2005-12-21 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2
3         * driver.cs: Report the case of no source files and no -out:
4         argument provided.
5
6 2005-12-20  Raja R Harinath  <rharinath@novell.com>
7
8         Fix #77035.
9         * expression.cs (ComposedCast.GetSignatureForError): Define.
10
11 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12
13         Fix #76995
14
15         * namespace.cs (NamespaceEntry): Add extern_aliases as a
16         ListDictionary, to contain the ExternAliasEntry entries (in
17         addition to the NamespaceEntry.aliases hashtable). This field is
18         shared between the original entry and its doppelganger (bodyless 
19         copy of it).
20         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
21         extern_aliases field.
22         (NamespaceEntry.Lookup): Move the IsImplicit check after the
23         lookup in extern_aliases.
24
25 2005-12-16  Raja R Harinath  <rharinath@novell.com>
26
27         Fix #77006.
28         * class.cs (TypeContainer.Mark_HasEquals): New.
29         (TypeContainer.Mark_HasGetHashCode): New.
30         (ClassPart): Override them.
31         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
32
33         Fix #77008.
34         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
35         'parent' argument to the base constructor.
36
37         Remove all mention of TypeContainer from decl.cs.
38         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
39         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
40         (DeclSpace.DeclSpace): Likewise.
41         (DeclSpace.DefineMembers): Remove unused argument.
42         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
43         debugging check -- we don't care if the debug code throws an
44         InvalidCastException instead of an InternalErrorException.
45         * class.cs (TypeContainer.DefineMembers): Update to changes.
46         (TypeContainer.DoDefineMembers): Likewise.
47         (TypeContainer.GetMethods): Likewise.
48         (PropertyMember.Define): Likewise.
49         (MemberBase.Parent): New property that forwards to
50         MemberCore.Parent, but ensures that we get a TypeContainer.
51         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
52         (RootContext.PopulateTypes): Likewise.  Remove special case code
53         for !RootContext.StdLib: DefineMembers is idempotent.
54
55 2005-12-14  Miguel de Icaza  <miguel@novell.com>
56
57         * convert.cs (ExplicitConversionCore): Check the return value from
58         ExplicitConversionCore which can return null on failure.  Fixes #76914
59
60 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
61
62         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
63
64 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
65
66         * doc.cs : The search for referenced namespace was insufficient to
67           get global one as it used to do. Fixed bug #76965.
68
69 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
70
71         * doc.cs : check name in cref in the last phase that whether it is
72           namespace or not.
73
74 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
75
76         * cs-tokenizer.cs : reverted the latest change: it somehow broke
77           Mono.C5.
78
79 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
80
81         * doc.cs : so it turned out that we cannot skip override check for 
82           interface members. Fixed bug #76954.
83
84 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
85
86         * cs-tokenizer.cs : fixed bug #75984:
87           - #warning and #error should not be handled when the source line
88             is disabled.
89           - #line is not checked strictly when the source line is disabled.
90           - #define and #undef is on the other hand checked strictly at any
91             state.
92
93 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
94
95         * cs-tokenizer.cs : missing Location (actually, filename) in one of
96           CS1027 report.
97
98 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
99
100         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
101
102         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
103         event initializers.
104         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
105         (FieldBase.Initializer): Initializer is now optional.
106         (EventField.Define): Only event field can have initializer.
107
108         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
109
110         * const.cs (Const): Reuse initializer.
111
112         * cs-parser.jay: Updated after FieldBase changes.
113         Added current_array_type to simplify array initializers.
114
115         * ecore.cs (NullCast.IsDefaultValue): Implemented.
116
117         * expression.cs, iterators.cs: Updated.
118
119         * namespace.cs (NamespaceEntry): Made UsingFound private.
120
121 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
122
123         * parameterCollection.cs: Obsolete, removed.
124         * parser.cs: Obsolete, removed.
125
126 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
127
128         Fix #76849.
129         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
130
131         * enum.cs (Enum.Define): Set obsolete context here.
132
133 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
134
135         * doc.cs :
136           - FindDocumentedMember() now expects 1) paramList as null
137             when "we don't have to check the number of parameters" and
138             2) Type.EmptyTypes when "there is no arguments".
139           - Introduced FoundMember struct to hold the exact type which was
140             used to find the documented member (the above change broke
141             test-xml-044; it might be better just to use DeclaringType than
142             what MS does, like this change does, but it depends on usage.)
143
144 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
145
146         * doc.cs : documented member might be from DeclaringType for nested
147           types. Fixed bug #76782.
148
149 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
150
151         * anonymous.cs: Have the param code handle leaving copies on the
152         stack etc. Allows anonymous params to take part in the assignment
153         code (++, +=, etc). Fixes bug #76550
154
155         * expression.cs: Handle the prepare_for_load/leave_copy by passing
156         it down to the anon code.
157
158         * iterators.cs: Use dummy var here
159
160         * codegen.cs: Handle new vars
161
162 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
163
164         Fix #76849.
165         * class.cs (MethodData.Define): Set proper Obsolete context.
166
167         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
168         obsolete context.
169         (FieldExpr.DoResolve): Ditto.
170
171 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
172
173         Fix #76849.
174         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
175         parent is not obsolete.
176
177 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
178
179         * doc.cs : (FindDocumentedMember) find parameterless members first
180           and get CS0419 in the early stage. Fixed first case of bug #76727.
181
182 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
183
184         Fix #76859.
185         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
186         no error was reported.
187
188         *expression.cs (Binary.DoResolve): left can be null.
189
190 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
191
192         Fix #76783.
193         * class.cs (MethodData.Emit): Parameters should be labeled first.
194
195 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
196
197         Fix #76761.
198         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
199
200 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
201
202         * attribute.cs (AreParametersCompliant): Moved to Parameter.
203
204         * class.cs (MethodCore): Parameter clean up.
205         (IMethodData): Added ParameterInfo.
206         (MethodData): Parameter clean up.
207         (Indexer.Define): Parameter clean up.
208
209         * anonymous.cs,
210         * codegen.cs,
211         * cs-parser.jay,
212         * decl.cs,
213         * doc.cs,
214         * ecore.cs,
215         * flowanalysis.cs,
216         * iterators.cs,
217         * pending.cs,
218         * statement.cs,
219         * typemanager.cs: Parameter clean up.
220
221         * delegate.cs (Define): Get rid of duplicated code.
222
223         * expression.cs (ParameterReference): Removed useless parameters
224         and simplified.
225         (Invocation): Ditto.
226
227         * parameter.cs (ParamsParameter): New class, params specialization.
228         (ArglistParameter): Attemp to separate arglist.
229         (Parameter): Refactored to be reusable and faster.
230         (Parameter.Modifier): Made understandable.
231         (Parameters): Changed to be used as a class for `this' assembly
232         parameters. Refactored to use new specialized classes.
233
234         * support.cs (ParameterData): Added Types property.
235         (InternalParameters): Deleted.
236
237 2005-08-20  Martin Baulig  <martin@ximian.com>
238
239         Merging this patch from GMCS to fix #75867.
240
241         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
242         scope if we don't already have it.
243
244 2005-11-17  Martin Baulig  <martin@ximian.com>
245
246         * anonymous.cs
247         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
248         inherit the scope from our parent.  Fixes #76653.
249
250 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
251
252         * doc.cs : the previous patch does not actually fix the bug.
253           PropertyInfo override check is now implemented and really fixed it.
254         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
255
256 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
257
258         * doc.cs : apply "override filter" also to properties.
259           Fixed bug #76730.
260
261 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
262
263         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
264           no need to check overrides. For classes, omit those results from 
265           interfaces since they must exist in the class. Fixed bug #76726.
266
267 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
268
269         * typemanager.cs : (GetFullNameSignature) differentiate indexers
270           with different parameters. Fixed the second problem in #76685.
271
272 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
273
274         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
275           get expected 'protected' access in CheckValidFamilyAccess()).
276           Fixed bug #76692.
277
278 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
279
280         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
281           Fixed bug #76705.  CS1569 was incorrectly commented out.
282
283 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
284
285         * doc.cs : use Invocation.IsOverride() to do real override check.
286         * expression.cs : made Invocation.IsOverride() internal.
287
288 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
289
290         * doc.cs : use TypeManager.FindMembers() instead of (possible)
291           TypeBuilder.FindMembers() and filter overriden base members out.
292           Fixed bug #76990.
293
294 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
295
296         * doc.cs : ref/out parameters are represented as '@' (instead of
297           '&' in type FullName). Fixed bug #76630 (additionally crefs).
298
299 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
300
301         * doc.cs : when there was no '.' in cref to methods in doc comment,
302           then parameters were missing in the output. Fixed bug #76691.
303
304 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
305
306         * driver.cs : don't output docs when there is an error.
307           Fixed bug #76693.
308
309 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
310
311         * doc.cs :
312           Now it should detect indexers. Fixed primary concern in bug #76685.
313           Fixed CS0419 message to not show the identical member signature in
314           the message.
315
316 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
317
318         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
319           instead of Type.FindMembers() since it does not handle events.
320           Fixed bug #71604.
321
322 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
323
324         * codegen.cs: Fixed typo (speficied -> specified).
325
326 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
327
328         Fix #76369.
329         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
330
331 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
332
333         * attribute.cs: Changed error message.
334
335         * cs-tokenizer.cs: One more check.
336
337 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
338
339         * statement.cs (Block.Resolve): Ignore empty statement.
340
341 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
342
343         * report.cs: Made error/warning methods more strict to avoid
344         their misuse.
345
346         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
347         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
348         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
349         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
350
351 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
352
353         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
354         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
355
356         * class.cs (TypeContainer.IsComImport): New property.
357         (Constructor.Define): Create proper ctor for ComImport types.
358
359         * expression.cs (New.CheckComImport): Fixed.
360
361 2005-11-07  Miguel de Icaza  <miguel@novell.com>
362
363         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
364         that a parameter has been captured does not mean that we do not
365         have to do the rest of the processing.  This fixes the second part
366         of #76592.  If there was another anonymous method capturing
367         values in the past, the Scope would never be set for the second
368         method that captured the same parameter.
369
370         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
371         properly manipulate the stack.   Second part of fix for #76592.
372
373         * expression.cs (New): Add support for invoking "new" on
374         interfaces that have been flagged with the ComImport attribute and
375         the CoClass.  Fixes #76637 
376
377         * statement.cs (Try.DoEmit): When a variable is captured, do not
378         try to emit the vi.LocalBuilder variable as it has been captured.
379         Create a temporary variable and store the results on the
380         FieldBuilder.  Fixes #76642
381
382 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
383
384         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
385
386         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
387
388         * expression.cs (Binary.DoResolve): Added && optimalization.
389     
390         * typemanager.cs (AddUserType): Removed useless argument.
391
392 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
393
394         * statement.cs (Block.variables): Uses ListDictionary.
395
396 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
397
398         Fix #75969.
399         * class.cs (PartialContainer.EmitType): Customized to emit
400         security attributes.
401         (ClassPart.ApplyAttributeBuilder): Transform security attribute
402         for partial classes.
403
404 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
405
406         Fix #76599.
407         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
408         access has to be fixed.
409         
410         * typemanager.cs (IsUnmanagedType): Wrong common field type.
411
412 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
413
414         Fix #76590.
415         * ecore.cs (NullCast.Reduce): Implemented.
416
417         * expression.cs (ArrayCreation.CheckIndices): Correcly check
418         constant type.
419         
420         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
421         properly.
422         (Foreach.Resolve): Catch null properly.
423
424 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
425  
426         * cs-tokenizer.cs: Warning text fix.
427
428         * driver.cs: AllWarningNumbers exposed on public interface.
429
430         * report.cs (): Reviewed warning numbers.
431         (IsValidWarning): Use binary search.
432
433 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
434  
435         * driver.cs: Implemeted resource visibility.
436         (Resources): New class for code sharing between /res: and
437         /linkres:
438  
439 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
440
441         Fix #76568.
442         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
443         folding.
444         
445         * convert (Convert.ImplicitReferenceConversion): NullCast holds
446         contants only.
447         
448         * ecore.cs (NullCast): Child is contant only.
449         
450         * literal.cs (NullLiteral.Reduce): null can be converted to any
451         reference type.
452
453 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
454
455         * driver.cs: Use Encoding.Default as default code page instead
456           of ISO-28591.
457
458 2005-10-27  Raja R Harinath  <rharinath@novell.com>
459
460         Fix #76085.
461         * expression.cs (Invocation.Error_InvalidArguments): Handle
462         __arglist parameters.
463         (Invocation.VerifyArgumentsCompat): Likewise.
464         * support.cs (ReflectionParameters.GetSignatureForError): Print
465         __arglist parameters.
466         (InternalParamters.GetSignatureForError): Likewise.
467         * parameter.cs (Parameters.GetSignatureForError): Likewise.
468
469 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
470
471         * attribute.cs (GetPropertyValue): Made public.
472
473         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
474         Resolve.
475         Add new property WrapNonExceptionThrows to handle 2.0 assembly
476         attribute.
477         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
478         is not defined.
479         
480         * driver.cs: Reflect method name change.
481         
482         * statement.cs (Try.Resolve): Warn when try has both general
483         exception handlers.
484         
485         * typemanager.cs: runtime_compatibility_attr_type new predefined
486         type.
487
488 2005-10-26  Raja R Harinath  <harinath@gmail.com>
489
490         Fix #76419.
491         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
492         treat it as an empty parameter list.
493
494 2005-10-26  Raja R Harinath  <rharinath@novell.com>
495
496         Fix #76271.     
497         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
498         ResolveAsTypeStep silent.
499         * statement.cs (Block.AddConstant): Mark block as used.
500         (Block.ResolveMeta): Avoid piling on error messages
501         if a constant initializer resolution fails.
502
503 2005-10-25  Raja R Harinath  <rharinath@novell.com>
504
505         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
506         Remove.
507         (NamespaceEntry.VerifyAllUsing): New.
508         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
509         behaviour.  Delegates actual resolution of alias to ...
510         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
511         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
512         Update.
513         * driver.cs (Driver.MainDriver): Update.
514         
515         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
516         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
517         property.
518         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
519         Remove.
520         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
521         RootNamespace.DefineNamespacesForAll.
522
523 2005-10-24  Raja R Harinath  <harinath@gmail.com>
524
525         * typemanager.cs (assemblies, external_aliases, modules)
526         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
527         (ComputeNamespaces, GetRootNamespace): Remove extra staging
528         overhead.  Move resposibility ...
529         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
530         * driver.cs, attribute.cs, codegen.cs: Update to changes.
531
532 2005-10-23  Raja R Harinath  <harinath@gmail.com>
533
534         * namespace.cs (RootNamespace.all_namespaces): Renamed from
535         cached_namespaces.  Improve usage.
536         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
537         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
538         Move from GlobalRootNamespace and simplify.
539         (RootNamespace.Global): Make instance variable.
540         (RootNamespace.RootNamespace): Add "alias name" parameter.
541         (GlobalRootNamespace): Simplify drastically.
542         (Namespace.Lookup): Don't use GetNamespace.
543         * typemanager.cs (GetRootNamespace): Rename from
544         ComputeNamespaceForAlias.
545         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
546
547 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
548
549         * anonymous.cs (AnonymousContainer): Don't crash when container
550         doesn't exist.
551
552 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
553
554         * expression.cs (Binary.DoResolve): Warn when comparing same
555         values.
556
557 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
558
559         Fix #76486.
560         * expression.cs (Binary.DoResolve): It looks like there are no
561         convetsion rules in enum context.
562
563 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
564
565         Add support for extern alias qualifiers.
566         * typemanager.cs: Move some LookupTypeReflection code
567         to namespace.cs, to have cleaner code. Added some methods
568         to help us keep track of the extern aliased references.
569         * driver.cs: Add suport for extern alias assemblies on command
570         line and check for their warnings/errors. Also keep track of the
571         extern aliased assemblies.
572         * namespace.cs: Move the global functionality of Namespace
573         to GlobalRootNamespace/RootNamespace. Now the global namespace
574         is GlobalRootNamespace.Globa. Also the code moved from 
575         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
576         Finally added LocalAliasEntry (AliasEntry before) and
577         ExternAliasEntry, to handle alias statements.
578         * cs-parser.jay: Add support in the grammar for extern alias
579         statement.
580         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
581         Update callings to Namespace (now in GlobalRootNamespace).
582
583 2005-10-18  Raja R Harinath  <rharinath@novell.com>
584
585         Fix #76371.
586         * class.cs (TypeContainer.DefineType): Move updating of
587         topological sort earlier in the code.
588         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
589
590 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
591
592         Fix #76273.
593         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
594         
595         * constant.cs (Constant.TryReduce): Moved from Cast class.
596         (Reduce): Made little bit more OO and fixed missing conversions.
597         
598         * ecore.cs (Reduce): Implemented.
599         (Binary.EnumLiftUp): New method to upgrade values to enum values.
600         
601         * literal.cs (Reduce): Implemented.
602         
603         * class.cs: Reverted Miguel's wrong commit.
604
605 2005-10-14  Miguel de Icaza  <miguel@novell.com>
606
607         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
608
609 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
610
611         * cs-parser.jay, expression.cs : CS0214 was missing error location
612           for constants. Fixed bug #76404.
613
614 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
615
616         Fix #76370.
617         * convert.cs (ExplicitConversionCore): Fixed object->enum
618         conversion.
619
620 2005-10-10  Raja R Harinath  <rharinath@novell.com>
621
622         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
623         InstanceExpression.
624         (PropertyExpr.EmitCall): Likewise.
625         * expression.cs (Invocation.EmitArguments): Handle case where
626         arguments == null.
627         (Invocation.EmitCall): Avoid allocating temporary variable if
628         there are no arguments.
629
630 2005-10-07  Raja R Harinath  <rharinath@novell.com>
631
632         Fix #76323.
633         * convert.cs (ImplicitConversionStandard): Move conversion of
634         void* to arbitrary pointer types ...
635         (ExplicitConversionStandard): .. here.
636         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
637         error to always print typenames.
638
639 2005-10-07  Raja R Harinath  <rharinath@novell.com>
640
641         * convert.cs (GetConversionOperator): Rename from
642         GetConversionOperators.  Move operator selection code from ...
643         (UserDefinedConversion): ... here.
644
645 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
646
647         * convert.cs (ExplicitConversionCore): Removed duplicate enum
648         conversion.
649
650 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
651
652         * assign.cs (Assign.DoResolve): Error method changed.
653
654         * cfold.cs (DoConstantNumericPromotions): Error method changed.
655         
656         * const.cs (ResolveValue): Reset in_transit immediately.
657         
658         * constant.cs: Error method changed.
659         
660         * convert.cs: Removed useless location parameter.
661         (ExplicitNumericConversion): Don't do double enum check.
662         (ExplicitConversionCore): Renamed from ExplicitConversion.
663         (ExplicitUnsafe): Extracted from ExplicitConversion.
664         (ExplicitConversion): Uses for error reporting.
665         
666         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
667         error messages.
668         (ResolveBoolean): Uses common error method.
669         (CastToDecimal): Get rid of ec.
670         (CastFromDecimal): Optimized.
671         (ConvCast): Get rid of ec.
672         
673         * enum.cs (ResolveValue): Reset in_transit immediately.
674         (Emit): Return after first error.
675         
676         * expression.cs: Convert changes.
677         
678         * literal.cs: Error method changed.
679         
680         * statement.cs: Error method changed.
681
682 2005-10-03  Raja R Harinath  <rharinath@novell.com>
683
684         * support.cs (SeekableStreamReader.Position): Don't error out when
685         the requested position is just beyond the end of the current
686         buffered data.
687
688 2005-09-28  Raja R Harinath  <rharinath@novell.com>
689
690         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
691         try to keep in sync with the byte count of the underlying Stream.
692         However, this limits us to a window size of 2048 characters: i.e.,
693         the maximum lookahead of our lexer/parser can be 2048 characters.
694
695 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
696
697         Fix #76255.
698         * driver.cs: Fix compilation files with full root path.
699
700 2005-09-25  Miguel de Icaza  <miguel@novell.com>
701
702         * report.cs (SymbolRelatedToPreviousError): Format the output so
703         it does not use an open parenthesis that is never closed. 
704
705         * driver.cs: Follow coding guidelines
706
707 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
708
709         Fix #72930.
710         * const.cs (Const.ResolveValue): Check for assigning non-null
711         value to reference type.
712
713 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
714
715         * anonymous.cs: Implemented ExprClassName.
716         
717         * assign.cs (Assign.DoResolve): Don't chrash when type is not
718         delegate.
719         
720         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
721         check.
722         
723         * class.cs (StaticClass.DefineContainerMembers): Report protected
724         members as error.
725         
726         * codegen.cs: if(ed) PRODUCTION.
727         
728         * convert.cs (Error_CannotImplicitConversion): Better error
729         distinction.
730         
731         * cs-parser.jay: More error checks.
732         
733         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
734         
735         * driver.cs (CSCParseOption): Enabled wrong option check.
736         
737         * ecore.cs (Expression.ExprClassName): Turned to property.
738         (MemberExpr.CheckIntermediateModification): For checking boxed
739         value types     modification.
740         
741         * statement.cs (Fixed.Resolve): Expression type must be
742         convertible to fixed type.
743         (CollectionForeach.GetEnumeratorFilter,TryType):
744         Small refactoring for easier error checking.
745
746 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
747
748         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
749         attributes.
750         
751         * class.cs (GeneratedBaseInitializer): New class for customization
752         compiler generated initializers.
753         (MemberBase.DoDefine): Check Obsolete attribute here.
754         (FieldMember.DoDefine): Ditto.
755         
756         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
757         constants.
758         
759         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
760         (MemberCore.GetObsoleteAttribute): Removed argument.
761         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
762         (MemberCore.CheckObsoleteType): New helper.
763         
764         * delegate.cs,
765         * enum.cs,
766         * statement.cs: Updates after MemberCore changes.
767         
768         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
769         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
770         
771         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
772         obsolete attribute for compiler construct.
773         (As.DoResolve): Cache result.
774         
775         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
776
777 2005-09-26  Raja R Harinath  <rharinath@novell.com>
778
779         Fix #76133.
780         * expression.cs (This.VerifyFixed): In a value type T, the type of
781         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
782         value type R, 'this' is treated as a value parameter.
783
784 2005-09-22  Miguel de Icaza  <miguel@novell.com>
785
786         * statement.cs (Lock): Use the TemporaryVariable class instead of
787         manually using local variables as those do not work when variables
788         are captured.
789
790         * ecore.cs: Moved the TemporaryVariable class from being a nested
791         class inside Foreach to be a public class that can be employed in
792         other places. 
793
794 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
795
796         * cs-parser.jay: interface_accessors replaced by
797         accessor_declarations.
798
799         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
800         location.
801         
802         * statement.cs (GotoCase.Resolve): Convert null constant to
803         null case.
804         (SwitchLabel.ResolveAndReduce): Ditto.
805         (SwitchLabel.NullStringCase): Custom null stamp.
806         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
807         
808         typemanager.cs (CSharpSignature): Don't skip first argument
809         for full names.
810
811 2005-09-18  Miguel de Icaza  <miguel@novell.com>
812
813         * driver.cs: Set InEmacs based on the environment variable EMACS. 
814
815         * location.cs (InEmacs): in this mode, do not report column
816         location as it confuses Emacs.
817
818 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
819
820         * cfold.cs, constant.cs, convert.cs, ecore.cs,
821         expression.cs, iterators.cs, literal.cs: Store constants and
822         literals location.
823         
824         * class.cs (MemberBase.ShortName): Pass location.
825         
826         * cs-parser.jay: Some location fixes.
827         
828         * ecore.cs (Expression.Location): Made virtual.
829
830 2005-09-05  Miguel de Icaza  <miguel@novell.com>
831
832         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
833         if the underlying types are the same, otherwise we need to produce
834         code that will do the proper cast.
835
836         This was exposed by Marek's constant rewrite which produced
837         invalid code for the call site:
838
839         enum X : long { a }
840         void Method (X v) {}
841
842         Method ((X) 5)
843
844         This fixes test-49.cs
845
846 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
847
848         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
849           Type/Object should be allowed as well. Fixed bug #75968.
850
851 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
852
853         * expression.cs : (Binary.DoResolve): when one is enum constant and
854           another is constant 0, then return enum one *as enum type*.
855           Fixed bug 74846.
856
857 2005-09-02  Raja R Harinath  <rharinath@novell.com>
858
859         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
860         internal.
861
862         Fix #75941.
863         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
864         flow-branching for LocalVariableReferences in case we were invoked
865         from a MemberAccess.
866         * expression.cs (LocalVariableReference.VerifyAssigned): New.
867         Carved out of ...
868         (LocalVariableReference.DoResolveBase): ... this.
869         (MemberAccess.Resolve): Do the check that was disabled during
870         SimpleNameResolve.
871
872 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
873
874         * class.cs :
875           (PartialContainer.Create): check abstract/sealed/static strictly
876           but abstract/sealed can exist only at one side. Fixed bug #75883.
877
878 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
879
880         Fix #75945.
881         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
882         specified, don't default to UnmanagedType.I4.
883
884 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
885
886         * expression.cs : conditional operator should check possibly
887           incorrect assign expression. Fixed bug #75946.
888
889 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
890
891         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
892           Reverting the change. gmcs is much complex than mcs on this matter.
893
894 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
895
896         * cs-tokenizer.cs : To read another token ahead of the actual 
897           consumption, use new SavedToken and cache token instead of moving
898           back the stream with SeekableStreamReader (it seemed problematic).
899         * cs-parser.jay,
900           driver.cs : Thus use StreamReader directly.
901         * support.cs : Thus removed SeekableStreamReader.
902
903 2005-08-30  Raja R Harinath  <rharinath@novell.com>
904
905         Fix #75934.
906         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
907         (ScopeInfo.EmitScopeType): Use it to construct field names from
908         names of captured locals.
909
910         Fix #75929.
911         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
912         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
913         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
914         (ExplicitConversion): Remove enum cases already handled by
915         implicit conversion.  Move implicit conversion check to the beginning.
916         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
917         * expression.cs (ArrayCreation.EmitDynamicInitializers):
918         Don't treat System.Enum as a struct.
919
920 2005-08-30  Jb Evain  <jbevain@gmail.com>
921
922         * attribute.cs: handles as expression in parameters.
923
924 2005-08-30  Raja R Harinath  <rharinath@novell.com>
925
926         Fix #75802.
927         * class.cs (TypeContainer.VerifyClsName): Don't use a
928         PartialContainer when verifying CLS compliance.
929         (AbstractPropertyEventMethod): Set Parent here, ...
930         (PropertyMethod): ... not here.
931
932 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
933
934         * attribute.cs : escaped attribute name should not be allowed to be
935           resolved (e.g. @class as classAttribute). Fixed bug #75930.
936
937 2005-08-29  Raja R Harinath  <rharinath@novell.com>
938
939         Fix #75927.
940         * convert.cs (ImplicitStandardConversionExists): Allow zero also
941         when converting a long constant to unsigned long.
942         * expression.cs (Invocation.OverloadResolve): Add sanity check to
943         detect where IsApplicable and VerifyArgumentsCompat disagree.
944
945 2005-08-29  Raja R Harinath  <rharinath@novell.com>
946         and Carlos Alberto Cortez  <carlos@unixmexico.org>
947
948         Fix #75848.
949         * class.cs (TypeContainer.CanElideInitializer): New helper.
950         (TypeContainer.EmitFieldInitializers): Use it to determine if we
951         can safely emitting the initializer of a field.
952
953 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
954
955         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
956           allowed inside a switch (without loop). Fixed bug #75433.
957
958 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
959
960         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
961         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
962
963 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
964
965         * driver.cs : kinda reverting the default encoding changes (not exact 
966           revert since I noticed that "codepage:reset" might not work fine).
967
968 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
969
970         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
971           Location. Now getter and setter store location correctly.
972           (errors/cs0111-12.cs now reports the expected location.)
973
974 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
975
976         * driver.cs : Use default encoding on the environment.
977           Removed (now that) extra parameter for SeekableStreamReader.
978         * support.cs : (SeekableStreamReader) third .ctor() argument for
979           StreamReader is not required (always true). preamble size could
980           be acquired in simpler and safe way.
981
982 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
983
984         * cs-parser.jay: report CS0642 at warning level 3
985           and report CS0642 for an if else statement also
986           fixes bug #74745. Patch by John Luke (and a bit
987           modified by me).
988           Removed extra CS0642 warning check for "while",
989           "for" and "fixed".
990         * statement.cs: In Block.Resolve(), CS0642 check
991           is reimplemented to check a sequence of an empty
992           statement and a block.
993
994           Both fix bug #66777.
995
996 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
997
998         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
999         detection until I fix it.
1000         
1001         * cs-tokenizer.cs: Changed error message.
1002         
1003         * cs-parser.jay: Fixed 2 error locations.
1004         
1005         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1006         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1007         properties.
1008         
1009         * enum.cs (GetSignatureForError): Fixed.
1010         
1011         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1012         method detection.
1013         
1014         * class.cs,
1015         * typemanager.cs (RegisterProperty): Removed.
1016         
1017         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1018
1019 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1020
1021         Fix #75874.
1022         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1023         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1024
1025 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1026
1027         * expression.cs : tiny fix is required for not warning positive ulong.
1028           See test-441.cs.
1029
1030 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1031
1032         * expression.cs : add CS0652 check for constant and integral
1033           expression. Fixed bug #53974.
1034
1035 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1036
1037         * expression.cs : in DoNumericPromotions(), check if there is implicit
1038           conversion overload for string (to check CS0034). Fixed bug #52492.
1039
1040 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1041
1042         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1043
1044 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1045
1046         * ecore.cs : report location when it is *not* Null.
1047
1048 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1049
1050         * codegen.cs,
1051           ecore.cs,
1052           flowanalysis.cs,
1053           expression.cs:
1054           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1055           correctly. Fixed bug #75721.
1056
1057 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1058
1059         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1060         loop that performs 'min (pos, char_count)'.
1061
1062         Fix #75862.
1063         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1064         converted value in Operator.OnesComplement.
1065
1066 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1067
1068         * anonymous.cs: If the anon method is pulled into a helper class,
1069         it needs to be `internal' not `private'. Fixes runtime behavior on
1070         msft. bug #75704
1071
1072 2005-08-20  Martin Baulig  <martin@ximian.com>
1073
1074         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1075         scope if we don't already have it.
1076
1077         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1078         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1079         fixes #75867.
1080
1081 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1082
1083         Fix #75803
1084         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1085         is a partial class.
1086
1087 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1088
1089         The big constants rewrite
1090         Fix #75746, #75685 and more
1091         As a side effect saved 1MB for MWF ;-)
1092         
1093         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1094         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1095         enum based for corlib compilation.
1096         
1097         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1098         subtractions.
1099         
1100         * class.cs (FixedField.Define): Use ResolveAsConstant.
1101         
1102         * const.cs (IConstant): Interface constants and enums.
1103         (Const.ResolveValue): New method for constant resolvning.
1104         (ExternalConstant): Constants from imported assemblies.
1105         
1106         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1107         conversion; like enums.
1108         (Constant.ToType): Converts this constant to different type.
1109         (Constant.Increment): Adds 1.
1110         
1111         * convert.cs (ImplicitConversionRequired): Simplified.
1112         
1113         * cs-parser.jay: Create EnumMember directly.
1114         
1115         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1116         
1117         * doc.cs (GenerateEnumDocComment): Removed.
1118         
1119         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1120         (ConvertIntLiteral): Removed.
1121         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1122         
1123         * enum.cs (EnumMember): Implement IConstant.
1124         (Enum.IsValidEnumConstant): Removed.
1125         (Enum.GetNextDefaultValue): Removed.
1126         (Enum.FindMembers): Updated.
1127         (Enum.GenerateDocComment): Iterate enum members.
1128         
1129         * expression.cs (Cast.TryReduce): Handle enums correctly.
1130         (New.Constantify): Made public.
1131         (MemberAccess.DoResolve): Removed contant specific if(s).
1132         
1133         * literal.cs (NullLiteral): Implement new abstract methods.
1134         
1135         * statement.cs (GotoCase.Resolve): Use new constant methods.
1136         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1137         
1138         * typemanager.cs (LookupEnum): Removed.
1139         (IsEnumType): Fixed to work with corlib.
1140         (RegisterConstant): Removed.
1141         (LookupConstant): Removed.
1142         (GetConstant): Changed to work with IConstant.
1143
1144 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1145
1146         * location.cs : Fixed overflown (>255) column number.
1147
1148 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1149
1150         First cut of the qualified-alias-member feature.
1151         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1152         token.
1153         * cs-parser.jay (DOUBLE_COLON): New token.
1154         (namespace_or_type_name): Add rule for recognizing
1155         qualified-alias-members.
1156         (primary_expression): Likewise.
1157         (element_access): Allow QualifiedAliasMember as a possible
1158         type-bearing expression.
1159         (local_variable_type, local_variable_pointer_type): Likewise.
1160         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1161         aliases in the current and enclosing namespace declarations.
1162         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1163         * decl.cs (MemberName.is_double_colon): New.
1164         (MemberName.MemberName): Add new constructor for alias-member.
1165         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1166         * expression.cs (QualifiedAliasMember): New expression type.
1167
1168 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1169
1170         * location.cs : it borked when no argument was specified.
1171
1172 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1173
1174         * location.cs : tiny ToString() format fix.
1175
1176 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1177
1178         * statement.cs : oops, it was missing.
1179
1180 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1181
1182         A set of fixes for precise line/column location.
1183
1184         * location.cs :
1185           "token" field now holds a file/line "delta", a line number offset 
1186           from the segment, and a column number. See also:
1187           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1188           December/009508.html
1189           Removed static IsNull. Use instance IsNull property instead.
1190         * cs-tokenizer.cs :
1191           For some tokens it stores Location. For Identifier it stores
1192           LocatedToken which is a pair of string name and location.
1193           Column numbers are adjusted only at getChar().
1194         * report.cs :
1195           Use Location.ToString() for reporting (it now contains column).
1196         * cs-parser.jay :
1197           Largely modified to use LocatedToken instead of
1198           string (IDENTIFIER), and to acquire Location from some tokens.
1199         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1200           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1201           codegen.cs :
1202           Now MemberName holds Location. DeclSpace.ctor() receives Location
1203           as a parameter. Removed extra parameters to all derived classes.
1204           Replaced Location.IsNull() with instance property.
1205         * assign.cs, expression.cs :
1206           Added .ctor() overload that omits Location.
1207         * attribute.cs :
1208           Added "nameEscaped" flag that indicates the identifier was escaped
1209           in the source file. This fixes bug #57047.
1210
1211 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1212
1213         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1214         New method, looking for lo-case imported cls type.
1215
1216         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1217         here.
1218
1219         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1220
1221         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1222
1223         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1224         all_imported_types.
1225         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1226
1227         Optimized to save 3.5 MB for SWF compilation.
1228
1229 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1230
1231         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1232         (PartialContainer.Create): Moved logic AddToContainer.
1233         (PartialContainer.MarkForDuplicationCheck): Shares name.
1234         
1235         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1236         place.
1237         
1238         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1239         initialization.
1240         (Namespace.GetSignatureForError): New method.
1241         
1242         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1243         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1244
1245 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1246
1247         Fix #75669.
1248         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1249         member lookup rather than qualifier_type, since qualifier_type can
1250         be null.
1251
1252 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1253
1254         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1255         enum member.
1256
1257 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1258
1259         * statement.cs: Copy the local exception into the exception
1260         captured local.  Fixes 75674
1261
1262 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1263
1264         Fix #75658.
1265         * expression.cs (Invocation.OverloadResolve): Don't report error
1266         CS1501 if error CS1502 has been reported.
1267         (New.DoResolve): Delegate CS1501 reporting to
1268         Invocation.OverloadResolve.
1269
1270         Fix #75656.
1271         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1272         invariant-meaning-in-block property in an enclosing block if
1273         necessary.
1274
1275 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1276
1277         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1278         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1279         (Switch.CheckSwitch): Just save 50kb for SWF.
1280
1281 2005-07-27  Martin Baulig  <martin@ximian.com>
1282
1283         * anonymous.cs (CaptureContext.AddField): Added
1284         `AnonymousContainer am' argument; compute its toplevel scope if
1285         it's not already computed.  Fixes #75649.
1286
1287 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1288
1289         Fix #75628.
1290         * class.cs (Constructor.Emit): Reset block to null if the block
1291         resolve fails.
1292
1293 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1294
1295         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1296
1297 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1298
1299         * class.cs (MethodData.Define): Check whether accessor implementing
1300         interface is public.
1301
1302         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1303
1304 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1305
1306         Fix #57245
1307         * namespace.cs (LookupType): Moved same type check to...
1308         
1309         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1310         with the same name.
1311
1312 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1313
1314         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1315         already found a typebuilder.
1316         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1317         MemberNames, not strings.
1318
1319         * const.cs (Error_ExpressionMustBeConst): 
1320         Rename from Error_EpressionMustBeConst.
1321         * const.cs, class.cs, statement.cd: Update.
1322
1323 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1324
1325         Fix #65573
1326
1327         * const.cs (Const.LookupConstantValue): Report missing contant expression
1328         everytime.
1329         (Error_EpressionMustBeConstant): Only one error method.
1330
1331         * class.cs, statement.c: Updated.
1332
1333 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1334
1335         * statement.cs (Block.Flags): Add back HasVarargs.
1336         (Block.flags): Make protected.
1337         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1338
1339         * typemanager.cs (types, typecontainers, user_types): Remove.
1340         (UserTypes, TypeContainers): Likewise.
1341         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1342         (CleanUp, Reset): Update.
1343         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1344         (GetNestedType): Use Type.GetNestedType.
1345         (CoreLookupType): Take two arguments, the namespace and the
1346         basename of the type.  Update to use the Namespace.Lookup
1347         mechanism.
1348         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1349         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1350         string concatenation and substring matches.
1351         * class.cs, enum.cs, delegate.cs: Update to changes.
1352
1353 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1354
1355         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1356         Expression and made virtual.
1357
1358         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1359         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1360
1361         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1362
1363         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1364         error message.
1365
1366         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1367         change.
1368
1369 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1370
1371         Fix #57707
1372         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1373         AssemblyCultureAttribute is not used on executable.
1374
1375         * rootcontext.cs,
1376         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1377
1378 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1379
1380         Fix #60638.
1381         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1382         New.  Reports CS0252/CS0253.
1383         Mostly taken from preliminary patch by Duncak Mak.
1384         (Binary.DoResolveOperator): Store results of operator lookup.
1385         Use them to detect if we need to warn about unintended reference
1386         comparisons.
1387
1388 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1389
1390         Fix #72969.
1391         * namespace.cs (Namespace.Lookup): Add back location parameter.
1392         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1393         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1394
1395         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1396         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1397         (Namespace.LookupType): ... this.
1398         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1399         of namespaces.
1400         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1401         purported to handle pointers.
1402         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1403         CoreLookupType.
1404
1405 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1406
1407         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1408         type as namespace.
1409
1410 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1411
1412         * namespace.cs (Namespace.Lookup): Drop location parameter.
1413         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1414         (NamespaceEntry.Lookup): ... this.
1415         (NamespaceEntry.Error_AmbiguousTypeReference):
1416         Move here from DeclSpace.
1417         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1418         names ...
1419         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1420         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1421         Move to NamespaceEntry.
1422         * delegate.cs, expression.cs: Update to changes.
1423
1424 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1425
1426         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1427         CheckAttributeType and refactored.
1428         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1429         ResolveAsTypeTerminal error handling.
1430         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1431         handling.
1432         (GetSignatureForError): Print errors in same way.
1433
1434         * class.cs,
1435         * codegen.cs: Reflect attribute GetSignatureForError change.
1436
1437         * ecore.cs,
1438         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1439
1440         * namespace.cs (UsingEntry): Refactored to make fields private.
1441
1442         * assign.cs,
1443         statement.cs: Error_UnexpectedKind has extra parameter.
1444
1445 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1446
1447         * ecore.cs (IAlias): Remove.
1448         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1449         that implement the interface.
1450         * namespace.cs (Namespace): Likewise.
1451         (Namespace.declspaces): Renamed from 'defined_names'.
1452         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1453         DeclSpace instead of an IAlias.
1454         * tree.cs (Tree.AddDecl): Update.
1455
1456 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1457
1458         * statement.cs (Block.Flags); Remove HasVarargs.
1459         (Block.HasVarargs): Move to ToplevelBlock.
1460         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1461         (Block.Variables): Make protected.  Initialize variable hashtable
1462         if necessary.
1463         (Block.AddVariable): Update.
1464         (Block.Resolve): Update to changes.
1465         (ToplevelBlock.HasVarargs): New boolean.
1466         (ToplevelBlock.ThisVariable): Move here from Block.
1467         (ToplevelBlock.AddThisVariable): Likewise.
1468         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1469         * expression.cs (This.ResolveBase): Update to changes.
1470         (ArglistAccess.DoResolve): Likewise.
1471
1472 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1473
1474         Fix #75321
1475         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1476
1477         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1478         not used and not used & assigned.
1479         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1480
1481 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1482
1483         Fix #75053
1484         * expression.cs (Is.DoResolve): null is never provided type.
1485
1486 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1487
1488         Fix #52496
1489         * cs-parser.jay: Less strict event error rule to catch more errors.
1490
1491 2005-07-08  Martin Baulig  <martin@ximian.com>
1492
1493         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1494         gettter (allowed) or setter (not allowed).
1495
1496         * class.cs (Accessor): Implement IIteratorContainer.
1497         (Accessor.Yields): New public field.
1498         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1499         per-accessor basis.
1500
1501         * cs-parser.jay
1502         (get_accessor_declaration, set_accessor_declaration): Set the
1503         `yields' flag on the accessor, not the property.
1504         (property_declaration): Do the iterators check on a per-accessor
1505         basis and not for the whole property.
1506
1507 2005-07-08  Martin Baulig  <martin@ximian.com>
1508
1509         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1510         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1511
1512 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1513
1514         Fix #74975
1515         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1516         (ExtractSecurityPermissionSet): Cope with self referencing security
1517         attributes properly.
1518
1519         * driver.cs (SetOutputFile): Made public property OutputFile.
1520
1521 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1522
1523         Fix #75486.
1524         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1525         has_nonstatic_fields.  Make into a FieldBase pointer.
1526         (TypeContainer.AddField): Add CS0282 check.
1527         (TypeContainer.EmitType): Update.
1528
1529 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1530
1531         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1532         compare if they start with __.
1533
1534 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1535
1536         * statement.cs (Switch.SwitchGoverningType): Only look at
1537         UserCasts that don't need implicit standard conversions to one of
1538         the allowed switch types (Fixes test-322.cs).
1539         (LocalInfo.Resolve): Re-enable sanity-test.
1540
1541 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1542
1543         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1544         
1545         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1546         
1547         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1548
1549 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1550
1551         Fix #75472.
1552         * ecore.cs (SimpleName.GetSignatureForError): Add.
1553         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1554         (MemberAccess.GetSignatureForError): Add.
1555
1556 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1557  
1558         The big error and warning messages review.
1559         
1560         * anonymous.cs,
1561         * assign.cs,
1562         * attribute.cs,
1563         * class.cs,
1564         * codegen.cs,
1565         * convert.cs,
1566         * cs-parser.jay,
1567         * cs-tokenizer.cs,
1568         * decl.cs,
1569         * delegate.cs,
1570         * doc.cs,
1571         * driver.cs,
1572         * ecore.cs,
1573         * enum.cs,
1574         * expression.cs,
1575         * flowanalysis.cs,
1576         * iterators.cs,
1577         * literal.cs,
1578         * location.cs,
1579         * modifiers.cs,
1580         * namespace.cs,
1581         * parameter.cs,
1582         * pending.cs,
1583         * report.cs,
1584         * rootcontext.cs,
1585         * statement.cs,
1586         * support.cs,
1587         * tree.cs,
1588         * typemanager.cs: Updated.
1589         
1590         * class.cs: (MethodCore.SetYields): Moved here to share.
1591         (PropertyMethod.Define): Moved iterator setup here.
1592         
1593         * iterators.cs: Add orig_method to have full access to parent
1594         container.
1595
1596 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1597
1598         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1599         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1600         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1601         variable of struct type.
1602         * expression.cs (Unary.ResolveOperator): Update to change.
1603         (Indirection.VerifyFixed): Likewise.
1604         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1605         (ParameterReference.VerifyFixed): Value parameters are fixed.
1606         (This.VerifyFixed): Treat 'this' as a value parameter.
1607         * statement.cs (LocalInfo.IsFixed): Remove.
1608
1609 2005-07-01  Martin Baulig  <martin@ximian.com>
1610
1611         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1612         `ec.EmitThis ()' to get the correct scope.
1613
1614 2005-07-01  Martin Baulig  <martin@ximian.com>
1615
1616         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1617         instance is a ParameterReference; fixes #75299.
1618
1619 2005-07-01  Martin Baulig  <martin@ximian.com>
1620
1621         Reverted Marek's latest patch (r46725):
1622         - it contains structural changes which are neither mentioned in
1623           the ChangeLog nor explained anywhere; for example the additional
1624           argument of EmitContext's and Iterator's .ctor's and the
1625           TypeContainer.DefineMembers() change.
1626         - structural changes like this should go in in seperate patches
1627           and not be hidden in a huge patch which just seems to affect
1628           warnings and errors.
1629           a big and hard to understand patch.
1630         - it breaks iterators and causes regressions, for instance in
1631           test-iter-03.cs.      
1632
1633 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1634
1635         Fix #75412.
1636         * expression.cs (Indexers.map): Remove.
1637         (Indexers.Append): Filter out inaccessible setters and getters.
1638         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1639
1640         Fix #75283.
1641         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1642         Refactored from ...
1643         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1644         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1645         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1646         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1647
1648 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1649
1650         Fix #75322
1651         * class.cs (FieldBase.GetInitializerExpression): One more field
1652         for backup.
1653
1654 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1655
1656         * pending.cs: Do not define a proxy if the base method is virtual,
1657         it will be picked up by the runtime (bug 75270).
1658
1659 2005-06-08  Martin Baulig  <martin@ximian.com>
1660
1661         The big Iterators rewrite :-)
1662
1663         * iterators.cs: Rewrite this to use the anonymous methods framework.
1664
1665         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1666         before the TypeContainers; see 2test-21.cs.
1667
1668         * class.cs
1669         (TypeContainer.DefineType): Don't create a new EmitContext if we
1670         already have one (this only happens if we're an Iterator).
1671         (TypeContainer.Define): Also call Define() on all our iterators.
1672         (Method.CreateEmitContext): Added support for iterators.
1673
1674         * anonymous.cs
1675         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1676         (AnonymousContainer.CreateMethodHost): Moved here from
1677         AnonymousMethod and made abstract.
1678         (AnonymousContainer.CreateScopeType): New abstract method.
1679         (AnonymousContainer.IsIterator): New public property.
1680         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1681         get the ScopeTypeBuilder rather than manually defining it here. 
1682         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1683         iterators here.
1684
1685         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1686         before RootContext.DefineTypes().
1687
1688         * codegen.cs (EmitContext.RemapToProxy): Removed.
1689         (EmitContext.CurrentAnonymousMethod): Changed type from
1690         AnonymousMethod -> AnonymousContainer.
1691         (EmitContext.ResolveTopBlock): Protect from being called twice.
1692         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1693         (EmitContext.EmitThis): Removed the iterators hacks; use the
1694         anonymous methods framework for that.
1695
1696         * statement.cs
1697         (ToplevelBlock.Container): Make this a property, not a field.
1698         (ToplevelBlock.ReParent): New public method; move the
1699         ToplevelBlock into a new container.
1700         (Foreach.TemporaryVariable): Simplify.
1701
1702 2005-06-05  Martin Baulig  <martin@ximian.com>
1703
1704         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1705         (Block.AddTemporaryVariable): New public method; creates a new
1706         `LocalInfo' for a temporary variable.
1707         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1708         variables here.
1709         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1710         non-iterator variables.
1711
1712 2005-06-05  Martin Baulig  <martin@ximian.com>
1713
1714         * statement.cs (Foreach.TemporaryVariable): Create the
1715         LocalBuilder in the Emit phase and not in Resolve since in some
1716         situations, we don't have an ILGenerator during Resolve; see
1717         2test-19.cs for an example.
1718
1719 2005-06-04  Martin Baulig  <martin@ximian.com>
1720
1721         **** Merged r45395 from GCS ****
1722
1723         The big Foreach rewrite - Part II.
1724
1725         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1726         with `PropertyInfo ienumerator_getcurrent'.
1727
1728         * codegen.cs (VariableStorage): Removed.
1729
1730         * statement.cs
1731         (Foreach): Derive from Statement, not ExceptionStatement.
1732         (Foreach.CollectionForeach): New nested class.  Moved all the code
1733         dealing with collection foreach here.
1734         (Foreach.ForeachHelperMethods): Removed.
1735         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1736
1737 2005-05-23  Martin Baulig  <martin@ximian.com>
1738
1739         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1740         don't need to.  Fix #75014.
1741
1742 2005-05-20  Martin Baulig  <martin@ximian.com>
1743
1744         Merged r44808 from GMCS.
1745
1746         * class.cs (TypeContainer.CircularDepException): Removed.
1747         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1748         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1749         (CS0146) and interface (CS0529) dependencies here.
1750
1751 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1752
1753         * expression.cs (Invocation.EmitCall): Fix initialization
1754         'this_call' to reflect current behaviour.  Fix indentation.
1755
1756         * convert.cs (FindMostEncompassedType): Add two trivial special
1757         cases (number_of_types == 0 || number_of_types == 1).
1758         (FindMostEncompasingType): Likewise.
1759
1760 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1761
1762         Some cleanups preparing for the fix of #75283.
1763         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1764         error testing.
1765         (EventExpr.InstanceResolve): Likewise.
1766         (EventExpr.DoResolve): Remove redundant checks.
1767
1768 2005-06-10  Duncan Mak  <duncan@novell.com>
1769
1770         * cs-tokenizer.cs (process_directives): New flag for controlling
1771         the processing of preprocessor directives.
1772         (x_token): After seeing a '#', return Token.NONE instead of going
1773         to handle_preprocessing_directive() when not processing
1774         directives. This avoids unnecessary processing during the token peek in
1775         is_punct().
1776
1777         This fixes #74939.
1778
1779         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1780         the existing error reporting methods instead of Report.Error.
1781
1782         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1783         after Raja's rewrite.
1784
1785 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1786
1787         * class.cs: Small fix.
1788
1789 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1790
1791         Fix #75160.
1792         * class.cs (GetPartialBases): Fix return value check of
1793         part.GetClassBases.
1794
1795 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1796
1797         Ensure that partial classes are registered in their enclosing
1798         namespace.  Initial part of fix of #75160.
1799         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1800         Register declspace with namespace here, not in
1801         DeclSpace.RecordDecl.
1802         * cs-parser.jay: Pass namespace to RecordDecl.
1803         * class.cs (PartialContainer.Create): Likewise.
1804         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1805         called.
1806         * decl.cs (Declspace.RecordDecl): Remove.
1807         * namespace.cs (NamespaceEntry.DefineName): Remove.
1808
1809 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1810
1811         * rootcontext.cs: Reset TargetExt as well.
1812
1813 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1814
1815         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1816         -langversion:ISO-1.
1817
1818 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1819
1820         Fix #75080, cs0119.cs.
1821         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1822         of ...
1823         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1824         allowing ExprClass.Type and ExprClass.Namespace for
1825         ResolveFlags.VariableOrValue.
1826         (Expression.Resolve) [1-argument variant]: Change default resolve
1827         flags based on language version.
1828         (Expression.Error_UnexpectedKind): Use a simple string array
1829         rather than an ArrayList.
1830         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1831         not ExprClass.Type.
1832         (TypeOfVoid.DoResolve): Likewise.
1833         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1834         flags argument -- it always has the same value.
1835
1836 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1837
1838         Fix #75081.
1839         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1840         Use it in the error message.
1841         * assign.cs, expression.cs, statement.cs: Update.
1842
1843 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1844
1845         Fix #75088.
1846         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1847         the "almostMatchedMember" case too.
1848         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1849         that failed the accessibility checks to 'almost_match'.
1850
1851 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1852
1853         * attribute.cs: Use internal MethodBuilder methods to set
1854         ExactSpelling and SetLastError on PInvoke methods, instead
1855         of passing them via charset.  Fixes #75060.
1856
1857 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1858
1859         * parameter.cs (Parameter): Remove TODO comment.
1860         (Parameter.DefineParameter): Remove Location parameter.
1861         (Parameters.LabelParameters): Likewise.
1862         * class.cs (Constructor.Emit): Update to change.
1863         (MethodData.Emit): Likewise.
1864         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1865         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1866
1867 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1868
1869         * parameter.cs,
1870           Removed Parameters.Location and added Parameter.Location instead.
1871           Removed Location parameter from Emit() and GetSignature().
1872         * anonymous.cs,
1873           class.cs,
1874           cs-parser.jay,
1875           delegate.cs,
1876           iterators.cs,
1877           statement.cs :
1878           Modified all related calls.
1879
1880 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1881
1882         Improve user-defined conversion handling.
1883         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1884         applicable operators.
1885         (AddConversionOperators): New.  Helper for GetConversionOperators.
1886         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1887         there is only one most encompassed/encompassing type.
1888         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1889         "applicable operator" handling.
1890         (UserConversion): Move cache here from GetConversionOperators.
1891         Directly cache the chosen operator, rather than the whole
1892         MethodGroup.
1893         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1894         case.  Allow conversion of decimal to sbyte and byte too.
1895         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1896         New static methods.  Used to avoid allocating EmptyExpressions in
1897         convert.cs.
1898
1899 2005-05-24  Duncan Mak  <duncan@novell.com>
1900
1901         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1902         another class, used in Convert.ExplicitNumericConversion.
1903         (CastToDecimal): New class, similar to above, but casts to
1904         System.Decimal, used in Convert.ImplicitNumericConversion and also
1905         in explicit convesion from double/float to decimal.
1906
1907         * convert.cs (ImplicitNumericConversion): Handle implicit
1908         conversions to System.Decimal.
1909         (ExplicitNumericConversion): handle explicit conversions to
1910         System.Decimal.
1911
1912         This fixes #68711.
1913         
1914 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1915
1916         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1917         know the type at this stage, just break through.   Fixes #75008 
1918
1919 2005-05-19  Martin Baulig  <martin@ximian.com>
1920
1921         * delegate.cs
1922         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1923         to disable error reporting.
1924
1925         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1926         here since we don't want to report an error; see the new test-336.cs.
1927
1928 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1929
1930         * statement.cs (ToplevelBlock.GetParameterReference)
1931         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1932         Move here from class Block.
1933         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1934         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1935
1936 2005-05-18  Martin Baulig  <martin@ximian.com>
1937
1938         Fix #74978.
1939
1940         * flowanalysis.cs
1941         (FlowBranching.Reachability): Add non-static public And() and Or()
1942         methods.
1943         (FlowBranchingSwitch): New class; do the `break_origins' thing
1944         like in FlowBranchingLoop.
1945         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1946         reachability, not just locals and parameters.
1947         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1948         switch; MergeBreakOrigins() now takes care of that.
1949
1950 2005-05-18  Martin Baulig  <martin@ximian.com>
1951
1952         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1953         a loop and may leave it, reset the barrier; fixes #74974.
1954
1955 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1956         
1957         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1958         is back.
1959         
1960         * cs-parser.jay: Catch more lexical errors.
1961         
1962         * report.cs: Add one more Error method.
1963         
1964         * rootcontext.cs,
1965         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1966
1967 2005-05-17  Martin Baulig  <martin@ximian.com>
1968
1969         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1970         #70970. 
1971
1972 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1973
1974         Fix test-382.cs.  Emit values of decimal constants.
1975         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1976         Carved out of ...
1977         (TypeContainer.AddField): ... this.
1978         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1979         with initializers to include 'Const's.
1980         (ClassPart.RegisterFieldForInitialization): Forward to
1981         PartialContainer.
1982         * const.cs (Const.Const): Pass initializer to base class.
1983         (Const.Define): In case of decimal constants, register them for
1984         initialization in a static constructor.
1985
1986 2005-05-14  Martin Baulig  <martin@ximian.com>
1987
1988         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1989         do not call ResolveUnreachable() on unreachable statements in
1990         here, see the comment in the source code.
1991
1992 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1993
1994         Fix #74934.
1995         * expression.cs (BinaryResolveOperator): If one of the operands of
1996         an equality comparison is 'null' and the other is a pointer type,
1997         convert the null to a NullPointer.
1998         * convert.cs (ImplicitReferenceConversion): If the expression is a
1999         NullLiteral and the target type is a pointer type, return a
2000         NullPointer instead.
2001         (ImplicitConversionStandard): Likewise.
2002
2003 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
2004         
2005         * cs-parser.jay: Set readonly context based on special constructs.
2006         
2007         * expression.cs (LocalVariableReference.DoResolveBase): Improved
2008         readonly variable error handling.
2009         
2010         * rootcontext.cs (EmitCode): Don't verify members when error
2011         occurred.
2012         
2013         * statement.cs (LocalInfo): Add reaodnly context information.
2014         (SetReadOnlyContext, GetReadOnlyContext): New methods.
2015
2016 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2017
2018         * statement.cs (Block.Resolve): Revert change below.  Modify fix
2019         for #74041 to initialize 'resolved' to false only for explicit
2020         blocks.  Fixes #74873.
2021
2022 2005-05-12  Raja R Harinath  <harinath@gmail.com>
2023
2024         Fix #74920.
2025         * typemanager.cs (unmanaged_enclosing_types): New.
2026         (IsUnmanagedType): Avoid infloops by using
2027         'unmanaged_enclosing_types' to talk with recursive invocations.
2028
2029 2005-05-13  Martin Baulig  <martin@ximian.com>
2030
2031         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2032         instance variable, not a local.  Fix #74873.
2033         (Block.ResolveUnreachable): Set it to true here.
2034
2035 2005-05-11  Duncan Mak  <duncan@novell.com>
2036
2037         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2038         continuing to process for 'arg'.
2039         (handle_preprocessing_directive): Check the argument of the #endif
2040         directive and report error CS1025 if there are any trailing
2041         characters.
2042
2043         According to the C# spec, having even whitespace after the #endif
2044         directive is illegal; however, because we call arg.TrimEnd ()
2045         beforehand, we have the same behavior as csc, allowing whitespace
2046         after the directive.
2047
2048         Fixes #74892.
2049
2050 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
2051
2052         Fix #74863.
2053         
2054         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2055         (Constructor.GetObsoleteAttribute): Implemented correctly.
2056
2057 2005-05-10  Martin Baulig  <martin@ximian.com>
2058
2059         * support.cs (ReflectionParameters.ParameterModifier): Use
2060         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2061         and `ParameterAttributes.In'.  Fixes #74884.
2062
2063 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
2064
2065         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2066         
2067         * expression.cs (Argument.GetParameterModifier): Turned to property.
2068         (Invocation.Error_InvalidArguments): Add more descriptive errors.
2069         
2070         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2071         its C# equivalent.
2072         
2073 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2074
2075         Fix #74852.
2076         * decl.cs (MemberCache.AddMethods): Register override methods,
2077         rather than non-override methods.
2078         * typemanager.cs (RegisterOverride): New.
2079         (IsOverride): Update.
2080
2081 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2082
2083         Fix #73105.
2084         
2085         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2086         recursive declaration.
2087         
2088         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2089         
2090 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2091
2092         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2093         
2094         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2095
2096 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2097
2098         Fix #74797.
2099         * decl.cs (DeclSpace.FamilyAccessible): 
2100         Use TypeManager.IsNestedFamilyAccessible.
2101
2102         Fix reopened #64812.
2103         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2104         internal'.
2105
2106 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2107             Abin Thomas  <projectmonokochi@rediffmail.com>
2108             Anoob V E  <projectmonokochi@rediffmail.com>
2109             Harilal P R  <projectmonokochi@rediffmail.com>
2110
2111         Fix #64812.
2112         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2113         allow access to all static members.
2114
2115 2005-05-04  Martin Baulig  <martin@ximian.com>
2116
2117         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2118
2119 2005-05-04  Martin Baulig  <martin@ximian.com>
2120
2121         Fix #74655.
2122
2123         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2124         section at the end; make things work if `default' is not the last
2125         section.        
2126
2127 2005-05-04  Martin Baulig  <martin@ximian.com>
2128
2129         Fix #70400.
2130
2131         * statement.cs (Switch): Replaced the `got_default' field with a
2132         `default_section' one.
2133         (Switch.CheckSwitch): Set `default_section' here.
2134         (Switch.Resolve): If we're a constant switch and the constant is
2135         not found, use the default section.
2136
2137 2005-05-03  Martin Baulig  <martin@ximian.com>
2138
2139         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2140
2141         * statement.cs (Foreach.ArrayForeach): New nested class.
2142         (Foreach.TemporaryVariable): New nested class.
2143         (Foreach.EmitArrayForeach): Removed; this is now in the new
2144         ArrayForeach class.
2145
2146 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2147
2148         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2149         more conservative.
2150         (VerifyPendingMethods): Revert change below.
2151
2152         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2153         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2154         that used to trigger warning -28.  Remove warning -28.
2155         * expression.cs (Invocation.OverloadResolve): Use
2156         TypeManager.IsOverride to distinguish override methods.
2157
2158         Fix #74773.
2159         * pending.cs (VerifyPendingMethods): If a base type implements the
2160         requested interface, don't bother checking individual methods of
2161         the base type.  As a side-effect, this prevents the creation of
2162         unnecessary proxies.
2163
2164 2005-05-02  Martin Baulig  <martin@ximian.com>
2165
2166         Fix #70182.
2167
2168         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2169         Also `And' the locals if the old vector is null.
2170         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2171         null; in this case we basically reset all the variables.        
2172
2173 2005-05-02  Martin Baulig  <martin@ximian.com>
2174
2175         Fix #74529.
2176
2177         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2178         Added `FlowBranching branching' argument; always `and' the
2179         variables instead of `or'ing them unless we're an infinite loop.
2180
2181         * statement.cs (While.Resolve): Create a new sibling unless we're
2182         infinite.       
2183
2184 2005-05-02  Martin Baulig  <martin@ximian.com>
2185
2186         Fix #70140.
2187
2188         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2189         arguments; use it instead of creating a new TopLevelBlock.
2190         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2191         our ConstructorInitializer.
2192
2193         * statement.cs
2194         (TopLevelBlock.TopLevelBranching): New public property.
2195         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2196         and create our `TopLevelBranching'.
2197
2198         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2199         anonymous method host, use `block.TopLevelBranching' rather than
2200         creating a new branching.
2201
2202 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2203
2204         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2205         a ScopeInfo, if any of the current children is a child of the new
2206         entry, move those children there.
2207
2208 2005-04-30  Martin Baulig  <martin@ximian.com>
2209
2210         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2211         at the beginning of a SwitchSection.  Fix #73335.
2212
2213 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2214
2215         Fix #74378
2216         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2217         
2218         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2219         (FieldExpr.DoResolve): Obsolete members are ignored for field
2220         initializers.
2221         
2222 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2223
2224         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2225         of arrays detection.
2226
2227         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2228         verification.
2229         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2230
2231         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2232         arrays report.
2233
2234 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2235
2236         * cs-parser.jay: Use the prefered version of -unsafe in error
2237         message.
2238
2239 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2240
2241         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2242         circumstances.
2243
2244 2005-04-20  John Luke  <john.luke@gmail.com>
2245
2246         * driver.cs: fix typo in error message, --outout to --output
2247
2248 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2249
2250         * codegen.cs (InRefOutArgumentResolving): New field.
2251         
2252         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2253         fields outside contructor.
2254         
2255         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2256         
2257 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2258
2259         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2260         parameter code was not completed ever, so it was not as up-to-date
2261         as local variables.  Must finish it.
2262
2263         The bug fix was to compare the Toplevel of the block, not the
2264         current block.  Thanks for Ben for pointing this out. 
2265
2266 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2267
2268         * decl.cs (AddMethods): Use the declaring type of the problem
2269         method to determine if we want to squash a warning.
2270
2271 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2272
2273         * attribute.cs: Removed debug output.
2274
2275         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2276         
2277         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2278         Report.Stderr.
2279         
2280 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2281
2282         Fix #74481.
2283         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2284         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2285         all null comparisons against reference types.
2286
2287 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2288
2289         Fix# 74565
2290         * class.cs (TypeContainer.CircularDepException) New nested
2291         exception class.
2292         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2293         (TypeContainer.DefineType): Removed error, reset InTransit before
2294         exit.
2295         (Class.DefineType): Throw exception when is in Transit.
2296         Catch exception and report error.
2297         (Struct.DefineType): Throw exception when is in Transit.
2298         Catch exception and report error.
2299         (Interface.DefineType): Throw exception when is in Transit.
2300         Catch exception and report error.
2301
2302         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2303         handle nested exception handlers.
2304
2305         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2306         a catch.
2307
2308         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2309         InFinally and InCatch storage.
2310
2311         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2312         (Catch.Resolve): Set and Restore ec.InCatch.
2313         (Try.Resolve): Set and Restore ec.InFinally.
2314         (Try.HasCatch): True when try has catch.
2315
2316 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2317
2318         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2319           for the same event member, so exclude such cases from warning 419.
2320           Fixed bug #74633.
2321
2322 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2323
2324         * expression.cs (Binary.ResolveOperator): Apply patch from John
2325         Luke to fix bug 59864: operators &, | and ^ on enumerations
2326         require that the same enum type on both sides.
2327
2328         * driver.cs: Add warnings to old flag usage, this is to assist
2329         people who produce Makefiles and hope that the Makefiles will be
2330         used on Windows.
2331
2332         * class.cs (TypeContainer.EmitType): Moved the definition of the
2333         special $PRIVATE$ field from the resolve phase to the Emit phase.
2334         During resolve we do not know if we are a struct with
2335         HasExplicitLayout, we know this only after the attributes for the
2336         type are emitted.
2337
2338         Set the FieldOffset to zero on the dummy field that we create for
2339         the class.   Fixes 74590.
2340
2341 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2342
2343         Fix #73834.
2344         * ecore.cs (PropertyExpr.resolved): New.
2345         (DoResolve): Use it to handle a case of double resolution here.
2346         Handle a case of identical-name-and-type-name.
2347         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2348         resolution by storing the results of expression resolution back
2349         into the "probes" array.
2350
2351 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2352
2353         Fix cs0208-7.cs and cs0208-8.cs.
2354         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2355         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2356         error reporting to point out the reason a struct is not unmanaged.
2357
2358 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2359
2360         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2361           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2362
2363 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2364
2365         Fix #74528.
2366         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2367         IdenticalNameAndTypeName here.
2368         (EventExpr.InstanceResolve): Likewise.
2369
2370 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2371
2372         C# 2.0 DefaultCharSetAttribute implementation
2373         
2374         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2375         which allows us to set GlobalNamespace for every resolve.
2376         (Attribute.ResolveArguments): Cut from Resolve.
2377         (Attribute.GetCharSetValue): Returns CharSet named argument.
2378         (Attribute.DefinePInvokeMethod): Gets default charset from
2379         module settings.
2380         (GlobalAttribute.ResolveAsTypeStep): Override.
2381         (GlobalAttribute.ResolveArguments): Override.
2382         
2383         * class.cs (TypeAttr): Is protected.
2384         
2385         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2386         (ModuleClass.DefaultCharSetType): New memeber.
2387         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2388         
2389         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2390         charset from module.
2391         
2392         * delegate.cs (TypeAttr): Override.
2393         (Delegate.DefineType): Use this TypeAttr.
2394         
2395         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2396         at very early stage (before types are defined) to resolve model
2397         module attributes. It will probably not work with corlib but it
2398         should be ok.
2399         
2400         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2401         charset from module.
2402         
2403         * typemanager.cs (default_charset_type): New type.
2404
2405 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2406
2407         * decl.cs (MemberCache.AddMethods): Don't warn if
2408         System.Object.Finalize has buggy MethodAttributes.
2409
2410         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2411         removed below.
2412
2413 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2414
2415         * doc.cs : detect ambiguous reference to overloaded members.
2416           Fixed bug #71603. MS 1.1 csc does not detect it.
2417
2418 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2419
2420         * doc.cs : delegates must not be referenced with parameters.
2421           Fixed bug #71605.
2422
2423 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2424
2425         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2426
2427 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2428
2429         * driver.cs (MainDriver): Stop processing if the CLS stage found
2430         errors. 
2431
2432         (CompilerCallableEntryPoint.InvokeCompiler): Always
2433         reset after execution;   Take a TextWriter argument for the
2434         output.
2435
2436         * report.cs: Use the error stream instead of hardcoding stderr. 
2437
2438 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2439
2440         * class.cs: Reduce code paths to test, too small of an
2441         optimization to make it worth the extra testing.  Always perform
2442         it. 
2443
2444 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2445
2446         Fix #74510.
2447         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2448         operators that had errors reported on them.
2449
2450 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2451
2452         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2453         argument types.
2454         (Attribute.Resolve): Add named argument type checking.
2455         
2456         * class.cs (FixedField.Define): Use IsPrimitiveType
2457         
2458         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2459         
2460         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2461         unsafe parameter types.
2462         
2463         * statement.cs (Using.ResolveExpression): Add better error description.
2464         
2465         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2466         
2467 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2468
2469         Fix #74484.
2470         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2471         AttributeUsageAttribute in the emitcontext of the attribute class,
2472         not in the emitcontext of the attributable entity it was attached to.
2473         * cs-parser.jay: Use 'current_class', not 'current_container',
2474         when creating a GlobalAttribute.
2475
2476 2005-04-08  Alp Toker  <alp@atoker.com>
2477
2478         * pending.cs: The fix to #58413 failed to compile methods implementing
2479         interfaces with/without params modifiers and vice versa, even though
2480         params modifiers aren't part of the signature. Make the modifier check
2481         less strict as in csc.
2482
2483 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2484             Anoob V E  <projectmonokochi@rediffmail.com>
2485             Harilal P R  <projectmonokochi@rediffmail.com>
2486
2487         Fix #58413.
2488         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2489         modifiers of pending methods.
2490         (PendingImplementation.PendingImplementation): Initialize it.
2491         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2492         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2493         with ParameterData.  Add check for modifiers.
2494         * class.cs (MethodData.Define): Update to changes.
2495
2496 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2497
2498         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2499
2500 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2501
2502         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2503         property.
2504         
2505         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2506         
2507         * rootcontext.cs,
2508         * typemanager.cs: Registered RequiredAttributeAttribute.
2509         
2510 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2511
2512         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2513         Warning CS0169 is back at level 3.
2514         (IMethodData.SetMemberIsUsed): New method.
2515         
2516         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2517         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2518         
2519         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2520
2521         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2522         contants.
2523         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2524         is used.
2525         
2526         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2527         is used.
2528         
2529         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2530         to avoid the problems with nested types.
2531
2532 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2533             Anoob V.E  <projectmonokochi@rediffmail.com>
2534             Harilal P.R  <projectmonokochi@rediffmail.com>
2535             Raja R Harinath  <rharinath@novell.com>
2536
2537         Fix #73820.
2538         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2539         attribute.
2540         * typemanager (GetConstructor): Make public.
2541
2542 2005-04-05  John Luke  <john.luke@gmail.com>
2543             Raja R Harinath  <rharinath@novell.com>
2544
2545         Fix #62232.
2546         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2547         struct too.  Return false quicker in a few cases.
2548         (VerifyUnManaged): Use it.
2549
2550 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2551
2552         Fix #74041.
2553         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2554         not 'unreachable_seen'.
2555
2556 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2557
2558         * attribute.cs (Attribute.GetValue): Removed unused.
2559         
2560         * codegen.cs (CodeGen.TrimExt): Removed unused.
2561         
2562         * cs-parser.jay (output): Removed unused.
2563         
2564         * cs-tokenizer.cs (hex_digits): Removed unused.
2565         
2566         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2567         
2568         * expression.cs (Indirection.LoadExprValue): Removed unused.
2569         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2570         
2571         * iterators.cs (Iterator.param_types): Removed unused.
2572         
2573         * statement.cs (Goto.block): Removed unused.
2574         (ToplevelBlock.did): Removed unused.
2575         (Switch.ResolveConstantSwitch): Removed unused.
2576
2577 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2578
2579         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2580         resetting thingy.
2581
2582 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2583
2584         Fix #74232 and cs0208-3.cs.
2585         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2586         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2587         unmanaged type.  Don't use FieldBuilders when 't' is a
2588         TypeBuilder.  Use ModFlags and MemberType fields.
2589         * class.cs (MemberBase.member_type): Rename from MemberType.
2590         (MemberBase.MemberType): New property.  Determines member_type on
2591         demand.
2592         (MemberBase.DoDefine): Don't initialize MemberType here.
2593         (FieldMember.Define): Likewise.
2594
2595 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2596
2597         Fix #74241
2598         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2599         Attributes are emitted there.
2600         
2601 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2602
2603         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2604         keyword in 'partial enum' too.
2605         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2606         is not allowed).
2607         Report from Kamil Skalski <nazgul@omega.pl>.
2608
2609         Fix #74309.
2610         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2611         have partial containers too.
2612
2613         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2614         in block' checks to Block.CheckInvariantMeaningInBlock.
2615         * statement.cs (Block.GetKnownVariableInfo): Make private.
2616         (Block.IsVariableUsedInChildBlock): Remove.
2617         (Block.IsVariableUsedInBlock): Likewise.
2618         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2619         conflicting declaration.
2620         (Block.AddVariable): Make error messages less long-winded and more
2621         specific.  Show location of conflicting declaration.
2622         * parameter.cs (Parameters.Location): New readonly property.
2623
2624 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2625
2626         Clean up semantics of invoking ResolveMemberAccess.
2627         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2628         can have an instance, ensure that we pass in a non-TypeExpression
2629         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2630         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2631         argument.  Update to changes and simplify.
2632         (FieldExpr.Emitinstance): Remove CS0120 check.
2633         (PropertyExpr.EmitInstance): Likewise.
2634         * expression.cs (Argument.Resolve): Likewise.
2635         (Invocation.DoResolve): Update to changes in semantics of
2636         InstanceExpression.
2637
2638 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2639
2640         Fix #74241
2641         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2642         customization.
2643         
2644         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2645
2646 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2647
2648         Fix difference in behaviour with commandline invocation.
2649         * driver.cs (Driver.Reset): New.
2650         (CompilerCallableEntryPoint): Call it.
2651
2652         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2653         variable" warnings if the boolean expression failed to resolve.
2654
2655 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2656
2657         * attribute.cs: Fix the union of several permissions when some of them
2658         are unrestricted (so the result isn't an unrestricted permission set).
2659         Fix #74036.
2660
2661 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2662
2663         * ecore.cs (MemberExpr): New class.  Convert from interface
2664         IMemberExpr.
2665         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2666         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2667         error checks.
2668         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2669         (MethodGroupExpr.IsExplicitImpl): Remove.
2670         (Expression.GetFieldFromEvent): Remove.
2671         (SimpleName.MemberStaticCheck): Remove.
2672         (SimpleName.DoSimpleNameResolve): Update to changes.
2673         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2674         (MemberAccess.IdenticalNameAndTypeName): Remove.
2675         (MemberAccess.error176): Move to MemberExpr.
2676         (MemberAccess.DoResolve): Update to changes.
2677         (BaseAccess.DoResolve): Likewise.
2678
2679 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2680
2681         C# 2.0 Conditional attribute class implementation
2682         
2683         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2684         Analyzes class whether it has attribute which has ConditionalAttribute
2685         and its condition is not defined.
2686         
2687         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2688         (Class.IsExcluded): New method. Search for at least one defined
2689         condition in ConditionalAttribute of attribute class.
2690
2691 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2692
2693         * ecore.cs (PropertyExpr): Derive from Expression, not
2694         ExpressionStatement.
2695         (PropertyExpr.EmitStatement): Remove.
2696
2697 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2698
2699         Fix #74060.
2700         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2701         internal field "value__" of an enum be private.  The examples for
2702         "value__" that I found on MSDN all used FieldAttributes.Private.
2703
2704         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2705         Don't mention IL method attribute names.
2706
2707         Fix #47991.  Remove a TODO.
2708         * statement.cs (Block.Toplevel): Make into a field.
2709         (Block.Parameters): Move into ToplevelBlock.
2710         (Block.known_variables): Rename from child_variable_names.
2711         (Block.Block): Remove variants that take Parameters.  Initialize
2712         'Toplevel' with the immediately surrounding toplevel block.
2713         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2714         LocalInfo parameter.
2715         (Block.GetKnownVariableInfo): New.
2716         (Block.IsVariableNameUsedInChildBlock): Update.
2717         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2718         the block, even though it may not be in scope.
2719         (Block.AddVariable): Remove Parameters parameter.  Use
2720         Toplevel.Parameters instead.
2721         (Block.AddConstant): Remove Parameters parameter.
2722         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2723         (Block.IsParamaterReference): Likewise.
2724         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2725         (ToplevelBlock.Parameters): New.  Moved from Block.
2726         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2727         initialize Parameters to a non-null value.
2728         * cs-parser.jay: Update to changes.
2729         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2730         simple names that mean different things in the same block.  Use
2731         Block.IsVariableNameUsedInBlock.
2732
2733 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2734
2735         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2736         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2737         GetTypeHandle.  It is possible for a reflected type to derive from
2738         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2739         System.Array during mscorlib compilation).
2740         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2741         contain a method_hash, don't create one either.  Don't create a
2742         deep copy of the base cache's method_hash.
2743         (MemberCache.SetupCache): Rename back from DeepCopy.
2744         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2745         already initialized.  If we see an override function, add its
2746         underlying base virtual function to the member_hash too.
2747
2748         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2749
2750 2005-03-26  Raja R Harinath  <harinath@acm.org>
2751
2752         Fix #73038.
2753         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2754         fails to resolve, ensure that the LHS is still resolved as an
2755         lvalue.
2756
2757 2005-03-25  Raja R Harinath  <harinath@acm.org>
2758
2759         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2760         ec.ContainerType.
2761         (Enum.current_ec): Remove.
2762         (Enum.LookupEnumValue): Remove EmitContext argument.
2763         Just uses the one created during DefineType.
2764         (Enum.FindMembers): Update.
2765         * expression.cs (MemberAccess.DoResolve): Update.
2766
2767 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2768
2769         * assign.cs (Assign.DoResolve): Check for CS1717 when
2770         source and target are same (uses Equals).
2771
2772         * expression.cs (LocalVariableReference, ParameterReference,
2773         This): Implemented Equals, GetHashCode.
2774
2775         * statement.cs (Block.GetParameterReference): Removed useless
2776         local variable.
2777
2778 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2779
2780         Fix cs0128.cs
2781         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2782         blocks before deciding whether the error is cs0136 or cs0128.
2783
2784         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2785         (using_alias_directive, using_namespace_directive): Pass
2786         MemberName, not an expression to Namespace.UsingAlias and
2787         Namespace.Using.
2788         (MakeName): Use the MemberName of the namespace.
2789         * namespace.cs (Namespace.MemberName): New.
2790         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2791         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2792         Likewise.
2793         * decl.cs (MemberName.Name): Make readonly.
2794         (MemberName.FromDotted): New "constructor".
2795         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2796         (MemberCore.Name): Compute from MemberName on demand.
2797         (MemberCore.SetMemberName): Provide a way to change the
2798         MemberName.
2799         (MemberCore.AddToContainer): Don't take a fullname parameter.
2800         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2801         fully qualified name of the container to the member name.
2802         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2803         only if the type is a member of the root container.
2804         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2805         MemberName.Left rather than searching for an embedded ".".
2806         (PartialContainer.CreatePart): Update to changes in RootContext.
2807         (MemberBase.ShortName): Turn into a property.  Use
2808         MemberCore.SetMemberName.
2809         (MemberBase.ExplicitInterfaceName): Remove.
2810         (MemberBase.UpdateMemberName): Remove.
2811         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2812         (PropertyBase.SetMemberName): New override.
2813         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2814         (Tree.GetDecl): New.
2815         (Tree.AllDecls): Rename from Decls.
2816         * attribute.cs, enum.cs, report.cs: Update to changes.
2817         * driver.cs (MainDriver): Use MemberName.FromDotted on
2818         RootContext.MainClass.
2819
2820 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2821
2822         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2823         checks.
2824
2825         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2826
2827 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2828
2829         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2830         property accessor modifiers.
2831
2832         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2833         fixed buffer attribute (CS1716).
2834         (PropertyMethod.HasCustomAccessModifier): When property accessor
2835         has custom modifier.
2836
2837         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2838         modifiers.
2839         (PropertyExpr.DoResolveLValue): Add CS0272.
2840
2841 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2842
2843         * convert.cs: When converting to a pointer, use the proper Conv.U
2844         or Conv.I depending on the source data type.
2845
2846         * cs-tokenizer.cs: Make the size for large decimal constants,
2847         fixes #72957.
2848
2849 2005-03-17  Martin Baulig  <martin@ximian.com>
2850
2851         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2852         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2853
2854 2005-03-17  Martin Baulig  <martin@ximian.com>
2855
2856         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2857         to bool so we can return an error condition.
2858         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2859         returned an error.
2860
2861 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2862
2863         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2864         attributes.
2865
2866 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2867
2868         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2869         Refactor to avoid traversing the list of assemblies, and to avoid
2870         string concatenation.
2871         * typemanager.cs (guid_attr_type): Remove.
2872         (negative_hits, pointers, references): Remove hashes.
2873         (type_hash): New.
2874         (GetConstructedType): New.  Uses type_hash to handle constructed
2875         types (arrays, references, pointers).
2876         (GetReferenceType, GetPointerType): Use it.
2877         (GetNestedType): New.  Uses type_hash to handle nested types of
2878         reflected types.
2879         (LookupType, LookupTypeDirect): Remove.
2880         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2881         'types' hash and LookupTypeReflection directly.
2882         (params_string, params_object): Use GetConstructedType.
2883         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2884         top-level types.
2885         (Namespace.Lookup): Use cached_types.
2886         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2887         provided by old TypeManager.LookupType.
2888         * rootcontext.cs (MakeFQN): Remove.
2889         * decl.cs (DeclSpace.MakeFQN): Likewise.
2890         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2891         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2892         TypeManager.GetConstructedType.
2893         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2894
2895 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2896
2897         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2898         indexers.
2899
2900         * cs-parser.jay: Reports CS1527 for any namespace element.
2901
2902         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2903         Added CS0407.
2904
2905         * expression.cs (ParameterReference.IsAssigned): Changed error to
2906         CS0269.
2907         (Error_WrongNumArguments): Moved CS0245 detection here.
2908
2909         * statement.cs (Return.Resolve): Add CS1622 report.
2910
2911 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2912
2913         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2914
2915 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2916
2917         * attribute.cs expression.cs: Get rid of some allocations.
2918
2919 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2920
2921         * doc.cs : just eliminate the latest change.
2922
2923 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2924
2925         * doc.cs : commented out the latest change. It breaks xml-030.cs
2926
2927 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2928
2929         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2930           fail. So invoke CreateType() in FindDocumentedType().
2931
2932 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2933
2934         * cs-tokenizer.cs : added IsKeyword().
2935         * doc.cs : Detect keyword incorrectly used as identifier.
2936           Allow identifiers prefixed by @.
2937
2938 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2939
2940         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2941         It caused exception in namespace resolving (again!).
2942         
2943         * class.cs (Class.ctor): Removed exit.
2944         (PropertyMethod.ctor): ditto.
2945         
2946         * codegen.cs (Codegen.Reset): Reset static data.
2947         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2948         
2949         * cs-tokenizer.cs (Cleanup): Removed.
2950         
2951         * driver.cs (GetSystemDir): Rewrote to one line command.
2952         It caused problem with unloaded dynamic modules.
2953         (UnixParseOption): Removed Exit.
2954         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2955         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2956         Now can be mcs used as library.
2957         
2958         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2959         empty location.
2960         
2961         * location.cs (Reset): Reset static data.
2962         
2963         * namespace.cs (Reset): Reset static data.
2964         
2965         * report.cs (Report.Reset): Reset static data.
2966         
2967         * rootcontext.cs (RootContext.Reset): Reset static data.
2968         
2969         * tree.cs (RootTypes.ctor): Use Location.Null
2970         
2971         * typemanager.cs (TypeManager.Reset): Reset static data.
2972         (CoreLookupType): Removed Exit.
2973         (TypeHandle.Reset): Reset static data.
2974         
2975 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2976
2977         Fix #73516.
2978         * typemanager.cs (ComputeNamespaces): Import namespaces from
2979         referenced modules too.
2980
2981 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2982
2983         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2984         than '.'.
2985
2986 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2987
2988         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2989         enclosing DeclSpace.  This ensures that a name-lookup populates
2990         more caches and there are fewer 'TypeExpression's.  Carve out
2991         nested type lookup into ...
2992         (LookupNestedTypeInHierarchy): ... this.
2993
2994 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2995
2996         Clean up a few partial-class semantics.  
2997         Fixes test-357.cs and cs1618-2.cs.
2998         * cs-parser.jay (struct_declaration): Use 'current_class' as
2999         parent of newly-created struct.  Remove call to Register ().
3000         Use 'pop_current_class' to complete handing the current struct.
3001         (interface_declaration): Likewise.
3002         (class_declaration): Likewise.
3003         (enum_declaration): Use 'current_class' as parent of newly created
3004         enum.
3005         (delegate_declaration): Likewise.
3006         (pop_current_class): New function.  This is used to handle closing
3007         up the 'current_class' and 'current_container', and pointing them
3008         to the enclosing class/container.
3009         (CSharpParser): Initialize 'current_class' too.
3010         * decl.cs (MemberCore): Add check for invariant: a partial
3011         container is not a parsed entity, and thus does not enclose any
3012         parsed members.
3013         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3014         (DeclSpace.BaseTypeExpr): Use it.
3015         (DeclSpace.LookupType): Add check for invariant.
3016         * class.cs (TypeContainer): Add check for invariant: a nested
3017         class should have the same NamespaceEntry as its enclosing class.
3018         (TypeContainer.EmitFieldInitializers): Make virtual.
3019         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3020         MemberCore.
3021         (TypeContainer.Register): Remove.
3022         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3023         null.  Use TypeResolveEmitContext for resolving base types and
3024         interfaces.  Move initialization of Parts.TypeBuilder here from
3025         ...
3026         (TypeContainer.DefineNestedTypes): ... here.
3027         (PartialContainer): Take a Namespace not a NamespaceEntry.
3028         (PartialContainer.Create): Don't use Register.  Call the
3029         appropriate Add... function directly.
3030         (ClassPart): Take both the PartialContainer and the enclosing
3031         class as constructor arguments.
3032         (ClassPart.EmitFieldInitializers): Override.
3033         (ClassPart.PartFindNestedTypes): Remove.
3034         (FieldBase.GetInitializerExpression): Resolve the initializer
3035         expression in the emit context of the enclosing class.
3036         * tree.cs (RootTypes): Remove Register ().
3037         
3038 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
3039
3040         * cs-parser.jay: Removed CS0134.
3041         
3042         * driver.cs: Removed CS1901.
3043         
3044         * expression.cs (SizeOf.DoResolve): Don't report CS0233
3045         for predefined types.
3046
3047 2005-03-07  Duncan Mak  <duncan@novell.com>
3048
3049         * codegen.cs (Save):  Catch UnauthorizedAccessException as
3050         well. Fixes bug #73454.
3051
3052 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3053
3054         * cs-tokenizer.cs (xtoken): Add CS1035.
3055         
3056         * class.cs (MethodData.Define): Add CS0683.
3057         (FieldMember.ctor): Add CS0681.
3058
3059 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3060
3061         * ecore.cs (SimpleName.DoResolve): Rename from
3062         SimpleName.DoResolveAllowStatic.
3063         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3064         Pass 'intermediate' flag to MemberStaticCheck.
3065         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3066         of "intermediate" lookups via MemberAccess.
3067         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3068         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3069
3070 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3071
3072         Fix #73394.
3073         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3074         slipped in because of variable names that are identical to a
3075         builtin type's BCL equivalent ('string String;', 'int Int32;').
3076         (PropertyExpr.EmitInstance): Likewise.
3077
3078 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3079
3080         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3081         
3082         * report.cs (warning_ignore_table): Made public.
3083
3084 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3085
3086         Fix #73282.
3087         * class.cs (MethodData.Emit): Pass 'container' to
3088         container.GetObsoleteAttribute instead of 'container.Parent'.
3089
3090 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3091
3092         * cs-parser.jay: Add 1534 error test.
3093
3094         * iterators.cs (Yield.CheckContext): Add error 1629.
3095         (Iterator.ctor): Save unsafe modifier.
3096         (MoveNextMethod.DoEmit): Restore unsafe context.
3097
3098         * namespace.cs (UsingAlias): Better error message.
3099
3100 2005-03-03  Dan Winship  <danw@novell.com>
3101
3102         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3103         the warning message [#73219]
3104
3105 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3106
3107         Fix compile with MCS 1.0.0.0.
3108         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3109         w_restore to not depend on string constant folding.
3110
3111 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3112
3113         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3114         CS0246 check to users who passed 'silent = false'.
3115         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3116         check.
3117         (SimpleName.SimpleNameResolve): Update.
3118         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3119         (MemberAccess.IdenticalNameAndTypeName): Update.
3120         * doc.cs (FindDocumentedTypeNonArray): Update.
3121
3122 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3123
3124         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3125         * parameters.cs (ComputeAndDefineParameters): Remove.
3126         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3127         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3128         Use GetParameterInfo.
3129
3130 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3131
3132         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3133
3134 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3135
3136         Unify DeclSpace.LookupType and DeclSpace.FindType.
3137         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3138         is in charge of defining nested types on demand.
3139         (DeclSpace.LookupType): Use it when the current_type is a
3140         TypeBuilder.  Use LookupTypeDirect for reflected types.
3141         (DeclSpace.FindType): Remove.
3142         (DeclSpace.LookupInterfaceOrClass): Likewise.
3143         (DeclSpace.DefineTypeAndParents): Likewise.
3144         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3145         DeclSpace.LookupType.
3146         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3147         * typemanager.cs (LookupType): Simplify.
3148         (AddUserType): Remove type from negative_hits.
3149         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3150         * class.cs (TypeContainer.FindMembers): Move handling of nested
3151         types ...
3152         (TypeContainer.FindMembers_NestedTypes): ... here.
3153         (TypeContainer.FindNestedType): Implement override.
3154         (ClassPart.FindNestedType): Delegate to PartialContainer.
3155         (ClassPart.PartFindNestedType): Looks up the nested types of the
3156         part alone.
3157
3158 2005-03-02  Martin Baulig  <martin@ximian.com>
3159
3160         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3161         static constructor in static classes.
3162
3163 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3164
3165         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3166         sizeParamIndex is not specified.
3167
3168 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3169
3170         Fix #73117
3171         * report.cs (WarningMessage.IsEnabled): Missing null check.
3172
3173 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3174
3175         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3176         in the fields and not in the properties.
3177
3178 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3179
3180         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3181         fields as well.
3182
3183 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3184
3185         * attribute.cs: Small refactoring (improved robustness).
3186         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3187         (ValidateGuid): Removed.
3188         (Resolve): Removed referenced to above mentioned.
3189         (GetAttributeUsage): Made private and changed to work without
3190         class assistance.
3191         (GetIndexerAttributeValue): Don't crash.
3192         (GetConditionalAttributeValue): Ditto.
3193         (GetClsCompliantAttributeValue): Ditto.
3194         (ExtractSecurityPermissionSet): All attributes exceptions are
3195         error 648.
3196         (GetPropertyValue): New helper.
3197         (GetMethodImplOptions): New method.
3198         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3199         some missing properties.
3200         
3201         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3202         (Method.ApplyAttributeBuilder): Updated.
3203         
3204         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3205         exception.
3206
3207 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3208
3209         Fix #73052.
3210         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3211         non-simple types (array, pointer, reference).
3212
3213 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3214
3215         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3216
3217         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3218         for operators.
3219         (Method.CheckBase): Catch wrong destructor here.
3220         (MethodData.Define): Add errors 550, 668.
3221
3222         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3223
3224         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3225
3226         * pending.cs (VerifyPendingMethods): Add error 551.
3227
3228         * typemanager.cs (CSharpName): Next error report helper.
3229
3230 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3231
3232         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3233         attributes. Removed useless attribute double check.
3234         It saves almost 2MBs for corlib.
3235
3236 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3237
3238         Fix #72924.
3239         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3240         called twice in case of error.
3241
3242 2005-02-23  Chris Toshok  <toshok@ximian.com>
3243
3244         Fix compiler portions of #72827.
3245         * statement.cs (Block.Emit): call Begin/EndScope on the
3246         EmitContext instead of the ILGenerator.
3247
3248         * codegen.cs (EmitContext.BeginScope): new method, call
3249         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3250         we have one.)
3251         (EmitContext.BeginScope): same, but EndScope and CloseScope
3252
3253         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3254         offset and call the superclass's OpenScope(int) with it.
3255         (SymbolWriter.CloseScope): get the current il
3256         offset and call superclass's CloseScope(int) with it.
3257
3258 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3259
3260         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3261         CS1677 for out and ref as well.
3262
3263         * class.cs (Method.Define): Add error CS1599 detection.
3264         
3265         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3266         
3267         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3268         
3269         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3270         
3271         * support.cs.cs (ModifierDesc): New helper method.
3272
3273 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3274             Abin Thomas  <projectmonokochi@rediffmail.com>
3275             Anoob V E  <projectmonokochi@rediffmail.com>
3276             Harilal P R  <projectmonokochi@rediffmail.com>
3277
3278         Fix #57851, #72718.
3279         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3280         MemberLookup (used for error reporting) actually returns a result.
3281         Fix error report number (122, not 112).
3282
3283 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3284             Anoob V E  <projectmonokochi@rediffmail.com>
3285             Harilal P R  <projectmonokochi@rediffmail.com>
3286
3287         Fix #71134.
3288         * pending.cs (PendingImplementation.GetAbstractMethods):
3289         Find NonPublic members too.
3290
3291 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3292
3293         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3294         Fixed error 217.
3295         
3296         * class.cs (MethodCore.CheckMethodAgainstBase):
3297         Add error 239 report.
3298
3299 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3300
3301         Fix #68955.
3302         * expression.cs (Invocation.IsApplicable): Make public.
3303         (Invocation.IsParamsMethodApplicable): Likewise.
3304         * delegate.cs (Delegate.VerifyApplicability): Don't use
3305         Invocation.VerifyArgumentCompat for parameter applicability
3306         testing.  Use Invocation.IsApplicable and
3307         Invocation.IsParamsMethodApplicable.
3308
3309 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3310
3311         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3312         
3313         * class.cs (Operator.Define): Add error 217 report.
3314         
3315 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3316
3317         * namespace.cs (UsingEntry.Resolve): Undo change below.
3318
3319 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3320
3321         Fix #72756.
3322         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3323         disable the error message when the extended MemberLookup also
3324         fails.
3325         (Expression.MemberLookupFinal): Update.
3326         (SimpleName.DoSimpleNameResolve): Update.
3327         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3328         Don't use MemberLookupFinal.
3329         (New.DoResolve): Update.
3330         (BaseAccess.CommonResolve): Update.
3331
3332 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3333
3334         Fix #72732.
3335         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3336         occured previously, don't resolve again.
3337
3338 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3339
3340         Fix #69949
3341         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3342         argument. Call ResolveAttributeUsage for unresolved.
3343         when types doesn't match ctor arguments.
3344         
3345         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3346         for nested attribute classes.
3347         (Class.attribute_usage): Removed.
3348         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3349         for attribute class.
3350         
3351         * ecore.cs (IsAttribute): Removed.
3352         
3353         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3354         
3355         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3356         now normal types.
3357         (attribute_types): Removed.
3358         (EmitCode): Global attributes are emited as the latest.
3359
3360 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3361
3362         * class.cs (EmitFieldInitializers): Don't emit field initializer
3363         for default values when optimilization is on.
3364         
3365         * constant.cs (Constant.IsDefaultValue): New property.
3366         
3367         * driver.cs: Add /optimize handling.
3368         
3369         * constant.cs,
3370         * ecore.cs,
3371         * literal.cs: Implement new IsDefaultValue property.
3372         
3373         * rootcontext.cs (Optimize): New field, holds /optimize option.
3374
3375 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix crasher in re-opened #72347.
3378         * namespace.cs (Namespace.Lookup): Return null if
3379         DeclSpace.DefineType returns null.
3380
3381         Fix #72678.
3382         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3383
3384 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3385
3386         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3387         now returns null if it cannot resolve to an lvalue.
3388         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3389         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3390         returned null.  Remove check for SimpleName.
3391         (EventExpr.DoResolveLValue): New.
3392         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3393         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3394         error from ...
3395         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3396         avoid CS0131 error.
3397         (Unary.ResolveOperator): Move CS0211 check ...
3398         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3399         CS0131 error.
3400         (Unary.DoResolveLValue): Simplify.
3401         (AddressOf.DoResolveLValue): New.
3402         (ArrayAccess.DoResolveLValue): New.
3403
3404 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3405
3406         * attribute.cs (Attribute.Resolve): Add arguments casting for
3407         when types doesn't match ctor arguments.
3408
3409 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3410
3411         Fix parts of #63202.
3412         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3413         lookup of operator in base type.  Ensure that all checks happen
3414         when the operator resolves to an "op_..." method.
3415
3416 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3417
3418         Fix #71992.
3419         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3420         'ignore_cs0104' parameter.  Pass it to ...
3421         (NamespaceEntry.Lookup): ... this.
3422         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3423         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3424         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3425         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3426         Update.  Request that cs0104 errors be ignored.
3427         (ComposedCast.ResolveAsTypeStep): Update.
3428
3429 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3430
3431         Fix #59209.
3432         * expression.cs (Invocation.BetterFunction): Remove support for
3433         comparing virtual functions and their overrides.
3434         (Invocation.IsOverride): New.
3435         (Invocation.OverloadResolve): Don't consider 'override' functions
3436         during candidate selection.  Store them in a lookaside list.
3437         If the selected method is a 'virtual' function, use the list to
3438         find any overrides that are closer to the LHS type.
3439
3440 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3441
3442         * expression.cs (New.DoResolve): Add complex core type reduction.
3443         (New.Constantify): Converts complex core type syntax like 'new int ()'
3444         to simple constant.
3445         
3446 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3447
3448         * decl.cs (EntryType.EntryType): New constructor to create an
3449         updated copy of a cache entry.
3450         (MemberCache.AddMethods): Use it.
3451         (MemberCache.ClearDeclaredOnly): Remove.
3452         (MemberCache.MemberCache): Update.
3453
3454 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3455
3456         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3457         variable.  This one is represents the actual low-level declaration
3458         of the method, as opposed to the semantic level `IsStatic'.   
3459
3460         An anonymous method which is hosted into a static method might be
3461         actually an instance method.  IsStatic would reflect the
3462         container, while MethodIsStatic represents the actual code
3463         generated.
3464
3465         * expression.cs (ParameterReference): Use the new MethodIsStatic
3466         instead of IsStatic.
3467
3468         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3469         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3470         set on the current EmitContext. 
3471
3472         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3473         resolve our casted expression as an LValue.  This triggers the
3474         proper LValue processing that is later required by Assign.
3475
3476         This fixes 72347.
3477
3478         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3479
3480 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3481
3482         C# 2.0 Fixed buffer implementation
3483
3484         * anonymous.cs: Update after RegisterHelperClass renaming.
3485
3486         * attribute.cs (AttributeTester.fixed_buffer_cache):
3487         Cache of external fixed buffers.
3488         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3489         implementation if field is fixed buffer else null.
3490
3491         * class.cs
3492         (TypeContainer.AddField): Accept FieldMember instead of Field.
3493         (FieldBase.IsFieldClsCompliant): Extracted code from
3494         VerifyClsCompliance descendant customization.
3495         (FixedField): New class handles fixed buffer fields.
3496         (FixedFieldExternal): Keeps information about imported fixed
3497         buffer.
3498         (IFixedField): Make access to internal or external fixed buffer
3499         same.
3500
3501         * cs-parser.jay: Add fixed buffer parsing.
3502
3503         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3504         buffer.
3505
3506         * expression.cs (Indirection): Extended implementation to accept
3507         fixed buffer field.
3508         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3509         (ElementAccess.MakePointerAccess): Get type as parameter.
3510         (DoResolve): Add fixed buffer field expression conversion.
3511         (DoResolveLValue): Ditto.
3512         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3513         (ArrayPtr): Derives from FixedBufferPtr.
3514         (ArrayPtr.Emit): Add extra emit for array elements.
3515
3516         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3517
3518         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3519         for compiler generated types.
3520         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3521
3522         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3523         and consume less memory.
3524         (Fixed.Resolve): Add fixed buffer case.
3525
3526         * typemanager.cs (compiler_generated_attr_ctor,
3527         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3528         (HasElementType): Add our own implementation to work on every
3529         runtime.
3530
3531 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3532
3533         * anonymous.cs (CaptureContext): Track whether `this' has been
3534         referenced.   
3535
3536         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3537         only captured `this' if it was implicitly done (instance
3538         methods/variables were used). 
3539
3540         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3541         `this' must be captured.
3542
3543 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3544  
3545         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3546         is null it means that there has been no need to capture anything,
3547         so we just create a sibling.
3548
3549         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3550
3551         Just a partial fix.  The other half is fairly elusive.
3552         
3553 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3554
3555         Fix #52586, cs0121-4.cs.
3556         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3557         and return a hashtable.
3558         (MemberCache.ClearDeclaredOnly): New.
3559         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3560         the method_hash of a base type too.
3561         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3562         type methods.  Overwrite entries with the same MethodHandle so
3563         that the ReflectedType is correct.  The process leaves in base
3564         virtual functions and their overrides as distinct entries.
3565         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3566         matters since it was boxed in a ArrayList before.
3567         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3568         modifier.
3569         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3570         case of a virtual function and its override (choose the overload
3571         as better).
3572         (Invocation.OverloadResolve): Avoid 'override' members during
3573         'applicable_type' calculation.
3574
3575 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3576
3577         Combine two near-redundant caches.
3578         * typemanager.cs (method_params): Rename from method_internal_params.
3579         (TypeManager.GetParameterData): New.  Replace
3580         Invocation.GetParameterData.
3581         (TypeManager.LookupParametersByBuilder): Remove.
3582         * expression.cs (Invocation.method_parameter_cache): Remove.
3583         (Invocation.GetParameterData): Remove.
3584         Update to changes.
3585         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3586         Update to changes.
3587
3588 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3589
3590         Fix #72015.
3591         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3592         TypeManager.multicast_delegate_type is null, resolve it by looking
3593         up "System.MulticastDelegate".
3594         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3595
3596 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3597             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3598             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3599
3600         Fix cs0164.cs.
3601         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3602         (LabeledStatement.AddReference): New.  Set 'referenced'.
3603         (Goto.Resolve): Use it.
3604
3605 2005-02-05  John Luke  <john.luke@gmail.com>
3606
3607         * driver.cs: remove duplicate -doc line in Usage ()
3608
3609 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3610
3611         * location.cs (Location.AddFile): Fix CS2002 error report.
3612
3613 2005-02-02  Martin Baulig  <martin@ximian.com>
3614
3615         * delegate.cs (Delegate.DefineType): Report an internal error if
3616         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3617         details.        
3618
3619 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3620
3621         Fix a crasher in a variant of #31984.
3622         * const.cs (Constant.CheckBase): New override that defers the
3623         new-or-override check in case the base type hasn't been populated
3624         yet.
3625         (Constant.Define): Ensure the new-or-override check is performed.
3626
3627 2005-02-01  Duncan Mak  <duncan@ximian.com>
3628
3629         * const.cs (LookupConstantValue): Check that `ce' is not null
3630         before calling GetValue ().
3631
3632 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3633
3634         Fix test-334.cs (#69519).
3635         * cs-parser.jay (using_alias_directive): Pass in an expression to
3636         NamespaceEntry.UsingAlias.
3637         (using_namespace_directive): Pass in an expression to
3638         NamespaceEntry.Using.
3639         (namespace_name): Don't flatten to a string.
3640         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3641         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3642         ResolveAsTypeStep.
3643         (NamespaceEntry.UsingEntry): Likewise.
3644         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3645         changes.
3646         (NamespaceEntry.LookupForUsing): Remove.
3647         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3648         names.
3649         (NamespaceEntry.Lookup): Remove support for dotted names.
3650
3651 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3652
3653         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3654         split into two.
3655         (NamespaceEntry.ImplicitParent): Compute on demand.
3656         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3657         parallels the current.
3658         (NamespaceEntry.LookupForUsing): Use it.
3659         (NamespaceEntry.Lookup): If the current namespace-entry is
3660         implicit, don't search aliases and using tables.
3661
3662 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3663
3664         Fix #31984.
3665         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3666         BaseCache here.
3667         (TypeContainer.BaseCache): Compute on demand.
3668         (TypeContainer.FindMembers): Define constants and types if they're
3669         not already created.
3670         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3671         check.
3672         * const.cs (Constant.Define): Make idempotent.
3673
3674 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3675
3676         * pending.cs: Produce better code (no nops produced by using Ldarg
3677         + value).
3678         
3679         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3680         i - 1' it should be arg + 1.
3681
3682         Fixes bug #71819.
3683
3684 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3685
3686         * attribute.cs (Attribute.CheckAttributeType): Make private
3687         non-virtual.
3688         (Attribute.ResolveType): Make virtual.
3689         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3690         handling of RootContext.Tree.Types.
3691
3692 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3693
3694         Update attribute-handling to use the SimpleName/MemberAccess
3695         mechanisms.
3696         * cs-parser.jay (attribute): Pass in an expression to the
3697         constructors of Attribute and GlobalAttribute.
3698         * attribute.cs (Attribute): Take an expression for the name.
3699         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3700         passed in attribute name expression.
3701         (Attribute.CheckAttributeType): Use it.
3702         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3703         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3704         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3705         argument to prevent error messages if the lookup fails.
3706
3707 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3708
3709         * expression.cs (Indirection): Implemented IVariable interface
3710         to support indirection in AddressOf operator.
3711         (PointerArithmetic.Emit): Add optimalization for case where
3712         result can be precomputed.
3713
3714 2005-01-26  Martin Baulig  <martin@ximian.com>
3715
3716         * class.cs (TypeContainer.AttributeTargets): Return the correct
3717         AttributeTargets depending on our `Kind' instead of throwing an
3718         exception; fixes #71632.
3719
3720 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3721
3722         Fix #71257
3723         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3724         constant members.
3725
3726 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3727
3728         Fix #71602.
3729         * expression.cs (MemberAccess.DoResolve): Don't complain with
3730         cs0572 when the LHS of a member access has identical name and type
3731         name.
3732
3733 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3734
3735         Fix #71651, #71675
3736         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3737         CreatePermission.
3738         Create custom PermissionSet only for PermissionSetAttribute.
3739
3740 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3741
3742         Fix #71649
3743         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3744         delegates in static class.
3745
3746 2005-01-24  Martin Baulig  <martin@ximian.com>
3747
3748         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3749         merging an implicit block, just use its reachability.
3750
3751         * statement.cs (Block.Resolve): Make the unreachable code check
3752         work wrt. implicit blocks; see test-337 from #63842.
3753
3754 2005-01-21  Alp Toker  <alp@atoker.com>
3755  
3756         * cs-parser.jay: destructor_declaration's container is PartialContainer
3757         not Class when partial types are used, so use Kind prop instead of
3758         'is'.
3759         
3760 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3761
3762         * cs-parser.jay: Improve error reporting when an interface
3763         declares new types.
3764
3765 2005-01-20  Dick Porter  <dick@ximian.com>
3766
3767         * support.cs: SeekableStreamReader fix from Sandor Dobos
3768         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3769         chars are read.  Fixes bug 70369.
3770
3771 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3772
3773         * cs-parser.jay (catch_clause): Simplify current_block handling
3774         somewhat.
3775
3776 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3777
3778         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3779         code with ImplicitStandardConversion to handle the implicit
3780         conversion of method groups into valid delegate invocations. 
3781
3782         The problem is that in parameter handling we were using this code
3783         path.  Fixes bug #64698
3784
3785 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3786
3787         * cs-parser.jay: Fix several infelicities.
3788         - Avoid assigning to the parser value stack.  Code like 
3789           '$3 = null' is unclean.  Synthesize a value for the code block
3790           instead. 
3791         - Avoid using oob_stack for storing location information.  Use ...
3792         (_mark_): ... this.  New (empty) rule.  Saves the current location
3793         in $$.
3794         (foreach_statement): Avoid using oob_stack for current_block
3795         handling.  Use technique used in for_statement and
3796         using_statement.  Synthesize a value for the code block to store
3797         additional intermediate information.
3798
3799 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3800
3801         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3802         of a different type is only allowed to private fields of a
3803         containing type, not on fields of a base class.
3804
3805         See test-174.cs and error cs0122-9.cs
3806
3807 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3808
3809         Fix test-335.cs (bug #58126).
3810         * cs-parser.jay (argument): Split out non-expression parts of the
3811         rule into 'non_simple_argument'.
3812         (invocation_expression): Support parenthesized invocations with
3813         multiple arguments, and with single non-simple arguments.
3814
3815 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3816
3817         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3818         places.
3819
3820 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3821
3822         Fix cs0038-1.cs, cs1640-6.cs.
3823         * ecore.cs (Expression.Resolve): Remove special-case for
3824         SimpleName in error-handling.
3825         (Expression.almostMatchedMembers): Relax access permission to
3826         protected.
3827         (Expression.MemberLookupFailed): Handle duplicates in
3828         almostMatchedMembers list.
3829         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3830         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3831         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3832         overload if the passed in MemberInfo is a MethodBase.
3833
3834 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3835
3836         Fix #70749
3837         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3838         for non-CAS & merge permission sets properly.
3839
3840 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3841
3842         Improve standard-compliance of simple name and member access 
3843         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3844         * ecore.cs (FullNamedExpression): New abstract base class 
3845         for Namespaces and TypeExpressions.
3846         (ResolveFlags.SimpleName): Remove.
3847         (SimpleName): Remove support for dotted names.
3848         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3849         DeclSpace.FindType and DeclSpace.LookupType.
3850         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3851         (Expression.ExprClassName): Make member function.
3852         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3853         a namespace.  Remove creation of dotted "SimpleName"s.
3854         (MemberAccess.DoResolve): Likewise.
3855         * decl.cs (DeclSpace.Cache): Make private.
3856         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3857         (DeclSpace.FindType): Update.
3858         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3859         FullNamedExpression.
3860         * namespace.cs (Namespace): Derive from FullNamedExpression
3861         so that it can be part of expression resolution.
3862         (Namespace.Lookup): Return an FullNamedExpression.
3863         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3864         namespace.
3865         * rootcontext.cs (NamespaceLookup): Remove.
3866         (LookupType): Move to DeclSpace.
3867         * attribute.cs (CheckAttributeType): Update.
3868         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3869         (FindDocumentedTypeNonArray): Likewise.
3870
3871 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3872
3873         Fix cs0509.cs, cs1632.cs.
3874         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3875         is the same as IsInterface.
3876         (TypeContainer.GetClassBases): Likewise.
3877         * statement.cs (LabeledStatement.ig): New field.
3878         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3879         label.
3880         (LabeledStatement.DoEmit): Check that the label was created with
3881         the same ILGenerator.
3882
3883 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3884
3885         Fix #71058
3886         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3887         accessors to its properties.
3888
3889         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3890         from accessors to property.
3891         
3892 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3893
3894         Fix #70722
3895         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3896         only for overrides.
3897         
3898 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3899
3900         * attribute.cs: Check for null and empty strings.  
3901
3902         I have lost another battle to Paolo.
3903
3904 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3905
3906         Fix #70942
3907         * class.cs (PropertyMethod): Set Parent field in ctors.
3908         (SetMethod.InternalParameters): Add unsafe switch hack.
3909         Override MarkForDuplicationCheck where it is appropriate.
3910
3911         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3912         It says whether container allows members with the same name.
3913         Base default is no.
3914         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3915         Removed is_method parameter.
3916
3917 2005-01-06  Duncan Mak  <duncan@ximian.com>
3918
3919         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3920         because the previous change led to incorrect reporting of CS1032
3921         ("Cannot define/undefine preprocessor symbols after first token in
3922         file"). Instead of using `tokens_seen' as the only flag that
3923         triggers CS1040, introduce `comments_seen'. This new flag is used
3924         to signify having seen comments on the current line, so it is
3925         unset after a newline.
3926
3927 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3928
3929         * doc.cs : When searching for a type, find nested type too.
3930           This fixes bug #71040.
3931
3932 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3933
3934         * doc.cs :
3935           - Warn missing member comment on those classes which also does not
3936             have doc comments. Fixed bug #71041.
3937           - Don't warn missing doc comment on default constructor.
3938             Fixed bug #71042.
3939
3940 2005-01-06  Duncan Mak  <duncan@ximian.com>
3941
3942         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3943         comments, set `tokens_seen' to true. This allows us to detect
3944         misplaced preprocessor directives (i.e. not at the beginning of
3945         the a line, nor after whitespaces). In that case, report error
3946         CS1040. This fixes bug #56460.
3947
3948         * cs-parser.jay (interface_member_declaration): Add checks for
3949         IsExplicitImpl, and report CS0541 error if an interface member is
3950         defined as an explicit interface declaration.
3951
3952 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3953
3954         Fix #70817
3955         * class.cs (PropertyMethod): Set Parent field in ctors.
3956         (SetMethod.InternalParameters): Add unsafe switch hack.
3957         
3958         * decl.cs (MemberCore.Parent): Cannot be readonly.
3959
3960 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3961
3962         * decl.cs (DeclSpace.ResolveType): Remove.
3963         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3964         Merge in code from ...
3965         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3966         * class.cs, enum.cs: Update to changes.
3967
3968 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3969
3970         * anonymous.cs: Ensure that we init the scope of our parent if it
3971         has not been initialized yet.
3972
3973 2004-12-30  Duncan Mak  <duncan@ximian.com>
3974
3975         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3976         if field.FieldBuilder is null. Fixes #70758.
3977
3978         * convert.cs: Fixed some typos and updated some of the comments.
3979         (ImplicitStandardConversionExists):
3980         (TryImplicitIntConversion): If `target_type' is an interface and
3981         the type of `ic' implements this interface, return true or a new
3982         BoxedCast instead of null. This fixes #70468.
3983
3984 2004-12-29  Duncan Mak  <duncan@ximian.com>
3985
3986         * expression.cs (Argument.Emit): Check that Expr is
3987         IMemoryLocation before casting to it, and report CS1510 otherwise.
3988
3989         This fixes #70402.
3990
3991 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3992
3993         * statement.cs (Block.ThisVariable): remove the recursion here, to
3994         make the --profile more sane.
3995
3996 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3997
3998         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3999         assembly, by JB Evain.
4000
4001 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4002
4003         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4004           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4005         "parent" refers to enclosing type/class.  "base" refers to superclass.
4006
4007 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4008
4009         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4010         Ensure that we only have GlobalAttributes.
4011         * attribute.cs (Attribute.Emit): Make non-virtual.
4012         (GlobalAttribute.Emit): Remove.
4013         (Attribute.Resolve): Make virtual.
4014         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4015         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4016         the argument. Don't create one.
4017         (Attribute.GetObsoleteAttribute): Likewise.
4018         (Attribute.GetClsCompliantAttributeValue): Likewise.
4019         * class.cs, decl.cs: Update to changes.
4020
4021 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4022
4023         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4024         
4025         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4026         
4027         * statement.cs (Foreach.Resolve): Add error 186 report.
4028
4029 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4030
4031         * expression.cs (Conditional.DoResolve): Add warning 429.
4032         
4033         * statement.cs (If.Resolve): Add warning 665.
4034
4035 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4036
4037         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4038         except when in the parser, and in GlobalAttribute.
4039         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4040         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4041         RootContext.Tree.Types.NamespaceEntry once work is done.
4042         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4043         and resets RootContext.Tree.Types.NamespaceEntry.
4044
4045 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4046
4047         * cs-parser.jay: Don't create a block for every variable.
4048
4049 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4050
4051         * location.cs: Provide extra information.
4052
4053         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4054         variables from the captured environment, it is the ldarg_0.
4055
4056 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4057
4058         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4059         find a conclusion.
4060         
4061         * class.cs: Changed warning level for 169 to avoid developer
4062         displeasure from warning flooding. It will be changed back when they
4063         fix most of current BCL warnings.
4064         
4065         * RootContext.cs: Pushed default WarningLevel to 3.
4066         
4067         * statement.cs: Removed unused variable.
4068
4069 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4070
4071         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4072         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4073         Add error 502 report.
4074         (StaticClass.DefineType): Add error 441 report.
4075         (Class.AllowedModifiersProp): New virtual property as temporary
4076         extension to AllowedModifiers.
4077         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4078         to share implementation with StaticClass and don't call virtual
4079         methods from ctor.
4080         
4081         * driver.cs (MainDriver): Add error 1558 test.
4082
4083         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4084         report. Moved error 36 test here.
4085
4086         * statement.cs (Throw.Resolve): Add error 724 report.
4087
4088         * typemanager.cs: Add out_attribute_type core type.
4089         
4090 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4091
4092         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4093         3018 report.
4094         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4095
4096         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4097         3017 report.
4098         
4099         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4100
4101         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4102         Add error 3023 report.
4103         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4104
4105         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4106         implementation.
4107
4108 2004-12-12  John Luke  <john.luke@gmail.com>
4109
4110         * driver.cs (AddArgs): take -- into account when
4111         adding arguments, fixes bug 65710 
4112
4113 2004-12-12  Martin Baulig  <martin@ximian.com>
4114
4115         * expression.cs (Unary.TryReduceNegative): Added support for
4116         SByteConstant and ByteConstant.
4117         (Unary.Reduce): Check error values from TryReduceNegative().
4118
4119 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4120
4121         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4122         and report exception as error 182.
4123
4124 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4125
4126         * driver.cs (Main): Fix message when there are warnings.
4127
4128 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4129
4130         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4131
4132 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4133
4134         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4135         Reduced number of warnings.
4136         
4137         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4138
4139 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4140
4141         * driver.cs: Removed message.
4142
4143         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4144
4145 2004-12-08    <vargaz@freemail.hu>
4146
4147         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4148
4149 2004-12-08  Martin Baulig  <martin@ximian.com>
4150
4151         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4152         instead of a CS3002 for properties and indexer.
4153
4154 2004-12-08  Martin Baulig  <martin@ximian.com>
4155
4156         * decl.cs (MemberName.ToString): Make this work again.
4157
4158 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4159
4160         * attribute.cs (Resolve): Add error 591 detection.
4161
4162         * class.cs (FieldMember.Define): Add error 1547 detection.
4163         (Indexer.Define): Add error 620 detection.
4164         (Operator.Define): Add error 590 detection.
4165
4166         * ecore.cs: Missing argument for error 79.
4167
4168         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4169         detection.
4170
4171 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4172
4173         Fix #70106
4174         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4175         only.
4176
4177 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4178
4179         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4180           Some operator comments were suppressed.
4181         * doc.cs : Implicit/explicit operator name in doc comments are like
4182           "op_Explicit(type)~returnType", so added suffix handling.
4183
4184 2004-12-07  Martin Baulig  <martin@ximian.com>
4185
4186         * decl.cs
4187         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4188         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4189         (DeclSpace.ec): New protected field; store the EmitContext here.
4190         (DeclSpace.EmitContext): New public property; moved here from
4191         `TypeContainer'.
4192         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4193         EmitContext.
4194
4195         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4196         (Enum.Emit): Don't create a new EmitContext.
4197
4198         * delegate.cs (Delegate.DefineType): Always create the
4199         EmitContext.
4200
4201         * iterators.cs (Iterators.DefineIterator): Create a new
4202         EmitContext and store it in `ec'.
4203
4204 2004-08-24  Martin Baulig  <martin@ximian.com>
4205
4206         * typemanager.cs
4207         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4208         this for accessibility checks.
4209         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4210         IsNestedFamilyAccessible.
4211         (TypeManager.IsSubclassOf): New method, do what the name actually
4212         says.   
4213
4214 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4215
4216         Fix crash on cs0657-17.cs.
4217         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4218         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4219         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4220         the case where the NamespaceEntry gets overwritten.
4221
4222 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4223
4224         Fixed #69195, #56821
4225         * ecore.cs (ResolveBoolean): Tiny refactoring.
4226
4227         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4228         of right expression resolving when left is false constant and
4229         operator is LogicalAnd OR true constant and operator is LogicalOr.
4230
4231         * statement.cs (ResolveUnreachable): Always reports warning.
4232
4233 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4234
4235         * class.cs: Distinguish between 1721 and 1722 (just a little help
4236         for the programmer).
4237
4238 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4239
4240         * delegate.cs: Only allow this on new versions of the language. 
4241
4242 2004-12-02  Duncan Mak  <duncan@ximian.com>
4243
4244         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4245         Expression class.
4246         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4247         here as a static method. Take an additional bool out parameter
4248         `must_do_cs1540_check' for signaling to InstanceResolve.
4249         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4250         member field from PropertyExpr class and made it an argument of
4251         the method instead.
4252         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4253         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4254         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4255         and `remove_accessor' as well as InstanceResolve: report CS0122
4256         where applicable.
4257
4258         Fixes #70129.
4259
4260 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4261
4262         Fix test-327.cs, test-328.cs, and put in early infrastructure
4263         for eventually fixing #52697.
4264         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4265         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4266         from other methods.
4267         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4268         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4269         (VerifyUsing, error246): Update.
4270         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4271         'NamespaceEntry.LookupNamespaceOrType'.
4272
4273 2004-12-03  Martin Baulig  <martin@ximian.com>
4274
4275         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4276         method as our child, call AnonymousMethod.Compatible() on it.
4277
4278 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4279
4280         Disable XML documentation support in 'basic' profile.
4281         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4282         Redirect XmlElement to System.Object.
4283         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4284         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4285         * mcs.exe.sources: Add doc-bootstrap.cs.
4286         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4287         of doc.cs.
4288
4289 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4290
4291         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4292           comments are allowed.
4293
4294 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4295
4296         * delegate.cs: Add checks for subtypes in paramaters and return values
4297         in VerifyMethod () to add support for Covariance/Contravariance
4298         in delegates.
4299         
4300 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4301
4302         * report.cs: Remove extra closing parenthesis.
4303
4304         * convert.cs (Error_CannotImplicitConversion): If the name of the
4305         types are the same, provide some extra information.
4306
4307         * class.cs (FieldBase): Use an unused bit field from the field to
4308         encode the `has_offset' property from the FieldMember.  This saves
4309         a couple of Ks on bootstrap compilation.
4310
4311         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4312         method as our child, return the AnonymousMethod resolved
4313         expression.
4314
4315         * expression.cs (New.DoResolve): Allow return values from
4316         NewDelegate to also include AnonymousMethods.
4317
4318         Fixes #70150.
4319
4320 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4321
4322         Fix bug #70102
4323         * attribute.cs (Resolve): Improved implementation of params
4324         attribute arguments.
4325
4326         * support.cs (ParameterData): Add HasParams to be faster.
4327
4328 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4329
4330         all things are for /doc support:
4331
4332         * doc.cs: new file that supports XML documentation generation.
4333         * mcs.exe.sources: added doc.cs.
4334         * driver.cs:
4335           Handle /doc command line option.
4336           Report error 2006 instead of 5 for missing file name for /doc.
4337           Generate XML documentation when required, after type resolution.
4338         * cs-tokenizer.cs:
4339           Added support for picking up documentation (/// and /** ... */),
4340           including a new XmlCommentState enumeration.
4341         * cs-parser.jay:
4342           Added lines to fill Documentation element for field, constant,
4343           property, indexer, method, constructor, destructor, operator, event
4344           and class, struct, interface, delegate, enum.
4345           Added lines to warn incorrect comment.
4346         * rootcontext.cs :
4347           Added Documentation field (passed only when /doc was specified).
4348         * decl.cs:
4349           Added DocComment, DocCommentHeader, GenerateDocComment() and
4350           OnGenerateDocComment() and some supporting private members for
4351           /doc feature to MemberCore.
4352         * class.cs:
4353           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4354         * delegate.cs:
4355           Added overriden DocCommentHeader.
4356         * enum.cs:
4357           Added overriden DocCommentHeader and GenerateDocComment().
4358
4359 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4360
4361         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4362         unwrapping the enumeration values, chain to
4363         DoConstantNumericPromotions again, so we can promote things to the
4364         fundamental types (takes care of enums that are bytes, sbytes).
4365
4366         Fixes bug #62054.
4367
4368 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4369
4370         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4371         Fix long-standing bug in type-lookup.  Use FindType instead of
4372         LookupType when ec.ResolvingTypeTree.
4373         (Attribute.ResolveType, Attribute.Resolve)
4374         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4375         Update to changes.
4376         (Attributes.Search): Remove internal version.  Update.
4377         (Attributes.SearchMulti): Update.
4378         (Attributes.GetClsCompliantAttribute): Remove.
4379         (Attributes.GetIndexerNameAttribute): Remove.
4380         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4381         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4382         * class.cs (Indexer.Define): Likewise.
4383
4384 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4385
4386         Fix bug #68790
4387         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4388         MarshallByReference members access.
4389
4390         * expression.cs: Use CheckMarshallByRefAccess;
4391         Better error CS0197 message.
4392
4393         * report.cs: Print whole related error message.
4394
4395 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4396
4397         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4398         the current directory to help debugging.
4399
4400 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4401
4402         * class (GetClassBases): Better error 60 report.
4403         (EventProperty): Disabled warning 67 detection.
4404
4405 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4406
4407         Fix bug #60324
4408         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4409
4410         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4411         precise values.
4412
4413 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4414
4415         Fix bug #49488
4416         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4417
4418         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4419
4420 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4421
4422         * attribute.cs (Attribute.Resolve): Refine error reporting and
4423         report a cs0117 if the identifier does not exist, to distinguish
4424         from 0617 which is a miss-use of the actual identifier.
4425
4426         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4427         between cs0070 and cs0079.
4428
4429         * class.cs (MemberBase.DoDefine): When reporting a wrong
4430         accessibility level, we use MethodCore to compare instead of
4431         Method (this was a regression in some refactoring effort).
4432
4433         So now we correctly report cs0056 again.
4434
4435         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4436         testing the target_type (which was known to be object_type) and
4437         not the source type (which is anonymous_method).
4438
4439         Fixed reporting of error cs1660.
4440
4441         * expression.cs (UserCast.Source): Expose the underlying cast.
4442
4443         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4444         allowed types to find a match to int32 first (most common).
4445
4446         In addition, it ignores any ImplicitUserConversions that did an
4447         internal implicit conversion (as the switch statement allows only
4448         one integral conversion to exist).
4449
4450         * class.cs (PartialContainer.Create): rename `name' to
4451         `member_name' for clarity.  Then replace the string calls with a
4452         call to MemberName.GetPartialName, as now using
4453         MemberName.ToString is an error (this is due to the side effects
4454         it had, that were fixed in the past).
4455
4456         This will restore the error reporting on a number of partial class
4457         errors that were missusing this (and getting an exception as a
4458         results, which is now just a plain textual warning, because
4459         yyparse debug output would crash otherwise).
4460
4461 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4462
4463         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4464
4465 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4466
4467         * rootcontext.cs (LookupType): Make sure to cache lookups that
4468         don't give us a negative result. This saves about 5% of corlib
4469         compilation time.
4470
4471 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4472
4473         * report.cs (AbstractMessage.Print): messages are sent to stderr
4474
4475         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4476         non-interface in the list of interfaces (at this point, either
4477         parent was properly set, or a base class is being listed in the
4478         interfaces section).
4479
4480         This flags error 1722, and resolves the crash from bug 69259.
4481
4482 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4483
4484         * statement.cs (Using.EmitExpressionFinally): make this work right
4485         for valuetypes. Fixes 69926.
4486
4487 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4488
4489         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4490         converted to an enum" here, before we try to change the underlying
4491         type.  This code exists, but it is a different code path than the
4492         one used while encoding constants.
4493
4494         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4495         old bug: when converting from the null literal to a pointer,
4496         return an EmptyCast, not the NullLiteral.
4497
4498         This fixes #69921, the recent null_type changes probably made this
4499         bug more prominent.
4500
4501         (ImplicitReferenceConversionExists): In addition, resynchronized
4502         the code here, so it matches the same code in
4503         ImplicitReferenceConversionExists for the `from any class-type S
4504         to any interface-type T'.
4505         
4506
4507 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4508
4509         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4510
4511 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4512
4513         * cs-parser.jay: Use verbosity accordingly. 
4514
4515 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4516
4517         * expression.cs (Unary.ResolveOperator): Do not report warning;
4518         AddressOf reads from variable.
4519         
4520         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4521
4522 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4523
4524         Fix bug #69462
4525
4526         * attribute.cs (Attributable): Removed CheckTargets.
4527         (Attributes.Emit): Explicit attribute targets are tested here.
4528
4529         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4530         not enabled for interfaces.
4531
4532         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4533         (GetAssemblyName): Ouch next bug there.
4534
4535 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4536
4537         * expression.cs: Error 275 added.
4538         
4539 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4540
4541         Fix bug #69177 (Implemented decimal constant support)
4542
4543         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4544         (BinaryFold): Add DecimalConstant.
4545
4546         * const.cs (Define): Decimal constant 
4547         (is not constant.
4548         (ChangeType): Add decimal type handling.
4549         (LookupConstantValue): Don't set value for decimal type but
4550         emit DecimalConstantAttribute. Needed for constant optimization.
4551
4552         * constant.cs (ToDecimal): New method.
4553         (ConvertToDecimal): New method.
4554         (IntConstant): Implemented ConvertToDecimal.
4555         (DecimalConstant.Emit): Emit optimized version for decimals in
4556         int range.
4557
4558         * expression.cs (ResolveOperator): Changed order of constant
4559         reduction to work correctly with native types which have
4560         overloaded operators.
4561         (ResolveMemberAccess): Extract constant value from attribute
4562         for decimal type.
4563
4564         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4565
4566         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4567         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4568         (ChangeType): Decimal is special.
4569         (TypeToCoreType): Add decimal type.
4570
4571 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4572
4573         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4574         decimal types.
4575
4576 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4577
4578         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4579         test cs1667-5.cs.
4580
4581 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4582
4583         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4584
4585         * pending.cs (PendingImplementation): Grab only interfaces.
4586
4587 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4588
4589         * statement.cs (ForeachHelperMethods): Add location member and
4590         error 202 detection.
4591
4592 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4593
4594         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4595         automatically handled by executable.make.
4596         (PROGRAM): Make profile-specific.
4597
4598 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4599
4600         * expression.cs (DoResolveBase): Fixed wrong warning for out
4601         variables.
4602
4603 2004-11-18  Martin Baulig  <martin@ximian.com>
4604
4605         Merged latest changes into gmcs.  Please keep this comment in
4606         here, it makes it easier for me to see what changed in MCS since
4607         the last time I merged.
4608
4609 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4610
4611         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4612         (TypeHandle.GetMemberCache): New.
4613         (TypeHandle.TypeHandle): Update.
4614         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4615         (TypeManager.LookupParentInterfacesCache):
4616         Rename from LookupInterfaceCache.  Optimize slightly.
4617         (TypeManager.MemberLookup_FindMembers): Update.
4618         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4619         multi-type variant.
4620         (AddCacheContents): Rename from AddHashtable.
4621         * class.cs (TypeContainer.parent_container): Remove.
4622         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4623         (TypeContainer.DoDefineMembers): Don't initialize it.
4624         Update to name changes.
4625         
4626 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4627
4628         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4629         that factors the code to check access modifiers on override.  
4630
4631         (PropertyBase): Use the code here.
4632
4633         Patch from Lluis S'anchez, fixes bug #69361.
4634
4635 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4636
4637         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4638         routine that is used to report the use of a captured variable
4639         whose address has been taken.
4640
4641         There are two checks: one when variables are being captured and
4642         the other check is when the address of a variable is taken. 
4643         
4644         (because an anonymous methods might be resolved before *or* after
4645         the address has been taken) and 
4646
4647         * expression.cs (Conditional.DoResolve): Remove the special
4648         casing that Martin added to trueExpr and falseExpr being both
4649         NullLiteral.  We get the right behavior now just by introducing
4650         the null_type into the compiler. 
4651
4652         * convert.cs (ExplicitConversion): Change the code to use
4653         null_type instead of testing `expr is NullLiteral'.
4654         (ImplicitConversionStandard): use null_type too.
4655         (ImplicitReferenceConversionExists): use null_type too.
4656         (ImplicitReferenceConversion): use null_type too.
4657
4658         * literal.cs: The type of `NullLiteral' is now null_type instead
4659         of object_type. 
4660         (Resolve): Set the type here.
4661
4662         * typemanager.cs: Introduce null_type.
4663
4664 2004-11-17  Martin Baulig  <martin@ximian.com>
4665
4666         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4667         direction, like FindMembers() does.  Fixes #69546, testcase is in
4668         test-315.cs.    
4669
4670 2004-11-16  Martin Baulig  <martin@ximian.com>
4671
4672         This is based on a patch from Marek Safar, see bug #69082.
4673         Fixes bugs #63705 and #67130.
4674
4675         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4676         method; create a MemberCache for an interface type and cache the
4677         result.
4678
4679         * decl.cs (IMemberContainer.ParentContainer): Removed.
4680         (IMemberContainer.ParentCache): New property.
4681         (MemberCache.SetupCacheForInterface): Removed.
4682         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4683         to create a cache for an interface's "parent".
4684
4685         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4686         interfaces too.
4687
4688 2004-11-16  Martin Baulig  <martin@ximian.com>
4689
4690         Merged back from gmcs; these changes already went into gmcs a
4691         couple of weeks ago.
4692
4693         * typemanager.cs
4694         (TypeManager.AddUserType): Removed the `ifaces' argument.
4695         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4696         `TypeExpr []'.
4697         (TypeManager.AddUserInterface): Removed.
4698         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4699         `TypeExpr []'.
4700         (TypeManager.GetInterfaces): Likewise.
4701         (TypeManager.GetExplicitInterfaces): Likewise.
4702
4703         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4704
4705         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4706         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4707
4708 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4709
4710         * statement.cs: Avoid adding bools to a hashtable.
4711
4712 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4713
4714         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4715         calling an unsafe method from a safe location.
4716
4717 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4718
4719         Fix #69167
4720         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4721
4722 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4723
4724         * namespace.cs (VerifyUsing): use GetPartialName instead of
4725         ToString. 
4726
4727 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4728
4729         * statement.cs (Return.Resolve): Fix regression in typo: if
4730         `in_exc', we have to request a NeedReturnLabel, this was a typo
4731         introduced in the anonymous method check-in.  Fixes #69131.
4732
4733         * Indexers were using the ShortName when defining themselves,
4734         causing a regression in the compiler bootstrap when applying the
4735         patch from 2004-11-02 (first part), now they use their full name
4736         and the bug is gone.
4737
4738 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4739
4740         * driver.cs: Strip the path from the names of embedded resources. Fixes
4741         #68519.
4742
4743 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4744
4745         Fix error message regression: cs0104-2.cs.
4746         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4747         (AliasEntry.Resolve): Update.
4748         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4749         'silent' flag.
4750         (RootContext.LookupType): Update.
4751
4752 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4753
4754         * cs-parser.jay: Add support for handling accessor modifiers
4755         * class: Add support port accessor modifiers and error checking,
4756         define PropertyMethod.Define as virtual (not abstract anymore)
4757         * ecore.cs: Add checking for proeprties access with access modifiers
4758         * iterators.cs: Modify Accessor constructor call based in the modified
4759         constructor
4760 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4761
4762         * expression.cs (StringConcat): Handle being called twice,
4763         as when we have a concat in a field init with more than two
4764         ctors in the class
4765
4766 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4767
4768         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4769         special case explicit implementations, we should always produce
4770         the .property or .event declaration.
4771         
4772         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4773         since it will not return correct data if people use this
4774         unresolved in the presence of using statements (see test-313).
4775
4776         * class.cs (MethodData.Define): If we are an explicit interface
4777         implementation, set the method name to the full name of the
4778         interface plus the name of the method.  
4779
4780         Notice that using the method.MethodName.GetFullName() does not
4781         work, as it will only contain the name as declared on the source
4782         file (it can be a shorthand in the presence of using statements)
4783         and not the fully qualifed type name, for example:
4784
4785         using System;
4786
4787         class D : ICloneable {
4788                 object ICloneable.Clone ()  {
4789                 }
4790         }
4791
4792         Would produce a method called `ICloneable.Clone' instead of
4793         `System.ICloneable.Clone'.
4794
4795         * namespace.cs (Alias.Resolve): Use GetPartialName.
4796         
4797 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * cs-parser.jay: Add error 1055 report.
4800
4801 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4802
4803         * assign.cs (Assign.DoResolve): Only do the transform of
4804         assignment into a New if the types are compatible, if not, fall
4805         through and let the implicit code deal with the errors and with
4806         the necessary conversions. 
4807
4808 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4809
4810         * cs-parser.jay: Add error 1031 report.
4811
4812         * cs-tokenizer.cs: Add location for error 1038.
4813
4814 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4815
4816         * cs-parser.jay: Add error 1016 report.
4817
4818 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4819
4820         * cs-parser.jay: Add errors 1575,1611 report.
4821
4822 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4823
4824         * cs-parser.jay: Add error 1001 report.
4825
4826 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4827
4828         Fix #68850
4829         * attribute.cs (GetMarshal): Add method argument for
4830         caller identification.
4831
4832         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4833         agument for GetMarshal and RuntimeMissingSupport.
4834
4835 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4836
4837         * attribute.cs (ExtractSecurityPermissionSet): Removed
4838         TypeManager.code_access_permission_type.
4839
4840         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4841
4842 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4843
4844         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4845         for obsolete use of a variable here.   Fixes regression on errors
4846         cs0619-25 and cs0619-26.
4847
4848 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4849
4850         Fix #62358, implemented security attribute encoding.
4851
4852         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4853         Tests permitted SecurityAction for assembly or other types.
4854         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4855         data from SecurityPermissionAttribute to PermisionSet class.
4856
4857         * class.cs (ApplyAttributeBuilder): Added special handling
4858         for System.Security.Permissions.SecurityAttribute based types.
4859
4860         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4861         special handling for System.Security.Permissions.SecurityAttribute
4862         based types.
4863
4864         * enum.cs (ApplyAttributeBuilder): Added special handling
4865         for System.Security.Permissions.SecurityAttribute based types.
4866
4867         * parameter.cs (ApplyAttributeBuilder): Added special handling
4868         for System.Security.Permissions.SecurityAttribute based types.
4869
4870         * rootcontext.cs: Next 2 core types.
4871
4872         * typemanager.cs (TypeManager.security_permission_attr_type):
4873         Built in type for the SecurityPermission Attribute.
4874         (code_access_permission_type): Build in type.
4875
4876 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4877
4878         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4879         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4880         all of this information into
4881         EmitContext.EmitCapturedVariableInstance.
4882         
4883         * codegen.cs (EmitCapturedVariableInstance): move here the
4884         funcionality of emitting an ldarg.0 in the presence of a
4885         remapping.   This centralizes the instance emit code.
4886
4887         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4888         then emit a load of this: it means that we have reached the
4889         topmost ScopeInfo: the one that contains the pointer to the
4890         instance of the class hosting the anonymous method.
4891
4892         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4893         captures to the topmost CaptureContext.
4894
4895 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4896
4897         * expression.cs (LocalVariableReference): Move the knowledge about
4898         the iterators into codegen's EmitCapturedVariableInstance.
4899
4900 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4901
4902         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4903         all code paths return a value from an anonymous method (it is the
4904         same as the 161 error, but for anonymous methods).
4905
4906 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4907
4908         The introduction of anonymous methods in the compiler changed
4909         various ways of doing things in the compiler.  The most
4910         significant one is the hard split between the resolution phase
4911         and the emission phases of the compiler.
4912
4913         For instance, routines that referenced local variables no
4914         longer can safely create temporary variables during the
4915         resolution phase: they must do so from the emission phase,
4916         since the variable might have been "captured", hence access to
4917         it can not be done with the local-variable operations from the runtime.
4918         
4919         * statement.cs 
4920
4921         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4922         is a toplevel block.
4923
4924         (ToplevelBlock): A new kind of Block, these are the blocks that
4925         are created by the parser for all toplevel method bodies.  These
4926         include methods, accessors and anonymous methods.
4927
4928         These contain some extra information not found in regular blocks:
4929         A pointer to an optional CaptureContext (for tracking captured
4930         local variables and parameters).  A pointer to the parent
4931         ToplevelBlock.
4932         
4933         (Return.Resolve): Catch missmatches when returning a value from an
4934         anonymous method (error 1662).
4935         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4936         phase.
4937
4938         (Break.Resolve): ditto.
4939
4940         (SwitchLabel): instead of defining the labels during the
4941         resolution phase, we now turned the public ILLabel and ILLabelCode
4942         labels into methods called GetILLabelCode() and GetILLabel() that
4943         only define the label during the Emit phase.
4944
4945         (GotoCase): Track the SwitchLabel instead of the computed label
4946         (its contained therein).  Emit the code by using
4947         SwitchLabel.GetILLabelCode ().
4948
4949         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4950         whether the Local has been captured or not.
4951
4952         (LocalInfo.IsCaptured): New property, used to tell whether the
4953         local has been captured.
4954         
4955         * anonymous.cs: Vastly updated to contain the anonymous method
4956         support.
4957
4958         The main classes here are: CaptureContext which tracks any
4959         captured information for a toplevel block and ScopeInfo used to
4960         track the activation frames for various local variables.   
4961
4962         Each toplevel block has an optional capture context associated
4963         with it.  When a method contains an anonymous method both the
4964         toplevel method and the anonymous method will create a capture
4965         context.   When variables or parameters are captured, they are
4966         recorded on the CaptureContext that owns them, for example:
4967
4968         void Demo () {
4969              int a;
4970              MyDelegate d = delegate {
4971                  a = 1;
4972              }
4973         }
4974
4975         Here `a' will be recorded as captured on the toplevel
4976         CapturedContext, the inner captured context will not have anything
4977         (it will only have data if local variables or parameters from it
4978         are captured in a nested anonymous method.
4979
4980         The ScopeInfo is used to track the activation frames for local
4981         variables, for example:
4982
4983         for (int i = 0; i < 10; i++)
4984                 for (int j = 0; j < 10; j++){
4985                    MyDelegate d = delegate {
4986                         call (i, j);
4987                    }
4988                 }
4989
4990         At runtime this captures a single captured variable `i', but it
4991         captures 10 different versions of the variable `j'.  The variable
4992         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4993         recorded on a child.  
4994
4995         The toplevel ScopeInfo will also track information like the `this'
4996         pointer if instance variables were referenced (this is necessary
4997         as the anonymous method lives inside a nested class in the host
4998         type of the method). 
4999
5000         (AnonymousMethod): Expanded to track the Toplevel, implement
5001         `AnonymousMethod.Compatible' to tell whether an anonymous method
5002         can be converted to a target delegate type. 
5003
5004         The routine now also produces the anonymous method content
5005
5006         (AnonymousDelegate): A helper class that derives from
5007         DelegateCreation, this is used to generate the code necessary to
5008         produce the delegate for the anonymous method that was created. 
5009
5010         * assign.cs: API adjustments for new changes in
5011         Convert.ImplicitStandardConversionExists.
5012
5013         * class.cs: Adjustments to cope with the fact that now toplevel
5014         blocks are of type `ToplevelBlock'. 
5015
5016         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5017         insteda of standard blocks.
5018
5019         Flag errors if params arguments are passed to anonymous methods.
5020
5021         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5022         `CurrentAnonymousMethod' which points to the current Anonymous
5023         Method.  The variable points to the AnonymousMethod class that
5024         holds the code being compiled.  It is set in the new EmitContext
5025         created for the anonymous method.
5026
5027         (EmitContext.Phase): Introduce a variable and an enumeration to
5028         assist in enforcing some rules about when and where we are allowed
5029         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5030         only one that enfonces this right now).
5031
5032         (EmitContext.HaveCaptureInfo): new helper method that returns
5033         whether we have a CapturedContext initialized.
5034
5035         (EmitContext.CaptureVariable): New method used to register that a
5036         LocalInfo must be flagged for capturing. 
5037
5038         (EmitContext.CapturedParameter): New method used to register that a
5039         parameters must be flagged for capturing. 
5040         
5041         (EmitContext.CapturedField): New method used to register that a
5042         field must be flagged for capturing. 
5043
5044         (EmitContext.HaveCapturedVariables,
5045         EmitContext.HaveCapturedFields): Return whether there are captured
5046         variables or fields. 
5047
5048         (EmitContext.EmitMethodHostInstance): This is used to emit the
5049         instance for the anonymous method.  The instance might be null
5050         (static methods), this (for anonymous methods that capture nothing
5051         and happen to live side-by-side with the current method body) or a
5052         more complicated expression if the method has a CaptureContext.
5053
5054         (EmitContext.EmitTopBlock): Routine that drives the emission of
5055         code: it will first resolve the top block, then emit any metadata
5056         and then emit the code.  The split is done so that we can extract
5057         any anonymous methods and flag any captured variables/parameters.
5058         
5059         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5060         during this phase, the ILGenerator should not be used as labels
5061         and local variables declared here might not be accessible to any
5062         code that is part of an anonymous method.  
5063
5064         Exceptions to this include the temporary variables that are
5065         created by some statements internally for holding temporary
5066         variables. 
5067         
5068         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5069         metadata for a cb
5070
5071         (EmitContext.TemporaryReturn): This method is typically called
5072         from the Emit phase, and its the only place where we allow the
5073         ReturnLabel to be defined other than the EmitMeta.  The reason is
5074         that otherwise we would have to duplicate a lot of logic in the
5075         Resolve phases of various methods that today is on the Emit
5076         phase. 
5077
5078         (EmitContext.NeedReturnLabel): This no longer creates the label,
5079         as the ILGenerator is not valid during the resolve phase.
5080
5081         (EmitContext.EmitThis): Extended the knowledge in this class to
5082         work in anonymous methods in addition to iterators. 
5083
5084         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5085         code is necessary on the stack to access the instance to a local
5086         variable (the variable will be accessed as a field).
5087
5088         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5089         EmitContext.EmitAddressOfParameter): Routines to support
5090         parameters (not completed at this point). 
5091         
5092         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5093         will also remove the parameters.
5094
5095         * convert.cs (Convert): Define a `ConstantEC' which points to a
5096         null.  This is just to prefity some code that uses
5097         ImplicitStandardConversion code and do not have an EmitContext
5098         handy.
5099
5100         The idea is to flag explicitly that at that point in time, it is
5101         known that the conversion will not trigger the delegate checking
5102         code in implicit conversions (which requires a valid
5103         EmitContext). 
5104
5105         Everywhere: pass new EmitContext parameter since
5106         ImplicitStandardConversionExists now requires it to check for
5107         anonymous method conversions. 
5108
5109         (Convert.ImplicitStandardConversionExists): If the type of an
5110         expression is the anonymous_method_type, and the type is a
5111         delegate, we invoke the AnonymousMethod.Compatible method to check
5112         whether an implicit conversion is possible. 
5113
5114         (Convert.ImplicitConversionStandard): Only do implicit method
5115         group conversions if the language level is not ISO_1.
5116
5117         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5118         MethodInfo for the Invoke method.  used by Delegate and
5119         AnonymousDelegate.
5120
5121         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5122         method conversions if the target type is a delegate.
5123
5124         Removed extra debugging nops.
5125
5126         (LocalVariableReference): Turn the `local_info' into a public
5127         field. 
5128
5129         Add `prepared' field, the same hack used for FieldExprs to cope
5130         with composed assignments, as Local variables do not necessarily
5131         operate purely on the stack as they used to: they can be captured
5132         fields. 
5133
5134         Add `temp' for a temporary result, like fields.
5135
5136         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5137
5138         It now copes with Local variables that are captured and emits the
5139         proper instance variable to load it from a field in the captured
5140         case. 
5141
5142         (ParameterReference.DoResolveBase): During the resolve phase,
5143         capture parameters if we are in an anonymous method.
5144
5145         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5146         anonymous method, use the EmitContext helper routines to emit the
5147         parameter reference.
5148
5149         * iterators.cs: Set RemapToProxy to true/false during the
5150         EmitDispose class.
5151
5152         * parameters.cs (GetParameterByName): New helper method. 
5153
5154         * typemanager.cs (anonymous_method_type) a new type that
5155         represents an anonyous method.  This is always an internal type,
5156         used as a fencepost to test against the anonymous-methodness of an
5157         expression. 
5158         
5159 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5160
5161         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5162         561 report.
5163         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5164
5165 2004-10-18  Martin Baulig  <martin@ximian.com>
5166
5167         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5168         `Type' directly, but call ResolveType() on it.
5169         (Catch.Resolve): Likewise.
5170         (Foreach.Resolve): Likewise.
5171
5172 2004-10-18  Martin Baulig  <martin@ximian.com>
5173
5174         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5175         `Type' directly, but call ResolveType() on it.
5176         (Probe.DoResolve): Likewise.
5177         (ArrayCreation.LookupType): Likewise.
5178         (TypeOf.DoResolve): Likewise.
5179         (SizeOf.DoResolve): Likewise.
5180
5181 2004-10-18  Martin Baulig  <martin@ximian.com>
5182
5183         * expression.cs (Invocation.BetterFunction): Put back
5184         TypeManager.TypeToCoreType().
5185
5186 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5187
5188         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5189         the ResolveType.
5190
5191 2004-10-18  Martin Baulig  <martin@ximian.com>
5192
5193         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5194         `Type' directly, but call ResolveType() on it.
5195
5196 2004-10-18  Martin Baulig  <martin@ximian.com>
5197
5198         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5199         `Type' directly, but call ResolveType() on it.
5200         (MemberBase.DoDefine): Likewise.
5201
5202         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5203         `Type' directly, but call ResolveType() on it.
5204         (ComposedCast.DoResolveAsTypeStep): Likewise.
5205
5206         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5207         `Type' directly, but call ResolveType() on it.
5208
5209 2004-10-17  John Luke  <john.luke@gmail.com>
5210
5211         * class.cs (Operator.GetSignatureForError): use CSharpName
5212
5213         * parameter.cs (Parameter.GetSignatureForError): Returns
5214         correct name even if was not defined.
5215
5216 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5217
5218         Fix #65816.
5219         * class.cs (TypeContainer.EmitContext): New property.
5220         (DefineNestedTypes): Create an emitcontext for each part.
5221         (MethodCore.DoDefineParameters): Use container's emitcontext.
5222         Pass type array to InternalParameters.
5223         (MemberBase.DoDefine): Use container's emitcontext.
5224         (FieldMember.Define): Likewise.
5225         (Event.Define): Likewise.
5226         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5227         Pass type array to InternalParameters.
5228         (SetIndexerMethod.GetParameterInfo): Likewise.
5229         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5230         * delegate.cs (Define): Pass emitcontext to
5231         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5232         array to InternalParameters.
5233         * expression.cs (ParameterReference.DoResolveBase): Pass
5234         emitcontext to GetParameterInfo.
5235         (ComposedCast.DoResolveAsTypeStep): Remove check on
5236         ec.ResolvingTypeTree.
5237         * parameter.cs (Parameter.Resolve): Change argument to
5238         EmitContext.  Use ResolveAsTypeTerminal.
5239         (Parameter.GetSignature): Change argument to EmitContext.
5240         (Parameters.ComputeSignature): Likewise.
5241         (Parameters.ComputeParameterTypes): Likewise.
5242         (Parameters.GetParameterInfo): Likewise.
5243         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5244         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5245         * support.cs (InternalParameters..ctor): Remove variant that takes
5246         a DeclSpace.
5247         * typemanager.cs (system_intptr_expr): New.
5248         (InitExpressionTypes): Initialize it.
5249
5250 2004-10-12  Chris Toshok  <toshok@ximian.com>
5251
5252         * cs-parser.jay: fix location for try_statement and catch_clause.
5253
5254 2004-10-11  Martin Baulig  <martin@ximian.com>
5255
5256         * report.cs: Don't make --fatal abort on warnings, we have
5257         -warnaserror for that.
5258
5259 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5260
5261         More DeclSpace.ResolveType avoidance.
5262         * decl.cs (MemberCore.InUnsafe): New property.
5263         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5264         with newly created EmitContext.
5265         (FieldMember.Define): Likewise.
5266         * delegate.cs (Delegate.Define): Likewise.
5267         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5268         only if normal name-lookup fails.
5269         (TypeExpr.DoResolve): Enable error-checking.
5270         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5271         (SizeOf.DoResolve): Likewise.
5272         (ComposedCast.DoResolveAsTypeStep): Likewise.
5273         (StackAlloc.DoResolve): Likewise.
5274         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5275         (Block.Unsafe): New property.
5276         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5277         (Unsafe): Set 'unsafe' flag of contained block.
5278         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5279         (Fixed.Resolve): Likewise.
5280         (Catch.Resolve): Likewise.
5281         (Using.ResolveLocalVariableDecls): Likewise.
5282         (Foreach.Resolve): Likewise.
5283
5284 2004-10-05  John Luke <john.luke@gmail.com>
5285
5286         * cs-parser.jay: add location to error CS0175
5287
5288 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5289
5290         * ecore.cs (Expression.Constantity): Add support for turning null
5291         into a constant.
5292
5293         * const.cs (Const.Define): Allow constants to be reference types
5294         as long as the value is Null.
5295
5296 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5297
5298         * namespace.cs (NamespaceEntry.Using): No matter which warning
5299         level is set, check if this namespace name has already been added.
5300
5301 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5302
5303         * expression.cs: reftype [!=]= null should always use br[true,false].
5304         # 67410
5305
5306 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5307
5308         Fix #67108
5309         * attribute.cs: Enum conversion moved to 
5310         GetAttributeArgumentExpression to be applied to the all
5311         expressions.
5312
5313 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5314
5315         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5316         * class.c (TypeContainer.DefineType): Flag error if
5317         base types aren't accessible due to access permissions.
5318         * decl.cs (DeclSpace.ResolveType): Move logic to
5319         Expression.ResolveAsTypeTerminal.
5320         (DeclSpace.ResolveTypeExpr): Thin layer over
5321         Expression.ResolveAsTypeTerminal.
5322         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5323         Refactor code into NestedAccess.  Use it.
5324         (DeclSpace.NestedAccess): New.
5325         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5326         argument to silence errors.  Check access permissions.
5327         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5328         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5329         (Cast.DoResolve): Likewise.
5330         (New.DoResolve): Likewise.
5331         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5332         (TypeOf.DoResolve): Likewise.
5333
5334         * expression.cs (Invocation.BetterConversion): Return the Type of
5335         the better conversion.  Implement section 14.4.2.3 more faithfully.
5336         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5337         section 14.4.2.2 explicit.
5338         (Invocation.OverloadResolve): Update.
5339         (Invocation): Remove is_base field.
5340         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5341         (Invocation.Emit): Likewise.
5342
5343 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5344
5345         * README: Update to changes.
5346
5347 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5348
5349         * cs-parser.jay: Reverted 642 warning fix.
5350
5351 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5352
5353         Fix bug #66615
5354         * decl.cs (FindMemberWithSameName): Indexer can have more than
5355         1 argument.
5356
5357 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5358
5359         * expression.cs (LocalVariableReference.DoResolveLValue):
5360         Do not report warning 219 for out values.
5361         (EmptyExpression.Null): New member to avoid extra allocations.
5362
5363 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5364
5365         * cs-parser.jay: Fix wrong warning 642 report.
5366
5367         * cs-tokenizer.cs (CheckNextToken): New helper;
5368         Inspect next character if is same as expected.
5369
5370 2004-09-23  Martin Baulig  <martin@ximian.com>
5371
5372         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5373         (Convert.ImplicitReferenceConversionExists): Likewise.
5374
5375 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5376
5377         * class.cs (Operator.Define): Add error 448 and 559 report.
5378
5379 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5380
5381         * class.cs (MemberBase.IsTypePermitted): New protected
5382         method for checking error CS0610.
5383
5384 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5385
5386         * class.cs (TypeContainer.HasExplicitLayout): New property
5387         Returns whether container has StructLayout attribute set Explicit.
5388         (FieldMember): New abstract class for consts and fields.
5389         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5390         (Field): Reuse FieldMember.
5391
5392         * const.cs (Const): Reuse FieldMember.
5393
5394         * rootcontext.cs: EmitConstants call moved to class.
5395
5396 2004-09-22  Martin Baulig  <martin@ximian.com>
5397
5398         Thanks to Peter Sestoft for this bug report.
5399
5400         * expression.cs (Conditional): If both the `trueExpr' and the
5401         `falseExpr' is a NullLiteral, return a NullLiteral.
5402
5403 2004-09-22  Martin Baulig  <martin@ximian.com>
5404
5405         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5406         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5407         for the "get_Current" call.
5408
5409 2004-09-22  Martin Baulig  <martin@ximian.com>
5410
5411         Marek and me just fixed one of our oldest bugs: #28562 :-)
5412
5413         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5414
5415         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5416         we're an EnumConstant, just return that.
5417         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5418         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5419         to get the value which'll actually be written into the attribute.
5420         However, we have to use GetValue() to access the attribute's value
5421         in the compiler.        
5422
5423 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5424
5425         * constant.cs (Constant.IsNegative): New abstract property
5426         IsNegative.
5427
5428         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5429         (StackAlloc.DoResolve): Reused IsNegative.
5430
5431 2004-09-21  Martin Baulig  <martin@ximian.com>
5432
5433         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5434         if we're used in an iterator, we may be called from different
5435         methods.
5436
5437         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5438         we actually have an exception block.
5439
5440 2004-09-20  John Luke <jluke@cfl.rr.com>
5441
5442         * class.cs, cs-parser.jay: Improve the error report for 1520:
5443         report the actual line where the error happens, not where the
5444         class was declared.
5445
5446         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5447         Pass location information that was available elsewhere.
5448
5449 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5450
5451         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5452         runtime to delay sign assemblies.
5453
5454 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5455
5456         * cs-parser.jay: Do not report the stack trace, this is barely
5457         used nowadays.
5458
5459 2004-08-22  John Luke  <john.luke@gmail.com>
5460  
5461         * driver.cs : check that a resource id is not already used
5462         before adding it, report CS1508 if it is, bug #63637
5463
5464 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5465
5466         * ecore.cs: Removed dead code.
5467
5468 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5469
5470         * class.cs: Do not report warning CS0067 on the interfaces.
5471
5472 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5473
5474         * cs-parser.jay: Add error 504 report.
5475
5476 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5477
5478         * rootcontext.cs: WarningLevel is 4 by default now.
5479
5480         * statement.cs (Fixed.Resolve): Do not null
5481         VariableInfo.
5482
5483 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5484
5485         Fixed bug #55780
5486         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5487         deep search when property is not virtual.
5488         (PropertyExpr.ResolveAccessors): Make one call for both
5489         accessors.
5490
5491 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5492
5493         Fixed bug #65766
5494         * statement.cs: Error 152 report constains also location.
5495
5496 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5497
5498         Fixed bug #65766
5499         * const.cs: Explicitly set constant as static.
5500
5501 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5502
5503         Fixed bug #64226
5504         * cs-parser.jay: Add error 1017 report.
5505
5506 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5507
5508         Fixed bug #59980, #64224
5509         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5510
5511         * typemanager.cs (IsSpecialMethod): Simplified
5512
5513 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5514
5515         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5516         condition with better params.
5517
5518 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5519
5520         Fixed bug #65238
5521         * attribute.cs (Resolve): Property has to have both
5522         accessors.
5523
5524 2004-09-14  Martin Baulig  <martin@ximian.com>
5525
5526         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5527
5528 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5529
5530         Fixed bug #61902
5531         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5532         called and is obsolete then this member suppress message
5533         when call is inside next [Obsolete] method or type.
5534
5535         * expression.cs: Use TestObsoleteMethodUsage member.
5536
5537 2004-09-14  Martin Baulig  <martin@ximian.com>
5538
5539         * cs-parser.jay: Sync a bit with the GMCS version.
5540
5541 2004-09-14  Martin Baulig  <martin@ximian.com>
5542
5543         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5544         (CSharpParser.yacc_verbose_flag): New public field.
5545
5546         * genericparser.cs: Removed.
5547
5548 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5549
5550         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5551
5552 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5553
5554         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5555
5556 2004-09-10  Martin Baulig  <martin@ximian.com>
5557
5558         Backported my MemberName changes from GMCS into MCS.
5559
5560         - we are now using a special `MemberName' class instead of using
5561         strings; in GMCS, the `MemberName' also contains the type
5562         arguments.
5563
5564         - changed the grammar rules a bit:
5565           * the old `member_name' is now a `namespace_or_type_name':
5566             The rule is that we use `namespace_or_type_name' everywhere
5567             where we expect either a "member name" (GetEnumerator) or a
5568             "member name" with an explicit interface name
5569             (IEnumerable.GetEnumerator).
5570             In GMCS, the explicit interface name may include type arguments
5571             (IEnumerable<T>.GetEnumerator).
5572           * we use `member_name' instead of just `IDENTIFIER' for
5573             "member names":
5574             The rule is that we use `member_name' wherever a member may
5575             have type parameters in GMCS.       
5576
5577         * decl.cs (MemberName): New public class.
5578         (MemberCore.MemberName): New public readonly field.
5579         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5580         (DeclSpace): Likewise.
5581
5582         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5583         * enum.cs (Enum.ctor): Likewise.
5584
5585         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5586         MemberName.     
5587         (AliasEntry.ctor): Take a MemberName, not an Expression.
5588         (AliasEntry.UsingAlias): Likewise.
5589
5590         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5591         (IMethodData.MemberName): Changed type from string to MemberName.
5592         (MemberBase.ExplicitInterfaceName): Likewise.
5593         (AbstractPropertyEventMethod.SetupName): Make this private.
5594         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5595         argument; compute the member name here.
5596         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5597         on the `member.MemberName' and the `prefix'.
5598
5599         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5600         not `type_name'.
5601         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5602         thus, we get a `MemberName' instead of a `string'.  These
5603         declarations may have type parameters in GMCS.
5604         (interface_method_declaration, delegate_declaration): Likewise.
5605         (class_declaration, interface_declaration): Likewise.
5606         (method_header): Use `namespace_or_type_name' instead of
5607         `member_name'.  We may be an explicit interface implementation.
5608         (property_declaration, event_declaration): Likewise.
5609         (member_name): This is now just an `IDENTIFIER', not a
5610         `namespace_or_type_name'.
5611         (type_name, interface_type): Removed.
5612         (namespace_or_type_name): Return a MemberName, not an Expression.
5613         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5614         call GetTypeExpression() on the MemberName to get an expression.
5615         (IndexerDeclaration.interface_type): Changed type from string to
5616         MemberName.
5617         (MakeName): Operate on MemberName's instead of string's.
5618
5619 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5620
5621         Fix bug #55770.
5622         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5623         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5624         lookup to avoid symbols introduced by 'using'.
5625         * rootcontext.cs (NamespaceLookup): Update.
5626
5627 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5628
5629         * class.cs (TypeContainer.DoDefineMembers): Do not call
5630         DefineDefaultConstructor for static classes.
5631
5632 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5633
5634         * attribute.cs (Attribute.Resolve): Add error 653 report.
5635
5636         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5637         report.
5638         (Method.ApplyAttributeBuilder): Add error 685 report.
5639         (Operator.Define): Add error 564 report.
5640
5641         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5642
5643         * expression.cs (Invocation.DoResolve): Add error
5644         245 and 250 report.
5645
5646         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5647         error 674 report.
5648
5649 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5650
5651         * class.cs (ConstructorInitializer.Resolve):
5652         Wrong error number (515->516).
5653
5654 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5655
5656         * class.cs (Indexer.Define): Add error 631 report.
5657
5658 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5659
5660         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5661
5662 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5665
5666 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5667
5668         * cs-parser.jay: Added error CS0241 report.
5669
5670 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5671
5672         * cs-parser.jay (fixed_statement): Introduce a scope for the
5673         declaration in the 'fixed' statement.
5674
5675 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5676
5677         * cs-parser.jay: Added CS0230 error report.
5678
5679 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5680
5681         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5682
5683 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5684
5685         * expression.cs (Argument.Resolve): Added error CS0192 and
5686         CS0199 report.
5687
5688 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5689
5690         C# 2.0 #pragma warning feature
5691
5692         * cs-tokenizer.cs (PreProcessPragma): New method; 
5693         Handles #pragma directive.
5694
5695         * report.cs (WarningRegions): New class; Support
5696         class for #pragma warning directive. It tests whether
5697         warning is enabled for a given line.
5698
5699 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5700
5701         * const.cs: Add more descriptive error report, tahnks to
5702         Sebastien. 
5703
5704 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5705
5706         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5707
5708 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5709
5710         * expression.cs: Apply patch from Ben: Remove dead code from
5711         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5712         as that code just threw an exception anwyays.
5713
5714         * const.cs: Remove the call to the turnintoconstant, for details
5715         see bug: #63144
5716         
5717         * literal.cs: The type of the null-literal is the null type;  So
5718         we use a placeholder type (literal.cs:System.Null, defined here)
5719         for it.
5720
5721         * expression.cs (Conditional.DoResolve): Remove some old code that
5722         is no longer needed, conversions have been fixed.
5723
5724         (ArrayCreationExpression.DoResolve): Return false if we fail to
5725         resolve the inner expression.
5726
5727 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5728
5729         Fix test-290.cs.
5730         * cs-parser.jay (delegate_declaration): Record a delegate
5731         declaration as a type declaration.
5732         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5733
5734 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5735
5736         * parameter.cs: Do not crash if the type can not be resolved. 
5737
5738         * expression.cs: Report errors with unsafe pointers, fixes #64896
5739
5740 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5741
5742         * expression.cs: Pointer arith always needs to do a conv.i
5743         if the operand is a long. fix 65320
5744
5745 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5746
5747         Fixed cs0619-37.cs, cs0619-38.cs
5748
5749         * enum.cs (GetObsoleteAttribute): Removed.
5750
5751         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5752         on Enum member is double staged. The first is tested member
5753         and then enum.
5754
5755 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5756
5757         Fixed #56986, #63631, #65231
5758
5759         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5760         adds member to name container.
5761         (TypeContainer.AddToTypeContainer): New method, adds type to
5762         name container.
5763         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5764         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5765         AddOperator): Simplified by reusing AddToMemberContainer.
5766         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5767         instead of field.
5768         (Method.CheckForDuplications): Fixed implementation to test all
5769         possibilities.
5770         (MemberBase): Detection whether member is explicit interface
5771         implementation is now in constructor.
5772         (MemberBase.UpdateMemberName): Handles IndexerName.
5773         (Accessor): Changed to keep also location information.
5774         (AbstractPropertyEventMethod): Is derived from MemberCore.
5775         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5776         will be emited or not.
5777         (PropertyBase.AreAccessorsDuplicateImplementation):
5778         Tests whether accessors are not in collision with some method.
5779         (Operator): Is derived from MethodCore to simplify common
5780         operations.
5781
5782         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5783         must be performed.
5784         (DeclSpace.AddToContainer): Adds the member to defined_names
5785         table. It tests for duplications and enclosing name conflicts.
5786
5787         * enum.cs (EnumMember): Clean up to reuse the base structures
5788
5789 2004-09-03  Martin Baulig  <martin@ximian.com>
5790
5791         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5792         into TypeContainer, to make partial classes work again.
5793
5794 2004-09-03  Martin Baulig  <martin@ximian.com>
5795
5796         * rootcontext.cs (RootContext.V2): Removed.
5797
5798 2004-03-23  Martin Baulig  <martin@ximian.com>
5799
5800         * expression.cs (Invocation.OverloadResolve): Added `bool
5801         may_fail' argument and use it instead of the Location.IsNull() hack.
5802
5803 2004-09-03  Martin Baulig  <martin@ximian.com>
5804
5805         Merged latest changes into gmcs.  Please keep this comment in
5806         here, it makes it easier for me to see what changed in MCS since
5807         the last time I merged.
5808
5809 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5810
5811         Fix #61128.
5812         * expression.cs (BetterConversion): Don't allow either conversion 
5813         to be null.  Remove redundant implicit conversion test when 'q ==
5814         null' -- when this function is invoked, we already know that the
5815         implicit conversion exists.
5816         (BetterFunction): Assume that 'best' is non-null.  Remove
5817         redundant reimplementation of IsApplicable when 'best' is null.
5818         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5819         number of arguments.
5820         (IsAncestralType): Extract from OverloadResolve.
5821         (OverloadResolve): Make robust to the MethodGroupExpr being
5822         unsorted.  Implement all the logic of Section 14.5.5.1, and
5823         support overloading of methods from multiple applicable types.
5824         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5825
5826         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5827         (RealError, Warning): Append type of report to related symbol.
5828
5829 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5830
5831         * enum.cs: Fixed CLS-Compliance checks for enum members.
5832         Error tests cs3008-8.cs, cs3014-8.cs
5833
5834 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5835
5836         Fixed bug #62342, #63102
5837         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5838         like ImplementMethod.
5839
5840 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5841
5842         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5843         Fixed bug #65170.
5844
5845 2004-09-02  Martin Baulig  <martin@ximian.com>
5846
5847         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5848         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5849         on the MethodBase.
5850
5851 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5852
5853         C# 2.0 Static classes implemented
5854
5855         * class.cs (TypeContainer): instance_constructors,
5856         initialized_fields, initialized_static_fields,
5857         default_constructor, base_inteface_types are protected to be
5858         accessible from StaticClass.
5859         (TypeContainer.DefineDefaultConstructor): New virtual method
5860         for custom default constructor generating
5861         (StaticClass): New class to handle "Static classes" feature.
5862
5863         * cs-parser.jay: Handle static keyword on class like instance
5864         of StaticClass.
5865
5866         * driver.cs: Added "/langversion" command line switch with two
5867         options (iso-1, default).
5868
5869 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5870
5871         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5872
5873 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5874
5875         * delegate.cs: Style.
5876
5877 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5878
5879         * delegate.cs: Add seperate instance expr field for miguel.
5880
5881 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5882
5883         * PointerArithmetic (Resolve): make sure we are not doing
5884         pointer arith on void*. Also, make sure we are resolved
5885         by not setting eclass until resolve.
5886
5887         All callers: Make sure that PointerArithmetic gets resolved.
5888
5889 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5890
5891         * ArrayCreation (LookupType): If the type does not resolve 
5892         to an array, give an error.
5893
5894 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5895
5896         * statement.cs (Try.Resolve): Fixed bug #64222
5897
5898 2004-08-27  Martin Baulig  <martin@ximian.com>
5899
5900         * class.cs
5901         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5902         crash here.     
5903
5904 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5905
5906         * ecore.cs (Constantify): Get underlying type via
5907         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5908         Windows in special cases.
5909
5910 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5911
5912         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5913         for obtaining also private methods.
5914         (GetRemoveMethod): Used GetRemoveMethod (true)
5915         for obtaining also private methods.
5916
5917 2004-08-24  Martin Baulig  <martin@ximian.com>
5918
5919         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5920         MethodAttributes.HideBySig for operators.
5921
5922 2004-08-23  Martin Baulig  <martin@ximian.com>
5923
5924         Back to the old error reporting system :-)
5925
5926         * report.cs (Message): Removed.
5927         (Report.MessageData, ErrorData, WarningData): Removed.
5928         (Report.Error, Warning): Back to the old system.
5929
5930 2004-08-23  Martin Baulig  <martin@ximian.com>
5931
5932         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5933
5934         * class.cs (TypeContainer.ParentContainer): New public virtual
5935         method; replaces the explicit interface implementation.
5936         (ClassPart.ParentContainer): Override.
5937
5938 2004-08-23  Martin Baulig  <martin@ximian.com>
5939
5940         * statement.cs (Switch): Added support for constant switches; see
5941         #59428 or test-285.cs.
5942
5943 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5944
5945         Fixed bug #62740.
5946         * statement.cs (GetEnumeratorFilter): Removed useless
5947         logic because C# specs is strict. GetEnumerator must be
5948         public.
5949
5950 2004-08-22  Martin Baulig  <martin@ximian.com>
5951
5952         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5953         a switch and may break, reset the barrier.  Fixes #59867.
5954
5955 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5956
5957         CLS-Compliance speed up (~5% for corlib)
5958
5959         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5960         New method. Tests container for CLS-Compliant names
5961
5962         * class.cs (TypeContainer.VerifyClsName): New method.
5963         Checks whether container name is CLS Compliant.
5964         (Constructor): Implements IMethodData.
5965
5966         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5967         low-case table for CLS Compliance test.
5968         (MemberCache.VerifyClsParameterConflict): New method.
5969         Checks method parameters for CS3006 error.
5970
5971         * enum.cs (EnumMember): Is derived from MemberCore.
5972         (Enum.VerifyClsName): Optimized for better performance.
5973
5974 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5975
5976         * report.cs: Renamed Error_T to Error and changed all
5977         references.
5978
5979 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5980
5981         * class.cs (TypeContainer.IndexerArrayList): New inner class
5982         container for indexers.
5983         (TypeContainer.DefaultIndexerName): New constant for default
5984         indexer name. Replaced all "Item" with this constant.
5985         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5986
5987         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5988         DefaultMemberAttribute constructor.
5989
5990 2004-08-05  Martin Baulig  <martin@ximian.com>
5991
5992         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5993         Fix bug #59429.
5994
5995 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5996
5997         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5998         multi platforms problem.
5999
6000         * compiler.csproj: Included shared files.
6001
6002 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6003
6004         Fix bug 60333, 55971 in the more general way
6005         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6006         Added arg_type argument for constant conversion.
6007         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6008
6009 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6010
6011         Fix bug #59760
6012         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6013         OperatorArrayList, MethodCoreArrayList for typecontainer
6014         containers. Changed class member types to these new types.
6015         (MethodArrayList.DefineMembers): Added test for CS0659.
6016
6017 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6018
6019         * cfold.cs: Synchronize the folding with the code in expression.cs
6020         Binary.DoNumericPromotions for uint operands.
6021
6022         * attribute.cs: Revert patch from Raja, it introduced a regression
6023         while building Blam-1.2.1 (hard to isolate a test case).
6024
6025 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6026
6027         Fix for #55382
6028         * class.cs:
6029         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6030         name collision.
6031         (MethodCore.parent_method): New member. The method we're overriding
6032         if this is an override method.
6033         (MethodCore.CheckBase): Moved from Method class and made common.
6034         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6035         private.
6036         (MethodCore.CheckForDuplications): New abstract method. For custom
6037         member duplication search in a container
6038         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6039         method and its return type.
6040         (Event.conflict_symbol): New member. Symbol with same name in the
6041         parent class.
6042
6043         * decl.cs:
6044         (MemberCache.FindMemberWithSameName): New method. The method
6045         is looking for conflict with inherited symbols.
6046
6047 2004-08-04  Martin Baulig  <martin@ximian.com>
6048
6049         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6050
6051         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6052
6053 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6054
6055         * report.cs (Message): New enum for better error, warning reference in
6056         the code.
6057         (MessageData): New inner abstract class. It generally handles printing of
6058         error and warning messages.
6059         Removed unused Error, Warning, Message methods.
6060
6061 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6062
6063         Fix for cs0592-8.cs test
6064         * attribute.cs
6065         (Attributable.ValidAttributeTargets): Made public.
6066         (Attribute.ExplicitTarget): New member for explicit target value.
6067         (Attribute.CheckTargets): Now we translate explicit attribute
6068         target to Target here.
6069
6070 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6071
6072         * ecore.cs (MethodGroupExpr): new IsBase property.
6073
6074         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6075
6076         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6077         rather than an instance expr.
6078
6079         (DelegateCreation.Emit): Use the method group rather than
6080         the instance expression. Also, if you have base.Foo as the
6081         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6082
6083         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6084
6085         (NewDelegate.DoResolve): Only check for the existance of Invoke
6086         if the method is going to be needed. Use MethodGroupExpr.
6087
6088         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6089
6090         * expression.cs: For pointer arith., make sure to use
6091         the size of the type, not the size of the pointer to
6092         the type.
6093
6094 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6095
6096         Fix for #60722
6097         * class.cs (Class): Added error CS0502 test.
6098
6099 2004-08-03  John Luke  <jluke@cfl.rr.com>
6100             Raja R Harinath  <rharinath@novell.com>
6101
6102         Fix for #60997.
6103         * attribute.cs (Attribute.complained_before): New flag.
6104         (Attribute.ResolveType, Attribute.Resolve),
6105         (Attribute.DefinePInvokeMethod): Set it.
6106         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6107         
6108 2004-08-03  Martin Baulig  <martin@ximian.com>
6109
6110         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6111         use a user-defined operator; we still need to do numeric
6112         promotions in case one argument is a builtin type and the other
6113         one has an implicit conversion to that type.  Fixes #62322.
6114
6115 2004-08-02  Martin Baulig  <martin@ximian.com>
6116
6117         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6118         (LocalInfo.IsThis): New public property.
6119         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6120
6121 2004-08-01  Martin Baulig  <martin@ximian.com>
6122
6123         * class.cs (TypeContainer.GetClassBases): Don't set the default
6124         here since we may get called from GetPartialBases().
6125         (TypeContainer.DefineType): If GetClassBases() didn't return a
6126         parent, use the default one.
6127
6128 2004-07-30  Duncan Mak  <duncan@ximian.com>
6129
6130         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
6131
6132 2004-07-30  Martin Baulig  <martin@ximian.com>
6133
6134         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6135
6136         * class.cs (SourceMethod): New public class, derive from the
6137         symbol writer's ISourceMethod.
6138         (Method): Use the new symbol writer API.
6139
6140         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6141         as argument and use the new symbol writer.
6142
6143         * location.cs
6144         (SourceFile): Implement the symbol writer's ISourceFile.
6145         (Location.SymbolDocument): Removed.
6146         (Location.SourceFile): New public property.
6147
6148         * symbolwriter.cs: Use the new symbol writer API.
6149
6150 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6151
6152         * Makefile (install-local): Remove.  Functionality moved to
6153         executable.make.
6154
6155 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6156
6157         * Makefile: Install mcs.exe.config file together with mcs.exe.
6158         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6159         correct runtime version.
6160         
6161 2004-07-25  Martin Baulig  <martin@ximian.com>
6162
6163         * class.cs
6164         (TypeContainer.RegisterOrder): Removed, this was unused.
6165         (TypeContainer, interface_order): Removed.
6166         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6167         TypeContainer as argument since we can also be called with a
6168         `PartialContainer' for a partial class/struct/interface.
6169         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6170         of checking whether we're an `Interface' - we could be a
6171         `PartialContainer'.
6172         (PartialContainer.Register): Override; call
6173         AddClass()/AddStruct()/AddInterface() on our parent.
6174
6175         * cs-parser.jay (interface_member_declaration): Add things to the
6176         `current_container', not the `current_class'.
6177
6178         * rootcontext.cs (RegisterOrder): The overloaded version which
6179         takes an `Interface' was unused, removed.
6180
6181         * typemanager.cs (TypeManager.LookupInterface): Return a
6182         `TypeContainer', not an `Interface'.
6183         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6184         contain a `PartialContainer' for an interface, so check it's
6185         `Kind' to figure out what it is.
6186
6187 2004-07-25  Martin Baulig  <martin@ximian.com>
6188
6189         * class.cs (Class.DefaultTypeAttributes): New public constant.
6190         (Struct.DefaultTypeAttributes): Likewise.
6191         (Interface.DefaultTypeAttributes): Likewise.
6192         (PartialContainer.TypeAttr): Override this and add the
6193         DefaultTypeAttributes.
6194
6195 2004-07-25  Martin Baulig  <martin@ximian.com>
6196
6197         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6198         we can just use the `Parent' field instead.
6199
6200 2004-07-25  Martin Baulig  <martin@ximian.com>
6201
6202         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6203
6204 2004-07-25  Martin Baulig  <martin@ximian.com>
6205
6206         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6207         our parts before defining any methods.
6208         (TypeContainer.VerifyImplements): Make this virtual.
6209         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6210         on our PartialContainer.
6211
6212 2004-07-25  Martin Baulig  <martin@ximian.com>
6213
6214         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6215
6216         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6217         argument, we can just use the `Parent' field instead.
6218
6219         * class.cs
6220         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6221         (MemberBase.DoDefine): Likewise.
6222
6223 2004-07-24  Martin Baulig  <martin@ximian.com>
6224
6225         * decl.cs (MemberCore.Parent): New public field.
6226         (DeclSpace.Parent): Moved to MemberCore.
6227
6228         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6229         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6230         parent's .ctor.
6231         (FieldBase, Field, Operator): Likewise.
6232         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6233         (EventField, Event): Likewise.
6234
6235 2004-07-23  Martin Baulig  <martin@ximian.com>
6236
6237         * class.cs (PartialContainer): New public class.
6238         (ClassPart): New public class.
6239         (TypeContainer): Added support for partial classes.
6240         (TypeContainer.GetClassBases): Splitted some of the functionality
6241         out into GetNormalBases() and GetPartialBases().
6242
6243         * cs-tokenizer.cs (Token.PARTIAL): New token.
6244         (Tokenizer.consume_identifier): Added some hacks to recognize
6245         `partial', but only if it's immediately followed by `class',
6246         `struct' or `interface'.
6247
6248         * cs-parser.jay: Added support for partial clases.
6249
6250 2004-07-23  Martin Baulig  <martin@ximian.com>
6251
6252         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6253         a `DeclSpace' and also made it readonly.
6254         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6255         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6256         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6257
6258         * cs-parser.jay: Pass the `current_class', not the
6259         `current_container' (at the moment, this is still the same thing)
6260         to a new Method, Property, Event, Indexer or Constructor.
6261
6262 2004-07-23  Martin Baulig  <martin@ximian.com>
6263
6264         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6265         and removed the `current_interface' one.
6266         (struct_declaration, class_declaration, interface_declaration):
6267         Set `current_class' to the newly created class/struct/interface;
6268         set their `Bases' and call Register() before parsing their body.
6269
6270 2004-07-23  Martin Baulig  <martin@ximian.com>
6271
6272         * class.cs (Kind): New public enum.
6273         (TypeContainer): Made this class abstract.
6274         (TypeContainer.Kind): New public readonly field.
6275         (TypeContainer.CheckDef): New public method; moved here from
6276         cs-parser.jay.
6277         (TypeContainer.Register): New public abstract method.
6278         (TypeContainer.GetPendingImplementations): New public abstract
6279         method.
6280         (TypeContainer.GetClassBases): Removed the `is_class' and
6281         `is_iface' parameters.
6282         (TypeContainer.DefineNestedTypes): Formerly known as
6283         DoDefineType().
6284         (ClassOrStruct): Made this class abstract.
6285
6286         * tree.cs (RootTypes): New public type. 
6287
6288 2004-07-20  Martin Baulig  <martin@ximian.com>
6289
6290         * tree.cs (Tree.RecordNamespace): Removed.
6291         (Tree.Namespaces): Removed.
6292
6293         * rootcontext.cs (RootContext.IsNamespace): Removed.
6294
6295         * cs-parser.jay (namespace_declaration): Just create a new
6296         NamespaceEntry here.
6297
6298 2004-07-20  Martin Baulig  <martin@ximian.com>
6299
6300         * statement.cs (ExceptionStatement): New abstract class.  This is
6301         now used as a base class for everyone who's using `finally'.
6302         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6303         our local variables before using them.
6304
6305         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6306         virtual method.  This is used by Yield.Resolve() to "steal" an
6307         outer block's `finally' clauses.
6308         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6309         argument.
6310
6311         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6312         version which takes an ExceptionStatement.  This version must be
6313         used to create exception branchings.
6314
6315         * iterator.cs
6316         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6317         (Iterator.EmitMoveNext): Added exception support; protect the
6318         block with a `fault' clause, properly handle 'finally' clauses.
6319         (Iterator.EmitDispose): Run all the `finally' clauses here.
6320
6321 2004-07-20  Martin Baulig  <martin@ximian.com>
6322
6323         * iterator.cs: This is the first of a set of changes in the
6324         iterator code.  Match the spec more closely: if we're an
6325         IEnumerable, then GetEnumerator() must be called.  The first time
6326         GetEnumerator() is called, it returns the current instance; all
6327         subsequent invocations (if any) must create a copy.
6328
6329 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6330
6331         * expression.cs: Resolve the constant expression before returning
6332         it. 
6333
6334 2004-07-19  Martin Baulig  <martin@ximian.com>
6335
6336         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6337         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6338         the return type of the new EmitContext.
6339
6340 2004-07-18  Martin Baulig  <martin@ximian.com>
6341
6342         * class.cs (Property.Define): Fix iterators.
6343
6344         * iterators.cs (Iterator.Define): Moved the
6345         `container.AddInterator (this)' call here from the .ctor; only do
6346         it if we resolved successfully.
6347
6348 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6349
6350         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6351         `true' for preprocessing directives that we parse.  The return
6352         value indicates whether we should return to regular tokenizing or
6353         not, not whether it was parsed successfully.
6354
6355         In the past if we were in: #if false ... #line #endif, we would
6356         resume parsing after `#line'.  See bug 61604.
6357
6358         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6359         building: IsEnumType should return true only for enums, not for
6360         enums or System.Enum itself.  This fixes #61593.
6361
6362         Likely what happened is that corlib was wrong: mcs depended on
6363         this bug in some places.  The bug got fixed, we had to add the
6364         hack, which caused bug 61593.
6365
6366         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6367         that was a workaround for the older conditions.
6368
6369 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6370
6371         * assign.cs: IAssignMethod has a new interface, as documented
6372         inline. All assignment code now uses this new api.
6373
6374         * ecore.cs, expression.cs: All classes which implement
6375         IAssignMethod now use the new interface.
6376
6377         * expression.cs (Invocation): add a hack to EmitCall so that
6378         IndexerAccess can be the target of a compound assignment without
6379         evaluating its arguments twice.
6380
6381         * statement.cs: Handle changes in Invocation api.
6382
6383 2004-07-16  Martin Baulig  <martin@ximian.com>
6384
6385         * iterators.cs: Rewrote this.  We're now using one single Proxy
6386         class for both the IEnumerable and the IEnumerator interface and
6387         `Iterator' derives from Class so we can use the high-level API.
6388
6389         * class.cs (TypeContainer.AddIterator): New method.
6390         (TypeContainer.DoDefineType): New protected virtual method, which
6391         is called from DefineType().
6392         (TypeContainer.DoDefineMembers): Call DefineType() and
6393         DefineMembers() on all our iterators.
6394         (TypeContainer.Emit): Call Emit() on all our iterators.
6395         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6396
6397         * codegen.cs (EmitContext.CurrentIterator): New public field.
6398
6399 2004-07-15  Martin Baulig  <martin@ximian.com>
6400
6401         * typemanager.cs
6402         (TypeManager.not_supported_exception_type): New type.   
6403
6404 2004-07-14  Martin Baulig  <martin@ximian.com>
6405
6406         * iterators.cs: Use real error numbers.
6407
6408 2004-07-14  Martin Baulig  <martin@ximian.com>
6409
6410         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6411         requires this to be a System.Collection.IEnumerable and not a
6412         class implementing that interface.
6413         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6414
6415 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6416
6417         * class.cs: Fixed previous fix, it broke some error tests.
6418
6419 2004-07-12  Martin Baulig  <martin@ximian.com>
6420
6421         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6422         Fixes #61293.
6423
6424 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6425
6426         * assign.cs (LocalTemporary): Add new argument: is_address,If
6427         `is_address' is true, then the value that we store is the address
6428         to the real value, and not the value itself.
6429         
6430         * ecore.cs (PropertyExpr): use the new local temporary
6431         stuff to allow us to handle X.Y += z (where X is a struct)
6432
6433 2004-07-08  Martin Baulig  <martin@ximian.com>
6434
6435         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6436         not always return, just like we're doing in Using.Resolve().
6437
6438 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6439
6440         * cs-parser.jay (fixed_statement): flag this as Pinned.
6441
6442 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6443
6444         * typemanager.cs (TypeManager): Removed MakePinned method, this
6445         mechanism is replaced with the .NET 2.x compatible mechanism of
6446         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6447
6448         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6449         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6450         `IsFixed' property which has a different meaning.
6451
6452 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6453
6454         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6455         visible from inside a nested class, not just the names of the
6456         immediately enclosing class.
6457         Fix for bug #60730.
6458
6459 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6460
6461         * expression.cs (BetterConversion): Remove buggy special-case
6462         handling of "implicit constant expression conversions".  At this
6463         point, we already know that the conversion is possible -- we're
6464         only checking to see which is better.
6465
6466 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6467
6468         * cs-parser.jay: Added error CS0210 test.
6469
6470 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6471
6472         * cs-parser.jay: Added error CS0134 test.
6473
6474 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6475
6476         Fix bug #52507
6477         * cs-parser.jay: Added error CS0145 test.
6478
6479 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6480
6481         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6482
6483 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6484         
6485         * expression.cs (StackAlloc.Resolve): The argument may not
6486         be a constant; deal with this case.
6487         
6488 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6491         GetIndexerAttributeValue.
6492         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6493
6494         * class.cs (Indexer.Define): Added error tests for CS0415,
6495         CS0609.
6496
6497 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6498
6499         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6500         property code.
6501
6502 2004-06-23  Martin Baulig  <martin@ximian.com>
6503
6504         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6505         neither return nor throw, reset the barrier as well.  Fixes #60457.
6506
6507 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6508
6509         * class.cs : EventAttributes is now set to None by default.
6510           This fixes bug #60459.
6511
6512 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6513
6514         Fix bug #60219
6515         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6516         Don't throw exception but return null (it's sufficient now).
6517
6518 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6519
6520         * typemanager.cs (GetArgumentTypes): Faster implementation.
6521
6522 2004-06-18  Martin Baulig  <martin@ximian.com>
6523
6524         * attribute.cs (Attribute.Resolve): Check whether we're an
6525         EmptyCast which a Constant child.  Fixes #60333.
6526
6527 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6528
6529         * statement.cs (EmitCollectionForeach): Account for the fact that
6530         not all valuetypes are in areas which we can take the address of.
6531         For these variables, we store to a temporary variable. Also, make
6532         sure that we dont emit a `callvirt' on a valuetype method.
6533
6534 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6535
6536         * expression.cs (StackAlloc.DoReSolve): Added test for
6537         negative parameter (CS0247).
6538
6539 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6540
6541         Fix bug #59792
6542         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6543
6544 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6545
6546         Fix bug #59781
6547         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6548         ulong.
6549
6550 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6551
6552         Fix bug #58254 & cs1555.cs, cs1556.cs
6553         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6554
6555 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6556
6557         * cs-parser.jay: Added error CS1669 test for indexers.
6558
6559 2004-06-11  Martin Baulig  <martin@ximian.com>
6560
6561         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6562         call this twice: for params and varargs methods.
6563
6564 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6565
6566         * class.cs:
6567         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6568
6569 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6570
6571         * attribute.cs (Attribute.GetValidTargets): Made public.
6572
6573         * class.cs: 
6574         (AbstractPropertyEventMethod): New class for better code sharing.
6575         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6576         CS1667 report.
6577         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6578
6579 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6580
6581         Fix bug #59477.
6582         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6583         that the call to Resolve is part of a MemberAccess.
6584         (Expression.Resolve): Use it for SimpleName resolution.
6585         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6586         Add 'intermediate' boolean argument.
6587         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6588         error message when the SimpleName can be resolved ambiguously
6589         between an expression and a type.
6590         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6591         public.
6592         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6593         call on the left-side.
6594
6595 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6596
6597         * class.cs:
6598         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6599
6600 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6601
6602         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6603
6604 2004-06-11  Martin Baulig  <martin@ximian.com>
6605
6606         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6607         varargs methods if applicable.
6608
6609 2004-06-11  Martin Baulig  <martin@ximian.com>
6610
6611         * expression.cs (Invocation.EmitCall): Don't use
6612         `method.CallingConvention == CallingConventions.VarArgs' since the
6613         method could also have `CallingConventions.HasThis'.
6614
6615 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6616
6617         * class.cs (Event.GetSignatureForError): Implemented.
6618         Fixed crash in error test cs3010.cs
6619
6620 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6621
6622         * cs-tokenizer.cs: Change the way we track __arglist to be
6623         consistent with the other keywords.
6624
6625 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6626
6627         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6628         tomorrow.
6629
6630 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6631
6632         * codegen.cs: Check that all referenced assemblies have a strongname
6633         before strongnaming the compiled assembly. If not report error CS1577.
6634         Fix bug #56563. Patch by Jackson Harper.
6635         * typemanager.cs: Added a method to return all referenced assemblies.
6636         Fix bug #56563. Patch by Jackson Harper.
6637
6638 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6639
6640         * class.cs:
6641         (Method.ApplyAttributeBuilder): Moved and added conditional
6642         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6643
6644         * delegate.cs:
6645         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6646
6647 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6648
6649         Fixed #59640
6650         * class.cs: (EventField.attribute_targets): Changed default target.
6651
6652 2004-06-08  Martin Baulig  <martin@ximian.com>
6653
6654         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6655
6656 2004-06-08  Martin Baulig  <martin@ximian.com>
6657
6658         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6659
6660 2004-06-07  Martin Baulig  <martin@ximian.com>
6661
6662         Added support for varargs methods.
6663
6664         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6665         keyword.
6666
6667         * cs-parser.jay: Added support for `__arglist'.
6668
6669         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6670
6671         * expression.cs (Argument.AType): Added `ArgList'.
6672         (Invocation): Added support for varargs methods.
6673         (ArglistAccess): New public class.
6674         (Arglist): New public class.
6675
6676         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6677
6678         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6679         a method's top-level block if the method has varargs.
6680
6681         * support.cs (ReflectionParameters, InternalParameters): Added
6682         support for varargs methods.    
6683
6684 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6685
6686         * class.cs: Provide location in indexer error report.
6687
6688         * driver.cs: Use standard names.
6689
6690         * namespace.cs: Catch the use of using after a namespace has been
6691         declared also on using aliases.
6692
6693 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6694
6695         Bug #50820.
6696         * typemanager.cs (closure_private_ok, closure_invocation_type)
6697         (closure_qualifier_type, closure_invocation_assembly)
6698         (FilterWithClosure): Move to ...
6699         (Closure): New internal nested class.
6700         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6701         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6702         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6703         (MemberLookup, MemberLookupFailed): Use it.
6704         * expression.cs (New.DoResolve): Treat the lookup for the
6705         constructor as being qualified by the 'new'ed type.
6706         (Indexers.GetIndexersForTypeOrInterface): Update.
6707
6708 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6709
6710         * attribute.cs
6711         (GetConditionalAttributeValue): New method. Returns
6712         condition of ConditionalAttribute.
6713         (SearchMulti): New method.  Returns all attributes of type 't'.
6714         Use it when attribute is AllowMultiple = true.
6715         (IsConditionalMethodExcluded): New method.
6716
6717         * class.cs
6718         (Method.IsExcluded): Implemented. Returns true if method has conditional
6719         attribute and the conditions is not defined (method is excluded).
6720         (IMethodData): Extended interface for ConditionalAttribute support.
6721         (PropertyMethod.IsExcluded): Implemented.
6722
6723         * decl.cs
6724         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6725
6726         * expression.cs
6727         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6728         on the method.
6729
6730 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6731
6732         * expression.cs (ArrayCreationExpression): Make this just an
6733         `expression'. It can't be a statement, so the code here was
6734         dead.
6735
6736 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6737
6738         Fixed #59072
6739         * typemanager.cs (GetFullNameSignature): New method for
6740         MethodBase types.
6741
6742 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6743
6744         Fixed #56452
6745         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6746         Use this method when MethodBuilder is null.
6747         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6748         Added test for error CS0626 (MONO reports error for this situation).
6749         (IMethodData.GetSignatureForError): Extended interface.
6750
6751 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6752
6753         * attribute.cs
6754         (AttributeTester.GetObsoleteAttribute): Returns instance of
6755         ObsoleteAttribute when type is obsolete.
6756
6757         * class.cs
6758         (TypeContainer.VerifyObsoleteAttribute): Override.
6759         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6760         (MethodCode.VerifyObsoleteAttribute): Override.
6761         (MemberBase.VerifyObsoleteAttribute): Override.
6762
6763         * decl.cs
6764         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6765         and report proper error.
6766
6767         *delegate.cs
6768         Delegate.VerifyObsoleteAttribute): Override.
6769
6770         * ecore.cs
6771         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6772         and report proper error.
6773         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6774
6775         * enum.cs
6776         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6777         and enum member.
6778
6779         * expression.cs
6780         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6781         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6782         Added test for ObsoleteAttribute.
6783
6784         * statement.cs
6785         (Catch): Derived from Statement.
6786
6787 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6788  
6789         Fixed bug #59071 & cs0160.cs
6790  
6791         * statement.cs (Try.Resolve): Check here whether order of catch
6792         clauses matches their dependencies.
6793
6794 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6795
6796         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6797         caused a regression: #59343.  Referencing nested classes from an
6798         assembly stopped working.
6799
6800 2004-05-31  Martin Baulig  <martin@ximian.com>
6801
6802         MCS is now frozen for beta 2.
6803
6804 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6805
6806         * convert.cs: add a trivial cache for overload operator resolution.
6807
6808 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6809
6810         * decl.cs: If possible, use lookuptypedirect here. We can only do
6811         this if there is no `.' after the namespace. Avoids using
6812         LookupType, which does lots of slow processing.
6813         (FindNestedType) New method, does what it says :-).
6814         * namespace.cs: use LookupTypeDirect.
6815         * rootcontext.cs: use membercache, if possible.
6816         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6817
6818 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6819
6820         * expression.cs:
6821         According to the spec, 
6822
6823         In a member access of the form E.I, if E is a single identifier,
6824         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6825         field, property, localvariable, or parameter with the same type as
6826         the meaning of E as a type-name (§3.8), then both possible
6827         meanings of E are permitted.
6828
6829         We did not check that E as a simple-name had the same type as E as
6830         a type name.
6831
6832         This trivial check gives us 5-7% on bootstrap time.
6833
6834 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6835
6836         * expression.cs (Invocation.OverloadResolve): Avoid the
6837         use of hashtables and boxing here by allocating on demand.
6838
6839 2004-05-30  Martin Baulig  <martin@ximian.com>
6840
6841         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6842         we're doing a silent lookup.  Don't try to lookup nested types in
6843         TypeManager.object_type (thanks to Ben Maurer).
6844
6845 2004-05-30  Martin Baulig  <martin@ximian.com>
6846
6847         Committing a patch from Ben Maurer.
6848
6849         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6850
6851 2004-05-29  Martin Baulig  <martin@ximian.com>
6852
6853         * class.cs (IMethodData.ShouldIgnore): New method.
6854
6855         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6856         `Location' argument, we don't need it anywhere.  Use
6857         `IMethodData.ShouldIgnore ()' instead of
6858         `MethodData.GetMethodFlags ()'.
6859         (TypeManager.AddMethod): Removed.
6860         (TypeManager.AddMethod2): Renamed to AddMethod.
6861
6862 2004-05-29  Martin Baulig  <martin@ximian.com>
6863
6864         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6865
6866         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6867         converting from a class type S to an interface type and we already
6868         have an object on the stack, don't box it again.  Fixes #52578.
6869
6870 2004-05-29  Martin Baulig  <martin@ximian.com>
6871
6872         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6873         Added support for `params' parameters.  Fixes #59267.
6874
6875 2004-05-29  Martin Baulig  <martin@ximian.com>
6876
6877         * literal.cs (NullPointer): Provide a private .ctor which sets
6878         `type' to TypeManager.object_type.  Fixes #59048.
6879
6880 2004-05-29  Martin Baulig  <martin@ximian.com>
6881
6882         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6883         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6884
6885         * ecore.cs (EventExpr.instance_expr): Make the field private.
6886
6887 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6888
6889         Fixed bug #50080 & cs0214-2.cs
6890         * expression.cs (Cast.DoResolve): Check unsafe context here.
6891         
6892         * statement.cs (Resolve.DoResolve): Likewise.
6893
6894 2004-05-26  Martin Baulig  <martin@ximian.com>
6895
6896         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6897
6898         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6899         (RootContext.LookupType): Pass down the `silent' flag.
6900
6901 2004-05-25  Martin Baulig  <martin@ximian.com>
6902
6903         * expression.cs
6904         (MethodGroupExpr.IdenticalTypeName): New public property.
6905         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6906         expression actually refers to a type.
6907
6908 2004-05-25  Martin Baulig  <martin@ximian.com>
6909
6910         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6911         for #56176 and made it actually work.
6912
6913 2004-05-25  Martin Baulig  <martin@ximian.com>
6914
6915         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6916         (FieldExpr, PropertyExpr): Override and implement
6917         CacheTemporaries.  Fixes #52279.
6918
6919 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6920
6921         * location.cs: In the new compiler listing a file twice is a
6922         warning, not an error.
6923
6924 2004-05-24  Martin Baulig  <martin@ximian.com>
6925
6926         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6927         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6928
6929 2004-05-24  Martin Baulig  <martin@ximian.com>
6930
6931         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6932         walking the `using' list.  Fixes #53921.
6933
6934 2004-05-24  Martin Baulig  <martin@ximian.com>
6935
6936         * const.cs (Const.LookupConstantValue): Added support for
6937         EmptyCast's; fixes #55251.
6938
6939 2004-05-24  Martin Baulig  <martin@ximian.com>
6940
6941         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6942         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6943         which does the CS0135 check.  The reason is that we first need to
6944         check whether the variable actually exists.
6945
6946 2004-05-24  Martin Baulig  <martin@ximian.com>
6947
6948         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6949         than RootContext.LookupType() to find the explicit interface
6950         type.  Fixes #58584.
6951
6952 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6953
6954         * Makefile: Simplify.  Use executable.make.
6955         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6956
6957 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6958
6959         * decl.cs:
6960         * enum.cs:
6961         Use the invariant culture when doing String.Compare for CLS case
6962         sensitivity.
6963         
6964 2004-05-23  Martin Baulig  <martin@ximian.com>
6965
6966         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6967         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6968
6969         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6970         
6971 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6972
6973         * class.cs (MemberBase.Define): Reuse MemberType member for 
6974         resolved type. Other methods can use it too.
6975
6976 2004-05-23  Martin Baulig  <martin@ximian.com>
6977
6978         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6979         the variable also exists in the current block (otherwise, we need
6980         to report a CS0103).  Fixes #58670.
6981
6982 2004-05-23  Martin Baulig  <martin@ximian.com>
6983
6984         * flowanalysis.cs (Reachability.Reachable): Compute this
6985         on-the-fly rather than storing it as a field.
6986
6987 2004-05-23  Martin Baulig  <martin@ximian.com>
6988
6989         * flowanalysis.cs (Reachability.And): Manually compute the
6990         resulting `barrier' from the reachability.      
6991        
6992 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6993
6994         Fix bug #57835
6995         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6996         instance of ObsoleteAttribute when symbol is obsolete.
6997
6998         * class.cs
6999         (IMethodData): Extended interface for ObsoleteAttribute support.
7000
7001 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7002
7003         * attribute.cs: Fix bug #55970
7004
7005 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7006
7007         Fix bug #52705
7008         * attribute.cs
7009         (GetObsoleteAttribute): New method. Creates the instance of
7010         ObsoleteAttribute.
7011         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7012         ObsoleteAttribute when member is obsolete.
7013         (AttributeTester.Report_ObsoleteMessage): Common method for
7014         Obsolete error/warning reporting.
7015
7016         * class.cs
7017         (TypeContainer.base_classs_type): New member for storing parent type.
7018
7019         * decl.cs
7020         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7021         for this MemberCore.
7022
7023 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7024
7025         * attribute.cs, const.cs: Fix bug #58590
7026
7027 2004-05-21  Martin Baulig  <martin@ximian.com>
7028
7029         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7030         out parameters if the end of the method is unreachable.  Fixes
7031         #58098. 
7032
7033 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7034
7035         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7036         Hari was right, why extra method.
7037
7038 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7039
7040         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7041
7042 2004-05-20  Martin Baulig  <martin@ximian.com>
7043
7044         Merged this back from gmcs to keep the differences to a minumum.
7045
7046         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
7047         instead of a Declspace.
7048         (Attribute.ResolveType): Likewise.
7049         (Attributes.Search): Likewise.
7050         (Attributes.Contains): Likewise.
7051         (Attributes.GetClsCompliantAttribute): Likewise.
7052
7053         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
7054         argument.
7055         (MethodData.ApplyAttributes): Take an EmitContext instead of a
7056         DeclSpace.
7057
7058 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7059
7060         Fix bug #58688 (MCS does not report error when the same attribute
7061         is assigned twice)
7062
7063         * attribute.cs (Attribute.Emit): Distinction between null and default.
7064
7065 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7066
7067         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7068         of a top-level attribute without an attribute target.
7069         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7070         Make non-static.
7071         (Attribute.Conditional_GetConditionName), 
7072         (Attribute.Obsolete_GetObsoleteMessage): Update.
7073         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7074         part of ScanForIndexerName.
7075         (Attribute.CanIgnoreInvalidAttribute): New function.
7076         (Attribute.ScanForIndexerName): Move to ...
7077         (Attributes.ScanForIndexerName): ... here.
7078         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7079         (Attributes.Search): New internal variant that can choose not to
7080         complain if types aren't resolved.  The original signature now
7081         complains.
7082         (Attributes.GetClsCompliantAttribute): Use internal variant, with
7083         complaints suppressed.
7084         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7085         only if it not useful.
7086         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7087         top-level for attributes that are shared between the assembly
7088         and a top-level class.
7089         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7090         * class.cs: Update to reflect changes.
7091         (DefineIndexers): Fuse loops.
7092         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7093         a couple more variants of attribute names.
7094
7095 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7096
7097         Fix bug #52585 (Implemented explicit attribute declaration)
7098
7099         * attribute.cs:
7100         (Attributable.ValidAttributeTargets): New abstract method. It gets
7101         list of valid attribute targets for explicit target declaration.
7102         (Attribute.Target): It holds target itself.
7103         (AttributeSection): Removed.
7104         (Attribute.CheckTargets): New method. It checks whether attribute
7105         target is valid for the current element.
7106
7107         * class.cs:
7108         (EventProperty): New class. For events that are declared like
7109         property (with add and remove accessors).
7110         (EventField): New class. For events that are declared like field.
7111         class.cs
7112
7113         * cs-parser.jay: Implemented explicit attribute target declaration.
7114
7115         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7116         Override ValidAttributeTargets.
7117
7118         * parameter.cs:
7119         (ReturnParameter): Class for applying custom attributes on 
7120         the return type.
7121         (ParameterAtribute): New class. Class for applying custom
7122         attributes on the parameter type.
7123
7124 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7125
7126         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7127         definitions. 
7128
7129         (Method): Allow UNSAFE here.
7130
7131         * modifiers.cs: Support unsafe reporting.
7132
7133 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7134
7135         * decl.cs: Fix bug #58478.
7136
7137 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7138
7139         * statement.cs: When checking for unreachable code on an EmptyStatement,
7140         set the location. Fixes bug #58488.
7141
7142 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7143
7144         * driver.cs: Add -pkg handling.
7145
7146         From Gonzalo: UseShelLExecute=false
7147
7148 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7149
7150         * attribute.cs:
7151         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7152         for attribute.
7153         (Attribute.IsClsCompliaceRequired): Moved to base for better
7154         accesibility.
7155         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7156         when attribute is AttributeUsageAttribute.
7157         (Attribute.GetValidTargets): Simplified.
7158         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7159         attribute for this type.
7160         (Attribute.ApplyAttributes): Method renamed to Emit and make
7161         non-static.
7162         (GlobalAttributeSection): New class for special handling of global
7163         attributes (assembly, module).
7164         (AttributeSection.Emit): New method.
7165
7166         * class.cs: Implemented Attributable abstract methods.
7167         (MethodCore.LabelParameters): Moved to Parameter class.
7168         (Accessor): Is back simple class.
7169         (PropertyMethod): Implemented Attributable abstract class.
7170         (DelegateMethod): Implemented Attributable abstract class.
7171         (Event): New constructor for disctintion between normal Event
7172         and Event with accessors.
7173
7174         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7175
7176         * codegen.cs, const.cs, decl.cs, delegate.cs:
7177         (CommonAssemblyModulClass): Implemented Attributable abstract class
7178         and simplified.
7179
7180         * enum.cs: Implement IAttributeSupport interface.
7181         (EnumMember): New class for emum members. Implemented Attributable
7182         abstract class
7183
7184         * parameter.cs:
7185         (ParameterBase): Is abstract.
7186         (ReturnParameter): New class for easier [return:] attribute handling.
7187
7188         * typemanager.cs: Removed builder_to_attr.
7189
7190 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7191
7192         Fix bug #57151.
7193         * attribute.cs (Attribute.GetPositionalValue): New function.
7194         * class.cs (TypeContainer.VerifyMembers): New function.
7195         (TypeContainer.Emit): Use it.
7196         (ClassOrStruct): New base class for Class and Struct.
7197         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7198         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7199         class.
7200         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7201         then each non-static field should have a FieldOffset attribute.
7202         Otherwise, none of the fields should have a FieldOffset attribute.
7203         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7204         and FieldOffset attributes.
7205         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7206         (TypeManager.field_offset_attribute_type): New core types.
7207         (TypeManager.InitCoreTypes): Initialize them.
7208
7209 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7210
7211         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7212         Return correct type.
7213         From bug #58270.
7214
7215 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7218         be implicitly converted to ulong.
7219         
7220         * expression.cs: The logic for allowing operator &, | and ^ worked
7221         was wrong, it worked before because we did not report an error in
7222         an else branch.  Fixes 57895.
7223
7224         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7225         allow volatile fields to be reference types.
7226
7227 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7228
7229         * driver.cs: Add support for /debug-
7230
7231 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7232
7233         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7234         Add a 'complain' parameter to silence errors.
7235         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7236         silently overlooked type-resolutions.
7237         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7238         to reflect changes.
7239         (Attributes.Search): New function.
7240         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7241         (Attributes.GetAttributeFullName): Remove hack.
7242         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7243         Update to reflect changes.
7244         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7245         Use Attributes.Search instead of nested loops.
7246
7247 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7248
7249         * decl.cs:
7250         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7251         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7252         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7253
7254         * report.cs: (Report.Warning): Renamed to Warning_T because of
7255         parameter collision.
7256
7257 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7258
7259         * expression.cs (MemberAccess.ResolveMemberAccess):
7260         Exit with non-zero status after Report.Error.
7261         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7262         Likewise.
7263         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7264
7265 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7266
7267         * support.cs: Don't hang when the file is empty.
7268
7269 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7270
7271         * support.cs: In SeekableStreamReader, compute the preamble size of the
7272           underlying stream. Position changes should take into account that initial
7273           count of bytes.
7274
7275 2004-05-03  Todd Berman  <tberman@sevenl.net>
7276
7277         * driver.cs: remove unused GetSysVersion function.
7278
7279 2004-05-03  Todd Berman  <tberman@sevenl.net>
7280
7281         * driver.cs: Remove the hack from saturday, as well as the hack
7282         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7283         link_paths to get that bit proper.
7284
7285 2004-05-01  Todd Berman  <tberman@sevenl.net>
7286
7287         * driver.cs: Try a LoadFrom before a Load, this checks the current
7288         path. This is currently a bug in mono that is be fixed, however, this
7289         provides a workaround for now. This will be removed when the bug
7290         is fixed.
7291
7292 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7293
7294         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7295         incomplete key pairs (#57941).
7296
7297 2004-05-01  Todd Berman  <tberman@sevenl.net>
7298
7299         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7300         from the GAC
7301
7302 2004-04-30  Jackson Harper  <jackson@ximian.com>
7303
7304         * codegen.cs: Open keys readonly.
7305         
7306 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7307
7308         * typemanager.cs: don't report cyclic struct layout when a struct
7309         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7310         which has 2 Pango.Rectangle fields.
7311
7312 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7313
7314         * expression.cs: Handle IntPtr comparisons with IL code
7315         rather than a method call.
7316
7317 2004-04-29  Martin Baulig  <martin@ximian.com>
7318
7319         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7320         the list of PropertyInfo's in class hierarchy and find the
7321         accessor.  Fixes #56013.
7322
7323 2004-04-29  Martin Baulig  <martin@ximian.com>
7324
7325         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7326
7327 2004-04-29  Martin Baulig  <martin@ximian.com>
7328
7329         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7330
7331         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7332
7333 2004-04-29  Martin Baulig  <martin@ximian.com>
7334
7335         * class.cs (ConstructorInitializer.Resolve): Check whether the
7336         parent .ctor is accessible.  Fixes #52146.
7337
7338 2004-04-29  Martin Baulig  <martin@ximian.com>
7339
7340         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7341
7342         * statement.cs (Using.EmitLocalVariableDecls): Use
7343         TypeManager.idisposable_type, not typeof (IDisposable).
7344         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7345
7346 2004-04-29  Martin Baulig  <martin@ximian.com>
7347
7348         * class.cs (Event.Define): Don't emit the field and don't set
7349         RTSpecialName and SpecialName for events on interfaces.  Fixes
7350         #57703. 
7351
7352 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7353
7354         Refactor Attribute.ApplyAttributes.
7355         * attribute.cs (Attributable): New base class for objects that can
7356         have Attributes applied on them.
7357         (Attribute): Make AttributeUsage fields public.
7358         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7359         (Attribute.IsInternalCall): New property.
7360         (Attribute.UsageAttr): Convert to a public read-only property.
7361         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7362         (Attribute.ResolveType, Attribute.Resolve)
7363         (Attribute.ScanForIndexerName): Update to reflect changes.
7364         (Attribute.CheckAttributeTarget): Re-format.
7365         (Attribute.ApplyAttributes): Refactor, to various
7366         Attributable.ApplyAttributeBuilder methods.
7367         * decl.cs (MemberCore): Make Attributable.
7368         * class.cs (Accessor): Make Attributable.
7369         (MethodData.ApplyAttributes): Use proper attribute types, not
7370         attribute names.
7371         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7372         (TypeContainer.ApplyAttributeBuilder)
7373         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7374         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7375         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7376         (Operator.ApplyAttributeBuilder): New factored-out methods.
7377         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7378         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7379         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7380         * parameter.cs (ParameterBase): New Attributable base class
7381         that can also represent Return types.
7382         (Parameter): Update to the changes.
7383
7384 2004-04-29  Jackson Harper  <jackson@ximian.com>
7385
7386         * driver.cs: Prefer the corlib system version when looking for
7387         assemblies in the GAC. This is still a hack, but its a better hack
7388         now.
7389         
7390 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7391
7392         * decl.cs, enum.cs: Improved error 3005 reporting.
7393   
7394         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7395         (related_symbols): New private member for list of symbols
7396         related to reported error/warning.
7397         
7398         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7399
7400 2004-04-29  Martin Baulig  <martin@ximian.com>
7401
7402         * ecore.cs (Expression.Constantify): If we're an enum and
7403         TypeManager.TypeToCoreType() doesn't give us another type, use
7404         t.UnderlyingSystemType.  Fixes #56178.  
7405
7406 2004-04-29  Martin Baulig  <martin@ximian.com>
7407
7408         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7409         interfaces and for each interface, only add members directly
7410         declared in that interface.  Fixes #53255.
7411
7412 2004-04-28  Martin Baulig  <martin@ximian.com>
7413
7414         * expression.cs (ConditionalLogicalOperator): Use a temporary
7415         variable for `left' to avoid that we evaluate it more than once;
7416         bug #52588.
7417
7418 2004-04-28  Martin Baulig  <martin@ximian.com>
7419
7420         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7421         `void[]' (CS1547).
7422
7423 2004-04-28  Martin Baulig  <martin@ximian.com>
7424
7425         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7426         void (CS1547).
7427
7428         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7429         whether the type is not void (CS1547).
7430
7431 2004-04-28  Martin Baulig  <martin@ximian.com>
7432
7433         * expression.cs (Unary.DoResolveLValue): Override this and report
7434         CS0131 for anything but Operator.Indirection.
7435
7436 2004-04-28  Martin Baulig  <martin@ximian.com>
7437
7438         Committing a patch from Ben Maurer; see bug #50820.
7439
7440         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7441         check for classes.
7442
7443         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7444         classes.        
7445
7446 2004-04-28  Martin Baulig  <martin@ximian.com>
7447
7448         Committing a patch from Ben Maurer; see bug #50820.
7449
7450         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7451         check for classes.
7452
7453         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7454         classes.        
7455
7456 2004-04-28  Martin Baulig  <martin@ximian.com>
7457
7458         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7459         (Block.AddLabel): Call DoLookupLabel() to only search in the
7460         current block.
7461
7462 2004-04-28  Martin Baulig  <martin@ximian.com>
7463
7464         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7465         comparing StringConstants and NullLiterals in Equality and Inequality.
7466
7467 2004-04-28  Jackson Harper  <jackson@ximian.com>
7468
7469         * driver.cs: Attempt to load referenced assemblies from the
7470         GAC. This is the quick and dirty version of this method that
7471         doesnt take into account versions and just takes the first
7472         canidate found. Will be good enough for now as we will not have more
7473         then one version installed into the GAC until I update this method.
7474
7475 2004-04-28  Martin Baulig  <martin@ximian.com>
7476
7477         * typemanager.cs (TypeManager.CheckStructCycles): New public
7478         static method to check for cycles in the struct layout.
7479
7480         * rootcontext.cs (RootContext.PopulateTypes): Call
7481         TypeManager.CheckStructCycles() for each TypeContainer.
7482         [Note: We only need to visit each type once.]
7483
7484 2004-04-28  Martin Baulig  <martin@ximian.com>
7485
7486         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7487
7488         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7489         success and added `out object value'.  Use a `bool resolved' field
7490         to check whether we've already been called rather than
7491         `ConstantValue != null' since this breaks for NullLiterals.
7492
7493 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7494
7495         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7496         setting of this flag, since the 'set' method may be non-public.
7497
7498 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7499
7500         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7501         check on current_vector.Block.
7502
7503 2004-04-27  Martin Baulig  <martin@ximian.com>
7504
7505         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7506         a field initializer.  Fixes #56459.
7507
7508 2004-04-27  Martin Baulig  <martin@ximian.com>
7509
7510         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7511         we're not attempting to use an indexer.  Fixes #52154.
7512
7513 2004-04-27  Martin Baulig  <martin@ximian.com>
7514
7515         * statement.cs (Return): Don't create a return label if we don't
7516         need it; reverts my change from January 20th.  Thanks to Ben
7517         Maurer for this.
7518
7519 2004-04-27  Martin Baulig  <martin@ximian.com>
7520
7521         According to the spec, `goto' can only leave a nested scope, but
7522         never enter it.
7523
7524         * statement.cs (Block.LookupLabel): Only lookup in the current
7525         block, don't recurse into parent or child blocks.
7526         (Block.AddLabel): Check in parent and child blocks, report
7527         CS0140/CS0158 if we find a duplicate.
7528         (Block): Removed this indexer for label lookups.
7529         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7530         this already does the error reporting for us.
7531
7532         * flowanalysis.cs
7533         (FlowBranching.UsageVector.Block): New public variable; may be null.
7534         (FlowBranching.CreateSibling): Added `Block' argument.
7535         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7536         label for the target of a `goto' and check whether we're not
7537         leaving a `finally'.
7538
7539 2004-04-27  Martin Baulig  <martin@ximian.com>
7540
7541         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7542         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7543         just for returns).
7544
7545 2004-04-27  Martin Baulig  <martin@ximian.com>
7546
7547         * statement.cs (Block.AddLabel): Also check for implicit blocks
7548         and added a CS0158 check.
7549
7550 2004-04-27  Martin Baulig  <martin@ximian.com>
7551
7552         * flowanalysis.cs (FlowBranchingLoop): New class.
7553         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7554         UsageVector's instead of an ArrayList.
7555         (FlowBranching.Label): Likewise.
7556         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7557         (FlowBranching.AddBreakVector): New method.
7558
7559 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7560
7561         * attribute.cs: Small regression fix: only convert the type if we
7562         the type is different, fixes System.Drawing build.
7563
7564 2004-04-27  Martin Baulig  <martin@ximian.com>
7565
7566         * attribute.cs (Attribute.Resolve): If we have a constant value
7567         for a named field or property, implicity convert it to the correct
7568         type.
7569
7570 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7571
7572         * statement.cs (Block.Block): Implicit blocks share
7573         'child_variable_names' fields with parent blocks.
7574         (Block.AddChildVariableNames): Remove.
7575         (Block.AddVariable): Mark variable as "used by a child block" in
7576         every surrounding block.
7577         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7578         been used in a child block, complain about violation of "Invariant
7579         meaning in blocks" rule.
7580         * cs-parser.jay (declare_local_variables): Don't use
7581         AddChildVariableNames.
7582         (foreach_statement): Don't create an implicit block: 'foreach'
7583         introduces a scope.
7584
7585 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7586
7587         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7588         converting from 0L to ulong.  Fixes 57522.
7589
7590 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7591
7592         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7593         derived class hides via 'new' keyword field from base class (test-242.cs).
7594         TODO: Handle this in the more general way.
7595         
7596         * class.cs (CheckBase): Ditto.
7597
7598 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7599
7600         * decl.cs (caching_flags): New member for storing cached values
7601         as bit flags.
7602         (MemberCore.Flags): New enum where bit flags for caching_flags
7603         are defined.
7604         (MemberCore.cls_compliance): Moved to caching_flags.
7605         (DeclSpace.Created): Moved to caching_flags.
7606
7607         * class.cs: Use caching_flags instead of DeclSpace.Created
7608         
7609 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7610
7611         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7612         if we are only a derived class, not a nested class.
7613
7614         * typemanager.cs: Same as above, but do this at the MemberLookup
7615         level (used by field and methods, properties are handled in
7616         PropertyExpr).   Allow for the qualified access if we are a nested
7617         method. 
7618
7619 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7620
7621         * class.cs: Refactoring.
7622         (IMethodData): New inteface; Holds links to parent members
7623         to avoid member duplication (reduced memory allocation).
7624         (Method): Implemented IMethodData interface.
7625         (PropertyBase): New inner classes for get/set methods.
7626         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7627         (Event): New inner classes for add/remove methods.
7628         (Event.DelegateMethod): Implemented IMethodData interface.
7629
7630         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7631         EmitContext (related to class.cs refactoring).
7632
7633 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7634
7635         * delegate.cs (Delegate.VerifyApplicability): If the number of
7636         arguments are the same as the number of parameters, first try to
7637         verify applicability ignoring  any 'params' modifier on the last
7638         parameter.
7639         Fixes #56442.
7640
7641 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7642
7643         * class.cs (TypeContainer.AddIndexer): Use
7644         'ExplicitInterfaceName' to determine if interface name was
7645         explicitly specified.  'InterfaceType' is not initialized at this time.
7646         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7647         Indexers array is already in the required order.  Initialize
7648         'IndexerName' only if there are normal indexers.
7649         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7650         (TypeContainer.Emit): Emit DefaultMember attribute only if
7651         IndexerName is initialized.
7652         Fixes #56300.
7653
7654 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7655
7656         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7657         Fixes #57007
7658
7659 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7660
7661         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7662         attributes.
7663         Fix for #56456.
7664
7665         * attribute.cs (Attribute.Resolve): Check for duplicate named
7666         attributes.
7667         Fix for #56463.
7668
7669 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7670
7671         * iterators.cs (MarkYield): track whether we are in an exception,
7672         and generate code accordingly.  Use a temporary value to store the
7673         result for our state.
7674
7675         I had ignored a bit the interaction of try/catch with iterators
7676         since their behavior was not entirely obvious, but now it is
7677         possible to verify that our behavior is the same as MS .NET 2.0
7678
7679         Fixes 54814
7680
7681 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7682
7683         * iterators.cs: Avoid creating temporaries if there is no work to
7684         do. 
7685
7686         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7687         Enumerations, use TypeManager.EnumToUnderlying and call
7688         recursively. 
7689
7690         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7691         bug #57013
7692
7693         (This.Emit): Use EmitContext.EmitThis to emit our
7694         instance variable.
7695
7696         (This.EmitAssign): Ditto.
7697
7698         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7699         codepaths, we will move all the functionality into
7700         Mono.CSharp.This 
7701
7702         (FieldExpr.EmitAssign): Ditto.
7703
7704         This fixes several hidden bugs that I uncovered while doing a code
7705         review of this today.
7706
7707         * codegen.cs (EmitThis): reworked so the semantics are more clear
7708         and also support value types "this" instances.
7709
7710         * iterators.cs: Changed so that for iterators in value types, we
7711         do not pass the value type as a parameter.  
7712
7713         Initialization of the enumerator helpers is now done in the caller
7714         instead of passing the parameters to the constructors and having
7715         the constructor set the fields.
7716
7717         The fields have now `assembly' visibility instead of private.
7718
7719 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7720
7721         * expression.cs (Argument.Resolve): Check if fields passed as ref
7722         or out are contained in a MarshalByRefObject.
7723
7724         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7725         another compiler type.
7726
7727 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7728
7729         * class.cs (Indexer.Define): use the new name checking method.
7730         Also, return false on an error.
7731         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7732         (is_identifier_[start/part]_character): make static.
7733
7734 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7735
7736         * expression.cs (Binary.ResolveOperator): Do no append strings
7737         twice: since we can be invoked more than once (array evaluation)
7738         on the same concatenation, take care of this here.  Based on a fix
7739         from Ben (bug #56454)
7740
7741 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7742
7743         * codegen.cs: Fix another case where CS1548 must be reported (when 
7744         delay-sign isn't specified and no private is available #56564). Fix
7745         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7746         error when MCS is used on the MS runtime and we need to delay-sign 
7747         (which seems unsupported by AssemblyBuilder - see #56621).
7748
7749 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7750
7751         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7752         (TypeManager.ComputeNamespaces): Faster implementation for
7753         Microsoft runtime.
7754
7755         * compiler.csproj: Updated AssemblyName to mcs.
7756
7757 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7758
7759         * rootcontext.cs: Add new types to the boot resolution.
7760
7761         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7762         MulticastDelegate is not allowed.
7763
7764         * typemanager.cs: Add new types to lookup: System.TypedReference
7765         and ArgIterator.
7766
7767         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7768         check for TypedReference or ArgIterator, they are not allowed. 
7769
7770         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7771         makes us properly catch 1510 in some conditions (see bug 56016 for
7772         details). 
7773
7774 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7775
7776         * CryptoConvert.cs: update from corlib version
7777         with endian fixes.
7778
7779 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7780
7781         * class.cs (Indexer.Define): Check indexername declaration
7782
7783 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7784
7785         * attribute.cs (IsClsCompliant): Fixed problem with handling
7786         all three states (compliant, not-compliant, undetected).
7787
7788 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7789
7790         * attribute.cs (Attribute): Location is now public.
7791         (Resolve): Store resolved arguments (pos_values) in attribute class.
7792         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7793         (GetClsCompliantAttributeValue): New method that gets
7794         CLSCompliantAttribute value.
7795         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7796         if exists else null.
7797         (AttributeTester): New class for CLS-Compliant verification routines.
7798
7799         * class.cs (Emit): Add CLS-Compliant verification.
7800         (Method.GetSignatureForError): Implemented.
7801         (Constructor.GetSignatureForError): Implemented
7802         (Constructor.HasCompliantArgs): Returns if constructor has
7803         CLS-Compliant arguments.
7804         (Constructor.Emit): Override.
7805         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7806         is needed to test only parameters.
7807         (FieldBase.GetSignatureForError): Implemented.
7808         (TypeContainer): New member for storing base interfaces.
7809         (TypeContainer.FindMembers): Search in base interfaces too.
7810
7811         * codegen.cs (GetClsComplianceAttribute): New method that gets
7812         assembly or module CLSCompliantAttribute value.
7813         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7814         for assembly.
7815         (ModuleClass.Emit): Add error 3012 test.
7816
7817         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7818
7819         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7820         state for all decl types.
7821         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7822         if CLS-Compliant tests are required.
7823         (IsClsCompliaceRequired): New method. Analyze whether code
7824         must be CLS-Compliant.
7825         (IsExposedFromAssembly): New method. Returns true when MemberCore
7826         is exposed from assembly.
7827         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7828         value or gets cached value.
7829         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7830         is explicitly marked with CLSCompliantAttribute.
7831         (IsIdentifierClsCompliant): New abstract method. This method is
7832         used to testing error 3005.
7833         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7834         for identifier and parameters CLS-Compliant testing.
7835         (VerifyClsCompliance): New method. The main virtual method for
7836         CLS-Compliant verifications.
7837         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7838         null. I don't know why is null (too many public members !).
7839         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7840         and get value of first CLSCompliantAttribute that found.
7841
7842         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7843         (VerifyClsCompliance): Override and add extra tests.
7844
7845         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7846         clscheck- disable CLS-Compliant verification event if assembly is has
7847         CLSCompliantAttribute(true).
7848
7849         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7850         ApllyAttribute is now called in emit section as in the other cases.
7851         Possible future Emit integration.
7852         (IsIdentifierClsCompliant): New override.
7853         (VerifyClsCompliance): New override.
7854         (GetEnumeratorName): Returns full enum name.
7855
7856         * parameter.cs (GetSignatureForError): Implemented.
7857
7858         * report.cs (WarningData): New struct for Warning message information.
7859         (LocationOfPreviousError): New method.
7860         (Warning): New method. Reports warning based on the warning table.
7861         (Error_T): New method. Reports error based on the error table.
7862
7863         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7864         verifications are done here.
7865
7866         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7867
7868         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7869         CLSCompliantAttribute.
7870         (all_imported_types): New member holds all imported types from other
7871         assemblies.
7872         (LoadAllImportedTypes): New method fills static table with exported types
7873         from all referenced assemblies.
7874         (Modules): New property returns all assembly modules.
7875
7876 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7877
7878         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7879         throwing a parser error.
7880
7881         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7882         which removes the hardcoded get_/set_ prefixes for properties, as
7883         IL allows for the properties to be named something else.  
7884
7885         Bug #56013
7886
7887         * expression.cs: Do not override operand before we know if it is
7888         non-null.  Fix 56207
7889
7890 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7891
7892         * typemanager.cs: support for pinned variables.
7893
7894 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7895
7896         * decl.cs, typemanager.cs: Avoid using an arraylist
7897         as a buffer if there is only one result set.
7898
7899 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7900
7901         * expression.cs: Make sure you cant call a static method
7902         with an instance expression, bug #56174.
7903
7904 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7905
7906         * class.cs (IsDuplicateImplementation): Improve error reporting to
7907         flag 663 (method only differs in parameter modifier).
7908
7909         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7910         in preprocessor directives.
7911
7912         * location.cs (LookupFile): Allow for the empty path.
7913
7914         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7915         better approach for some of that patch, but its failing with the
7916         CharSet enumeration.  For now try/catch will do.
7917
7918         * typemanager.cs: Do not crash if a struct does not have fields.
7919         Fixes 56150.
7920
7921 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7922
7923         * expression.cs: cs0213, cant fix a fixed expression.
7924         fixes 50231.
7925
7926 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7927
7928         * cs-parser.jay: detect invalid embeded statements gracefully.
7929         bug #51113.
7930
7931 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7932
7933         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7934         As a regex:
7935         s/
7936         the invocation type may not be a subclass of the tye of the item/
7937         The type of the item must be a subclass of the invocation item.
7938         /g
7939
7940         Fixes bug #50820.
7941
7942 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7943
7944         * attribute.cs: Added methods to get a string and a bool from an
7945         attribute. Required to information from AssemblyKeyFileAttribute,
7946         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7947         * codegen.cs: Modified AssemblyName creation to include support for
7948         strongnames. Catch additional exceptions to report them as CS1548.
7949         * compiler.csproj: Updated include CryptoConvert.cs.
7950         * compiler.csproj.user: Removed file - user specific configuration.
7951         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7952         Mono.Security assembly. The original class is maintained and tested in
7953         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7954         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7955         like CSC 8.0 (C# v2) supports.
7956         * Makefile: Added CryptoConvert.cs to mcs sources.
7957         * rootcontext.cs: Added new options for strongnames.
7958
7959 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7960
7961         * driver.cs: For --expect-error, report error code `2'
7962         if the program compiled with no errors, error code `1' if
7963         it compiled with an error other than the one expected.
7964
7965 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7966
7967         * compiler.csproj: Updated for Visual Studio .NET 2003.
7968         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7969         * compiler.sln: Updated for Visual Studio .NET 2003.
7970
7971 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7972
7973         * expression.cs: Fix bug #47234. We basically need to apply the
7974         rule that we prefer the conversion of null to a reference type
7975         when faced with a conversion to 'object' (csc behaviour).
7976
7977 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7978
7979         * statement.cs: Shorter form for foreach, eliminates
7980         a local variable. r=Martin.
7981
7982 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7983
7984         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7985         checks if we can use brtrue/brfalse to test for 0.
7986         * expression.cs: use the above in the test for using brtrue/brfalse.
7987         cleanup code a bit.
7988
7989 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7990
7991         * expression.cs: Rewrite string concat stuff. Benefits:
7992
7993         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7994         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7995         rather than a concat chain.
7996
7997         * typemanager.cs: Add lookups for more concat overloads.
7998
7999 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8000
8001         * expression.cs: Emit shorter il code for array init.
8002
8003         newarr
8004         dup
8005         // set 1
8006
8007         // set 2
8008
8009         newarr
8010         stloc.x
8011
8012         ldloc.x
8013         // set 1
8014
8015         ldloc.x
8016         // set 2
8017
8018 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8019
8020         * statement.cs: Before, two switch blocks would be merged if the
8021         total size of the blocks (end_item - begin_item + 1) was less than
8022         two times the combined sizes of the blocks.
8023
8024         Now, it will only merge if after the merge at least half of the
8025         slots are filled.
8026
8027         fixes 55885.
8028
8029 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8030
8031         * class.cs : csc build fix for GetMethods(). See bug #52503.
8032
8033 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8034
8035         * expression.cs: Make sure fp comparisons work with NaN.
8036         This fixes bug #54303. Mig approved this patch a long
8037         time ago, but we were not able to test b/c the runtime
8038         had a related bug.
8039
8040 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8041
8042         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8043
8044 2004-03-19  Martin Baulig  <martin@ximian.com>
8045
8046         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8047         error here and not in our caller.
8048
8049 2004-03-19  Martin Baulig  <martin@ximian.com>
8050
8051         * interface.cs: Completely killed this file.
8052         (Interface): We're now a TypeContainer and live in class.cs.
8053
8054         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8055         argument; we're now also called for interfaces.
8056         (TypeContainer.DefineMembers): Allow this method being called
8057         multiple times.
8058         (TypeContainer.GetMethods): New public method; formerly known as
8059         Interface.GetMethod().  This is used by PendingImplementation.
8060         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8061         it's now private and non-static.
8062         (Interface): Moved this here; it's now implemented similar to
8063         Class and Struct.
8064         (Method, Property, Event, Indexer): Added `bool is_interface'
8065         argument to their .ctor's.
8066         (MemberBase.IsInterface): New public field.
8067
8068         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8069         instances instead of InterfaceMethod, InterfaceProperty, etc.
8070         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8071         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8072
8073 2004-03-19  Martin Baulig  <martin@ximian.com>
8074
8075         * class.cs (MethodCore.IsDuplicateImplementation): New private
8076         method which does the CS0111 checking.
8077         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8078         Use IsDuplicateImplementation().
8079
8080 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8081
8082         * decl.cs (FindMemberToOverride): New method to find the correct
8083         method or property to override in the base class.
8084         * class.cs
8085             - Make Method/Property use the above method to find the
8086               version in the base class.
8087             - Remove the InheritableMemberSignatureCompare as it is now
8088               dead code.
8089
8090         This patch makes large code bases much faster to compile, as it is
8091         O(n) rather than O(n^2) to do this validation.
8092
8093         Also, it fixes bug 52458 which is that nested classes are not
8094         taken into account when finding the base class member.
8095
8096         Reviewed/Approved by Martin.
8097
8098 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8099
8100         * interface.cs: In all interface classes removed redundant
8101         member initialization.
8102
8103 2004-03-16  Martin Baulig  <martin@ximian.com>
8104
8105         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8106
8107 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8108
8109         * decl.cs (DefineTypeAndParents): New helper method to define a
8110         type's containers before the type itself is defined;  This is a
8111         bug exposed by the recent changes to Windows.Forms when an
8112         implemented interface was defined inside a class that had not been
8113         built yet.   
8114
8115         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8116
8117         (Check): Loop correctly to report errors modifiers
8118         (UNSAFE was not in the loop, since it was the same as TOP).
8119
8120         * interface.cs: Every interface member now takes a ModFlags,
8121         instead of a "is_new" bool, which we set on the base MemberCore. 
8122
8123         Every place where we called "UnsafeOk" in the interface, now we
8124         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8125         the unsafe settings from the member declaration instead of the
8126         container interface. 
8127
8128         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8129
8130         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8131         `set_indexer_name' to the pending bits (one per type).
8132
8133         We fixed a bug today that was picking the wrong method to
8134         override, since for properties the existing InterfaceMethod code
8135         basically ignored the method name.  Now we make sure that the
8136         method name is one of the valid indexer names.
8137
8138 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8139  
8140         * support.cs (SeekableStreamReader): Keep track of stream byte
8141         positions and don't mix them with character offsets to the buffer.
8142
8143         Patch from Gustavo Giráldez
8144
8145 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8146
8147         * interface.cs (InterfaceSetGetBase): Removed double member
8148         initialization, base class does it as well.
8149
8150 2004-03-13  Martin Baulig  <martin@ximian.com>
8151
8152         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8153         when compiling corlib.
8154
8155 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8156
8157         * convert.cs (ExplicitConversion): We were reporting an error on
8158         certain conversions (object_type source to a value type, when the
8159         expression was `null') before we had a chance to pass it through
8160         the user defined conversions.
8161
8162         * driver.cs: Replace / and \ in resource specifications to dots.
8163         Fixes 50752
8164
8165         * class.cs: Add check for duplicate operators.  Fixes 52477
8166
8167 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8168
8169         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8170         that are in the middle of the statements, not only at the end.
8171         Fixes #54987
8172
8173         * class.cs (TypeContainer.AddField): No longer set the
8174         `HaveStaticConstructor' flag, now we call it
8175         `UserDefineStaticConstructor' to diferentiate the slightly
8176         semantic difference.
8177
8178         The situation is that we were not adding BeforeFieldInit (from
8179         Modifiers.TypeAttr) to classes that could have it.
8180         BeforeFieldInit should be set to classes that have no static
8181         constructor. 
8182
8183         See:
8184
8185         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8186
8187         And most importantly Zoltan's comment:
8188
8189         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8190
8191         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8192          before its static fields are used', i.e. initialization does not need
8193          to be triggered by the first access to the type. Setting this flag
8194          helps the JIT to compile better code, since it can run the static
8195          constructor at JIT time, and does not need to generate code to call it
8196          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8197          this flag for lots of classes like String. 
8198          
8199          csc sets this flag if the type does not have an explicit static 
8200          constructor. The reasoning seems to be that if there are only static
8201          initalizers for a type, and no static constructor, then the programmer
8202          does not care when this initialization happens, so beforefieldinit
8203          can be used.
8204          
8205          This bug prevents the AOT compiler from being usable, since it 
8206          generates so many calls to mono_runtime_class_init that the AOT code
8207          is much slower than the JITted code. The JITted code is faster, 
8208          because it does not generate these calls if the vtable is type is
8209          already initialized, which is true in the majority of cases. But the
8210          AOT compiler can't do this."
8211
8212 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8213
8214         * class.cs (MethodData.Emit): Refactor the code so symbolic
8215         information is generated for destructors;  For some reasons we
8216         were taking a code path that did not generate symbolic information
8217         before. 
8218
8219 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8220
8221         * class.cs: Create a Constructor.CheckBase method that
8222         takes care of all validation type code. The method
8223         contains some code that was moved from Define.
8224
8225         It also includes new code that checks for duplicate ctors.
8226         This fixes bug #55148.
8227
8228 2004-03-09  Joshua Tauberer <tauberer@for.net>
8229
8230         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8231         a { ... }-style array creation invokes EmitStaticInitializers
8232         which is not good for reference-type arrays.  String, decimal
8233         and now null constants (NullCast) are not counted toward
8234         static initializers.
8235
8236 2004-03-05  Martin Baulig  <martin@ximian.com>
8237
8238         * location.cs (SourceFile.HasLineDirective): New public field;
8239         specifies whether the file contains or is referenced by a "#line"
8240         directive.
8241         (Location.DefineSymbolDocuments): Ignore source files which
8242         either contain or are referenced by a "#line" directive.        
8243
8244 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8245
8246         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8247         direct access to our parent, so check the method inline there.
8248
8249 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8250
8251         * expression.cs (Invocation.EmitCall): Miguel's last commit
8252         caused a regression. If you had:
8253
8254             T t = null;
8255             t.Foo ();
8256
8257         In Foo the implict this would be null.
8258
8259 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8260
8261         * expression.cs (Invocation.EmitCall): If the method is not
8262         virtual, do not emit a CallVirt to it, use Call.
8263
8264         * typemanager.cs (GetFullNameSignature): Improve the method to
8265         cope with ".ctor" and replace it with the type name.
8266
8267         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8268         as an argument the ConstructorBuilder where it is being defined,
8269         to catch the recursive constructor invocations.
8270
8271 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8272
8273         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8274         routines to check if a type is an enumerable/enumerator allow
8275         classes that implement the IEnumerable or IEnumerator interfaces.
8276
8277         * class.cs (Property, Operator): Implement IIteratorContainer, and
8278         implement SetYields.
8279
8280         (Property.Define): Do the block swapping for get_methods in the
8281         context of iterators.   We need to check if Properties also
8282         include indexers or not.
8283
8284         (Operator): Assign the Block before invoking the
8285         OperatorMethod.Define, so we can trigger the Iterator code
8286         replacement. 
8287
8288         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8289         Property and Operator classes are not created when we parse the
8290         declarator but until we have the block completed, so we use a
8291         singleton SimpleIteratorContainer.Simple to flag whether the
8292         SetYields has been invoked.
8293
8294         We propagate this setting then to the Property or the Operator to
8295         allow the `yield' to function.
8296
8297 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8298
8299         * codegen.cs: Implemented attribute support for modules.
8300         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8301         Assembly/Module functionality.
8302
8303         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8304         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8305         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8306
8307 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8308
8309         * interface.cs (FindMembers): The operation is performed on all base
8310         interfaces and not only on the first. It is required for future CLS Compliance patch.
8311
8312 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8313
8314         * statement.cs, codegen.cs:
8315         This patch deals with patterns such as:
8316
8317         public class List : IEnumerable {
8318
8319                 public MyEnumerator GetEnumerator () {
8320                         return new MyEnumerator(this);
8321                 }
8322
8323                 IEnumerator IEnumerable.GetEnumerator () {
8324                         ...
8325                 }
8326                 
8327                 public struct MyEnumerator : IEnumerator {
8328                         ...
8329                 }
8330         }
8331
8332         Before, there were a few things we did wrong:
8333         1) we would emit callvirt on a struct, which is illegal
8334         2) we emited ldarg when we needed to emit ldarga
8335         3) we would mistakenly call the interface methods on an enumerator
8336         type that derived from IEnumerator and was in another assembly. For example:
8337
8338         public class MyEnumerator : IEnumerator
8339
8340         Would have the interface methods called, even if there were public impls of the
8341         method. In a struct, this lead to invalid IL code.
8342
8343 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8344
8345         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8346           renamed to Emit.
8347
8348         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8349
8350 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * cs-parser.jay: Fix small regression: we were not testing V2
8353         compiler features correctly.
8354
8355         * interface.cs: If the emit context is null, then create one
8356
8357 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8358
8359         * decl.cs (GetSignatureForError): New virtual method to get full name
8360           for error messages.
8361
8362         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8363           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8364
8365         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8366           Duplicated members and code in these classes has been removed.
8367           Better encapsulation in these classes.
8368
8369 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8370
8371         * assign.cs (Assign.DoResolve): When dealing with compound
8372         assignments, there is a new rule in ECMA C# 2.4 (might have been
8373         there before, but it is documented here) that states that in:
8374
8375         a op= b;
8376
8377         If b is of type int, and the `op' is a shift-operator, then the
8378         above is evaluated as:
8379
8380         a = (int) a op b 
8381
8382         * expression.cs (Binary.ResolveOperator): Instead of testing for
8383         int/uint/long/ulong, try to implicitly convert to any of those
8384         types and use that in pointer arithmetic.
8385
8386         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8387         method to print information for from the type, not from the
8388         null-method we were given.
8389
8390 2004-02-01  Duncan Mak  <duncan@ximian.com>
8391
8392         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8393         parsing for cmd, fixes bug #53694.
8394
8395 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8396
8397         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8398         in the member name duplication tests. Property and operator name duplication
8399         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8400
8401 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8402
8403         * interface.cs (PopulateMethod): Fixed crash when interface method
8404         returns not existing type (error test cs0246-3.cs).
8405
8406 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8407
8408         * cs-parser.jay (interface_accessors): Re-write actions to also
8409         store attributes attached to get and set methods. Fix spelling
8410         while at it.
8411
8412         (inteface_property_declaration): Modify accordingly.
8413
8414         (InterfaceAccessorInfo): New helper class to store information to pass
8415         around between rules that use interface_accessors.
8416
8417         * interface.cs (Emit): Apply attributes on the get and set
8418         accessors of properties and indexers too.
8419
8420         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8421         right MethodBuilder when applying attributes to the get and set accessors.
8422
8423 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8426
8427 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8428
8429         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8430
8431 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8432
8433         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8434         changes that treat `yield' specially when present before `break'
8435         or `return' tokens.
8436
8437         * cs-tokenizer.cs: yield is no longer a keyword.
8438
8439 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8440
8441         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8442         setting for default constructors.
8443         For default constructors are almost every time set wrong Modifier. The
8444         generated IL code has been alright. But inside mcs this values was
8445         wrong and this was reason why several of my CLS Compliance tests
8446         failed.
8447
8448 2004-01-22  Martin Baulig  <martin@ximian.com>
8449
8450         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8451         not a QualifiedIdentifier.  This is what `type_name_expression'
8452         was previously doing.
8453         (type_name_expression): Removed; the code is now in
8454         `namespace_or_type_name'.
8455         (qualified_identifier): Removed, use `namespace_or_type_name'
8456         instead.
8457         (QualifiedIdentifier): Removed this class.      
8458
8459 2004-01-22  Martin Baulig  <martin@ximian.com>
8460
8461         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8462         not a string as alias name.
8463
8464 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8465
8466         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8467         #52730 bug, and instead compute correctly the need to use a
8468         temporary variable when requesting an address based on the
8469         static/instace modified of the field and the constructor.
8470  
8471 2004-01-21  Martin Baulig  <martin@ximian.com>
8472
8473         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8474         class and namespace before looking up aliases.  Fixes #52517.
8475
8476 2004-01-21  Martin Baulig  <martin@ximian.com>
8477
8478         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8479         assinged in a 'try'; fixes exception4.cs.
8480
8481 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8482         * class.cs : Implemented parameter-less constructor for TypeContainer
8483
8484         * decl.cs: Attributes are now stored here. New property OptAttributes
8485
8486         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8487
8488         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8489
8490 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8493           (CSharpSignature): New method for indexer and property signature.
8494
8495 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8496
8497         * pending.cs (IsVirtualFilter): Faster implementation.
8498
8499 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8500
8501         * typemanager.cs: Avoid inclusion of same assembly more than once.
8502
8503 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8504
8505         * cs-parser.jay: Fixed problem where the last assembly attribute
8506           has been applied also to following declaration (class, struct, etc.)
8507           
8508 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8509
8510         * class.cs: Added error CS0538, CS0539 reporting.
8511         Fixed crash on Microsoft runtime when field type is void.
8512
8513         * cs-parser.jay: Added error CS0537 reporting.
8514
8515         * pending.cs: Added error CS0535 reporting.
8516         Improved error report for errors CS0536, CS0534.
8517
8518 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8519
8520         Merge a few bits from the Anonymous Method MCS tree.
8521
8522         * statement.cs (ToplevelBlock): New class for toplevel methods,
8523         will hold anonymous methods, lifted variables.
8524
8525         * cs-parser.jay: Create toplevel blocks for delegates and for
8526         regular blocks of code. 
8527
8528 2004-01-20  Martin Baulig  <martin@ximian.com>
8529
8530         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8531         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8532         and `NeedExplicitReturn'; added `IsLastStatement'.
8533         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8534         have a `ReturnLabel' or we're not unreachable.
8535
8536         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8537         child's reachability; don't just override ours with it.  Fixes
8538         #58058 (lluis's example).
8539         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8540         InFinally(), InLoop(), InSwitch() and
8541         BreakCrossesTryCatchBoundary() methods.
8542
8543         * statement.cs (Return): Do all error checking in Resolve().
8544         Unless we are the last statement in a top-level block, always
8545         create a return label and jump to it.
8546         (Break, Continue): Do all error checking in Resolve(); also make
8547         sure we aren't leaving a `finally'.
8548         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8549         statement in a top-level block.
8550         (Block.Flags): Added `IsDestructor'.
8551         (Block.IsDestructor): New public property.
8552
8553 2004-01-20  Martin Baulig  <martin@ximian.com>
8554
8555         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8556
8557 2004-01-20  Martin Baulig  <martin@ximian.com>
8558
8559         * statement.cs (Statement.ResolveUnreachable): New public method.
8560         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8561         (Block.Resolve): Resolve unreachable statements.
8562
8563 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8564
8565         * expression.cs: We need to fix the case where we do
8566         not have a temp variable here.
8567
8568         * assign.cs: Only expression compound assignments need
8569         temporary variables.
8570
8571 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8572
8573         * flowanalysis.cs: Reduce memory allocation in a few ways:
8574           - A block with no variables should not allocate a bit
8575             vector for itself.
8576           - A method with no out parameters does not need any tracking
8577             for assignment of the parameters, so we need not allocate
8578             any data for it.
8579           - The arrays:
8580                 public readonly Type[] VariableTypes;
8581                 public readonly string[] VariableNames;
8582             Are redundant. The data is already stored in the variable
8583             map, so we need not allocate another array for it.
8584           - We need to add alot of checks for if (params | locals) == null
8585             due to the first two changes.
8586
8587 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8588
8589         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8590         implement IMemoryLocation, we store a copy on a local variable and
8591         take the address of it.  Patch from Benjamin Jemlich
8592
8593         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8594         to use a special "type_name_expression" rule which reduces the
8595         number of "QualifiedIdentifier" classes created, and instead
8596         directly creates MemberAccess expressions.
8597
8598 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8599
8600         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8601         that fixes #52853.  Null literal assignment to ValueType
8602
8603         * class.cs (MethodData.Emit): Instead of checking the name of the
8604         method to determine if its a destructor, create a new derived
8605         class from Method called Destructor, and test for that.  
8606
8607         * cs-parser.jay: Create a Destructor object instead of a Method.  
8608
8609         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8610
8611         Fixes: 52933
8612
8613 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8614
8615         * expression.cs (Binary.ResolveOperator): Perform an implicit
8616         conversion from MethodGroups to their delegate types on the
8617         Addition operation.
8618
8619         * delegate.cs: Introduce a new class DelegateCreation that is the
8620         base class for `NewDelegate' and `ImplicitDelegateCreation',
8621         factor some code in here.
8622
8623         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8624         conversion from MethodGroups to compatible delegate types. 
8625
8626         * ecore.cs (Expression.Resolve): Do not flag error 654
8627         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8628         we allow conversions from MethodGroups to delegate types now.
8629
8630         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8631         assignments in v2 either.
8632
8633 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8634
8635         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8636         static read-only fields in ctors.
8637
8638         Applied patch from Benjamin Jemlich 
8639
8640         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8641
8642 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8643
8644         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8645         here to return true, as they can be used like this:
8646
8647                 (XXX) int.MEMBER ()
8648
8649         Fixed 49836 and all the other dups
8650
8651 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8652
8653         * driver.cs: Implement /win32res and /win32icon.
8654
8655 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8656
8657         * cs-parser.jay: Add a rule to improve error handling for the
8658         common mistake of placing modifiers after the type.
8659
8660 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8661
8662         * cs-parser.jay (interface_event_declaration): Catch
8663         initialization of events on interfaces, and report cs0068
8664
8665         * cs-parser.jay (interface_event_declaration): Catch
8666         initialization of events. 
8667
8668         * ecore.cs: Better report missing constructors.
8669
8670         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8671         the error reporting done in the wrong place.  Fix.
8672
8673         * expression.cs (Binary.ResolveOperator): Catch the 
8674         operator + (E x, E y) error earlier, and later allow for implicit
8675         conversions in operator +/- (E e, U x) from U to the underlying
8676         type of E.
8677
8678         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8679         52596, if the container class is abstract, the default constructor
8680         is protected otherwise its public (before, we were always public).
8681
8682         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8683         fixed statement.
8684
8685         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8686         Jemlich that fixes bug #52597, MCS was generating invalid code for
8687         idisposable structs.   Thanks to Ben for following up with this
8688         bug as well.
8689
8690 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8691
8692         * driver.cs: Allow assemblies without code to be generated, fixes
8693         52230.
8694
8695 2004-01-07  Nick Drochak <ndrochak@gol.com>
8696
8697         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8698
8699 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8700
8701         * cs-parser.jay: Add rules to improve error reporting if fields or
8702         methods are declared at the namespace level (error 116)
8703
8704         * Add rules to catch event add/remove
8705
8706 2004-01-04  David Sheldon <dave-mono@earth.li>
8707
8708   * expression.cs: Added matching ")" to error message for 
8709   CS0077
8710
8711 2004-01-03 Todd Berman <tberman@gentoo.org>
8712
8713         * ecore.cs, attribute.cs:
8714         Applying fix from #52429.
8715
8716 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8717
8718         * ecore.cs, expression.cs, statement.cs:
8719         Total rewrite of how we handle branching. We
8720         now handle complex boolean expressions with fewer
8721         jumps. As well if (x == 0) no longer emits a ceq.
8722
8723         if (x is Foo) is much faster now, because we generate
8724         better code.
8725
8726         Overall, we get a pretty big improvement on our benchmark
8727         tests. The code we generate is smaller and more readable.
8728
8729         I did a full two-stage bootstrap. The patch was reviewed
8730         by Martin and Miguel.
8731
8732 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8733
8734         * cs-parser.jay: Make primary_expression not take a QI.
8735         we dont need this because the member_access rule covers
8736         us here. So we replace the rule with just IDENTIFIER.
8737
8738         This has two good effects. First, we remove a s/r conflict.
8739         Second, we allocate many fewer QualifiedIdentifier objects.
8740
8741 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8742
8743         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8744         set the correct information via SRE. This prevents
8745         hanging on the MS runtime. Fixes #29374.
8746
8747 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8748
8749         * convert.cs: correctly handle conversions to value types
8750         from Enum and ValueType as unboxing conversions.
8751
8752         Fixes bug #52569. Patch by Benjamin Jemlich.
8753
8754 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8755
8756         * expression.cs (BetterConversion): Prefer int -> uint
8757         over int -> ulong (csc's behaviour). This fixed bug #52046.
8758
8759 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8760
8761         * decl.cs (MemberCache.FindMembers): now returns a
8762         MemberInfo [].
8763
8764         * typemanager.cs: In general, go with with ^^.
8765         (CopyNewMethods): take an IList.
8766         (RealMemberLookup): Only allocate an arraylist
8767         if we copy from two sets of methods.
8768
8769         This change basically does two things:
8770         1) Fewer array lists allocated due to CopyNewMethods.
8771         2) the explicit cast in MemberList costed ALOT.
8772
8773 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8774
8775         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8776         a hashtable to avoid needless string allocations when an identifier is
8777         used more than once (the common case).
8778
8779 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8780
8781         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8782         is broken, it will not return anything. So, we
8783         have to use the information we have in mcs to
8784         do the task.
8785
8786         * typemanager.cs: Add a cache for GetInterfaces,
8787         since this will now be used more often (due to ^^)
8788
8789         (GetExplicitInterfaces) New method that gets the
8790         declared, not effective, interfaces on a type
8791         builder (eg, if you have interface IFoo, interface
8792         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8793         { IBar }.
8794
8795         This patch makes MCS able to bootstrap itself on
8796         Windows again.
8797
8798 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8799
8800         * expression.cs: Remove the Nop's that Miguel put
8801         in by mistake.
8802
8803 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8804
8805         * report.cs, codegen.cs: Give the real stack trace to
8806         the error when an exception is thrown.
8807
8808 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8809
8810         * decl.cs: only allocate hashtables for ifaces if 
8811         it is an iface!
8812
8813 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8814
8815         * expression.cs: fix the error from cs0121-2.cs
8816         (a parent interface has two child interfaces that
8817         have a function with the same name and 0 params
8818         and the function is called through the parent).
8819
8820 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8821
8822         * class.cs, rootcontext.cs, typmanager.cs: do not
8823         leak pointers.
8824
8825 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8826
8827         * codegen.cs: remove stack for the ec flow branching.
8828         It is already a linked list, so no need.
8829
8830 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8831
8832         * Makefile: Allow custom profiler here.
8833
8834 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8835
8836         * typemanager.cs (LookupType):
8837           - Use a static char [], because split takes
8838             a param array for args, so it was allocating
8839             every time.
8840           - Do not store true in a hashtable, it boxes.
8841
8842 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8843
8844         * flowanalysis.cs: bytify common enums.
8845
8846 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8847
8848         * modifiers.cs: Add a new set of flags for the
8849         flags allowed on explicit interface impls.
8850         * cs-parser.jay: catch the use of modifiers in
8851         interfaces correctly.
8852         * class.cs: catch private void IFoo.Blah ().
8853
8854         All related to bug #50572.
8855
8856 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8857
8858         * decl.cs: Rewrite the consistant accessability checking.
8859         Accessability is not linear, it must be implemented in
8860         a tableish way. Fixes #49704.
8861
8862 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8863
8864         * expression.cs: Handle negation in a checked context.
8865         We must use subtraction from zero. Fixes #38674.
8866
8867 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8868
8869         * class.cs: Ignore static void main in DLLs.
8870         * rootcontext.cs: Handle the target type here,
8871         since we are have to access it from class.cs
8872         * driver.cs: account for the above.
8873
8874 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8875
8876         * report.cs: Give line numbers and files if available.
8877
8878 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8879
8880         * driver.cs: Implement /addmodule.
8881
8882         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8883         ModuleBuilders.
8884
8885 2003-12-20  Martin Baulig  <martin@ximian.com>
8886
8887         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8888         (FieldBase.IsAssigned): Removed this field.
8889         (FieldBase.SetAssigned): New public method.
8890         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8891
8892 2003-12-20  Martin Baulig  <martin@ximian.com>
8893
8894         * expression.cs (LocalVariableReference.DoResolve): Don't set
8895         `vi.Used' if we're called from DoResolveLValue().
8896
8897         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8898         returns the usage vector it just merged into the current one -
8899         pass this one to UsageWarning().
8900         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8901         of the `EmitContext', don't call this recursively on our children.
8902
8903 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8904
8905         * driver.cs: Implement /target:module.
8906
8907 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8908
8909         * support.cs (CharArrayHashtable): New helper class.
8910
8911         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8912         char arrays, not strings, so we can avoid creating a string in
8913         consume_identifier if the identifier is a keyword.
8914
8915 2003-12-16  Martin Baulig  <martin@ximian.com>
8916
8917         * statement.cs (LocalInfo.Assigned): Removed this property.
8918         (LocalInfo.Flags): Removed `Assigned'.
8919         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8920         and uses flow analysis.
8921         (Block.UsageWarning): Made this method private.
8922         (Block.Resolve): Call UsageWarning() if appropriate.
8923
8924         * expression.cs (LocalVariableReference.DoResolve): Always set
8925         LocalInfo.Used here.
8926
8927 2003-12-13  Martin Baulig  <martin@ximian.com>
8928
8929         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8930         any value here; we're now using flow analysis to figure out
8931         whether a statement/block returns a value.
8932
8933 2003-12-13  Martin Baulig  <martin@ximian.com>
8934
8935         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8936         working again.
8937         (FlowBranching.MergeFinally): Don't call
8938         `branching.CheckOutParameters()' here, this is called in
8939         MergeTopBlock().
8940         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8941         when adding the `finally' vector.       
8942
8943 2003-12-13  Martin Baulig  <martin@ximian.com>
8944
8945         * flowanalysis.cs
8946         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8947         actually work and also fix #48962.
8948
8949 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8950
8951         * decl.cs: Do not check System.Object for nested types,
8952         since we know it does not have any. Big bang for buck:
8953
8954         BEFORE:
8955            Run 1:   8.35 seconds
8956            Run 2:   8.32 seconds
8957            corlib:  17.99 seconds
8958         AFTER:
8959            Run 1:   8.17 seconds
8960            Run 2:   8.17 seconds
8961            corlib:  17.39 seconds
8962
8963 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8964
8965         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8966         time we are returning 0 members, so we save alot here.
8967
8968 2003-12-11  Martin Baulig  <martin@ximian.com>
8969
8970         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8971         `MergeChild()', also just take the `FlowBranching' as argument;
8972         call Merge() on it and return the result.
8973         (FlowBranching.Merge): We don't need to do anything if we just
8974         have one sibling.
8975
8976 2003-12-11  Martin Baulig  <martin@ximian.com>
8977
8978         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8979         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8980         Maurer for this idea.
8981
8982 2003-12-11  Martin Baulig  <martin@ximian.com>
8983
8984         * flowanalysis.cs (MergeResult): This class is now gone; we now
8985         use the `UsageVector' for this.  The reason for this is that if a
8986         branching just has one sibling, we don't need to "merge" them at
8987         all - that's the next step to do.
8988         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8989         `MergeResult'.
8990
8991 2003-12-11  Martin Baulig  <martin@ximian.com>
8992
8993         Reworked flow analyis and made it more precise and bug-free.  The
8994         most important change is that we're now using a special `Reachability'
8995         class instead of having "magic" meanings of `FlowReturns'.  I'll
8996         do some more cleanups and optimizations and also add some more
8997         documentation this week.
8998
8999         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9000         largely reworked this class.
9001         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9002         the new `Reachability' class instead of having "magic" values here.
9003         (FlowBranching): We're now using an instance of `Reachability'
9004         instead of having separate `Returns', `Breaks' etc. fields.
9005
9006         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9007         based on flow analysis; ignore the return value of block.Emit ().
9008
9009 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9010
9011         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9012         if they are private.
9013
9014 2003-12-09  Martin Baulig  <martin@ximian.com>
9015
9016         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9017         call them directly on the UsageVector.
9018
9019 2003-12-09  Martin Baulig  <martin@ximian.com>
9020
9021         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9022         Changed return type from `FlowReturns' to `Reachability'.
9023
9024 2003-12-09  Martin Baulig  <martin@ximian.com>
9025
9026         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9027         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9028         `Reachable' fields with a single `Reachability' one.
9029
9030 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9031
9032         * class.cs (FindMembers): Remove foreach's.
9033
9034         Bootstrap times:
9035
9036         BEFORE
9037                 Run 1:   8.74 seconds
9038                 Run 2:   8.71 seconds
9039
9040         AFTER
9041                 Run 1:   8.64 seconds
9042                 Run 2:   8.58 seconds
9043
9044
9045 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9046
9047         * cs-parser.jay:
9048         * gen-treedump.cs:
9049         * statement.cs:
9050         This patch does a few things:
9051                 1. EmptyStatement is now a singleton, so it is never reallocated.
9052                 2. All blah is EmptyStatement constructs have been changed to
9053                    blah == EmptyStatement.Value, which is much faster and valid
9054                    now that EmptyStatement is a singleton.
9055                 3. When resolving a block, rather than allocating a new array for
9056                    the non-empty statements, empty statements are replaced with
9057                    EmptyStatement.Value
9058                 4. Some recursive functions have been made non-recursive.
9059         Mainly the performance impact is from (3), however (1) and (2) are needed for
9060         this to work. (4) does not make a big difference in normal situations, however
9061         it makes the profile look saner.
9062
9063         Bootstrap times:
9064
9065         BEFORE
9066         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9067         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9068         Total memory allocated: 56397 KB
9069
9070         AFTER
9071         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9072         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9073         Total memory allocated: 55666 KB
9074
9075 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9076
9077         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9078         than the hashtable in a hashtable version
9079
9080         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9081         we always end up concating a string. This results in a huge perf
9082         loss, because many strings have to be tracked by the GC. In this
9083         patch, we first use a hashtable that works with two keys, so that
9084         the strings do not need to be concat'ed.
9085
9086         Bootstrap times:
9087         BEFORE
9088                 Run 1:   8.74 seconds
9089                 Run 2:   8.71 seconds
9090
9091         AFTER
9092                 Run 1:   8.65 seconds
9093                 Run 2:   8.56 seconds
9094
9095 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9096
9097         * Makefile: Add a new target `do-time' that does a quick and simple
9098         profile, leaving easy to parse output.
9099
9100 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9101
9102         * codegen.cs (Init): Create the dynamic assembly with 
9103         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9104
9105 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9106
9107         * support.cs: Make the PtrHashtable use only one
9108         instance of its comparer.
9109
9110 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9111
9112         * typemanager.cs: Fix lookup of GetNamespaces.
9113
9114 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9115
9116         * expression.cs: Removed redundant line.
9117
9118         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9119         ArrayLists, use for loops with bounds.  
9120
9121         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9122         arraylist.
9123
9124         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9125         arraylists, use for loop with bounds.
9126
9127         The above three changes give us a 0.071 second performance
9128         improvement out of 3.294 seconds down to 3.223.  On my machine
9129         the above changes reduced the memory usage by 1,387 KB during
9130         compiler bootstrap.
9131
9132         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9133         QualifiedIdentifiers.  Before we created a new string through
9134         concatenation, and mostly later on, the result would be
9135         manipulated by DecomposeQI through string manipulation.
9136
9137         This reduced the compiler memory usage for bootstrapping from
9138         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9139         compile times in 0.05 seconds.
9140
9141 2003-11-28  Dick Porter  <dick@ximian.com>
9142
9143         * support.cs: Do string compares with the Invariant culture.
9144
9145         * rootcontext.cs: 
9146         * gen-treedump.cs: 
9147         * expression.cs: 
9148         * driver.cs: 
9149         * decl.cs: 
9150         * codegen.cs: 
9151         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9152         the comparison is done with the Invariant culture.
9153
9154 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9155
9156         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9157         GetEnumerator method.
9158
9159         (ProbeCollectionType): Iterate starting at the most specific type
9160         upwards looking for a GetEnumerator
9161
9162         * expression.cs: Shift count can be up to 31 for int/uint and 63
9163         for long/ulong.
9164
9165 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9166
9167         * statement.cs (Block.LookupLabel): Also look for the label on the
9168         children blocks.  Use a hash table to keep track of visited
9169         nodes. 
9170
9171         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9172         we actually did transform the other operand, otherwise fall back
9173         to the common codepath that casts to long.
9174
9175         * cs-tokenizer.cs: Use the same code pattern as the int case.
9176         Maybe I should do the parsing myself, and avoid depending on the
9177         Parse routines to get this done.
9178
9179 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9180
9181         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9182         which fixes bug 51347.  This time test it.
9183
9184         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9185         attributes for example can not tell the difference between these.
9186         The difference was only a syntax feature of the language. 
9187
9188         * attribute.cs: Apply attributes to delegates.
9189
9190         * delegate.cs: Call the apply attributes method.
9191
9192 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9193
9194         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9195         comparing 0 vs Byte.MinValue, not the value
9196
9197         (ImplicitConversionRequired): When reporting a conversion error,
9198         use error 31 to print out the constant error instead of the
9199         simpler 29.
9200
9201         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9202         which fixes bug 51347.
9203
9204 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9207         which fixes the -warnaserror command line option.
9208
9209 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9210
9211         * cfold.cs (DoNumericPromotions): During constant folding of
9212         additions on UIntConstant, special case intconstants with
9213         IntConstants like we do on the expression binary operator. 
9214
9215 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9216
9217         * convert.cs (ImplicitReferenceConversion): We were missing a case
9218         (System.Enum are not value types or class types, so we need to
9219         classify them separatedly).
9220
9221         * driver.cs: We do not support error 2007.
9222
9223 2003-11-12 Jackson Harper <jackson@ximian.com>
9224
9225         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9226         system directory. Also use the full file name so users can
9227         libraries names mscorlib-o-tron.dll in a non system dir.
9228
9229 2003-11-10  Martin Baulig  <martin@ximian.com>
9230
9231         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9232         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9233         calling `ResolveType()' on them, directly assign their `Type'.
9234
9235 2003-11-08  Martin Baulig  <martin@ximian.com>
9236
9237         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9238         return value and the `out parent' parameter.
9239         (TypeContainer.DefineType): Moved the CS0644 check into
9240         GetClassBases().  Don't pass the interface types to the
9241         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9242         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9243
9244         * ecore.cs (TypeExpr.IsAttribute): New property.
9245         (TypeExpr.GetInterfaces): New method.
9246
9247         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9248         TypeExpr instead of a Type.
9249         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9250         (Interface.DefineType): Don't pass the interface types to the
9251         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9252         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9253
9254         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9255         instead of a `Type[]'.
9256         (TypeManager.RegisterBuilder): Likewise.
9257         (TypeManager.AddUserInterface): Likewise.
9258         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9259         `Type[]' and also return a `TypeExpr[]'.
9260         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9261
9262 2003-11-08  Martin Baulig  <martin@ximian.com>
9263
9264         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9265         Expression.     
9266
9267 2003-11-08  Martin Baulig  <martin@ximian.com>
9268
9269         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9270         TypeManager.ResolveExpressionTypes().
9271
9272         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9273         instead of an Expression.
9274         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9275         (TypeExpression): New public class; formerly known as `TypeExpr'.
9276
9277         * expression.cs (ComposedCast): Derive from TypeExpr.
9278
9279         * typemanager.cs (TypeManager.system_*_expr): These are now
9280         TypExpr's instead of Expression's.
9281         (TypeManager.ResolveExpressionTypes): New public static function;
9282         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9283         of them.        
9284
9285 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9286
9287         * expression.cs (New.DoResolve): Do not dereference value that
9288         might be a null return.
9289
9290         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9291         sure that the constant value has the right type.  Fixes an
9292         unreported bug, similar to 50425.
9293
9294         * const.cs (Const.LookupConstantValue): Call
9295         ImplicitStandardConversionExists before doing a conversion to
9296         avoid havng the TypeManager.ChangeType do conversions.
9297
9298         Reduced the number of casts used
9299
9300         (Const.ChangeType): New routine to enable reuse of the constant
9301         type changing code from statement.
9302
9303         * typemanager.cs (ChangeType): Move common initialization to
9304         static global variables.
9305
9306         Fixes #50425.
9307
9308         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9309         every value type to go through, even if it was void.  Fix that. 
9310
9311         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9312         character of the define, and the is_identifier_part_character for
9313         the rest of the string.
9314
9315 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9316
9317         * expression.cs (UnaryMutator.EmitCode): When I updated
9318         LocalVariableReference.DoResolve, I overdid it, and dropped an
9319         optimization done on local variable references.
9320
9321 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9322
9323         * ecore.cs: Convert the return from Ldlen into an int.
9324
9325 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9326
9327         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9328         the accessibility, this is a special case for toplevel non-public
9329         classes (internal for instance).
9330
9331 2003-10-20  Nick Drochak <ndrochak@gol.com>
9332
9333         * ecore.cs: Fix typo and build.  Needed another right paren.
9334
9335 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9338         `internal' case regular and protected, but not allowing protected
9339         to be evaluated later.  Bug 49840
9340
9341 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9342
9343         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9344         to kb.Nlast, and not the kb.nFirst to isolate the switch
9345         statement.
9346
9347         Extract the underlying type, so enumerations of long/ulong are
9348         treated like long/ulong.
9349
9350 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9351
9352         * expression.cs (New): Overload the meaning of RequestedType to
9353         track the possible creation of the NewDelegate type, since
9354         DoResolve is invoked more than once for new constructors on field
9355         initialization.
9356
9357         See bugs: #48800 and #37014
9358
9359         * cs-parser.jay (declare_local_constants): Take an arraylist
9360         instead of a single constant.
9361
9362         (local_constant_declaration): It should take a
9363         constant_declarators, not a constant_declarator.  Fixes 49487
9364
9365         * convert.cs: Fix error report.
9366
9367 2003-10-13 Jackson Harper <jackson@ximian.com>
9368
9369         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9370         bug #49611
9371
9372 2003-10-09  Martin Baulig  <martin@ximian.com>
9373
9374         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9375         to the .ctor.
9376         (MethodCore.DoDefineParameters): Removed the TypeContainer
9377         argument; use the DeclSpace which was passed to the .ctor instead.
9378         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9379         TypeContainer; we only need a DeclSpace here.
9380
9381 2003-10-09  Martin Baulig  <martin@ximian.com>
9382
9383         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9384         to the .ctor.
9385         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9386         EmitContext's .ctor.    
9387
9388 2003-10-09  Martin Baulig  <martin@ximian.com>
9389
9390         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9391         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9392         AsAccessible(), moved them as well.
9393
9394         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9395
9396 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9397
9398         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9399
9400 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9401
9402         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9403         generation for >=, as spotted by Paolo, bug 48679.  
9404         Patch from David Waite.
9405
9406         * cs-tokenizer.cs: Add handling for #pragma.
9407
9408         * cs-parser.jay: Allow for both yield and yield return in the
9409         syntax.  The anti-cobolization of C# fight will go on!
9410
9411         * class.cs (TypeBuilder.DefineType): Catch error condition here
9412         (Parent.DefineType erroring out and returning null).
9413
9414         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9415         coping with enumerations variables, we were mistakenly processing
9416         them as a regular value type instead of built-in types.  Fixes the
9417         bug #48063
9418
9419         * typemanager.cs (IsBuiltinOrEnum): New method.
9420
9421 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9422
9423         * cs-parser.jay: Upgrade: yield now needs the return clause.
9424
9425 2003-09-19  Martin Baulig  <martin@ximian.com>
9426
9427         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9428         `MemberCache parent' argument.  Normally, an interface doesn't
9429         have a parent type except System.Object, but we use this in gmcs
9430         for generic type parameters.
9431
9432 2003-09-18  Martin Baulig  <martin@ximian.com>
9433
9434         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9435         on `type.IsInterface'; don't check whether the type has a parent
9436         to determine whether it's an interface.
9437
9438 2003-09-15  Martin Baulig  <martin@ximian.com>
9439
9440         * class.cs (TypeContainer.DefineType): Added an error flag to
9441         avoid reporting duplicate CS0146's ("class definition is
9442         circular.").
9443
9444         * driver.cs (Driver.MainDriver): Abort if
9445         RootContext.ResolveTree() reported any errors.
9446
9447 2003-09-07  Martin Baulig  <martin@ximian.com>
9448
9449         * report.cs (Error, Warning): Added overloaded versions which take
9450         a `params object[] args' and call String.Format().
9451
9452 2003-09-07  Martin Baulig  <martin@ximian.com>
9453
9454         * decl.cs (DeclSpace..ctor): Don't call
9455         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9456         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9457         (DeclSpace.RecordDecl): New method.
9458
9459         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9460
9461 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9462
9463         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9464         value attributes to be applied to ParameterBuilders.
9465
9466         * class.cs (MethodCore.LabelParameters): Make static and more
9467         generic so that it can be used from other places - like interface
9468         methods, for instance.
9469
9470         * interface.cs (Interface.Emit): Call LabelParameters before
9471         emitting attributes on the InterfaceMethod.
9472
9473 2003-08-26  Martin Baulig  <martin@ximian.com>
9474
9475         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9476         resolving aliases; fixes #47927.
9477
9478 2003-08-26  Martin Baulig  <martin@ximian.com>
9479
9480         * statement.cs (Using.DoResolve): This is internally emitting a
9481         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9482         do not always return.  Fixes #47681.
9483
9484 2003-08-26  Martin Baulig  <martin@ximian.com>
9485
9486         * decl.cs (MemberCore): Moved WarningNotHiding(),
9487         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9488         into MemberBase.
9489         (AdditionResult): Make this nested in DeclSpace.
9490         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9491         argument; call NamespaceEntry.Define() unless we're nested in a
9492         class or struct.
9493
9494         * namespace.cs (Namespace.DefineName): New public function.  This
9495         is called from DeclSpace's .ctor to add 
9496         (Namespace.Lookup): Include DeclSpaces in the lookup.
9497
9498         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9499
9500         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9501
9502 2003-08-25  Martin Baulig  <martin@ximian.com>
9503
9504         * convert.cs (Convert.ExplicitReferenceConversion): When
9505         converting from an interface type to a class, unbox if the target
9506         type is a struct type.  Fixes #47822.
9507
9508 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9509
9510         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9511         #47854.
9512
9513 2003-08-22  Martin Baulig  <martin@ximian.com>
9514
9515         * class.cs (TypeManager.DefineType): When defining a nested type,
9516         call DefineType() on our parent; fixes #47801.
9517
9518 2003-08-22  Martin Baulig  <martin@ximian.com>
9519
9520         * class.cs (MethodData.Define): While checking if a method is an
9521         interface implementation, improve the test a bit more to fix #47654.
9522
9523 2003-08-22  Martin Baulig  <martin@ximian.com>
9524
9525         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9526         correctly; fixes #47722.
9527
9528 2003-08-22  Martin Baulig  <martin@ximian.com>
9529
9530         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9531         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9532
9533         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9534
9535 2003-08-22  Martin Baulig  <martin@ximian.com>
9536
9537         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9538         can only be assigned in static constructors.  Fixes #47161.
9539
9540 2003-08-22  Martin Baulig  <martin@ximian.com>
9541
9542         Rewrote and improved the flow analysis code.
9543
9544         * flowbranching.cs (FlowBranching): Make this class abstract.
9545         (FlowBranching.CreateBranching): New static function to create a
9546         new flow branching.
9547         (FlowBranchingBlock, FlowBranchingException): New classes.
9548         (FlowBranching.UsageVector.Type): New public readonly field.
9549         (FlowBranching.UsageVector.Breaks): Removed the setter.
9550         (FlowBranching.UsageVector.Returns): Removed the setter.
9551         (FlowBranching.UsageVector): Added Break(), Return(),
9552         NeverReachable() and Throw() methods to modify the reachability.
9553         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9554         done by FlowBranching.Merge().
9555         (FlowBranching.UsageVector.MergeChild): New method; merges the
9556         merge result into the current vector.
9557         (FlowBranching.Merge): New abstract method to merge a branching.
9558
9559 2003-08-12  Martin Baulig  <martin@ximian.com>
9560
9561         * expression.cs (Indirection.CacheTemporaries): Create the
9562         LocalTemporary with the pointer type, not its element type.
9563
9564 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9567         token was a keyword or not.
9568
9569         Add `error' options where an IDENTIFIER was expected;  Provide
9570         CheckToken and CheckIdentifierToken convenience error reporting
9571         functions. 
9572
9573         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9574
9575         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9576         NameSpaceEntry NameSpaceEntry.
9577
9578         (LookupInterfaceOrClass): Avoid creating a full qualified name
9579         from namespace and name: avoid doing lookups when we know the
9580         namespace is non-existant.   Use new Tree.LookupByNamespace which
9581         looks up DeclSpaces based on their namespace, name pair.
9582
9583         * driver.cs: Provide a new `parser verbose' to display the
9584         exception thrown during parsing.  This is turned off by default
9585         now, so the output of a failure from mcs is more graceful.
9586
9587         * namespace.cs: Track all the namespaces defined in a hashtable
9588         for quick lookup.
9589
9590         (IsNamespace): New method
9591
9592 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9593
9594         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9595         we know that we need to concatenate (full typename can never be
9596         null). 
9597
9598         * class.cs: ditto.
9599
9600         * statement.cs: Use a bitfield;  Do not initialize to null things
9601         which are done by the constructor by default.
9602
9603         * cs-parser.jay: bug fix, parameter was 4, not 3.
9604
9605         * expression.cs: Just use the property;
9606
9607         * statement.cs: No need for GetVariableInfo method.
9608
9609 2003-08-08  Martin Baulig  <martin@ximian.com>
9610
9611         * flowanalysis.cs (FlowReturns): This is now nested in the
9612         `FlowBranching' class.
9613         (MyBitVector): Moved this here from statement.cs.
9614         (FlowBranching.SiblingType): New enum type.
9615         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9616
9617 2003-08-07  Martin Baulig  <martin@ximian.com>
9618
9619         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9620         `FlowBranching' class and called `BranchingType'.
9621
9622 2003-08-07  Martin Baulig  <martin@ximian.com>
9623
9624         * flowanalysis.cs: Moved all the control flow analysis code into
9625         its own file.
9626
9627 2003-08-07  Martin Baulig  <martin@ximian.com>
9628
9629         * assign.cs (Assign.DoResolve): `target' must either be an
9630         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9631         #37319.
9632
9633 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * expression.cs (BinaryMethod): This kind of expression is created by the
9636         Binary class if it determines that the operator has to be handled
9637         by a method.
9638
9639         (BinaryDelegate): This kind of expression is created if we are
9640         dealing with a + or - operator on delegates.
9641
9642         (Binary): remove method, argumetns, and DelegateOperator: when
9643         dealing with methods, 
9644
9645         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9646
9647         * statement.cs (Block): use bitfields for the three extra booleans
9648         we had in use.   Remove unused topblock parameter.
9649
9650         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9651
9652         * assign.cs: Drop extra unneeded tests.
9653
9654 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9655
9656         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9657
9658         * statement.cs (Foreach): Use VariableStorage instead of
9659         LocalBuilders.   
9660
9661         * codegen.cs (VariableStorage): New class used by clients that
9662         require a variable stored: locals or fields for variables that
9663         need to live across yield.
9664
9665         Maybe provide a convenience api for EmitThis+EmitLoad?
9666
9667         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9668         these bad boys.
9669
9670 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9671
9672         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9673         RemapParameterLValue): New methods that are used to turn a
9674         precomputed FieldInfo into an expression like this:
9675
9676                 instance.FieldInfo
9677
9678         The idea is to use this instead of making LocalVariableReference
9679         have more than one meaning.
9680
9681         * cs-parser.jay: Add error production to BASE.
9682
9683         * ecore.cs: Deal with TypeManager.GetField returning null, which
9684         is now a valid return value.
9685
9686         (FieldExprNoAddress): New expression for Fields whose address can
9687         not be taken.
9688
9689         * expression.cs (LocalVariableReference): During the resolve
9690         phases, create new expressions if we are in a remapping context.
9691         Remove code that dealt with remapping here.
9692
9693         (ParameterReference): same.
9694
9695         (ProxyInstance): New expression, like the `This' expression, but
9696         it is born fully resolved.  We know what we are doing, so remove
9697         the errors that are targeted to user-provided uses of `this'.
9698
9699         * statement.cs (Foreach): our variable is now stored as an
9700         Expression;  During resolution, follow the protocol, dont just
9701         assume it will return this.
9702
9703 2003-08-06  Martin Baulig  <martin@ximian.com>
9704
9705         * support.cs (SeekableStreamReader.cs): New public class.
9706
9707         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9708         SeekableStreamReader instead of the normal StreamReader.
9709
9710 2003-08-04  Martin Baulig  <martin@ximian.com>
9711
9712         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9713         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9714         deambiguate casts and delegate invocations.
9715         (parenthesized_expression): Use the new tokens to ensure this is
9716         not a cast of method invocation.
9717
9718         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9719         when reading a `)' and Deambiguate_CloseParens () was previously
9720         called.
9721
9722         * expression.cs (ParenthesizedExpression): New class.  This is
9723         just used for the CS0075 test.
9724         (Binary.DoResolve): Check for CS0075.   
9725
9726 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9727
9728         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9729         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9730         reference comparison.
9731
9732         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9733         examine the ReturnType for equality - this is necessary in the
9734         cases of implicit and explicit operators whose signature also
9735         includes the return type.
9736
9737 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9738
9739         * namespace.cs: Cache the result of the namespace computation,
9740         instead of computing it every time.
9741
9742 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9743
9744         * decl.cs: Use a global arraylist that we reuse over invocations
9745         to avoid excesive memory consumption.  Reduces memory usage on an
9746         mcs compile by one meg (45 average).
9747
9748         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9749         private, work around that.
9750
9751 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * literal.cs (IntLiteral): Define Zero and One static literals. 
9754
9755         * cs-parser.jay (integer_literal): use static literals to reduce
9756         memory usage for the most used literals (0, 1 and -1).  211kb
9757         reduced in memory usage.
9758
9759         Replace all calls to `new ArrayList' with `new
9760         ArrayList(4)' which is a good average number for most allocations,
9761         and also requires only 16 bytes of memory for its buffer by
9762         default. 
9763
9764         This reduced MCS memory usage in seven megabytes for the RSS after
9765         bootstrapping.
9766
9767 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9768
9769         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9770         handle params methods the correct way by forming only one
9771         applicable set with params and normal methods in them. Earlier we
9772         were looking at params methods only if we found no normal methods
9773         which was not the correct thing to do.
9774
9775         (Invocation.BetterFunction): Take separate arguments indicating
9776         when candidate and the best method are params methods in their
9777         expanded form.
9778
9779         This fixes bugs #43367 and #46199.
9780
9781         * attribute.cs: Documentation updates.
9782
9783         (CheckAttribute): Rename to CheckAttributeTarget.
9784         (GetValidPlaces): Rename to GetValidTargets.
9785
9786         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9787         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9788
9789         Fixes bug #44468.
9790
9791 2003-07-28  Martin Baulig  <martin@ximian.com>
9792
9793         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9794         name when looking up the base class of a nested class.  Fixes #46977.
9795
9796 2003-07-26  Martin Baulig  <martin@ximian.com>
9797
9798         * expression.cs (Indexers.Indexer): New nested struct; contains
9799         getter, setter and the indexer's type.
9800         (Indexers.Properties): This is now an ArrayList of
9801         Indexers.Indexer's.
9802         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9803         indexer doesn't have any getters.
9804
9805         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9806         for embedded property and indexer assignments.
9807
9808 2003-07-26  Martin Baulig  <martin@ximian.com>
9809
9810         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9811         preprocessor directive is not the first non-whitespace character
9812         on a line.
9813
9814 2003-07-26  Martin Baulig  <martin@ximian.com>
9815
9816         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9817         namespace parsing, follow the spec more closely.
9818
9819         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9820         NamespaceEntry.Lookup().
9821
9822 2003-07-25  Martin Baulig  <martin@ximian.com>
9823
9824         * MethodCore.cs (OverridesSomething): New public field; it's set
9825         from TypeContainer.DefineMembers if this method overrides
9826         something (which doesn't need to be a method).  Fix #39462.
9827
9828 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9829
9830         * typemanager.cs (GetMembers): Ensure that the list of members is
9831         reversed. This keeps things in sync.
9832
9833         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9834         find an AttributeUsage attribute.
9835
9836         * expression.cs (Invocation.OverloadResolve): Perform the check
9837         which disallows Invoke to be directly called on a Delegate.
9838
9839         (Error_InvokeOnDelegate): Report error cs1533.
9840
9841 2003-07-25  Martin Baulig  <martin@ximian.com>
9842
9843         * expression.cs (Indexers.GetIndexersForType): Only look in the
9844         interface hierarchy if the requested type is already an
9845         interface.  Fixes #46788 while keeping #46502 fixed.
9846
9847 2003-07-25  Martin Baulig  <martin@ximian.com>
9848
9849         * class.cs (TypeContainer.DefineMembers): Check whether all
9850         readonly fields have been assigned and report warning CS0649 if
9851         not.
9852
9853         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9854         a valuetype.
9855
9856 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9857
9858         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9859         returned from GetMethods to make things consistent with the
9860         assumptions MCS makes about ordering of methods.
9861
9862         This should comprehensively fix bug #45127 and it does :-)
9863
9864         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9865         ordering is actually reverse.
9866
9867         * Clean up some debug messages I left lying around.
9868
9869         * interface.cs (Populate*): Get rid of code which emits attributes
9870         since the stage in which we emit attributes is the 'Emit' stage,
9871         not the define stage.
9872
9873         (Emit): Move attribute emission for interface members here.
9874
9875 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9876
9877         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9878         closely: we eliminate methods in base types when we have an
9879         applicable method in a top-level type.
9880
9881         Please see section 14.5.5.1 for an exact description of what goes
9882         on. 
9883
9884         This fixes bug #45127 and a host of other related to corlib compilation.
9885
9886         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9887         array is the method corresponding to the top-level type (this is
9888         because of the changes made to icall.c) so we change this
9889         accordingly.
9890
9891         (MethodGroupExpr.Name): This too.
9892
9893         * typemanager.cs (GetElementType): New method which does the right
9894         thing when compiling corlib. 
9895
9896         * everywhere: Make use of the above in the relevant places.
9897
9898 2003-07-22  Martin Baulig  <martin@ximian.com>
9899
9900         * cs-parser.jay (invocation_expression): Moved
9901         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9902         `cast_expression', but create a InvocationOrCast which later
9903         resolves to either an Invocation or a Cast.
9904
9905         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9906         method; call this before EmitStatement() to make sure that this
9907         expression can be used as a statement.
9908
9909         * expression.cs (InvocationOrCast): New class; resolves to either
9910         an Invocation or a Cast.
9911
9912         * statement.cs (StatementExpression): Call ResolveStatement() on
9913         the ExpressionStatement before emitting it.
9914
9915 2003-07-21  Martin Baulig  <martin@ximian.com>
9916
9917         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9918         `ref' and `out' attributes match; fixes #46220.
9919         (MemberAccess.ResolveMemberAccess): You can't reference a type
9920         through an expression; fixes #33180.
9921         (Indexers.GetIndexersForType): Don't return the indexers from
9922         interfaces the class implements; fixes #46502.
9923
9924 2003-07-21  Martin Baulig  <martin@ximian.com>
9925
9926         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9927         CS0661 checks; fixes bug #30442.
9928
9929 2003-07-21  Martin Baulig  <martin@ximian.com>
9930
9931         * decl.cs (AdditionResult): Added `Error'.
9932
9933         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9934
9935         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9936         makes cs0031.cs actually work.
9937
9938 2003-07-20  Martin Baulig  <martin@ximian.com>
9939
9940         * namespace.cs: Fixed that bug which caused a crash when compiling
9941         the debugger's GUI.
9942
9943 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * typemanager.cs (LookupTypeReflection): Never expose types which
9946         are NotPublic, NestedPrivate, NestedAssembly, or
9947         NestedFamANDAssem.  We used to return these, and later do a check
9948         that would report a meaningful error, but the problem is that we
9949         would not get the real match, if there was a name override.
9950
9951 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9952
9953         * namespace.cs (Namespace, Name): Do not compute the namespace
9954         name dynamically, compute it in the constructor.  This reduced
9955         memory usage by 1697 KB.
9956
9957         * driver.cs: Use --pause to pause at the end.
9958
9959 2003-07-17  Peter Williams  <peter@newton.cx>
9960
9961         * Makefile: Change the name of the test target so that it doesn't
9962         conflict with the recursive test target.
9963
9964 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9965
9966         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9967         AddressOf): Do not use EmitThis, that was wrong, use the actual
9968         this pointer.
9969
9970 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9971
9972         * class.cs (MethodData.Define): While checking if a method is an
9973         interface implementation, improve the test: If we are not public
9974         (use new test here: use the computed MethodAttributes directly,
9975         instead of the parsed modifier flags) check if the `implementing'
9976         method comes from an interface or not.
9977
9978         * pending.cs (VerifyPendingMethods): Slightly better error
9979         message.
9980
9981         * makefile: add test target that does the mcs bootstrap.
9982
9983 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9984
9985         * interface.cs (Define): Do nothing here since there are no
9986         members to populate etc. Move the attribute emission out of here
9987         since this was just totally the wrong place to put it. Attribute
9988         application happens during the 'Emit' phase, not in the 'Define'
9989         phase.
9990
9991         (Emit): Add this method and move the attribute emission here
9992
9993         * rootcontext.cs (EmitCode): Call the Emit method on interface
9994         types too.
9995
9996 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9997
9998         * expression.cs (OverloadResolve): Report error only if Location
9999         is not 'Null' which means that there was a probe going on.
10000
10001 2003-07-14  Martin Baulig  <martin@ximian.com>
10002
10003         * expression.cs (ConditionalLogicalOperator): New public class to
10004         implement user defined conditional logical operators.
10005         This is section 14.11.2 in the spec and bug #40505.
10006
10007 2003-07-14  Martin Baulig  <martin@ximian.com>
10008
10009         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10010
10011 2003-07-14  Martin Baulig  <martin@ximian.com>
10012
10013         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10014
10015         * ecore.cs (IVariable.VerifyFixed): New interface method.
10016
10017         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10018         operator, check whether the variable is actually fixed.  Fixes bug
10019         #36055.  Set a variable definitely assigned when taking its
10020         address as required by the spec.
10021
10022         * statement.cs (LocalInfo.IsFixed): New field.
10023         (LocalInfo.MakePinned): Set `IsFixed' to true.
10024
10025 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10026
10027         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10028         for .ctors, ensure that we only ask for members declared in the
10029         attribute type (BindingFlags.DeclaredOnly).
10030
10031         Fixes bug #43632.
10032
10033         * expression.cs (Error_WrongNumArguments): Report error 1501
10034         correctly the way CSC does.
10035
10036 2003-07-13  Martin Baulig  <martin@ximian.com>
10037
10038         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10039         lookup on the fully qualified name, to make things like "X.X" work
10040         where "X.X" is a fully qualified type name, but we also have a
10041         namespace "X" in the using list.  Fixes #41975.
10042
10043 2003-07-13  Martin Baulig  <martin@ximian.com>
10044
10045         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10046         function. If we're a CompoundAssign, we need to create an embedded
10047         CompoundAssign, not an embedded Assign.
10048         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10049         Fixes #45854.
10050
10051 2003-07-13  Martin Baulig  <martin@ximian.com>
10052
10053         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10054         work to fix bug #46088.
10055
10056 2003-07-13  Ravi Pratap <ravi@ximian.com>
10057
10058         * class.cs (Operator.Emit): Do not emit attributes here - it is
10059         taken care of by the Method class that we delegate too. This takes
10060         care of bug #45876.
10061
10062 2003-07-10  Martin Baulig  <martin@ximian.com>
10063
10064         * expression.cs (TypeOfVoid): New class.
10065         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10066
10067 2003-07-10  Martin Baulig  <martin@ximian.com>
10068
10069         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10070         bug #35957.
10071
10072 2003-07-10  Martin Baulig  <martin@ximian.com>
10073
10074         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10075         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10076
10077         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10078
10079         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10080
10081 2003-07-10  Martin Baulig  <martin@ximian.com>
10082
10083         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10084         of decimal.  Fixes #42850.
10085
10086         NOTE: I also fixed the created byte blob, but this doesn't work on
10087         the MS runtime and csc never produces any byte blobs for decimal
10088         arrays.
10089
10090 2003-07-10  Martin Baulig  <martin@ximian.com>
10091
10092         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10093         structs; fixes #32068.
10094         (Block.AddChildVariableNames): Fixed #44302.
10095
10096 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10097
10098         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10099
10100 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * attribute.cs: And this test is onger needed.
10103
10104 2003-07-08  Martin Baulig  <martin@ximian.com>
10105
10106         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10107         inaccessible types.  Fixes #36313.
10108
10109         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10110
10111         * namespace.cs (NamespaceEntry): Create implicit entries for all
10112         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10113         implicit entries for N1.N2 and N1.
10114
10115 2003-07-08  Martin Baulig  <martin@ximian.com>
10116
10117         Rewrote the handling of namespaces to fix a lot of the issues
10118         wrt. `using' aliases etc.
10119
10120         * namespace.cs (Namespace): Splitted this class into a
10121         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10122
10123         * typemanager.cs (TypeManager.IsNamespace): Removed.
10124         (TypeManager.ComputeNamespaces): Only compute namespaces from
10125         loaded assemblies here, not the namespaces from the assembly we're
10126         currently compiling.
10127
10128 2003-07-08  Martin Baulig  <martin@ximian.com>
10129
10130         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10131
10132 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10133
10134         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10135         already fixed it.  
10136
10137         I thought about the memory savings here, but LookupTypeReflection
10138         is used under already very constrained scenarios.  Compiling
10139         corlib or mcs only exposes one hit, so it would not really reduce
10140         any memory consumption.
10141
10142 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10143
10144         * typemanager.cs: fixes bug #45889 by only adding public types from
10145         other assemblies to the list of known types.
10146
10147 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10148
10149         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10150         on the type we resolved.
10151
10152 2003-07-05  Martin Baulig  <martin@ximian.com>
10153
10154         * pending.cs (PendingImplementation.ParentImplements): Don't
10155         create the proxy if the parent is abstract.
10156
10157         * class.cs (TypeContainer.DefineIndexers): Process explicit
10158         interface implementations first.  Fixes #37714.
10159
10160 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10163         defined recursively;  but since we modify the input parameters
10164         (left is set to `this' temporarily), we reset this value if the
10165         left_is_explicit is false, which gives the original semantics to
10166         the code.  
10167
10168         * literal.cs (NullPointer): new class used to represent a null
10169         literal in a pointer context.
10170
10171         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10172         type is a pointer, use a NullPointer object instead of a
10173         NullLiteral.   Closes 43687
10174
10175         (ExplicitConversion): Convert pointer values using
10176         the conv opcode to the proper type.
10177
10178         * ecore.cs (New): change ValueTypeVariable property into a method,
10179         that returns whether the valuetype is suitable for being used.
10180
10181         * expression.cs (Binary.DoNumericPromotions): Only return if we
10182         the int constant was a valid uint, and we can return both left and
10183         right as uints.  If not, we continue processing, to trigger the
10184         type conversion.  This fixes 39018.
10185
10186         * statement.cs (Block.EmitMeta): During constant resolution, set
10187         the CurrentBlock property on the emitcontext, so that we resolve
10188         constants propertly.
10189
10190 2003-07-02  Martin Baulig  <martin@ximian.com>
10191
10192         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10193         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10194
10195         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10196         than emitting it here.
10197
10198         * statement.cs: Fixed some more flow analysis bugs.
10199
10200 2003-07-02  Martin Baulig  <martin@ximian.com>
10201
10202         * class.cs (MethodData.Define): When implementing interface
10203         methods, set Final unless we're Virtual.
10204
10205         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10206         check work for interface methods.
10207
10208 2003-07-01  Martin Baulig  <martin@ximian.com>
10209
10210         * ecore.cs (EmitContext.This): Replaced this property with a
10211         GetThis() method which takes a Location argument.  This ensures
10212         that we get the correct error location for a CS0188.
10213
10214 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10217         ImplicitStandardConversion.
10218
10219         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10220
10221 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10222
10223         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10224         optimization.
10225
10226 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10227
10228         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10229         constructors.
10230
10231         (MethodData.Define): Turn off initlocals for unsafe methods.
10232
10233 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10234
10235         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10236         complete;  Fixes #37521.
10237
10238         * delegate.cs: Use Modifiers.TypeAttr to compute the
10239         TypeAttributes, instead of rolling our own.  This makes the flags
10240         correct for the delegates.
10241
10242 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10243
10244         * class.cs (Constructor.Define): Set the private flag for static
10245         constructors as well.
10246
10247         * cs-parser.jay (statement_expression): Set the return value to
10248         null, to avoid a crash when we catch an error.
10249
10250 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10251
10252         * cs-parser.jay: Applied patch from Jackson that adds support for
10253         extern and unsafe modifiers to destructor declarations.
10254
10255         * expression.cs: Report error 21 if the user is trying to index a
10256         System.Array.
10257
10258         * driver.cs: Add an error message, suggested by the bug report.
10259
10260         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10261         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10262
10263 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10264
10265         * namespace.cs: Add some information to reduce FAQs.
10266
10267 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10268
10269         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10270         underlying enumeration types.  Fixes #43915.
10271
10272         * expression.cs: Treat ushort/short as legal values to be used in
10273         bitwise operations.
10274
10275 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10276
10277         * delegate.cs: transfer custom attributes for paramenters from
10278         the delegate declaration to Invoke and BeginInvoke.
10279
10280 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10281
10282         * attribute.cs: handle custom marshalers and emit marshal info
10283         for fields, too.
10284
10285 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10286
10287         * makefile.gnu: Added anonymous.cs to the compiler sources.
10288
10289 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10290
10291         * iterators.cs: Change the name of the proxy class to include two
10292         underscores.
10293
10294         * cs-parser.jay: Update grammar to include anonymous methods.
10295
10296         * anonymous.cs: new file.
10297
10298 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * class.cs (Field.Define): Add missing test for pointers and
10301         safety. 
10302
10303 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10304
10305         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10306         we use the stobj opcode.
10307
10308         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10309         since it wasn't the correct fix. 
10310
10311         It still is puzzling that we are required to use stobj for IntPtr
10312         which seems to be a ValueType.
10313
10314 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10315
10316         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10317         during regular simple name resolution.   Now, the trick is that
10318         instead of returning for processing the simplename, we do a
10319         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10320         contextual lookup type).   If a match is found, return that, if
10321         not, return for further composition.
10322
10323         This fixes long-standing 30485.
10324
10325         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10326         using the address to initialize an object, do an Stobj instead of
10327         using the regular Stelem.
10328
10329         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10330         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10331         Because if we are a BaseIndexerAccess that value will be true.
10332         Fixes 43643.
10333
10334         * statement.cs (GotoCase.Resolve): Return after reporting an
10335         error, do not attempt to continue. 
10336
10337         * expression.cs (PointerArithmetic.Emit): If our operand is a
10338         long, convert our constants to match the operand before
10339         multiplying.  Convert to I type before adding.   Fixes 43670.
10340
10341 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10342
10343         * enum.cs (ImplicitConversionExists) : Rename to
10344         ImplicitEnumConversionExists to remove ambiguity. 
10345
10346         * ecore.cs (NullCast): New type of cast expression class which
10347         basically is very similar to EmptyCast with the difference being
10348         it still is a constant since it is used only to cast a null to
10349         something else
10350         (eg. (string) null)
10351
10352         * convert.cs (ImplicitReferenceConversion): When casting a null
10353         literal, we return a NullCast.
10354
10355         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10356         should be around anymore.
10357
10358         The renaming (reported was slightly wrong). Corrections:
10359
10360         ConvertImplicitStandard -> ImplicitConversionStandard
10361         ConvertExplicitStandard -> ExplicitConversionStandard
10362
10363         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10364         before passing them in !
10365
10366         * convert.cs (ImplicitConversionStandard): When comparing for
10367         equal expr and target types, ensure that expr is not a
10368         NullLiteral.
10369
10370         In general, we must not be checking (expr_type ==
10371         target_type) in the top level conversion methods
10372         (ImplicitConversion, ExplicitConversion etc). This checking is
10373         done in the methods that they delegate to.
10374
10375 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10376
10377         * convert.cs: Move Error_CannotConvertType,
10378         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10379         ImplicitNumericConversion, ImplicitConversionExists,
10380         ImplicitUserConversionExists, StandardConversionExists,
10381         FindMostEncompassedType, FindMostSpecificSource,
10382         FindMostSpecificTarget, ImplicitUserConversion,
10383         ExplicitUserConversion, GetConversionOperators,
10384         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10385         TryImplicitIntConversion, Error_CannotConvertImplicit,
10386         ConvertImplicitRequired, ConvertNumericExplicit,
10387         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10388         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10389         its own file.
10390
10391         Perform the following renames:
10392
10393         StandardConversionExists -> ImplicitStandardConversionExists
10394         ConvertImplicit -> ImplicitConversion
10395         ConvertImplicitStandard -> ImplicitStandardConversion
10396         TryImplicitIntConversion -> ImplicitIntConversion
10397         ConvertImplicitRequired -> ImplicitConversionRequired
10398         ConvertNumericExplicit -> ExplicitNumericConversion
10399         ConvertReferenceExplicit -> ExplicitReferenceConversion
10400         ConvertExplicit -> ExplicitConversion
10401         ConvertExplicitStandard -> ExplicitStandardConversion
10402
10403 2003-05-19  Martin Baulig  <martin@ximian.com>
10404
10405         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10406         (TypeInfo): Added support for structs having structs as fields.
10407
10408         * ecore.cs (FieldExpr): Implement IVariable.
10409         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10410         VariableInfo for the field.
10411
10412 2003-05-18  Martin Baulig  <martin@ximian.com>
10413
10414         * expression.cs (This.DoResolve): Report a CS0027 if we're
10415         emitting a field initializer.
10416
10417 2003-05-18  Martin Baulig  <martin@ximian.com>
10418
10419         * expression.cs (This.ResolveBase): New public function.
10420         (This.DoResolve): Check for CS0188.
10421
10422         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10423         This.Resolve().
10424
10425         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10426         `instance_expression' to null if we don't have any non-static
10427         methods.
10428
10429 2003-05-18  Martin Baulig  <martin@ximian.com>
10430
10431         Reworked the way how local variables and parameters are handled by
10432         the flow analysis code.
10433
10434         * statement.cs (TypeInfo, VariableMap): New public classes.
10435         (VariableInfo): New public class.  This is now responsible for
10436         checking whether a variable has been assigned.  It is used for
10437         parameters and local variables.
10438         (Block.EmitMeta): Take the InternalParameters as argument; compute
10439         the layout of the flow vectors here.
10440         (Block.LocalMap, Block.ParameterMap): New public properties.
10441         (FlowBranching): The .ctor doesn't get the InternalParameters
10442         anymore since Block.EmitMeta() now computes the layout of the flow
10443         vector.
10444         (MyStructInfo): This class is now known as `StructInfo' and nested
10445         in `TypeInfo'; we don't access this directly anymore.
10446
10447         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10448         property and removed IsAssigned(), IsFieldAssigned(),
10449         SetAssigned() and SetFieldAssigned(); we now call them on the
10450         VariableInfo so we don't need to duplicate this code everywhere.
10451
10452         * expression.cs (ParameterReference): Added `Block block' argument
10453         to the .ctor.
10454         (LocalVariableReference, ParameterReference, This): The new
10455         VariableInfo class is now responsible for all the definite
10456         assignment stuff.
10457
10458         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10459         IsParameterAssigned, SetParameterAssigned): Removed.
10460
10461 2003-05-18  Martin Baulig  <martin@ximian.com>
10462
10463         * typemanager.cs (InitCoreTypes): Try calling
10464         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10465         the 3-args-version.  Corlib now also needs our `void_type'.
10466         (GetMethod): Added overloaded version which takes an optional
10467         `bool report_errors' to allow lookups of optional methods.
10468
10469 2003-05-12  Martin Baulig  <martin@ximian.com>
10470
10471         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10472         only used for locals and not for parameters.
10473
10474 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * support.cs (InternalParameters.ParameterType): Return the
10477         ExternalType of the parameter.
10478
10479         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10480         they were unused.
10481
10482 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10483
10484         * class.cs (MethodData.Define): Do not set the `newslot' on
10485         interface members, if they are also flagged as "override".
10486
10487         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10488         better code for ++i and i++.  This only works for static fields
10489         and local variables.
10490
10491         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10492         want to pull the DeclSpace out of the builder_to_declspace instead
10493         of the TypeBuilder (like in TypeContainer.FindMembers).
10494
10495         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10496         instead of LookupTypeContainer.  Fixes the crash on .NET for
10497         looking up interface members.
10498
10499         * const.cs: Create our own emit context during the Definition
10500         stage, so that constants are evaluated in the proper context, when
10501         a recursive definition happens.
10502
10503 2003-05-11  Martin Baulig  <martin@ximian.com>
10504
10505         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10506         new block for a switch section.
10507         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10508         the adding/lookup in the switch block.  Fixes #39828.
10509
10510 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10513         functionality: I needed to convert the data after I had performed
10514         the add/sub operation into the operands type size.
10515
10516         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10517         pass the type for the box operation, otherwise the resulting
10518         object would have been of type object.
10519
10520         (BoxedCast): Add constructor to specify the type to box as.
10521
10522 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * iterators.cs: I was reusing the `count' variable inadvertently,
10525         take steps to not allow this to happen.
10526
10527 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10530         by creating an array at the point where the params starts and
10531         putting all those arguments there, then adjusting the size of the
10532         array.
10533
10534 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * expression.cs (New.AddressOf): Implement interface
10537         IMemoryLocation.  This is used when the `new' operator is used in
10538         the context of an invocation to a method on a value type.
10539
10540         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10541         example. 
10542
10543         * namespace.cs: Also check the using aliases here.
10544
10545         * driver.cs: Move the test for using validity after the types have
10546         been entered, so we do a single pass that also includes the using
10547         aliases. 
10548
10549         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10550         in the regular case.   CreateSiblingForFinally is doing extra
10551         error checking.
10552
10553         * attribute.cs (GetAttributeArgumentExpression): Store the result
10554         on an out value, and use the return value to indicate failure
10555         instead of using null (which is a valid return for Constant.GetValue).
10556
10557         * statement.cs: Perform the analysis flow for the increment
10558         portion after the statement, because this will be the real flow of
10559         execution.  Fixes #42385
10560
10561         * codegen.cs (EmitContext.EmitArgument,
10562         EmitContext.EmitStoreArgument): New helper functions when the
10563         RemapToProxy flag is set.
10564
10565         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10566         function.
10567
10568         Add support for remapping parameters. 
10569
10570         * iterators.cs: Propagate parameter values;  Store parameter
10571         values in the proxy classes.
10572
10573 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10574
10575         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10576         need a proxy reference;  I do not know what I was thinking
10577
10578         * cs-parser.jay (constructor_initializer): catch another error,
10579         and display nice message.
10580
10581         (field_declaration): catch void field declaration
10582         to flag a better error. 
10583
10584         * class.cs (MemberBase.CheckBase): Report an error instead of a
10585         warning if a new protected member is declared in a struct. 
10586         (Field.Define): catch the error of readonly/volatile.
10587
10588         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10589
10590         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10591         volatile variable is taken
10592
10593 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10594
10595         * statement.cs (Fixed.Resolve): Report an error if we are not in
10596         an unsafe context.
10597
10598 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10599
10600         * typemanager.cs: reuse the code that handles type clashes for
10601         delegates and enumerations.
10602
10603         * class.cs (Report28): Always report.
10604
10605         * expression.cs (EncodeAsAttribute): Allow nulls here.
10606
10607 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10608
10609         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10610         the functionality for testing whether an expression is valid for
10611         an attribute here.  Also handle the case of arrays of elements
10612         being stored. 
10613
10614         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10615         encoding a linear array into an array of objects that are suitable
10616         to be passed to an CustomAttributeBuilder.
10617
10618         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10619
10620         * ecore.cs: (FieldExpr): Handle field remapping here.
10621
10622         * iteratators.cs: Pass the instance variable (if the method is an
10623         instance method) to the constructors, so we can access the field
10624         variables on the class.
10625
10626         TODO: Test this with structs.  I think the THIS variable on
10627         structs might have to be a pointer, and not a refenrece
10628
10629 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10630
10631         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10632         local variables to fields in a proxy class.
10633
10634         * iterators.cs (PopulateProxy): Rename our internal fields to
10635         <XXX>.  
10636         Create a <THIS> field if we are an instance method, so we can
10637         reference our parent container variables.
10638         (MapVariable): Called back from the EmitContext code to enter a
10639         new variable to field mapping into the proxy class (we just create
10640         a FieldBuilder).
10641
10642         * expression.cs
10643         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10644         for using the remapped locals to fields.
10645
10646         I placed the code here, because that gives the same semantics to
10647         local variables, and only changes the Emit code.
10648
10649         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10650         statements inside iterators.
10651         (VariableInfo): Add a FieldBuilder for the cases when we are
10652         remapping local variables to fields in a proxy class
10653
10654         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10655         current_block != null.
10656
10657         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10658         not cope with strings, as it has been moved to the
10659         TableSwitchEmit.  Fixed bug in switch generation.
10660
10661         * expression.cs (New.DoResolve): Provide more context for the user
10662         when reporting an error.
10663
10664         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10665         pointers. 
10666
10667         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10668         check the permissions for it.  Note than in a type-resolution
10669         context the check was already present in DeclSpace.ResolveType,
10670         but was missing from the MemberAccess.
10671
10672         (ArrayCreation.CheckIndices): warn if the user has
10673         more nested levels of expressions, but there are no more
10674         dimensions specified.  Avoids crash on bug 41906.
10675
10676 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10677
10678         * statement.cs (Block): replace Implicit bool, for a generic
10679         flags.   
10680         New flag: `Unchecked'.  This is used during the EmitMeta phase
10681         (which is out-of-line with the regular Resolve/Emit process for a
10682         statement, as this is done ahead of time, but still gets a chance
10683         to call constant resolve).
10684
10685         (Block.Flags): new enum for adding a new flag.
10686
10687         (Block.EmitMeta): track the state of unchecked.
10688
10689         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10690         to enable constant resolution to work there as well.
10691
10692 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10693
10694         * typemanager.cs (ienumerable_type): Also look up
10695         System.Collections.IEnumerable. 
10696
10697 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10698
10699         TODO: Test more than one conditional per method.
10700
10701         * class.cs (Indexer.Define): Report the location where the user is
10702         referencing the unsupported feature.
10703
10704         (MethodData): Overload the use of `conditionals' to
10705         minimize the creation of needless ArrayLists.   This saves roughly
10706         212kb on my machine.
10707
10708         (Method): Implement the new IIteratorContainer interface.
10709         (Method.SetYields): Implement the method by setting the ModFlags
10710         to contain METHOD_YIELDS.
10711
10712         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10713         which just got set to null.
10714
10715         * iterators.cs: New file.
10716
10717         (Yield, YieldBreak): New statements.
10718
10719         * statement.cs (Return.Resolve): Flag an error if we are used in
10720         an iterator method.
10721
10722         * codegen.cs (InIterator): New flag set if the code is being
10723         compiled in an iterator method.
10724
10725         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10726         internal modifier, and we just use it to avoid adding extra
10727         fields, as this is seldom used.  
10728
10729         * cs-parser.jay: Add yield_statement (yield and yield break).
10730
10731         * driver.cs: New flag -v2 to turn on version 2 features. 
10732
10733         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10734         hashtable when v2 is enabled.
10735
10736 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10737
10738         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10739         there is already a namespace defined with this name.
10740
10741         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10742         people upgraded their corlibs.
10743
10744         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10745         always use fully qualified types, no need to use the compiler
10746         front end.
10747
10748         (TypeManager.IsNamespace): Use binarysearch.
10749
10750         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10751         AddDelegate): I did not quite use the new IsValid API properly: I
10752         have to pass the short-name and the fullname.  I was passing only
10753         the basename instead of the fullname sometimes. 
10754
10755         (TypeContainer.DefineType): call NamespaceClash.
10756
10757         * interface.cs (Interface.DefineType): use NamespaceClash before
10758         defining the type.
10759
10760         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10761         defining the type.
10762
10763         * enum.cs: (Enum.DefineType): use NamespaceClash before
10764         defining the type.
10765
10766         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10767         speed increase.  First, use the negative_hits cache when we get a
10768         negative.  Second, add the type with its full original name
10769         instead of the new . and + encoded name (reflection uses + to
10770         separate type from a nested type).  Use LookupTypeReflection
10771         directly which bypasses the type->name hashtable (that we already
10772         know does not contain the type.
10773
10774         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10775         location/container type. 
10776
10777         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10778
10779 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10782
10783         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10784         method is being referenced in the method group from a static
10785         context, and report error 120 if so.
10786
10787         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10788         Error118. 
10789
10790         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10791         is created, we create the A namespace).
10792
10793         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10794         Fixes #41591
10795
10796 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10799         invocation to ModuleBuilder.GetType with the same values will
10800         return a new type instance, so we need to cache its return
10801         values. 
10802
10803         * expression.cs (Binary.ResolveOperator): Only allow the compare
10804         operators on enums if they are of the same type.
10805
10806         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10807         types of ValueType on their own case.  Before we were giving them
10808         the same treatment as objects.
10809
10810         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10811         fullname.  Short name is used to compare against container name.
10812         Fullname is used to check against defined namespace names.
10813
10814         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10815         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10816
10817         (Method.CheckBase): Call parent.
10818         (MemberBase.CheckBase): Check for protected members on sealed
10819         classes.
10820         (PropertyBase.CheckBase): Call parent.
10821         (Field.Define): Call parent.
10822
10823         * report.cs: Negative error codes are now mapped to 8000 - code,
10824         so that the display is render more nicely.
10825
10826         * typemanager.cs: Do not use try/catch, instead report a regular
10827         error. 
10828
10829         (GetPointerType, GetReferenceType): These methods provide
10830         mechanisms to obtain the T* and T& from a T.  We had the code
10831         previously scattered around the code base, and it also used
10832         TypeManager.LookupType that would go through plenty of caches.
10833         This one goes directly to the type source.
10834
10835         In some places we did the Type.GetType followed by
10836         ModuleBuilder.GetType, but not in others, so this unifies the
10837         processing as well.
10838
10839         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10840         statements now that we have namespace information.
10841
10842         * typemanager.cs (IsNamespace): New method, returns whether the
10843         string presented is a namespace or not.
10844
10845         (ComputeNamespaces): New public entry point, computes the list of
10846         available namespaces, using the GetNamespaces API call in Mono, or
10847         the slower version in MS.NET.   
10848
10849         Now before we start the semantic analysis phase, we have a
10850         complete list of namespaces including everything that the user has
10851         provided.
10852
10853         Deleted old code to cache namespaces in .nsc files.
10854
10855 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10858         class/struct location definition Location for the implicit
10859         constructor location.
10860
10861         (Operator.Define): Use the location of the operator for the
10862         implicit Method definition.
10863
10864         (Constructor.Emit): use the constructor location for the implicit
10865         base initializer constructor.
10866
10867         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10868         and the Expression class now contains two new methods:
10869
10870         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10871         isolate type lookup from the rest of the resolution process.
10872
10873         Since we use Expressions to hold type definitions due to the way
10874         we parse the input we have historically overloaded Resolve to
10875         perform the Type lookups if a special flag is passed.  Now this is
10876         eliminated and two methods take their place. 
10877
10878         The differences in the two methods between xStep and xTerminal is
10879         that xStep is involved in our current lookup system that uses
10880         SimpleNames to compose a name, while xTerminal is used just to
10881         catch the case where the simplename lookup failed.
10882
10883 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * expression.cs (ResolveMemberAccess): Remove redundant code.
10886         TypeExpr expressions are always born fully resolved.
10887
10888         * interface.cs (PopulateMethod): Do not lookup the types twice.
10889         We were doing it once during SemanticAnalysis and once during
10890         PopulateMethod.
10891
10892         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10893         in local variable type definitions, were being returned as a
10894         SimpleName (we decomposed everything into a string), that is
10895         because primary_expression was being used instead of a type in the
10896         grammar (reduce/reduce conflicts).
10897
10898         The part that was wrong is that we converted the expression into a
10899         string (an oversimplification in one hand, compounded with primary
10900         expressions doing string concatenation).
10901
10902         So things like:
10903
10904         A.B.C [] x;
10905
10906         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10907         using clauses from working on this particular context.  And a type
10908         was being matched directly against "A.B.C[]".
10909
10910         We now use the correct approach, and allow for ComposedCast to be
10911         part of the unary expression.  So the "A.B.C []" become a composed
10912         cast of "A.B.C" (as a nested group of MemberAccess with a
10913         SimpleName at the end) plus the rank composition "[]". 
10914
10915         Also fixes 35567
10916
10917 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10918
10919         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10920         for the access level checking.
10921
10922         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10923         `TypeContainer container', because I kept getting confused when I
10924         was debugging this code.
10925
10926         * expression.cs (Indexers): Instead of tracking getters/setters,
10927         we now track them in parallel.  We create one arraylist less, but
10928         most importantly it is possible now for the LValue code to find a
10929         matching get for a set.
10930
10931         (IndexerAccess.DoResolveLValue): Update the code.
10932         GetIndexersForType has been modified already to extract all the
10933         indexers from a type.  The code assumed it did not.
10934
10935         Also make the code set the correct return type for the indexer.
10936         This was fixed a long time ago for properties, but was missing for
10937         indexers.  It used to be void_type.
10938
10939         (Binary.Emit): Test first for doubles instead of
10940         floats, as they are more common.
10941
10942         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10943         when dealing with floats and the <=, >= operators.  This fixes bug
10944         #39314 
10945
10946         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10947         to load the array value by emitting a load on the foreach variable
10948         type.  This was incorrect.  
10949
10950         We now emit the code to load an element using the the array
10951         variable type, and then we emit the conversion operator.
10952
10953         Fixed #40176
10954
10955 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10956
10957         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10958
10959 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10960
10961         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10962         test for protection before we test for signatures. 
10963
10964         (MethodSignature.ToString): implement.
10965
10966         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10967         to the case where we reduced into a LongConstant.
10968
10969         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10970         depend on whether the information is acurrate, because the
10971         Microsoft runtime will always claim that the array type is public,
10972         regardless of the real state.
10973
10974         If the type is a pointer, another problem happens: the type is
10975         reported as non-public in Microsoft.  
10976
10977         In both cases we have to call CheckAccessLevel recursively with
10978         the underlying type as the argument to be tested.
10979
10980 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10981
10982         * assign.cs (Assign.Emit): If we are dealing with a compound
10983         assignment expression, we should use the code path that stores the
10984         intermediate result in a temporary value.  This fixes #40903.
10985
10986         *expression.cs (Indirection.ToString): Provide ToString method for
10987         debugging. 
10988
10989 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10990
10991         * class.cs: Null out fields holding references to Block objects so
10992         they can be garbage collected.
10993
10994         * expression.cs (OverloadResolve): Remove unused local.
10995
10996 2003-04-07  Martin Baulig  <martin@ximian.com>
10997
10998         * codegen.cs (EmitContext.CurrentFile): New public field.
10999         (EmitContext.Mark): Use the CurrentFile to check whether the
11000         location is in the correct file.
11001         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11002
11003 2003-04-07  Martin Baulig  <martin@ximian.com>
11004
11005         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11006
11007         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11008         location.  [FIXME: The location argument which gets passed to this
11009         method is sometimes wrong!]
11010
11011 2003-04-07  Nick Drochak <ndrochak@gol.com>
11012
11013         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11014
11015 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11016
11017         * expression.cs (Indirection.EmitAssign): We were using the
11018         temporary, but returning immediately instead of continuing the
11019         EmitAssing flow.
11020
11021 2003-04-06  Martin Baulig  <martin@ximian.com>
11022
11023         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11024         if it's a nested child, but also deriving from the outer class.
11025         See test 190.cs.
11026
11027         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11028         nested child, but also deriving from the outer class.  See
11029         test-190.cs.
11030         (FilterWithClosure): We may access private members of the outer
11031         class if we're a nested child and deriving from the outer class.
11032         (RealMemberLookup): Only set `closure_private_ok' if the
11033         `original_bf' contained BindingFlags.NonPublic.
11034
11035 2003-04-05  Martin Baulig  <martin@ximian.com>
11036
11037         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
11038
11039 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11040
11041         * class.cs (Event.Define): Do not allow abstract events to have
11042         initializers. 
11043
11044 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11047         block in event declarations.
11048
11049         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11050         value type, get its address.
11051
11052         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11053         leaving a class on the stack instead of a boolean value (int
11054         0/1).  Change the code so we compare against null, and then the
11055         result against zero.
11056
11057         * class.cs (TypeContainer.GetClassBases): We were checking for the
11058         parent class being sealed too late.
11059
11060         * expression.cs (Binary.Emit): For <= and >= when dealing with
11061         floating point values, use cgt.un and clt.un instead of cgt and
11062         clt alone.
11063
11064 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11065
11066         * statement.cs: Apply the same optimization as MS: skip the 
11067         GetEnumerator returning an IEnumerator, and use the one returning a 
11068         CharEnumerator instead. This allows us to avoid the try-finally block 
11069         and the boxing.
11070
11071 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11072
11073         * cs-parser.jay: Attributes cannot be applied to
11074                          namespaces. Fixes #40473
11075
11076 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11077
11078         * class.cs:
11079         (Add*): check if the name is valid using the full name for constants,
11080         fields, properties and events.
11081
11082 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11083
11084         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11085         char constants to be part of the enumeration.
11086
11087         * expression.cs (Conditional.DoResolve): Add support for operator
11088         true. Implements the missing functionality from 14.12
11089
11090         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11091         operator true/false as required by the spec.
11092
11093         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11094         implicit conversion to boolean.
11095
11096         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11097         also one where the type implements `operator true'. 
11098
11099         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11100         get an expression that will invoke operator true based on an
11101         expression.  
11102
11103         (GetConversionOperators): Removed the hack that called op_True
11104         here.  
11105
11106         (Expression.ResolveBoolean): Move this from Statement.
11107
11108 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11109
11110         * ecore.cs (FieldExpr): do not allow initialization of initonly
11111         fields on derived classes
11112
11113 2003-03-13  Martin Baulig  <martin@ximian.com>
11114
11115         * statement.cs (Block.Emit): Call ig.BeginScope() and
11116         ig.EndScope() when compiling with debugging info; call
11117         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11118
11119 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11120
11121         * expression.cs (Indexers): Do not construct immediately, allow
11122         for new members to be appended as we go.  Fixes 38143
11123
11124 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11125
11126         * expression.cs: save/restore context when resolving an unchecked
11127         expression.
11128
11129 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11130
11131         * cfold.cs: Catch division by zero in modulus operator during
11132         constant folding.
11133
11134 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11135
11136         * interface.cs (Interface.DefineMembers): Avoid defining members
11137         twice. 
11138
11139 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11140
11141         * driver.cs: handle the +/- options for -noconfig
11142
11143         * statement.cs (Unckeched.Resolve): Also track the state of
11144         unchecked in the Resolve phase.
11145
11146 2003-02-27  Martin Baulig  <martin@ximian.com>
11147
11148         * ecore.cs (Expression.MemberLookup): Don't create a
11149         MethodGroupExpr for something which is not a method.  Fixes #38291.
11150
11151 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11152
11153         * class.cs (MemberBase.CheckParameters): Also check that the type
11154         is unmanaged if it is a pointer.
11155
11156         * expression.cs (SizeOf.Resolve): Add location information.
11157
11158         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11159         a managed type is declared.
11160
11161         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11162         parameter modifiers as well.  Fixes bug 38606
11163
11164         * class.cs: Very sad.  Am backing out the speed up changes
11165         introduced by the ArrayList -> Array in the TypeContainer, as they
11166         were not actually that much faster, and introduced a bug (no error
11167         reports on duplicated methods).
11168
11169         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11170         source first, this will guarantee that we have a valid expression
11171         before calling in lower levels functions that will require a
11172         resolved object.  Then use this original_source in the
11173         target.ResolveLValue instead of the original source that was
11174         passed to us.
11175
11176         Another change.  Use target.Resolve instead of LValueResolve.
11177         Although we are resolving for LValues, we will let the Assign code
11178         take care of that (it will be called again from Resolve).  This
11179         basically allows code like this:
11180
11181         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11182         class Y { void A (X x) { x [0] += o; }
11183
11184         The problem was that the indexer was trying to resolve for
11185         set_Item (idx, object o) and never finding one.  The real set_Item
11186         was set_Item (idx, X).  By delaying the process we get the right
11187         semantics. 
11188
11189         Fixes bug 36505
11190
11191 2003-02-23  Martin Baulig  <martin@ximian.com>
11192
11193         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11194         while calling DoEmit ().
11195
11196         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11197         source files; if you use the #line directive inside a method, the
11198         compiler stops emitting line numbers for the debugger until it
11199         reaches the end of the method or another #line directive which
11200         restores the original file.
11201
11202 2003-02-23  Martin Baulig  <martin@ximian.com>
11203
11204         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11205
11206 2003-02-23  Martin Baulig  <martin@ximian.com>
11207
11208         * statement.cs (Block.AddChildVariableNames): We need to call this
11209         recursively, not just for our immediate children.
11210
11211 2003-02-23  Martin Baulig  <martin@ximian.com>
11212
11213         * class.cs (Event.Define): Always make the field private, like csc does.
11214
11215         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11216         actually work, fixes bug #37521.
11217
11218 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11219
11220         * delegate.cs: When creating the various temporary "Parameters"
11221         classes, make sure that we call the ComputeAndDefineParameterTypes
11222         on those new parameters (just like we do with the formal ones), to
11223         allow them to be resolved in the context of the DeclSpace.
11224
11225         This fixes the bug that Dick observed in Bugzilla #38530.
11226
11227 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * expression.cs (ResolveMemberAccess): When resolving a constant,
11230         do not attempt to pull a constant if the value was not able to
11231         generate a valid constant.
11232
11233         * const.cs (LookupConstantValue): Do not report more errors than required.
11234
11235 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11236
11237         * expression.cs: fixes bug #38328.
11238
11239 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * class.cs: Changed all the various members that can be part of a
11242         class from being an ArrayList to be an Array of the right type.
11243         During the DefineType type_list, interface_list, delegate_list and
11244         enum_list are turned into types, interfaces, delegates and enums
11245         arrays.  
11246
11247         And during the member population, indexer_list, event_list,
11248         constant_list, field_list, instance_constructor_list, method_list,
11249         operator_list and property_list are turned into their real arrays.
11250
11251         Although we could probably perform this operation earlier, for
11252         good error reporting we need to keep the lists and remove the
11253         lists for longer than required.
11254
11255         This optimization was triggered by Paolo profiling the compiler
11256         speed on the output of `gen-sample-program.pl' perl script. 
11257
11258         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11259         not crash in methods like MemberLookupFailed that use this field.  
11260
11261         This problem arises when the compiler fails to resolve a type
11262         during interface type definition for example.
11263
11264 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11267         inherit from System.Object, so we have to stop at null, not only
11268         when reaching System.Object.
11269
11270 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11271
11272         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11273         DeclaredOnly because the parent indexer might have had a different
11274         name, but did not loop until the top of the hierarchy was reached.
11275
11276         The problem this one fixes is 35492: when a class implemented an
11277         indexer from an interface, we were getting the interface method
11278         (which was abstract) and we were flagging an error (can not invoke
11279         abstract method).
11280
11281         This also keeps bug 33089 functioning, and test-148 functioning.
11282
11283         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11284         out if a method is special is to see if it is declared in a
11285         property or event, or whether it is one of the predefined operator
11286         names.   This should fix correctly #36804.
11287
11288 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11289
11290         The goal here is to remove the dependency on EmptyCast.Peel ().
11291         Killing it completely.
11292
11293         The problem is that currently in a number of places where
11294         constants are expected, we have to "probe" for an EmptyCast, and
11295         Peel, which is not the correct thing to do, as this will be
11296         repetitive and will likely lead to errors. 
11297
11298         The idea is to remove any EmptyCasts that are used in casts that
11299         can be reduced to constants, so we only have to cope with
11300         constants. 
11301
11302         This bug hunt was triggered by Bug 37363 and the desire to remove
11303         the duplicate pattern where we were "peeling" emptycasts to check
11304         whether they were constants.  Now constants will always be
11305         constants.
11306
11307         * ecore.cs: Use an enumconstant here instead of wrapping with
11308         EmptyCast.  
11309
11310         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11311         throwing me off.  By handling this we can get rid of a few hacks.
11312
11313         * statement.cs (Switch): Removed Peel() code.
11314
11315 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11316
11317         * class.cs: Location information for error 508
11318
11319         * expression.cs (New.DoResolve): Add a guard against double
11320         resolution of an expression.  
11321
11322         The New DoResolve might be called twice when initializing field
11323         expressions (see EmitFieldInitializers, the call to
11324         GetInitializerExpression will perform a resolve on the expression,
11325         and later the assign will trigger another resolution
11326
11327         This leads to bugs (#37014)
11328
11329         * delegate.cs: The signature for EndInvoke should contain any ref
11330         or out parameters as well.  We were not doing this in the past. 
11331
11332         * class.cs (Field.Define): Do not overwrite the type definition
11333         inside the `volatile' group.  Turns out that volatile enumerations
11334         were changing the type here to perform a validity test, which
11335         broke conversions. 
11336
11337 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11338
11339         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11340         and structs, we do not want to load the instance variable
11341
11342         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11343         enum_type has to be handled like an object reference (implicit
11344         conversions exists from this to object), but the regular IsClass
11345         and IsValueType tests will never return true for this one.
11346
11347         Also we use TypeManager.IsValueType instead of type.IsValueType,
11348         just for consistency with the rest of the code (this is only
11349         needed if we ever use the construct exposed by test-180.cs inside
11350         corlib, which we dont today).
11351
11352 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11353
11354         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11355         just InternalCall.
11356
11357 2003-02-09  Martin Baulig  <martin@ximian.com>
11358
11359         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11360         (Namespace.DefineNamespaces): New static public method; this is
11361         called when we're compiling with debugging to add all namespaces
11362         to the symbol file.
11363
11364         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11365         pass it to the Namespace's .ctor.
11366
11367         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11368         and MethodBase arguments; pass the namespace ID to the symwriter;
11369         pass the MethodBase instead of the token to the symwriter.
11370         (SymbolWriter.DefineNamespace): New method to add a namespace to
11371         the symbol file.
11372
11373 2003-02-09  Martin Baulig  <martin@ximian.com>
11374
11375         * symbolwriter.cs: New file.  This is a wrapper around
11376         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11377         methods here in near future.
11378
11379 2003-02-09  Martin Baulig  <martin@ximian.com>
11380
11381         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11382         ILGenerator.MarkSequencePoint() which are actually used by the
11383         symbol writer.
11384
11385 2003-02-09  Martin Baulig  <martin@ximian.com>
11386
11387         * location.cs (SourceFile): New public sealed class.  This
11388         contains the name and an index which is used in the location's token.
11389         (Location): Reserve an appropriate number of bits in the token for
11390         the source file instead of walking over that list, this gives us a
11391         really huge performance improvement when compiling with debugging.
11392
11393         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11394         `SourceFile' argument instead of a string.
11395         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11396         but don't parse/tokenize here, we need to generate the list of all
11397         source files before we do that.
11398         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11399         the files.
11400
11401         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11402         instead of a string.
11403
11404         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11405         of a string.
11406
11407 2003-02-09  Martin Baulig  <martin@ximian.com>
11408
11409         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11410         filename on `#line default'.
11411
11412 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11413
11414         * statement.cs: don't clear the pinned var when the fixed statement
11415         returns from the method (fixes bug#37752).
11416
11417 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11418
11419         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11420         to IsValueType.
11421
11422 2003-02-07  Martin Baulig  <martin@ximian.com>
11423
11424         * driver.cs: Removed the `--debug-args' command line argument.
11425
11426         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11427         automatically by the AsssemblyBuilder.
11428         (CodeGen.InitializeSymbolWriter): We don't need to call any
11429         initialization function on the symbol writer anymore.  This method
11430         doesn't take any arguments.
11431
11432 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11433
11434         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11435         from referenced assemblies as well.
11436
11437 2003-02-02  Martin Baulig  <martin@ximian.com>
11438
11439         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11440
11441 2003-02-02  Martin Baulig  <martin@ximian.com>
11442
11443         * class.cs (Constructor.Emit): Open the symbol writer before
11444         emitting the constructor initializer.
11445         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11446         single-stepping through constructor initializers.
11447
11448 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11449
11450         * class.cs: Handle error 549: do not allow virtual methods in
11451         sealed classes. 
11452
11453 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11454
11455         * decl.cs: Check access levels when resolving types
11456
11457 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11458
11459         * statement.cs: Add parameters and locals set in catch blocks that might 
11460         return to set vector
11461
11462 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11463
11464         * class.cs (Operator): Set the SpecialName flags for operators.
11465
11466         * expression.cs (Invocation.DoResolve): Only block calls to
11467         accessors and operators on SpecialName methods.
11468
11469         (Cast.TryReduce): Handle conversions from char constants.
11470
11471
11472 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11473
11474         * statement.cs: small memory and time optimization in FlowBranching.
11475
11476 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11477
11478         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11479         problem that the last fix but in the other sid (Set).
11480
11481         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11482         access when there is no indexer in the hierarchy.
11483
11484 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11485
11486         * class.cs: Combine some if statements.
11487
11488 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11489
11490         * driver.cs: fixed bug #37187.
11491
11492 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11493
11494         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11495         any indexer, it's needed to build a list with all the indexers in the
11496         hierarchy (AllGetters), else we have problems. Fixes #35653.
11497
11498 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11499
11500         * class.cs (MethodData.Define): It is wrong for an interface
11501         implementation to be static in both cases: explicit and implicit.
11502         We were only handling this in one case.
11503
11504         Improve the if situation there to not have negations.
11505
11506         * class.cs (Field.Define): Turns out that we do not need to check
11507         the unsafe bit on field definition, only on usage.  Remove the test.
11508
11509 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11510
11511         * driver.cs: use assembly.Location instead of Codebase (the latest
11512         patch made mcs fail when using MS assemblies).
11513
11514 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11515
11516         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11517         get the path to *corlib.dll.
11518
11519 2003-01-21  Nick Drochak <ndrochak@gol.com>
11520
11521         * cs-tokenizer.cs:
11522         * pending.cs:
11523         * typemanager.cs: Remove compiler warnings
11524
11525 2003-01-20  Duncan Mak  <duncan@ximian.com>
11526
11527         * AssemblyInfo.cs: Bump the version number to 0.19.
11528
11529 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11530
11531         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11532
11533 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11534
11535         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11536
11537 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11538
11539         * cs-parser.jay: Small fix: we were not comparing the constructor
11540         name correctly.   Thanks to Zoltan for the initial pointer.
11541
11542 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11543
11544         * cs-tokenizer.cs: Set file name when specified with #line
11545
11546 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11547
11548         * cs-parser.jay: Only perform the constructor checks here if we
11549         are named like the class;  This will help provider a better
11550         error.  The constructor path is taken when a type definition is
11551         not found, but most likely the user forgot to add the type, so
11552         report that rather than the constructor error.
11553
11554 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11555
11556         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11557         allocations.
11558
11559 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11560
11561         * cs-parser.jay: Add cleanup call.
11562
11563 2003-01-13  Duncan Mak  <duncan@ximian.com>
11564
11565         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11566         consistent with other methods.
11567
11568 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11569
11570         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11571
11572 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11573
11574         * attribute.cs: only set GuidAttr to true when we have a
11575         GuidAttribute.
11576
11577 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11578
11579         * ecore.cs:
11580         * expression.cs:
11581         * typemanager.cs: fixes to allow mcs compile corlib with the new
11582         Type.IsSubclassOf fix.
11583
11584 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11585
11586         * expression.cs (LocalVariableReference.DoResolve): Classify a
11587         constant as a value, not as a variable.   Also, set the type for
11588         the variable.
11589
11590         * cs-parser.jay (fixed_statement): take a type instead of a
11591         pointer_type, so we can produce a better error message later.
11592
11593         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11594         as an error.  
11595
11596         (For.DoEmit): Make inifinite loops have a
11597         non-conditional branch back.
11598
11599         (Fixed.DoEmit): First populate the pinned variables, then emit the
11600         statement, then clear the variables.  Before I was emitting the
11601         code once for each fixed piece.
11602
11603
11604 2003-01-08  Martin Baulig  <martin@ximian.com>
11605
11606         * statement.cs (FlowBranching.MergeChild): A break in a
11607         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11608
11609 2003-01-08  Martin Baulig  <martin@ximian.com>
11610
11611         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11612         lives in the same number space than `param_map'.  Fixes #36154.
11613
11614 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11615
11616         * cs-parser.jay (constructor_declaration): Set the
11617         Constructor.ModFlags before probing for it.  This makes the
11618         compiler report 514, 515 and 132 (the code was there, but got
11619         broken). 
11620
11621         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11622         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11623         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11624
11625 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11626
11627         * enum.cs: create the enum static fields using the enum type.
11628
11629 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11630
11631         * class.cs: don't try to create the ParamBuilder for the return
11632         type if it's not needed (and handle it breaking for the ms runtime
11633         anyway).
11634
11635 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11636
11637         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11638
11639 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11640
11641         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11642         the command.   This showed up while compiling the JANET source
11643         code, which used \r as its only newline separator.
11644
11645 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11646
11647         * class.cs (Method.Define): If we are an operator (because it
11648         reuses our code), then set the SpecialName and HideBySig.  #36128
11649
11650 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11651
11652         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11653         exception, report error 120 `object reference required'.
11654
11655         * driver.cs: Add --pause option, used during to measure the size
11656         of the process as it goes with --timestamp.
11657
11658         * expression.cs (Invocation.DoResolve): Do not allow methods with
11659         SpecialName to be invoked.
11660
11661 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11662
11663         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11664         number before adding it.
11665
11666 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11667
11668         * ecore.cs (StandardImplicitConversion): When in an unsafe
11669         context, we allow conversion between void * to any other pointer
11670         type. This fixes bug #35973.
11671
11672 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11673
11674         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11675         is not thrown when extensionless outputs are used 
11676
11677 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11678
11679         * rootcontext.cs: fixed compilation of corlib.
11680
11681 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11682
11683         * attribute.cs (Attributes.Contains): Add new method.
11684
11685         * class.cs (MethodCore.LabelParameters): if the parameter is an
11686         `out' parameter, check that no attribute `[In]' has been passed.
11687
11688         * enum.cs: Handle the `value__' name in an enumeration.
11689
11690 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11691
11692         * decl.cs: Added special case to allow overrides on "protected
11693         internal" methods
11694
11695 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11696
11697         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11698         since it makes much more sense.
11699
11700         (Attributes.ctor): Don't require a Location parameter.
11701
11702         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11703
11704         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11705         since we already have that information per attribute.
11706
11707         * everywhere : make appropriate changes.
11708
11709         * class.cs (LabelParameters): Write the code which actually
11710         applies attributes to the return type. We can't do this on the MS
11711         .NET runtime so we flag a warning in the case an exception is
11712         thrown.
11713
11714 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11715
11716         * const.cs: Handle implicit null conversions here too.
11717
11718 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11719
11720         * class.cs (MethodCore.LabelParameters): Remove the extra
11721         Type [] parameter since it is completely unnecessary. Instead
11722         pass in the method's attributes so that we can extract
11723         the "return" attribute.
11724
11725 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11726
11727         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11728         of ignoring it and letting the compile continue.
11729
11730         * typemanager.cs (ChangeType): use an extra argument to return an
11731         error condition instead of throwing an exception.
11732
11733 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11734
11735         * expression.cs (Unary.TryReduce): mimic the code for the regular
11736         code path.  Perform an implicit cast in the cases where we can
11737         implicitly convert to one of the integral types, and then reduce
11738         based on that constant.   This fixes bug #35483.
11739
11740 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11741
11742         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11743
11744 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11745
11746         * namespace.cs: fixed bug #35489.
11747
11748 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * class.cs: Remove some dead code.
11751
11752         * cs-parser.jay: Estimate the number of methods needed
11753         (RootContext.MethodCount);
11754
11755         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11756         numbers instead of StringBuilders.
11757
11758         * support.cs (PtrHashtable): Add constructor with initial size;
11759         We can now reduce reallocations of the method table.
11760
11761 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11762
11763         * attribute.cs (ApplyAttributes): Keep track of the emitted
11764         attributes on a per-target basis. This fixes bug #35413.
11765
11766 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11767
11768         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11769         default to the Windows 1252 encoding.
11770
11771         (UnixParseOption): Support version, thanks to Alp for the missing
11772         pointer. 
11773
11774         * AssemblyInfo.cs: Add nice assembly information.
11775
11776         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11777         (bug 35169).
11778
11779         * cs-parser.jay: Allow a trailing comma before the close bracked
11780         in the attribute_section production.
11781
11782         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11783         address of the instance was being taken, I will take this out,
11784         because we take the address of the object immediately here.
11785
11786 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11787
11788         * typemanager.cs (AreMultipleAllowed): Take care of the most
11789         obvious case where attribute type is not in the current assembly -
11790         stupid me ;-)
11791
11792 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11793
11794         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11795         definitions, instead of doing that afterwards.  
11796
11797         Also we use a nice little hack, depending on the constructor, we
11798         know if we are a "composed" name or a simple name.  Hence, we
11799         avoid the IndexOf test, and we avoid 
11800
11801         * codegen.cs: Add code to assist in a bug reporter to track down
11802         the source of a compiler crash. 
11803
11804 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11805
11806         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11807         types have been emitted for a given element and flag an error
11808         if something which does not have AllowMultiple set is used more
11809         than once.
11810
11811         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11812         attribute types and their corresponding AllowMultiple properties
11813
11814         (AreMultipleAllowed): Check the property for a given type.
11815
11816         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11817         property in the case we have a TypeContainer.
11818
11819         (Attributes.AddAttribute): Detect duplicates and just skip on
11820         adding them. This trivial fix catches a pretty gross error in our
11821         attribute emission - global attributes were being emitted twice!
11822
11823         Bugzilla bug #33187 is now fixed.
11824
11825 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11826
11827         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11828         instead of pp_and).
11829
11830         * expression.cs (Binary.ResolveOperator): I can only use the
11831         Concat (string, string, string) and Concat (string, string,
11832         string, string) if the child is actually a concatenation of
11833         strings. 
11834
11835 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11836
11837         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11838         context where we need a 2-character lookahead.
11839
11840         * pending.cs (PendingImplementation): Rework so we can keep track
11841         of interface types all the time, and flag those which were
11842         implemented by parents as optional.
11843
11844 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11845
11846         * expression.cs (Binary.ResolveOperator): Use
11847         String.Concat(string,string,string) or
11848         String.Concat(string,string,string,string) when possible. 
11849
11850         * typemanager: More helper methods.
11851
11852
11853 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11854
11855         * pending.cs: remove the bogus return from GetMissingInterfaces()
11856         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11857
11858 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11859
11860         * namespace.cs: avoid duplicated 'using xxx' being added to
11861         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11862         when we get more than one 'using' statement for the same namespace.
11863         Report a CS0105 warning for it.
11864
11865 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11866
11867         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11868         of calling getChar/putback, uses internal knowledge of it.    
11869
11870         (xtoken): Reorder tokenizer so most common patterns are checked
11871         first.  This reduces the compilation time in another 5% (from 8.11s
11872         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11873
11874         The parsing time is 22% of the compilation in mcs, and from that
11875         64% is spent on the tokenization process.  
11876
11877         I tried using a binary search for keywords, but this is slower
11878         than the hashtable.  Another option would be to do a couple of
11879         things:
11880
11881                 * Not use a StringBuilder, instead use an array of chars,
11882                   with a set value.  Notice that this way we could catch
11883                   the 645 error without having to do it *afterwards*.
11884
11885                 * We could write a hand-parser to avoid the hashtable
11886                   compares altogether.
11887
11888         The identifier consumption process takes 37% of the tokenization
11889         time.  Another 15% is spent on is_number.  56% of the time spent
11890         on is_number is spent on Int64.Parse:
11891
11892                 * We could probably choose based on the string length to
11893                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11894                   computations. 
11895
11896         Another 3% is spend on wrapping `xtoken' in the `token' function.
11897
11898         Handle 0xa0 as whitespace (#34752)
11899
11900 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11901
11902         * typemanager.cs (IsCLRType): New routine to tell whether a type
11903         is one of the builtin types.  
11904
11905         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11906         typecode in more places instead of doing pointer comparissions.
11907         We could leverage some knowledge about the way the typecodes are
11908         laid out.
11909
11910         New code to cache namespaces in assemblies, it is currently not
11911         invoked, to be used soon.
11912
11913         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11914
11915         * expression.cs (Binary.ResolveOperator): specially handle
11916         strings, and do not perform user-defined operator overloading for
11917         built-in types.
11918
11919 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11920
11921         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11922         internalcall as it is a pretty simple operation;  Avoid whenever
11923         possible to call Char.IsLetter.
11924
11925         (consume_identifier): Cut by half the number of
11926         hashtable calls by merging the is_keyword and GetKeyword behavior.
11927
11928         Do not short-circuit, because if we do, we
11929         report errors (ie, #if false && true would produce an invalid
11930         directive error);
11931
11932
11933 2002-11-24  Martin Baulig  <martin@ximian.com>
11934
11935         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11936         check constant ranges and report a CS0221.  Fixes #33186.
11937
11938 2002-11-24  Martin Baulig  <martin@ximian.com>
11939
11940         * cs-parser.jay: Make this work for uninitialized variable
11941         declarations in the `for' initializer.  Fixes #32416.
11942
11943 2002-11-24  Martin Baulig  <martin@ximian.com>
11944
11945         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11946         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11947
11948 2002-11-24  Martin Baulig  <martin@ximian.com>
11949
11950         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11951         argument; if true, we also check for user-defined conversions.
11952         This is only needed if both arguments are of a user-defined type.
11953         Fixes #30443, added test-175.cs.
11954         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11955
11956         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11957
11958 2002-11-24  Martin Baulig  <martin@ximian.com>
11959
11960         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11961         function to get the store opcode.
11962         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11963         only emit the Ldelema if the store opcode is Stobj.  You must run
11964         both test-34 and test-167 to test this.  Fixes #34529.
11965
11966 2002-11-23  Martin Baulig  <martin@ximian.com>
11967
11968         * ecore.cs (Expression.MemberLookup): Added additional
11969         `qualifier_type' argument which is used when we're being called
11970         from MemberAccess.DoResolve() and null if we're called from a
11971         SimpleName lookup.
11972         (Expression.MemberLookupFailed): New method to report errors; this
11973         does the CS1540 check and reports the correct error message.
11974
11975         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11976         argument for the CS1540 check and redone the way how we're dealing
11977         with private members.  See the comment in the source code for details.
11978         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11979         `closure_start_type' to `closure_qualifier_type' and check whether
11980         it's not null.  It was not this filter being broken, it was just
11981         being called with the wrong arguments.
11982
11983         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11984         and pass it the correct `qualifier_type'; this also does the error
11985         handling for us.
11986
11987 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11988
11989         * expression.cs (Invocation.EmitParams): If the we are dealing
11990         with a non-built-in value type, load its address as well.
11991
11992         (ArrayCreation): Use a a pretty constant instead
11993         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11994         static initializers.  
11995
11996         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11997         because they are not really value types, just glorified integers. 
11998
11999         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12000
12001         * ecore.cs: Remove redundant code for enumerations, make them use
12002         the same code path as everything else, fixes the casting issue
12003         with enumerations in Windows.Forms.
12004
12005         * attribute.cs: Do only cast to string if it is a string, the
12006         validation happens later.
12007
12008         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12009         people upgrade their corlibs.
12010
12011         * ecore.cs: Oops, enumerations were not following the entire code path
12012
12013 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12014
12015         * typemanager.cs (FilterWithClosure): Commented out the test for
12016         1540 in typemanager.cs, as it has problems when accessing
12017         protected methods from a parent class (see test-174.cs). 
12018
12019         * attribute.cs (Attribute.ValidateGuid): new method.
12020         (Attribute.Resolve): Use above.
12021
12022 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12023
12024         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12025
12026         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12027         handling for enumerations, as we only needed the TypeContainer
12028         functionality to begin with (this is required for the fix below to
12029         work for enums that reference constants in a container class for
12030         example). 
12031
12032         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12033
12034         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12035         a valid TypeBuilder to perform lookups on.o
12036
12037         * class.cs (InheritableMemberSignatureCompare): Use true in the
12038         call to GetGetMethod and GetSetMethod, because we are comparing
12039         the signature, and we need to get the methods *even* if they are
12040         private. 
12041
12042         (PropertyBase.CheckBase): ditto.
12043
12044         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12045         GotoCase.Resolve): Use Peel on EmpytCasts.
12046
12047         * ecore.cs (EmptyCast): drop child, add Peel method.
12048
12049 2002-11-17  Martin Baulig  <martin@ximian.com>
12050
12051         * ecore.cs (EmptyCast.Child): New public property.
12052
12053         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12054         label resolved to an EmptyCast.  Fixes #34162.
12055         (GotoCase.Resolve): Likewise.
12056         (Block.EmitMeta): Likewise.
12057
12058 2002-11-17  Martin Baulig  <martin@ximian.com>
12059
12060         * expression.cs (Invocation.BetterConversion): Prefer int over
12061         uint; short over ushort; long over ulong for integer literals.
12062         Use ImplicitConversionExists instead of StandardConversionExists
12063         since we also need to check for user-defined implicit conversions.
12064         Fixes #34165.  Added test-173.cs.
12065
12066 2002-11-16  Martin Baulig  <martin@ximian.com>
12067
12068         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12069         with the `true' and `false' literals.  Fixes #33151.
12070
12071 2002-11-16  Martin Baulig  <martin@ximian.com>
12072
12073         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12074         October 22nd; don't do the cs1540 check for static members.
12075
12076         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12077         now using our own filter here and doing the cs1540 check again.
12078
12079 2002-11-16  Martin Baulig  <martin@ximian.com>
12080
12081         * support.cs (InternalParameters): Don't crash if we don't have
12082         any fixed parameters.  Fixes #33532.
12083
12084 2002-11-16  Martin Baulig  <martin@ximian.com>
12085
12086         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12087         when looking up static methods to make this work on Windows.
12088         Fixes #33773.
12089
12090 2002-11-16  Martin Baulig  <martin@ximian.com>
12091
12092         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12093         a setter rather than using PropertyInfo.CanWrite.
12094
12095 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12096
12097         * class.cs: Allow acces to block member by subclasses. Fixes build
12098         breaker.
12099
12100 2002-11-14  Martin Baulig  <martin@ximian.com>
12101
12102         * class.cs (Constructor.Emit): Added the extern/block check.
12103         Fixes bug #33678.
12104
12105 2002-11-14  Martin Baulig  <martin@ximian.com>
12106
12107         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12108         iteration while looking for indexers, this is needed because the
12109         indexer may have a different name in our base classes.  Fixed the
12110         error reporting (no indexers at all, not get accessor, no
12111         overloaded match).  Fixes bug #33089.
12112         (IndexerAccess.DoResolveLValue): Likewise.
12113
12114 2002-11-14  Martin Baulig  <martin@ximian.com>
12115
12116         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12117         indexers.  Fixes the first part of bug #33089.
12118         (MethodSignature.InheritableMemberSignatureCompare): Added support
12119         for properties.
12120
12121 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12122
12123         * attribute.cs (Attribute.Resolve): Catch the
12124         NullReferenceException and report it since it isn't supposed to
12125         happen. 
12126
12127 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12128
12129         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12130         LogicalOr and LogicalAnd that can benefit from recursively
12131         handling EmitBranchable.  The code now should be nice for Paolo.
12132
12133 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12134
12135         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12136         the Type lookups, as we perform quite a number of lookups on
12137         non-Types.  This can be removed once we can deterministically tell
12138         whether we have a type or a namespace in advance.
12139
12140         But this might require special hacks from our corlib.
12141
12142         * TODO: updated.
12143
12144         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12145         and double which avoids a conversion from an integer to a double.
12146
12147         * expression.cs: tiny optimization, avoid calling IsConstant,
12148         because it effectively performs the lookup twice.
12149
12150 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12151
12152         But a bogus return here to keep the semantics of the old code
12153         until the Mono runtime is fixed.
12154
12155         * pending.cs (GetMissingInterfaces): New method used to remove all
12156         the interfaces that are already implemented by our parent
12157         classes from the list of pending methods. 
12158
12159         * interface.cs: Add checks for calls after ResolveTypeExpr.
12160
12161 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * class.cs (Class.Emit): Report warning 67: event not used if the
12164         warning level is beyond 3.
12165
12166         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12167         being a NullLiteral.
12168
12169         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12170         specifiers. 
12171
12172         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12173         path that might fail if a type can not be resolved.
12174
12175         * expression.cs (Binary.Emit): Emit unsigned versions of the
12176         operators. 
12177
12178         * driver.cs: use error 5.
12179
12180 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12181
12182         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12183
12184 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12185
12186         * cs-parser.jay (switch_section): A beautiful patch from Martin
12187         Baulig that fixed 33094.
12188
12189 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12190
12191         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12192         Check whether the base is abstract and report an error if so.
12193
12194         * expression.cs (IndexerAccess.DoResolveLValue,
12195         IndexerAccess.DoResolve): ditto. 
12196
12197         (Invocation.DoResolve): ditto.
12198
12199         (Invocation.FullMethodDesc): Improve the report string.
12200
12201         * statement.cs (Block): Eliminate IsVariableDefined as it is
12202         basically just a wrapper for GetVariableInfo.
12203
12204         * ecore.cs (SimpleName): Use new 
12205
12206         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12207         type, as we return the actual parameter ref/unref state on a
12208         different call.
12209
12210 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12211
12212         * support.cs: Return proper flags REF/OUT fixing the previous
12213         commit.  
12214
12215         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12216         not used to mean `ref' but `ref or out' in ParameterReference
12217
12218         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12219         full type signature instead of calling TypeManger.CSharpName
12220         ourselves. 
12221
12222         * support.cs (InternalParameters.ParameterDesc): Do not compare
12223         directly to the modflags, because REF/OUT will actually be bitsets
12224         if set. 
12225
12226         * delegate.cs (VerifyMethod): Check also the modifiers.
12227
12228         * cs-tokenizer.cs: Fix bug where floating point values with an
12229         exponent where a sign was missing was ignored.
12230
12231         * driver.cs: Allow multiple assemblies to be specified in a single
12232         /r: argument
12233
12234 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12237         because identifiers after a parenthesis would end up in this kind
12238         of production, and we needed to desamiguate it for having casts
12239         like:
12240
12241                 (UserDefinedType *) xxx
12242
12243 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12244
12245         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12246         we should set on the Bindingflags.NonPublic, but not turn on
12247         private_ok.  private_ok controls whether a Private member is
12248         returned (this is chekced on the filter routine), while the
12249         BindingFlags.NonPublic just controls whether private/protected
12250         will be allowed.   This fixes the problem part of the problem of
12251         private properties being allowed to be used in derived classes.
12252
12253         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12254         so we can call the children DoResolveLValue method (this will
12255         properly signal errors on lvalue assignments to base properties)
12256
12257         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12258         getter are null, and we have a property info, we know that this
12259         happened because the lookup failed, so we report an error 122 for
12260         protection level violation.
12261
12262         We also silently return if setter and getter are null in the
12263         resolve functions, this condition only happens if we have flagged
12264         the error before.  This is the other half of the problem. 
12265
12266         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12267         not have accessibility information, that is why we were returning
12268         true in the filter function in typemanager.cs.
12269
12270         To properly report 122 (property is inaccessible because of its
12271         protection level) correctly, we report this error in ResolveAccess
12272         by failing if both the setter and the getter are lacking (ie, the
12273         lookup failed). 
12274
12275         DoResolve and DoLResolve have been modified to check for both
12276         setter/getter being null and returning silently, the reason being
12277         that I did not want to put the knowledge about this error in upper
12278         layers, like:
12279
12280         int old = Report.Errors;
12281         x = new PropertyExpr (...);
12282         if (old != Report.Errors)
12283                 return null;
12284         else
12285                 return x;
12286
12287         So the property expr is returned, but it is invalid, so the error
12288         will be flagged during the resolve process. 
12289
12290         * class.cs: Remove InheritablePropertySignatureCompare from the
12291         class, as we no longer depend on the property signature to compute
12292         whether it is possible to implement a method or not.
12293
12294         The reason is that calling PropertyInfo.GetGetMethod will return
12295         null (in .NET, in Mono it works, and we should change this), in
12296         cases where the Get Method does not exist in that particular
12297         class.
12298
12299         So this code:
12300
12301         class X { public virtual int A { get { return 1; } } }
12302         class Y : X { }
12303         class Z : Y { public override int A { get { return 2; } } }
12304
12305         Would fail in Z because the parent (Y) would not have the property
12306         defined.  So we avoid this completely now (because the alternative
12307         fix was ugly and slow), and we now depend exclusively on the
12308         method names.
12309
12310         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12311         reference method, instead of using the property.
12312
12313         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12314         routines are gone now.
12315
12316         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12317         names, they were incorrectly named.
12318
12319         * cs-tokenizer.cs: Return are more gentle token on failure. 
12320
12321         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12322         had an out-of-sync index variable, which caused it to remove from
12323         the list of pending methods the wrong method sometimes.
12324
12325 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12326
12327         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12328         CanWrite, because those refer to this particular instance of the
12329         property, and do not take into account the fact that we can
12330         override single members of a property.
12331
12332         Constructor requires an EmitContext.  The resolution process does
12333         not happen here, but we need to compute the accessors before,
12334         because the resolution does not always happen for properties.
12335
12336         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12337         subclass, before we did not update this flag, but we did update
12338         bindingflags. 
12339
12340         (GetAccessors): Drop this routine, as it did not work in the
12341         presence of partially overwritten set/get methods. 
12342
12343         Notice that this broke the cs1540 detection, but that will require
12344         more thinking. 
12345
12346 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12347
12348         * class.cs:
12349         * codegen.cs:
12350         * driver.cs: issue a warning instead of an error if we don't support
12351         debugging for the platform. Also ignore a couple of errors that may
12352         arise when trying to write the symbols. Undo my previous patch.
12353
12354 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12355
12356         * driver.cs: ignore /debug switch except for Unix platforms.
12357
12358 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12359
12360         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12361
12362 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12363
12364         * driver.cs: Do not make mcs-debug conditional, so we do not break
12365         builds that use it.
12366
12367         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12368         review this patch.  But basically after all the children variables
12369         have been merged, the value of "Breaks" was not being set to
12370         new_breaks for Switch blocks.  I think that it should be set after
12371         it has executed.  Currently I set this to the value of new_breaks,
12372         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12373         conservative, but I do not understand this code very well.
12374
12375         I did not break anything in the build, so that is good ;-)
12376
12377         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12378
12379 2002-10-20  Mark Crichton  <crichton@gimp.org>
12380
12381         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12382
12383 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12384
12385         * cfold.cs: Fixed compile blocker.
12386
12387 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12388
12389         * driver.cs: I was chekcing the key, not the file.
12390
12391 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12392
12393         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12394         message that we were generating - we just need to silently return
12395         a null.
12396
12397 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12398
12399         * class.cs (Event.Define): Change my previous commit, as this
12400         breaks the debugger.  This is a temporary hack, as it seems like
12401         the compiler is generating events incorrectly to begin with.
12402
12403         * expression.cs (Binary.ResolveOperator): Added support for 
12404         "U operator - (E x, E y)"
12405
12406         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12407         y)".
12408
12409         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12410         init-only variables, but this path did not take into account that
12411         there might be also instance readonly variables.  Correct this
12412         problem. 
12413
12414         This fixes bug 32253
12415
12416         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12417         delegates as well.
12418
12419         * driver.cs: Change the extension for modules to `netmodule'
12420
12421         * cs-parser.jay: Improved slightly the location tracking for
12422         the debugger symbols.
12423
12424         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12425         modifiers that were specified instead of the hardcoded value
12426         (FamAndAssem).  This was basically ignoring the static modifier,
12427         and others.  Fixes 32429.
12428
12429         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12430         fixed a bug in the process (32476)
12431
12432         * expression.cs (ArrayAccess.EmitAssign): Patch from
12433         hwang_rob@yahoo.ca that fixes bug 31834.3
12434
12435 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12436
12437         * driver.cs: Make the module extension .netmodule.
12438
12439 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12440
12441         * driver.cs: Report an error if the resource file is not found
12442         instead of crashing.
12443
12444         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12445         false, like Emit does.
12446
12447 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12448
12449         * typemanager.cs: Remove unused private member.  Also reported mcs
12450         bug to report this as a warning like csc.
12451
12452 2002-10-15  Martin Baulig  <martin@gnome.org>
12453
12454         * statement.cs (Statement.Emit): Made this a virtual method; emits
12455         the line number info and calls DoEmit().
12456         (Statement.DoEmit): New protected abstract method, formerly knows
12457         as Statement.Emit().
12458
12459         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12460
12461 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12462
12463         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12464         have fixed a remaining problem: not every AddXXXX was adding a
12465         fully qualified name.  
12466
12467         Now everyone registers a fully qualified name in the DeclSpace as
12468         being defined instead of the partial name.  
12469
12470         Downsides: we are slower than we need to be due to the excess
12471         copies and the names being registered this way.  
12472
12473         The reason for this is that we currently depend (on the corlib
12474         bootstrap for instance) that types are fully qualified, because
12475         we dump all the types in the namespace, and we should really have
12476         types inserted into the proper namespace, so we can only store the
12477         basenames in the defined_names array.
12478
12479 2002-10-10  Martin Baulig  <martin@gnome.org>
12480
12481         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12482         from bug #31834, see the bug report for a testcase which is
12483         miscompiled.
12484
12485 2002-10-10  Martin Baulig  <martin@gnome.org>
12486
12487         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12488         flow analysis code for this.
12489
12490         * statement.cs (Do, While, For): Tell the flow analysis code about
12491         infinite loops.
12492         (FlowBranching.UsageVector): Added support for infinite loops.
12493         (Block.Resolve): Moved the dead code elimination here and use flow
12494         analysis to do it.
12495
12496 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * class.cs (Field.Define): Catch cycles on struct type
12499         definitions. 
12500
12501         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12502         fields if the fields are static.  We only need to check instance
12503         fields. 
12504
12505         * expression.cs (As.DoResolve): Test for reference type.
12506
12507         * statement.cs (Using.ResolveExpression): Use
12508         ConvertImplicitRequired, not ConvertImplicit which reports an
12509         error on failture
12510         (Using.ResolveLocalVariableDecls): ditto.
12511
12512         * expression.cs (Binary.ResolveOperator): Report errors in a few
12513         places where we had to.
12514
12515         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12516
12517 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12518
12519         * expression.cs: Use StoreFromPtr instead of extracting the type
12520         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12521
12522         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12523         an enumeration value to a System.Enum, but System.Enum is not a
12524         value type, but an class type, so we need to box.
12525
12526         (Expression.ConvertExplicit): One codepath could return
12527         errors but not flag them.  Fix this.  Fixes #31853
12528
12529         * parameter.cs (Resolve): Do not allow void as a parameter type.
12530
12531 2002-10-06  Martin Baulig  <martin@gnome.org>
12532
12533         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12534         if it's a class type and not a struct.  Fixes #31815.
12535
12536 2002-10-06  Martin Baulig  <martin@gnome.org>
12537
12538         * statement.cs: Reworked the flow analysis code a bit to make it
12539         usable for dead code elimination.
12540
12541 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12542
12543         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12544
12545 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12546
12547         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12548         to fix the test 165, will investigate deeper.
12549
12550 2002-10-04  Martin Baulig  <martin@gnome.org>
12551
12552         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12553         finally blocks actually work.
12554         (Try.Resolve): We don't need to create a sibling for `finally' if
12555         there is no finally block.
12556
12557 2002-10-04  Martin Baulig  <martin@gnome.org>
12558
12559         * class.cs (Constructor.Define): The default accessibility for a
12560         non-default constructor is private, not public.
12561
12562 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12563
12564         * class.cs (Constructor): Make AllowedModifiers public, add
12565         EXTERN.
12566
12567         * cs-parser.jay: Perform the modifiers test here, as the
12568         constructor for the Constructor class usually receives a zero
12569         because of the way we create it (first we create, later we
12570         customize, and we were never checking the modifiers).
12571
12572         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12573         is a version of LookupTypeReflection that includes the type-name
12574         cache.  This can be used as a fast path for functions that know
12575         the fully qualified name and are only calling into *.GetType() to
12576         obtain a composed type.
12577
12578         This is also used by TypeManager.LookupType during its type
12579         composition.
12580
12581         (LookupType): We now also track the real type name, as sometimes
12582         we can get a quey for the real type name from things like
12583         ComposedCast.  This fixes bug 31422.
12584
12585         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12586         complete type fullname, it does not have to go through the type
12587         resolution system to obtain the composed version of the type (for
12588         obtaining arrays or pointers).
12589
12590         (Conditional.Emit): Use the EmitBoolExpression to
12591         generate nicer code, as requested by Paolo.
12592
12593         (ArrayCreation.CheckIndices): Use the patch from
12594         hwang_rob@yahoo.ca to validate the array initializers. 
12595
12596 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12597
12598         * class.cs (ConstructorInitializer.Emit): simplify code by using
12599         Invocation.EmitCall, and at the same time, fix the bugs in calling
12600         parent constructors that took variable arguments. 
12601
12602         * ecore.cs (Expression.ConvertNumericExplicit,
12603         Expression.ImplicitNumericConversion): Remove the code that
12604         manually wrapped decimal (InternalTypeConstructor call is now gone
12605         as well).
12606
12607         * expression.cs (Cast.TryReduce): Also handle decimal types when
12608         trying to perform a constant fold on the type.
12609
12610         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12611
12612         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12613         that only turned off an error report, and did nothing else. 
12614
12615 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12616
12617         * driver.cs: Handle and ignore /fullpaths
12618
12619 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12620
12621         * expression.cs (Binary.ResolveOperator): Catch the case where
12622         DoNumericPromotions returns true, 
12623
12624         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12625
12626 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12627
12628         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12629         report error 70.
12630
12631 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12634         conversion exists, but it is also required that the conversion be
12635         performed.  This manifested in "(Type64Enum) 2".  
12636
12637         * class.cs (TypeManager.AddMethod): The fix is not to change
12638         AddEnum, because that one was using a fully qualified name (every
12639         DeclSpace derivative does), but to change the AddMethod routine
12640         that was using an un-namespaced name.  This now correctly reports
12641         the duplicated name.
12642
12643         Revert patch until I can properly fix it.  The issue
12644         is that we have a shared Type space across all namespaces
12645         currently, which is wrong.
12646
12647         Options include making the Namespace a DeclSpace, and merge
12648         current_namespace/current_container in the parser.
12649
12650 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12651
12652         * cs-parser.jay: Improve error reporting when we get a different
12653         kind of expression in local_variable_type and
12654         local_variable_pointer_type. 
12655
12656         Propagate this to avoid missleading errors being reported.
12657
12658         * ecore.cs (ImplicitReferenceConversion): treat
12659         TypeManager.value_type as a target just like object_type.   As
12660         code like this:
12661
12662         ValueType v = 1;
12663
12664         Is valid, and needs to result in the int 1 being boxed before it
12665         is assigned to the value type v.
12666
12667         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12668         to validate the enumeration name.
12669
12670         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12671         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12672         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12673
12674         * ecore.cs (TryImplicitIntConversion): When doing an
12675         implicit-enumeration-conversion, check if the type is 64-bits and
12676         perform a conversion before passing to EnumConstant.
12677
12678 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12681         report ambiguous type references.  Unlike the MS version, we
12682         report what the ambiguity is.   Innovation at work ;-)
12683
12684         (DeclSpace.FindType): Require a location argument to
12685         display when we display an ambiguous error.
12686
12687         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12688
12689         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12690
12691         * expression.cs (EmitDynamicInitializers): Apply patch from
12692         hwang_rob@yahoo.ca that fixes the order in which we emit our
12693         initializers. 
12694
12695 2002-09-21  Martin Baulig  <martin@gnome.org>
12696
12697         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12698         delegate takes no arguments.
12699
12700 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12701
12702         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12703         from integers.
12704
12705         * expression.cs: Extract the underlying type.
12706
12707         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12708
12709         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12710
12711 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12712
12713         * class.cs (TypeContainer.DefineType): We can not use the nice
12714         PackingSize with the size set to 1 DefineType method, because it
12715         will not allow us to define the interfaces that the struct
12716         implements.
12717
12718         This completes the fixing of bug 27287
12719
12720         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12721         means also structs.  This fixes part of the problem. 
12722         (Expresion.ImplicitReferenceConversionExists): ditto.
12723
12724         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12725         error if there were no errors reported during the type lookup
12726         process, to avoid duplicates or redundant errors.  Without this
12727         you would get an ambiguous errors plus a type not found.  We have
12728         beaten the user enough with the first error.  
12729
12730         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12731         reference. 
12732
12733         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12734         during the resolution process, stop the lookup, this avoids
12735         repeated error reports (same error twice).
12736
12737         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12738
12739         * typemanager.cs (LookupType): Redo the type lookup code to match
12740         the needs of System.Reflection.  
12741
12742         The issue is that System.Reflection requires references to nested
12743         types to begin with a "+" sign instead of a dot.  So toplevel
12744         types look like: "NameSpace.TopLevelClass", and nested ones look
12745         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12746         levels. 
12747
12748 2002-09-19  Martin Baulig  <martin@gnome.org>
12749
12750         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12751         says that a method always returns or always throws an exception,
12752         don't report the CS0161.
12753
12754         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12755         set `Returns = new_returns'.
12756
12757 2002-09-19  Martin Baulig  <martin@gnome.org>
12758
12759         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12760         to an enum constant, check for a CS0176.
12761
12762 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12765         for operators that must be in pairs and report errors.
12766
12767         * ecore.cs (SimpleName.DoResolveType): During the initial type
12768         resolution process, when we define types recursively, we must
12769         check first for types in our current scope before we perform
12770         lookups in the enclosing scopes.
12771
12772         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12773
12774         (Invocation.VerifyArgumentsCompat): Call
12775         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12776         I thought we were supposed to always call this, but there are a
12777         few places in the code where we dont do it.
12778
12779 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12780
12781         * driver.cs: Add support in -linkres and -resource to specify the
12782         name of the identifier.
12783
12784 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12785
12786         * ecore.cs (StandardConversionExists): Sync with the conversion
12787         code: allow anything-* to void* conversions.
12788
12789         (FindMostSpecificSource): Use an Expression argument
12790         instead of a Type, because we might be handed over a Literal which
12791         gets a few more implicit conversions that plain types do not.  So
12792         this information was being lost.
12793
12794         Also, we drop the temporary type-holder expression when not
12795         required.
12796
12797 2002-09-17  Martin Baulig  <martin@gnome.org>
12798
12799         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12800         this is an explicit interface implementation.
12801
12802 2002-09-17  Martin Baulig  <martin@gnome.org>
12803
12804         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12805         different `IndexerName' attributes.
12806
12807         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12808         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12809         virtual CommonResolve().
12810
12811 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12812
12813         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12814         and convert that to the UnderlyingType.
12815
12816         * statement.cs (Foreach.Resolve): Indexers are just like variables
12817         or PropertyAccesses.
12818
12819         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12820         inside quoted strings, we were not doing this before.
12821
12822 2002-09-16  Martin Baulig  <martin@gnome.org>
12823
12824         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12825         resolve it.  This is needed for the definite assignment check of the
12826         instance expression, fixes bug #29846.
12827         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12828
12829 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12830
12831         * parameter.cs: Fix compile error.  Cannot reference static member
12832         from an instance object.  Is this an mcs bug?
12833
12834 2002-09-14  Martin Baulig  <martin@gnome.org>
12835
12836         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12837         multiple times.  Fixes bug #30295, added test-166.cs.
12838
12839 2002-09-14  Martin Baulig  <martin@gnome.org>
12840
12841         * statement.cs (Block.Emit): Don't emit unreachable code.
12842         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12843         `break' statements.
12844         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12845
12846 2002-09-14  Martin Baulig  <martin@gnome.org>
12847
12848         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12849         is set.
12850
12851 2002-09-14  Martin Baulig  <martin@gnome.org>
12852
12853         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12854         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12855         be false on the ms runtime.
12856
12857 2002-09-13  Martin Baulig  <martin@gnome.org>
12858
12859         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12860         the CS0038 error message.
12861
12862 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12863
12864         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12865         constant inside, return it.
12866
12867 2002-09-12  Martin Baulig  <martin@gnome.org>
12868
12869         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12870         implicit conversion can be done between enum types.
12871
12872         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12873         check whether an implicit conversion to the current enum's UnderlyingType
12874         exists and report an error if not.
12875
12876         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12877         without debugging support.
12878
12879         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12880         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12881
12882 2002-09-12  Martin Baulig  <martin@gnome.org>
12883
12884         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12885
12886         * ecore.cs (IMemberExpr.DeclaringType): New property.
12887         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12888         nonstatic member of an outer type (CS0038).
12889
12890 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12891
12892         * driver.cs: Activate the using-error detector at warning level
12893         4 (at least for MS-compatible APIs).
12894
12895         * namespace.cs (VerifyUsing): Small buglett fix.
12896
12897         * pending.cs (PendingImplementation): pass the container pointer. 
12898
12899         * interface.cs (GetMethods): Allow for recursive definition.  Long
12900         term, I would like to move every type to support recursive
12901         definitions, not the current ordering mechanism that we have right
12902         now.
12903
12904         The situation is this: Attributes are handled before interfaces,
12905         so we can apply attributes to interfaces.  But some attributes
12906         implement interfaces, we will now handle the simple cases
12907         (recursive definitions will just get an error).  
12908
12909         * parameter.cs: Only invalidate types at the end if we fail to
12910         lookup all types.  
12911
12912 2002-09-09  Martin Baulig  <martin@gnome.org>
12913
12914         * ecore.cs (PropertyExpr.Emit): Also check for
12915         TypeManager.system_int_array_get_length so this'll also work when
12916         compiling corlib.  Fixes #30003.
12917
12918 2002-09-09  Martin Baulig  <martin@gnome.org>
12919
12920         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12921         and throw an exception if we can't get the type's size.  Fixed #30040,
12922         added test-165.cs.
12923
12924 2002-09-09  Martin Baulig  <martin@gnome.org>
12925
12926         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12927
12928         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12929         context.  Fixes bug #30027.
12930
12931         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12932         virtual functions.  Fixes bug #30043, added test-164.cs.
12933
12934 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12935
12936         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12937
12938 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12939
12940         * driver.cs: Use an object to get the windows codepage since it's not a
12941         static property.
12942
12943 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12944
12945         * statement.cs (For.Emit): for infinite loops (test == null)
12946         return whether there is a break inside, not always "true".
12947
12948         * namespace.cs (UsingEntry): New struct to hold the name of the
12949         using definition, the location where it is defined, and whether it
12950         has been used in a successful type lookup.
12951
12952         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12953         strings.
12954
12955         * decl.cs: ditto.
12956
12957 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12958
12959         * attribute.cs : Fix incorrect code which relied on catching
12960         a NullReferenceException to detect a null being passed in
12961         where an object was expected.
12962
12963 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12964
12965         * statement.cs (Try): flag the catch variable as assigned
12966
12967         * expression.cs (Cast): Simplified by using ResolveType instead of
12968         manually resolving.
12969
12970         * statement.cs (Catch): Fix bug by using ResolveType.
12971
12972 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12973
12974         * expression.cs (BetterConversion): Special case for when we have
12975         a NullLiteral as the argument and we have to choose between string
12976         and object types - we choose string the way csc does.
12977
12978         * attribute.cs (Attribute.Resolve): Catch the
12979         NullReferenceException and report error #182 since the Mono
12980         runtime no more has the bug and having this exception raised means
12981         we tried to select a constructor which takes an object and is
12982         passed a null.
12983
12984 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12985
12986         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12987         message (1502, 1503) when we can't locate a method after overload
12988         resolution. This is much more informative and closes the bug
12989         Miguel reported.
12990
12991         * interface.cs (PopulateMethod): Return if there are no argument
12992         types. Fixes a NullReferenceException bug.
12993
12994         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12995         expressions too. Previously we were checking only in one place for
12996         positional arguments leaving out named arguments.
12997
12998         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12999         type to the enum type is not allowed. Remove code corresponding to
13000         that.
13001
13002         (ConvertNumericExplicit): Allow explicit conversions from
13003         the underlying type to enum type. This precisely follows the spec
13004         and closes a bug filed by Gonzalo.
13005
13006 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13007
13008         * compiler.csproj:
13009         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13010
13011 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13012
13013         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13014         it was important that we stored the right value after the
13015         reduction in `converted'.
13016
13017 2002-09-04  Martin Baulig  <martin@gnome.org>
13018
13019         * location.cs (Location.SymbolDocument): Use full pathnames for the
13020         source files.
13021
13022 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13023
13024         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13025         of the expression resolve mechanism, because that will catch the
13026         SimpleName error failures.
13027
13028         (Conditional): If we can not resolve the
13029         expression, return, do not crash.
13030
13031 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13032
13033         * cs-tokenizer.cs:
13034         (location): display token name instead of its number.
13035
13036 2002-08-28  Martin Baulig  <martin@gnome.org>
13037
13038         * expression.cs (Binary.ResolveOperator): Don't silently return
13039         but return an error if an operator cannot be applied between two
13040         enum types.
13041
13042 2002-08-28  Martin Baulig  <martin@gnome.org>
13043
13044         * class.cs (Constructor.Define): Set the permission attributes
13045         correctly instead of making all constructors public.
13046
13047 2002-08-28  Martin Baulig  <martin@gnome.org>
13048
13049         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13050         for private members before reporting a CS0103; if we find anything,
13051         it's a CS0122.
13052
13053 2002-08-28  Martin Baulig  <martin@gnome.org>
13054
13055         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13056         to check whether `closure_start_type == closure_invocation_type',
13057         we also need to check whether `m.DeclaringType == closure_invocation_type'
13058         before bypassing the permission checks.  We might be accessing
13059         protected/private members from the base class.
13060         (TypeManager.RealMemberLookup): Only set private_ok if private
13061         members were requested via BindingFlags.NonPublic.
13062
13063         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13064
13065         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13066         MethodGroupExpr.IsExplicitImpl if appropriate.
13067         (Invocation.DoResolve): Don't report the CS0120 for explicit
13068         interface implementations.
13069
13070 2002-08-27  Martin Baulig  <martin@gnome.org>
13071
13072         * expression.cs (Invocation.DoResolve): If this is a static
13073         method and we don't have an InstanceExpression, we must report
13074         a CS0120.
13075
13076 2002-08-25  Martin Baulig  <martin@gnome.org>
13077
13078         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13079         `==' between a valuetype and an object.
13080
13081 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * ecore.cs (TypeExpr): Provide a ToString method.
13084
13085 2002-08-24  Martin Baulig  <martin@gnome.org>
13086
13087         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13088         now called proggie.dbg and it's a binary file.
13089
13090 2002-08-23  Martin Baulig  <martin@gnome.org>
13091
13092         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13093
13094 2002-08-23  Martin Baulig  <martin@gnome.org>
13095
13096         * struct.cs (MyStructInfo.ctor): Make this work with empty
13097         structs; it's not allowed to use foreach() on null.
13098
13099 2002-08-23  Martin Baulig  <martin@gnome.org>
13100
13101         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13102         writer the full pathname of the generated assembly.
13103
13104 2002-08-23  Martin Baulig  <martin@gnome.org>
13105
13106         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13107         A `finally' block never returns or breaks; improved handling of
13108         unreachable code.
13109
13110 2002-08-23  Martin Baulig  <martin@gnome.org>
13111
13112         * statement.cs (Throw.Resolve): Allow `throw null'.
13113
13114 2002-08-23  Martin Baulig  <martin@gnome.org>
13115
13116         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13117         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13118         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13119         MemberLookup would return a wrong event if this is an explicit
13120         interface implementation and the class has an event with the same
13121         name.
13122
13123 2002-08-23  Martin Baulig  <martin@gnome.org>
13124
13125         * statement.cs (Block.AddChildVariableNames): New public method.
13126         (Block.AddChildVariableName): Likewise.
13127         (Block.IsVariableNameUsedInChildBlock): Likewise.
13128         (Block.AddVariable): Check whether a variable name has already
13129         been used in a child block.
13130
13131         * cs-parser.jay (declare_local_variables): Mark all variable names
13132         from the current block as being used in a child block in the
13133         implicit block.
13134
13135 2002-08-23  Martin Baulig  <martin@gnome.org>
13136
13137         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13138         find the symbol writer.
13139
13140         * driver.cs: csc also allows the arguments to /define being
13141         separated by commas, not only by semicolons.
13142
13143 2002-08-23  Martin Baulig  <martin@gnome.org>
13144
13145         * interface.cs (Interface.GetMembers): Added static check for events.
13146
13147 2002-08-15  Martin Baulig  <martin@gnome.org>
13148
13149         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13150         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13151
13152         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13153         why the MethodData.EmitDestructor() change was necessary.
13154
13155 2002-08-20  Martin Baulig  <martin@gnome.org>
13156
13157         * class.cs (TypeContainer.FindMembers): Added static check for events.
13158
13159         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13160
13161         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13162         use Type.GetEvents(), not Type.FindMembers().
13163
13164 2002-08-20  Martin Baulig  <martin@gnome.org>
13165
13166         * decl.cs (MemberCache): Added a special method cache which will
13167         be used for method-only searched.  This ensures that a method
13168         search will return a MethodInfo with the correct ReflectedType for
13169         inherited methods.      
13170
13171 2002-08-20  Martin Baulig  <martin@gnome.org>
13172
13173         * decl.cs (DeclSpace.FindMembers): Made this public.
13174
13175 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13176
13177         * delegate.cs: fixed build on windows.
13178         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13179
13180 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13181
13182         * ecore.cs (StandardConversionExists): Return a false
13183         if we are trying to convert the void type to anything else
13184         since that is not allowed.
13185
13186         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13187         we flag error 70 in the event an event is trying to be accessed
13188         directly from outside the declaring type.
13189
13190 2002-08-20  Martin Baulig  <martin@gnome.org>
13191
13192         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13193         MemberCache from typemanager.cs to decl.cs.
13194
13195 2002-08-19  Martin Baulig  <martin@gnome.org>
13196
13197         * class.cs (TypeContainer): Implement IMemberContainer.
13198         (TypeContainer.DefineMembers): Create the MemberCache.
13199         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13200         return public members if BindingFlags.Public was given, check
13201         whether members are static.
13202
13203 2002-08-16  Martin Baulig  <martin@gnome.org>
13204
13205         * decl.cs (DeclSpace.Define): Splitted this in Define and
13206         DefineMembers.  DefineMembers is called first and initializes the
13207         MemberCache.
13208
13209         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13210         DefineMembers() on all our DeclSpaces.
13211
13212         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13213         but call DefineMembers() on all nested interfaces.  We call their
13214         Define() in our new Define() function.
13215
13216         * interface.cs (Interface): Implement IMemberContainer.
13217         (Interface.Define): Moved all code except the attribute stuf to
13218         DefineMembers().
13219         (Interface.DefineMembers): Initialize the member cache.
13220
13221         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13222         need this anymore since we can use MemberCache.FindMembers directly.
13223
13224 2002-08-19  Martin Baulig  <martin@gnome.org>
13225
13226         * typemanager.cs (MemberCache): When creating the cache for an
13227         interface type, add all inherited members.
13228         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13229         to `out bool used_cache' and documented it.
13230         (TypeManager.MemberLookup): If we already used the cache in the first
13231         iteration, we don't need to do the interfaces check.
13232
13233 2002-08-19  Martin Baulig  <martin@gnome.org>
13234
13235         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13236         here from IMemberFinder and don't implement this interface anymore.
13237         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13238
13239         * typemanager.cs (IMemberFinder): This interface is now only used by
13240         classes which actually support the member cache.
13241         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13242         since we only put DeclSpaces into this Hashtable.
13243         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13244         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13245
13246 2002-08-16  Martin Baulig  <martin@gnome.org>
13247
13248         * typemanager.cs (ICachingMemberFinder): Removed.
13249         (IMemberFinder.MemberCache): New property.
13250         (TypeManager.FindMembers): Merged this with RealFindMembers().
13251         This function will never be called from TypeManager.MemberLookup()
13252         so we can't use the cache here, just the IMemberFinder.
13253         (TypeManager.MemberLookup_FindMembers): Check whether the
13254         IMemberFinder has a MemberCache and call the cache's FindMembers
13255         function.
13256         (MemberCache): Rewrote larger parts of this yet another time and
13257         cleaned it up a bit.
13258
13259 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13260
13261         * driver.cs (LoadArgs): Support quoting.
13262
13263         (Usage): Show the CSC-like command line arguments.
13264
13265         Improved a few error messages.
13266
13267 2002-08-15  Martin Baulig  <martin@gnome.org>
13268
13269         * typemanager.cs (IMemberContainer.Type): New property.
13270         (IMemberContainer.IsInterface): New property.
13271
13272         The following changes are conditional to BROKEN_RUNTIME, which is
13273         defined at the top of the file.
13274
13275         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13276         class'es members, but add all members from TypeHandle.ObjectType
13277         if we're an interface.
13278         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13279         is the current type.
13280         (MemberCache.CacheEntry.Container): Removed this field.
13281         (TypeHandle.GetMembers): Include inherited members.
13282
13283 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13284
13285         * typemanager.cs: fixed compilation and added a comment on a field that
13286         is never used.
13287
13288 2002-08-15  Martin Baulig  <martin@gnome.org>
13289
13290         * class.cs (ConstructorInitializer.Resolve): In the
13291         Expression.MemberLookup call, use the queried_type as
13292         invocation_type.
13293
13294         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13295         declared' attribute, it's always true.
13296         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13297         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13298         temporary wrapper for FindMembers which tells MemberLookup whether
13299         members from the base classes are included in the return value.
13300         This will go away soon.
13301         (TypeManager.MemberLookup): Use this temporary hack here; once the
13302         new MemberCache is completed, we don't need to do the DeclaredOnly
13303         looping here anymore since the MemberCache will take care of this.
13304         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13305         (MemberCache): When creating the MemberCache for a class, get
13306         members from the current class and all its base classes.
13307         (MemberCache.CacheEntry.Container): New field.  This is a
13308         temporary hack until the Mono runtime is fixed to distinguish
13309         between ReflectedType and DeclaringType.  It allows us to use MCS
13310         with both the MS runtime and the unfixed Mono runtime without
13311         problems and without accecting performance.
13312         (MemberCache.SearchMembers): The DeclaredOnly looping from
13313         TypeManager.MemberLookup is now done here.      
13314
13315 2002-08-14  Martin Baulig  <martin@gnome.org>
13316
13317         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13318         Type.GetFields on dynamic types but get the fields from the
13319         corresponding TypeContainer.
13320         (MyStructInfo.GetStructInfo): Added check for enum types.
13321
13322         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13323         (MemberList.SyncRoot): Implemented.
13324         (TypeManager.FilterWithClosure): No need to check permissions if
13325         closure_start_type == closure_invocation_type, don't crash if
13326         closure_invocation_type is null.
13327
13328 2002-08-13  Martin Baulig  <martin@gnome.org>
13329
13330         Rewrote TypeContainer.FindMembers to use a member cache.  This
13331         gives us a speed increase of about 35% for the self-hosting MCS
13332         build and of about 15-20% for the class libs (both on GNU/Linux).
13333
13334         * report.cs (Timer): New class to get enhanced profiling.  This
13335         whole class is "TIMER" conditional since it remarkably slows down
13336         compilation speed.
13337
13338         * class.cs (MemberList): New class.  This is an IList wrapper
13339         which we're now using instead of passing MemberInfo[]'s around to
13340         avoid copying this array unnecessarily.
13341         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13342         (ICachingMemberFinder, IMemberContainer): New interface.
13343         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13344         has already been checked, otherwise use it for the name comparision.
13345         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13346         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13347         if possible.  Returns a MemberList, not a MemberInfo [].
13348         (TypeHandle): New class, implements IMemberContainer.  We create
13349         one instance of this class per type, it contains a MemberCache
13350         which is used to do the member lookups.
13351         (MemberCache): New class.  Each instance of this class contains
13352         all members of a type and a name-based hash table.
13353         (MemberCache.FindMembers): This is our new member lookup
13354         function.  First, it looks up all members of the requested name in
13355         the hash table.  Then, it walks this list and sorts out all
13356         applicable members and returns them.
13357
13358 2002-08-13  Martin Baulig  <martin@gnome.org>
13359
13360         In addition to a nice code cleanup, this gives us a performance
13361         increase of about 1.4% on GNU/Linux - not much, but it's already
13362         half a second for the self-hosting MCS compilation.
13363
13364         * typemanager.cs (IMemberFinder): New interface.  It is used by
13365         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13366         Enum, Delegate or Interface.
13367         (TypeManager.finder_to_member_finder): New PtrHashtable.
13368         (TypeManager.finder_to_container): Removed.
13369         (TypeManager.finder_to_delegate): Removed.
13370         (TypeManager.finder_to_interface): Removed.
13371         (TypeManager.finder_to_enum): Removed.
13372
13373         * interface.cs (Interface): Implement IMemberFinder.
13374
13375         * delegate.cs (Delegate): Implement IMemberFinder.
13376
13377         * enum.cs (Enum): Implement IMemberFinder.
13378
13379         * class.cs (TypeContainer): Implement IMemberFinder.
13380
13381 2002-08-12  Martin Baulig  <martin@gnome.org>
13382
13383         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13384
13385 2002-08-12  Martin Baulig  <martin@gnome.org>
13386
13387         * ecore.cs (ITypeExpression): New interface for expressions which
13388         resolve to a type.
13389         (TypeExpression): Renamed to TypeLookupExpression.
13390         (Expression.DoResolve): If we're doing a types-only lookup, the
13391         expression must implement the ITypeExpression interface and we
13392         call DoResolveType() on it.
13393         (SimpleName): Implement the new ITypeExpression interface.
13394         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13395         hack, the situation that we're only looking up types can't happen
13396         anymore when this method is called.  Moved the type lookup code to
13397         DoResolveType() and call it.
13398         (SimpleName.DoResolveType): This ITypeExpression interface method
13399         is now doing the types-only lookup.
13400         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13401         (ResolveFlags): Added MaskExprClass.
13402
13403         * expression.cs (MemberAccess): Implement the ITypeExpression
13404         interface.
13405         (MemberAccess.DoResolve): Added support for a types-only lookup
13406         when we're called via ITypeExpression.DoResolveType().
13407         (ComposedCast): Implement the ITypeExpression interface.
13408
13409         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13410         Expression.Resolve() with ResolveFlags.Type instead.
13411
13412 2002-08-12  Martin Baulig  <martin@gnome.org>
13413
13414         * interface.cs (Interface.Define): Apply attributes.
13415
13416         * attribute.cs (Attribute.ApplyAttributes): Added support for
13417         interface attributes.
13418
13419 2002-08-11  Martin Baulig  <martin@gnome.org>
13420
13421         * statement.cs (Block.Emit): Only check the "this" variable if we
13422         do not always throw an exception.
13423
13424         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13425         whether the property has a set accessor.
13426
13427 2002-08-11  Martin Baulig  <martin@gnome.org>
13428
13429         Added control flow analysis support for structs.
13430
13431         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13432         with control flow analysis turned off.
13433         (IVariable): New interface.
13434         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13435         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13436         (FieldExpr.DoResolve): Resolve the instance expression with flow
13437         analysis turned off and do the definite assignment check after the
13438         resolving when we know what the expression will resolve to.
13439
13440         * expression.cs (LocalVariableReference, ParameterReference):
13441         Implement the new IVariable interface, only call the flow analysis
13442         code if ec.DoFlowAnalysis is true.
13443         (This): Added constructor which takes a Block argument.  Implement
13444         the new IVariable interface.
13445         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13446         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13447         This does the definite assignment checks for struct members.
13448
13449         * class.cs (Constructor.Emit): If this is a non-static `struct'
13450         constructor which doesn't have any initializer, call
13451         Block.AddThisVariable() to tell the flow analysis code that all
13452         struct elements must be initialized before control returns from
13453         the constructor.
13454
13455         * statement.cs (MyStructInfo): New public class.
13456         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13457         argument to this indexer.  If non-zero, check an individual struct
13458         member, not the whole struct.
13459         (FlowBranching.CheckOutParameters): Check struct members.
13460         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13461         overloaded versions of these methods which take an additional
13462         `int field_idx' argument to check struct members.
13463         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13464         overloaded versions of these methods which take an additional
13465         `string field_name' argument to check struct member.s
13466         (VariableInfo): Implement the IVariable interface.
13467         (VariableInfo.StructInfo): New public property.  Returns the
13468         MyStructInfo instance of the variable if it's a struct or null.
13469         (Block.AddThisVariable): New public method.  This is called from
13470         Constructor.Emit() for non-static `struct' constructor which do
13471         not have any initializer.  It creates a special variable for the
13472         "this" instance variable which will be checked by the flow
13473         analysis code to ensure that all of the struct's fields are
13474         initialized before control returns from the constructor.
13475         (UsageVector): Added support for struct members.  If a
13476         variable/parameter is a struct with N members, we reserve a slot
13477         in the usage vector for each member.  A struct is considered fully
13478         initialized if either the struct itself (slot 0) or all its
13479         members are initialized.
13480
13481 2002-08-08  Martin Baulig  <martin@gnome.org>
13482
13483         * driver.cs (Driver.MainDriver): Only report an error CS5001
13484         if there were no compilation errors.
13485
13486         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13487         `UnsafeContext' property to determine whether the parent is in
13488         unsafe context rather than checking the parent's ModFlags:
13489         classes nested in an unsafe class are unsafe as well.
13490
13491 2002-08-08  Martin Baulig  <martin@gnome.org>
13492
13493         * statement.cs (UsageVector.MergeChildren): Distinguish between
13494         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13495         we return.  Added test17() and test18() to test-154.cs.
13496
13497 2002-08-08  Martin Baulig  <martin@gnome.org>
13498
13499         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13500         Family access, make sure the invoking type isn't a subclass of the
13501         queried type (that'd be a CS1540).
13502
13503         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13504         this method which takes an additional `Type invocation_type'.
13505
13506         * expression.cs (BaseAccess.DoResolve): Use the base type as
13507         invocation and query type.
13508         (MemberAccess.DoResolve): If the lookup failed and we're about to
13509         report a CS0122, try a lookup with the ec.ContainerType - if this
13510         succeeds, we must report a CS1540.
13511
13512 2002-08-08  Martin Baulig  <martin@gnome.org>
13513
13514         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13515         (MethodGroupExpr): Implement the IMemberExpr interface.
13516
13517         * expression (MemberAccess.ResolveMemberAccess): No need to have
13518         any special code for MethodGroupExprs anymore, they're now
13519         IMemberExprs.   
13520
13521 2002-08-08  Martin Baulig  <martin@gnome.org>
13522
13523         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13524         Family, FamANDAssem and FamORAssem permissions.
13525         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13526
13527 2002-08-08  Martin Baulig  <martin@gnome.org>
13528
13529         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13530         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13531         or loop block.
13532
13533 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13534
13535         * driver.cs: implemented /resource option to embed managed resources.
13536
13537 2002-08-07  Martin Baulig  <martin@gnome.org>
13538
13539         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13540         (FieldBase.HasFieldInitializer): New public property.
13541         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13542         returns the field initializer and makes sure it is only resolved once.
13543         (TypeContainer.EmitFieldInitializers): Call
13544         FieldBase.GetInitializerExpression to get the initializer, this ensures
13545         that it isn't resolved multiple times.
13546
13547         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13548         the resolving process (SimpleName/MemberLookup) that we're currently
13549         emitting a field initializer (which must not access any instance members,
13550         this is an error CS0236).
13551
13552         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13553         argument, if the `IsFieldInitializer' flag is set, we must report and
13554         error CS0236 and not an error CS0120.   
13555
13556 2002-08-07  Martin Baulig  <martin@gnome.org>
13557
13558         * ecore.cs (IMemberExpr): New public interface.
13559         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13560         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13561         if the expression is an IMemberExpr.
13562
13563         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13564         to be null, implicitly default to `this' if we're non-static in
13565         this case.  Simplified the code a lot by using the new IMemberExpr
13566         interface.  Also fixed bug #28176 here.
13567
13568 2002-08-06  Martin Baulig  <martin@gnome.org>
13569
13570         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13571         ParameterReferences during semantic analysis so that we can do a
13572         type-only search when resolving Cast, TypeOf and SizeOf.
13573         (block): Pass the `current_local_parameters' to the Block's
13574         constructor.
13575
13576         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13577         argument to the constructor.
13578         (ConstructorInitializer.Resolve): Create a temporary implicit
13579         block with the parameters.
13580
13581         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13582         references here if we aren't doing a type-only search.
13583
13584         * statement.cs (Block): Added constructor which takes a
13585         `Parameters parameters' argument.
13586         (Block.Parameters): New public property.
13587
13588         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13589         to `Parameters' and made it public readonly.
13590
13591 2002-08-06  Martin Baulig  <martin@gnome.org>
13592
13593         * ecore.cs (Expression.Warning): Made this public as well.
13594
13595         * report.cs (Report.Debug): Print the contents of collections.
13596
13597 2002-08-06  Martin Baulig  <martin@gnome.org>
13598
13599         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13600         used to tell Resolve() which kinds of expressions it may return.
13601         (Expression.Resolve): Added overloaded version of this method which
13602         takes a `ResolveFlags flags' argument.  This can be used to tell
13603         Resolve() which kinds of expressions it may return.  Reports a
13604         CS0118 on error.
13605         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13606         ResolveFlags.SimpleName.
13607         (Expression.Error118): Added overloaded version of this method which
13608         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13609         which kinds of expressions are allowed.
13610
13611         * expression.cs (Argument.ResolveMethodGroup): New public method.
13612         Resolves an argument, but allows a MethodGroup to be returned.
13613         This is used when invoking a delegate.
13614
13615         * TODO: Updated a bit.
13616
13617 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13618
13619         Fixed compilation with csc.
13620
13621         * ecore.cs: Expression.Error made public. Is this correct? Should
13622         Warning be made public too?
13623
13624         * expression.cs: use ea.Location instead of ea.loc.
13625         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13626
13627 2002-08-06  Martin Baulig  <martin@gnome.org>
13628
13629         * ecore.cs (Expression.loc): Moved the location here instead of
13630         duplicating it in all derived classes.
13631         (Expression.Location): New public property.
13632         (Expression.Error, Expression.Warning): Made them non-static and
13633         removed the location argument.
13634         (Expression.Warning): Added overloaded version which takes an
13635         `int level' argument.
13636         (Expression.Error118): Make this non-static and removed the
13637         expression and location arguments.
13638         (TypeExpr): Added location argument to the constructor.
13639
13640         * expression.cs (StaticCallExpr): Added location argument to
13641         the constructor.
13642         (Indirection, PointerArithmetic): Likewise.
13643         (CheckedExpr, UnCheckedExpr): Likewise.
13644         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13645         (StringPtr): Likewise.
13646
13647
13648 2002-08-05  Martin Baulig  <martin@gnome.org>
13649
13650         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13651
13652         * assign.cs (Assign.DoResolve): Check whether the source
13653         expression is a value or variable.
13654
13655         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13656         while resolving the corresponding blocks.
13657
13658         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13659         an error, don't silently return null.
13660
13661         * statement.cs (Block.AddVariable): Do the error reporting here
13662         and distinguish between CS0128 and CS0136.
13663         (Block.DoResolve): Report all unused labels (warning CS0164).
13664         (LabeledStatement): Pass the location to the constructor.
13665         (LabeledStatement.HasBeenReferenced): New property.
13666         (LabeledStatement.Resolve): Set it to true here.
13667
13668         * statement.cs (Return.Emit): Return success even after reporting
13669         a type mismatch error (CS0126 or CS0127), this is what csc does and
13670         it avoids confusing the users with any consecutive errors.
13671
13672 2002-08-05  Martin Baulig  <martin@gnome.org>
13673
13674         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13675
13676         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13677
13678         * expression.cs (MemberAccess.DoResolve): Silently return if an
13679         error has already been reported.
13680
13681         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13682         error has already been reported.
13683
13684 2002-08-05  Martin Baulig  <martin@gnome.org>
13685
13686         * statement.cs (UsageVector): Only initialize the `parameters'
13687         vector if we actually have any "out" parameters.
13688
13689 2002-08-05  Martin Baulig  <martin@gnome.org>
13690
13691         * expression.cs (Binary.ResolveOperator): When combining delegates,
13692         they must have the same type.
13693
13694 2002-08-05  Martin Baulig  <martin@gnome.org>
13695
13696         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13697         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13698         work with the ms runtime and we also don't need it: if we're a
13699         PropertyBuilder and not in the `indexer_arguments' hash, then we
13700         are a property and not an indexer.
13701
13702         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13703         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13704         since the latter one doesn't work with the ms runtime.
13705
13706 2002-08-03  Martin Baulig  <martin@gnome.org>
13707
13708         Fixed bugs #27998 and #22735.
13709
13710         * class.cs (Method.IsOperator): New public field.
13711         (Method.CheckBase): Report CS0111 if there's already a method
13712         with the same parameters in the current class.  Report CS0508 when
13713         attempting to change the return type of an inherited method.
13714         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13715         and it's not marked abstract or extern.
13716         (PropertyBase): New abstract base class for Property and Indexer.
13717         (PropertyBase.CheckBase): Moved here from Property and made it work
13718         for indexers.
13719         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13720         the same so we can reuse it there.
13721         (Property, Indexer): Derive from PropertyBase.
13722         (MethodSignature.inheritable_property_signature_filter): New delegate
13723         to find properties and indexers.
13724
13725         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13726         argument and improved error reporting.
13727
13728         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13729         EmptyReadOnlyParameters and made it a property.
13730
13731         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13732         version of this method which takes a `PropertyInfo indexer'.
13733         (TypeManager.RegisterIndexer): New method.
13734
13735         * class.cs: Added myself as author of this file :-)
13736
13737 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13738
13739         * class.cs: fixed compilation on windoze.
13740
13741 2002-08-03  Martin Baulig  <martin@gnome.org>
13742
13743         * interface.cs (Interface.GetInterfaceBases): Check whether all
13744         base interfaces are at least as accessible than the current one.
13745
13746         * class.cs (TypeContainer.GetClassBases): Check whether base types
13747         are at least as accessible than the current type.
13748         (TypeContainer.AsAccessible): Implemented and made non-static.
13749         (MemberBase.CheckParameters): Report errors if the accessibility
13750         checks fail.
13751
13752         * delegate.cs (Delegate.Delegate): The default visibility is
13753         internal for top-level types and private for nested types.
13754         (Delegate.Define): Report errors if the accessibility checks fail.
13755
13756         * enum.cs (Enum.Enum): The default visibility is internal for
13757         top-level types and private for nested types.
13758         (Enum.DefineType): Compute the correct visibility.
13759
13760         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13761         function which takes a `bool is_toplevel' instead of a TypeContainer.
13762
13763         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13764         builtin type.
13765
13766 2002-08-02  Martin Baulig  <martin@gnome.org>
13767
13768         * expression.cs (LocalVariableReferenc): Added constructor which
13769         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13770         (LocalVariableReference.IsReadOnly): New property.
13771         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13772         variable is readonly, use our own readonly flag to do this; you can
13773         use the new constructor to get a writable reference to a read-only
13774         variable.
13775
13776         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13777         reference to the local variable.
13778
13779 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * rootcontext.cs (ResolveCore): Also include System.Exception
13782
13783         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13784         we reach an EmptyStatement.
13785
13786         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13787         is also fine.
13788
13789         * expression.cs (Binary.ResolveOperator): Check error result in
13790         two places.
13791
13792         use brtrue/brfalse directly and avoid compares to null.
13793
13794 2002-08-02  Martin Baulig  <martin@gnome.org>
13795
13796         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13797         Fixes bug #28407, added test-155.cs.
13798
13799 2002-08-01  Martin Baulig  <martin@gnome.org>
13800
13801         * class.cs (Event.EmitDefaultMethod): Make this work with static
13802         events.  Fixes #28311, added verify-3.cs.
13803
13804 2002-08-01  Martin Baulig  <martin@gnome.org>
13805
13806         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13807         `is_disposable' fields.
13808         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13809         `hm.is_disposable' if we're using the collection pattern.
13810         (Foreach.EmitCollectionForeach): Use the correct type for the
13811         enumerator's local variable, only emit the try/finally block if
13812         necessary (fixes #27713).
13813
13814 2002-08-01  Martin Baulig  <martin@gnome.org>
13815
13816         * ecore.cs (Expression.report118): Renamed to Error118 and made
13817         it public static.
13818
13819         * statement.cs (Throw.Resolve): Check whether the expression is of
13820         the correct type (CS0118) and whether the type derives from
13821         System.Exception (CS0155).
13822         (Catch.Resolve): New method.  Do the type lookup here and check
13823         whether it derives from System.Exception (CS0155).
13824         (Catch.CatchType, Catch.IsGeneral): New public properties.
13825
13826         * typemanager.cs (TypeManager.exception_type): Added.
13827
13828 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * driver.cs: Updated About function.
13831
13832 2002-07-31  Martin Baulig  <martin@gnome.org>
13833
13834         Implemented Control Flow Analysis.
13835
13836         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13837         (EmitContext.CurrentBranching): Added.
13838         (EmitContext.StartFlowBranching): Added.
13839         (EmitContext.EndFlowBranching): Added.
13840         (EmitContext.KillFlowBranching): Added.
13841         (EmitContext.IsVariableAssigned): Added.
13842         (EmitContext.SetVariableAssigned): Added.
13843         (EmitContext.IsParameterAssigned): Added.
13844         (EmitContext.SetParameterAssigned): Added.
13845         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13846         Added control flow analysis stuff here.
13847
13848         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13849         resolve the expression as lvalue.
13850         (LocalVariableReference.DoResolve): Check whether the variable has
13851         already been assigned.
13852         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13853         the parameter as assigned here.
13854         (ParameterReference.DoResolve): Check whether the parameter has already
13855         been assigned.
13856         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13857         expression as lvalue.
13858
13859         * statement.cs (FlowBranching): New class for the flow analysis code.
13860         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13861         (LabeledStatement.IsDefined): New public property.
13862         (LabeledStatement.AddUsageVector): New public method to tell flow
13863         analyis that the label may be reached via a forward jump.
13864         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13865         flow analysis.
13866         (VariableInfo.Number): New public field.  This is used by flow analysis
13867         to number all locals of a block.
13868         (Block.CountVariables): New public property.  This is the number of
13869         local variables in this block (including the locals from all parent
13870         blocks).
13871         (Block.EmitMeta): Number all the variables.
13872
13873         * statement.cs: Added flow analysis support to all classes.
13874
13875 2002-07-31  Martin Baulig  <martin@gnome.org>
13876
13877         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13878         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13879         then use this argument.
13880
13881         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13882
13883         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13884         use this to specify /define options.
13885
13886 2002-07-29  Martin Baulig  <martin@gnome.org>
13887
13888         * statement.cs (Fixed): Moved all code that does variable lookups
13889         and resolvings from Emit to Resolve.
13890
13891         * statement.cs (For): Moved all code that does variable lookups
13892         and resolvings from Emit to Resolve.
13893
13894         * statement.cs (Using): Moved all code that does variable lookups
13895         and resolvings from Emit to Resolve.
13896
13897 2002-07-29  Martin Baulig  <martin@gnome.org>
13898
13899         * attribute.cs (Attribute.Resolve): Explicitly catch a
13900         System.NullReferenceException when creating the
13901         CustromAttributeBuilder and report a different warning message.
13902
13903 2002-07-29  Martin Baulig  <martin@gnome.org>
13904
13905         * support.cs (ParameterData.ParameterName): Added method to
13906         get the name of a parameter.
13907
13908         * typemanager.cs (TypeManager.IsValueType): New public method.
13909
13910 2002-07-29  Martin Baulig  <martin@gnome.org>
13911
13912         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13913         is a flag which specifies that it's either ref or out.
13914         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13915         the out parameter to `out Parameter.Modifier mod', also set the
13916         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13917
13918         * support.cs (InternalParameters.ParameterModifier): Distinguish
13919         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13920         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13921
13922         * expression.cs (Argument.GetParameterModifier): Distinguish
13923         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13924         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13925
13926 2002-07-29  Martin Baulig  <martin@gnome.org>
13927
13928         * expression.cs (ParameterReference.ParameterReference): Added
13929         `Location loc' argument to the constructor.
13930
13931         * cs-parser.jay: Pass location to ParameterReference.
13932
13933 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13934
13935         * statement.cs (Try): Initialize the location.
13936
13937         * cs-parser.jay: pass location to Try.
13938
13939         * expression.cs (Unary.Reduce): Change the prototype to return
13940         whether a constant fold could be performed or not.  The result is
13941         returned in an out parameters.  In the case of Indirection and
13942         AddressOf, we want to perform the full tests.
13943
13944 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13945
13946         * statement.cs (Statement.Emit): Flag dead code.
13947
13948 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13949
13950         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13951
13952 2002-07-27  Martin Baulig  <martin@gnome.org>
13953
13954         * class.cs (MethodData.Define): Put back call to
13955         TypeManager.AddMethod(), accidentally commented this out.
13956
13957         * report.cs (Debug): New public method to print debugging information,
13958         this is `[Conditional ("DEBUG")]'.
13959
13960 2002-07-26  Martin Baulig  <martin@gnome.org>
13961
13962         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13963         (switch_statement): Push the current_block to the switch_stack and
13964         pop it again when we're done with the switch.
13965         (switch_section): The new block is a child of the current_block.
13966         Fixes bug #24007, added test-152.cs.
13967
13968 2002-07-27  Martin Baulig  <martin@gnome.org>
13969
13970         * expression.cs (Invocation.EmitArguments): When calling a varargs
13971         function with only its fixed arguments, we need to pass an empty
13972         array.
13973
13974 2002-07-27  Martin Baulig  <martin@gnome.org>
13975
13976         Mono 0.13 has been released.
13977
13978 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * driver.cs: Rename --resource to --linkres, because that is what
13981         we do currently, we dont support --resource yet.
13982
13983         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13984
13985 2002-07-25  Martin Baulig  <martin@gnome.org>
13986
13987         * class.cs (MethodData): New public class.  This is a `method builder'
13988         class for a method or one accessor of a Property/Indexer/Event.
13989         (MethodData.GetMethodFlags): Moved here from MemberBase.
13990         (MethodData.ApplyAttributes): Likewise.
13991         (MethodData.ApplyObsoleteAttribute): Likewise.
13992         (MethodData.ApplyConditionalAttribute): Likewise.
13993         (MethodData.ApplyDllImportAttribute): Likewise.
13994         (MethodData.CheckAbstractAndExternal): Likewise.
13995         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13996         (MethodData.Emit): Formerly known as Method.Emit().
13997         (MemberBase): Moved everything which was specific to a single
13998         accessor/method to MethodData.
13999         (Method): Create a new MethodData and call Define() and Emit() on it.
14000         (Property, Indexer, Event): Create a new MethodData objects for each
14001         accessor and call Define() and Emit() on them.
14002
14003 2002-07-25  Martin Baulig  <martin@gnome.org>
14004
14005         Made MethodCore derive from MemberBase to reuse the code from there.
14006         MemberBase now also checks for attributes.
14007
14008         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14009         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14010         as virtual.
14011         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14012         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14013         (MemberBase.ApplyAttributes): New virtual method; applies the
14014         attributes to a method or accessor.
14015         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14016         (MemberBase.ApplyConditionalAttribute): Likewise.
14017         (MemberBase.ApplyDllImportAttribute): Likewise.
14018         (MemberBase.CheckAbstractAndExternal): Likewise.
14019         (MethodCore.ParameterTypes): This is now a property instead of a
14020         method, it's initialized from DoDefineParameters().
14021         (MethodCore.ParameterInfo): Removed the set accessor.
14022         (MethodCore.DoDefineParameters): New protected virtual method to
14023         initialize ParameterTypes and ParameterInfo.
14024         (Method.GetReturnType): We can now simply return the MemberType.
14025         (Method.GetMethodFlags): Override the MemberBase version and add
14026         the conditional flags.
14027         (Method.CheckBase): Moved some code from Define() here, call
14028         DoDefineParameters() here.
14029         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14030         here to avoid some larger code duplication.
14031         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14032         ensure that abstract and external accessors don't declare a body.
14033
14034         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14035         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14036         lookup in the attribute's parent classes, so we need to abort as soon
14037         as we found the first match.
14038         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14039         the attribute has no arguments.
14040
14041         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14042         of a Method.
14043
14044 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14045
14046         * cs-parser.jay: reverted previous patch.
14047
14048 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14049
14050         * cs-parser.jay: fixed bug #22119.
14051
14052 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14053
14054         * attribute.cs: fixed compilation. The error was:
14055         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14056         be assigned to before control leaves the current method."
14057         [FIXME:  Filed as bug #28186: MCS must report this error.]
14058
14059 2002-07-25  Martin Baulig  <martin@gnome.org>
14060
14061         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14062         method to pull the condition name ouf of a Conditional attribute.
14063         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14064         the obsolete message and error flag out of an Obsolete attribute.
14065
14066         * class.cs (Method.GetMethodFlags): New public method to get the
14067         TypeManager.MethodFlags for this method.
14068         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14069         private methods.
14070         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14071         if we're overriding a virtual function, set the new private variable
14072         `parent_method'; call the new TypeManager.AddMethod().
14073
14074         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14075         the MethodBuilder and the Method in a PtrHashtable.
14076         (TypeManager.builder_to_method): Added for this purpose.
14077         (TypeManager.MethodFlags): Added IsObsoleteError.
14078         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14079         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14080         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14081         the message from the attribute.
14082
14083 2002-07-24  Martin Baulig  <martin@gnome.org>
14084
14085         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14086         preprocessor directives, ensure that the argument to #define/#undef is
14087         exactly one identifier and that it's actually an identifier.
14088
14089         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14090         did not work ....
14091
14092 2002-07-24  Martin Baulig  <martin@gnome.org>
14093
14094         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14095         initialize it to TypeManager.object_type in the constructor.
14096         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14097         of the `hm.get_current' method if we're using the collection pattern.
14098         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14099         for the explicit conversion to make it work when we're using the collection
14100         pattern and the `Current' property has a different return type than `object'.
14101         Fixes #27713.
14102
14103 2002-07-24  Martin Baulig  <martin@gnome.org>
14104
14105         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14106         does not match, but don't report any errors.  This method is called in
14107         order for all methods in a MethodGroupExpr until a matching method is
14108         found, so we don't want to bail out if the first method doesn't match.
14109         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14110         matches, report the 123.  Fixes #28070.
14111
14112 2002-07-24  Martin Baulig  <martin@gnome.org>
14113
14114         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14115         TypeManager.TypeToCoreType() to the top of the method so the
14116         following equality checks will work.  Fixes #28107.
14117
14118 2002-07-24  Martin Baulig  <martin@gnome.org>
14119
14120         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14121         operand is of type uint, and the other operand is of type sbyte,
14122         short or int, the operands are converted to type long." -
14123         Actually do what this comment already told us.  Fixes bug #28106,
14124         added test-150.cs.
14125
14126 2002-07-24  Martin Baulig  <martin@gnome.org>
14127
14128         * class.cs (MethodBase): New abstract class.  This is now a base
14129         class for Property, Indexer and Event to avoid some code duplication
14130         in their Define() and DefineMethods() methods.
14131         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14132         generic methods for Define() and DefineMethods().
14133         (FieldBase): Derive from MemberBase, not MemberCore.
14134         (Property): Derive from MemberBase, not MemberCore.
14135         (Property.DefineMethod): Moved all the code from this method to the
14136         new MethodBase.DefineAccessor(), just call it with appropriate
14137         argumetnts.
14138         (Property.Define): Call the new Property.DoDefine(), this does some
14139         sanity checks and we don't need to duplicate the code everywhere.
14140         (Event): Derive from MemberBase, not MemberCore.
14141         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14142         accessors, this will also make them work with interface events.
14143         (Indexer): Derive from MemberBase, not MemberCore.
14144         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14145         (Indexer.Define): Use the new MethodBase functions.
14146
14147         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14148         argument to the constructor.
14149         (Interface.FindMembers): Added support for interface events.
14150         (Interface.PopluateEvent): Implemented.
14151
14152         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14153
14154 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14155
14156         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14157         but this is required to check for a method name being the same as
14158         the containing class.  
14159
14160         Handle this now.
14161
14162 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14163
14164         * interface.cs: initialize variable.
14165
14166 2002-07-23  Martin Baulig  <martin@gnome.org>
14167
14168         Implemented the IndexerName attribute in interfaces.
14169
14170         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14171         name if this is an explicit interface implementation.
14172         (Indexer.InterfaceIndexerName): New public variable.  If we're
14173         implementing an interface indexer, this is the IndexerName in that
14174         interface.  Otherwise, it's the IndexerName.
14175         (Indexer.DefineMethod): If we're implementing interface indexer,
14176         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14177         and Pending.ImplementIndexer methods.
14178         (Indexer.Define): Also define the PropertyBuilder if we're
14179         implementing an interface indexer and this is neither an explicit
14180         interface implementation nor do the IndexerName match the one in
14181         the interface.
14182
14183         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14184         If a method is defined here, then we always need to create a proxy
14185         for it.  This is used when implementing interface indexers.
14186         (Pending.IsInterfaceIndexer): New public method.
14187         (Pending.ImplementIndexer): New public method.
14188         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14189         This is used when implementing interface indexers to define a proxy
14190         if necessary.
14191         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14192         define a proxy if necessary.
14193
14194         * interface.cs (Interface.IndexerName): New public variable.
14195         (Interface.PopulateIndexer): Set the IndexerName.
14196         (Interface.DefineIndexers): New private method.  Populate all the
14197         indexers and make sure their IndexerNames match.
14198
14199         * typemanager.cs (IndexerPropertyName): Added support for interface
14200         indexers.
14201
14202 2002-07-22  Martin Baulig  <martin@gnome.org>
14203
14204         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14205         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14206         ret if HasReturnLabel.
14207         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14208         variables.
14209
14210         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14211         and set the ec.LoopBeginTryCatchLevel.
14212         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14213         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14214         the current ec.TryCatchLevel, the branch goes out of an exception
14215         block.  In this case, we need to use Leave and not Br.
14216
14217 2002-07-22  Martin Baulig  <martin@gnome.org>
14218
14219         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14220         block unless the block does not always return or it is contained in
14221         another try { ... } catch { ... } block.  Fixes bug #26506.
14222         Added verify-1.cs to the test suite.
14223
14224 2002-07-22  Martin Baulig  <martin@gnome.org>
14225
14226         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14227         then we do not always return.  Fixes bug #24985.
14228
14229 2002-07-22  Martin Baulig  <martin@gnome.org>
14230
14231         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14232         lookup on a per-class level; ie. walk up the class hierarchy until we
14233         found at least one applicable method, then choose the best among them.
14234         Fixes bug #24463 and test-29.cs.
14235
14236 2002-07-22  Martin Baulig  <martin@gnome.org>
14237
14238         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14239         return types of the methods.  The return type is not part of the
14240         signature and we must not check it to make the `new' modifier work.
14241         Fixes bug #27999, also added test-147.cs.
14242         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14243
14244         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14245         on the method's return type.
14246
14247 2002-07-21  Martin Baulig  <martin@gnome.org>
14248
14249         * assign.cs: Make this work if the rightmost source is a constant and
14250         we need to do an implicit type conversion.  Also adding a few more tests
14251         to test-38.cs which should have caught this.
14252
14253         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14254         target in the makefile for this.  The makefile.gnu is primarily intended
14255         for end-users who don't want to debug the compiler.
14256
14257 2002-07-21  Martin Baulig  <martin@gnome.org>
14258
14259         * assign.cs: Improved the Assign class so it can now handle embedded
14260         assignments (X = Y = Z = something).  As a side-effect this'll now also
14261         consume less local variables.  test-38.cs now passes with MCS, added
14262         a few new test cases to that test.
14263
14264 2002-07-20  Martin Baulig  <martin@gnome.org>
14265
14266         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14267         instructions.  Fixes bug #27977, also added test-146.cs.
14268
14269 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14270
14271         * cs-tokenizer.cs: fixed getHex ().
14272
14273 2002-07-19  Martin Baulig  <martin@gnome.org>
14274
14275         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14276         not Type.GetType() to lookup the array type.  This is needed when
14277         we're constructing an array of a user-defined type.
14278         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14279         single-dimensional arrays, but also for single-dimensial arrays of
14280         type decimal.
14281
14282 2002-07-19  Martin Baulig  <martin@gnome.org>
14283
14284         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14285         this function is called, it's not allowed to share LocalBuilders
14286         among ILGenerators.
14287
14288 2002-07-19  Martin Baulig  <martin@gnome.org>
14289
14290         * expression.cs (Argument.Resolve): Report an error 118 when trying
14291         to pass a type as argument.
14292
14293 2002-07-18  Martin Baulig  <martin@gnome.org>
14294
14295         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14296         Conv_R_Un for the signed `long' type.
14297
14298 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14299
14300         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14301         `expr' for the temporary result, as that will fail if we do
14302         multiple resolves on the same expression.
14303
14304 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14305
14306         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14307         ec.TypeContainer for looking up aliases. 
14308
14309         * class.cs (TypeContainer): Remove LookupAlias from here.
14310
14311         * decl.cs (DeclSpace); Move here.
14312
14313 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14314
14315         * class.cs (FindMembers): Only call filter if the constructor
14316         bulider is not null.
14317
14318         Also handle delegates in `NestedTypes' now.  Now we will perform
14319         type lookups using the standard resolution process.  This also
14320         fixes a bug.
14321
14322         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14323         This uses Expressions (the limited kind that can be parsed by the
14324         tree) instead of strings.
14325
14326         * expression.cs (ComposedCast.ToString): Implement, used to flag
14327         errors since now we have to render expressions.
14328
14329         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14330         FormArrayType. 
14331
14332         * ecore.cs (SimpleName.ToString): ditto.
14333
14334         * cs-parser.jay: Instead of using strings to assemble types, use
14335         Expressions to assemble the type (using SimpleName, ComposedCast,
14336         MemberAccess).  This should fix the type lookups in declarations,
14337         because we were using a different code path for this.
14338
14339         * statement.cs (Block.Resolve): Continue processing statements
14340         even when there is an error.
14341
14342 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14343
14344         * class.cs (Event.Define): Also remove the `remove' method from
14345         the list of pending items.
14346
14347         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14348         generate more compact code. 
14349
14350 2002-07-17  Martin Baulig  <martin@gnome.org>
14351
14352         * const.cs (Const.LookupConstantValue): Add support for constant
14353         `unchecked' and `checked' expressions.
14354         Also adding test case test-140.cs for this.
14355
14356 2002-07-17  Martin Baulig  <martin@gnome.org>
14357
14358         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14359         check whether mi.ReturnType implements the IEnumerator interface; the
14360         `==' and the IsAssignableFrom() will fail in this situation.
14361
14362 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14363
14364         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14365         here too.
14366
14367 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14368
14369         * expression.cs: fixed bug #27811.
14370
14371 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14372
14373         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14374         Molaro: when we are a ref, the value already contains a pointer
14375         value, do not take the address of it.
14376
14377 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14378         * removed mb-parser.jay and mb-tokenizer.cs
14379
14380 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14381
14382         * expression.cs: check against the building corlib void type.
14383
14384 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14385
14386         * ecore.cs: fix for valuetype static readonly fields: when 
14387         initializing them, we need their address, not the address of a copy.
14388
14389 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14390
14391         * typemanager.cs: register also enum_type in corlib.
14392
14393 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14394
14395         * class.cs: allow calling this (but not base) initializers in structs.
14396
14397 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14398
14399         * ecore.cs: make sure we compare against the building base types
14400         in GetTypeSize ().
14401
14402 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14403
14404         * typemanager.cs: fix TypeToCoreType() to handle void and object
14405         (corlib gets no more typerefs after this change).
14406
14407 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14408
14409         * expression.cs (ArrayCreation.EmitArrayArguments): use
14410         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14411
14412         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14413         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14414         array indexes, the runtime actually forbids them.
14415
14416         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14417         for array arguments here.
14418
14419         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14420         instead of the default for ValueTypes.
14421
14422         (New.DoEmit): Use IsValueType instead of
14423         IsSubclassOf (value_type)
14424         (New.DoResolve): ditto.
14425         (Invocation.EmitCall): ditto.
14426
14427         * assign.cs (Assign): ditto.
14428
14429         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14430         Statements *are* currently doing part of their resolution during
14431         Emit.  
14432
14433         Expressions do always resolve during resolve, but statements are
14434         only required to propagate resolution to their children.
14435
14436 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14437
14438         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14439
14440         (LoadAssembly): Do not add the dll if it is already specified
14441
14442         (MainDriver): Add the System directory to the link path at the end,
14443         after all the other -L arguments. 
14444
14445         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14446         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14447         ldelem.u1) and using the opposite for sbytes.
14448
14449         This fixes Digger, and we can finally run it.
14450
14451         * driver.cs (UnixParseOption): Move the option parsing here.  
14452         (CSCParseOption): Implement CSC-like parsing of options.
14453
14454         We now support both modes of operation, the old Unix way, and the
14455         new CSC-like way.  This should help those who wanted to make cross
14456         platform makefiles.
14457
14458         The only thing broken is that /r:, /reference: and /lib: are not
14459         implemented, because I want to make those have the same semantics
14460         as the CSC compiler has, and kill once and for all the confussion
14461         around this.   Will be doing this tomorrow.
14462
14463         * statement.cs (Unsafe.Resolve): The state is checked during
14464         resolve, not emit, so we have to set the flags for IsUnsfe here.
14465
14466 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14469         not catch the Error_ObjectRefRequired in SimpleName (as it is
14470         possible to have a class/instance variable name that later gets
14471         deambiguated), we have to check this here.      
14472
14473 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14474
14475         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14476         make static and put into Expression.
14477
14478         (Event.Define): Register the private field of the event with the 
14479         TypeManager so that GetFieldFromEvent can get at it.
14480
14481         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14482         keep track of the private field associated with an event which
14483         has no accessors.
14484
14485         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14486         private field.
14487
14488         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14489
14490 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * expression.cs (Binary.EmitBranchable): this routine emits the
14493         Binary expression in a branchable context.  This basically means:
14494         we need to branch somewhere, not just get the value on the stack.
14495
14496         This works together with Statement.EmitBoolExpression.
14497
14498         * statement.cs (Statement.EmitBoolExpression): Use
14499         EmitBranchable. 
14500
14501 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14502
14503         * statement.cs (For): Reduce the number of jumps in loops.
14504
14505         (For): Implement loop inversion for the For statement.
14506
14507         (Break): We can be breaking out of a Try/Catch controlled section
14508         (foreach might have an implicit try/catch clause), so we need to
14509         use Leave instead of Br.
14510
14511         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14512         now).  If the instace expression supports IMemoryLocation, we use
14513         the AddressOf method from the IMemoryLocation to extract the
14514         address instead of emitting the instance.
14515
14516         This showed up with `This', as we were emitting the instance
14517         always (Emit) instead of the Address of This.  Particularly
14518         interesting when This is a value type, as we dont want the Emit
14519         effect (which was to load the object).
14520
14521 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14524
14525         * statement.cs (Checked): Set the CheckedState during the resolve
14526         process too, as the ConvCast operations track the checked state on
14527         the resolve process, and not emit.
14528
14529         * cs-parser.jay (namespace_member_declaration): Flag that we have
14530         found a declaration when we do.  This is used to flag error 1529
14531
14532         * driver.cs: Report ok when we display the help only.
14533
14534 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14535
14536         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14537
14538 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * cs-tokenizer.cs (define): We also have to track locally the
14541         defines.  AllDefines is just used for the Conditional Attribute,
14542         but we also need the local defines for the current source code. 
14543
14544 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14545
14546         * statement.cs (While, For, Do): These loops can exit through a
14547         Break statement, use this information to tell whether the
14548         statement is the last piece of code.
14549
14550         (Break): Flag that we break.
14551
14552         * codegen.cs (EmitContexts): New `Breaks' state variable.
14553
14554 2002-07-03  Martin Baulig  <martin@gnome.org>
14555
14556         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14557         modifiers in method declarations in structs.  Otherwise, you won't
14558         be able to override things like Object.Equals().
14559
14560 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * class.cs (Method, Property, Indexer): Do not allow the public
14563         modifier to be used in explicit interface implementations.
14564
14565         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14566         override modifiers in method declarations in structs
14567
14568 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14569
14570         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14571         integer or real overflow, report an error
14572
14573 2002-07-02  Martin Baulig  <martin@gnome.org>
14574
14575         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14576         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14577         to tell the runtime about our newly created System.Object and
14578         System.ValueType types.
14579
14580 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14583         struct instead of Ldarg/Starg.
14584
14585 2002-07-02  Martin Baulig  <martin@gnome.org>
14586
14587         * expression.cs (Indirection.Indirection): Call
14588         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14589
14590 2002-07-02  Martin Baulig  <martin@gnome.org>
14591
14592         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14593         ValueType, call TypeManager.TypeToCoreType() on it.
14594         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14595         the OpCodes.Newarr argument.
14596
14597 2002-07-02  Martin Baulig  <martin@gnome.org>
14598
14599         * expression.cs (Invocation.EmitCall): When compiling corlib,
14600         replace all calls to the system's System.Array type to calls to
14601         the newly created one.
14602
14603         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14604         System.Array methods.
14605         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14606         from the system's System.Array type which must be replaced.
14607
14608 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14609
14610         * typemanager.cs: load unverifiable_code_ctor so we can build
14611         corlib using the correct type. Avoid using GetTypeCode() with
14612         TypeBuilders.
14613         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14614         TypeManager.object_type to allow building corlib.
14615
14616 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14617
14618         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14619
14620 2002-07-01  Martin Baulig  <martin@gnome.org>
14621
14622         * class.cs: Make the last change actually work, we need to check
14623         whether `ifaces != null' to avoid a crash.
14624
14625 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14626
14627         * class.cs: when we build structs without fields that implement
14628         interfaces, we need to add the interfaces separately, since there is
14629         no API to both set the size and add the interfaces at type creation
14630         time.
14631
14632 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14633
14634         * expression.cs: the dimension arguments to the array constructors
14635         need to be converted if they are a long.
14636
14637 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14638
14639         * class.cs: don't emit ldarg.0 if there is no parent constructor
14640         (fixes showstopper for corlib).
14641
14642 2002-06-29  Martin Baulig  <martin@gnome.org>
14643
14644         MCS now compiles corlib on GNU/Linux :-)
14645
14646         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14647         ie. check for MethodImplOptions.InternalCall.
14648
14649         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14650         and TypeManager.attribute_type are null, so we must explicitly check
14651         whether parent is not null to find out whether it's an attribute type.
14652         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14653         and SetBuilder, not only if the property is neither abstract nor external.
14654         This is necessary to set the MethodImplOptions on the accessor methods.
14655         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14656         SetBuilder, see Property.Emit().
14657
14658         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14659         populate "System.Object", "System.ValueType" and "System.Attribute" since
14660         they've already been populated from BootCorlib_PopulateCoreTypes().
14661
14662 2002-06-29  Martin Baulig  <martin@gnome.org>
14663
14664         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14665         is the NullLiteral, we also need to make sure that target_type is not
14666         an enum type.   
14667
14668 2002-06-29  Martin Baulig  <martin@gnome.org>
14669
14670         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14671         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14672         before calling BootstrapCorlib_ResolveDelegate ().
14673
14674 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14675
14676         * statement.cs: fixed build-breaker. All tests passed ok.
14677
14678 2002-06-27  Martin Baulig  <martin@gnome.org>
14679
14680         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14681         for System.Decimal when compiling corlib.
14682
14683 2002-06-27  Martin Baulig  <martin@gnome.org>
14684
14685         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14686         switch blocks which contain nothing but a default clause.
14687
14688 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14689
14690        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14691
14692 2002-06-27  Martin Baulig  <martin@gnome.org>
14693
14694         * ecore.cs (PropertyExpr.PropertyExpr): Call
14695         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14696
14697         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14698         is already a TypeBuilder.
14699
14700 2002-06-27  Martin Baulig  <martin@gnome.org>
14701
14702         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14703         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14704         the "from an array-type to System.Array" case.  This makes it work
14705         when compiling corlib.
14706
14707 2002-06-27  Martin Baulig  <martin@gnome.org>
14708
14709         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14710         non-static PropertyExpr, set its InstanceExpression.  This makes
14711         the `ICollection.Count' property work in System/Array.cs.
14712
14713 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14714
14715         * driver.cs: Made error handling more consistent.  Errors now
14716         tracked by Report class, so many methods which used to return int
14717         now return void.  Main() now prints success/failure and 
14718         errors/warnings message.
14719
14720         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14721         the magic number return values (123 and 124).  Now, if the
14722         expected error occurs, the compiler exits with success (exit value
14723         0).  If the compilation completes without seeing that particular
14724         error, the compiler exits with failure (exit value 1).  The
14725         makefile in mcs/errors has been changed to handle the new behaviour.
14726
14727         * report.cs: Made 'expected error' number a property and renamed
14728         it from 'Probe' to 'ExpectedError'.
14729
14730         * genericparser.cs: Removed error handling support, since it is
14731         now all done by Report class.
14732
14733         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14734         class, so parse() no longer returns an int.
14735
14736         * namespace.cs: Use Report.Error instead of GenericParser.error
14737
14738 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14739
14740         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14741         TypeContainer.AddOperator): At the front of the list put the
14742         explicit implementations, so they get resolved/defined first. 
14743
14744 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14745
14746         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14747         interface type is implemented by this TypeContainer.  Used during
14748         explicit interface implementation.
14749
14750         (Property.Define, Indexer.Define, Method.Define): Validate that
14751         the given interface in the explicit implementation is one of the
14752         base classes for the containing type.
14753
14754         Also if we are explicitly implementing an interface, but there is
14755         no match in the pending implementation table, report an error.
14756
14757         (Property.Define): Only define the property if we are
14758         not explicitly implementing a property from an interface.  Use the
14759         correct name also for those properties (the same CSC uses,
14760         although that is really not needed).
14761
14762         (Property.Emit): Do not emit attributes for explicitly implemented
14763         properties, as there is no TypeBuilder.
14764
14765         (Indexer.Emit): ditto.
14766
14767         Hiding then means that we do not really *implement* a pending
14768         implementation, which makes code fail.
14769
14770 2002-06-22  Martin Baulig  <martin@gnome.org>
14771
14772         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14773         the return value of Object.GetType().  [FIXME: we need to do this whenever
14774         we get a type back from the reflection library].
14775
14776 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14777
14778         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14779
14780 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * attribute.cs: Return null if we can not look up the type.
14783
14784         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14785         the interface types found.
14786
14787         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14788         interface types found.
14789
14790         * typemanager.cs (GetInterfaces): Make this routine returns alll
14791         the interfaces and work around the lame differences between
14792         System.Type and System.Reflection.Emit.TypeBuilder in the results
14793         result for GetInterfaces.
14794
14795         (ExpandInterfaces): Given an array of interface types, expand and
14796         eliminate repeated ocurrences of an interface.  This expands in
14797         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14798         be IA, IB, IC.
14799
14800 2002-06-21  Martin Baulig  <martin@gnome.org>
14801
14802         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14803         on System.Enum.
14804
14805 2002-06-21  Martin Baulig  <martin@gnome.org>
14806
14807         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14808         and called with one of the core types, return the corresponding typebuilder for
14809         that type.
14810
14811         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14812         element type.
14813
14814 2002-06-21  Martin Baulig  <martin@gnome.org>
14815
14816         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14817         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14818         (Expression.ConvertReferenceExplicit): Likewise.
14819
14820         * expression.cs (ElementAccess.DoResolve): Likewise.
14821         (ElementAccess.DoResolveLValue): Likewise.
14822
14823 2002-06-10  Martin Baulig  <martin@gnome.org>
14824
14825         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14826         add the "value" parameter to the parameter list.
14827
14828         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14829         to our caller.
14830
14831 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14832
14833         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14834         the argument to an int, uint, long or ulong, per the spec.  Also
14835         catch negative constants in array creation.
14836
14837 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14838
14839         * class.cs: do not allow the same interface to appear twice in
14840         the definition list.
14841
14842 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14843
14844         * ecore.cs: don't use ldlen with System.Array.
14845
14846 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14847
14848         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14849
14850 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14851
14852         * modifiers.cs: produce correct field attributes for protected
14853         internal. Easy fix so miguel can work on ther harder stuff:-)
14854
14855 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * pending.cs: New file.  Move the code from class.cs here.
14858         Support clearning the pending flag for all methods (when not doing
14859         explicit interface implementation).
14860
14861 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14862
14863         * rootcontext.cs: added a couple more types needed to bootstrap.
14864
14865 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14866
14867         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14868         constructor in the type, instead of any constructor in the type
14869         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14870         a bug in the Mono runtime when applying the params attribute). 
14871
14872 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14873         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14874
14875 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14876
14877         * expression.cs (Unary.ResolveOperator): Use TypeManager
14878         to resolve the type.
14879
14880 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14881
14882         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14883         attached.
14884
14885         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14886         with each member too.
14887
14888         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14889         field builders too - this takes care of the enum member case.
14890
14891 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14892
14893         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14894         address-of operator on both value types and pointers.
14895
14896 2002-06-10  Martin Baulig  <martin@gnome.org>
14897
14898         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14899         PropertyBuilder to the `property_builders' list.
14900
14901         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14902         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14903         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14904         find any indexers which are inherited from an interface.
14905
14906 2002-06-09  Martin Baulig  <martin@gnome.org>
14907
14908         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14909         the same type as the constant if necessary.  There's also a test-130.cs
14910         for this.
14911
14912         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14913
14914         * typemanager.cs (TypeManager.ChangeType): Previously known as
14915         Enum.ChangeEnumType().
14916
14917 2002-06-09  Martin Baulig  <martin@gnome.org>
14918
14919         * expression.cs (Cast.TryReduce): Added support for consts.
14920
14921 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14922
14923         * class.cs (Accessor): Hold attributes information so we can pass
14924         it along.
14925
14926         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14927         Modify to pass in attributes attached to the methods.
14928
14929         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14930
14931         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14932         to handle the Accessor kind :-)
14933
14934         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14935
14936 2002-06-08  Martin Baulig  <martin@gnome.org>
14937
14938         * expression.cs (Unary.TryReduceNegative): Added support for
14939         ULongConstants.
14940
14941 2002-06-08  Martin Baulig  <martin@gnome.org>
14942
14943         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14944         name can't be found in the `defined_names' - the caller will do a
14945         MemberLookup in this case and thus find methods in System.Enum
14946         such as Enum.IsDefined().
14947
14948 2002-06-08  Martin Baulig  <martin@gnome.org>
14949
14950         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14951         Convert.ChangeType() which works with TypeBuilder created types.
14952         (Enum.LookupEnumValue, Enum.Define): Use it here.
14953
14954         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14955         `TypeBuilder.BaseType != null' check.
14956         (TypeContainer.FindMembers): Only lookup parent members if we
14957         actually have a parent.
14958         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14959         (ConstructorInitializer.Resolve): Likewise.
14960
14961         * interface.cs (Interface.FindMembers): Added
14962         `TypeBuilder.BaseType != null' check.
14963
14964         * rootcontext.cs (RootContext.ResolveCore): Added
14965         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14966         classes_second_stage.
14967
14968         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14969         debug_type and trace_type when compiling with --nostdlib.       
14970
14971 2002-06-07  Martin Baulig  <martin@gnome.org>
14972
14973         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14974         (AddField): Set it to true when adding a non-static field.
14975         (DefineType): Use `have_nonstatic_fields' to find out whether we
14976         have non-static fields, not `Fields != null'.
14977
14978 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14979
14980         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14981         dereferencing a null on the static-field code path)
14982
14983 2002-05-30  Martin Baulig  <martin@gnome.org>
14984
14985         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14986         to take command line arguments.  Use reflection to call the new
14987         custom `Initialize' function on the symbol writer and pass it the
14988         command line arguments.
14989
14990         * driver.cs (--debug-args): New command line argument to pass command
14991         line arguments to the symbol writer.
14992
14993 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14996         the target type for indexers and properties.  Thanks to Joe for
14997         catching this.
14998
14999 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15000
15001         * typemanager.cs (MethodFlags): returns the method flags
15002         (Obsolete/ShouldIgnore) that control warning emission and whether
15003         the invocation should be made, or ignored. 
15004
15005         * expression.cs (Invocation.Emit): Remove previous hack, we should
15006         not do this on matching a base type, we should do this based on an attribute
15007
15008         Only emit calls to System.Diagnostics.Debug and
15009         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15010         on the command line.
15011
15012         * rootcontext.cs: Global settings for tracing and debugging.
15013
15014         * cs-tokenizer.cs (define): New utility function to track
15015         defines.   Set the global settings for TRACE and DEBUG if found.
15016
15017 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15018
15019         * interface.cs (Populate*): Pass in the TypeContainer as well as
15020         the DeclSpace as parameters so that we can create EmitContexts and
15021         then use that to apply attributes etc.
15022
15023         (PopulateMethod, PopulateEvent, PopulateProperty)
15024         (PopulateIndexer): Apply attributes everywhere.
15025
15026         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15027         etc.
15028
15029         (ApplyAttributes): Update accordingly.
15030
15031         We now apply interface attributes for all members too.
15032
15033 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15034
15035         * class.cs (Indexer.Define); Correctly check if we are explicit
15036         implementation (instead of checking the Name for a ".", we
15037         directly look up if the InterfaceType was specified).
15038
15039         Delay the creation of the PropertyBuilder.
15040
15041         Only create the PropertyBuilder if we are not an explicit
15042         interface implementation.   This means that explicit interface
15043         implementation members do not participate in regular function
15044         lookups, and hence fixes another major ambiguity problem in
15045         overload resolution (that was the visible effect).
15046
15047         (DefineMethod): Return whether we are doing an interface
15048         implementation. 
15049
15050         * typemanager.cs: Temporary hack until we get attributes in
15051         interfaces (Ravi is working on that) and we get IndexerName
15052         support in interfaces.
15053
15054         * interface.cs: Register the indexers as properties.
15055
15056         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15057         warning, I have verified that this is a bug in the .NET runtime
15058         (JavaScript suffers of the same problem).
15059
15060         * typemanager.cs (MemberLookup): When looking up members for
15061         interfaces, the parent of an interface is the implicit
15062         System.Object (so we succeed in searches of Object methods in an
15063         interface method invocation.  Example:  IEnumerable x;  x.ToString
15064         ()) 
15065
15066 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15067
15068         * class.cs (Event): Events should also register if they do
15069         implement the methods that an interface requires.
15070
15071         * typemanager.cs (MemberLookup); use the new GetInterfaces
15072         method. 
15073
15074         (GetInterfaces): The code used to lookup interfaces for a type is
15075         used in more than one place, factor it here. 
15076
15077         * driver.cs: Track the errors at the bottom of the file, we kept
15078         on going.
15079
15080         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15081         instance if the method we are calling is static!
15082
15083 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15084
15085         * attribute.cs (ApplyAttributes): Make this function filter out
15086         the IndexerName attribute (as that attribute in reality is never
15087         applied) and return the string constant for the IndexerName
15088         attribute. 
15089
15090         * class.cs (TypeContainer.Emit): Validate that all the indexers
15091         have the same IndexerName attribute, and if so, set the
15092         DefaultName attribute on the class. 
15093
15094         * typemanager.cs: The return value might contain other stuff (not
15095         only methods).  For instance, consider a method with an "Item"
15096         property and an Item method.
15097
15098         * class.cs: If there is a problem with the parameter types,
15099         return. 
15100
15101 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15102
15103         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15104         looks at user defined conversion after making a call to 
15105         StandardConversionExists - we need this for overload resolution.
15106
15107         * expression.cs : Update accordingly the various method calls.
15108
15109         This fixes 2 bugs filed against implicit user defined conversions 
15110
15111 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15112
15113         * statement.cs: Track the result of the assignment.
15114
15115 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15116
15117         * expression.cs (MemberAccess): Improved error reporting for
15118         inaccessible members.
15119
15120 2002-05-22  Martin Baulig  <martin@gnome.org>
15121
15122         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15123         itself with debugging support.
15124
15125 2002-05-22  Martin Baulig  <martin@gnome.org>
15126
15127         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15128         Removed, this isn't needed anymore.
15129
15130 2002-05-20  Martin Baulig  <martin@gnome.org>
15131
15132         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15133         be underlying type for an enum.
15134
15135 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15136
15137         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15138         that splits out the loading of just the core types.
15139
15140         * rootcontext.cs (ResolveCore): Split the struct resolution in
15141         two, so we can load the enumeration underlying types before any
15142         enums are used.
15143
15144         * expression.cs (Is): Bandaid until we fix properly Switch (see
15145         bug #24985 for details).
15146
15147         * typemanager.cs (ImplementsInterface): The hashtable will contain
15148         a null if there are no interfaces implemented.
15149
15150 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15151
15152         * cs-parser.jay (indexer_declarator): It is fine to have array
15153         parameters
15154
15155 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * typemanager.cs: (RegisterBuilder): New function used to register
15158         TypeBuilders that implement interfaces.  Since
15159         TypeBuilder.GetInterfaces (as usual) does not work with lame
15160         Reflection.Emit. 
15161         (AddUserType): register interfaces.
15162
15163         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15164         dealing with TypeBuilder.  Also, arrays are showing up as
15165         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15166         methods can not be invoked on them!
15167
15168         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15169         (ImplicitReferenceConversionExists): Split out from
15170         StandardConversionExists. 
15171
15172         * expression.cs (As): We were only implementing one of the three
15173         cases for the as operator.  We now implement them all.
15174         (Is): Implement the various other cases for Is as well.
15175
15176         * typemanager.cs (CACHE): New define used to control if we want or
15177         not the FindMembers cache.  Seems to have a negative impact on
15178         performance currently
15179
15180         (MemberLookup): Nested types have full acess to
15181         enclosing type members
15182
15183         Remove code that coped with instance/static returns for events, we
15184         now catch this in RealFindMembers.
15185
15186         (RealFindMembers): only perform static lookup if the instance
15187         lookup did not return a type or an event.  
15188
15189 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15190
15191         * assign.cs (CompoundAssign): We pass more semantic information
15192         now to Compound Assignments than we did before: now we have all
15193         the information at hand, and now we resolve the target *before* we
15194         do the expression expansion, which allows the "CacheValue" method
15195         to have the effect we intended (before, a [x] += 1 would generate
15196         two differen ArrayAccess expressions from the ElementAccess,
15197         during the resolution process).
15198
15199         (CompoundAssign.DoResolve): Resolve target and original_source here.
15200
15201 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15202
15203         * expression.cs (ArrayAccess): dropped debugging information. 
15204
15205         * typemanager.cs: Small bug fix: I was always returning i_members,
15206         instead of one of i_members or s_members (depending on which had
15207         the content).
15208
15209         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15210         method is invoked before any code generation takes place, and it
15211         is a mechanism to inform that the expression will be invoked more
15212         than once, and that the method should use temporary values to
15213         avoid having side effects
15214
15215         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15216
15217         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15218         implementation.
15219
15220         * expression.cs (Indirection, ArrayAccess): Add support for
15221         CacheTemporaries in these two bad boys. 
15222
15223         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15224         ldobj or ldind_ref.  
15225         (StoreFromPtr): Handle stobj as well.
15226
15227         * expression.cs (UnaryMutator): Share more code.
15228
15229         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15230         down: I was not tracking the Filter function as well, which
15231         was affecting the results of the cache.
15232
15233 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15234
15235         * attribute.cs: Remove the hack to handle the CharSet property on
15236         StructLayouts. 
15237
15238 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15239
15240         * attribute.cs (DoResolve): More uglyness, we now only try to
15241         resolve the attribute partially, to extract the CharSet
15242         information (only if we are a StructLayout attribute).  Otherwise 
15243
15244         (GetExtraTypeInfo): Add some code to conditionally kill in the
15245         future this.   I am more and more convinced that the .NET
15246         framework has special code to handle the attribute setting on
15247         certain elements.
15248
15249         * expression.cs (IsParamsMethodApplicable): Revert my previous
15250         foreach change here, it was wrong.
15251
15252 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15253
15254         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15255         (pp_expr): do not abort on unknown input, just return.
15256         (eval): abort if there are pending chars.
15257
15258         * attribute.cs (Attribute.Resolve): Positional parameters are
15259         optional.  Deal with that case.
15260
15261         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15262         the Ansi/Unicode/Auto information for the type.
15263
15264         (TypeContainer.DefineType): instantiate the EmitContext here, as
15265         we will be using it during the type definition (to resolve
15266         attributes) and during the emit phase.
15267
15268         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15269         to pull type information out of the attributes
15270
15271         (Attribute.Resolve): track the constructor builder, and allow for
15272         multiple invocations (structs and classes will use this).
15273
15274         * ecore.cs (MemberLookupFinal): new version with all the
15275         parameters customizable.
15276
15277         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15278         constructors.  Return if the result value is null (as the error
15279         would have been flagged already by MemberLookupFinal)
15280
15281         Do not allow instances of abstract classes or interfaces to be
15282         created.
15283
15284         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15285         We have to compare the assembly property here when dealing with
15286         FamANDAssem and Assembly access modifiers, because we might be
15287         creating an assembly from *modules* (that means that we are not
15288         getting TypeBuilders for types defined in other modules that are
15289         part of this assembly).
15290
15291         (Method.Emit): If the method is marked abstract and has a body,
15292         emit an error. 
15293
15294         (TypeContainer.DefineMembers): If both the defined member and the
15295         parent name match are methods, then do not emit any warnings: let
15296         the Method.Define routine take care of flagging warnings.  But if
15297         there is a mismatch (method overrides something else, or method is
15298         overriwritten by something, then emit warning).
15299
15300         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15301         set to null, this means `do not check for the return type on the
15302         signature'. 
15303
15304         (Method.Define): set the return type for the method signature to
15305         null, so that we get methods with the same name and parameters and
15306         different return types.  This is used to flag warning 114 (you are
15307         hiding a method, and you probably want to use the new/override
15308         keywords instead).
15309
15310         * typemanager.cs (MemberLookup): Implemented proper access
15311         control, closing a long standing set of bug reports.  The problem
15312         was that the Framework only has two bits: Public and NonPublic,
15313         and NonPublic includes private and protected methods, but we need
15314         to enforce the FamANDAssem, FamOrAssem and Family. 
15315
15316 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * statement.cs (GotoCase): Return true: Ammounts to giving up
15319         knowledge on whether we return or not, and letting the other case
15320         be responsible for it.
15321
15322 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * driver.cs: Do not load directories for each file processed, only
15325         do it if there is a pattern.
15326
15327         * ecore.cs: Report readonly assigns here as well, as we might have
15328         been resolved only by MemberAccess.
15329
15330         (SimpleName.SimpleNameResolve): Also be useful for LValue
15331         resolution.   We need this to propagate assign to local readonly variables
15332
15333         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15334         do not want to reuse potential criteria memory.
15335
15336         * class.cs (MyEventBuilder): Set reflected_type;
15337
15338         * ecore.cs (Constantify): Added support for constifying bools.
15339
15340         (RootContext.LookupType): Added a cache for values looked up in
15341         the declaration space.
15342
15343         * typemanager.cs (FindMembers): Now is a front-end to
15344         RealFindMembers, and provides a two-level hashtable-based cache to
15345         the request.  
15346
15347         15% performance improvement: from 22.5 to 19.2 seconds.
15348
15349         * expression.cs (IsParamsMethodApplicable): use foreach.
15350         (Invocation.DoResolve): ditto.
15351         (New.DoResolve): ditto.
15352         (ArrayCreation.DoResolve): ditto.
15353
15354         * ecore.cs (FindMostEncompassingType): use foreach.
15355
15356         * delegate.cs (NewDelegate.DoResolve): Use foreach
15357
15358         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15359         (RemoveMethods): use foreach.
15360
15361         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15362         nested foreach statements instead of for, and also break out of
15363         the inner loop once a match is found.
15364
15365         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15366
15367 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15368
15369         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15370         we actually unwrap the expression to allow for extra information
15371         to be extracted. 
15372
15373         * expression.cs: Use Shr_Un on unsigned operations. 
15374
15375 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15376
15377         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15378         applicable operators was not being considered correctly. This closes
15379         the bug Miguel reported.
15380
15381 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15382
15383         * attribute.cs: check that the type derives from System.Attribute
15384         and report the correct error in that case (moved the duplicate code to
15385         its own method, too).
15386
15387 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15388
15389         * attribute.cs: lookup attribute type name as the spec says: first the
15390         bare attribute name and then name + "Attribute" (nant compiles with
15391         mcs after this fix).
15392
15393 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15394
15395         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15396         Because of the way we parse things, we should try to see if a
15397         UIntConstant can fit in an integer.
15398
15399 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15400
15401         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15402         when we are in an explicit context.
15403
15404         (ConvertReferenceExplicit): When converting from Iface type S to Class
15405         T make sure the rules are implemented as an OR.
15406
15407         * parameter.cs (ParameterType): Make it a property for now although the
15408         purpose really isn't anything immediate.
15409
15410         * expression.cs (Is*Applicable): Do better checking on the parameter type
15411         of a ref/out parameter. The ones from the system assemblies are already 
15412         marked with the correct type so we don't need to do any correction.
15413
15414         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15415         the object type is standard too so include that.
15416
15417 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15418
15419         * ecore.cs (StandardConversionExists): Augment with missing code:
15420         deal with IntConstant, LongConstants and Enumerations.
15421
15422         * assign.cs: Report the error, instead of failing silently
15423
15424         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15425         typecontainer that they are declared, because the
15426         typecontainer/namespace will have the list of using clauses that
15427         need to be applied.
15428
15429         Assembly Attributes were escaping the normal registration
15430         mechanism. 
15431
15432         (EmitCode): Apply attributes within an EmitContext that represents
15433         the container they were declared on.
15434
15435         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15436
15437 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15438
15439         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15440         Revamp completely - make much cleaner as we now operate only
15441         on a set of Types.
15442
15443         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15444         to implement the logic detailed in the spec more correctly.
15445
15446         (UserDefinedConversion): Update accordingly.
15447
15448 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15449
15450         * statement.cs: Return flow analysis information up.
15451
15452         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15453         and the default.
15454
15455         (token): Do not consume an extra character before calling
15456         decimal_digits.
15457
15458 2002-05-06  Piers Haken <piersh@friskit.com>
15459
15460         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15461
15462 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15463
15464         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15465         EmitContext during the instance constructor initializer
15466         resolution, to stop access to instance variables.
15467
15468         This is mandated by the spec, last paragraph of the `constructor
15469         initializers' section. 
15470
15471 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15472
15473         * cs-parser.jay, class.cs (Accessor): new class used to represent
15474         an accessor (get or set).  In the past we used `null' to represent
15475         a missing accessor.  But this is ambiguous because there was no
15476         way to tell in abstract indexers/properties if one of them was
15477         specified.
15478
15479         Now there is a way of addressing that.
15480
15481         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15482         instead of FindMembers.
15483
15484         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15485         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15486
15487         * attribute.cs: Treat indexers and properties as the same in terms
15488         of applying attributes
15489
15490         * ecore.cs (FindMostEncompassedType): Use statically initialized
15491         EmptyExpressions()s like we do elsewhere to avoid creating useless
15492         objects (and we take this out of the tight loop).
15493
15494         (GetConversionOperators): Move the code to extract the actual
15495         operators to a separate routine to clean things up.
15496
15497 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15498
15499         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15500         events are always registered FieldBuilders.
15501
15502         * class.cs (FieldBase): New class shared by Fields 
15503
15504         * delegate.cs: If we are a toplevel delegate, use our full name.
15505         If we are a nested delegate, then only use our tail name.
15506
15507 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15508
15509         * expression.cs (IsApplicable): Ensure that we add the "&" to
15510         ref/out types before comparing it with the type of the argument.
15511
15512         (IsParamsMethodApplicable): Ditto.
15513
15514         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15515         silly me ;-)
15516
15517         * delegate.cs : Handle the case when we have more than one applicable
15518         method. Flag an error only when we finish checking all.
15519
15520 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15521
15522         * expression.cs: Add support for boolean static initializers.
15523
15524 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15525
15526         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15527
15528         * parameter.cs (ComputeParameterTypes,
15529         ComputeAndDefineParameterTypes): Better error handling: now we
15530         clear the `types' cache if we fail during any of the type lookups.
15531         We also return the status code correctly to our caller
15532
15533         * delegate.cs: If we fail to define a delegate, abort the extra
15534         steps. 
15535
15536         * expression.cs (Binary.ResolveOperator): for
15537         operator==(object,object) and operator !=(object, object) we also
15538         have to verify that there is an implicit conversion from one to
15539         the other.
15540
15541         (ArrayAccess.DoResolve): Array Access can operate on
15542         non-variables. 
15543
15544 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * assign.cs (CompoundAssign): A new class used as a "flag" that
15547         the assignment actually is happening as part of a compound
15548         assignment operator.
15549
15550         During compound assignment, a few new rules exist to enable things
15551         like:
15552
15553         byte b |= 1 + 2
15554
15555         From the spec:
15556
15557         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15558         to the type of x) if y is implicitly convertible to the type of x,
15559         and the operator is a builtin operator and the return type of the
15560         operator is explicitly convertible to the type of x. 
15561
15562         * rootcontext.cs: Reset warning level to 2.  4 catches various
15563         "interesting" features in mcs, we must clean this up at some
15564         point, but currently am trying to kill other bugs ;-)
15565
15566         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15567         in container classes as well.  
15568
15569         * expression.cs (Binary.ResolveOperator): Handle string case
15570         before anything else (as operator overloading does emit an error
15571         before doing anything else).
15572
15573         This code could go away when we move to a table driven model, but
15574         i could not come up with a good plan last night.
15575
15576 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15577
15578         * typemanager.cs (CSharpName): reimplementation using regex.
15579         * class.cs: added null check for fields in Emit
15580         * rootcontext.cs: set warninglevel to 4
15581
15582 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * typemanager.cs (CSharpName): reimplemented with Lupus
15585         suggestion.
15586
15587 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15588
15589         * statement.cs (If): correclty implement Resolve, because we were
15590         not catching sem errors in there.  The same process is needed
15591         everywhere else. 
15592         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15593
15594
15595         (Statement.Warning_DeadCodeFound): Factorize code.
15596         (While): Report dead code here too.
15597
15598         (Statement): Added Resolve virtual method to allow
15599         for resolution split from the emit code.
15600
15601 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * statement.cs (EmitBoolExpression): No longer try to resolve the
15604         expression here.    
15605         (MakeBoolean): New utility function that resolve, implicitly
15606         converts to boolean and tags the expression. 
15607
15608
15609         (If, Do): Implement dead code elimination.
15610         (While): Implement loop inversion
15611
15612         (Do, While, For, If): Resolve the expression prior to calling our
15613         code generation.
15614
15615 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15616
15617         * class.cs:
15618           - added method Report28 (warning: program has more than one entry point)
15619           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15620           - modified method Method.Define, the part at the end of the method
15621
15622         * rootcontext.cs: added static public Location EntryPointLocation;
15623           
15624         * ../errors/cs0028.cs : Add test case for the above warning.              
15625
15626         * typemanager.cs:
15627           - modified method CSharpName to allow arrays of primitive type to
15628             be printed nicely (e.g. instead of System.Int32[][] it now prints
15629             int[][])
15630           - added method CSharpSignature: returns the signature of a method
15631             in string format to be used in reporting errors, warnings, etc.
15632
15633         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15634         with String.Empty.
15635
15636 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15637
15638         * delegate.cs (Define): Fix extremely silly bug where I was
15639         setting the type of the 'object' parameter of the BeginInvoke
15640         method to System.IAsyncResult instead of System.Object ;-)
15641
15642 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15643
15644         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15645         here. 
15646
15647         (Constructor.Emit): return if we fail to initialize the
15648         constructor.  Another door closed!  
15649
15650         * expression.cs (New.DoResolve): Improve error message (from -6 to
15651         1501).  Use DeclaredOnly lookup to find the exact constructor.
15652
15653         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15654         loop.  This is useful.
15655
15656         * cs-parser.jay: Adjust the default parameters so that destructors
15657         have the proper signature.
15658
15659 2002-04-26  Martin Baulig  <martin@gnome.org>
15660
15661         * driver.cs (LoadAssembly): If `assembly' contains any characters
15662         which are only valid in path names and not in assembly names
15663         (currently slash, backslash and point), use Assembly.LoadFrom ()
15664         instead of Assembly.Load () on the `assembly' (before iteration
15665         over the link_paths).
15666
15667 2002-04-26  Martin Baulig  <martin@gnome.org>
15668
15669         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15670
15671 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15672
15673         * class.cs (Property): use the new typemanager.MemberLookup
15674
15675         (TypeContainer.MemberLookup): Implement using the
15676         TypeManager.MemberLookup now. 
15677
15678         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15679         and return MemberInfos, so that these can be used without an
15680         EmitContext (what we had before).
15681
15682 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15683
15684         * expression.cs: Fix the case where the argument to params if the
15685         type of the params.  I omitted handling this before.   Fixed
15686
15687 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * driver.cs: Call BootCorlib_PopulateCoreType
15690
15691         * class.cs (Property.CheckBase): Check for properties only, not
15692         for all members. 
15693
15694         * interface.cs: Temporary hack: try/catch around the
15695         CustomAttributeBuilder, because I am getting an exception that I
15696         do not understand.
15697
15698         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15699         types whose definitions are required to be there (attributes are
15700         defined before standard types).
15701
15702         Compute definitions as we boot the various types, as they are used
15703         immediately (value_type class will need object_type, but if we do
15704         not initialize object_type, we will pass a null, which will let
15705         the runtime pick the System.Object from the existing corlib, which
15706         is not what we want).
15707
15708 2002-04-22  Patrik Torstensson <totte@labs2.com>
15709
15710         * cs-tokenizer.cs: fixed a number of trim() issues.
15711
15712 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15713
15714         * expression.cs (Argument.Type): Ensure that we return the correct
15715         type when we have out or ref parameters [in which case we 
15716         append a "&"].
15717
15718 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * class.cs (Property, Indexer): Allow extern modifier in there. 
15721
15722         * typemanager.cs (InitBaseTypes): Initializes object_type and
15723         value_type, since those will be used early on during the bootstrap
15724         process to compile corlib.
15725
15726         (InitCoreTypes): Move code from here to InitBaseTypes.
15727
15728 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15729
15730         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15731         single-dimension arrays as using the ldlen opcode.  
15732
15733         Daniel Lewis discovered this optimization.  
15734
15735         * typemanager.cs: Add signature for System.Array::get_Length
15736
15737 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15738
15739         * statement.cs: report the error when the foreach does not apply to an
15740         array nor a collection.
15741
15742 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15743
15744         * expression.cs: Add implicit conversions to the operator ~.
15745
15746         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15747
15748         * typemanager.cs: Locate the decimal constructor.
15749
15750 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15751
15752         * attribute.cs: use the new property of TypeOf.
15753         * expression.cs: added 'get' property around typearg.
15754
15755         These changes fix a build breaker reported by NickD. Is this the
15756         correct way to fix?  If not, please, revert my changes and make it
15757         work :-).
15758
15759 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15760
15761         * attribute.cs: Add support for typeof in attribute invocations.
15762         I am not sure that this is right though.
15763
15764 2002-04-14  Duncan Mak  <duncan@ximian.com>
15765
15766         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15767         Binary.Operator.Division case.
15768
15769 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15770
15771         * class.cs (DefineType): Ensure that we do a proper check on
15772         attribute types and also register it with the TypeManager.
15773
15774         (TypeContainer.Targets): The default for attribute types is
15775         AttributeTargets.All.
15776
15777         * attribute.cs (ApplyAttributes): Registering the attribute type
15778         is done elsewhere, not when we discover we have a Usage attribute.
15779
15780 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15781
15782         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15783         and get rid of is_delegate parameter.
15784
15785         * everywhere : update.
15786
15787 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15788
15789         * cs-parser.jay (compilation_unit): Revamp completely to use
15790         some new ideas that I got from Rhys' grammar to solve the problems
15791         with assembly level attributes.
15792
15793         (outer_declaration): New grammar production.
15794
15795         (attribute_sections): Add.
15796
15797         (opt_attributes): Base on attribute_sections
15798
15799         (namespace_declaration): Allow opt_attributes to tackle the case
15800         when we have assembly level attributes - we are clever in this
15801         regard now ;-)
15802
15803         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15804         attributes in the non-global context.
15805
15806         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15807         instead of SetGlobalAttributes.
15808
15809         * class.cs, rootcontext.cs : Ensure we define and generate 
15810         attribute types before anything else.
15811
15812         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15813         and flag the new error -20 for the case when the attribute type
15814         does not have valid targets specified. csc does not catch this.
15815
15816         * ../errors/errors.txt : update for error # -20
15817
15818 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15819
15820         * support.cs (InternalParameters.ParameterModifier): Do some null
15821         checking and return sane values.
15822
15823         * class.cs (Method.Define): If we are a PInvoke method, ensure
15824         that we are static and extern. Report error # 601
15825
15826         * ../errors/cs0601.cs : Add test case for the above error.
15827
15828 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15829
15830         * rootcontext.cs (attribute_types): We need to keep type of
15831         all attribute types separately and emit code for them first.
15832
15833         (RegisterAttribute) : Implement.
15834
15835         * class.cs (DefineType): Check if the current Type is a custom
15836         attribute type and register it accordingly.
15837
15838         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15839         adding the first attribute twice and rename to
15840
15841         (SetGlobalAttributes): this.
15842
15843         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15844         lookups.
15845
15846         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15847         if we are processing global arguments. Hmm, I am unsure of this.
15848
15849 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15850
15851         * expression.cs: added static array of strings to avoid calling
15852         Enum.ToString () for Operator in Binary. Significant recover of
15853         performance.
15854
15855 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * class.cs (FindMembers): Allow the Builders of the various
15858         members to be null.  If they are skip them.  This only happens
15859         during the PInvoke declaration.
15860
15861 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15862
15863         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15864         failure, so we do not keep going afterwards.
15865
15866         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15867         wanted to pass `false' as the `is_delegate' argument.  If this is
15868         the case, why not use delegate_type == null to mean `is_delegate =
15869         false' and anything else as is_delegate = true.
15870
15871 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15872
15873         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15874         code for the section, not the beginning of the tests.
15875
15876 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15877
15878         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15879
15880         * expression.cs (Binary): same.  Warn about errors where we have
15881         Enum/Enum in operator + as well.
15882
15883 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15884
15885         * statement.cs:
15886                 - added support for switch(bool)
15887                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15888                 - add TableSwitchEmit() to handle table-based switch statements
15889
15890 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15891
15892         * expression.cs (Invocation.OverloadResolve): Factor out code which
15893         does parameter compatibility checking with arguments so that we can 
15894         re-use the code even from Delegate.VerifyApplicability
15895
15896         (VerifyArgumentsCompat): Move above code here.
15897
15898         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15899         and instead make a call to the above method.
15900
15901 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15902
15903         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15904         We use it to keep track of classes which are attribute types.
15905
15906 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * delegate.cs (Delegate.Define): Correctly define the types in the
15909         presence of fixed and array parameters.
15910
15911         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15912         doing FindMembers.
15913
15914         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15915         include NonPublic after the first iteration.
15916
15917         * class.cs (Indexer.CheckBase): Only check if both parents are
15918         non-null. 
15919
15920         * cs-parser.jay (accessor_body): If empty, set to null.
15921
15922         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15923         same code path here to resolve constants names that we did have in
15924         MemberAccess.DoResolve.  There is too much code duplicated here.
15925
15926 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15927
15928         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15929
15930         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15931         to MakeUnionSet.
15932
15933         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15934         tokens, numbers and strings.
15935
15936         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15937         parenthesis.
15938
15939         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15940         asyncronous parameters and the regular parameters.  
15941
15942         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15943         specify the target directory.
15944
15945         * expression.cs: (This.DoResolve): Simplify
15946         (As.Emit): Optimize, do not generate IsInst if the expression is
15947         always of the given type.
15948
15949         (Is.DoResolve): Bug fix, we were reporting both always/never for
15950         the is expression.
15951
15952         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15953         creating too many unnecessary arrays.
15954
15955 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15956
15957         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15958         fields instead of rolling our own initializer.   Takes care of all
15959         implicit conversions, and drops unnecessary static checks/argument.
15960
15961 2002-03-31  Dick Porter  <dick@ximian.com>
15962
15963         * driver.cs: use the GetDirectories() return values properly, and
15964         use "/" as path separator.
15965
15966 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * expression.cs (Unary): Optimize - - expr into expr.
15969         (Binary): Optimize a + (-b) into a -b.
15970
15971         * codegen.cs (CodeGen): Made all methods static.
15972
15973 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15974
15975         * rootcontext.cs: 
15976
15977         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15978         TypeBuilder property.
15979
15980         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15981         instead. 
15982
15983         * tree.cs: Removed the various RecordXXXX, and replaced with a
15984         single RecordDecl.  Removed all the accessor methods, and just
15985         left a single access point Type 
15986
15987         * enum.cs: Rename DefineEnum to DefineType.
15988
15989         * decl.cs: New abstract method `DefineType' used to unify the
15990         Defines for Enumerations, Interfaces, TypeContainers and
15991         Delegates.
15992
15993         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15994         LookupBaseClasses method that used to live in class.cs and
15995         interface.cs here, and renamed to FindType.
15996
15997         * delegate.cs: Implement DefineType.  Take advantage of the
15998         refactored pattern for locating the parent builder without taking
15999         the parent_builder argument (which we know does not work if we are
16000         nested, and triggering a toplevel definition).
16001
16002 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16005         accessibility of a member has changed during override and report
16006         an error if so.
16007
16008         * class.cs (Method.Define, Property.Define): Only complain on
16009         overrides if the method is private, any other accessibility is
16010         fine (and since we just checked the permission is the same, we are
16011         good to go).
16012
16013         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16014         and elif are processed always.  The other pre-processing
16015         directives are only processed if we are "taking" the path
16016
16017 2002-03-29  Martin Baulig  <martin@gnome.org>
16018
16019         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16020         current location is not Null.
16021
16022         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16023         a separate method so we can profile it.
16024
16025         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16026         `span.Seconds' are just seconds, but no minutes or hours.
16027         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16028
16029 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16030
16031         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16032         Remove the gratuitous set of Final:
16033
16034                                 // If an interface implementation, then we can set Final.
16035                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16036                                     implementing.DeclaringType.IsInterface)
16037                                         flags |= MethodAttributes.Final;
16038
16039         I do not know what I was smoking when I used that.
16040
16041
16042         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16043         step into fixing the name resolution issues for delegates and
16044         unifying the toplevel name resolution.
16045
16046 2002-03-28  Martin Baulig  <martin@gnome.org>
16047
16048         * class.cs (Method.Emit): If we have a symbol writer, call its
16049         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16050         tell it about the current method.
16051
16052         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16053         writer that we're going to emit the first byte of IL code for a new
16054         statement (a new source line).
16055         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16056         EmitContext.Mark() before emitting any code.
16057
16058         * location.cs (SymbolDocument): Return null when we're Null.
16059
16060         * statement.cs (Statement): Moved the `Location loc' variable here.
16061         (Statement.EmitBoolExpression): If we have a symbol writer, call
16062         ec.Mark() before emitting any code to tell it that we're at the
16063         beginning of a new statement.
16064         (StatementExpression): Added `Location' argument to the constructor.
16065         (Block): Added public readonly variable `StartLocation' and public
16066         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16067         (Block): Added constructor which takes a start and end location.
16068         (Block.SetEndLocation): New method. This sets the end location.
16069         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16070         local variables we create.
16071         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16072         each statement and do also mark the begin and end of the block.
16073
16074         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16075         tell it the current lexer.Location, use Location.Null for the end of the
16076         block.
16077         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16078         current block, set its end location using SetEndLocation().
16079         (statement_expression): StatementExpression constructor now takes the
16080         lexer.Location as additional argument.
16081         (for_statement, declare_local_variables): Likewise.
16082         (declare_local_variables): When creating a new implicit block, use the
16083         new Block constructor and pass it the lexer.Location.
16084
16085 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16088         members also on the parent interfaces recursively.
16089
16090 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16091
16092         * report.cs: Use new formats, since Gonzalo finished the missing
16093         bits. 
16094
16095         * expression.cs (Binary.ResolveOperator): added missing operator|
16096         operator& and operator^ for bool/bool.
16097
16098         * cs-parser.jay: CheckDef now takes a Location argument that is
16099         used to report errors more precisly (instead of reporting the end
16100         of a definition, we try to track something which is a lot closer
16101         to the source of the problem).
16102
16103         * cs-tokenizer.cs: Track global token use, so we can properly flag
16104         the use of #define/#undef after the first token has been seen.
16105
16106         Also, rename the reportXXXX to Error_DescriptiveName
16107
16108         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16109         TypeContainer, so that Enum and Interface can use this too.
16110
16111         * class.cs (TypeContainer.LookupInterfaceOrClass,
16112         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16113         `builder' argument.  Typically this was used to pass the parent
16114         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16115         the definition).  
16116
16117         The problem is that a nested class could trigger the definition of
16118         a toplevel class, and the builder would be obviously wrong in that
16119         case. 
16120
16121         So we drop this argument, and we compute dynamically the
16122         TypeBuilder/ModuleBuilder (the correct information was available
16123         to us anyways from DeclSpace.Parent)
16124
16125         * interface.cs (Interface.DefineInterface): Drop builder
16126         parameter cleanup like class.cs
16127
16128         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16129         like class.cs
16130
16131         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16132         values. 
16133
16134         (Try.Emit): Propagate the returns value from the statement.
16135
16136         (Return.Emit): Even if we are leavning 
16137
16138         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16139
16140         * modifiers.cs: Fix the computation of MethodAttributes flags.
16141
16142 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16143
16144         * driver.cs: allow compilation of files that start with '/'.
16145         Add a default case when checking the argument of --target.
16146
16147 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * interface.cs: Implement the same search algorithm for types in
16150         the interface code.
16151
16152         * delegate.cs: Do not allow multiple definition.
16153
16154         * Recovered ChangeLog that got accidentally amputated
16155
16156         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16157
16158         * rootcontext.cs: Load manually enum to allow core classes to
16159         contain enumerations.
16160
16161         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16162         Update to new static methods in TypeManager.
16163
16164         * typemanager.cs (GetMethod, GetConstructor): Use our
16165         implementation of FindMembers to find the members, since during
16166         corlib compilation, the types are TypeBuilders and GetMethod and
16167         GetConstructor do not work.
16168
16169         Make all methods in TypeManager static.
16170
16171         (InitCodeHelpers): Split the functionality from
16172         the InitCodeTypes function.
16173
16174         * driver.cs: Call InitCodeHelpers after we have populated the
16175         types. 
16176
16177         * cs-parser.jay (delegate_declaration): we did not used to compute
16178         the delegate name correctly for void delegates.
16179
16180 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16181
16182         * rootcontext.cs (RootContext): Init the interface_resolve_order
16183         and type_container_resolve_order always.
16184
16185         (ResolveCore, BootstrapCorlib_ResolveClass,
16186         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16187         compiler when compiling with --nostdlib
16188
16189         * class.cs (TypeContainer.DefineType): Check that our parent is
16190         not null.  This test is most important when we are bootstraping
16191         the core types.
16192
16193         * codegen.cs: Split out the symbol writing code.
16194
16195 2002-03-25  Martin Baulig  <martin@gnome.org>
16196
16197         * driver.cs (-g): Made -g an alias for --debug.
16198
16199 2002-03-24  Martin Baulig  <martin@gnome.org>
16200
16201         * codegen.cs (SymbolWriter): New public variable. Returns the
16202         current symbol writer.
16203         (CodeGen): Added `bool want_debugging_support' argument to the
16204          constructor. If true, tell the ModuleBuild that we want debugging
16205         support and ask it for the ISymbolWriter.
16206         (Save): If we have a symbol writer, call it's Close() method after
16207         saving the assembly.
16208
16209         * driver.c (--debug): New command line argument to create a
16210         debugger information file.
16211
16212         * location.cs (SymbolDocument): New public property. Returns an
16213         ISymbolDocumentWriter object for the current source file or null
16214         if we don't have a symbol writer.
16215
16216 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16217
16218         * driver.cs (LoadAssembly): Correctly return when all the paths
16219         have been tried and not before.
16220
16221         * statement.cs (Switch.Emit): return the actual coverage for this
16222         statement (returns/not-returns)
16223
16224         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16225         switch of the statement if we are the last switch section.  That
16226         kills two problems: try/catch problems (we used to emit an empty
16227         nop at the end) and switch statements where all branches would
16228         return. 
16229
16230 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * driver.cs: Add default assemblies (the equivalent to the
16233         Microsoft CSC.RSP file)
16234
16235         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16236         also update tokens_seen and set it to false.
16237
16238         * driver.cs: Implement --recurse for Mike.
16239
16240         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16241         correctly splitting out the paths.
16242
16243 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16244
16245         * interface.cs (Interface.PopulateProperty): Instead of using
16246         `parent' as the declaration space for the set parameters, use
16247         `this' 
16248
16249         * support.cs (InternalParameters): InternalParameters constructor
16250         takes a DeclSpace instead of a TypeContainer.
16251
16252         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16253         types are being initialized, load the address of it before calling
16254         the function.  
16255
16256         (New): Provide a mechanism to disable the generation of local
16257         value type temporaries when the caller will be providing us with
16258         an address to store it.
16259
16260         (ArrayCreation.EmitDynamicInitializers): Use it.
16261
16262 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16263
16264         * expression.cs (Invocation.EmitArguments): Only probe for array
16265         property if there is more than one argument.  Sorry about that.
16266
16267         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16268         empty param arrays.
16269
16270         * class.cs (Method.LabelParameters): Fix incorrect code path that
16271         prevented the `ParamArrayAttribute' from being applied to the
16272         params attribute.
16273
16274 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16275
16276         * support.cs (ReflectionParameters): Correctly compute whether the
16277         last argument is a params array.  Fixes the problem with
16278         string.Split ('a')
16279
16280         * typemanager.cs: Make the assemblies array always be non-null
16281         (empty, but non-null)
16282
16283         * tree.cs (RecordDecl): New function that abstracts the recording
16284         of names.  This reports error 101, and provides a pointer to the
16285         previous declaration.  Fixes a crash in the compiler.
16286
16287         * cs-parser.jay (constructor_declaration): Update to new grammar,
16288         and provide a constructor_body that can be empty.
16289
16290 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * driver.cs: Add support for --resources.
16293
16294         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16295         Make all types for the various array helper methods be integer.
16296
16297         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16298         CheckState to ConvCast.
16299
16300         (ConvCast): Now it takes a `checked' state argument, to avoid
16301         depending on the emit context for the conversion, and just using
16302         the resolve time setting.
16303
16304         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16305         instead of Invocation.EmitArguments.  We do not emit the original
16306         arguments, instead we emit those which have been converted to
16307         unsigned int expressions.
16308
16309         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16310
16311         * codegen.cs: ditto.
16312
16313         * expression.cs (LocalVariableReference): Drop the use of the
16314         Store function that depended on the variable index.
16315
16316         * statement.cs (VariableInfo): Drop the `Idx' property from this
16317         class, as this is not taking into account the indexes for
16318         temporaries tat we generate during the execution, getting the
16319         indexes wrong.
16320
16321         * class.cs: First emit class initializers, then call the parent
16322         constructor. 
16323
16324         * expression.cs (Binary): Fix opcode emision.
16325         (UnaryMutator.EmitCode): Support checked code generation
16326
16327         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16328         matches for events for both the Static and Instance scans,
16329         pointing to the same element.   Fix that.
16330
16331 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16332
16333         * rootcontext.cs (ResolveTree): Always set the
16334         interface_resolve_order, because nested interfaces will be calling
16335         into us.
16336
16337         * class.cs (GetInterfaceOrClass): Track the same resolution
16338         process used by TypeManager.LookupType.  This fixes the nested
16339         type lookups in class declarations (separate path from
16340         LookupType). 
16341
16342         (TypeContainer.DefineType): Also define nested interfaces.
16343         (TypeContainer.RegisterOrder): New public function used to
16344         register the order in which child interfaces need to be closed.
16345
16346         Nested interfaces need to be closed after their parents have been
16347         created. 
16348
16349         * interface.cs (InterfaceAttr): Put all the logic for computing
16350         the interface attribute here. 
16351
16352         (DefineInterface): Register our interface order with the
16353         RootContext or with the TypeContainer depending on the case.
16354
16355 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16356
16357         * cs-parser.jay: rework foreach statement to work with the new
16358         changes to the policy on SimpleNames.
16359
16360         * report.cs: support Stacktrace on warnings as well.
16361
16362         * makefile: drop --unsafe and /unsafe from the compile.
16363
16364 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16365
16366         * ecore.cs (StandardConversionExists): Modify to take an Expression
16367         as the first parameter. Ensure we do null -> reference type conversion
16368         checking.
16369
16370         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16371         temporary Expression objects.
16372
16373 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16374
16375         * interface.cs: workaround bug in method overloading resolution
16376         (there is already a bugzilla bug for it).
16377
16378 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16379
16380         We could also solve this problem by having a separate path for
16381         performing type lookups, instead of DoResolve, we could have a
16382         ResolveType entry point, and only participating pieces of the
16383         production (simplename, deref, array) would implement this. 
16384
16385         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16386         signal SimpleName to only resolve type names and not attempt to
16387         resolve anything else.
16388
16389         * expression.cs (Cast): Set the flag.
16390
16391         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16392
16393         * class.cs: Only report 108 if there is no `new' modifier.
16394
16395         * cs-parser.jay: rework foreach statement to work with the new
16396         changes to the policy on SimpleNames.
16397
16398         * report.cs: support Stacktrace on warnings as well.
16399
16400         * makefile: drop --unsafe and /unsafe from the compile.
16401
16402 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16405         lookups here, instead of doing that at parse time.  This means
16406         that our grammar will not introduce `LocalVariableReferences' as
16407         expressions at this point.  That solves the problem of code like
16408         this:
16409
16410         class X {
16411            static void Main ()
16412            { int X = 1;
16413             { X x = null }}}
16414
16415         This is only half the fix.  The full fix requires parameters to
16416         also be handled in this way.
16417
16418         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16419         makes the use more obvious of the DeclSpace.  The
16420         ec.TypeContainer.TypeBuilder is now only used to pull the
16421         TypeBuilder for it.
16422
16423         My theory is that I can get rid of the TypeBuilder completely from
16424         the EmitContext, and have typecasts where it is used (from
16425         DeclSpace to where it matters).  
16426
16427         The only pending problem is that the code that implements Aliases
16428         is on TypeContainer, and probably should go in DeclSpace.
16429
16430         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16431         lookups here, instead of doing that at parse time.  This means
16432         that our grammar will not introduce `LocalVariableReferences' as
16433         expressions at this point.  That solves the problem of code like
16434         this:
16435
16436         class X {
16437            static void Main ()
16438            { int X = 1;
16439             { X x = null }}}
16440
16441         This is only half the fix.  The full fix requires parameters to
16442         also be handled in this way.
16443
16444         * class.cs (Property.DefineMethod): When implementing an interface
16445         method, set newslot, when implementing an abstract method, do not
16446         set the flag (before we tried never setting it, or always setting
16447         it, which is the difference).
16448         (Indexer.DefineMethod): same.
16449         (Method.DefineMethod): same.
16450
16451         * ecore.cs: Only set the status used flag if we get back a Field.
16452
16453         * attribute.cs: Temporary hack, so Paolo can keep working.
16454
16455 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16456
16457         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16458         the unmanaged type in the case we have a MarshalAs attribute.
16459
16460         (Resolve): Handle the case when we are parsing the special MarshalAs
16461         attribute [we need to store the unmanaged type to use later]
16462
16463         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16464         MarshalAs Attribute.
16465
16466         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16467         on parameters and accordingly set the marshalling info.
16468
16469 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16470
16471         * class.cs: Optimizing slightly by removing redundant code after
16472         we switched to the `NoTypes' return value.
16473         (Property.DefineMethod): use NoTypes here too.
16474
16475         This fixes the bug I introduced in my last batch of changes.
16476
16477 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16478
16479         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16480
16481         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16482         Enums since those are types too. 
16483
16484         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16485
16486         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16487         thanks to a call during the lookup process.
16488
16489 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16490
16491         * statement.cs (Foreach): Lots of work to accomodate a particular
16492         kind of foreach statement that I had not kept in mind.  It is
16493         possible to have foreachs on classes that provide a GetEnumerator
16494         method that return objects that implement the "pattern" for using
16495         a foreach, there is no need to support GetEnumerator
16496         specifically. 
16497
16498         This is needed to compile nant.
16499
16500         * decl.cs: Only report 114 if the member is not `Finalize' and if
16501         the warning level is at least 2.
16502
16503         * class.cs: Moved the compare function from Method to
16504         MethodSignature. 
16505
16506         (MethodSignature.InheritableMemberSignatureCompare): Add new
16507         filter function that is used to extract inheritable methods from a
16508         class. 
16509
16510         (Method.Define): Use the new `inheritable_method_signature_filter'
16511         delegate
16512
16513         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16514         command. 
16515
16516 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16517
16518         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16519
16520         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16521
16522         * expression.cs: Pass location information to
16523         ConvertImplicitStandard. 
16524
16525         * class.cs: Added debugging code to track return values from
16526         interfaces. 
16527
16528 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16529
16530         * expression.cs (Is.DoResolve): If either side of the `is' is an
16531         interface, do not flag the warning.
16532
16533         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16534         for interfaces
16535
16536         * report.cs: Allow for --fatal to be used with --probe.
16537
16538         * typemanager.cs (NoTypes): Move the definition for the empty Type
16539         array here. 
16540
16541         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16542         properties. 
16543         (TypeContainer.DefineProxy): New function used to proxy to parent
16544         implementations when implementing interfaces.
16545         (TypeContainer.ParentImplements): used to lookup if our parent
16546         implements a public function that is required by an interface.
16547         (TypeContainer.VerifyPendingMethods): Hook this up.
16548
16549         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16550         `modules' and `assemblies' arraylists into arrays.  We only grow
16551         these are the very early start up of the program, so this improves
16552         the speedof LookupType (nicely measured).
16553
16554         * expression.cs (MakeByteBlob): Replaced unsafe code with
16555         BitConverter, as suggested by Paolo.
16556
16557         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16558         folding of string concatenation, but if either side is a string,
16559         and the other is not, then return null, and let the runtime use
16560         the concatenation on the string plus the object (using
16561         `Object.ToString'). 
16562
16563 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16564
16565         Constant Folding has been implemented now.
16566
16567         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16568         the error instead on types that are not supported in one's
16569         complement. 
16570
16571         * constant.cs (Constant and all children): New set of functions to
16572         perform implict and explicit conversions.
16573
16574         * ecore.cs (EnumConstant): Implement the new functions to perform
16575         conversion by proxying to the child expression.
16576
16577         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16578         own separate setting that can not be turned off from the command
16579         line using --unchecked or --checked and is only controlled using
16580         the checked/unchecked statements and expressions.  This setting is
16581         used by the constant folder to flag errors.
16582
16583         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16584         ConstantCheckState as well.   
16585
16586         During Resolve, they also have to flag the state, because the
16587         constant folder runs completely in the Resolve phase.
16588
16589         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16590         well.
16591
16592 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * cfold.cs: New file, this file contains the constant folder.
16595
16596         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16597         argument to track whether we are using the resulting address to
16598         load or store a value and provide better error messages. 
16599
16600         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16601         new AddressOf arguments.
16602
16603         * statement.cs (Foreach.EmitCollectionForeach): Update
16604
16605         * expression.cs (Argument.Emit): Call AddressOf with proper
16606         arguments to track usage.
16607
16608         (New.DoEmit): Call AddressOf with new arguments.
16609
16610         (Unary.Emit): Adjust AddressOf call.
16611
16612 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16613
16614         * cs-parser.jay (member_access): Change the case for pre-defined types
16615         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16616         this suggestion.
16617
16618         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16619         a method body.
16620
16621         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16622         essentially like methods and apply attributes like MethodImplOptions to them too.
16623
16624         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16625         not being null.
16626
16627         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16628         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16629         is the DeclSpace.
16630
16631         * Update code everywhere accordingly.
16632
16633         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16634
16635         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16636
16637 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16638
16639         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16640         try performing lookups against those instead of jumping straight into using
16641         the 'using' clauses.
16642
16643         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16644
16645         (LookupType): Perform lookups in implicit parents too.
16646
16647         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16648         sequence as RootContext.LookupType. 
16649
16650         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16651         the various cases of namespace lookups into this method.
16652
16653 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16654
16655         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16656         in positional arguments)
16657
16658         * class.cs (Operator): Update the AllowedModifiers to contain
16659         extern. 
16660
16661         * cs-parser.jay: Update operator declaration to allow for the
16662         operator body to be empty.
16663
16664         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16665         values. 
16666
16667 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * class.cs (Method.Emit): Label parameters.
16670
16671         * driver.cs: Return 1 or 0 as the program exit code.
16672
16673 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16674
16675         * expression.cs: Special case the `null' object when trying to
16676         auto-compute the type, as anything can be explicitly converted to
16677         that. 
16678
16679         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16680         spotting this Paolo.
16681
16682         (Expression.ImplicitNumericConversion): Perform comparissions of
16683         the type using the underlying type in the case of an enumeration
16684         rather than using the enumeration type for the compare.
16685
16686         Cope with the underlying == type case, which is not possible to
16687         catch before. 
16688
16689         (Expression.ConvertNumericExplicit): Perform comparissions of
16690         the type using the underlying type in the case of an enumeration
16691         rather than using the enumeration type for the compare.
16692
16693         * driver.cs: If the user does not supply an extension, assume .exe
16694
16695         * cs-parser.jay (if_statement): Rewrote so that we can track the
16696         location for the if statement.
16697
16698         * expression.cs (Binary.ConstantFold): Only concat strings when
16699         the operation is "+", not everything ;-)
16700
16701         * statement.cs (Statement.EmitBoolExpression): Take a location
16702         argument. 
16703         (If, While, Do): Track location.
16704
16705         * expression.cs (Binary.ResolveOperator): In the object + string
16706         case, I was missing a call to ConvertImplicit
16707
16708 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16709
16710         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16711         Location arguments. Ensure we use RootContext.LookupType to do our work
16712         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16713
16714         * interface.cs (PopulateMethod): Handle the type of the parameter being
16715         null gracefully.
16716
16717         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16718         have a params method with no fixed arguments and a call is made with no
16719         arguments.
16720
16721 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16722
16723         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16724         the verbatim-string-literal
16725
16726         * support.cs (InternalParameters.ParameterModifier): handle null
16727         fixed parameters.
16728         (InternalParameters.ParameterType): ditto.
16729
16730         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16731         duplicating the name of the variable parameter.
16732         (GetParameterByName): Fix bug where we were not looking up array
16733         paramters if they were the only present (thanks Paolo!).
16734         (GetParameterInfo): We only have an empty set of types if both
16735         fixed and array are set to null.
16736         (GetParameterInfo-idx): Handle FixedParameter == null
16737
16738         * cs-parser.jay: Handle the case where there is no catch
16739         statements (missing null test).
16740
16741 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16742
16743         * driver.cs (MainDriver): Be conservative on our command line
16744         handling.
16745
16746         Catch DirectoryNotFoundException when calling GetFiles.
16747
16748         (SplitPathAndPattern): Used to split the input specification into
16749         a path and a pattern that we can feed to Directory.GetFiles.
16750
16751 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16752
16753         * statement.cs (Fixed): Implement the last case of the Fixed
16754         statement (string handling).
16755
16756         * expression.cs (StringPtr): New class used to return a char * to
16757         a string;  Used by the Fixed statement.
16758
16759         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16760
16761         * expression.cs (Binary.ResolveOperator): Remove redundant
16762         MemberLookup pn parent type.
16763         Optimize union call, we do not need a union if the types are the same.
16764         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16765         type.
16766
16767         Specialize the use of MemberLookup everywhere, instead of using
16768         the default settings. 
16769
16770         (StackAlloc): Implement stackalloc keyword.
16771
16772         * cs-parser.jay: Add rule to parse stackalloc.
16773
16774         * driver.cs: Handle /h, /help, /?
16775
16776         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16777         before we supported unsafe code.
16778
16779         * makefile: add --unsafe to the self compilation of mcs.
16780
16781 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16782
16783         * expression.cs (PointerArithmetic): New class that is used to
16784         perform pointer arithmetic.
16785         (Binary.Resolve): Handle pointer arithmetic
16786         Handle pointer comparission.
16787         (ArrayPtr): Utility expression class that is used to take the
16788         address of an array.
16789
16790         (ElementAccess): Implement array access for pointers
16791
16792         * statement.cs (Fixed): Implement fixed statement for arrays, we
16793         are missing one more case before we are done.
16794
16795         * expression.cs (Indirection): Implement EmitAssign and set the
16796         ExprClass to Variable.  This allows pointer dereferences to be
16797         treated as variables, and to have values assigned to them.
16798
16799         * ecore.cs (Expression.StoreFromPtr): New utility function to
16800         store values dereferencing.
16801
16802 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16803
16804         * expression.cs (Binary.ResolveOperator): Ensure that we are
16805         not trying to operate on a void type - this fixes the reported
16806         bug.
16807
16808         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16809         the parent implementation is sealed.
16810
16811         * ../errors/cs0239.cs : Add.
16812
16813         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16814
16815         * typemanager.cs (unverifiable_code_type): Corresponds to 
16816         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16817         which have unsafe code in them.
16818
16819         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16820         unsafe context.
16821
16822 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16823
16824         * cs-tokenizer.cs: Add support for @"litreal strings"
16825
16826         Make tokenizer accept pre-processor directives
16827         on any column (remove the old C-like limitation). 
16828
16829         * rootcontext.cs (EmitCode): Emit any global attributes.
16830         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16831
16832         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16833
16834         * cs-parser.jay: Add support for global attributes.  
16835
16836 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16837
16838         * expression.cs (Indirection): New helper class.  Unary will
16839         create Indirection classes to be able to implement the
16840         IMemoryLocation interface on it.
16841
16842 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16843
16844         * cs-parser.jay (fixed_statement): reference the right statement.
16845
16846         * statement.cs (Fixed.Emit): Finish implementing the fixed
16847         statement for the &x case.
16848
16849 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16850
16851         * class.cs (Property.Define, Method.Define): Remove newslot when
16852         `implementing'.  
16853
16854         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16855         wrong.  NewSlot should only be used if the `new' keyword is present.
16856
16857         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16858         locating our system dir.  Sorry about this.
16859
16860 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * driver.cs (GetSystemDir): Compute correctly the location of our
16863         system assemblies.  I was using the compiler directory instead of
16864         the library directory.
16865
16866 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16867
16868         * expression.cs (BetterFunction): Put back in what Miguel commented out
16869         since it is the correct fix. The problem is elsewhere ;-)
16870
16871         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16872         parameters of the parms method are themselves compatible or not !
16873
16874         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16875         to check that a class implements an interface before saying that an implicit
16876         conversion was allowed. Use ImplementsInterface to do the checking.
16877
16878 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16879
16880         * class.cs (Method.Define): Track whether we are an explicit
16881         implementation or not.  And only call DefineMethodOverride if we
16882         are an explicit implementation.
16883
16884         (Property.DefineMethod): Ditto.
16885
16886 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16887
16888         * expression.cs (BetterFunction): Catch hideous bug which was
16889          preventing us from detecting ambiguous calls due to implicit casts i.e
16890         cs0121.
16891
16892 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16893
16894         * support.cs (Pair): Remove un-needed method.  I figured why I was
16895         getting the error in cs-parser.jay, the variable in a foreach loop
16896         is readonly, and the compiler does not really treat this as a variable.
16897
16898         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16899         instead of EQUALS in grammar.  
16900
16901         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16902
16903         * expression.cs (Unary.DoResolve): Check whether the argument is
16904         managed or not.
16905
16906 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16907
16908         * support.cs: Api for Pair to set a value.  Despite the fact that
16909         the variables are public the MS C# compiler refuses to compile
16910         code that accesses the field if the variable is part of a foreach
16911         statement. 
16912
16913         * statement.cs (Fixed): Begin implementation of the fixed
16914         statement.
16915
16916         (Block.AddVariable): Return the VariableInfo on success and null
16917         on failure instead of true/false. 
16918
16919         * cs-parser.jay (foreach): Catch errors on variables already
16920         defined (we were ignoring this value before) and properly unwind
16921         the block hierarchy
16922
16923         (fixed_statement): grammar for the fixed statement.
16924
16925 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16926
16927         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16928         pointer types to be incretemented.
16929
16930         (SizeOf): Implement.
16931
16932         * cs-parser.jay (pointer_member_access): Implement
16933         expr->IDENTIFIER production.
16934
16935         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16936         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16937         on safe contexts.
16938
16939         (Unary): Implement indirection.
16940
16941         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16942         use in non-unsafe context).
16943
16944         (SimpleName.DoResolve): Check for pointers in field access on safe
16945         contexts. 
16946
16947         (Expression.LoadFromPtr): Factor the load-indirect code in this
16948         function.  This was duplicated in UnboxCast and ParameterReference
16949
16950 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * expression.cs (ComposedCast): report an error if a pointer cast
16953         is used in a safe region.
16954
16955         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16956         pointer type casts in unsafe context.
16957
16958         * codegen.cs (EmitContext): Set up IsUnsafe.
16959
16960         * cs-parser.jay (non_expression_type): Add productions for pointer
16961         casts. 
16962
16963         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16964         code.  We should not use force into static mode if the method is
16965         not virtual.  Fixes bug in MIS
16966
16967         * statement.cs (Do.Emit, While.Emit, For.Emit,
16968         Statement.EmitBoolExpression): Add support to Do and While to
16969         propagate infinite loop as `I do return' semantics.
16970
16971         Improve the For case to also test for boolean constants.
16972
16973         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16974         to the list of attributes we can add.
16975
16976         Remove `EmitContext' argument.
16977
16978         * class.cs (Method.Define): Apply parameter attributes.
16979         (Constructor.Define): Apply parameter attributes.
16980         (MethodCore.LabelParameters): Move here the core of labeling
16981         parameters. 
16982
16983         * support.cs (ReflectionParameters.ParameterModifier,
16984         InternalParameters.ParameterModifier): Use IsByRef on the type and
16985         only return the OUT bit for these parameters instead of in/out/ref
16986         flags.
16987
16988         This is because I miss-understood things.  The ParameterInfo.IsIn
16989         and IsOut represent whether the parameter has the [In] and [Out]
16990         attributes set.  
16991
16992 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16993
16994         * ecore.cs (FieldExpr.Emit): Release temporaries.
16995
16996         * assign.cs (LocalTemporary.Release): new function.
16997
16998         * codegen.cs (EmitContext.GetTemporaryStorage,
16999         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17000         temporary storage.  Now we can "put back" localbuilders when we
17001         are done with them
17002
17003 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17006         need to make a copy of the variable to generate verifiable code.
17007
17008 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * driver.cs: Compute dynamically the system directory.
17011
17012         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17013         Slower, but more generally useful.  Used by the abstract
17014         registering implementation. 
17015
17016         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17017         the rules for the special rule on Type/instances.  First check if
17018         we have the same name, and if so, try that special static path
17019         rather than the instance path.
17020
17021 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17022
17023         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17024         for, while and if.
17025
17026         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17027         Enum, ValueType, Delegate or Array for non-corlib compiles.
17028
17029         * cs-tokenizer.cs: Catch long identifiers (645)
17030
17031         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17032         piece of code.
17033
17034         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17035         fix, we were returning too early, so we were not registering
17036         pending methods from abstract classes.
17037
17038         Do not register pending methods if the class is abstract.
17039
17040         * expression.cs (Conditional.DoResolve): Report circular implicit
17041         conversions when we neecd to compute it for conditional
17042         expressions. 
17043
17044         (Is.DoResolve): If the expression is always of the provided type,
17045         flag warning 183.  If the expression can not ever be of the
17046         provided type flag warning 184.
17047
17048         * class.cs: Catch 169 as well.
17049
17050         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17051         read. 
17052
17053 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17054
17055         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17056
17057 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17058
17059         * interface.cs: (PopulateMethod): Check for pointers being defined
17060         only if the unsafe context is active.
17061         (PopulateProperty): ditto.
17062         (PopulateIndexer): ditto.
17063
17064         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17065         specified.  If pointers are present, make sure that they are
17066         present in an unsafe context.
17067         (Constructor, Constructor.Define): ditto.
17068         (Field, Field.Define): ditto.
17069         (Property, Property.Define): ditto.
17070         (Event, Event.Define): ditto.
17071
17072         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17073         hashtable if there are classes or structs defined.
17074
17075         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17076         code, as the constant resolution moved.
17077
17078         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17079         the metadata, so we can flag error 133. 
17080
17081         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17082         pointer is being declared in an unsafe context.
17083
17084 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * modifiers.cs (Modifiers.Check): Require a Location argument.
17087         Report error 227 for Unsafe use.
17088
17089         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17090
17091         * statement.cs (For.Emit): If the test is null, then report that
17092         we do `return', as we wont reach anything afterwards.
17093
17094         (Switch.SwitchGoverningType): Track the expression that matched
17095         the conversion.
17096
17097         * driver.cs: Allow negative numbers as an error code to flag.
17098
17099         * cs-parser.jay: Handle 1551.
17100
17101         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17102
17103 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * cs-parser.jay: Report 1518 (type declaration can only contain
17106         class, struct, interface, enum or delegate)
17107
17108         (switch_label): Report 1523 (keywords `case' or `default' must
17109         preced code)
17110
17111         (opt_switch_sections): Report 1522 (empty switch)
17112
17113         * driver.cs: Report 1515 (response file specified multiple times)
17114         Report 1516 (Source file specified multiple times).
17115
17116         * expression.cs (Argument.Resolve): Signal 1510
17117
17118         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17119         access not allowed in static code)
17120
17121 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17122
17123         * typemanager.cs (IsPointerType): Utility method which we are going
17124         to need a lot.
17125
17126         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17127         the object type, so we take care of that.
17128
17129         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17130
17131         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17132         added to non-params parameters :-)
17133
17134         * typemanager.cs (CSharpName): Include 'void' type too. 
17135
17136         (void_ptr_type): Include in the set of core types.
17137
17138         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17139         duplicating code.
17140
17141         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17142         an unsafe context.
17143
17144         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17145         completely forgotten about it.
17146
17147 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17148
17149         * cs-parser.jay (pointer_type): Add. This begins our implementation
17150         of parsing rules for unsafe code.
17151
17152         (unsafe_statement): Implement.
17153
17154         (embedded_statement): Modify to include the above.
17155
17156         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17157
17158         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17159         if the current context is an unsafe one.
17160
17161         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17162         are handled differently, we need separate rules for them.
17163
17164         (local_variable_declaration): Update to use local_variable_pointer_type
17165         to allow variable declarations of unmanaged pointer types.
17166
17167         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17168         in unsafe contexts.
17169
17170         * ../errors/cs0214.cs : Add.
17171
17172 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17173
17174         * makefile: remove 'response' file when cleaning.
17175
17176 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17177
17178         * cs-parser.jay: Report 1524.
17179
17180 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17181
17182         * typemanager.cs (RegisterMethod): drop checking if we have
17183         registered this from here
17184
17185 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17186
17187         * class.cs (Method.EmitDestructor): Implement calling our base
17188         destructor. 
17189
17190         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17191         value of InFinally.
17192
17193         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17194         this routine and will wrap the call in a try/catch block.  Deal
17195         with the case.
17196
17197 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17198
17199         * ecore.cs (Expression.MemberLookup): instead of taking a
17200         parameter `same_type' that was used to tell whether we could
17201         access private members we compute our containing type from the
17202         EmitContext.
17203
17204         (FieldExpr): Added partial support for volatile fields.  This does
17205         not work for volatile fields exposed from assemblies, as I can not
17206         figure out how to extract the modreq from it.
17207
17208         Updated all the source files to use this.
17209
17210         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17211         because it is referenced by MemberLookup very often. 
17212
17213 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17214
17215         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17216         TypeBuilder.GetCustomAttributes to retrieve what we need.
17217
17218         Get rid of redundant default_member_attr_type as this is the same as
17219         default_member_type which already exists.
17220
17221         * interface.cs, attribute.cs : Update accordingly.
17222
17223 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17224
17225         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17226         work for TYpeBuilders though.  Ravi, can you please fix this?
17227
17228         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17229
17230         * expression.cs (Argument.Emit): Handle the case of ref objects
17231         being passed to ref functions;  
17232
17233         (ParameterReference.EmitLoad): Loads the content of the pointer
17234         without dereferencing.
17235
17236 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17239
17240 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17241
17242         * class.cs (Indexer.DefineMethod): Incorporate the interface
17243         type in the name of the method if we are doing explicit interface
17244         implementation.
17245
17246         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17247
17248         (BetterConversion): Fix extremely trivial bug where we were referring to
17249         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17250         again !
17251
17252         * ../errors/bug16.cs : Add although we have fixed it.
17253
17254 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17255
17256         * expression.cs (BaseIndexer): Begin implementation.
17257
17258         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17259
17260         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17261         production directly to remove a shift/reduce, and implement
17262         explicit interface implementation.
17263
17264         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17265         after a floating point suffix.
17266
17267         * expression.cs (DoNumericPromotions): Improved the conversion for
17268         uint/uint.  If we have a constant, we avoid doing a typecast to a
17269         larger type.
17270
17271         * class.cs (Indexer): Implement explicit interface implementation
17272         for indexers.
17273
17274 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17275
17276         * class.cs: make the default instance constructor public and hidebysig.
17277
17278 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17279
17280         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17281         so we can call it from elsewhere.
17282
17283         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17284         we emit it internally if the class has a defined indexer; otherwise the user
17285         emits it by decorating the class definition with the DefaultMemberAttribute.
17286
17287         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17288         attribute is not used on a type which defines an indexer.
17289
17290         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17291         character when we skip whitespace.
17292
17293         * ../errors/cs0646.cs : Add.
17294
17295 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17296
17297         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17298         again. 
17299
17300         * makefile: Add practical target `mcs3.exe' which builds the third
17301         generation compiler. 
17302
17303         * expression.cs (New): Fix structures constructor calling.
17304
17305         * class.cs (Property, Method, Indexer): Emit Final flag on the
17306         method if we are an interface implementation and we are not
17307         abstract. 
17308
17309         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17310         whether this property is referencing a `base' method.
17311
17312         * expression.cs (Invocation.EmitCall): take an extra argument:
17313         is_base, this is used to determine whether the `call' or
17314         `callvirt' opcode should be used.
17315
17316
17317         * delegate.cs: update EmitCall.
17318
17319         * class.cs (Method.Define): Set NewSlot for the cases where we are
17320         not implementing an interface method.
17321
17322         (Property.Define): ditto.
17323
17324 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17325
17326         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17327         'r'.  Allows mcs to parse itself fully.
17328
17329 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17330
17331         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17332         of the number of initializers that require the InitializeArray method.
17333
17334         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17335         update the above field where necessary.
17336
17337         (MakeByteBlob): Update accordingly.
17338
17339         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17340         greater than 2.
17341
17342         (EmitDynamicInitializers): Update in accordance with the new optimization.
17343
17344         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17345         same OpCode applies.
17346
17347         * cs-parser.jay : Fix some glaring errors I introduced.
17348
17349 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17350
17351         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17352         so that we can check for name clashes there too.
17353
17354         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17355         for interface indexers.
17356
17357         * interfaces.cs (Define): Emit the default member attribute.
17358
17359         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17360         variable was being referred to while setting the value ;-)
17361
17362 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17363
17364         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17365         byte-by-byte information when we know the data is zero.
17366
17367         Make the block always a multiple of 4, because
17368         DefineInitializedData has a bug.
17369
17370         * assign.cs: Fix, we should assign from the temporary, not from
17371         the source. 
17372
17373         * expression.cs (MakeByteBlob): Fix my incorrect code.
17374
17375 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17376
17377         * typemanager.cs (EnumToUnderlying): This function is used to get
17378         the underlying type from an enumeration, because it does not
17379         always work. 
17380
17381         * constant.cs: Use the I4_S form for values between -128 and 127.
17382
17383         * statement.cs (Block.LookupLabel): Looks up a label.
17384         (Block): Drop support for labeled blocks.
17385
17386         (LabeledStatement): New kind of statement that represents a label
17387         only.
17388
17389         (Goto): Finally implement this bad boy.
17390
17391         * cs-parser.jay: Update to reflect new mechanism to implement
17392         labels.
17393
17394 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * codegen.cs (EmitContext.This): a codegen property that keeps the
17397         a single instance of this instead of creating many different this
17398         instances. 
17399
17400         * delegate.cs (Delegate.DoResolve): Update to use the property;
17401
17402         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17403
17404         * expression.cs (BaseAccess.DoResolve): Ditto.
17405
17406 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17407
17408         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17409         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17410
17411         (InitCoreTypes): Update accordingly.
17412
17413         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17414         so we can quickly store the state.
17415
17416         (ApplyAttributes): Set the correct implementation flags
17417         for InternalCall methods.
17418
17419 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * expression.cs (EmitCall): if a method is not virtual, then do
17422         not use callvirt on it.
17423
17424         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17425         user defined stuff) requires the use of stobj, which takes an
17426         address on the stack instead of an array and an index.  So emit
17427         the Ldelema operation for it.
17428
17429         (EmitStoreOpcode): Use stobj for valuetypes.
17430
17431         (UnaryMutator.EmitCode): Use the right 1 value depending on
17432         whether we are dealing with int64/uint64, float or doubles.
17433
17434         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17435         constructors that I implemented last night.
17436
17437         (Constructor.IsDefault): Fix to work properly for static
17438         constructors.
17439
17440         * cs-parser.jay (CheckDef): report method signature errors.
17441         Update error number 103 to be 132.
17442
17443         * decl.cs: New AdditionResult enumeration value: MethodExists.
17444         Although we do this check for methods later on in the semantic
17445         analysis, catching repeated default constructors is so easy that
17446         we catch these here. 
17447
17448         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17449         promotions code.
17450
17451         (ParameterReference.EmitAssign, Emit): handle
17452         bools as bytes.
17453
17454         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17455         (ArrayAccess.EmitStoreOpcode): ditto.
17456
17457         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17458
17459         * expression.cs (MakeByteBlob): Complete all the missing types
17460         (uint, short, ushort, byte, sbyte)
17461
17462         * class.cs: Only init instance field initializers on instance
17463         constructors. 
17464
17465         Rename `constructors' to instance_constructors. 
17466
17467         (TypeContainer.AddConstructor): Only add constructors to the list
17468         if it is not static.
17469
17470         Make sure that we handle default_static_constructor independently
17471         everywhere where we handle instance_constructors
17472
17473 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * class.cs: Do not lookup or create a base initializer for a
17476         static constructor.
17477
17478         (ConstructorInitializer.Resolve): use the proper type to lookup
17479         for constructors.
17480
17481         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17482
17483         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17484         in DeclSpace. 
17485
17486         * decl.cs: CloseType is now an virtual method, the default
17487         implementation just closes this type.
17488
17489 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17490
17491         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17492         to PreserveSig by default. Also emit HideBySig on such methods.
17493
17494         Basically, set the defaults to standard values.
17495
17496         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17497         argument, if candidate is better, it can't be worse than the best !
17498
17499         (Invocation): Re-write bits to differentiate between methods being
17500         applicable in their expanded form and their normal form - for params
17501         methods of course.
17502
17503         Get rid of use_standard everywhere as only standard conversions are allowed
17504         in overload resolution. 
17505
17506         More spec conformance.
17507
17508 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17509
17510         * driver.cs: Add --timestamp, to see where the compiler spends
17511         most of its time.
17512
17513         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17514         `this' in static code.
17515
17516         (SimpleName.DoResolve): Implement in terms of a helper function
17517         that allows static-references to be passed upstream to
17518         MemberAccess.
17519
17520         (Expression.ResolveWithSimpleName): Resolve specially simple
17521         names when called by MemberAccess to implement the special
17522         semantics. 
17523
17524         (Expression.ImplicitReferenceConversion): Handle conversions from
17525         Null to reference types before others, as Null's type is
17526         System.Object. 
17527
17528         * expression.cs (Invocation.EmitCall): Handle the special case of
17529         calling methods declared on a reference type from a ValueType
17530         (Base classes System.Object and System.Enum)
17531
17532         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17533         the left hand side is a TypeExpr, not on every enumeration. 
17534
17535         (Binary.Resolve): If types are reference types, then do a cast to
17536         object on operators != and == of both arguments.
17537
17538         * typemanager.cs (FindMembers): Extract instance and static
17539         members if requested.
17540
17541         * interface.cs (PopulateProperty): Use void_type instead of null
17542         as the return type for the setter method.
17543
17544         (PopulateIndexer): ditto.
17545
17546 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17547
17548         * support.cs (ReflectionParameters): Fix minor bug where we
17549         were examining the wrong parameter for the ParamArray attribute.
17550
17551         Cope with requests for the type of the parameter at position
17552         greater than the params parameter's. We now return the element
17553         type of the params array as that makes more sense.
17554
17555         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17556         accordingly as we no longer have to extract the element type
17557         ourselves.
17558
17559         (Invocation.OverloadResolve): Update.
17560
17561 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17562
17563         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17564         against IEnumerator, test whether the return value is a descendant
17565         of the IEnumerator interface.
17566
17567         * class.cs (Indexer.Define): Use an auxiliary method to implement
17568         the other bits of the method definition.  Begin support for
17569         explicit interface implementation.
17570
17571         (Property.DefineMethod): Use TypeManager.void_type instead of null
17572         for an empty return value.
17573
17574 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17575
17576         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17577         dealing with a FieldExpr which is composed of a FieldBuilder, in
17578         the code path we did extract the constant, but we should have
17579         obtained the underlying value to be able to cast it (otherwise we
17580         end up in an infinite loop, this is what Ravi was running into).
17581
17582         (ArrayCreation.UpdateIndices): Arrays might be empty.
17583
17584         (MemberAccess.ResolveMemberAccess): Add support for section
17585         14.5.4.1 that deals with the special case of E.I when E is a type
17586         and something else, that I can be a reference to a static member.
17587
17588         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17589         handle a particular array type to create byte blobs, it is just
17590         something we dont generate byteblobs for.
17591
17592         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17593         arguments. 
17594
17595         * location.cs (Push): remove the key from the hashtable that we
17596         are about to add.   This happens for empty files.
17597
17598         * driver.cs: Dispose files after we have parsed them.
17599
17600         (tokenize): new function that only runs the tokenizer on its
17601         input, for speed testing.
17602
17603 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17604
17605         * class.cs (Event.Define): Define the private field only if there
17606         are no accessors defined.
17607
17608         * expression.cs (ResolveMemberAccess): If there is no associated
17609         field with the event, that means we have an event defined with its
17610         own accessors and we should flag error cs0070 since transforming
17611         ourselves into a field is not valid in that case.
17612
17613         * ecore.cs (SimpleName.DoResolve): Same as above.
17614
17615         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17616         and charset to sane values.
17617
17618 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17619
17620         * assign.cs (DoResolve): Perform check on events only if they 
17621         are being accessed outside the declaring type.
17622
17623         * cs-parser.jay (event_declarations): Update rules to correctly
17624         set the type of the implicit parameter etc.
17625
17626         (add_accessor, remove_accessor): Set current local parameters.
17627
17628         * expression.cs (Binary): For delegate addition and subtraction,
17629         cast the return value from the method into the appropriate delegate
17630         type.
17631
17632 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17633
17634         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17635         of these as the workaround is unnecessary.
17636
17637         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17638         delegate data - none of that is needed at all.
17639
17640         Re-write bits to extract the instance expression and the delegate method
17641         correctly.
17642
17643         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17644         on delegates too.
17645
17646         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17647         of attaching attributes instead of duplicating code everywhere.
17648
17649         * everywhere : Update code to do attribute emission using the above method.
17650
17651 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17652
17653         * expression.cs (IsParamsMethodApplicable): if there are not
17654         parameters, return immediately.
17655
17656         * ecore.cs: The 0 literal can be implicity converted to an enum
17657         type. 
17658
17659         (SimpleName.DoResolve): First lookup the type, then lookup the
17660         members. 
17661
17662         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17663         want to get its address.  If the InstanceExpression is not
17664         addressable, store the result in a temporary variable, then get
17665         the address of it.
17666
17667         * codegen.cs: Only display 219 errors on warning level or above. 
17668
17669         * expression.cs (ArrayAccess): Make it implement the
17670         IMemoryLocation interface.
17671
17672         (Binary.DoResolve): handle the operator == (object a, object b)
17673         and operator != (object a, object b) without incurring into a
17674         BoxedCast (because 5 != o should never be performed).
17675
17676         Handle binary enumerator operators.
17677
17678         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17679         value type, otherwise use Ldelem_ref.
17680
17681         Use precomputed names;
17682
17683         (AddressOf): Implement address of
17684
17685         * cs-parser.jay (labeled_statement): Fix recursive block
17686         addition by reworking the production.
17687
17688         * expression.cs (New.DoEmit): New has a special case:
17689                 
17690                  If we are dealing with a ValueType, we have a few
17691                  situations to deal with:
17692                 
17693                     * The target of New is a ValueType variable, that is
17694                       easy, we just pass this as the variable reference
17695                 
17696                     * The target of New is being passed as an argument,
17697                       to a boxing operation or a function that takes a
17698                       ValueType.
17699                 
17700                       In this case, we need to create a temporary variable
17701                       that is the argument of New.
17702
17703
17704 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17705
17706         * rootcontext.cs (LookupType): Check that current_type is not null before
17707         going about looking at nested types.
17708
17709         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17710         not implement the IAssignMethod interface any more.
17711
17712         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17713         where we tranform them into FieldExprs if they are being resolved from within
17714         the declaring type.
17715
17716         * ecore.cs (SimpleName.DoResolve): Do the same here.
17717
17718         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17719
17720         * ../errors/bug10.cs : Add.
17721
17722         * ../errors/cs0070.cs : Add.
17723
17724         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17725
17726         * assign.cs : Get rid of EventIsLocal everywhere.
17727
17728 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17729
17730         * ecore.cs (ConvertIntLiteral): finished the implementation.
17731
17732         * statement.cs (SwitchLabel): Convert the value we are using as a
17733         key before looking up the table.
17734
17735 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17736
17737         * codegen.cs (EmitTopBlock): Require a Location argument now.
17738
17739         * cs-parser.jay (constructor_declarator): We need to setup
17740         current_local_parameters before we parse the
17741         opt_constructor_initializer, to allow the variables to be bound
17742         to the constructor arguments.
17743
17744         * rootcontext.cs (LookupType): First lookup nested classes in our
17745         class and our parents before we go looking outside our class.
17746
17747         * expression.cs (ConstantFold): Extract/debox the values at the
17748         beginnning. 
17749
17750         * rootcontext.cs (EmitCode): Resolve the constants first before we
17751         resolve the types.  This is not really needed, but it helps debugging.
17752
17753         * statement.cs: report location.
17754
17755         * cs-parser.jay: pass location to throw statement.
17756
17757         * driver.cs: Small bug fix.
17758
17759         * report.cs: Updated format to be 4-zero filled digits.
17760
17761 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17762
17763         * expression.cs (CheckIndices): Fix minor bug where the wrong
17764         variable was being referred to ;-)
17765
17766         (DoEmit): Do not call EmitStaticInitializers when the 
17767         underlying type is System.Object.
17768
17769 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17770
17771         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17772         and do the usual workaround for SRE.
17773
17774         * class.cs (MyEventBuilder.EventType): New member to get at the type
17775         of the event, quickly.
17776
17777         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17778
17779         * assign.cs (Assign.DoResolve): Handle the case when the target
17780         is an EventExpr and perform the necessary checks.
17781
17782         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17783         interface.
17784
17785         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17786
17787         (EventExpr): Set the type in the constructor itself since we 
17788         are meant to be born fully resolved.
17789
17790         (EventExpr.Define): Revert code I wrote earlier.
17791                 
17792         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17793         instance expression is null. The instance expression is a This in that case
17794         or a null, depending on whether it is a static method or not.
17795
17796         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17797         refers to more than one method.
17798
17799         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17800         and accordingly flag errors.
17801
17802 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17805
17806 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * location.cs (ToString): Provide useful rutine.
17809
17810 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17811
17812         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17813         objects, return the actual integral boxed.
17814
17815         * statement.cs (SwitchLabel): define an ILLabel for each
17816         SwitchLabel. 
17817
17818         (Switch.CheckSwitch): If the value is a Literal, extract
17819         the underlying literal.
17820
17821         Also in the unused hashtable we had, add the SwitchLabel so we can
17822         quickly look this value up.
17823
17824         * constant.cs: Implement a bunch of new constants.  Rewrite
17825         Literal based on this.  Made changes everywhere to adapt to this.
17826
17827         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17828         dereferencing array only once, and also copes with enumrations.
17829
17830         bytes are two bytes wide, not one.
17831
17832         (Cast): Perform constant conversions.
17833
17834         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17835         wrappers to the literals here.
17836
17837         * expression.cs (DoNumericPromotions): long literals can converted
17838         to ulong implicity (this is taken care of elsewhere, but I was
17839         missing this spot).
17840
17841         * ecore.cs (Expression.Literalize): Make the return type Literal,
17842         to improve type checking.
17843
17844         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17845
17846 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17847
17848         * literal.cs: Revert code from ravi that checked the bounds.  The
17849         bounds are sane by the definition of the type itself. 
17850
17851         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17852         need to actually look up in our parent hierarchy for interfaces
17853         implemented. 
17854
17855         * const.cs: Use the underlying type for enumerations
17856
17857         * delegate.cs: Compute the basename for the delegate creation,
17858         that should fix the delegate test case, and restore the correct
17859         Type Lookup semantics in rootcontext
17860
17861         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17862         referencing a nested type with the Reflection API is using the "+"
17863         sign. 
17864
17865         * cs-parser.jay: Do not require EOF token at the end.
17866
17867 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17868
17869         * rootcontext.cs (LookupType): Concatenate type names with
17870         a '.' instead of a '+' The test suite passes again.
17871
17872         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17873         field of the enumeration.
17874
17875         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17876         the case when the member is an EventExpr.
17877
17878         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17879         static has an associated instance expression.
17880
17881         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17882
17883         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17884
17885         * class.cs (Event.Define): Register event and perform appropriate checks
17886         for error #111.
17887
17888         We define the Add and Remove methods even if the use provides none because
17889         in that case, we provide default implementations ourselves.
17890
17891         Define a private field of the type of the event. This is done by the CSC compiler
17892         and we should be doing it too ;-)
17893
17894         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17895         More methods we use in code we generate.
17896
17897         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17898         is important.
17899
17900         (InitCoreTypes): Update accordingly for the above.
17901
17902         * class.cs (Event.Emit): Generate code for default accessors that we provide
17903
17904         (EmitDefaultMethod): Do the job in the above.
17905
17906         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17907         appropriate place.
17908
17909 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17910
17911         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17912         builders even if we were missing one.
17913
17914         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17915         pass the Basename as our class name instead of the Name.  The
17916         basename will be correctly composed for us.
17917
17918         * parameter.cs (Paramters): Now takes a Location argument.
17919
17920         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17921         make all the code call directly LookupType in RootContext and take
17922         this chance to pass the Location information everywhere.
17923
17924         * Everywhere: pass Location information.
17925
17926 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17927
17928         * class.cs (Constructor.Define): Updated way of detecting the
17929         length of the parameters.
17930
17931         (TypeContainer.DefineType): Use basename as the type name for
17932         nested types.
17933
17934         (TypeContainer.Define): Do not recursively define types here, as
17935         definition is taken care in order by the RootContext.
17936
17937         * tree.cs: Keep track of namespaces in a per-file basis.
17938
17939         * parameter.cs (Parameter.ComputeSignature): Update to use
17940         DeclSpace. 
17941
17942         (Parameters.GetSignature): ditto.
17943
17944         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17945         instead of a TypeContainer.
17946
17947         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17948         resolve names.  Because we need to be resolve in our context, not
17949         our parents.
17950
17951         * driver.cs: Implement response files.
17952
17953         * class.cs (TypeContainer.DefineType): If we are defined, do not
17954         redefine ourselves.
17955
17956         (Event.Emit): Emit the code for add/remove handlers.
17957         (Event.Define): Save the MethodBuilders for add/remove.
17958
17959         * typemanager.cs: Use pair here too.
17960
17961         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17962         DictionaryEntry requires the first argument to be non-null.  
17963
17964         (enum_declaration): Compute full name for registering the
17965         enumeration.
17966
17967         (delegate_declaration): Instead of using
17968         formal_parameter_list, use opt_formal_parameter_list as the list
17969         can be empty.
17970
17971         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17972         (EventParsing): New property that controls whether `add' and
17973         `remove' are returned as tokens or identifiers (for events);
17974
17975 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17976
17977         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17978         use MyEventBuilder only and let it wrap the real builder for us.
17979
17980         (MyEventBuilder): Revamp constructor etc.
17981
17982         Implement all operations that we perform on EventBuilder in precisely the same
17983         way here too.
17984
17985         (FindMembers): Update to use the EventBuilder member.
17986
17987         (Event.Emit): Update accordingly.
17988
17989 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17990
17991         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17992         by calling the appropriate methods.
17993
17994         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17995         useful.
17996
17997         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17998
17999 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18000
18001         * delegate.cs (Delegate.Populate): Check that the return type
18002         and various parameters types are indeed accessible.
18003
18004         * class.cs (Constructor.Define): Same here.
18005
18006         (Field.Define): Ditto.
18007
18008         (Event.Define): Ditto.
18009
18010         (Operator.Define): Check that the underlying Method defined itself
18011         correctly - so it's MethodBuilder should not be null.
18012
18013         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18014         expression happens to be null.
18015
18016         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18017         members but as of now we don't seem to be able to do anything really useful with it.
18018
18019         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18020         not the EventBuilder.
18021
18022 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18023
18024         * cs-tokenizer.cs: Add support for defines.
18025         Add support for #if, #elif, #else, #endif
18026
18027         (eval_var): evaluates a variable.
18028         (eval): stubbed for evaluating functions.
18029
18030         * cs-parser.jay: Pass the defines information
18031
18032         * driver.cs: Add --define command line option.
18033
18034         * decl.cs: Move MemberCore here.
18035
18036         Make it the base class for DeclSpace.  This allows us to catch and
18037         report 108 and 109 for everything now.
18038
18039         * class.cs (TypeContainer.Define): Extract all the members
18040         before populating and emit the warning 108 (new keyword required
18041         to override) instead of having each member implement this.
18042
18043         (MemberCore.Define): New abstract method, we will be using this in
18044         the warning reporting engine in Populate.
18045
18046         (Operator.Define): Adjust to new MemberCore protocol. 
18047
18048         * const.cs (Const): This does not derive from Expression, it is a
18049         temporary object we use to create fields, it is a MemberCore. 
18050
18051         * class.cs (Method.Define): Allow the entry point to be in a
18052         specific class.
18053
18054         * driver.cs: Rewrite the argument handler to clean it up a bit.
18055
18056         * rootcontext.cs: Made it just an auxiliary namespace feature by
18057         making everything static.
18058
18059         * driver.cs: Adapt code to use RootContext type name instead of
18060         instance variable.
18061
18062         * delegate.cs: Remove RootContext argument.
18063
18064         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18065         argument. 
18066
18067         * class.cs (Event.Define): The lookup can fail.
18068
18069         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18070
18071         * expression.cs: Resolve the this instance before invoking the code.
18072
18073 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18074
18075         * cs-parser.jay: Add a production in element_access that allows
18076         the thing to become a "type" reference.  This way we can parse
18077         things like "(string [])" as a type.
18078
18079         Note that this still does not handle the more complex rules of
18080         casts. 
18081
18082
18083         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18084
18085         * ecore.cs: (CopyNewMethods): new utility function used to
18086         assemble the list of methods from running FindMembers.
18087
18088         (MemberLookup): Rework FindMembers so that 
18089
18090 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18091
18092         * class.cs (TypeContainer): Remove Delegates who fail to be
18093         defined.
18094
18095         * delegate.cs (Populate): Verify that we dont get null return
18096         values.   TODO: Check for AsAccessible.
18097
18098         * cs-parser.jay: Use basename to emit error 574 (destructor should
18099         have the same name as container class), not the full name.
18100
18101         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18102         possible representation.  
18103
18104         Also implements integer type suffixes U and L.
18105
18106 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18107
18108         * expression.cs (ArrayCreation.DoResolve): We need to do the
18109         argument resolution *always*.
18110
18111         * decl.cs: Make this hold the namespace.  Hold the root context as
18112         well.
18113         (LookupType): Move here.
18114
18115         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18116
18117         * location.cs (Row, Name): Fixed the code, it was always returning
18118         references to the first file.
18119
18120         * interface.cs: Register properties defined through interfaces.
18121
18122         * driver.cs: Add support for globbing on the command line
18123
18124         * class.cs (Field): Make it derive from MemberCore as well.
18125         (Event): ditto.
18126
18127 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18128
18129         * class.cs (Event::Define): Check that the type of the event is a delegate
18130         type else flag error #66.
18131
18132         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18133         same.
18134
18135         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18136         values of EntryPoint, CharSet etc etc.
18137
18138         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18139
18140         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18141         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18142         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18143         which needs this to do its work.
18144
18145         * ../errors/cs0066.cs : Add.
18146
18147 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18148
18149         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18150         helper functions.
18151
18152         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18153         clears out the parameters field.
18154         (MemberSignatureCompare): Cleanup
18155
18156         (MemberCore): New base class used to share code between MethodCore
18157         and Property.
18158
18159         (RegisterRequiredImplementations) BindingFlags.Public requires
18160         either BindingFlags.Instace or Static.  Use instance here.
18161
18162         (Property): Refactored code to cope better with the full spec.
18163
18164         * parameter.cs (GetParameterInfo): Return an empty array instead
18165         of null on error.
18166
18167         * class.cs (Property): Abstract or extern properties have no bodies.
18168
18169         * parameter.cs (GetParameterInfo): return a zero-sized array.
18170
18171         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18172         method modifier validation to the typecontainer so we can reuse
18173         this on properties.
18174
18175         (MethodCore.ParameterTypes): return an empty sized array of types.
18176
18177         (Property.Define): Test property modifier validity.
18178
18179         Add tests for sealed/override too.
18180
18181         (Method.Emit): abstract or extern methods have no bodies.
18182
18183 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18184
18185         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18186         thing.
18187
18188         (Method::Define, ::Emit): Modify accordingly.
18189
18190         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18191
18192         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18193
18194         * makefile: Pass in /unsafe.
18195
18196 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18197
18198         * class.cs (MakeKey): Kill routine.
18199
18200         * class.cs (TypeContainer.Define): Correctly define explicit
18201         method implementations (they require the full interface name plus
18202         the method name).
18203
18204         * typemanager.cs: Deply the PtrHashtable here and stop using the
18205         lame keys.  Things work so much better.
18206
18207         This of course broke everyone who depended on `RegisterMethod' to
18208         do the `test for existance' test.  This has to be done elsewhere.
18209
18210         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18211         the object stupid Equals method (because, that like fails all over
18212         the place).  We still do not use it.
18213
18214         * class.cs (TypeContainer.SetRequiredInterface,
18215         TypeContainer.RequireMethods): Killed these two routines and moved
18216         all the functionality to RegisterRequiredImplementations.
18217
18218         (TypeContainer.RegisterRequiredImplementations): This routine now
18219         registers all the implementations required in an array for the
18220         interfaces and abstract methods.  We use an array of structures
18221         which can be computed ahead of time to reduce memory usage and we
18222         also assume that lookups are cheap as most classes will not
18223         implement too many interfaces.
18224
18225         We also avoid creating too many MethodSignatures.
18226
18227         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18228         clear the "pending" bit if we find that there are problems with
18229         the declaration.
18230
18231         (TypeContainer.VerifyPendingMethods): Update to report errors of
18232         methods that look like implementations but are not.
18233
18234         (TypeContainer.Define): Add support for explicit interface method
18235         implementation. 
18236
18237 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * typemanager.cs: Keep track of the parameters here instead of
18240         being a feature of the TypeContainer.
18241
18242         * class.cs: Drop the registration of parameters here, as
18243         InterfaceMethods are also interface declarations.
18244
18245         * delegate.cs: Register methods with the TypeManager not only with
18246         the TypeContainer.  This code was buggy.
18247
18248         * interface.cs: Full registation here.
18249
18250 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * expression.cs: Remove reducer for binary expressions, it can not
18253         be done this way.
18254
18255         * const.cs: Put here the code that used to go into constant.cs
18256
18257         * constant.cs: Put here the code for constants, this is a new base
18258         class for Literals.
18259
18260         * literal.cs: Make Literal derive from Constant.
18261
18262 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18263
18264         * statement.cs (Return.Emit): Report error 157 if the user
18265         attempts to return from a finally block.
18266
18267         (Return.Emit): Instead of emitting a return, jump to the end of
18268         the function.
18269
18270         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18271         LocalBuilder to store the result of the function.  ReturnLabel is
18272         the target where we jump.
18273
18274
18275 2001-12-09  Radek Doulik  <rodo@ximian.com>
18276
18277         * cs-parser.jay: remember alias in current namespace
18278
18279         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18280         namespaces
18281
18282         * class.cs (LookupAlias): lookup alias in my_namespace
18283
18284         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18285         aliases hashtable
18286         (LookupAlias): lookup alias in this and if needed in parent
18287         namespaces
18288
18289 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18290
18291         * support.cs: 
18292
18293         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18294         making things static.  I need this to avoid passing the
18295         TypeContainer when calling ParameterType.
18296
18297         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18298         that did string manipulation to compute the type and then call
18299         GetType.  Use Parameter.ParameterType instead.
18300
18301         * cs-tokenizer.cs: Consume the suffix for floating values.
18302
18303         * expression.cs (ParameterReference): figure out whether this is a
18304         reference parameter or not.  Kill an extra variable by computing
18305         the arg_idx during emission.
18306
18307         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18308         function that returns whether a parameter is an out/ref value or not.
18309
18310         (Parameter.ParameterType): The type of the parameter (base,
18311         without ref/out applied).
18312
18313         (Parameter.Resolve): Perform resolution here.
18314         (Parameter.ExternalType): The full type (with ref/out applied).
18315
18316         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18317         support for expressions on the using statement.
18318
18319 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18320
18321         * statement.cs (Using.EmitLocalVariableDecls): Split the
18322         localvariable handling of the using statement.
18323
18324         (Block.EmitMeta): Keep track of variable count across blocks.  We
18325         were reusing slots on separate branches of blocks.
18326
18327         (Try.Emit): Emit the general code block, we were not emitting it. 
18328
18329         Check the type of the declaration to be an IDisposable or
18330         something that can be implicity converted to it. 
18331
18332         Emit conversions if required.
18333
18334         * ecore.cs (EmptyExpression): New utility class.
18335         (Expression.ImplicitConversionExists): New utility function.
18336
18337 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18338
18339         * statement.cs (Using): Implement.
18340
18341         * expression.cs (LocalVariableReference): Support read only variables.
18342
18343         * statement.cs: Remove the explicit emit for the Leave opcode.
18344         (VariableInfo): Add a readonly field.
18345
18346 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18347
18348         * ecore.cs (ConvCast): new class used to encapsulate the various
18349         explicit integer conversions that works in both checked and
18350         unchecked contexts.
18351
18352         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18353         properly generate the overflow opcodes.
18354
18355 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * statement.cs: The correct type for the EmptyExpression is the
18358         element_type, not the variable type.  Ravi pointed this out.
18359
18360 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18361
18362         * class.cs (Method::Define): Handle PInvoke methods specially
18363         by using DefinePInvokeMethod instead of the usual one.
18364
18365         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18366         above to do the task of extracting information and defining the method.
18367
18368 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18369
18370         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18371         of the condition for string type.
18372
18373         (Emit): Move that here. 
18374
18375         (ArrayCreation::CheckIndices): Keep string literals in their expression
18376         form.
18377
18378         (EmitDynamicInitializers): Handle strings appropriately.
18379
18380 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18381
18382         * codegen.cs (EmitContext): Replace multiple variables with a
18383         single pointer to the current Switch statement.
18384
18385         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18386         EmitContext.
18387
18388 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18389
18390         * statement.cs 
18391
18392         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18393         default'.
18394
18395         (Foreach.Emit): Foreach on arrays was not setting
18396         up the loop variables (for break/continue).
18397
18398         (GotoCase): Semi-implented.
18399
18400 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18401
18402         * attribute.cs (CheckAttribute): Handle system attributes by using
18403         Attribute.GetAttributes to examine information we need.
18404
18405         (GetValidPlaces): Same here.
18406
18407         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18408
18409         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18410
18411         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18412
18413         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18414
18415         (Method::Emit): Handle the case when we are a PInvoke method.
18416
18417 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18418
18419         * expression.cs: Use ResolveWithSimpleName on compound names.
18420
18421 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18422
18423         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18424         before trying to reduce it.
18425
18426         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18427
18428         * constant.cs (LookupConstantValue): Implement.
18429
18430         (EmitConstant): Use the above in emitting the constant.
18431
18432         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18433         that are user-defined by doing a LookupConstantValue on them.
18434
18435         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18436         too, like above.
18437
18438 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18439
18440         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18441
18442         (BaseAccess.DoResolve): Implement.
18443
18444         (MemberAccess.DoResolve): Split this routine into a
18445         ResolveMemberAccess routine that can be used independently
18446
18447 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18448
18449         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18450         As that share bits of the implementation.  Is returns a boolean,
18451         while As returns the Type that is being probed.
18452
18453 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18454
18455         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18456         instead of a Literal - much easier.
18457
18458         (EnumInTransit): Remove - utterly useless :-)
18459
18460         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18461
18462         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18463
18464         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18465         chain when we have no associated expression.
18466
18467 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18468
18469         * constant.cs (Define): Use Location while reporting the errror.
18470
18471         Also emit a warning when 'new' is used and there is no inherited
18472         member to hide.
18473
18474         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18475         populated.
18476
18477         (LookupEnumValue): Implement to lookup an enum member's value and define it
18478         if necessary.
18479
18480         (Populate): Re-write accordingly to use the above routine.
18481
18482 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18483
18484         * expression.cs (This): Fix prototype for DoResolveLValue to
18485         override the base class DoResolveLValue.
18486
18487         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18488         declarations) 
18489
18490         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18491         (we need to load the address of the field here).  This fixes
18492         test-22. 
18493
18494         (FieldExpr.DoResolveLValue): Call the DoResolve
18495         function to initialize the Instance expression.
18496
18497         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18498         correctly the GetEnumerator operation on a value type.
18499
18500         * cs-parser.jay: Add more simple parsing error catches.
18501
18502         * statement.cs (Switch): Add support for string switches.
18503         Handle null specially.
18504
18505         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18506
18507 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18508
18509         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18510
18511         (declare_local_constant): New helper function.
18512
18513         * statement.cs (AddConstant): Keep a separate record of constants
18514
18515         (IsConstant): Implement to determine if a variable is a constant.
18516
18517         (GetConstantExpression): Implement.
18518
18519         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18520
18521         * statement.cs (IsVariableDefined): Re-write.
18522
18523 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18524
18525         * class.cs (TypeContainer::FindMembers): Look for constants
18526         in the case when we are looking for MemberTypes.Field
18527
18528         * expression.cs (MemberAccess::DoResolve): Check that in the
18529         case we are a FieldExpr and a Literal, we are not being accessed
18530         by an instance reference.
18531
18532         * cs-parser.jay (local_constant_declaration): Implement.
18533
18534         (declaration_statement): Implement for constant declarations.
18535
18536 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * statement.cs (Switch): Catch double defaults.
18539
18540         (Switch): More work on the switch() statement
18541         implementation.  It works for integral values now, need to finish
18542         string support.
18543
18544
18545 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18548         integer literals into other integer literals.  To be used by
18549         switch. 
18550
18551 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18552
18553         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18554         some memory.
18555
18556         (EmitDynamicInitializers): Cope with the above since we extract data
18557         directly from ArrayData now.
18558
18559         (ExpectInitializers): Keep track of whether initializers are mandatory
18560         or not.
18561
18562         (Bounds): Make it a hashtable to prevent the same dimension being 
18563         recorded for every element in that dimension.
18564
18565         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18566         from being found.
18567
18568         Also fix bug which was causing the indices to be emitted in the reverse
18569         order.
18570
18571 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18572
18573         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18574         unfinished.  They do not work, because the underlying code is
18575         sloppy.
18576
18577 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * cs-parser.jay: Remove bogus fixme.
18580
18581         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18582         on Switch statement.
18583
18584 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18585
18586         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18587         the same. 
18588
18589         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18590         parameter. Apparently, any expression is allowed. 
18591
18592         (ValidateInitializers): Update accordingly.
18593
18594         (CheckIndices): Fix some tricky bugs thanks to recursion.
18595
18596         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18597         I was being completely brain-dead.
18598
18599         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18600         and re-write acordingly.
18601
18602         (DelegateInvocation): Re-write accordingly.
18603
18604         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18605
18606         (MakeByteBlob): Handle types more correctly.
18607
18608         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18609         initialization from expressions but it is incomplete because I am a complete
18610         Dodo :-|
18611
18612 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18613
18614         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18615         on If.  Basically, we have to return `true' (ie, we do return to
18616         our caller) only if both branches of the if return.
18617
18618         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18619         short-circuit operators, handle them as short circuit operators. 
18620
18621         (Cast.DoResolve): Resolve type.
18622         (Cast.Cast): Take an expression as the target type.
18623
18624         * cs-parser.jay (cast_expression): Remove old hack that only
18625         allowed a limited set of types to be handled.  Now we take a
18626         unary_expression and we resolve to a type during semantic
18627         analysis.
18628
18629         Use the grammar productions from Rhys to handle casts (this is
18630         not complete like Rhys syntax yet, we fail to handle that corner
18631         case that C# has regarding (-x), but we will get there.
18632
18633 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18634
18635         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18636         field which is an array type.
18637
18638         * cs-parser.jay (declare_local_variables): Support array initialization too.
18639
18640         * typemanager.cs (MakeKey): Implement.
18641
18642         (everywhere): Use the above appropriately.
18643
18644         * cs-parser.jay (for_statement): Update for array initialization while
18645         declaring variables.
18646
18647         * ecore.cs : The error message was correct, it's the variable's names that
18648         were misleading ;-) Make the code more readable.
18649
18650         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18651         the correct type etc.
18652
18653         (ConvertExplicit): Handle Enum types by examining the underlying type.
18654
18655 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18656
18657         * parameter.cs (GetCallingConvention): Always return
18658         CallingConventions.Standard for now.
18659
18660 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18661
18662         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18663         and `r' after calling DoNumericPromotions.
18664
18665         * ecore.cs: Fix error message (the types were in the wrong order).
18666
18667         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18668         BindingFlags.Instance as well 
18669
18670         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18671         implicit int literal conversion in an empty cast so that we
18672         propagate the right type upstream.
18673
18674         (UnboxCast): new class used to unbox value types.
18675         (Expression.ConvertExplicit): Add explicit type conversions done
18676         by unboxing.
18677
18678         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18679         the target type before applying the implicit LongLiterals to ULong
18680         literal cast.
18681
18682 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18683
18684         * cs-parser.jay (for_statement): Reworked the way For works: now
18685         we declare manually any variables that are introduced in
18686         for_initializer to solve the problem of having out-of-band code
18687         emition (that is what got for broken).
18688
18689         (declaration_statement): Perform the actual variable declaration
18690         that used to be done in local_variable_declaration here.
18691
18692         (local_variable_declaration): Do not declare anything, just pass
18693         the information on a DictionaryEntry
18694
18695 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18696
18697         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18698         re-write of the logic to now make it recursive.
18699
18700         (UpdateIndices): Re-write accordingly.
18701
18702         Store element data in a separate ArrayData list in the above methods.
18703
18704         (MakeByteBlob): Implement to dump the array data into a byte array.
18705
18706 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18707
18708         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18709         into CheckIndices.
18710
18711         * constant.cs (Define): Implement.
18712
18713         (EmitConstant): Re-write fully.
18714
18715         Pass in location info.
18716
18717         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18718         respectively.
18719
18720         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18721         DictionaryEntry since we need location info too.
18722
18723         (constant_declaration): Update accordingly.
18724
18725         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18726         code into another method : UpdateIndices.
18727
18728 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18729
18730         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18731         some type checking etc.
18732
18733 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18734
18735         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18736         bits to provide dimension info if the user skips doing that.
18737
18738         Update second constructor to store the rank correctly.
18739
18740 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18741
18742         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18743         and try to implement.
18744
18745         * ../errors/cs0150.cs : Add.
18746
18747         * ../errors/cs0178.cs : Add.
18748
18749 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * statement.cs: Implement foreach on multi-dimensional arrays. 
18752
18753         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18754         name of the params argument.
18755
18756         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18757         initializing the array.
18758
18759         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18760         we can use this elsewhere.
18761
18762         * statement.cs: Finish implementation of foreach for single
18763         dimension arrays.
18764
18765         * cs-parser.jay: Use an out-of-band stack to pass information
18766         around, I wonder why I need this.
18767
18768         foreach_block: Make the new foreach_block the current_block.
18769
18770         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18771         function used to return a static Parameters structure.  Used for
18772         empty parameters, as those are created very frequently.
18773
18774         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18775
18776 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18777
18778         * interface.cs : Default modifier is private, not public. The
18779         make verify test passes again.
18780
18781 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18782
18783         * support.cs (ReflectionParameters): Fix logic to determine
18784         whether the last parameter is a params one. Test 9 passes again.
18785
18786         * delegate.cs (Populate): Register the builders we define with
18787         RegisterParameterForBuilder. Test 19 passes again.
18788
18789         * cs-parser.jay (property_declaration): Reference $6 instead
18790         of $$ to get at the location.
18791
18792         (indexer_declaration): Similar stuff.
18793
18794         (attribute): Ditto.
18795
18796         * class.cs (Property): Register parameters for the Get and Set methods
18797         if they exist. Test 23 passes again.
18798
18799         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18800         call to EmitArguments as we are sure there aren't any params arguments. 
18801         Test 32 passes again.
18802
18803         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18804         IndexOutOfRangeException. 
18805
18806         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18807         Test 33 now passes again.
18808
18809 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18812         broke a bunch of things.  Will have to come up with a better way
18813         of tracking locations.
18814
18815         * statement.cs: Implemented foreach for single dimension arrays.
18816
18817 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18818
18819         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18820         an error.  This removes the lookup from the critical path.
18821
18822         * cs-parser.jay: Removed use of temporary_loc, which is completely
18823         broken. 
18824
18825 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18826
18827         * support.cs (ReflectionParameters.ParameterModifier): Report
18828         whether the argument is a PARAMS argument or not.
18829
18830         * class.cs: Set the attribute `ParamArrayAttribute' on the
18831         parameter argument.
18832
18833         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18834         and cons_param_array_attribute (ConstructorInfo for
18835         ParamArrayAttribute)., 
18836
18837         * codegen.cs: Emit the return using the `Return' statement, that
18838         way we can report the error correctly for missing return values. 
18839
18840         * class.cs (Method.Emit): Clean up.
18841
18842         * expression.cs (Argument.Resolve): Take another argument: the
18843         location where this argument is used.  Notice that this is not
18844         part of the "Argument" class as to reduce the size of the
18845         structure (we know the approximate location anyways).
18846
18847         Test if the argument is a variable-reference, if not, then
18848         complain with a 206.
18849
18850         (Argument.Emit): Emit addresses of variables.
18851
18852         (Argument.FullDesc): Simplify.
18853
18854         (Invocation.DoResolve): Update for Argument.Resolve.
18855
18856         (ElementAccess.DoResolve): ditto.
18857
18858         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18859         method should be virtual, as this method is always virtual.
18860
18861         (NewDelegate.DoResolve): Update for Argument.Resolve.
18862
18863         * class.cs (ConstructorInitializer.DoResolve): ditto.
18864
18865         * attribute.cs (Attribute.Resolve): ditto.
18866
18867 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18868
18869         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18870
18871         * expression.cs (ParameterReference): Drop IStackStorage and implement
18872         IAssignMethod instead. 
18873
18874         (LocalVariableReference): ditto.
18875
18876         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18877         IAssignMethod instead. 
18878
18879 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18880
18881         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18882         enumerations that are used in heavily used structures derive from
18883         byte in a laughable and pathetic attempt to reduce memory usage.
18884         This is the kind of pre-optimzations that you should not do at
18885         home without adult supervision.
18886
18887         * expression.cs (UnaryMutator): New class, used to handle ++ and
18888         -- separatedly from the other unary operators.  Cleans up the
18889         code, and kills the ExpressionStatement dependency in Unary.
18890
18891         (Unary): Removed `method' and `Arguments' from this class, making
18892         it smaller, and moving it all to SimpleCall, so I can reuse this
18893         code in other locations and avoid creating a lot of transient data
18894         strucutres when not required.
18895
18896         * cs-parser.jay: Adjust for new changes.
18897
18898 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18899
18900         * enum.cs (Enum.Populate): If there is a failure during
18901         definition, return
18902
18903         * cs-parser.jay (opt_enum_base): we used to catch type errors
18904         here, but this is really incorrect.  The type error should be
18905         catched during semantic analysis.
18906
18907 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18908
18909         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18910         current_local_parameters as expected since I, in my stupidity, had forgotten
18911         to do this :-)
18912
18913         * attribute.cs (GetValidPlaces): Fix stupid bug.
18914
18915         * class.cs (Method::Emit): Perform check on applicability of attributes.
18916
18917         (Constructor::Emit): Ditto.
18918
18919         (Field::Emit): Ditto.
18920
18921         (Field.Location): Store location information.
18922
18923         (Property, Event, Indexer, Operator): Ditto.
18924
18925         * cs-parser.jay (field_declaration): Pass in location for each field.
18926
18927         * ../errors/cs0592.cs : Add.
18928
18929 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18930
18931         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18932
18933         (InitCoreTypes): Update accordingly.
18934
18935         (RegisterAttrType, LookupAttr): Implement.
18936
18937         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18938         info about the same.
18939
18940         (Resolve): Update to populate the above as necessary.
18941
18942         (Error592): Helper.
18943
18944         (GetValidPlaces): Helper to the above.
18945
18946         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18947
18948         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18949
18950 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18951
18952         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18953
18954         * ../errors/cs0617.cs : Add.
18955
18956 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18957
18958         * enum.cs (Emit): Rename to Populate to be more consistent with what
18959         we expect it to do and when exactly it is called.
18960
18961         * class.cs, rootcontext.cs : Update accordingly.
18962
18963         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18964         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18965
18966         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18967
18968         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18969         of a fieldinfo using the above, when dealing with a FieldBuilder.
18970
18971 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18972
18973         * ../errors/cs0031.cs : Add.
18974
18975         * ../errors/cs1008.cs : Add.
18976
18977         * ../errrors/cs0543.cs : Add.
18978
18979         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18980         enum type.
18981
18982         (FindMembers): Implement.
18983
18984         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18985         enums and delegates too.
18986
18987         (enum_types): Rename to builder_to_enum.
18988
18989         (delegate_types): Rename to builder_to_delegate.
18990
18991         * delegate.cs (FindMembers): Implement.
18992
18993 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18994
18995         * typemanager.cs (IsEnumType): Implement.
18996
18997         * enum.cs (Emit): Re-write parts to account for the underlying type
18998         better and perform checking etc.
18999
19000         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19001         of the underlying type.
19002
19003         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19004         value
19005
19006         * enum.cs (error31): Helper to report error #31.
19007
19008         * cs-parser.jay (enum_declaration): Store location of each member too.
19009
19010         * enum.cs (member_to_location): New hashtable. 
19011
19012         (AddEnumMember): Update location hashtable.
19013
19014         (Emit): Use the location of each member while reporting errors.
19015
19016 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19017
19018         * cs-parser.jay: A for_initializer if is a
19019         local_variable_declaration really ammount to have an implicit
19020         block with the variable declaration and no initializer for for.
19021
19022         * statement.cs (For.Emit): Cope with null initializers.
19023
19024         This fixes the infinite loop on for initializers.
19025
19026 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19027
19028         * enum.cs: More cleanup.
19029
19030         * ecore.cs: Remove dead code.
19031
19032         * class.cs (Property.Emit): More simplification.
19033         (Event.Emit): ditto.
19034
19035         Reworked to have less levels of indentation.
19036
19037 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19038
19039         * class.cs (Property): Emit attributes.
19040
19041         (Field): Ditto.
19042
19043         (Event): Ditto.
19044
19045         (Indexer): Ditto.
19046
19047         (Operator): Ditto.
19048
19049         * enum.cs (Emit): Ditto.
19050
19051         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19052         Enums too.
19053
19054         * class.cs (Field, Event, etc.): Move attribute generation into the
19055         Emit method everywhere.
19056
19057         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19058         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19059         as we had no way of defining nested enums !
19060
19061         * rootcontext.cs : Adjust code accordingly.
19062
19063         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19064
19065 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19066
19067         * expression.cs (EvalConstantExpression): Move into ecore.cs
19068
19069         * enum.cs (Enum): Rename some members and make them public and readonly
19070         according to our convention.
19071
19072         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19073         nothing else.
19074
19075         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19076
19077         (Enum::Emit): Write a simple version for now which doesn't try to compute
19078         expressions. I shall modify this to be more robust in just a while.
19079
19080         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19081
19082         (TypeContainer::CloseType): Create the Enum types too.
19083
19084         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19085
19086         * expression.cs (EvalConstantExpression): Get rid of completely.
19087
19088         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19089         user-defined values and other cases.
19090
19091         (IsValidEnumLiteral): Helper function.
19092
19093         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19094         out there in the case we had a literal FieldExpr.
19095
19096         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19097
19098         (Literalize): Revamp a bit to take two arguments.
19099
19100         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19101
19102 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19103
19104         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19105
19106         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19107
19108         (Resolve): Use the above to ensure we have proper initializers.
19109
19110 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19111
19112         * expression.cs (Expression::EvalConstantExpression): New method to 
19113         evaluate constant expressions.
19114
19115         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19116
19117 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19120         in an array.
19121
19122         (Binary.ResolveOperator): Handle operator != (object a, object b)
19123         and operator == (object a, object b);
19124
19125         (Binary.DoNumericPromotions): Indicate whether the numeric
19126         promotion was possible.
19127
19128         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19129         Implement.  
19130
19131         Made the ArrayAccess implement interface IAssignMethod instead of
19132         IStackStore as the order in which arguments are passed reflects
19133         this.
19134
19135         * assign.cs: Instead of using expr.ExprClass to select the way of
19136         assinging, probe for the IStackStore/IAssignMethod interfaces.
19137
19138         * typemanager.cs: Load InitializeArray definition.
19139
19140         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19141         static data that can be used to initialize arrays. 
19142
19143 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * expression.cs: Handle operator== and operator!= for booleans.
19146
19147         (Conditioal.Reduce): Implement reducer for the ?: operator.
19148
19149         (Conditional.Resolve): Implement dead code elimination.
19150
19151         (Binary.Resolve): Catch string literals and return a new
19152         concatenated string.
19153
19154         (Unary.Reduce): Implement reduction of unary expressions.
19155
19156         * ecore.cs: Split out the expression core handling here.
19157
19158         (Expression.Reduce): New method used to perform constant folding
19159         and CSE.  This is needed to support constant-expressions. 
19160
19161         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19162         targets, and optimize for !x.
19163
19164 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19165
19166         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19167         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19168         set custom atttributes.
19169
19170         * literal.cs (Literal::GetValue): New abstract method to return the actual
19171         value of the literal, cast as an object.
19172
19173         (*Literal): Implement GetValue method.
19174
19175         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19176         expressions to the arraylist but objects of type Argument.
19177
19178         * class.cs (TypeContainer::Emit): Emit our attributes too.
19179
19180         (Method::Emit, Constructor::Emit): Ditto.
19181
19182         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19183         to be ignoring earlier.
19184
19185 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19186
19187         * attribute.cs (AttributeSection::Define): Implement to do the business
19188         of constructing a CustomAttributeBuilder.
19189
19190         (Attribute): New trivial class. Increases readability of code.  
19191
19192         * cs-parser.jay : Update accordingly.
19193
19194         (positional_argument_list, named_argument_list, named_argument): New rules
19195
19196         (attribute_arguments): Use the above so that we are more correct.
19197
19198 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19199
19200         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19201         to perform all checks for a method with a params parameter.
19202
19203         (Invocation::OverloadResolve): Update to use the above method and therefore
19204         cope correctly with params method invocations.
19205
19206         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19207         params too.
19208
19209         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19210         constructors in our parent too because we can't afford to miss out on 
19211         protected ones ;-)
19212
19213         * attribute.cs (AttributeSection): New name for the class Attribute
19214
19215         Other trivial changes to improve readability.
19216
19217         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19218         use the new class names.
19219
19220 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19221
19222         * class.cs (Method::Define): Complete definition for params types too
19223
19224         (Indexer::Define): Ditto.
19225
19226         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19227         Cope everywhere with a request for info about the array parameter.
19228
19229 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19230
19231         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19232
19233         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19234         local_variable_type to extract the string corresponding to the type.
19235
19236         (local_variable_type): Fixup the action to use the new helper method.
19237
19238         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19239         go.
19240
19241         * expression.cs : Clean out code which uses the above.
19242
19243 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19244
19245         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19246         and bale out if necessary by returning a false.
19247
19248         (RegisterProperty): Ditto.
19249
19250         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19251         and print out appropriate error messages.
19252
19253         * interface.cs (everywhere): Ditto.
19254
19255         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19256         location to constructor.
19257
19258         * class.cs (Property, Event, Indexer): Update accordingly.
19259
19260         * ../errors/cs111.cs : Added.
19261
19262         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19263         of a method, as laid down by the spec.
19264
19265         (Invocation::OverloadResolve): Use the above method.
19266
19267 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19268
19269         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19270         now take a TypeContainer and a Parameters object.
19271
19272         (ParameterData): Modify return type of ParameterModifier method to be 
19273         Parameter.Modifier and not a string.
19274
19275         (ReflectionParameters, InternalParameters): Update accordingly.
19276
19277         * expression.cs (Argument::GetParameterModifier): Same here.
19278
19279         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19280         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19281         symbol in it at all so maybe this is only for now.
19282
19283 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19284
19285         * support.cs (InternalParameters): Constructor now takes an extra argument 
19286         which is the actual Parameters class.
19287
19288         (ParameterDesc): Update to provide info on ref/out modifiers.
19289
19290         * class.cs (everywhere): Update call to InternalParameters to pass in
19291         the second argument too.
19292
19293         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19294         to return the modifier info [ref/out etc]
19295
19296         (InternalParameters, ReflectionParameters): Implement the above.
19297
19298         * expression.cs (Argument::ParameterModifier): Similar function to return
19299         info about the argument's modifiers.
19300
19301         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19302         too.
19303
19304         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19305         a new SetFormalParameters object which we pass to InternalParameters.
19306
19307 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19308
19309         * expression.cs (NewArray): Merge into the ArrayCreation class.
19310
19311 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19312
19313         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19314         NewUserdefinedArray into one as there wasn't much of a use in having
19315         two separate ones.
19316
19317         * expression.cs (Argument): Change field's name to ArgType from Type.
19318
19319         (Type): New readonly property which returns the proper type, taking into 
19320         account ref/out modifiers.
19321
19322         (everywhere): Adjust code accordingly for the above.
19323
19324         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19325         whether we are emitting for a ref or out parameter.
19326
19327         * expression.cs (Argument::Emit): Use the above field to set the state.
19328
19329         (LocalVariableReference::Emit): Update to honour the flag and emit the
19330         right stuff.
19331
19332         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19333
19334         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19335
19336         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19337
19338         (ReflectionParameters, InternalParameters): Implement the above method.
19339
19340         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19341         reporting errors.
19342
19343         (Invocation::FullMethodDesc): Ditto. 
19344
19345 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19346
19347         * cs-parser.jay: Add extra production for the second form of array
19348         creation. 
19349
19350         * expression.cs (ArrayCreation): Update to reflect the above
19351         change. 
19352
19353         * Small changes to prepare for Array initialization.
19354
19355 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19356
19357         * typemanager.cs (ImplementsInterface): interface might be null;
19358         Deal with this problem;
19359
19360         Also, we do store negative hits on the cache (null values), so use
19361         this instead of calling t.GetInterfaces on the type everytime.
19362
19363 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19364
19365         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19366
19367         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19368         split functionality out into different classes.
19369
19370         (New::FormArrayType): Move into NewBuiltinArray.
19371
19372         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19373         quite useless.
19374
19375         (NewBuiltinArray): New class to handle creation of built-in arrays.
19376
19377         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19378         account creation of one-dimensional arrays.
19379
19380         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19381
19382         (NewUserdefinedArray::DoResolve): Implement.
19383
19384         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19385
19386         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19387         we maintain inside the TypeManager. This is necessary to perform lookups on the
19388         module builder.
19389
19390         (LookupType): Update to perform GetType on the module builders too.     
19391
19392         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19393
19394         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19395
19396 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19397
19398         * expression.cs (New::DoResolve): Implement guts of array creation.
19399
19400         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19401
19402 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19403
19404         * expression.cs: Fix bug I introduced lsat night that broke
19405         Delegates. 
19406
19407         (Expression.Resolve): Report a 246 error (can not resolve name)
19408         if we find a SimpleName in the stream.
19409
19410         (Expression.ResolveLValue): Ditto.
19411
19412         (Expression.ResolveWithSimpleName): This function is a variant of
19413         ResolveName, this one allows SimpleNames to be returned without a
19414         warning.  The only consumer of SimpleNames is MemberAccess
19415
19416 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19417
19418         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19419         might arrive here.  I have my doubts that this is correct.
19420
19421         * statement.cs (Lock): Implement lock statement.
19422
19423         * cs-parser.jay: Small fixes to support `lock' and `using'
19424
19425         * cs-tokenizer.cs: Remove extra space
19426
19427         * driver.cs: New flag --checked, allows to turn on integer math
19428         checking. 
19429
19430         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19431         Threading.Monitor.Exit 
19432
19433 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19434
19435         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19436         Expression Class to be IndexerAccess.
19437
19438         Notice that Indexer::DoResolve sets the eclass to Value.
19439
19440 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19441
19442         * class.cs (TypeContainer::Emit): Emit code for indexers.
19443
19444         * assign.cs (IAssignMethod): New interface implemented by Indexers
19445         and Properties for handling assignment.
19446
19447         (Assign::Emit): Simplify and reuse code. 
19448
19449         * expression.cs (IndexerAccess, PropertyExpr): Implement
19450         IAssignMethod, clean up old code. 
19451
19452 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19453
19454         * typemanager.cs (ImplementsInterface): New method to determine if a type
19455         implements a given interface. Provides a nice cache too.
19456
19457         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19458         method.
19459
19460         (ConvertReferenceExplicit): Ditto.
19461
19462         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19463         various methods, with correct names etc.
19464
19465         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19466         Operator.UnaryNegation.
19467
19468         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19469         we have a unary plus or minus operator.
19470
19471         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19472         UnaryMinus.
19473
19474         * everywhere : update accordingly.
19475
19476         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19477         respectively.
19478
19479         * class.cs (Method::Define): For the case where we are implementing a method
19480         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19481         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19482
19483 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19484
19485         * interface.cs (FindMembers): Implement to work around S.R.E
19486         lameness.
19487
19488         * typemanager.cs (IsInterfaceType): Implement.
19489
19490         (FindMembers): Update to handle interface types too.
19491
19492         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19493         use IsAssignableFrom as that is not correct - it doesn't work.
19494
19495         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19496         and accordingly override EmitStatement.
19497
19498         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19499         using the correct logic :-)
19500
19501 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19502
19503         * ../errors/cs-11.cs : Add to demonstrate error -11 
19504
19505 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19506
19507         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19508         then pass this as a hint to ResolveLValue.
19509
19510         * expression.cs (FieldExpr): Add Location information
19511
19512         (FieldExpr::LValueResolve): Report assignment to readonly
19513         variable. 
19514
19515         (Expression::ExprClassFromMemberInfo): Pass location information.
19516
19517         (Expression::ResolveLValue): Add new method that resolves an
19518         LValue. 
19519
19520         (Expression::DoResolveLValue): Default invocation calls
19521         DoResolve. 
19522
19523         (Indexers): New class used to keep track of indexers in a given
19524         Type. 
19525
19526         (IStackStore): Renamed from LValue, as it did not really describe
19527         what this did.  Also ResolveLValue is gone from this interface and
19528         now is part of Expression.
19529
19530         (ElementAccess): Depending on the element access type
19531
19532         * typemanager.cs: Add `indexer_name_type' as a Core type
19533         (System.Runtime.CompilerServices.IndexerNameAttribute)
19534
19535         * statement.cs (Goto): Take a location.
19536
19537 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19538
19539         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19540         if two delegates are compatible.
19541
19542         (NewDelegate::DoResolve): Update to take care of the case when
19543         we instantiate a delegate from another delegate.
19544
19545         * typemanager.cs (FindMembers): Don't even try to look up members
19546         of Delegate types for now.
19547
19548 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19549
19550         * delegate.cs (NewDelegate): New class to take care of delegate
19551         instantiation.
19552
19553         * expression.cs (New): Split the delegate related code out into 
19554         the NewDelegate class.
19555
19556         * delegate.cs (DelegateInvocation): New class to handle delegate 
19557         invocation.
19558
19559         * expression.cs (Invocation): Split out delegate related code into
19560         the DelegateInvocation class.
19561
19562 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19563
19564         * expression.cs (New::DoResolve): Implement delegate creation fully
19565         and according to the spec.
19566
19567         (New::DoEmit): Update to handle delegates differently.
19568
19569         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19570         because of which we were printing out arguments in reverse order !
19571
19572         * delegate.cs (VerifyMethod): Implement to check if the given method
19573         matches the delegate.
19574
19575         (FullDelegateDesc): Implement.
19576
19577         (VerifyApplicability): Implement.
19578
19579         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19580         delegate invocations too.
19581
19582         (Invocation::Emit): Ditto.
19583
19584         * ../errors/cs1593.cs : Added.
19585
19586         * ../errors/cs1594.cs : Added.
19587
19588         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19589
19590 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19591
19592         * typemanager.cs (intptr_type): Core type for System.IntPtr
19593
19594         (InitCoreTypes): Update for the same.
19595
19596         (iasyncresult_type, asynccallback_type): Ditto.
19597
19598         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19599         correct.
19600
19601         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19602         too.
19603
19604         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19605         the builders for the 4 members of a delegate type :-)
19606
19607         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19608         type.
19609
19610         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19611
19612         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19613
19614 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19615
19616         * statement.cs (Break::Emit): Implement.   
19617         (Continue::Emit): Implement.
19618
19619         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19620         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19621         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19622         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19623         end loop
19624
19625         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19626         properties that track the label for the current loop (begin of the
19627         loop and end of the loop).
19628
19629 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19630
19631         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19632         use of emitting anything at all.
19633
19634         * class.cs, rootcontext.cs : Get rid of calls to the same.
19635
19636         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19637
19638         (Populate): Define the constructor correctly and set the implementation
19639         attributes.
19640
19641         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19642         have been defined.
19643
19644         (AddDelegateType): Implement.
19645
19646         (IsDelegateType): Implement helper method.
19647
19648         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19649
19650         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19651         and accordingly handle it.
19652
19653         * delegate.cs (Populate): Take TypeContainer argument.
19654         Implement bits to define the Invoke method. However, I still haven't figured out
19655         how to take care of the native int bit :-(
19656
19657         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19658         Qualify the name of the delegate, not its return type !
19659
19660         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19661         conversion.
19662
19663         (StandardConversionExists): Checking for array types turns out to be recursive.
19664
19665         (ConvertReferenceExplicit): Implement array conversion.
19666
19667         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19668
19669 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19670
19671         * cs-parser.jay (delegate_declaration): Store the fully qualified
19672         name as it is a type declaration.
19673
19674         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19675         readonly.
19676
19677         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19678         as TypeContainer::DefineType.
19679
19680         (Populate): Method in which all the definition of the various methods (Invoke)
19681         etc is done.
19682
19683         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19684         see.
19685
19686         (CloseDelegate): Finally creates the delegate.
19687
19688         * class.cs (TypeContainer::DefineType): Update to define delegates.
19689         (Populate, Emit and CloseType): Do the same thing here too.
19690
19691         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19692         delegates in all these operations.
19693
19694 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19695
19696         * expression.cs: LocalTemporary: a new expression used to
19697         reference a temporary that has been created.
19698
19699         * assign.cs: Handle PropertyAccess back here, so that we can
19700         provide the proper semantic access to properties.
19701
19702         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19703         a few more explicit conversions. 
19704
19705         * modifiers.cs: `NEW' modifier maps to HideBySig.
19706
19707         * expression.cs (PropertyExpr): Make this into an
19708         ExpressionStatement, and support the EmitStatement code path. 
19709
19710         Perform get/set error checking, clean up the interface.
19711
19712         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19713         them into toplevel access objects.
19714
19715 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19716
19717         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19718         SRE.
19719
19720         * typemanager.cs: Keep track here of our PropertyBuilders again to
19721         work around lameness in SRE.
19722
19723 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19724
19725         * expression.cs (LValue::LValueResolve): New method in the
19726         interface, used to perform a second resolution pass for LValues. 
19727
19728         (This::DoResolve): Catch the use of this in static methods.
19729
19730         (This::LValueResolve): Implement.
19731
19732         (This::Store): Remove warning, assigning to `this' in structures
19733         is 
19734
19735         (Invocation::Emit): Deal with invocation of
19736         methods on value types.  We need to pass the address to structure
19737         methods rather than the object itself.  (The equivalent code to
19738         emit "this" for structures leaves the entire structure on the
19739         stack instead of a pointer to it). 
19740
19741         (ParameterReference::DoResolve): Compute the real index for the
19742         argument based on whether the method takes or not a `this' pointer
19743         (ie, the method is static).
19744
19745         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19746         value types returned from functions when we need to invoke a
19747         method on the sturcture.
19748
19749
19750 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19751
19752         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19753         defining the type in the Modulebuilder or Typebuilder. This is to take
19754         care of nested types which need to be defined on the TypeBuilder using
19755         DefineNestedMethod.
19756
19757         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19758         methods in RootContext, only ported to be part of TypeContainer.
19759
19760         (TypeContainer::GetInterfaceOrClass): Ditto.
19761
19762         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19763
19764         * interface.cs (Interface::DefineInterface): New method. Does exactly
19765         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19766         too.
19767
19768         (Interface::GetInterfaces): Move from RootContext here and port.
19769
19770         (Interface::GetInterfaceByName): Same here.
19771
19772         * rootcontext.cs (ResolveTree): Re-write.
19773
19774         (PopulateTypes): Re-write.
19775
19776         * class.cs (TypeContainer::Populate): Populate nested types too.
19777         (TypeContainer::Emit): Emit nested members too.
19778
19779         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19780         instead just use the name argument passed in as it is already fully
19781         qualified.
19782
19783         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19784         to TypeContainer mapping to see if a type is user-defined.
19785
19786         * class.cs (TypeContainer::CloseType): Implement. 
19787
19788         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19789         the default constructor.
19790
19791         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19792         twice.
19793
19794         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19795
19796         * interface.cs (CloseType): Create the type here.
19797
19798         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19799         the hierarchy.
19800
19801         Remove all the methods which are now in TypeContainer.
19802
19803 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19804
19805         * delegate.cs (Define): Re-write bits to define the delegate
19806         correctly.
19807
19808 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19811
19812         * expression.cs (ImplicitReferenceConversion): handle null as well
19813         as a source to convert to any reference type.
19814
19815         * statement.cs (Return): Perform any implicit conversions to
19816         expected return type.  
19817
19818         Validate use of return statement.  
19819
19820         * codegen.cs (EmitContext): Pass the expected return type here.
19821
19822         * class.cs (Method, Constructor, Property): Pass expected return
19823         type to EmitContext.
19824
19825 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19826
19827         * expression.cs: Make DoResolve take an EmitContext instead of a
19828         TypeContainer.
19829
19830         Replaced `l' and `location' for `loc', for consistency.
19831
19832         (Error, Warning): Remove unneeded Tc argument.
19833
19834         * assign.cs, literal.cs, constant.cs: Update to new calling
19835         convention. 
19836
19837         * codegen.cs: EmitContext now contains a flag indicating whether
19838         code is being generated in a static method or not.
19839
19840         * cs-parser.jay: DecomposeQI, new function that replaces the old
19841         QualifiedIdentifier.  Now we always decompose the assembled
19842         strings from qualified_identifier productions into a group of
19843         memberaccesses.
19844
19845 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19846
19847         * rootcontext.cs: Deal with field-less struct types correctly now
19848         by passing the size option to Define Type.
19849
19850         * class.cs: Removed hack that created one static field. 
19851
19852 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19853
19854         * statement.cs: Moved most of the code generation here. 
19855
19856 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19857
19858         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19859         seem very right.
19860
19861         (ElementAccess): Remove useless bits for now - keep checks as the spec
19862         says.
19863
19864 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19865
19866         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19867         and start performing checks according to the spec.
19868
19869 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19870
19871         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19872         rank_specifiers instead.
19873
19874         (rank_specifiers): Change the order in which the rank specifiers are stored
19875
19876         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19877
19878         * expression.cs (ElementAccess): Implement the LValue interface too.
19879
19880 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19881
19882         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19883         except that user defined conversions are not included.
19884
19885         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19886         perform the conversion of the return type, if necessary.
19887
19888         (New::DoResolve): Check whether we are creating an array or an object
19889         and accordingly do the needful.
19890
19891         (New::Emit): Same here.
19892
19893         (New::DoResolve): Implement guts of array creation.
19894
19895         (New::FormLookupType): Helper function.
19896
19897 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19898
19899         * codegen.cs: Removed most of the code generation here, and move the
19900         corresponding code generation bits to the statement classes. 
19901
19902         Added support for try/catch/finalize and throw.
19903
19904         * cs-parser.jay: Added support for try/catch/finalize.
19905
19906         * class.cs: Catch static methods having the flags override,
19907         virtual or abstract.
19908
19909         * expression.cs (UserCast): This user cast was not really doing
19910         what it was supposed to do.  Which is to be born in fully resolved
19911         state.  Parts of the resolution were being performed at Emit time! 
19912
19913         Fixed this code.
19914
19915 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * expression.cs: Implicity convert the result from UserCast.
19918
19919 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19920
19921         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19922         prevented it from working correctly. 
19923
19924         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19925         merely ConvertImplicit.
19926
19927 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19928
19929         * typemanager.cs: Make the LookupTypeContainer function static,
19930         and not per-instance.  
19931
19932         * class.cs: Make static FindMembers (the one that takes a Type
19933         argument). 
19934
19935         * codegen.cs: Add EmitForeach here.
19936
19937         * cs-parser.jay: Make foreach a toplevel object instead of the
19938         inline expansion, as we need to perform semantic analysis on it. 
19939
19940 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19941
19942         * expression.cs (Expression::ImplicitUserConversion): Rename to
19943         UserDefinedConversion.
19944
19945         (Expression::UserDefinedConversion): Take an extra argument specifying 
19946         whether we look for explicit user conversions too.
19947
19948         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19949
19950         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19951
19952         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19953         with the appropriate arguments.
19954
19955         * cs-parser.jay (cast_expression): Record location too.
19956
19957         * expression.cs (Cast): Record location info.
19958
19959         (Expression::ConvertExplicit): Take location argument.
19960
19961         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19962         to determine if we are doing explicit conversions.
19963
19964         (UserCast::Emit): Update accordingly.
19965
19966         (Expression::ConvertExplicit): Report an error if everything fails.
19967
19968         * ../errors/cs0030.cs : Add.
19969
19970 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19971
19972         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19973         virtual and newslot bits. 
19974
19975         * class.cs (TypeContainer::RegisterRequiredImplementations):
19976         Record methods we need.
19977
19978         (TypeContainer::MakeKey): Helper function to make keys for
19979         MethodBases, since the Methodbase key is useless.
19980
19981         (TypeContainer::Populate): Call RegisterRequiredImplementations
19982         before defining the methods.   
19983
19984         Create a mapping for method_builders_to_methods ahead of time
19985         instead of inside a tight loop.
19986
19987         (::RequireMethods):  Accept an object as the data to set into the
19988         hashtable so we can report interface vs abstract method mismatch.
19989
19990 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19991
19992         * report.cs: Make all of it static.
19993
19994         * rootcontext.cs: Drop object_type and value_type computations, as
19995         we have those in the TypeManager anyways.
19996
19997         Drop report instance variable too, now it is a global.
19998
19999         * driver.cs: Use try/catch on command line handling.
20000
20001         Add --probe option to debug the error reporting system with a test
20002         suite. 
20003
20004         * report.cs: Add support for exiting program when a probe
20005         condition is reached.
20006
20007 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20008
20009         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20010         we do a forcible conversion regardless of type, to check if 
20011         ForceConversion returns a null.
20012
20013         (Binary::error19): Use location to report error.
20014
20015         (Unary::error23): Use location here too.
20016
20017         * ../errors/cs0019.cs : Check in.
20018
20019         * ../errors/cs0023.cs : Check in.
20020
20021         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20022         case of a non-null MethodInfo object with a length of 0 !
20023
20024         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20025         an applicable member - according to the spec :-)
20026         Also fix logic to find members in base types.
20027
20028         (Unary::ResolveOperator): Same here.
20029
20030         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20031         as I was getting thoroughly confused between this and error19 :-)
20032
20033         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20034         (::FindMostEncompassedType): Implement.
20035         (::FindMostEncompassingType): Implement.
20036         (::StandardConversionExists): Implement.
20037
20038         (UserImplicitCast): Re-vamp. We now need info about most specific
20039         source and target types so that we can do the necessary conversions.
20040
20041         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20042         mathematical union with no duplicates.
20043
20044 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20045
20046         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20047         in order from base classes to child classes, so that we can in
20048         child classes look up in our parent for method names and
20049         attributes (required for handling abstract, virtual, new, override
20050         constructs: we need to instrospect our base class, and if we dont
20051         populate the classes in order, the introspection might be
20052         incorrect.  For example, a method could query its parent before
20053         the parent has any methods and would determine that the parent has
20054         no abstract methods (while it could have had them)).
20055
20056         (RootContext::CreateType): Record the order in which we define the
20057         classes.
20058
20059 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * class.cs (TypeContainer::Populate): Also method definitions can
20062         fail now, keep track of this.
20063
20064         (TypeContainer::FindMembers): Implement support for
20065         DeclaredOnly/noDeclaredOnly flag.
20066
20067         (Constructor::Emit) Return the ConstructorBuilder.
20068
20069         (Method::Emit) Return the MethodBuilder. 
20070         Check for abstract or virtual methods to be public.
20071
20072         * rootcontext.cs (RootContext::CreateType): Register all the
20073         abstract methods required for the class to be complete and the
20074         interface methods that must be implemented. 
20075
20076         * cs-parser.jay: Report error 501 (method requires body if it is
20077         not marked abstract or extern).
20078
20079         * expression.cs (TypeOf::Emit): Implement.
20080
20081         * typemanager.cs: runtime_handle_type, new global type.
20082
20083         * class.cs (Property::Emit): Generate code for properties.
20084
20085 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20086
20087         * expression.cs (Unary::ResolveOperator): Find operators on base type
20088         too - we now conform exactly to the spec.
20089
20090         (Binary::ResolveOperator): Same here.
20091
20092         * class.cs (Operator::Define): Fix minor quirk in the tests.
20093
20094         * ../errors/cs0215.cs : Added.
20095
20096         * ../errors/cs0556.cs : Added.
20097
20098         * ../errors/cs0555.cs : Added.
20099
20100 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20101
20102         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20103         single integer which is really efficient
20104
20105 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20106
20107         *  expression.cs (Expression::ImplicitUserConversion): Use location
20108         even in the case when we are examining True operators.
20109  
20110         * class.cs (Operator::Define): Perform extensive checks to conform
20111         with the rules for operator overloading in the spec.
20112
20113         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20114         some of the other conversions mentioned in the spec.
20115
20116         * typemanager.cs (array_type): New static member for the System.Array built-in
20117         type.
20118
20119         (cloneable_interface): For System.ICloneable interface.
20120
20121         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20122         we start resolving the tree and populating types.
20123
20124         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20125  
20126 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * expression.cs (Expression::ExprClassFromMemberInfo,
20129         Expression::Literalize): Create literal expressions from
20130         FieldInfos which are literals.
20131
20132         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20133         type casts, because they were wrong.  The test suite in tests
20134         caught these ones.
20135
20136         (ImplicitNumericConversion): ushort to ulong requires a widening
20137         cast. 
20138
20139         Int32 constant to long requires widening cast as well.
20140
20141         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20142         for integers because the type on the stack is not i4.
20143
20144 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * expression.cs (report118): require location argument. 
20147
20148         * parameter.cs: Do not dereference potential null value.
20149
20150         * class.cs: Catch methods that lack the `new' keyword when
20151         overriding a name.  Report warnings when `new' is used without
20152         anything being there to override.
20153
20154         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20155
20156         * class.cs: Only add constructor to hashtable if it is non-null
20157         (as now constructors can fail on define).
20158
20159         (TypeManager, Class, Struct): Take location arguments.
20160
20161         Catch field instance initialization in structs as errors.
20162
20163         accepting_filter: a new filter for FindMembers that is static so
20164         that we dont create an instance per invocation.
20165
20166         (Constructor::Define): Catch errors where a struct constructor is
20167         parameterless 
20168
20169         * cs-parser.jay: Pass location information for various new
20170         constructs. 
20171
20172         * delegate.cs (Delegate): take a location argument.
20173
20174         * driver.cs: Do not call EmitCode if there were problesm in the
20175         Definition of the types, as many Builders wont be there. 
20176
20177         * decl.cs (Decl::Decl): Require a location argument.
20178
20179         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20180         into integers, and find the most appropiate integer for it.
20181
20182         * literal.cs: Implement ULongLiteral.
20183
20184         * rootcontext.cs: Provide better information about the location of
20185         failure when CreateType fails.
20186
20187 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20188
20189         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20190         as well.
20191
20192         * expression.cs (Binary::CheckShiftArguments): Add missing type
20193         computation.
20194         (Binary::ResolveOperator): Add type to the logical and and logical
20195         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20196         before.
20197
20198         (Binary::DoNumericPromotions): In the case where either argument
20199         is ulong (and most signed types combined with ulong cause an
20200         error) perform implicit integer constant conversions as well.
20201
20202 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20203
20204         * expression.cs (UserImplicitCast): Method should always be
20205         non-null. 
20206         (Invocation::BetterConversion): Simplified test for IntLiteral.
20207
20208         (Expression::ImplicitNumericConversion): Split this routine out.
20209         Put the code that performs implicit constant integer conversions
20210         here. 
20211
20212         (Expression::Resolve): Become a wrapper around DoResolve so we can
20213         check eclass and type being set after resolve.
20214
20215         (Invocation::Badness): Remove this dead function
20216
20217         (Binary::ResolveOperator): Do not compute the expensive argumnets
20218         unless we have a union for it.
20219
20220         (Probe::Emit): Is needs to do an isinst and then
20221         compare against null.
20222
20223         (::CanConvert): Added Location argument.  If the Location argument
20224         is null (Location.Null), then we do not report errors.  This is
20225         used by the `probe' mechanism of the Explicit conversion.  We do
20226         not want to generate an error for something that the user
20227         explicitly requested to be casted.  But the pipeline for an
20228         explicit cast first tests for potential implicit casts.
20229
20230         So for now, if the Location is null, it means `Probe only' to
20231         avoid adding another argument.   Might have to revise this
20232         strategy later.
20233
20234         (ClassCast): New class used to type cast objects into arbitrary
20235         classes (used in Explicit Reference Conversions).
20236
20237         Implement `as' as well.
20238
20239         Reverted all the patches from Ravi below: they were broken:
20240
20241                 * The use of `level' as a mechanism to stop recursive
20242                   invocations is wrong.  That was there just to catch the
20243                   bug with a strack trace but not as a way of addressing
20244                   the problem.
20245
20246                   To fix the problem we have to *understand* what is going
20247                   on and the interactions and come up with a plan, not
20248                   just get things going.
20249
20250                 * The use of the type conversion cache that I proposed
20251                   last night had an open topic: How does this work across
20252                   protection domains.  A user defined conversion might not
20253                   be public in the location where we are applying the
20254                   conversion, a different conversion might be selected
20255                   (ie, private A->B (better) but public B->A (worse),
20256                   inside A, A->B applies, but outside it, B->A will
20257                   apply).
20258
20259                 * On top of that (ie, even if the above is solved),
20260                   conversions in a cache need to be abstract.  Ie, `To
20261                   convert from an Int to a Short use an OpcodeCast', not
20262                   `To convert from an Int to a Short use the OpcodeCast on
20263                   the variable 5' (which is what this patch was doing).
20264
20265 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20266
20267         * expression.cs (Invocation::ConversionExists): Re-write to use
20268         the conversion cache
20269
20270         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20271         cache all conversions done, not just user-defined ones.
20272
20273         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20274         to determine if a conversion exists instead of acutually trying to 
20275         perform the conversion. It's faster too.
20276
20277         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20278         and only then attempt the implicit conversion.
20279
20280 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20281
20282         * expression.cs (ConvertImplicit): Use a cache for conversions
20283         already found. Check level of recursion and bail out if necessary.
20284
20285 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20286
20287         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20288         Export standard methods that we expect for string operations.
20289
20290         * statement.cs (Block::UsageWarning): Track usage of variables and
20291         report the errors for not used variables.
20292
20293         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20294         operator. 
20295
20296 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20297
20298         * codegen.cs: remove unnneded code 
20299
20300         * expression.cs: Removed BuiltinTypeAccess class
20301
20302         Fix the order in which implicit conversions are
20303         done.  
20304
20305         The previous fixed dropped support for boxed conversions (adding a
20306         test to the test suite now)
20307
20308         (UserImplicitCast::CanConvert): Remove test for source being null,
20309         that code is broken.  We should not feed a null to begin with, if
20310         we do, then we should track the bug where the problem originates
20311         and not try to cover it up here.
20312
20313         Return a resolved expression of type UserImplicitCast on success
20314         rather than true/false.  Ravi: this is what I was talking about,
20315         the pattern is to use a static method as a "constructor" for
20316         objects. 
20317
20318         Also, do not create arguments until the very last minute,
20319         otherwise we always create the arguments even for lookups that
20320         will never be performed. 
20321
20322         (UserImplicitCast::Resolve): Eliminate, objects of type
20323         UserImplicitCast are born in a fully resolved state. 
20324
20325         * typemanager.cs (InitCoreTypes): Init also value_type
20326         (System.ValueType). 
20327
20328         * expression.cs (Cast::Resolve): First resolve the child expression.
20329
20330         (LValue): Add new method AddressOf to be used by
20331         the `&' operator.  
20332
20333         Change the argument of Store to take an EmitContext instead of an
20334         ILGenerator, because things like FieldExpr need to be able to call
20335         their children expression to generate the instance code. 
20336
20337         (Expression::Error, Expression::Warning): Sugar functions for
20338         reporting errors.
20339
20340         (Expression::MemberLookup): Accept a TypeContainer instead of a
20341         Report as the first argument.
20342
20343         (Expression::ResolvePrimary): Killed.  I still want to improve
20344         this as currently the code is just not right.
20345
20346         (Expression::ResolveMemberAccess): Simplify, but it is still
20347         wrong. 
20348
20349         (Unary::Resolve): Catch errors in AddressOf operators.
20350
20351         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20352         index to a byte for the short-version, or the compiler will choose
20353         the wrong Emit call, which generates the wrong data.
20354
20355         (ParameterReference::Emit, ::Store): same.
20356
20357         (FieldExpr::AddressOf): Implement.
20358
20359         * typemanager.cs: TypeManager: made public variable instead of
20360         property.
20361
20362         * driver.cs: document --fatal.
20363
20364         * report.cs (ErrorMessage, WarningMessage): new names for the old
20365         Error and Warning classes.
20366
20367         * cs-parser.jay (member_access): Turn built-in access to types
20368         into a normal simplename
20369
20370 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20371
20372         * expression.cs (Invocation::BetterConversion): Fix to cope
20373         with q being null, since this was introducing a bug.
20374
20375         * expression.cs (ConvertImplicit): Do built-in conversions first.
20376
20377 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20378
20379         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20380
20381 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20382
20383         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20384         I had introduced long ago (what's new ?).
20385
20386         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20387         the work of all the checking. 
20388         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20389         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20390
20391         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20392         that is the right way. 
20393
20394         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20395         overloading resolution. Use everywhere instead of cutting and pasting code.
20396
20397         (Binary::ResolveOperator): Use MakeUnionSet.
20398
20399         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20400         we have to convert to bool types. Not complete yet.
20401
20402 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20403
20404         * typemanager.cs (TypeManager::CSharpName): support ushort.
20405
20406         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20407         to provide an expression that performsn an implicit constant int
20408         conversion (section 6.1.6).
20409         (Expression::ConvertImplicitRequired): Reworked to include
20410         implicit constant expression conversions.
20411
20412         (Expression::ConvertNumericExplicit): Finished.
20413
20414         (Invocation::Emit): If InstanceExpression is null, then it means
20415         that we perform a call on this.
20416
20417 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20418
20419         * expression.cs (Unary::Emit): Remove some dead code.
20420         (Probe): Implement Resolve and Emit for `is'.
20421         (Expression::ConvertImplicitRequired): Attempt to do constant
20422         expression conversions here.  Maybe should be moved to
20423         ConvertImplicit, but I am not sure.
20424         (Expression::ImplicitLongConstantConversionPossible,
20425         Expression::ImplicitIntConstantConversionPossible): New functions
20426         that tell whether is it possible to apply an implicit constant
20427         expression conversion.
20428
20429         (ConvertNumericExplicit): Started work on explicit numeric
20430         conversions.
20431
20432         * cs-parser.jay: Update operator constants.
20433
20434         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20435         (Parameters::GetSignature): Hook up VerifyArgs here.
20436         (Parameters::VerifyArgs): Verifies that no two arguments have the
20437         same name. 
20438
20439         * class.cs (Operator): Update the operator names to reflect the
20440         ones that the spec expects (as we are just stringizing the
20441         operator names).
20442
20443         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20444         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20445         previous usage did only work for our methods.
20446         (Expression::ConvertImplicit): Handle decimal implicit numeric
20447         conversions as well.
20448         (Expression::InternalTypeConstructor): Used to invoke constructors
20449         on internal types for default promotions.
20450
20451         (Unary::Emit): Implement special handling for the pre/post
20452         increment/decrement for overloaded operators, as they need to have
20453         the same semantics as the other operators.
20454
20455         (Binary::ResolveOperator): ditto.
20456         (Invocation::ConversionExists): ditto.
20457         (UserImplicitCast::Resolve): ditto.
20458
20459 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20460
20461         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20462         operator, return after emitting body. Regression tests pass again !
20463
20464         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20465         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20466         (Invocation::OverloadResolve): Ditto.
20467         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20468
20469         * everywhere : update calls to the above methods accordingly.
20470
20471 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20472
20473         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20474
20475         * expression.cs (ExpressionStatement): New base class used for
20476         expressions that can appear in statements, so that we can provide
20477         an alternate path to generate expression that do not leave a value
20478         on the stack.
20479
20480         (Expression::Emit, and all the derivatives): We no longer return
20481         whether a value is left on the stack or not.  Every expression
20482         after being emitted leaves a single value on the stack.
20483
20484         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20485         facilties of ExpressionStatement if possible.
20486
20487         * cs-parser.jay: Update statement_expression.
20488
20489 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * driver.cs: Change the wording of message
20492
20493 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20494
20495         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20496         the type of the expression to the return type of the method if
20497         we have an overloaded operator match ! The regression tests pass again !
20498         (Unary::ResolveOperator): Ditto.
20499
20500         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20501         to find "op_Implicit", not "implicit" ;-)
20502         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20503         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20504
20505         * everywhere : Correct calls to the above accordingly.
20506
20507         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20508         (ConvertImplicit): Do user-defined conversion if it exists.
20509
20510 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * assign.cs: track location.
20513         (Resolve): Use implicit conversions on assignment.
20514
20515         * literal.cs: Oops.  Not good, Emit of short access values should
20516         pass (Bytes) or the wrong argument will be selected.
20517
20518         * expression.cs (Unary::Emit): Emit code for -expr.
20519
20520         (Unary::ResolveOperator): Handle `Substract' for non-constants
20521         (substract from zero from the non-constants).
20522         Deal with Doubles as well. 
20523
20524         (Expression::ConvertImplicitRequired): New routine that reports an
20525         error if no implicit conversion exists. 
20526
20527         (Invocation::OverloadResolve): Store the converted implicit
20528         expressions if we make them
20529
20530 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20531
20532         * class.cs (ConstructorInitializer): Take a Location argument.
20533         (ConstructorBaseInitializer): Same here.
20534         (ConstructorThisInitializer): Same here.
20535
20536         * cs-parser.jay : Update all calls accordingly.
20537
20538         * expression.cs (Unary, Binary, New): Take location argument.
20539         Update accordingly everywhere.
20540
20541         * cs-parser.jay : Update all calls to the above to take a location
20542         argument.
20543
20544         * class.cs : Ditto.
20545
20546 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20547
20548         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20549         (Invocation::BetterConversion): Same here
20550         (Invocation::ConversionExists): Ditto.
20551
20552         (Invocation::ConversionExists): Implement.
20553
20554 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20555
20556         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20557         Also take an additional TypeContainer argument.
20558
20559         * All over : Pass in TypeContainer as argument to OverloadResolve.
20560
20561         * typemanager.cs (CSharpName): Update to check for the string type and return
20562         that too.
20563
20564         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20565         a given method.
20566
20567 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20568
20569         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20570         (Invocation::BetterFunction): Implement.
20571         (Invocation::BetterConversion): Implement.
20572         (Invocation::ConversionExists): Skeleton, no implementation yet.
20573
20574         Okay, things work fine !
20575
20576 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20577
20578         * typemanager.cs: declare and load enum_type, delegate_type and
20579         void_type. 
20580
20581         * expression.cs (Expression::Emit): Now emit returns a value that
20582         tells whether a value is left on the stack or not.  This strategy
20583         might be reveted tomorrow with a mechanism that would address
20584         multiple assignments.
20585         (Expression::report118): Utility routine to report mismatches on
20586         the ExprClass.
20587
20588         (Unary::Report23): Report impossible type/operator combination
20589         utility function.
20590
20591         (Unary::IsIncrementableNumber): Whether the type can be
20592         incremented or decremented with add.
20593         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20594         complemented. 
20595         (Unary::ResolveOperator): Implement ++, !, ~,
20596
20597         (Invocation::Emit): Deal with new Emit convetion.
20598
20599         * All Expression derivatives: Updated their Emit method to return
20600         whether they leave values on the stack or not.
20601
20602         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20603         stack for expressions that are statements. 
20604
20605 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20606
20607         * expression.cs (LValue): New interface.  Must be implemented by
20608         LValue objects.
20609         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20610         LValue interface.
20611
20612         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20613         interface for generating code, simplifies the code.
20614
20615 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20616
20617         * expression.cs (everywhere): Comment out return statements in ::Resolve
20618         methods to avoid the warnings.
20619
20620 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20621
20622         * driver.cs (parse): Report error 2001 if we can not open the
20623         source file.
20624
20625         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20626         not resolve it.
20627
20628         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20629         object. 
20630
20631         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20632         otherwise nested blocks end up with the same index.
20633
20634         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20635
20636         * expression.cs:  Instead of having FIXMEs in the Resolve
20637         functions, throw exceptions so it is obvious that we are facing a
20638         bug. 
20639
20640         * cs-parser.jay (invocation_expression): Pass Location information.
20641
20642         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20643         Use a basename for those routines because .NET does not like paths
20644         on them. 
20645
20646         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20647         already defined.
20648
20649 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20650
20651         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20652         are loading the correct data types (throws an exception if not).
20653         (TypeManager::InitCoreTypes): Use CoreLookupType
20654
20655         * expression.cs (Unary::ResolveOperator): return the child
20656         expression for expressions which are just +expr.
20657         (Unary::ResolveOperator): Return negative literals for -LITERAL
20658         expressions (otherwise they are Unary {Literal}).
20659         (Invocation::Badness): Take into account `Implicit constant
20660         expression conversions'.
20661
20662         * literal.cs (LongLiteral): Implement long literal class.
20663         (IntLiteral): export the `Value' of the intliteral. 
20664
20665 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20666
20667         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20668
20669         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20670         instead of 'Operator'
20671
20672         * expression.cs (Binary::ResolveOperator): Update accordingly.
20673         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20674         and 'Minus'
20675
20676         * cs-parser.jay (unary_expression): Update to use the new names.
20677
20678         * gen-treedump.cs (GetUnary): Same here.
20679
20680         * expression.cs (Unary::Resolve): Implement.
20681         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20682         operators are found instead of making noise ;-)
20683         (Unary::ResolveOperator): New method to do precisely the same thing which
20684         Binary::ResolveOperator does for Binary expressions.
20685         (Unary.method, .Arguments): Add.
20686         (Unary::OperName): Implement.   
20687         (Unary::ForceConversion): Copy and Paste !
20688
20689         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20690         a unary operator.
20691
20692         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20693         for the inbuilt operators. Only overloading works for now ;-)
20694
20695 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20696
20697         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20698         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20699
20700         * expression.cs (This::Emit): Implement. 
20701         (This::Resolve): Implement.
20702         (TypeOf:Resolve): Implement.
20703         (Expression::ResolveSimpleName): Add an implicit this to instance
20704         field references. 
20705         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20706         Bind instance variable to Field expressions.
20707         (FieldExpr::Instance): New field used to track the expression that
20708         represents the object instance.
20709         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20710         binding 
20711         (FieldExpr::Emit): Implement.
20712
20713         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20714         the last instruction contains a return opcode to avoid generating
20715         the last `ret' instruction (this generates correct code, and it is
20716         nice to pass the peverify output).
20717
20718         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20719         initializer for static and instance variables.
20720         (Constructor::Emit): Allow initializer to be null in the case of
20721         static constructors.  Only emit initializer for instance
20722         constructors. 
20723
20724         (TypeContainer::FindMembers): Return a null array if there are no
20725         matches.
20726
20727         Also fix the code for the MemberTypes.Method branch, as it was not
20728         scanning that for operators (or tried to access null variables before).
20729
20730         * assign.cs (Assign::Emit): Handle instance and static fields. 
20731
20732         * TODO: Updated.
20733
20734         * driver.cs: Stop compilation if there are parse errors.
20735
20736         * cs-parser.jay (constructor_declaration): Provide default base
20737         initializer for non-static constructors.
20738         (constructor_declarator): Do not provide a default base
20739         initializers if none was specified.
20740         Catch the fact that constructors should not have parameters.
20741
20742         * class.cs: Do not emit parent class initializers for static
20743         constructors, that should be flagged as an error.
20744
20745 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20746
20747         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20748         Move back code into TypeContainer::Populate.
20749
20750 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20751
20752         * class.cs (TypeContainer::AddConstructor): Fix the check to
20753         compare against Name, not Basename. 
20754         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20755
20756         * cs-parser.jay : Update accordingly.
20757
20758         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20759         for methods, don't forget to look into the operators too.
20760         (RegisterMethodBuilder): Helper method to take care of this for
20761         methods, constructors and operators.
20762         (Operator::Define): Completely revamp.
20763         (Operator.OperatorMethod, MethodName): New fields.
20764         (TypeContainer::Populate): Move the registering of builders into
20765         RegisterMethodBuilder.
20766         (Operator::Emit): Re-write.
20767
20768         * expression.cs (Binary::Emit): Comment out code path to emit method
20769         invocation stuff for the case when we have a user defined operator. I am
20770         just not able to get it right !
20771
20772 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20773
20774         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20775         argument. 
20776
20777         (Expression::MemberLookup): Provide a version that allows to
20778         specify the MemberTypes and BindingFlags. 
20779
20780         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20781         so it was not fetching variable information from outer blocks.
20782
20783         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20784         Beforefieldinit as it was buggy.
20785
20786         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20787         that Ravi put here.  
20788
20789         * class.cs (Constructor::Emit): Only emit if block is not null.
20790         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20791         deal with this by semantically definining it as if the user had
20792         done it.
20793
20794         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20795         constructors as we now "emit" them at a higher level.
20796
20797         (TypeContainer::DefineDefaultConstructor): Used to define the
20798         default constructors if none was provided.
20799
20800         (ConstructorInitializer): Add methods Resolve and Emit. 
20801
20802         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20803
20804 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20805
20806         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20807         the default constructor builder with our hashtable for methodbuilders
20808         to methodcores.
20809
20810         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20811         and argument_count is 0 in which case we have a match.
20812         (Binary::ResolveOperator): More null checking and miscellaneous coding
20813         style cleanup.
20814
20815 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20816
20817         * rootcontext.cs (IsNameSpace): Compare against null.
20818
20819         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20820
20821         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20822         and Unary::Operator.
20823
20824         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20825         accordingly.
20826
20827         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20828         we have overloaded operators.
20829         (Binary::ResolveOperator): Implement the part which does the operator overload
20830         resolution.
20831
20832         * class.cs (Operator::Emit): Implement.
20833         (TypeContainer::Emit): Emit the operators we have too.
20834
20835         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20836         the case when we have a user-defined operator.
20837
20838 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20839
20840         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20841
20842 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20843
20844         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20845         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20846         (Constructor::Emit): Implement.
20847         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20848         if we have no work to do. 
20849         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20850         Emit method.
20851
20852         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20853         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20854
20855         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20856         of parent.parent.
20857
20858 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20859
20860         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20861         in the source.
20862         (Tree::RecordNamespace): Method to do what the name says ;-)
20863         (Tree::Namespaces): Property to get at the namespaces hashtable.
20864
20865         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20866         keep track.
20867
20868         * rootcontext.cs (IsNamespace): Fixed it :-)
20869
20870 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20871
20872         * class.cs (TypeContainer::FindMembers): Add support for
20873         constructors. 
20874         (MethodCore): New class that encapsulates both the shared aspects
20875         of a Constructor and a Method.  
20876         (Method, Constructor): Factored pieces into MethodCore.
20877
20878         * driver.cs: Added --fatal which makes errors throw exceptions.
20879         Load System assembly as well as part of the standard library.
20880
20881         * report.cs: Allow throwing exceptions on errors for debugging.
20882
20883         * modifiers.cs: Do not use `parent', instead use the real type
20884         container to evaluate permission settings.
20885
20886         * class.cs: Put Ravi's patch back in.  He is right, and we will
20887         have to cope with the
20888
20889 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20890
20891         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20892         FamORAssem, not FamANDAssem.
20893
20894 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20895
20896         * driver.cs: Added --parse option that only parses its input files
20897         and terminates.
20898
20899         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20900         incorrect.  IsTopLevel is not used to tell whether an object is
20901         root_types or not (that can be achieved by testing this ==
20902         root_types).  But to see if this is a top-level *class* (not
20903         necessarly our "toplevel" container). 
20904
20905 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20906
20907         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20908         parent instead of a direct call to GetType.
20909
20910 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20911
20912         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20913         Modifiers.TypeAttr. This should just be a call to that method.
20914
20915         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20916         object so that we can determine if we are top-level or not.
20917
20918         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20919         TypeContainer too.
20920
20921         * enum.cs (Enum::Define): Ditto.
20922
20923         * modifiers.cs (FieldAttr): Re-write.
20924
20925         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20926         (TypeContainer::HaveStaticConstructor): New property to provide access
20927         to precisely that info.
20928
20929         * modifiers.cs (MethodAttr): Re-write.
20930         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20931
20932         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20933         of top-level types as claimed.
20934
20935 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20936
20937         * expression.cs (MemberLookup): Fruitless attempt to lookup
20938         constructors.  Maybe I need to emit default constructors?  That
20939         might be it (currently .NET emits this for me automatically).
20940         (Invocation::OverloadResolve): Cope with Arguments == null.
20941         (Invocation::EmitArguments): new function, shared by the new
20942         constructor and us.
20943         (Invocation::Emit): Handle static and instance methods.  Emit
20944         proper call instruction for virtual or non-virtual invocations.
20945         (New::Emit): Implement.
20946         (New::Resolve): Implement.
20947         (MemberAccess:Resolve): Implement.
20948         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20949         to track instances.
20950         (FieldExpr::Resolve): Set type.
20951
20952         * support.cs: Handle empty arguments.
20953                 
20954         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20955         SimpleLookup): Auxiliary routines to help parse a qualifier
20956         identifier.  
20957
20958         Update qualifier_identifier rule.
20959
20960         * codegen.cs: Removed debugging messages.
20961
20962         * class.cs: Make this a global thing, this acts just as a "key" to
20963         objects that we might have around.
20964
20965         (Populate): Only initialize method_builders_to_methods once.
20966
20967         * expression.cs (PropertyExpr): Initialize type from the
20968         PropertyType. 
20969
20970         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20971         Resolve pattern.  Attempt to implicitly convert value to boolean.
20972         Emit code.
20973
20974         * expression.cs: Set the type for the int32/int32 argument case.
20975         (Binary::ResolveOperator): Set the return type to boolean for
20976         comparission operators
20977
20978         * typemanager.cs: Remove debugging print code.
20979
20980         (Invocation::Resolve): resolve type.
20981
20982         * class.cs: Allocate a MemberInfo of the correct size, as the code
20983         elsewhere depends on the test to reflect the correct contents.
20984
20985         (Method::) Keep track of parameters, due to System.Reflection holes
20986
20987         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20988         mapping here.
20989
20990         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20991         of the exact size and return that.
20992
20993         (Class::LookupMethodByBuilder): New function that maps
20994         MethodBuilders to its methods.  Required to locate the information
20995         on methods because System.Reflection bit us again.
20996
20997         * support.cs: New file, contains an interface ParameterData and
20998         two implementations: ReflectionParameters and InternalParameters
20999         used to access Parameter information.  We will need to grow this
21000         as required.
21001
21002         * expression.cs (Invocation::GetParameterData): implement a cache
21003         and a wrapper around the ParameterData creation for methods. 
21004         (Invocation::OverloadResolve): Use new code.
21005
21006 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21007
21008         * class.cs (TypeContainer::EmitField): Remove and move into 
21009         (Field::Define): here and modify accordingly.
21010         (Field.FieldBuilder): New member.
21011         (TypeContainer::Populate): Update accordingly.
21012         (TypeContainer::FindMembers): Implement.
21013
21014 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * statement.cs: (VariableInfo::VariableType): New field to be
21017         initialized with the full type once it is resolved. 
21018
21019 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * parameter.cs (GetParameterInfo): Use a type cache to compute
21022         things only once, and to reuse this information
21023
21024         * expression.cs (LocalVariableReference::Emit): Implement.
21025         (OpcodeCast::Emit): fix.
21026
21027         (ParameterReference::Resolve): Implement.
21028         (ParameterReference::Emit): Implement.
21029
21030         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21031         that are expressions need to stay as Expressions.
21032
21033         * typemanager.cs (CSharpName): Returns the C# name of a type if
21034         possible. 
21035
21036         * expression.cs (Expression::ConvertImplicit): New function that
21037         implements implicit type conversions.
21038
21039         (Expression::ImplicitReferenceConversion): Implements implicit
21040         reference conversions.
21041
21042         (EmptyCast): New type for transparent casts.
21043
21044         (OpcodeCast): New type for casts of types that are performed with
21045         a sequence of bytecodes.
21046
21047         (BoxedCast): New type used for casting value types into reference
21048         types.  Emits a box opcode.
21049
21050         (Binary::DoNumericPromotions): Implements numeric promotions of
21051         and computation of the Binary::Type.
21052
21053         (Binary::EmitBranchable): Optimization.
21054
21055         (Binary::Emit): Implement code emission for expressions.
21056
21057         * typemanager.cs (TypeManager): Added two new core types: sbyte
21058         and byte.
21059
21060 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21061
21062         * class.cs (TypeContainer::FindMembers): Method which does exactly
21063         what Type.FindMembers does, only we don't have to use reflection. No
21064         implementation yet.
21065
21066         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21067         typecontainer objects as we need to get at them.
21068         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21069
21070         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21071         typecontainer object.
21072
21073         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21074         of just a Report object.
21075
21076 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21077
21078         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21079         "remove_"
21080         (TypeContainer::Populate): Now define the delegates of the type too.
21081         (TypeContainer.Delegates): Property to access the list of delegates defined
21082         in the type.
21083
21084         * delegates.cs (Delegate::Define): Implement partially.
21085
21086         * modifiers.cs (TypeAttr): Handle more flags.
21087
21088 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21089
21090         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21091         and not <=
21092         (Operator::Define): Re-write logic to get types by using the LookupType method
21093         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21094         (Indexer::Define): Ditto.
21095         (Event::Define): Ditto.
21096         (Property::Define): Ditto.
21097
21098 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21099
21100         * class.cs (TypeContainer::Populate): Now define operators too. 
21101         (TypeContainer.Operators): New property to access the list of operators
21102         in a type.
21103         (Operator.OperatorMethodBuilder): New member to hold the method builder
21104         for the operator we are defining.
21105         (Operator::Define): Implement.
21106
21107 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21108
21109         * class.cs (Event::Define): Make the prefixes of the accessor methods
21110         addOn_ and removeOn_ 
21111
21112         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21113         of the location being passed in too. Ideally, this should go later since all
21114         error reporting should be done through the Report object.
21115
21116         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21117         (Populate): Iterate thru the indexers we have and define them too.
21118         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21119         for the get and set accessors.
21120         (Indexer::Define): Implement.
21121
21122 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21123
21124         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21125         my previous implementation, did not work.
21126
21127         * typemanager.cs: Add a couple of missing types (the longs).
21128
21129         * literal.cs: Use TypeManager.bool_type instead of getting it.
21130
21131         * expression.cs (EventExpr): New kind of expressions.
21132         (Expressio::ExprClassFromMemberInfo): finish
21133
21134 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21135
21136         * assign.cs: Emit stores to static fields differently.
21137
21138 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21139
21140         * Merge in changes and adjust code to tackle conflicts. Backed out my
21141         code in Assign::Resolve ;-) 
21142
21143 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21144
21145         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21146         instead Report.Error and also pass in the location.
21147         (CSharpParser::Lexer): New readonly property to return the reference
21148         to the Tokenizer object.
21149         (declare_local_variables): Use Report.Error with location instead of plain 
21150         old error.
21151         (CheckDef): Ditto.
21152
21153         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21154         (Operator.CheckBinaryOperator): Ditto.
21155
21156         * cs-parser.jay (operator_declarator): Update accordingly.
21157
21158         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21159         (CheckBinaryOperator): Same here.
21160
21161         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21162         on the name without any prefixes of namespace names etc. This is because we
21163         already might have something already fully qualified like 
21164         'System.Console.WriteLine'
21165
21166         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21167
21168 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21169
21170         * cs-tokenizer.cs (location): Return a string which also contains
21171         the file name.
21172
21173         * expression.cs (ElementAccess): New class for expressions of the
21174         type 'element access.'
21175         (BaseAccess): New class for expressions of the type 'base access.'
21176         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21177         respectively.
21178
21179         * cs-parser.jay (element_access): Implement action.
21180         (base_access): Implement actions.
21181         (checked_expression, unchecked_expression): Implement.
21182
21183         * cs-parser.jay (local_variable_type): Correct and implement.
21184         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21185
21186         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21187
21188         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21189         name and the specifiers.
21190
21191         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21192
21193         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21194         making them all public ;-)
21195
21196         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21197         class anyways.
21198
21199 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21200
21201         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21202         PropertyExprs.
21203         (FieldExpr, PropertyExprs): New resolved expressions.
21204         (SimpleName::MemberStaticCheck): Perform static checks for access
21205         to non-static fields on static methods. Maybe this should be
21206         generalized for MemberAccesses. 
21207         (SimpleName::ResolveSimpleName): More work on simple name
21208         resolution. 
21209
21210         * cs-parser.jay (primary_expression/qualified_identifier): track
21211         the parameter index.
21212
21213         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21214         (EmitContext::EmitBoolExpression): Chain to expression generation
21215         instead of temporary hack.
21216         (::EmitStatementExpression): Put generic expression code generation.
21217
21218         * assign.cs (Assign::Emit): Implement variable assignments to
21219         local variables, parameters and fields.
21220
21221 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21222
21223         * statement.cs (Block::GetVariableInfo): New method, returns the
21224         VariableInfo for a variable name in a block.
21225         (Block::GetVariableType): Implement in terms of GetVariableInfo
21226
21227         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21228         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21229
21230 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21231
21232         * cs-parser.jay (operator_declaration): Continue on my quest : update
21233         to take attributes argument.
21234         (event_declaration): Ditto.
21235         (enum_declaration): Ditto.
21236         (indexer_declaration): Ditto.
21237
21238         * class.cs (Operator::Operator): Update constructor accordingly.
21239         (Event::Event): Ditto.
21240
21241         * delegate.cs (Delegate::Delegate): Same here.
21242
21243         * enum.cs (Enum::Enum): Same here.
21244
21245 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21246
21247         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21248
21249         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21250
21251         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21252         being passed around as an arraylist.
21253         (Attributes::AddAttribute): Method to add attribute sections.
21254
21255         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21256         (struct_declaration): Update accordingly.
21257         (constant_declaration): Update.
21258         (field_declaration): Update.
21259         (method_header): Update.
21260         (fixed_parameter): Update.
21261         (parameter_array): Ditto.
21262         (property_declaration): Ditto.
21263         (destructor_declaration): Ditto.
21264
21265         * class.cs (Struct::Struct): Update constructors accordingly.
21266         (Class::Class): Ditto.
21267         (Field::Field): Ditto.
21268         (Method::Method): Ditto.
21269         (Property::Property): Ditto.
21270         (TypeContainer::OptAttribute): update property's return type.
21271
21272         * interface.cs (Interface.opt_attributes): New member.
21273         (Interface::Interface): Update to take the extra Attributes argument.
21274
21275         * parameter.cs (Parameter::Parameter): Ditto.
21276
21277         * constant.cs (Constant::Constant): Ditto.
21278
21279         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21280         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21281         the attributes as a parameter.
21282         (InterfaceProperty): Update constructor call.
21283         (InterfaceEvent): Ditto.
21284         (InterfaceMethod): Ditto.
21285         (InterfaceIndexer): Ditto.
21286
21287         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21288         pass the attributes too.
21289         (interface_event_declaration): Ditto.
21290         (interface_property_declaration): Ditto.
21291         (interface_method_declaration): Ditto.
21292         (interface_declaration): Ditto.
21293
21294 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21295
21296         * class.cs (Method::Define): Track the "static Main" definition to
21297         create an entry point. 
21298
21299         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21300         EntryPoint if we find it. 
21301
21302         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21303         (EmitContext::ig): Make this variable public.
21304
21305         * driver.cs: Make the default output file be the first file name
21306         with the .exe extension.  
21307
21308         Detect empty compilations
21309
21310         Handle various kinds of output targets.  Handle --target and
21311         rename -t to --dumper.
21312
21313         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21314         methods inherited from Expression return now an Expression.  This
21315         will is used during the tree rewriting as we resolve them during
21316         semantic analysis.
21317
21318         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21319         the spec.  Missing entirely is the information about
21320         accessability of elements of it.
21321
21322         (Expression::ExprClassFromMemberInfo): New constructor for
21323         Expressions that creates a fully initialized Expression based on
21324         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21325         a Type.
21326
21327         (Invocation::Resolve): Begin implementing resolution of invocations.
21328
21329         * literal.cs (StringLiteral):  Implement Emit.
21330
21331 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21332
21333         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21334         member.
21335
21336 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21337
21338         * cs-parser.jay (attribute_arguments): Implement actions.
21339         (attribute): Fix bug in production. Implement action.
21340         (attribute_list): Implement.
21341         (attribute_target): Implement.
21342         (attribute_target_specifier, opt_target_specifier): Implement
21343         (CheckAttributeTarget): New method to check if the attribute target
21344         is valid.
21345         (attribute_section): Implement.
21346         (opt_attributes): Implement.
21347
21348         * attribute.cs : New file to handle attributes.
21349         (Attribute): Class to hold attribute info.
21350
21351         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21352         (attribute_section): Modify production to use 2 different rules to 
21353         achieve the same thing. 1 s/r conflict down !
21354         Clean out commented, useless, non-reducing dimension_separator rules.
21355
21356         * class.cs (TypeContainer.attributes): New member to hold list
21357         of attributes for a type.
21358         (Struct::Struct): Modify to take one more argument, the attribute list.
21359         (Class::Class): Ditto.
21360         (Field::Field): Ditto.
21361         (Method::Method): Ditto.
21362         (Property::Property): Ditto.
21363
21364         * cs-parser.jay (struct_declaration): Update constructor call to
21365         pass in the attributes too.
21366         (class_declaration): Ditto.
21367         (constant_declaration): Ditto.
21368         (field_declaration): Ditto.
21369         (method_header): Ditto.
21370         (fixed_parameter): Ditto.
21371         (parameter_array): Ditto.
21372         (property_declaration): Ditto.
21373
21374         * constant.cs (Constant::Constant): Update constructor similarly.
21375         Use System.Collections.
21376
21377         * parameter.cs (Parameter::Parameter): Update as above.
21378
21379 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21380
21381         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21382         (TypeContainer.delegates): New member to hold list of delegates.
21383
21384         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21385         this time as I seem to be on crack ;-)
21386
21387 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21388
21389         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21390         tell whether an identifier represents a namespace.
21391
21392         * expression.cs (NamespaceExpr): A namespace expression, used only
21393         temporarly during expression resolution.
21394         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21395         utility functions to resolve names on expressions.
21396
21397 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21398
21399         * codegen.cs: Add hook for StatementExpressions. 
21400
21401         * class.cs: Fix inverted test for static flag in methods.
21402
21403 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21404
21405         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21406         to make it coincide with MS' number.
21407         (Operator::CheckBinaryOperator): Ditto.
21408
21409         * ../errors/errors.txt : Remove error numbers added earlier.
21410
21411         * ../errors/cs1019.cs : Test case for error # 1019
21412
21413         * ../errros/cs1020.cs : Test case for error # 1020
21414
21415         * cs-parser.jay : Clean out commented cruft.
21416         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21417         used anywhere - non-reducing rule.
21418         (namespace_declarations): Non-reducing rule - comment out.
21419
21420         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21421         with TypeContainer::AddEnum.
21422
21423         * delegate.cs : New file for delegate handling classes.
21424         (Delegate): Class for declaring delegates.
21425
21426         * makefile : Update.
21427
21428         * cs-parser.jay (delegate_declaration): Implement.
21429
21430 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21431
21432         * class.cs (Event::Define): Implement.
21433         (Event.EventBuilder): New member.
21434
21435         * class.cs (TypeContainer::Populate): Update to define all enums and events
21436         we have.
21437         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21438         readonly fields for all these cases ?
21439
21440 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21441
21442         * class.cs (Property): Revamp to use the convention of making fields readonly.
21443         Accordingly modify code elsewhere.
21444
21445         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21446         the Define method of the Property class.
21447
21448         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21449         trivial bug.
21450         (TypeContainer::Populate): Update to define all the properties we have. Also
21451         define all enumerations.
21452
21453         * enum.cs (Define): Implement.
21454
21455 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21456
21457         * cs-parser.jay (overloadable_operator): The semantic value is an
21458         enum of the Operator class.
21459         (operator_declarator): Implement actions.
21460         (operator_declaration): Implement.
21461
21462         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21463         validity of definitions.
21464         (Operator::CheckBinaryOperator): Static method to check for binary operators
21465         (TypeContainer::AddOperator): New method to add an operator to a type.
21466
21467         * cs-parser.jay (indexer_declaration): Added line to actually call the
21468         AddIndexer method so it gets added ;-)
21469
21470         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21471         already taken care of by the MS compiler ?  
21472
21473 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21474
21475         * class.cs (Operator): New class for operator declarations.
21476         (Operator::OpType): Enum for the various operators.
21477
21478 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21479
21480         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21481         ostensibly handle this in semantic analysis.
21482
21483         * cs-parser.jay (general_catch_clause): Comment out
21484         (specific_catch_clauses, specific_catch_clause): Ditto.
21485         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21486         (catch_args, opt_catch_args): New productions.
21487         (catch_clause): Rewrite to use the new productions above
21488         (catch_clauses): Modify accordingly.
21489         (opt_catch_clauses): New production to use in try_statement
21490         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21491         and re-write the code in the actions to extract the specific and
21492         general catch clauses by being a little smart ;-)
21493
21494         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21495         Hooray, try and catch statements parse fine !
21496
21497 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21498
21499         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21500         string from the hashtable of variables.
21501
21502         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21503         I end up making that mistake ;-)
21504         (catch_clauses): Fixed gross error which made Key and Value of the 
21505         DictionaryEntry the same : $1 !!
21506
21507 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21508
21509         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21510
21511         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21512         when the add and remove accessors are specified. 
21513
21514 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21515
21516         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21517         information about indexer_declarator.
21518         (indexer_declarator): Implement actions.
21519         (parsing_indexer): New local boolean used to keep track of whether
21520         we are parsing indexers or properties. This is necessary because 
21521         implicit_parameters come into picture even for the get accessor in the 
21522         case of an indexer.
21523         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21524
21525         * class.cs (Indexer): New class for indexer declarations.
21526         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21527         (TypeContainer::indexers): New member to hold list of indexers for the
21528         type.
21529
21530 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21531
21532         * cs-parser.jay (add_accessor_declaration): Implement action.
21533         (remove_accessor_declaration): Implement action.
21534         (event_accessors_declaration): Implement
21535         (variable_declarators): swap statements for first rule - trivial.
21536
21537         * class.cs (Event): New class to hold information about event
21538         declarations.
21539         (TypeContainer::AddEvent): New method to add an event to a type
21540         (TypeContainer::events): New member to hold list of events.
21541
21542         * cs-parser.jay (event_declaration): Implement actions.
21543
21544 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21545
21546         * cs-parser.jay (dim_separators): Implement. Make it a string
21547         concatenating all the commas together, just as they appear.
21548         (opt_dim_separators): Modify accordingly
21549         (rank_specifiers): Update accordingly. Basically do the same
21550         thing - instead, collect the brackets here.
21551         (opt_rank_sepcifiers): Modify accordingly.
21552         (array_type): Modify to actually return the complete type string
21553         instead of ignoring the rank_specifiers.
21554         (expression_list): Implement to collect the expressions
21555         (variable_initializer): Implement. We make it a list of expressions
21556         essentially so that we can handle the array_initializer case neatly too.
21557         (variable_initializer_list): Implement.
21558         (array_initializer): Make it a list of variable_initializers
21559         (opt_array_initializer): Modify accordingly.
21560
21561         * expression.cs (New::NType): Add enumeration to help us
21562         keep track of whether we have an object/delegate creation
21563         or an array creation.
21564         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21565         members to hold data about array creation.
21566         (New:New): Modify to update NewType
21567         (New:New): New Overloaded contructor for the array creation
21568         case.
21569
21570         * cs-parser.jay (array_creation_expression): Implement to call
21571         the overloaded New constructor.
21572
21573 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21574
21575         * class.cs (TypeContainer::Constructors): Return member
21576         constructors instead of returning null.
21577
21578 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21579
21580         * typemanager.cs (InitCoreTypes): Initialize the various core
21581         types after we have populated the type manager with the user
21582         defined types (this distinction will be important later while
21583         compiling corlib.dll)
21584
21585         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21586         on Expression Classification.  Now all expressions have a method
21587         `Resolve' and a method `Emit'.
21588
21589         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21590         generation from working.     Also add some temporary debugging
21591         code. 
21592
21593 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21594
21595         * codegen.cs: Lots of code generation pieces.  This is only the
21596         beginning, will continue tomorrow with more touches of polish.  We
21597         handle the fundamentals of if, while, do, for, return.  Others are
21598         trickier and I need to start working on invocations soon.
21599
21600         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21601         s.InitStatement. 
21602
21603         * codegen.cs (EmitContext): New struct, used during code
21604         emission to keep a context.   Most of the code generation will be
21605         here. 
21606
21607         * cs-parser.jay: Add embedded blocks to the list of statements of
21608         this block.  So code generation proceeds in a top down fashion.
21609
21610 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21611
21612         * statement.cs: Add support for multiple child blocks.
21613
21614 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21615
21616         * codegen.cs (EmitCode): New function, will emit the code for a
21617         Block of code given a TypeContainer and its ILGenerator. 
21618
21619         * statement.cs (Block): Standard public readonly optimization.
21620         (Block::Block constructors): Link children. 
21621         (Block::Child): Child Linker.
21622         (Block::EmitVariables): Emits IL variable declarations.
21623
21624         * class.cs: Drop support for MethodGroups here, delay until
21625         Semantic Analysis.
21626         (Method::): Applied the same simplification that I did before, and
21627         move from Properties to public readonly fields.
21628         (Method::ParameterTypes): Returns the parameter types for the
21629         function, and implements a cache that will be useful later when I
21630         do error checking and the semantic analysis on the methods is
21631         performed.
21632         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21633         and made a method, optional argument tells whether this is a class
21634         or a structure to apply the `has-this' bit.
21635         (Method::GetCallingConvention): Implement, returns the calling
21636         convention. 
21637         (Method::Define): Defines the type, a second pass is performed
21638         later to populate the methods.
21639
21640         (Constructor::ParameterTypes): implement a cache similar to the
21641         one on Method::ParameterTypes, useful later when we do semantic
21642         analysis. 
21643
21644         (TypeContainer::EmitMethod):  New method.  Emits methods.
21645
21646         * expression.cs: Removed MethodGroup class from here.
21647
21648         * parameter.cs (Parameters::GetCallingConvention): new method.
21649
21650 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * class.cs (TypeContainer::Populate): Drop RootContext from the
21653         argument. 
21654
21655         (Constructor::CallingConvention): Returns the calling convention.
21656         (Constructor::ParameterTypes): Returns the constructor parameter
21657         types. 
21658
21659         (TypeContainer::AddConstructor): Keep track of default constructor
21660         and the default static constructor.
21661
21662         (Constructor::) Another class that starts using `public readonly'
21663         instead of properties. 
21664
21665         (Constructor::IsDefault): Whether this is a default constructor. 
21666
21667         (Field::) use readonly public fields instead of properties also.
21668
21669         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21670         track of static constructors;  If none is used, turn on
21671         BeforeFieldInit in the TypeAttributes. 
21672
21673         * cs-parser.jay (opt_argument_list): now the return can be null
21674         for the cases where there are no arguments. 
21675
21676         (constructor_declarator): If there is no implicit `base' or
21677         `this', then invoke the default parent constructor. 
21678
21679         * modifiers.cs (MethodAttr): New static function maps a set of
21680         modifiers flags into a MethodAttributes enum
21681         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21682         MethodAttr, TypeAttr to represent the various mappings where the
21683         modifiers are used.
21684         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21685
21686 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21687
21688         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21689         method arguments.
21690
21691         * interface.cs (PopulateIndexer): Implemented the code generator
21692         for interface indexers.
21693
21694 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21695
21696         * interface.cs (InterfaceMemberBase): Now we track the new status
21697         here.  
21698
21699         (PopulateProperty): Implement property population.  Woohoo!  Got
21700         Methods and Properties going today. 
21701
21702         Removed all the properties for interfaces, and replaced them with
21703         `public readonly' fields. 
21704
21705 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21706
21707         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21708         initialize their hashtables/arraylists only when they are needed
21709         instead of doing this always.
21710
21711         * parameter.cs: Handle refs and out parameters.
21712
21713         * cs-parser.jay: Use an ArrayList to construct the arguments
21714         instead of the ParameterCollection, and then cast that to a
21715         Parameter[] array.
21716
21717         * parameter.cs: Drop the use of ParameterCollection and use
21718         instead arrays of Parameters.
21719
21720         (GetParameterInfo): Use the Type, not the Name when resolving
21721         types. 
21722
21723 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21724
21725         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21726         and instead use public readonly fields.
21727
21728         * class.cs: Put back walking code for type containers.
21729
21730 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21731
21732         * class.cs (MakeConstant): Code to define constants.
21733
21734         * rootcontext.cs (LookupType): New function.  Used to locate types 
21735
21736
21737 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21738
21739         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21740         this System.Reflection code is.  Kudos to Microsoft
21741
21742         * typemanager.cs: Implement a type cache and avoid loading all
21743         types at boot time.  Wrap in LookupType the internals.  This made
21744         the compiler so much faster.  Wow.  I rule!
21745
21746         * driver.cs: Make sure we always load mscorlib first (for
21747         debugging purposes, nothing really important).
21748
21749         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21750         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21751
21752         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21753         on namespaces that have been imported using the `using' keyword.
21754
21755         * class.cs (TypeContainer::TypeAttr): Virtualize.
21756         (Class::TypeAttr): Return attributes suitable for this bad boy.
21757         (Struct::TypeAttr): ditto.
21758         Handle nested classes.
21759         (TypeContainer::) Remove all the type visiting code, it is now
21760         replaced with the rootcontext.cs code
21761
21762         * rootcontext.cs (GetClassBases): Added support for structs. 
21763
21764 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21765
21766         * interface.cs, statement.cs, class.cs, parameter.cs,
21767         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21768         Drop use of TypeRefs, and use strings instead.
21769
21770 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21771
21772         * rootcontext.cs: 
21773
21774         * class.cs (Struct::Struct): set the SEALED flags after
21775         checking the modifiers.
21776         (TypeContainer::TypeAttr): new property, returns the
21777         TypeAttributes for a class.  
21778
21779         * cs-parser.jay (type_list): Oops, list production was creating a
21780         new list of base types.
21781
21782         * rootcontext.cs (StdLib): New property.
21783         (GetInterfaceTypeByName): returns an interface by type name, and
21784         encapsulates error handling here.
21785         (GetInterfaces): simplified.
21786         (ResolveTree): Encapsulated all the tree resolution here.
21787         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21788         types. 
21789
21790         * driver.cs: Add support for --nostdlib, to avoid loading the
21791         default assemblies.
21792         (Main): Do not put tree resolution here. 
21793
21794         * rootcontext.cs: Beginning of the class resolution.
21795
21796 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21797
21798         * rootcontext.cs: Provide better error reporting. 
21799
21800         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21801
21802         * rootcontext.cs (CreateInterface): Handle the case where there
21803         are no parent interfaces.
21804
21805         (CloseTypes): Routine to flush types at the end.
21806         (CreateInterface): Track types.
21807         (GetInterfaces): Returns an array of Types from the list of
21808         defined interfaces.
21809
21810         * typemanager.c (AddUserType): Mechanism to track user types (puts
21811         the type on the global type hash, and allows us to close it at the
21812         end). 
21813
21814 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21815
21816         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21817         RecordInterface instead.
21818
21819         * cs-parser.jay: Updated to reflect changes above.
21820
21821         * decl.cs (Definition): Keep track of the TypeBuilder type that
21822         represents this type here.  Not sure we will use it in the long
21823         run, but wont hurt for now.
21824
21825         * driver.cs: Smaller changes to accomodate the new code.
21826
21827         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21828         when done. 
21829
21830         * rootcontext.cs (CreateInterface):  New method, used to create
21831         the System.TypeBuilder type for interfaces.
21832         (ResolveInterfaces): new entry point to resolve the interface
21833         hierarchy. 
21834         (CodeGen): Property, used to keep track of the code generator.
21835
21836 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21837
21838         * cs-parser.jay: Add a second production for delegate_declaration
21839         with `VOID'.
21840
21841         (enum_body): Put an opt_comma here instead of putting it on
21842         enum_body or enum_member_declarations so we can handle trailing
21843         commas on enumeration members.  Gets rid of a shift/reduce.
21844
21845         (type_list): Need a COMMA in the middle.
21846
21847         (indexer_declaration): Tell tokenizer to recognize get/set
21848
21849         * Remove old targets.
21850
21851         * Re-add the parser target.
21852
21853 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21854
21855         * cs-parser.jay: Add precendence rules for a number of operators
21856         ot reduce the number of shift/reduce conflicts in the grammar.
21857
21858 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21859
21860         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21861         and put it here.
21862
21863         Get rid of old crufty code.
21864
21865         * rootcontext.cs: Use this to keep track of the parsed
21866         representation and the defined types available to the program. 
21867
21868         * gen-treedump.cs: adjust for new convention.
21869
21870         * type.cs: Split out the type manager, and the assembly builder
21871         from here. 
21872
21873         * typemanager.cs: the type manager will live here now.
21874
21875         * cil-codegen.cs: And the code generator here. 
21876
21877 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21878
21879         * makefile: Fixed up for easy making.
21880
21881 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21882
21883         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21884         the 
21885
21886         (unary_expression): Expand pre_increment_expression and
21887         post_decrement_expression to reduce a shift/reduce.
21888
21889 2001-07-11  Simon Cozens
21890
21891         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21892
21893         Improve allow_keyword_as_indent name.
21894
21895 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21896
21897         * Adjustments for Beta2. 
21898
21899 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21900
21901         * decl.cs: Added `Define' abstract method.
21902         (InTransit): new property, used to catch recursive definitions. 
21903
21904         * interface.cs: Implement `Define'. 
21905
21906         * modifiers.cs: Map Modifiers.constants to
21907         System.Reflection.TypeAttribute flags.
21908
21909         * class.cs: Keep track of types and user-defined types.
21910         (BuilderInit): New method for creating an assembly
21911         (ResolveType): New function to launch the resolution process, only
21912         used by interfaces for now.
21913
21914         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21915         that are inserted into the name space. 
21916
21917 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21918
21919         * ARGH.  I have screwed up my tree so many times due to the use of
21920         rsync rather than using CVS.  Going to fix this at once. 
21921
21922         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21923         load types.
21924
21925 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21926
21927         * Experiment successful: Use System.Type rather that our own
21928         version of Type.  
21929
21930 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * cs-parser.jay: Removed nsAliases from here.
21933
21934         Use new namespaces, handle `using XXX;' 
21935
21936         * namespace.cs: Reimplemented namespace handling, use a recursive
21937         definition of the class.  Now we can keep track of using clauses
21938         and catch invalid using clauses.
21939
21940 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21941
21942         * gen-treedump.cs: Adapted for all the renaming.
21943
21944         * expression.cs (Expression): this class now has a Type property
21945         which returns an expression Type.
21946
21947         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21948         `Type', as this has a different meaning now in the base
21949
21950 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * interface.cs, class.cs: Removed from all the sources the
21953         references to signature computation, as we can not do method
21954         signature computation during the parsing time, as we are not
21955         trying to solve at that point distinguishing:
21956
21957         class X {
21958                 void a (Blah x) {}
21959                 void a (NS.Blah x) {}
21960         }
21961
21962         Which depending on the context might be valid or not, as we do not
21963         know if Blah is the same thing as NS.Blah at that point.
21964
21965         * Redid everything so the code uses TypeRefs now instead of
21966         Types.  TypeRefs are just temporary type placeholders, that need
21967         to be resolved.  They initially have a pointer to a string and the
21968         current scope in which they are used.  This is used later by the
21969         compiler to resolve the reference to an actual Type. 
21970
21971         * DeclSpace is no longer a CIR.Type, and neither are
21972         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21973         are all DeclSpaces, but no Types. 
21974
21975         * type.cs (TypeRefManager): This implements the TypeRef manager,
21976         which keeps track of all the types that need to be resolved after
21977         the parsing has finished. 
21978
21979 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21980
21981         * ARGH.  We are going to have to store `foreach' as a class rather
21982         than resolving it, as we need to verify error 1579 after name
21983         resolution.   *OR* we could keep a flag that says `This request to
21984         IEnumerator comes from a foreach statement' which we can then use
21985         to generate the error.
21986
21987 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21988
21989         * class.cs (TypeContainer.AddMethod): we now add methods to the
21990         MethodGroup instead of the method hashtable.  
21991
21992         * expression.cs: Add MethodGroup abstraction, which gets us one
21993         step closer to the specification in the way we handle method
21994         declarations.  
21995
21996         * cs-parser.jay (primary_expression): qualified_identifier now
21997         tried to match up an identifier to a local variable reference or
21998         to a parameter reference.
21999
22000         current_local_parameters is now a parser global variable that
22001         points to the current parameters for the block, used during name
22002         lookup.
22003
22004         (property_declaration): Now creates an implicit `value' argument to
22005         the set accessor.
22006
22007 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22008
22009         * parameter.cs: Do not use `param' arguments as part of the
22010         signature, per the spec.
22011
22012 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * decl.cs: Base class for classes, structs and interfaces.  This
22015         is the "Declaration Space" 
22016
22017         * cs-parser.jay: Use CheckDef for checking declaration errors
22018         instead of having one on each function.
22019
22020         * class.cs: Factor out some code for handling error handling in
22021         accordance to the "Declarations" section in the "Basic Concepts"
22022         chapter in the ECMA C# spec.
22023
22024         * interface.cs: Make all interface member classes derive from
22025         InterfaceMemberBase.
22026
22027 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22028
22029         * Many things: all interfaces are parsed and generated in
22030         gen-treedump.  Support for member variables, constructors,
22031         destructors, properties, constants is there.
22032
22033         Beginning of the IL backend, but very little done, just there for
22034         testing purposes. 
22035
22036 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22037
22038         * cs-parser.jay: Fix labeled statement.
22039
22040         * cs-tokenizer.cs (escape): Escape " and ' always.
22041         ref_line, ref_name: keep track of the line/filename as instructed
22042         by #line by the compiler.
22043         Parse #line.
22044
22045 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22046
22047         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22048         to match the values in System.CodeDOM.
22049
22050         Divid renamed to Divide.
22051
22052         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22053         statements. 
22054         (Statements.set): remove.
22055
22056         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22057         statements. 
22058
22059         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22060         falseStatements always have valid values. 
22061
22062         * cs-parser.jay: Use System.CodeDOM now.
22063