In ilasm/codegen:
[mono.git] / mcs / mcs / ChangeLog
1 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #75636.
4         * expression.cs (Invocation.OverloadResolve): Replace reflected
5         override methods with their base virtual methods, rather than
6         skipping over them.
7         * typemanager.cs (TypeManager.GetOverride): New.
8
9 2006-01-05  Jb Evain  <jbevain@gmail.com>
10
11         * class.cs (Property.Define, Indexer.Define): do not tag the
12         properties as SpecialName | RTSpecialName.
13
14 2006-01-04  Miguel de Icaza  <miguel@novell.com>
15
16         * class.cs (MethodCore.IsDuplicateImplementation): This method was
17         doing a low-level comparission of parameter types.  It was lacking
18         a check for __argslist. 
19
20 2005-12-30  Miguel de Icaza  <miguel@novell.com>
21
22         * expression.cs (ParameterReference.DoResolveBase): Allow
23         reference parameters if they are local to this block. 
24
25         This allows the ref and out parameters of a delegate to be used in
26         an anonymous method, for example:
27
28         delegate void set (out int x);
29
30         set s = delegate (out int x){
31                 x = 0;
32         };
33
34         This is used by functionality introduced late in the C# language.
35         
36         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
37         method that take ref and out parameters. 
38
39         Fixes #77119 which was a late change in the spec.
40
41 2005-12-23  Miguel de Icaza  <miguel@novell.com>
42
43         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
44         parent if its the same scope.  Fixes #77060.
45
46 2005-12-21  Miguel de Icaza  <miguel@novell.com>
47
48         * driver.cs: Report the case of no source files and no -out:
49         argument provided.
50
51 2005-12-20  Raja R Harinath  <rharinath@novell.com>
52
53         Fix #77035.
54         * expression.cs (ComposedCast.GetSignatureForError): Define.
55
56 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
57
58         Fix #76995
59
60         * namespace.cs (NamespaceEntry): Add extern_aliases as a
61         ListDictionary, to contain the ExternAliasEntry entries (in
62         addition to the NamespaceEntry.aliases hashtable). This field is
63         shared between the original entry and its doppelganger (bodyless 
64         copy of it).
65         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
66         extern_aliases field.
67         (NamespaceEntry.Lookup): Move the IsImplicit check after the
68         lookup in extern_aliases.
69
70 2005-12-16  Raja R Harinath  <rharinath@novell.com>
71
72         Fix #77006.
73         * class.cs (TypeContainer.Mark_HasEquals): New.
74         (TypeContainer.Mark_HasGetHashCode): New.
75         (ClassPart): Override them.
76         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
77
78         Fix #77008.
79         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
80         'parent' argument to the base constructor.
81
82         Remove all mention of TypeContainer from decl.cs.
83         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
84         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
85         (DeclSpace.DeclSpace): Likewise.
86         (DeclSpace.DefineMembers): Remove unused argument.
87         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
88         debugging check -- we don't care if the debug code throws an
89         InvalidCastException instead of an InternalErrorException.
90         * class.cs (TypeContainer.DefineMembers): Update to changes.
91         (TypeContainer.DoDefineMembers): Likewise.
92         (TypeContainer.GetMethods): Likewise.
93         (PropertyMember.Define): Likewise.
94         (MemberBase.Parent): New property that forwards to
95         MemberCore.Parent, but ensures that we get a TypeContainer.
96         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
97         (RootContext.PopulateTypes): Likewise.  Remove special case code
98         for !RootContext.StdLib: DefineMembers is idempotent.
99
100 2005-12-14  Miguel de Icaza  <miguel@novell.com>
101
102         * convert.cs (ExplicitConversionCore): Check the return value from
103         ExplicitConversionCore which can return null on failure.  Fixes #76914
104
105 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
106
107         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
108
109 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
110
111         * doc.cs : The search for referenced namespace was insufficient to
112           get global one as it used to do. Fixed bug #76965.
113
114 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
115
116         * doc.cs : check name in cref in the last phase that whether it is
117           namespace or not.
118
119 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
120
121         * cs-tokenizer.cs : reverted the latest change: it somehow broke
122           Mono.C5.
123
124 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
125
126         * doc.cs : so it turned out that we cannot skip override check for 
127           interface members. Fixed bug #76954.
128
129 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
130
131         * cs-tokenizer.cs : fixed bug #75984:
132           - #warning and #error should not be handled when the source line
133             is disabled.
134           - #line is not checked strictly when the source line is disabled.
135           - #define and #undef is on the other hand checked strictly at any
136             state.
137
138 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
139
140         * cs-tokenizer.cs : missing Location (actually, filename) in one of
141           CS1027 report.
142
143 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
144
145         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
146
147         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
148         event initializers.
149         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
150         (FieldBase.Initializer): Initializer is now optional.
151         (EventField.Define): Only event field can have initializer.
152
153         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
154
155         * const.cs (Const): Reuse initializer.
156
157         * cs-parser.jay: Updated after FieldBase changes.
158         Added current_array_type to simplify array initializers.
159
160         * ecore.cs (NullCast.IsDefaultValue): Implemented.
161
162         * expression.cs, iterators.cs: Updated.
163
164         * namespace.cs (NamespaceEntry): Made UsingFound private.
165
166 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
167
168         * parameterCollection.cs: Obsolete, removed.
169         * parser.cs: Obsolete, removed.
170
171 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
172
173         Fix #76849.
174         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
175
176         * enum.cs (Enum.Define): Set obsolete context here.
177
178 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
179
180         * doc.cs :
181           - FindDocumentedMember() now expects 1) paramList as null
182             when "we don't have to check the number of parameters" and
183             2) Type.EmptyTypes when "there is no arguments".
184           - Introduced FoundMember struct to hold the exact type which was
185             used to find the documented member (the above change broke
186             test-xml-044; it might be better just to use DeclaringType than
187             what MS does, like this change does, but it depends on usage.)
188
189 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
190
191         * doc.cs : documented member might be from DeclaringType for nested
192           types. Fixed bug #76782.
193
194 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
195
196         * anonymous.cs: Have the param code handle leaving copies on the
197         stack etc. Allows anonymous params to take part in the assignment
198         code (++, +=, etc). Fixes bug #76550
199
200         * expression.cs: Handle the prepare_for_load/leave_copy by passing
201         it down to the anon code.
202
203         * iterators.cs: Use dummy var here
204
205         * codegen.cs: Handle new vars
206
207 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
208
209         Fix #76849.
210         * class.cs (MethodData.Define): Set proper Obsolete context.
211
212         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
213         obsolete context.
214         (FieldExpr.DoResolve): Ditto.
215
216 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
217
218         Fix #76849.
219         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
220         parent is not obsolete.
221
222 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
223
224         * doc.cs : (FindDocumentedMember) find parameterless members first
225           and get CS0419 in the early stage. Fixed first case of bug #76727.
226
227 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
228
229         Fix #76859.
230         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
231         no error was reported.
232
233         *expression.cs (Binary.DoResolve): left can be null.
234
235 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
236
237         Fix #76783.
238         * class.cs (MethodData.Emit): Parameters should be labeled first.
239
240 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
241
242         Fix #76761.
243         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
244
245 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
246
247         * attribute.cs (AreParametersCompliant): Moved to Parameter.
248
249         * class.cs (MethodCore): Parameter clean up.
250         (IMethodData): Added ParameterInfo.
251         (MethodData): Parameter clean up.
252         (Indexer.Define): Parameter clean up.
253
254         * anonymous.cs,
255         * codegen.cs,
256         * cs-parser.jay,
257         * decl.cs,
258         * doc.cs,
259         * ecore.cs,
260         * flowanalysis.cs,
261         * iterators.cs,
262         * pending.cs,
263         * statement.cs,
264         * typemanager.cs: Parameter clean up.
265
266         * delegate.cs (Define): Get rid of duplicated code.
267
268         * expression.cs (ParameterReference): Removed useless parameters
269         and simplified.
270         (Invocation): Ditto.
271
272         * parameter.cs (ParamsParameter): New class, params specialization.
273         (ArglistParameter): Attemp to separate arglist.
274         (Parameter): Refactored to be reusable and faster.
275         (Parameter.Modifier): Made understandable.
276         (Parameters): Changed to be used as a class for `this' assembly
277         parameters. Refactored to use new specialized classes.
278
279         * support.cs (ParameterData): Added Types property.
280         (InternalParameters): Deleted.
281
282 2005-08-20  Martin Baulig  <martin@ximian.com>
283
284         Merging this patch from GMCS to fix #75867.
285
286         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
287         scope if we don't already have it.
288
289 2005-11-17  Martin Baulig  <martin@ximian.com>
290
291         * anonymous.cs
292         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
293         inherit the scope from our parent.  Fixes #76653.
294
295 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
296
297         * doc.cs : the previous patch does not actually fix the bug.
298           PropertyInfo override check is now implemented and really fixed it.
299         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
300
301 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
302
303         * doc.cs : apply "override filter" also to properties.
304           Fixed bug #76730.
305
306 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
307
308         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
309           no need to check overrides. For classes, omit those results from 
310           interfaces since they must exist in the class. Fixed bug #76726.
311
312 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
313
314         * typemanager.cs : (GetFullNameSignature) differentiate indexers
315           with different parameters. Fixed the second problem in #76685.
316
317 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
318
319         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
320           get expected 'protected' access in CheckValidFamilyAccess()).
321           Fixed bug #76692.
322
323 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
324
325         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
326           Fixed bug #76705.  CS1569 was incorrectly commented out.
327
328 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
329
330         * doc.cs : use Invocation.IsOverride() to do real override check.
331         * expression.cs : made Invocation.IsOverride() internal.
332
333 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
334
335         * doc.cs : use TypeManager.FindMembers() instead of (possible)
336           TypeBuilder.FindMembers() and filter overriden base members out.
337           Fixed bug #76990.
338
339 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
340
341         * doc.cs : ref/out parameters are represented as '@' (instead of
342           '&' in type FullName). Fixed bug #76630 (additionally crefs).
343
344 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
345
346         * doc.cs : when there was no '.' in cref to methods in doc comment,
347           then parameters were missing in the output. Fixed bug #76691.
348
349 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
350
351         * driver.cs : don't output docs when there is an error.
352           Fixed bug #76693.
353
354 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
355
356         * doc.cs :
357           Now it should detect indexers. Fixed primary concern in bug #76685.
358           Fixed CS0419 message to not show the identical member signature in
359           the message.
360
361 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
362
363         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
364           instead of Type.FindMembers() since it does not handle events.
365           Fixed bug #71604.
366
367 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
368
369         * codegen.cs: Fixed typo (speficied -> specified).
370
371 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
372
373         Fix #76369.
374         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
375
376 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
377
378         * attribute.cs: Changed error message.
379
380         * cs-tokenizer.cs: One more check.
381
382 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
383
384         * statement.cs (Block.Resolve): Ignore empty statement.
385
386 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
387
388         * report.cs: Made error/warning methods more strict to avoid
389         their misuse.
390
391         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
392         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
393         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
394         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
395
396 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
397
398         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
399         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
400
401         * class.cs (TypeContainer.IsComImport): New property.
402         (Constructor.Define): Create proper ctor for ComImport types.
403
404         * expression.cs (New.CheckComImport): Fixed.
405
406 2005-11-07  Miguel de Icaza  <miguel@novell.com>
407
408         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
409         that a parameter has been captured does not mean that we do not
410         have to do the rest of the processing.  This fixes the second part
411         of #76592.  If there was another anonymous method capturing
412         values in the past, the Scope would never be set for the second
413         method that captured the same parameter.
414
415         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
416         properly manipulate the stack.   Second part of fix for #76592.
417
418         * expression.cs (New): Add support for invoking "new" on
419         interfaces that have been flagged with the ComImport attribute and
420         the CoClass.  Fixes #76637 
421
422         * statement.cs (Try.DoEmit): When a variable is captured, do not
423         try to emit the vi.LocalBuilder variable as it has been captured.
424         Create a temporary variable and store the results on the
425         FieldBuilder.  Fixes #76642
426
427 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
428
429         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
430
431         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
432
433         * expression.cs (Binary.DoResolve): Added && optimalization.
434     
435         * typemanager.cs (AddUserType): Removed useless argument.
436
437 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
438
439         * statement.cs (Block.variables): Uses ListDictionary.
440
441 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
442
443         Fix #75969.
444         * class.cs (PartialContainer.EmitType): Customized to emit
445         security attributes.
446         (ClassPart.ApplyAttributeBuilder): Transform security attribute
447         for partial classes.
448
449 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
450
451         Fix #76599.
452         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
453         access has to be fixed.
454         
455         * typemanager.cs (IsUnmanagedType): Wrong common field type.
456
457 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
458
459         Fix #76590.
460         * ecore.cs (NullCast.Reduce): Implemented.
461
462         * expression.cs (ArrayCreation.CheckIndices): Correcly check
463         constant type.
464         
465         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
466         properly.
467         (Foreach.Resolve): Catch null properly.
468
469 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
470  
471         * cs-tokenizer.cs: Warning text fix.
472
473         * driver.cs: AllWarningNumbers exposed on public interface.
474
475         * report.cs (): Reviewed warning numbers.
476         (IsValidWarning): Use binary search.
477
478 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
479  
480         * driver.cs: Implemeted resource visibility.
481         (Resources): New class for code sharing between /res: and
482         /linkres:
483  
484 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
485
486         Fix #76568.
487         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
488         folding.
489         
490         * convert (Convert.ImplicitReferenceConversion): NullCast holds
491         contants only.
492         
493         * ecore.cs (NullCast): Child is contant only.
494         
495         * literal.cs (NullLiteral.Reduce): null can be converted to any
496         reference type.
497
498 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
499
500         * driver.cs: Use Encoding.Default as default code page instead
501           of ISO-28591.
502
503 2005-10-27  Raja R Harinath  <rharinath@novell.com>
504
505         Fix #76085.
506         * expression.cs (Invocation.Error_InvalidArguments): Handle
507         __arglist parameters.
508         (Invocation.VerifyArgumentsCompat): Likewise.
509         * support.cs (ReflectionParameters.GetSignatureForError): Print
510         __arglist parameters.
511         (InternalParamters.GetSignatureForError): Likewise.
512         * parameter.cs (Parameters.GetSignatureForError): Likewise.
513
514 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
515
516         * attribute.cs (GetPropertyValue): Made public.
517
518         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
519         Resolve.
520         Add new property WrapNonExceptionThrows to handle 2.0 assembly
521         attribute.
522         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
523         is not defined.
524         
525         * driver.cs: Reflect method name change.
526         
527         * statement.cs (Try.Resolve): Warn when try has both general
528         exception handlers.
529         
530         * typemanager.cs: runtime_compatibility_attr_type new predefined
531         type.
532
533 2005-10-26  Raja R Harinath  <harinath@gmail.com>
534
535         Fix #76419.
536         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
537         treat it as an empty parameter list.
538
539 2005-10-26  Raja R Harinath  <rharinath@novell.com>
540
541         Fix #76271.     
542         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
543         ResolveAsTypeStep silent.
544         * statement.cs (Block.AddConstant): Mark block as used.
545         (Block.ResolveMeta): Avoid piling on error messages
546         if a constant initializer resolution fails.
547
548 2005-10-25  Raja R Harinath  <rharinath@novell.com>
549
550         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
551         Remove.
552         (NamespaceEntry.VerifyAllUsing): New.
553         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
554         behaviour.  Delegates actual resolution of alias to ...
555         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
556         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
557         Update.
558         * driver.cs (Driver.MainDriver): Update.
559         
560         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
561         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
562         property.
563         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
564         Remove.
565         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
566         RootNamespace.DefineNamespacesForAll.
567
568 2005-10-24  Raja R Harinath  <harinath@gmail.com>
569
570         * typemanager.cs (assemblies, external_aliases, modules)
571         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
572         (ComputeNamespaces, GetRootNamespace): Remove extra staging
573         overhead.  Move resposibility ...
574         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
575         * driver.cs, attribute.cs, codegen.cs: Update to changes.
576
577 2005-10-23  Raja R Harinath  <harinath@gmail.com>
578
579         * namespace.cs (RootNamespace.all_namespaces): Renamed from
580         cached_namespaces.  Improve usage.
581         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
582         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
583         Move from GlobalRootNamespace and simplify.
584         (RootNamespace.Global): Make instance variable.
585         (RootNamespace.RootNamespace): Add "alias name" parameter.
586         (GlobalRootNamespace): Simplify drastically.
587         (Namespace.Lookup): Don't use GetNamespace.
588         * typemanager.cs (GetRootNamespace): Rename from
589         ComputeNamespaceForAlias.
590         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
591
592 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
593
594         * anonymous.cs (AnonymousContainer): Don't crash when container
595         doesn't exist.
596
597 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
598
599         * expression.cs (Binary.DoResolve): Warn when comparing same
600         values.
601
602 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
603
604         Fix #76486.
605         * expression.cs (Binary.DoResolve): It looks like there are no
606         convetsion rules in enum context.
607
608 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
609
610         Add support for extern alias qualifiers.
611         * typemanager.cs: Move some LookupTypeReflection code
612         to namespace.cs, to have cleaner code. Added some methods
613         to help us keep track of the extern aliased references.
614         * driver.cs: Add suport for extern alias assemblies on command
615         line and check for their warnings/errors. Also keep track of the
616         extern aliased assemblies.
617         * namespace.cs: Move the global functionality of Namespace
618         to GlobalRootNamespace/RootNamespace. Now the global namespace
619         is GlobalRootNamespace.Globa. Also the code moved from 
620         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
621         Finally added LocalAliasEntry (AliasEntry before) and
622         ExternAliasEntry, to handle alias statements.
623         * cs-parser.jay: Add support in the grammar for extern alias
624         statement.
625         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
626         Update callings to Namespace (now in GlobalRootNamespace).
627
628 2005-10-18  Raja R Harinath  <rharinath@novell.com>
629
630         Fix #76371.
631         * class.cs (TypeContainer.DefineType): Move updating of
632         topological sort earlier in the code.
633         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
634
635 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
636
637         Fix #76273.
638         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
639         
640         * constant.cs (Constant.TryReduce): Moved from Cast class.
641         (Reduce): Made little bit more OO and fixed missing conversions.
642         
643         * ecore.cs (Reduce): Implemented.
644         (Binary.EnumLiftUp): New method to upgrade values to enum values.
645         
646         * literal.cs (Reduce): Implemented.
647         
648         * class.cs: Reverted Miguel's wrong commit.
649
650 2005-10-14  Miguel de Icaza  <miguel@novell.com>
651
652         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
653
654 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
655
656         * cs-parser.jay, expression.cs : CS0214 was missing error location
657           for constants. Fixed bug #76404.
658
659 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
660
661         Fix #76370.
662         * convert.cs (ExplicitConversionCore): Fixed object->enum
663         conversion.
664
665 2005-10-10  Raja R Harinath  <rharinath@novell.com>
666
667         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
668         InstanceExpression.
669         (PropertyExpr.EmitCall): Likewise.
670         * expression.cs (Invocation.EmitArguments): Handle case where
671         arguments == null.
672         (Invocation.EmitCall): Avoid allocating temporary variable if
673         there are no arguments.
674
675 2005-10-07  Raja R Harinath  <rharinath@novell.com>
676
677         Fix #76323.
678         * convert.cs (ImplicitConversionStandard): Move conversion of
679         void* to arbitrary pointer types ...
680         (ExplicitConversionStandard): .. here.
681         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
682         error to always print typenames.
683
684 2005-10-07  Raja R Harinath  <rharinath@novell.com>
685
686         * convert.cs (GetConversionOperator): Rename from
687         GetConversionOperators.  Move operator selection code from ...
688         (UserDefinedConversion): ... here.
689
690 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
691
692         * convert.cs (ExplicitConversionCore): Removed duplicate enum
693         conversion.
694
695 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
696
697         * assign.cs (Assign.DoResolve): Error method changed.
698
699         * cfold.cs (DoConstantNumericPromotions): Error method changed.
700         
701         * const.cs (ResolveValue): Reset in_transit immediately.
702         
703         * constant.cs: Error method changed.
704         
705         * convert.cs: Removed useless location parameter.
706         (ExplicitNumericConversion): Don't do double enum check.
707         (ExplicitConversionCore): Renamed from ExplicitConversion.
708         (ExplicitUnsafe): Extracted from ExplicitConversion.
709         (ExplicitConversion): Uses for error reporting.
710         
711         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
712         error messages.
713         (ResolveBoolean): Uses common error method.
714         (CastToDecimal): Get rid of ec.
715         (CastFromDecimal): Optimized.
716         (ConvCast): Get rid of ec.
717         
718         * enum.cs (ResolveValue): Reset in_transit immediately.
719         (Emit): Return after first error.
720         
721         * expression.cs: Convert changes.
722         
723         * literal.cs: Error method changed.
724         
725         * statement.cs: Error method changed.
726
727 2005-10-03  Raja R Harinath  <rharinath@novell.com>
728
729         * support.cs (SeekableStreamReader.Position): Don't error out when
730         the requested position is just beyond the end of the current
731         buffered data.
732
733 2005-09-28  Raja R Harinath  <rharinath@novell.com>
734
735         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
736         try to keep in sync with the byte count of the underlying Stream.
737         However, this limits us to a window size of 2048 characters: i.e.,
738         the maximum lookahead of our lexer/parser can be 2048 characters.
739
740 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
741
742         Fix #76255.
743         * driver.cs: Fix compilation files with full root path.
744
745 2005-09-25  Miguel de Icaza  <miguel@novell.com>
746
747         * report.cs (SymbolRelatedToPreviousError): Format the output so
748         it does not use an open parenthesis that is never closed. 
749
750         * driver.cs: Follow coding guidelines
751
752 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
753
754         Fix #72930.
755         * const.cs (Const.ResolveValue): Check for assigning non-null
756         value to reference type.
757
758 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
759
760         * anonymous.cs: Implemented ExprClassName.
761         
762         * assign.cs (Assign.DoResolve): Don't chrash when type is not
763         delegate.
764         
765         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
766         check.
767         
768         * class.cs (StaticClass.DefineContainerMembers): Report protected
769         members as error.
770         
771         * codegen.cs: if(ed) PRODUCTION.
772         
773         * convert.cs (Error_CannotImplicitConversion): Better error
774         distinction.
775         
776         * cs-parser.jay: More error checks.
777         
778         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
779         
780         * driver.cs (CSCParseOption): Enabled wrong option check.
781         
782         * ecore.cs (Expression.ExprClassName): Turned to property.
783         (MemberExpr.CheckIntermediateModification): For checking boxed
784         value types     modification.
785         
786         * statement.cs (Fixed.Resolve): Expression type must be
787         convertible to fixed type.
788         (CollectionForeach.GetEnumeratorFilter,TryType):
789         Small refactoring for easier error checking.
790
791 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
792
793         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
794         attributes.
795         
796         * class.cs (GeneratedBaseInitializer): New class for customization
797         compiler generated initializers.
798         (MemberBase.DoDefine): Check Obsolete attribute here.
799         (FieldMember.DoDefine): Ditto.
800         
801         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
802         constants.
803         
804         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
805         (MemberCore.GetObsoleteAttribute): Removed argument.
806         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
807         (MemberCore.CheckObsoleteType): New helper.
808         
809         * delegate.cs,
810         * enum.cs,
811         * statement.cs: Updates after MemberCore changes.
812         
813         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
814         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
815         
816         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
817         obsolete attribute for compiler construct.
818         (As.DoResolve): Cache result.
819         
820         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
821
822 2005-09-26  Raja R Harinath  <rharinath@novell.com>
823
824         Fix #76133.
825         * expression.cs (This.VerifyFixed): In a value type T, the type of
826         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
827         value type R, 'this' is treated as a value parameter.
828
829 2005-09-22  Miguel de Icaza  <miguel@novell.com>
830
831         * statement.cs (Lock): Use the TemporaryVariable class instead of
832         manually using local variables as those do not work when variables
833         are captured.
834
835         * ecore.cs: Moved the TemporaryVariable class from being a nested
836         class inside Foreach to be a public class that can be employed in
837         other places. 
838
839 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
840
841         * cs-parser.jay: interface_accessors replaced by
842         accessor_declarations.
843
844         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
845         location.
846         
847         * statement.cs (GotoCase.Resolve): Convert null constant to
848         null case.
849         (SwitchLabel.ResolveAndReduce): Ditto.
850         (SwitchLabel.NullStringCase): Custom null stamp.
851         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
852         
853         typemanager.cs (CSharpSignature): Don't skip first argument
854         for full names.
855
856 2005-09-18  Miguel de Icaza  <miguel@novell.com>
857
858         * driver.cs: Set InEmacs based on the environment variable EMACS. 
859
860         * location.cs (InEmacs): in this mode, do not report column
861         location as it confuses Emacs.
862
863 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
864
865         * cfold.cs, constant.cs, convert.cs, ecore.cs,
866         expression.cs, iterators.cs, literal.cs: Store constants and
867         literals location.
868         
869         * class.cs (MemberBase.ShortName): Pass location.
870         
871         * cs-parser.jay: Some location fixes.
872         
873         * ecore.cs (Expression.Location): Made virtual.
874
875 2005-09-05  Miguel de Icaza  <miguel@novell.com>
876
877         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
878         if the underlying types are the same, otherwise we need to produce
879         code that will do the proper cast.
880
881         This was exposed by Marek's constant rewrite which produced
882         invalid code for the call site:
883
884         enum X : long { a }
885         void Method (X v) {}
886
887         Method ((X) 5)
888
889         This fixes test-49.cs
890
891 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
892
893         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
894           Type/Object should be allowed as well. Fixed bug #75968.
895
896 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
897
898         * expression.cs : (Binary.DoResolve): when one is enum constant and
899           another is constant 0, then return enum one *as enum type*.
900           Fixed bug 74846.
901
902 2005-09-02  Raja R Harinath  <rharinath@novell.com>
903
904         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
905         internal.
906
907         Fix #75941.
908         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
909         flow-branching for LocalVariableReferences in case we were invoked
910         from a MemberAccess.
911         * expression.cs (LocalVariableReference.VerifyAssigned): New.
912         Carved out of ...
913         (LocalVariableReference.DoResolveBase): ... this.
914         (MemberAccess.Resolve): Do the check that was disabled during
915         SimpleNameResolve.
916
917 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
918
919         * class.cs :
920           (PartialContainer.Create): check abstract/sealed/static strictly
921           but abstract/sealed can exist only at one side. Fixed bug #75883.
922
923 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
924
925         Fix #75945.
926         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
927         specified, don't default to UnmanagedType.I4.
928
929 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
930
931         * expression.cs : conditional operator should check possibly
932           incorrect assign expression. Fixed bug #75946.
933
934 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
935
936         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
937           Reverting the change. gmcs is much complex than mcs on this matter.
938
939 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
940
941         * cs-tokenizer.cs : To read another token ahead of the actual 
942           consumption, use new SavedToken and cache token instead of moving
943           back the stream with SeekableStreamReader (it seemed problematic).
944         * cs-parser.jay,
945           driver.cs : Thus use StreamReader directly.
946         * support.cs : Thus removed SeekableStreamReader.
947
948 2005-08-30  Raja R Harinath  <rharinath@novell.com>
949
950         Fix #75934.
951         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
952         (ScopeInfo.EmitScopeType): Use it to construct field names from
953         names of captured locals.
954
955         Fix #75929.
956         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
957         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
958         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
959         (ExplicitConversion): Remove enum cases already handled by
960         implicit conversion.  Move implicit conversion check to the beginning.
961         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
962         * expression.cs (ArrayCreation.EmitDynamicInitializers):
963         Don't treat System.Enum as a struct.
964
965 2005-08-30  Jb Evain  <jbevain@gmail.com>
966
967         * attribute.cs: handles as expression in parameters.
968
969 2005-08-30  Raja R Harinath  <rharinath@novell.com>
970
971         Fix #75802.
972         * class.cs (TypeContainer.VerifyClsName): Don't use a
973         PartialContainer when verifying CLS compliance.
974         (AbstractPropertyEventMethod): Set Parent here, ...
975         (PropertyMethod): ... not here.
976
977 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
978
979         * attribute.cs : escaped attribute name should not be allowed to be
980           resolved (e.g. @class as classAttribute). Fixed bug #75930.
981
982 2005-08-29  Raja R Harinath  <rharinath@novell.com>
983
984         Fix #75927.
985         * convert.cs (ImplicitStandardConversionExists): Allow zero also
986         when converting a long constant to unsigned long.
987         * expression.cs (Invocation.OverloadResolve): Add sanity check to
988         detect where IsApplicable and VerifyArgumentsCompat disagree.
989
990 2005-08-29  Raja R Harinath  <rharinath@novell.com>
991         and Carlos Alberto Cortez  <carlos@unixmexico.org>
992
993         Fix #75848.
994         * class.cs (TypeContainer.CanElideInitializer): New helper.
995         (TypeContainer.EmitFieldInitializers): Use it to determine if we
996         can safely emitting the initializer of a field.
997
998 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
999
1000         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1001           allowed inside a switch (without loop). Fixed bug #75433.
1002
1003 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1004
1005         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1006         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1007
1008 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1009
1010         * driver.cs : kinda reverting the default encoding changes (not exact 
1011           revert since I noticed that "codepage:reset" might not work fine).
1012
1013 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1014
1015         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1016           Location. Now getter and setter store location correctly.
1017           (errors/cs0111-12.cs now reports the expected location.)
1018
1019 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1020
1021         * driver.cs : Use default encoding on the environment.
1022           Removed (now that) extra parameter for SeekableStreamReader.
1023         * support.cs : (SeekableStreamReader) third .ctor() argument for
1024           StreamReader is not required (always true). preamble size could
1025           be acquired in simpler and safe way.
1026
1027 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1028
1029         * cs-parser.jay: report CS0642 at warning level 3
1030           and report CS0642 for an if else statement also
1031           fixes bug #74745. Patch by John Luke (and a bit
1032           modified by me).
1033           Removed extra CS0642 warning check for "while",
1034           "for" and "fixed".
1035         * statement.cs: In Block.Resolve(), CS0642 check
1036           is reimplemented to check a sequence of an empty
1037           statement and a block.
1038
1039           Both fix bug #66777.
1040
1041 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1042
1043         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1044         detection until I fix it.
1045         
1046         * cs-tokenizer.cs: Changed error message.
1047         
1048         * cs-parser.jay: Fixed 2 error locations.
1049         
1050         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1051         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1052         properties.
1053         
1054         * enum.cs (GetSignatureForError): Fixed.
1055         
1056         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1057         method detection.
1058         
1059         * class.cs,
1060         * typemanager.cs (RegisterProperty): Removed.
1061         
1062         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1063
1064 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1065
1066         Fix #75874.
1067         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1068         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1069
1070 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1071
1072         * expression.cs : tiny fix is required for not warning positive ulong.
1073           See test-441.cs.
1074
1075 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1076
1077         * expression.cs : add CS0652 check for constant and integral
1078           expression. Fixed bug #53974.
1079
1080 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1081
1082         * expression.cs : in DoNumericPromotions(), check if there is implicit
1083           conversion overload for string (to check CS0034). Fixed bug #52492.
1084
1085 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1086
1087         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1088
1089 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1090
1091         * ecore.cs : report location when it is *not* Null.
1092
1093 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1094
1095         * codegen.cs,
1096           ecore.cs,
1097           flowanalysis.cs,
1098           expression.cs:
1099           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1100           correctly. Fixed bug #75721.
1101
1102 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1103
1104         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1105         loop that performs 'min (pos, char_count)'.
1106
1107         Fix #75862.
1108         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1109         converted value in Operator.OnesComplement.
1110
1111 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1112
1113         * anonymous.cs: If the anon method is pulled into a helper class,
1114         it needs to be `internal' not `private'. Fixes runtime behavior on
1115         msft. bug #75704
1116
1117 2005-08-20  Martin Baulig  <martin@ximian.com>
1118
1119         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1120         scope if we don't already have it.
1121
1122         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1123         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1124         fixes #75867.
1125
1126 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1127
1128         Fix #75803
1129         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1130         is a partial class.
1131
1132 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1133
1134         The big constants rewrite
1135         Fix #75746, #75685 and more
1136         As a side effect saved 1MB for MWF ;-)
1137         
1138         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1139         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1140         enum based for corlib compilation.
1141         
1142         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1143         subtractions.
1144         
1145         * class.cs (FixedField.Define): Use ResolveAsConstant.
1146         
1147         * const.cs (IConstant): Interface constants and enums.
1148         (Const.ResolveValue): New method for constant resolvning.
1149         (ExternalConstant): Constants from imported assemblies.
1150         
1151         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1152         conversion; like enums.
1153         (Constant.ToType): Converts this constant to different type.
1154         (Constant.Increment): Adds 1.
1155         
1156         * convert.cs (ImplicitConversionRequired): Simplified.
1157         
1158         * cs-parser.jay: Create EnumMember directly.
1159         
1160         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1161         
1162         * doc.cs (GenerateEnumDocComment): Removed.
1163         
1164         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1165         (ConvertIntLiteral): Removed.
1166         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1167         
1168         * enum.cs (EnumMember): Implement IConstant.
1169         (Enum.IsValidEnumConstant): Removed.
1170         (Enum.GetNextDefaultValue): Removed.
1171         (Enum.FindMembers): Updated.
1172         (Enum.GenerateDocComment): Iterate enum members.
1173         
1174         * expression.cs (Cast.TryReduce): Handle enums correctly.
1175         (New.Constantify): Made public.
1176         (MemberAccess.DoResolve): Removed contant specific if(s).
1177         
1178         * literal.cs (NullLiteral): Implement new abstract methods.
1179         
1180         * statement.cs (GotoCase.Resolve): Use new constant methods.
1181         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1182         
1183         * typemanager.cs (LookupEnum): Removed.
1184         (IsEnumType): Fixed to work with corlib.
1185         (RegisterConstant): Removed.
1186         (LookupConstant): Removed.
1187         (GetConstant): Changed to work with IConstant.
1188
1189 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1190
1191         * location.cs : Fixed overflown (>255) column number.
1192
1193 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1194
1195         First cut of the qualified-alias-member feature.
1196         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1197         token.
1198         * cs-parser.jay (DOUBLE_COLON): New token.
1199         (namespace_or_type_name): Add rule for recognizing
1200         qualified-alias-members.
1201         (primary_expression): Likewise.
1202         (element_access): Allow QualifiedAliasMember as a possible
1203         type-bearing expression.
1204         (local_variable_type, local_variable_pointer_type): Likewise.
1205         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1206         aliases in the current and enclosing namespace declarations.
1207         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1208         * decl.cs (MemberName.is_double_colon): New.
1209         (MemberName.MemberName): Add new constructor for alias-member.
1210         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1211         * expression.cs (QualifiedAliasMember): New expression type.
1212
1213 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1214
1215         * location.cs : it borked when no argument was specified.
1216
1217 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1218
1219         * location.cs : tiny ToString() format fix.
1220
1221 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1222
1223         * statement.cs : oops, it was missing.
1224
1225 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1226
1227         A set of fixes for precise line/column location.
1228
1229         * location.cs :
1230           "token" field now holds a file/line "delta", a line number offset 
1231           from the segment, and a column number. See also:
1232           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1233           December/009508.html
1234           Removed static IsNull. Use instance IsNull property instead.
1235         * cs-tokenizer.cs :
1236           For some tokens it stores Location. For Identifier it stores
1237           LocatedToken which is a pair of string name and location.
1238           Column numbers are adjusted only at getChar().
1239         * report.cs :
1240           Use Location.ToString() for reporting (it now contains column).
1241         * cs-parser.jay :
1242           Largely modified to use LocatedToken instead of
1243           string (IDENTIFIER), and to acquire Location from some tokens.
1244         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1245           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1246           codegen.cs :
1247           Now MemberName holds Location. DeclSpace.ctor() receives Location
1248           as a parameter. Removed extra parameters to all derived classes.
1249           Replaced Location.IsNull() with instance property.
1250         * assign.cs, expression.cs :
1251           Added .ctor() overload that omits Location.
1252         * attribute.cs :
1253           Added "nameEscaped" flag that indicates the identifier was escaped
1254           in the source file. This fixes bug #57047.
1255
1256 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1257
1258         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1259         New method, looking for lo-case imported cls type.
1260
1261         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1262         here.
1263
1264         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1265
1266         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1267
1268         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1269         all_imported_types.
1270         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1271
1272         Optimized to save 3.5 MB for SWF compilation.
1273
1274 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1275
1276         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1277         (PartialContainer.Create): Moved logic AddToContainer.
1278         (PartialContainer.MarkForDuplicationCheck): Shares name.
1279         
1280         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1281         place.
1282         
1283         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1284         initialization.
1285         (Namespace.GetSignatureForError): New method.
1286         
1287         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1288         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1289
1290 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1291
1292         Fix #75669.
1293         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1294         member lookup rather than qualifier_type, since qualifier_type can
1295         be null.
1296
1297 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1298
1299         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1300         enum member.
1301
1302 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1303
1304         * statement.cs: Copy the local exception into the exception
1305         captured local.  Fixes 75674
1306
1307 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1308
1309         Fix #75658.
1310         * expression.cs (Invocation.OverloadResolve): Don't report error
1311         CS1501 if error CS1502 has been reported.
1312         (New.DoResolve): Delegate CS1501 reporting to
1313         Invocation.OverloadResolve.
1314
1315         Fix #75656.
1316         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1317         invariant-meaning-in-block property in an enclosing block if
1318         necessary.
1319
1320 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1321
1322         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1323         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1324         (Switch.CheckSwitch): Just save 50kb for SWF.
1325
1326 2005-07-27  Martin Baulig  <martin@ximian.com>
1327
1328         * anonymous.cs (CaptureContext.AddField): Added
1329         `AnonymousContainer am' argument; compute its toplevel scope if
1330         it's not already computed.  Fixes #75649.
1331
1332 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1333
1334         Fix #75628.
1335         * class.cs (Constructor.Emit): Reset block to null if the block
1336         resolve fails.
1337
1338 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1339
1340         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1341
1342 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1343
1344         * class.cs (MethodData.Define): Check whether accessor implementing
1345         interface is public.
1346
1347         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1348
1349 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1350
1351         Fix #57245
1352         * namespace.cs (LookupType): Moved same type check to...
1353         
1354         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1355         with the same name.
1356
1357 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1358
1359         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1360         already found a typebuilder.
1361         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1362         MemberNames, not strings.
1363
1364         * const.cs (Error_ExpressionMustBeConst): 
1365         Rename from Error_EpressionMustBeConst.
1366         * const.cs, class.cs, statement.cd: Update.
1367
1368 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1369
1370         Fix #65573
1371
1372         * const.cs (Const.LookupConstantValue): Report missing contant expression
1373         everytime.
1374         (Error_EpressionMustBeConstant): Only one error method.
1375
1376         * class.cs, statement.c: Updated.
1377
1378 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1379
1380         * statement.cs (Block.Flags): Add back HasVarargs.
1381         (Block.flags): Make protected.
1382         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1383
1384         * typemanager.cs (types, typecontainers, user_types): Remove.
1385         (UserTypes, TypeContainers): Likewise.
1386         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1387         (CleanUp, Reset): Update.
1388         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1389         (GetNestedType): Use Type.GetNestedType.
1390         (CoreLookupType): Take two arguments, the namespace and the
1391         basename of the type.  Update to use the Namespace.Lookup
1392         mechanism.
1393         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1394         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1395         string concatenation and substring matches.
1396         * class.cs, enum.cs, delegate.cs: Update to changes.
1397
1398 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1399
1400         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1401         Expression and made virtual.
1402
1403         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1404         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1405
1406         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1407
1408         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1409         error message.
1410
1411         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1412         change.
1413
1414 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1415
1416         Fix #57707
1417         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1418         AssemblyCultureAttribute is not used on executable.
1419
1420         * rootcontext.cs,
1421         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1422
1423 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1424
1425         Fix #60638.
1426         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1427         New.  Reports CS0252/CS0253.
1428         Mostly taken from preliminary patch by Duncak Mak.
1429         (Binary.DoResolveOperator): Store results of operator lookup.
1430         Use them to detect if we need to warn about unintended reference
1431         comparisons.
1432
1433 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1434
1435         Fix #72969.
1436         * namespace.cs (Namespace.Lookup): Add back location parameter.
1437         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1438         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1439
1440         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1441         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1442         (Namespace.LookupType): ... this.
1443         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1444         of namespaces.
1445         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1446         purported to handle pointers.
1447         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1448         CoreLookupType.
1449
1450 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1451
1452         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1453         type as namespace.
1454
1455 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1456
1457         * namespace.cs (Namespace.Lookup): Drop location parameter.
1458         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1459         (NamespaceEntry.Lookup): ... this.
1460         (NamespaceEntry.Error_AmbiguousTypeReference):
1461         Move here from DeclSpace.
1462         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1463         names ...
1464         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1465         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1466         Move to NamespaceEntry.
1467         * delegate.cs, expression.cs: Update to changes.
1468
1469 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1470
1471         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1472         CheckAttributeType and refactored.
1473         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1474         ResolveAsTypeTerminal error handling.
1475         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1476         handling.
1477         (GetSignatureForError): Print errors in same way.
1478
1479         * class.cs,
1480         * codegen.cs: Reflect attribute GetSignatureForError change.
1481
1482         * ecore.cs,
1483         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1484
1485         * namespace.cs (UsingEntry): Refactored to make fields private.
1486
1487         * assign.cs,
1488         statement.cs: Error_UnexpectedKind has extra parameter.
1489
1490 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1491
1492         * ecore.cs (IAlias): Remove.
1493         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1494         that implement the interface.
1495         * namespace.cs (Namespace): Likewise.
1496         (Namespace.declspaces): Renamed from 'defined_names'.
1497         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1498         DeclSpace instead of an IAlias.
1499         * tree.cs (Tree.AddDecl): Update.
1500
1501 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1502
1503         * statement.cs (Block.Flags); Remove HasVarargs.
1504         (Block.HasVarargs): Move to ToplevelBlock.
1505         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1506         (Block.Variables): Make protected.  Initialize variable hashtable
1507         if necessary.
1508         (Block.AddVariable): Update.
1509         (Block.Resolve): Update to changes.
1510         (ToplevelBlock.HasVarargs): New boolean.
1511         (ToplevelBlock.ThisVariable): Move here from Block.
1512         (ToplevelBlock.AddThisVariable): Likewise.
1513         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1514         * expression.cs (This.ResolveBase): Update to changes.
1515         (ArglistAccess.DoResolve): Likewise.
1516
1517 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1518
1519         Fix #75321
1520         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1521
1522         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1523         not used and not used & assigned.
1524         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1525
1526 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1527
1528         Fix #75053
1529         * expression.cs (Is.DoResolve): null is never provided type.
1530
1531 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1532
1533         Fix #52496
1534         * cs-parser.jay: Less strict event error rule to catch more errors.
1535
1536 2005-07-08  Martin Baulig  <martin@ximian.com>
1537
1538         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1539         gettter (allowed) or setter (not allowed).
1540
1541         * class.cs (Accessor): Implement IIteratorContainer.
1542         (Accessor.Yields): New public field.
1543         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1544         per-accessor basis.
1545
1546         * cs-parser.jay
1547         (get_accessor_declaration, set_accessor_declaration): Set the
1548         `yields' flag on the accessor, not the property.
1549         (property_declaration): Do the iterators check on a per-accessor
1550         basis and not for the whole property.
1551
1552 2005-07-08  Martin Baulig  <martin@ximian.com>
1553
1554         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1555         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1556
1557 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1558
1559         Fix #74975
1560         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1561         (ExtractSecurityPermissionSet): Cope with self referencing security
1562         attributes properly.
1563
1564         * driver.cs (SetOutputFile): Made public property OutputFile.
1565
1566 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1567
1568         Fix #75486.
1569         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1570         has_nonstatic_fields.  Make into a FieldBase pointer.
1571         (TypeContainer.AddField): Add CS0282 check.
1572         (TypeContainer.EmitType): Update.
1573
1574 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1575
1576         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1577         compare if they start with __.
1578
1579 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1580
1581         * statement.cs (Switch.SwitchGoverningType): Only look at
1582         UserCasts that don't need implicit standard conversions to one of
1583         the allowed switch types (Fixes test-322.cs).
1584         (LocalInfo.Resolve): Re-enable sanity-test.
1585
1586 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1587
1588         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1589         
1590         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1591         
1592         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1593
1594 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1595
1596         Fix #75472.
1597         * ecore.cs (SimpleName.GetSignatureForError): Add.
1598         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1599         (MemberAccess.GetSignatureForError): Add.
1600
1601 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1602  
1603         The big error and warning messages review.
1604         
1605         * anonymous.cs,
1606         * assign.cs,
1607         * attribute.cs,
1608         * class.cs,
1609         * codegen.cs,
1610         * convert.cs,
1611         * cs-parser.jay,
1612         * cs-tokenizer.cs,
1613         * decl.cs,
1614         * delegate.cs,
1615         * doc.cs,
1616         * driver.cs,
1617         * ecore.cs,
1618         * enum.cs,
1619         * expression.cs,
1620         * flowanalysis.cs,
1621         * iterators.cs,
1622         * literal.cs,
1623         * location.cs,
1624         * modifiers.cs,
1625         * namespace.cs,
1626         * parameter.cs,
1627         * pending.cs,
1628         * report.cs,
1629         * rootcontext.cs,
1630         * statement.cs,
1631         * support.cs,
1632         * tree.cs,
1633         * typemanager.cs: Updated.
1634         
1635         * class.cs: (MethodCore.SetYields): Moved here to share.
1636         (PropertyMethod.Define): Moved iterator setup here.
1637         
1638         * iterators.cs: Add orig_method to have full access to parent
1639         container.
1640
1641 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1642
1643         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1644         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1645         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1646         variable of struct type.
1647         * expression.cs (Unary.ResolveOperator): Update to change.
1648         (Indirection.VerifyFixed): Likewise.
1649         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1650         (ParameterReference.VerifyFixed): Value parameters are fixed.
1651         (This.VerifyFixed): Treat 'this' as a value parameter.
1652         * statement.cs (LocalInfo.IsFixed): Remove.
1653
1654 2005-07-01  Martin Baulig  <martin@ximian.com>
1655
1656         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1657         `ec.EmitThis ()' to get the correct scope.
1658
1659 2005-07-01  Martin Baulig  <martin@ximian.com>
1660
1661         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1662         instance is a ParameterReference; fixes #75299.
1663
1664 2005-07-01  Martin Baulig  <martin@ximian.com>
1665
1666         Reverted Marek's latest patch (r46725):
1667         - it contains structural changes which are neither mentioned in
1668           the ChangeLog nor explained anywhere; for example the additional
1669           argument of EmitContext's and Iterator's .ctor's and the
1670           TypeContainer.DefineMembers() change.
1671         - structural changes like this should go in in seperate patches
1672           and not be hidden in a huge patch which just seems to affect
1673           warnings and errors.
1674           a big and hard to understand patch.
1675         - it breaks iterators and causes regressions, for instance in
1676           test-iter-03.cs.      
1677
1678 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1679
1680         Fix #75412.
1681         * expression.cs (Indexers.map): Remove.
1682         (Indexers.Append): Filter out inaccessible setters and getters.
1683         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1684
1685         Fix #75283.
1686         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1687         Refactored from ...
1688         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1689         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1690         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1691         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1692
1693 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1694
1695         Fix #75322
1696         * class.cs (FieldBase.GetInitializerExpression): One more field
1697         for backup.
1698
1699 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1700
1701         * pending.cs: Do not define a proxy if the base method is virtual,
1702         it will be picked up by the runtime (bug 75270).
1703
1704 2005-06-08  Martin Baulig  <martin@ximian.com>
1705
1706         The big Iterators rewrite :-)
1707
1708         * iterators.cs: Rewrite this to use the anonymous methods framework.
1709
1710         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1711         before the TypeContainers; see 2test-21.cs.
1712
1713         * class.cs
1714         (TypeContainer.DefineType): Don't create a new EmitContext if we
1715         already have one (this only happens if we're an Iterator).
1716         (TypeContainer.Define): Also call Define() on all our iterators.
1717         (Method.CreateEmitContext): Added support for iterators.
1718
1719         * anonymous.cs
1720         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1721         (AnonymousContainer.CreateMethodHost): Moved here from
1722         AnonymousMethod and made abstract.
1723         (AnonymousContainer.CreateScopeType): New abstract method.
1724         (AnonymousContainer.IsIterator): New public property.
1725         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1726         get the ScopeTypeBuilder rather than manually defining it here. 
1727         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1728         iterators here.
1729
1730         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1731         before RootContext.DefineTypes().
1732
1733         * codegen.cs (EmitContext.RemapToProxy): Removed.
1734         (EmitContext.CurrentAnonymousMethod): Changed type from
1735         AnonymousMethod -> AnonymousContainer.
1736         (EmitContext.ResolveTopBlock): Protect from being called twice.
1737         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1738         (EmitContext.EmitThis): Removed the iterators hacks; use the
1739         anonymous methods framework for that.
1740
1741         * statement.cs
1742         (ToplevelBlock.Container): Make this a property, not a field.
1743         (ToplevelBlock.ReParent): New public method; move the
1744         ToplevelBlock into a new container.
1745         (Foreach.TemporaryVariable): Simplify.
1746
1747 2005-06-05  Martin Baulig  <martin@ximian.com>
1748
1749         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1750         (Block.AddTemporaryVariable): New public method; creates a new
1751         `LocalInfo' for a temporary variable.
1752         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1753         variables here.
1754         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1755         non-iterator variables.
1756
1757 2005-06-05  Martin Baulig  <martin@ximian.com>
1758
1759         * statement.cs (Foreach.TemporaryVariable): Create the
1760         LocalBuilder in the Emit phase and not in Resolve since in some
1761         situations, we don't have an ILGenerator during Resolve; see
1762         2test-19.cs for an example.
1763
1764 2005-06-04  Martin Baulig  <martin@ximian.com>
1765
1766         **** Merged r45395 from GCS ****
1767
1768         The big Foreach rewrite - Part II.
1769
1770         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1771         with `PropertyInfo ienumerator_getcurrent'.
1772
1773         * codegen.cs (VariableStorage): Removed.
1774
1775         * statement.cs
1776         (Foreach): Derive from Statement, not ExceptionStatement.
1777         (Foreach.CollectionForeach): New nested class.  Moved all the code
1778         dealing with collection foreach here.
1779         (Foreach.ForeachHelperMethods): Removed.
1780         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1781
1782 2005-05-23  Martin Baulig  <martin@ximian.com>
1783
1784         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1785         don't need to.  Fix #75014.
1786
1787 2005-05-20  Martin Baulig  <martin@ximian.com>
1788
1789         Merged r44808 from GMCS.
1790
1791         * class.cs (TypeContainer.CircularDepException): Removed.
1792         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1793         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1794         (CS0146) and interface (CS0529) dependencies here.
1795
1796 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1797
1798         * expression.cs (Invocation.EmitCall): Fix initialization
1799         'this_call' to reflect current behaviour.  Fix indentation.
1800
1801         * convert.cs (FindMostEncompassedType): Add two trivial special
1802         cases (number_of_types == 0 || number_of_types == 1).
1803         (FindMostEncompasingType): Likewise.
1804
1805 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1806
1807         Some cleanups preparing for the fix of #75283.
1808         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1809         error testing.
1810         (EventExpr.InstanceResolve): Likewise.
1811         (EventExpr.DoResolve): Remove redundant checks.
1812
1813 2005-06-10  Duncan Mak  <duncan@novell.com>
1814
1815         * cs-tokenizer.cs (process_directives): New flag for controlling
1816         the processing of preprocessor directives.
1817         (x_token): After seeing a '#', return Token.NONE instead of going
1818         to handle_preprocessing_directive() when not processing
1819         directives. This avoids unnecessary processing during the token peek in
1820         is_punct().
1821
1822         This fixes #74939.
1823
1824         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1825         the existing error reporting methods instead of Report.Error.
1826
1827         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1828         after Raja's rewrite.
1829
1830 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1831
1832         * class.cs: Small fix.
1833
1834 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1835
1836         Fix #75160.
1837         * class.cs (GetPartialBases): Fix return value check of
1838         part.GetClassBases.
1839
1840 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1841
1842         Ensure that partial classes are registered in their enclosing
1843         namespace.  Initial part of fix of #75160.
1844         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1845         Register declspace with namespace here, not in
1846         DeclSpace.RecordDecl.
1847         * cs-parser.jay: Pass namespace to RecordDecl.
1848         * class.cs (PartialContainer.Create): Likewise.
1849         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1850         called.
1851         * decl.cs (Declspace.RecordDecl): Remove.
1852         * namespace.cs (NamespaceEntry.DefineName): Remove.
1853
1854 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1855
1856         * rootcontext.cs: Reset TargetExt as well.
1857
1858 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1859
1860         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1861         -langversion:ISO-1.
1862
1863 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1864
1865         Fix #75080, cs0119.cs.
1866         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1867         of ...
1868         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1869         allowing ExprClass.Type and ExprClass.Namespace for
1870         ResolveFlags.VariableOrValue.
1871         (Expression.Resolve) [1-argument variant]: Change default resolve
1872         flags based on language version.
1873         (Expression.Error_UnexpectedKind): Use a simple string array
1874         rather than an ArrayList.
1875         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1876         not ExprClass.Type.
1877         (TypeOfVoid.DoResolve): Likewise.
1878         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1879         flags argument -- it always has the same value.
1880
1881 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1882
1883         Fix #75081.
1884         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1885         Use it in the error message.
1886         * assign.cs, expression.cs, statement.cs: Update.
1887
1888 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1889
1890         Fix #75088.
1891         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1892         the "almostMatchedMember" case too.
1893         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1894         that failed the accessibility checks to 'almost_match'.
1895
1896 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1897
1898         * attribute.cs: Use internal MethodBuilder methods to set
1899         ExactSpelling and SetLastError on PInvoke methods, instead
1900         of passing them via charset.  Fixes #75060.
1901
1902 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1903
1904         * parameter.cs (Parameter): Remove TODO comment.
1905         (Parameter.DefineParameter): Remove Location parameter.
1906         (Parameters.LabelParameters): Likewise.
1907         * class.cs (Constructor.Emit): Update to change.
1908         (MethodData.Emit): Likewise.
1909         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1910         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1911
1912 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1913
1914         * parameter.cs,
1915           Removed Parameters.Location and added Parameter.Location instead.
1916           Removed Location parameter from Emit() and GetSignature().
1917         * anonymous.cs,
1918           class.cs,
1919           cs-parser.jay,
1920           delegate.cs,
1921           iterators.cs,
1922           statement.cs :
1923           Modified all related calls.
1924
1925 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1926
1927         Improve user-defined conversion handling.
1928         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1929         applicable operators.
1930         (AddConversionOperators): New.  Helper for GetConversionOperators.
1931         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1932         there is only one most encompassed/encompassing type.
1933         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1934         "applicable operator" handling.
1935         (UserConversion): Move cache here from GetConversionOperators.
1936         Directly cache the chosen operator, rather than the whole
1937         MethodGroup.
1938         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1939         case.  Allow conversion of decimal to sbyte and byte too.
1940         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1941         New static methods.  Used to avoid allocating EmptyExpressions in
1942         convert.cs.
1943
1944 2005-05-24  Duncan Mak  <duncan@novell.com>
1945
1946         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1947         another class, used in Convert.ExplicitNumericConversion.
1948         (CastToDecimal): New class, similar to above, but casts to
1949         System.Decimal, used in Convert.ImplicitNumericConversion and also
1950         in explicit convesion from double/float to decimal.
1951
1952         * convert.cs (ImplicitNumericConversion): Handle implicit
1953         conversions to System.Decimal.
1954         (ExplicitNumericConversion): handle explicit conversions to
1955         System.Decimal.
1956
1957         This fixes #68711.
1958         
1959 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1960
1961         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1962         know the type at this stage, just break through.   Fixes #75008 
1963
1964 2005-05-19  Martin Baulig  <martin@ximian.com>
1965
1966         * delegate.cs
1967         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1968         to disable error reporting.
1969
1970         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1971         here since we don't want to report an error; see the new test-336.cs.
1972
1973 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1974
1975         * statement.cs (ToplevelBlock.GetParameterReference)
1976         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1977         Move here from class Block.
1978         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1979         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1980
1981 2005-05-18  Martin Baulig  <martin@ximian.com>
1982
1983         Fix #74978.
1984
1985         * flowanalysis.cs
1986         (FlowBranching.Reachability): Add non-static public And() and Or()
1987         methods.
1988         (FlowBranchingSwitch): New class; do the `break_origins' thing
1989         like in FlowBranchingLoop.
1990         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1991         reachability, not just locals and parameters.
1992         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1993         switch; MergeBreakOrigins() now takes care of that.
1994
1995 2005-05-18  Martin Baulig  <martin@ximian.com>
1996
1997         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1998         a loop and may leave it, reset the barrier; fixes #74974.
1999
2000 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2001         
2002         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2003         is back.
2004         
2005         * cs-parser.jay: Catch more lexical errors.
2006         
2007         * report.cs: Add one more Error method.
2008         
2009         * rootcontext.cs,
2010         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2011
2012 2005-05-17  Martin Baulig  <martin@ximian.com>
2013
2014         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2015         #70970. 
2016
2017 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2018
2019         Fix test-382.cs.  Emit values of decimal constants.
2020         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2021         Carved out of ...
2022         (TypeContainer.AddField): ... this.
2023         (TypeContainer.EmitFieldInitializers): Allow the list of fields
2024         with initializers to include 'Const's.
2025         (ClassPart.RegisterFieldForInitialization): Forward to
2026         PartialContainer.
2027         * const.cs (Const.Const): Pass initializer to base class.
2028         (Const.Define): In case of decimal constants, register them for
2029         initialization in a static constructor.
2030
2031 2005-05-14  Martin Baulig  <martin@ximian.com>
2032
2033         * statement.cs (Block.Resolve): Correctly handle unreachable code;
2034         do not call ResolveUnreachable() on unreachable statements in
2035         here, see the comment in the source code.
2036
2037 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2038
2039         Fix #74934.
2040         * expression.cs (BinaryResolveOperator): If one of the operands of
2041         an equality comparison is 'null' and the other is a pointer type,
2042         convert the null to a NullPointer.
2043         * convert.cs (ImplicitReferenceConversion): If the expression is a
2044         NullLiteral and the target type is a pointer type, return a
2045         NullPointer instead.
2046         (ImplicitConversionStandard): Likewise.
2047
2048 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
2049         
2050         * cs-parser.jay: Set readonly context based on special constructs.
2051         
2052         * expression.cs (LocalVariableReference.DoResolveBase): Improved
2053         readonly variable error handling.
2054         
2055         * rootcontext.cs (EmitCode): Don't verify members when error
2056         occurred.
2057         
2058         * statement.cs (LocalInfo): Add reaodnly context information.
2059         (SetReadOnlyContext, GetReadOnlyContext): New methods.
2060
2061 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2062
2063         * statement.cs (Block.Resolve): Revert change below.  Modify fix
2064         for #74041 to initialize 'resolved' to false only for explicit
2065         blocks.  Fixes #74873.
2066
2067 2005-05-12  Raja R Harinath  <harinath@gmail.com>
2068
2069         Fix #74920.
2070         * typemanager.cs (unmanaged_enclosing_types): New.
2071         (IsUnmanagedType): Avoid infloops by using
2072         'unmanaged_enclosing_types' to talk with recursive invocations.
2073
2074 2005-05-13  Martin Baulig  <martin@ximian.com>
2075
2076         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2077         instance variable, not a local.  Fix #74873.
2078         (Block.ResolveUnreachable): Set it to true here.
2079
2080 2005-05-11  Duncan Mak  <duncan@novell.com>
2081
2082         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2083         continuing to process for 'arg'.
2084         (handle_preprocessing_directive): Check the argument of the #endif
2085         directive and report error CS1025 if there are any trailing
2086         characters.
2087
2088         According to the C# spec, having even whitespace after the #endif
2089         directive is illegal; however, because we call arg.TrimEnd ()
2090         beforehand, we have the same behavior as csc, allowing whitespace
2091         after the directive.
2092
2093         Fixes #74892.
2094
2095 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
2096
2097         Fix #74863.
2098         
2099         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2100         (Constructor.GetObsoleteAttribute): Implemented correctly.
2101
2102 2005-05-10  Martin Baulig  <martin@ximian.com>
2103
2104         * support.cs (ReflectionParameters.ParameterModifier): Use
2105         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2106         and `ParameterAttributes.In'.  Fixes #74884.
2107
2108 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
2109
2110         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2111         
2112         * expression.cs (Argument.GetParameterModifier): Turned to property.
2113         (Invocation.Error_InvalidArguments): Add more descriptive errors.
2114         
2115         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2116         its C# equivalent.
2117         
2118 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2119
2120         Fix #74852.
2121         * decl.cs (MemberCache.AddMethods): Register override methods,
2122         rather than non-override methods.
2123         * typemanager.cs (RegisterOverride): New.
2124         (IsOverride): Update.
2125
2126 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2127
2128         Fix #73105.
2129         
2130         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2131         recursive declaration.
2132         
2133         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2134         
2135 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2136
2137         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2138         
2139         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2140
2141 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2142
2143         Fix #74797.
2144         * decl.cs (DeclSpace.FamilyAccessible): 
2145         Use TypeManager.IsNestedFamilyAccessible.
2146
2147         Fix reopened #64812.
2148         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2149         internal'.
2150
2151 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2152             Abin Thomas  <projectmonokochi@rediffmail.com>
2153             Anoob V E  <projectmonokochi@rediffmail.com>
2154             Harilal P R  <projectmonokochi@rediffmail.com>
2155
2156         Fix #64812.
2157         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2158         allow access to all static members.
2159
2160 2005-05-04  Martin Baulig  <martin@ximian.com>
2161
2162         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2163
2164 2005-05-04  Martin Baulig  <martin@ximian.com>
2165
2166         Fix #74655.
2167
2168         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2169         section at the end; make things work if `default' is not the last
2170         section.        
2171
2172 2005-05-04  Martin Baulig  <martin@ximian.com>
2173
2174         Fix #70400.
2175
2176         * statement.cs (Switch): Replaced the `got_default' field with a
2177         `default_section' one.
2178         (Switch.CheckSwitch): Set `default_section' here.
2179         (Switch.Resolve): If we're a constant switch and the constant is
2180         not found, use the default section.
2181
2182 2005-05-03  Martin Baulig  <martin@ximian.com>
2183
2184         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2185
2186         * statement.cs (Foreach.ArrayForeach): New nested class.
2187         (Foreach.TemporaryVariable): New nested class.
2188         (Foreach.EmitArrayForeach): Removed; this is now in the new
2189         ArrayForeach class.
2190
2191 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2192
2193         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2194         more conservative.
2195         (VerifyPendingMethods): Revert change below.
2196
2197         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2198         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2199         that used to trigger warning -28.  Remove warning -28.
2200         * expression.cs (Invocation.OverloadResolve): Use
2201         TypeManager.IsOverride to distinguish override methods.
2202
2203         Fix #74773.
2204         * pending.cs (VerifyPendingMethods): If a base type implements the
2205         requested interface, don't bother checking individual methods of
2206         the base type.  As a side-effect, this prevents the creation of
2207         unnecessary proxies.
2208
2209 2005-05-02  Martin Baulig  <martin@ximian.com>
2210
2211         Fix #70182.
2212
2213         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2214         Also `And' the locals if the old vector is null.
2215         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2216         null; in this case we basically reset all the variables.        
2217
2218 2005-05-02  Martin Baulig  <martin@ximian.com>
2219
2220         Fix #74529.
2221
2222         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2223         Added `FlowBranching branching' argument; always `and' the
2224         variables instead of `or'ing them unless we're an infinite loop.
2225
2226         * statement.cs (While.Resolve): Create a new sibling unless we're
2227         infinite.       
2228
2229 2005-05-02  Martin Baulig  <martin@ximian.com>
2230
2231         Fix #70140.
2232
2233         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2234         arguments; use it instead of creating a new TopLevelBlock.
2235         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2236         our ConstructorInitializer.
2237
2238         * statement.cs
2239         (TopLevelBlock.TopLevelBranching): New public property.
2240         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2241         and create our `TopLevelBranching'.
2242
2243         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2244         anonymous method host, use `block.TopLevelBranching' rather than
2245         creating a new branching.
2246
2247 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2248
2249         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2250         a ScopeInfo, if any of the current children is a child of the new
2251         entry, move those children there.
2252
2253 2005-04-30  Martin Baulig  <martin@ximian.com>
2254
2255         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2256         at the beginning of a SwitchSection.  Fix #73335.
2257
2258 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2259
2260         Fix #74378
2261         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2262         
2263         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2264         (FieldExpr.DoResolve): Obsolete members are ignored for field
2265         initializers.
2266         
2267 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2268
2269         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2270         of arrays detection.
2271
2272         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2273         verification.
2274         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2275
2276         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2277         arrays report.
2278
2279 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2280
2281         * cs-parser.jay: Use the prefered version of -unsafe in error
2282         message.
2283
2284 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2285
2286         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2287         circumstances.
2288
2289 2005-04-20  John Luke  <john.luke@gmail.com>
2290
2291         * driver.cs: fix typo in error message, --outout to --output
2292
2293 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2294
2295         * codegen.cs (InRefOutArgumentResolving): New field.
2296         
2297         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2298         fields outside contructor.
2299         
2300         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2301         
2302 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2303
2304         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2305         parameter code was not completed ever, so it was not as up-to-date
2306         as local variables.  Must finish it.
2307
2308         The bug fix was to compare the Toplevel of the block, not the
2309         current block.  Thanks for Ben for pointing this out. 
2310
2311 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2312
2313         * decl.cs (AddMethods): Use the declaring type of the problem
2314         method to determine if we want to squash a warning.
2315
2316 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2317
2318         * attribute.cs: Removed debug output.
2319
2320         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2321         
2322         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2323         Report.Stderr.
2324         
2325 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2326
2327         Fix #74481.
2328         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2329         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2330         all null comparisons against reference types.
2331
2332 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2333
2334         Fix# 74565
2335         * class.cs (TypeContainer.CircularDepException) New nested
2336         exception class.
2337         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2338         (TypeContainer.DefineType): Removed error, reset InTransit before
2339         exit.
2340         (Class.DefineType): Throw exception when is in Transit.
2341         Catch exception and report error.
2342         (Struct.DefineType): Throw exception when is in Transit.
2343         Catch exception and report error.
2344         (Interface.DefineType): Throw exception when is in Transit.
2345         Catch exception and report error.
2346
2347         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2348         handle nested exception handlers.
2349
2350         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2351         a catch.
2352
2353         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2354         InFinally and InCatch storage.
2355
2356         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2357         (Catch.Resolve): Set and Restore ec.InCatch.
2358         (Try.Resolve): Set and Restore ec.InFinally.
2359         (Try.HasCatch): True when try has catch.
2360
2361 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2362
2363         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2364           for the same event member, so exclude such cases from warning 419.
2365           Fixed bug #74633.
2366
2367 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2368
2369         * expression.cs (Binary.ResolveOperator): Apply patch from John
2370         Luke to fix bug 59864: operators &, | and ^ on enumerations
2371         require that the same enum type on both sides.
2372
2373         * driver.cs: Add warnings to old flag usage, this is to assist
2374         people who produce Makefiles and hope that the Makefiles will be
2375         used on Windows.
2376
2377         * class.cs (TypeContainer.EmitType): Moved the definition of the
2378         special $PRIVATE$ field from the resolve phase to the Emit phase.
2379         During resolve we do not know if we are a struct with
2380         HasExplicitLayout, we know this only after the attributes for the
2381         type are emitted.
2382
2383         Set the FieldOffset to zero on the dummy field that we create for
2384         the class.   Fixes 74590.
2385
2386 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2387
2388         Fix #73834.
2389         * ecore.cs (PropertyExpr.resolved): New.
2390         (DoResolve): Use it to handle a case of double resolution here.
2391         Handle a case of identical-name-and-type-name.
2392         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2393         resolution by storing the results of expression resolution back
2394         into the "probes" array.
2395
2396 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2397
2398         Fix cs0208-7.cs and cs0208-8.cs.
2399         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2400         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2401         error reporting to point out the reason a struct is not unmanaged.
2402
2403 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2404
2405         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2406           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2407
2408 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2409
2410         Fix #74528.
2411         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2412         IdenticalNameAndTypeName here.
2413         (EventExpr.InstanceResolve): Likewise.
2414
2415 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2416
2417         C# 2.0 DefaultCharSetAttribute implementation
2418         
2419         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2420         which allows us to set GlobalNamespace for every resolve.
2421         (Attribute.ResolveArguments): Cut from Resolve.
2422         (Attribute.GetCharSetValue): Returns CharSet named argument.
2423         (Attribute.DefinePInvokeMethod): Gets default charset from
2424         module settings.
2425         (GlobalAttribute.ResolveAsTypeStep): Override.
2426         (GlobalAttribute.ResolveArguments): Override.
2427         
2428         * class.cs (TypeAttr): Is protected.
2429         
2430         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2431         (ModuleClass.DefaultCharSetType): New memeber.
2432         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2433         
2434         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2435         charset from module.
2436         
2437         * delegate.cs (TypeAttr): Override.
2438         (Delegate.DefineType): Use this TypeAttr.
2439         
2440         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2441         at very early stage (before types are defined) to resolve model
2442         module attributes. It will probably not work with corlib but it
2443         should be ok.
2444         
2445         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2446         charset from module.
2447         
2448         * typemanager.cs (default_charset_type): New type.
2449
2450 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2451
2452         * decl.cs (MemberCache.AddMethods): Don't warn if
2453         System.Object.Finalize has buggy MethodAttributes.
2454
2455         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2456         removed below.
2457
2458 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2459
2460         * doc.cs : detect ambiguous reference to overloaded members.
2461           Fixed bug #71603. MS 1.1 csc does not detect it.
2462
2463 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2464
2465         * doc.cs : delegates must not be referenced with parameters.
2466           Fixed bug #71605.
2467
2468 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2469
2470         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2471
2472 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2473
2474         * driver.cs (MainDriver): Stop processing if the CLS stage found
2475         errors. 
2476
2477         (CompilerCallableEntryPoint.InvokeCompiler): Always
2478         reset after execution;   Take a TextWriter argument for the
2479         output.
2480
2481         * report.cs: Use the error stream instead of hardcoding stderr. 
2482
2483 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2484
2485         * class.cs: Reduce code paths to test, too small of an
2486         optimization to make it worth the extra testing.  Always perform
2487         it. 
2488
2489 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2490
2491         Fix #74510.
2492         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2493         operators that had errors reported on them.
2494
2495 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2496
2497         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2498         argument types.
2499         (Attribute.Resolve): Add named argument type checking.
2500         
2501         * class.cs (FixedField.Define): Use IsPrimitiveType
2502         
2503         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2504         
2505         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2506         unsafe parameter types.
2507         
2508         * statement.cs (Using.ResolveExpression): Add better error description.
2509         
2510         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2511         
2512 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2513
2514         Fix #74484.
2515         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2516         AttributeUsageAttribute in the emitcontext of the attribute class,
2517         not in the emitcontext of the attributable entity it was attached to.
2518         * cs-parser.jay: Use 'current_class', not 'current_container',
2519         when creating a GlobalAttribute.
2520
2521 2005-04-08  Alp Toker  <alp@atoker.com>
2522
2523         * pending.cs: The fix to #58413 failed to compile methods implementing
2524         interfaces with/without params modifiers and vice versa, even though
2525         params modifiers aren't part of the signature. Make the modifier check
2526         less strict as in csc.
2527
2528 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2529             Anoob V E  <projectmonokochi@rediffmail.com>
2530             Harilal P R  <projectmonokochi@rediffmail.com>
2531
2532         Fix #58413.
2533         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2534         modifiers of pending methods.
2535         (PendingImplementation.PendingImplementation): Initialize it.
2536         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2537         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2538         with ParameterData.  Add check for modifiers.
2539         * class.cs (MethodData.Define): Update to changes.
2540
2541 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2542
2543         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2544
2545 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2546
2547         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2548         property.
2549         
2550         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2551         
2552         * rootcontext.cs,
2553         * typemanager.cs: Registered RequiredAttributeAttribute.
2554         
2555 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2556
2557         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2558         Warning CS0169 is back at level 3.
2559         (IMethodData.SetMemberIsUsed): New method.
2560         
2561         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2562         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2563         
2564         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2565
2566         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2567         contants.
2568         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2569         is used.
2570         
2571         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2572         is used.
2573         
2574         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2575         to avoid the problems with nested types.
2576
2577 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2578             Anoob V.E  <projectmonokochi@rediffmail.com>
2579             Harilal P.R  <projectmonokochi@rediffmail.com>
2580             Raja R Harinath  <rharinath@novell.com>
2581
2582         Fix #73820.
2583         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2584         attribute.
2585         * typemanager (GetConstructor): Make public.
2586
2587 2005-04-05  John Luke  <john.luke@gmail.com>
2588             Raja R Harinath  <rharinath@novell.com>
2589
2590         Fix #62232.
2591         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2592         struct too.  Return false quicker in a few cases.
2593         (VerifyUnManaged): Use it.
2594
2595 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2596
2597         Fix #74041.
2598         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2599         not 'unreachable_seen'.
2600
2601 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2602
2603         * attribute.cs (Attribute.GetValue): Removed unused.
2604         
2605         * codegen.cs (CodeGen.TrimExt): Removed unused.
2606         
2607         * cs-parser.jay (output): Removed unused.
2608         
2609         * cs-tokenizer.cs (hex_digits): Removed unused.
2610         
2611         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2612         
2613         * expression.cs (Indirection.LoadExprValue): Removed unused.
2614         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2615         
2616         * iterators.cs (Iterator.param_types): Removed unused.
2617         
2618         * statement.cs (Goto.block): Removed unused.
2619         (ToplevelBlock.did): Removed unused.
2620         (Switch.ResolveConstantSwitch): Removed unused.
2621
2622 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2623
2624         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2625         resetting thingy.
2626
2627 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2628
2629         Fix #74232 and cs0208-3.cs.
2630         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2631         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2632         unmanaged type.  Don't use FieldBuilders when 't' is a
2633         TypeBuilder.  Use ModFlags and MemberType fields.
2634         * class.cs (MemberBase.member_type): Rename from MemberType.
2635         (MemberBase.MemberType): New property.  Determines member_type on
2636         demand.
2637         (MemberBase.DoDefine): Don't initialize MemberType here.
2638         (FieldMember.Define): Likewise.
2639
2640 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2641
2642         Fix #74241
2643         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2644         Attributes are emitted there.
2645         
2646 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2647
2648         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2649         keyword in 'partial enum' too.
2650         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2651         is not allowed).
2652         Report from Kamil Skalski <nazgul@omega.pl>.
2653
2654         Fix #74309.
2655         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2656         have partial containers too.
2657
2658         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2659         in block' checks to Block.CheckInvariantMeaningInBlock.
2660         * statement.cs (Block.GetKnownVariableInfo): Make private.
2661         (Block.IsVariableUsedInChildBlock): Remove.
2662         (Block.IsVariableUsedInBlock): Likewise.
2663         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2664         conflicting declaration.
2665         (Block.AddVariable): Make error messages less long-winded and more
2666         specific.  Show location of conflicting declaration.
2667         * parameter.cs (Parameters.Location): New readonly property.
2668
2669 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2670
2671         Clean up semantics of invoking ResolveMemberAccess.
2672         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2673         can have an instance, ensure that we pass in a non-TypeExpression
2674         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2675         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2676         argument.  Update to changes and simplify.
2677         (FieldExpr.Emitinstance): Remove CS0120 check.
2678         (PropertyExpr.EmitInstance): Likewise.
2679         * expression.cs (Argument.Resolve): Likewise.
2680         (Invocation.DoResolve): Update to changes in semantics of
2681         InstanceExpression.
2682
2683 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2684
2685         Fix #74241
2686         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2687         customization.
2688         
2689         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2690
2691 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2692
2693         Fix difference in behaviour with commandline invocation.
2694         * driver.cs (Driver.Reset): New.
2695         (CompilerCallableEntryPoint): Call it.
2696
2697         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2698         variable" warnings if the boolean expression failed to resolve.
2699
2700 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2701
2702         * attribute.cs: Fix the union of several permissions when some of them
2703         are unrestricted (so the result isn't an unrestricted permission set).
2704         Fix #74036.
2705
2706 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2707
2708         * ecore.cs (MemberExpr): New class.  Convert from interface
2709         IMemberExpr.
2710         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2711         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2712         error checks.
2713         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2714         (MethodGroupExpr.IsExplicitImpl): Remove.
2715         (Expression.GetFieldFromEvent): Remove.
2716         (SimpleName.MemberStaticCheck): Remove.
2717         (SimpleName.DoSimpleNameResolve): Update to changes.
2718         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2719         (MemberAccess.IdenticalNameAndTypeName): Remove.
2720         (MemberAccess.error176): Move to MemberExpr.
2721         (MemberAccess.DoResolve): Update to changes.
2722         (BaseAccess.DoResolve): Likewise.
2723
2724 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2725
2726         C# 2.0 Conditional attribute class implementation
2727         
2728         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2729         Analyzes class whether it has attribute which has ConditionalAttribute
2730         and its condition is not defined.
2731         
2732         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2733         (Class.IsExcluded): New method. Search for at least one defined
2734         condition in ConditionalAttribute of attribute class.
2735
2736 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2737
2738         * ecore.cs (PropertyExpr): Derive from Expression, not
2739         ExpressionStatement.
2740         (PropertyExpr.EmitStatement): Remove.
2741
2742 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2743
2744         Fix #74060.
2745         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2746         internal field "value__" of an enum be private.  The examples for
2747         "value__" that I found on MSDN all used FieldAttributes.Private.
2748
2749         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2750         Don't mention IL method attribute names.
2751
2752         Fix #47991.  Remove a TODO.
2753         * statement.cs (Block.Toplevel): Make into a field.
2754         (Block.Parameters): Move into ToplevelBlock.
2755         (Block.known_variables): Rename from child_variable_names.
2756         (Block.Block): Remove variants that take Parameters.  Initialize
2757         'Toplevel' with the immediately surrounding toplevel block.
2758         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2759         LocalInfo parameter.
2760         (Block.GetKnownVariableInfo): New.
2761         (Block.IsVariableNameUsedInChildBlock): Update.
2762         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2763         the block, even though it may not be in scope.
2764         (Block.AddVariable): Remove Parameters parameter.  Use
2765         Toplevel.Parameters instead.
2766         (Block.AddConstant): Remove Parameters parameter.
2767         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2768         (Block.IsParamaterReference): Likewise.
2769         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2770         (ToplevelBlock.Parameters): New.  Moved from Block.
2771         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2772         initialize Parameters to a non-null value.
2773         * cs-parser.jay: Update to changes.
2774         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2775         simple names that mean different things in the same block.  Use
2776         Block.IsVariableNameUsedInBlock.
2777
2778 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2779
2780         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2781         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2782         GetTypeHandle.  It is possible for a reflected type to derive from
2783         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2784         System.Array during mscorlib compilation).
2785         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2786         contain a method_hash, don't create one either.  Don't create a
2787         deep copy of the base cache's method_hash.
2788         (MemberCache.SetupCache): Rename back from DeepCopy.
2789         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2790         already initialized.  If we see an override function, add its
2791         underlying base virtual function to the member_hash too.
2792
2793         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2794
2795 2005-03-26  Raja R Harinath  <harinath@acm.org>
2796
2797         Fix #73038.
2798         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2799         fails to resolve, ensure that the LHS is still resolved as an
2800         lvalue.
2801
2802 2005-03-25  Raja R Harinath  <harinath@acm.org>
2803
2804         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2805         ec.ContainerType.
2806         (Enum.current_ec): Remove.
2807         (Enum.LookupEnumValue): Remove EmitContext argument.
2808         Just uses the one created during DefineType.
2809         (Enum.FindMembers): Update.
2810         * expression.cs (MemberAccess.DoResolve): Update.
2811
2812 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2813
2814         * assign.cs (Assign.DoResolve): Check for CS1717 when
2815         source and target are same (uses Equals).
2816
2817         * expression.cs (LocalVariableReference, ParameterReference,
2818         This): Implemented Equals, GetHashCode.
2819
2820         * statement.cs (Block.GetParameterReference): Removed useless
2821         local variable.
2822
2823 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2824
2825         Fix cs0128.cs
2826         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2827         blocks before deciding whether the error is cs0136 or cs0128.
2828
2829         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2830         (using_alias_directive, using_namespace_directive): Pass
2831         MemberName, not an expression to Namespace.UsingAlias and
2832         Namespace.Using.
2833         (MakeName): Use the MemberName of the namespace.
2834         * namespace.cs (Namespace.MemberName): New.
2835         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2836         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2837         Likewise.
2838         * decl.cs (MemberName.Name): Make readonly.
2839         (MemberName.FromDotted): New "constructor".
2840         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2841         (MemberCore.Name): Compute from MemberName on demand.
2842         (MemberCore.SetMemberName): Provide a way to change the
2843         MemberName.
2844         (MemberCore.AddToContainer): Don't take a fullname parameter.
2845         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2846         fully qualified name of the container to the member name.
2847         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2848         only if the type is a member of the root container.
2849         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2850         MemberName.Left rather than searching for an embedded ".".
2851         (PartialContainer.CreatePart): Update to changes in RootContext.
2852         (MemberBase.ShortName): Turn into a property.  Use
2853         MemberCore.SetMemberName.
2854         (MemberBase.ExplicitInterfaceName): Remove.
2855         (MemberBase.UpdateMemberName): Remove.
2856         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2857         (PropertyBase.SetMemberName): New override.
2858         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2859         (Tree.GetDecl): New.
2860         (Tree.AllDecls): Rename from Decls.
2861         * attribute.cs, enum.cs, report.cs: Update to changes.
2862         * driver.cs (MainDriver): Use MemberName.FromDotted on
2863         RootContext.MainClass.
2864
2865 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2866
2867         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2868         checks.
2869
2870         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2871
2872 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2873
2874         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2875         property accessor modifiers.
2876
2877         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2878         fixed buffer attribute (CS1716).
2879         (PropertyMethod.HasCustomAccessModifier): When property accessor
2880         has custom modifier.
2881
2882         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2883         modifiers.
2884         (PropertyExpr.DoResolveLValue): Add CS0272.
2885
2886 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2887
2888         * convert.cs: When converting to a pointer, use the proper Conv.U
2889         or Conv.I depending on the source data type.
2890
2891         * cs-tokenizer.cs: Make the size for large decimal constants,
2892         fixes #72957.
2893
2894 2005-03-17  Martin Baulig  <martin@ximian.com>
2895
2896         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2897         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2898
2899 2005-03-17  Martin Baulig  <martin@ximian.com>
2900
2901         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2902         to bool so we can return an error condition.
2903         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2904         returned an error.
2905
2906 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2907
2908         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2909         attributes.
2910
2911 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2912
2913         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2914         Refactor to avoid traversing the list of assemblies, and to avoid
2915         string concatenation.
2916         * typemanager.cs (guid_attr_type): Remove.
2917         (negative_hits, pointers, references): Remove hashes.
2918         (type_hash): New.
2919         (GetConstructedType): New.  Uses type_hash to handle constructed
2920         types (arrays, references, pointers).
2921         (GetReferenceType, GetPointerType): Use it.
2922         (GetNestedType): New.  Uses type_hash to handle nested types of
2923         reflected types.
2924         (LookupType, LookupTypeDirect): Remove.
2925         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2926         'types' hash and LookupTypeReflection directly.
2927         (params_string, params_object): Use GetConstructedType.
2928         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2929         top-level types.
2930         (Namespace.Lookup): Use cached_types.
2931         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2932         provided by old TypeManager.LookupType.
2933         * rootcontext.cs (MakeFQN): Remove.
2934         * decl.cs (DeclSpace.MakeFQN): Likewise.
2935         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2936         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2937         TypeManager.GetConstructedType.
2938         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2939
2940 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2941
2942         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2943         indexers.
2944
2945         * cs-parser.jay: Reports CS1527 for any namespace element.
2946
2947         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2948         Added CS0407.
2949
2950         * expression.cs (ParameterReference.IsAssigned): Changed error to
2951         CS0269.
2952         (Error_WrongNumArguments): Moved CS0245 detection here.
2953
2954         * statement.cs (Return.Resolve): Add CS1622 report.
2955
2956 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2957
2958         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2959
2960 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2961
2962         * attribute.cs expression.cs: Get rid of some allocations.
2963
2964 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2965
2966         * doc.cs : just eliminate the latest change.
2967
2968 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2969
2970         * doc.cs : commented out the latest change. It breaks xml-030.cs
2971
2972 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2973
2974         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2975           fail. So invoke CreateType() in FindDocumentedType().
2976
2977 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2978
2979         * cs-tokenizer.cs : added IsKeyword().
2980         * doc.cs : Detect keyword incorrectly used as identifier.
2981           Allow identifiers prefixed by @.
2982
2983 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2984
2985         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2986         It caused exception in namespace resolving (again!).
2987         
2988         * class.cs (Class.ctor): Removed exit.
2989         (PropertyMethod.ctor): ditto.
2990         
2991         * codegen.cs (Codegen.Reset): Reset static data.
2992         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2993         
2994         * cs-tokenizer.cs (Cleanup): Removed.
2995         
2996         * driver.cs (GetSystemDir): Rewrote to one line command.
2997         It caused problem with unloaded dynamic modules.
2998         (UnixParseOption): Removed Exit.
2999         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3000         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3001         Now can be mcs used as library.
3002         
3003         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3004         empty location.
3005         
3006         * location.cs (Reset): Reset static data.
3007         
3008         * namespace.cs (Reset): Reset static data.
3009         
3010         * report.cs (Report.Reset): Reset static data.
3011         
3012         * rootcontext.cs (RootContext.Reset): Reset static data.
3013         
3014         * tree.cs (RootTypes.ctor): Use Location.Null
3015         
3016         * typemanager.cs (TypeManager.Reset): Reset static data.
3017         (CoreLookupType): Removed Exit.
3018         (TypeHandle.Reset): Reset static data.
3019         
3020 2005-03-10  Raja R Harinath  <rharinath@novell.com>
3021
3022         Fix #73516.
3023         * typemanager.cs (ComputeNamespaces): Import namespaces from
3024         referenced modules too.
3025
3026 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3027
3028         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
3029         than '.'.
3030
3031 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3032
3033         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
3034         enclosing DeclSpace.  This ensures that a name-lookup populates
3035         more caches and there are fewer 'TypeExpression's.  Carve out
3036         nested type lookup into ...
3037         (LookupNestedTypeInHierarchy): ... this.
3038
3039 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3040
3041         Clean up a few partial-class semantics.  
3042         Fixes test-357.cs and cs1618-2.cs.
3043         * cs-parser.jay (struct_declaration): Use 'current_class' as
3044         parent of newly-created struct.  Remove call to Register ().
3045         Use 'pop_current_class' to complete handing the current struct.
3046         (interface_declaration): Likewise.
3047         (class_declaration): Likewise.
3048         (enum_declaration): Use 'current_class' as parent of newly created
3049         enum.
3050         (delegate_declaration): Likewise.
3051         (pop_current_class): New function.  This is used to handle closing
3052         up the 'current_class' and 'current_container', and pointing them
3053         to the enclosing class/container.
3054         (CSharpParser): Initialize 'current_class' too.
3055         * decl.cs (MemberCore): Add check for invariant: a partial
3056         container is not a parsed entity, and thus does not enclose any
3057         parsed members.
3058         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3059         (DeclSpace.BaseTypeExpr): Use it.
3060         (DeclSpace.LookupType): Add check for invariant.
3061         * class.cs (TypeContainer): Add check for invariant: a nested
3062         class should have the same NamespaceEntry as its enclosing class.
3063         (TypeContainer.EmitFieldInitializers): Make virtual.
3064         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3065         MemberCore.
3066         (TypeContainer.Register): Remove.
3067         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3068         null.  Use TypeResolveEmitContext for resolving base types and
3069         interfaces.  Move initialization of Parts.TypeBuilder here from
3070         ...
3071         (TypeContainer.DefineNestedTypes): ... here.
3072         (PartialContainer): Take a Namespace not a NamespaceEntry.
3073         (PartialContainer.Create): Don't use Register.  Call the
3074         appropriate Add... function directly.
3075         (ClassPart): Take both the PartialContainer and the enclosing
3076         class as constructor arguments.
3077         (ClassPart.EmitFieldInitializers): Override.
3078         (ClassPart.PartFindNestedTypes): Remove.
3079         (FieldBase.GetInitializerExpression): Resolve the initializer
3080         expression in the emit context of the enclosing class.
3081         * tree.cs (RootTypes): Remove Register ().
3082         
3083 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
3084
3085         * cs-parser.jay: Removed CS0134.
3086         
3087         * driver.cs: Removed CS1901.
3088         
3089         * expression.cs (SizeOf.DoResolve): Don't report CS0233
3090         for predefined types.
3091
3092 2005-03-07  Duncan Mak  <duncan@novell.com>
3093
3094         * codegen.cs (Save):  Catch UnauthorizedAccessException as
3095         well. Fixes bug #73454.
3096
3097 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3098
3099         * cs-tokenizer.cs (xtoken): Add CS1035.
3100         
3101         * class.cs (MethodData.Define): Add CS0683.
3102         (FieldMember.ctor): Add CS0681.
3103
3104 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3105
3106         * ecore.cs (SimpleName.DoResolve): Rename from
3107         SimpleName.DoResolveAllowStatic.
3108         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3109         Pass 'intermediate' flag to MemberStaticCheck.
3110         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3111         of "intermediate" lookups via MemberAccess.
3112         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3113         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3114
3115 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3116
3117         Fix #73394.
3118         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3119         slipped in because of variable names that are identical to a
3120         builtin type's BCL equivalent ('string String;', 'int Int32;').
3121         (PropertyExpr.EmitInstance): Likewise.
3122
3123 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3124
3125         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3126         
3127         * report.cs (warning_ignore_table): Made public.
3128
3129 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3130
3131         Fix #73282.
3132         * class.cs (MethodData.Emit): Pass 'container' to
3133         container.GetObsoleteAttribute instead of 'container.Parent'.
3134
3135 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3136
3137         * cs-parser.jay: Add 1534 error test.
3138
3139         * iterators.cs (Yield.CheckContext): Add error 1629.
3140         (Iterator.ctor): Save unsafe modifier.
3141         (MoveNextMethod.DoEmit): Restore unsafe context.
3142
3143         * namespace.cs (UsingAlias): Better error message.
3144
3145 2005-03-03  Dan Winship  <danw@novell.com>
3146
3147         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3148         the warning message [#73219]
3149
3150 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3151
3152         Fix compile with MCS 1.0.0.0.
3153         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3154         w_restore to not depend on string constant folding.
3155
3156 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3157
3158         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3159         CS0246 check to users who passed 'silent = false'.
3160         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3161         check.
3162         (SimpleName.SimpleNameResolve): Update.
3163         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3164         (MemberAccess.IdenticalNameAndTypeName): Update.
3165         * doc.cs (FindDocumentedTypeNonArray): Update.
3166
3167 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3168
3169         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3170         * parameters.cs (ComputeAndDefineParameters): Remove.
3171         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3172         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3173         Use GetParameterInfo.
3174
3175 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3176
3177         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3178
3179 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3180
3181         Unify DeclSpace.LookupType and DeclSpace.FindType.
3182         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3183         is in charge of defining nested types on demand.
3184         (DeclSpace.LookupType): Use it when the current_type is a
3185         TypeBuilder.  Use LookupTypeDirect for reflected types.
3186         (DeclSpace.FindType): Remove.
3187         (DeclSpace.LookupInterfaceOrClass): Likewise.
3188         (DeclSpace.DefineTypeAndParents): Likewise.
3189         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3190         DeclSpace.LookupType.
3191         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3192         * typemanager.cs (LookupType): Simplify.
3193         (AddUserType): Remove type from negative_hits.
3194         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3195         * class.cs (TypeContainer.FindMembers): Move handling of nested
3196         types ...
3197         (TypeContainer.FindMembers_NestedTypes): ... here.
3198         (TypeContainer.FindNestedType): Implement override.
3199         (ClassPart.FindNestedType): Delegate to PartialContainer.
3200         (ClassPart.PartFindNestedType): Looks up the nested types of the
3201         part alone.
3202
3203 2005-03-02  Martin Baulig  <martin@ximian.com>
3204
3205         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3206         static constructor in static classes.
3207
3208 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3209
3210         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3211         sizeParamIndex is not specified.
3212
3213 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3214
3215         Fix #73117
3216         * report.cs (WarningMessage.IsEnabled): Missing null check.
3217
3218 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3221         in the fields and not in the properties.
3222
3223 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3224
3225         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3226         fields as well.
3227
3228 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3229
3230         * attribute.cs: Small refactoring (improved robustness).
3231         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3232         (ValidateGuid): Removed.
3233         (Resolve): Removed referenced to above mentioned.
3234         (GetAttributeUsage): Made private and changed to work without
3235         class assistance.
3236         (GetIndexerAttributeValue): Don't crash.
3237         (GetConditionalAttributeValue): Ditto.
3238         (GetClsCompliantAttributeValue): Ditto.
3239         (ExtractSecurityPermissionSet): All attributes exceptions are
3240         error 648.
3241         (GetPropertyValue): New helper.
3242         (GetMethodImplOptions): New method.
3243         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3244         some missing properties.
3245         
3246         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3247         (Method.ApplyAttributeBuilder): Updated.
3248         
3249         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3250         exception.
3251
3252 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3253
3254         Fix #73052.
3255         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3256         non-simple types (array, pointer, reference).
3257
3258 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3259
3260         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3261
3262         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3263         for operators.
3264         (Method.CheckBase): Catch wrong destructor here.
3265         (MethodData.Define): Add errors 550, 668.
3266
3267         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3268
3269         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3270
3271         * pending.cs (VerifyPendingMethods): Add error 551.
3272
3273         * typemanager.cs (CSharpName): Next error report helper.
3274
3275 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3276
3277         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3278         attributes. Removed useless attribute double check.
3279         It saves almost 2MBs for corlib.
3280
3281 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3282
3283         Fix #72924.
3284         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3285         called twice in case of error.
3286
3287 2005-02-23  Chris Toshok  <toshok@ximian.com>
3288
3289         Fix compiler portions of #72827.
3290         * statement.cs (Block.Emit): call Begin/EndScope on the
3291         EmitContext instead of the ILGenerator.
3292
3293         * codegen.cs (EmitContext.BeginScope): new method, call
3294         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3295         we have one.)
3296         (EmitContext.BeginScope): same, but EndScope and CloseScope
3297
3298         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3299         offset and call the superclass's OpenScope(int) with it.
3300         (SymbolWriter.CloseScope): get the current il
3301         offset and call superclass's CloseScope(int) with it.
3302
3303 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3304
3305         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3306         CS1677 for out and ref as well.
3307
3308         * class.cs (Method.Define): Add error CS1599 detection.
3309         
3310         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3311         
3312         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3313         
3314         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3315         
3316         * support.cs.cs (ModifierDesc): New helper method.
3317
3318 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3319             Abin Thomas  <projectmonokochi@rediffmail.com>
3320             Anoob V E  <projectmonokochi@rediffmail.com>
3321             Harilal P R  <projectmonokochi@rediffmail.com>
3322
3323         Fix #57851, #72718.
3324         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3325         MemberLookup (used for error reporting) actually returns a result.
3326         Fix error report number (122, not 112).
3327
3328 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3329             Anoob V E  <projectmonokochi@rediffmail.com>
3330             Harilal P R  <projectmonokochi@rediffmail.com>
3331
3332         Fix #71134.
3333         * pending.cs (PendingImplementation.GetAbstractMethods):
3334         Find NonPublic members too.
3335
3336 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3337
3338         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3339         Fixed error 217.
3340         
3341         * class.cs (MethodCore.CheckMethodAgainstBase):
3342         Add error 239 report.
3343
3344 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3345
3346         Fix #68955.
3347         * expression.cs (Invocation.IsApplicable): Make public.
3348         (Invocation.IsParamsMethodApplicable): Likewise.
3349         * delegate.cs (Delegate.VerifyApplicability): Don't use
3350         Invocation.VerifyArgumentCompat for parameter applicability
3351         testing.  Use Invocation.IsApplicable and
3352         Invocation.IsParamsMethodApplicable.
3353
3354 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3355
3356         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3357         
3358         * class.cs (Operator.Define): Add error 217 report.
3359         
3360 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3361
3362         * namespace.cs (UsingEntry.Resolve): Undo change below.
3363
3364 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3365
3366         Fix #72756.
3367         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3368         disable the error message when the extended MemberLookup also
3369         fails.
3370         (Expression.MemberLookupFinal): Update.
3371         (SimpleName.DoSimpleNameResolve): Update.
3372         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3373         Don't use MemberLookupFinal.
3374         (New.DoResolve): Update.
3375         (BaseAccess.CommonResolve): Update.
3376
3377 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3378
3379         Fix #72732.
3380         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3381         occured previously, don't resolve again.
3382
3383 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3384
3385         Fix #69949
3386         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3387         argument. Call ResolveAttributeUsage for unresolved.
3388         when types doesn't match ctor arguments.
3389         
3390         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3391         for nested attribute classes.
3392         (Class.attribute_usage): Removed.
3393         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3394         for attribute class.
3395         
3396         * ecore.cs (IsAttribute): Removed.
3397         
3398         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3399         
3400         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3401         now normal types.
3402         (attribute_types): Removed.
3403         (EmitCode): Global attributes are emited as the latest.
3404
3405 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3406
3407         * class.cs (EmitFieldInitializers): Don't emit field initializer
3408         for default values when optimilization is on.
3409         
3410         * constant.cs (Constant.IsDefaultValue): New property.
3411         
3412         * driver.cs: Add /optimize handling.
3413         
3414         * constant.cs,
3415         * ecore.cs,
3416         * literal.cs: Implement new IsDefaultValue property.
3417         
3418         * rootcontext.cs (Optimize): New field, holds /optimize option.
3419
3420 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3421
3422         Fix crasher in re-opened #72347.
3423         * namespace.cs (Namespace.Lookup): Return null if
3424         DeclSpace.DefineType returns null.
3425
3426         Fix #72678.
3427         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3428
3429 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3430
3431         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3432         now returns null if it cannot resolve to an lvalue.
3433         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3434         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3435         returned null.  Remove check for SimpleName.
3436         (EventExpr.DoResolveLValue): New.
3437         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3438         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3439         error from ...
3440         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3441         avoid CS0131 error.
3442         (Unary.ResolveOperator): Move CS0211 check ...
3443         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3444         CS0131 error.
3445         (Unary.DoResolveLValue): Simplify.
3446         (AddressOf.DoResolveLValue): New.
3447         (ArrayAccess.DoResolveLValue): New.
3448
3449 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3450
3451         * attribute.cs (Attribute.Resolve): Add arguments casting for
3452         when types doesn't match ctor arguments.
3453
3454 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3455
3456         Fix parts of #63202.
3457         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3458         lookup of operator in base type.  Ensure that all checks happen
3459         when the operator resolves to an "op_..." method.
3460
3461 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3462
3463         Fix #71992.
3464         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3465         'ignore_cs0104' parameter.  Pass it to ...
3466         (NamespaceEntry.Lookup): ... this.
3467         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3468         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3469         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3470         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3471         Update.  Request that cs0104 errors be ignored.
3472         (ComposedCast.ResolveAsTypeStep): Update.
3473
3474 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3475
3476         Fix #59209.
3477         * expression.cs (Invocation.BetterFunction): Remove support for
3478         comparing virtual functions and their overrides.
3479         (Invocation.IsOverride): New.
3480         (Invocation.OverloadResolve): Don't consider 'override' functions
3481         during candidate selection.  Store them in a lookaside list.
3482         If the selected method is a 'virtual' function, use the list to
3483         find any overrides that are closer to the LHS type.
3484
3485 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3486
3487         * expression.cs (New.DoResolve): Add complex core type reduction.
3488         (New.Constantify): Converts complex core type syntax like 'new int ()'
3489         to simple constant.
3490         
3491 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3492
3493         * decl.cs (EntryType.EntryType): New constructor to create an
3494         updated copy of a cache entry.
3495         (MemberCache.AddMethods): Use it.
3496         (MemberCache.ClearDeclaredOnly): Remove.
3497         (MemberCache.MemberCache): Update.
3498
3499 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3500
3501         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3502         variable.  This one is represents the actual low-level declaration
3503         of the method, as opposed to the semantic level `IsStatic'.   
3504
3505         An anonymous method which is hosted into a static method might be
3506         actually an instance method.  IsStatic would reflect the
3507         container, while MethodIsStatic represents the actual code
3508         generated.
3509
3510         * expression.cs (ParameterReference): Use the new MethodIsStatic
3511         instead of IsStatic.
3512
3513         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3514         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3515         set on the current EmitContext. 
3516
3517         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3518         resolve our casted expression as an LValue.  This triggers the
3519         proper LValue processing that is later required by Assign.
3520
3521         This fixes 72347.
3522
3523         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3524
3525 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3526
3527         C# 2.0 Fixed buffer implementation
3528
3529         * anonymous.cs: Update after RegisterHelperClass renaming.
3530
3531         * attribute.cs (AttributeTester.fixed_buffer_cache):
3532         Cache of external fixed buffers.
3533         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3534         implementation if field is fixed buffer else null.
3535
3536         * class.cs
3537         (TypeContainer.AddField): Accept FieldMember instead of Field.
3538         (FieldBase.IsFieldClsCompliant): Extracted code from
3539         VerifyClsCompliance descendant customization.
3540         (FixedField): New class handles fixed buffer fields.
3541         (FixedFieldExternal): Keeps information about imported fixed
3542         buffer.
3543         (IFixedField): Make access to internal or external fixed buffer
3544         same.
3545
3546         * cs-parser.jay: Add fixed buffer parsing.
3547
3548         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3549         buffer.
3550
3551         * expression.cs (Indirection): Extended implementation to accept
3552         fixed buffer field.
3553         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3554         (ElementAccess.MakePointerAccess): Get type as parameter.
3555         (DoResolve): Add fixed buffer field expression conversion.
3556         (DoResolveLValue): Ditto.
3557         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3558         (ArrayPtr): Derives from FixedBufferPtr.
3559         (ArrayPtr.Emit): Add extra emit for array elements.
3560
3561         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3562
3563         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3564         for compiler generated types.
3565         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3566
3567         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3568         and consume less memory.
3569         (Fixed.Resolve): Add fixed buffer case.
3570
3571         * typemanager.cs (compiler_generated_attr_ctor,
3572         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3573         (HasElementType): Add our own implementation to work on every
3574         runtime.
3575
3576 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3577
3578         * anonymous.cs (CaptureContext): Track whether `this' has been
3579         referenced.   
3580
3581         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3582         only captured `this' if it was implicitly done (instance
3583         methods/variables were used). 
3584
3585         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3586         `this' must be captured.
3587
3588 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3589  
3590         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3591         is null it means that there has been no need to capture anything,
3592         so we just create a sibling.
3593
3594         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3595
3596         Just a partial fix.  The other half is fairly elusive.
3597         
3598 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3599
3600         Fix #52586, cs0121-4.cs.
3601         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3602         and return a hashtable.
3603         (MemberCache.ClearDeclaredOnly): New.
3604         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3605         the method_hash of a base type too.
3606         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3607         type methods.  Overwrite entries with the same MethodHandle so
3608         that the ReflectedType is correct.  The process leaves in base
3609         virtual functions and their overrides as distinct entries.
3610         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3611         matters since it was boxed in a ArrayList before.
3612         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3613         modifier.
3614         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3615         case of a virtual function and its override (choose the overload
3616         as better).
3617         (Invocation.OverloadResolve): Avoid 'override' members during
3618         'applicable_type' calculation.
3619
3620 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3621
3622         Combine two near-redundant caches.
3623         * typemanager.cs (method_params): Rename from method_internal_params.
3624         (TypeManager.GetParameterData): New.  Replace
3625         Invocation.GetParameterData.
3626         (TypeManager.LookupParametersByBuilder): Remove.
3627         * expression.cs (Invocation.method_parameter_cache): Remove.
3628         (Invocation.GetParameterData): Remove.
3629         Update to changes.
3630         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3631         Update to changes.
3632
3633 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3634
3635         Fix #72015.
3636         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3637         TypeManager.multicast_delegate_type is null, resolve it by looking
3638         up "System.MulticastDelegate".
3639         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3640
3641 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3642             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3643             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3644
3645         Fix cs0164.cs.
3646         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3647         (LabeledStatement.AddReference): New.  Set 'referenced'.
3648         (Goto.Resolve): Use it.
3649
3650 2005-02-05  John Luke  <john.luke@gmail.com>
3651
3652         * driver.cs: remove duplicate -doc line in Usage ()
3653
3654 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3655
3656         * location.cs (Location.AddFile): Fix CS2002 error report.
3657
3658 2005-02-02  Martin Baulig  <martin@ximian.com>
3659
3660         * delegate.cs (Delegate.DefineType): Report an internal error if
3661         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3662         details.        
3663
3664 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3665
3666         Fix a crasher in a variant of #31984.
3667         * const.cs (Constant.CheckBase): New override that defers the
3668         new-or-override check in case the base type hasn't been populated
3669         yet.
3670         (Constant.Define): Ensure the new-or-override check is performed.
3671
3672 2005-02-01  Duncan Mak  <duncan@ximian.com>
3673
3674         * const.cs (LookupConstantValue): Check that `ce' is not null
3675         before calling GetValue ().
3676
3677 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3678
3679         Fix test-334.cs (#69519).
3680         * cs-parser.jay (using_alias_directive): Pass in an expression to
3681         NamespaceEntry.UsingAlias.
3682         (using_namespace_directive): Pass in an expression to
3683         NamespaceEntry.Using.
3684         (namespace_name): Don't flatten to a string.
3685         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3686         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3687         ResolveAsTypeStep.
3688         (NamespaceEntry.UsingEntry): Likewise.
3689         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3690         changes.
3691         (NamespaceEntry.LookupForUsing): Remove.
3692         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3693         names.
3694         (NamespaceEntry.Lookup): Remove support for dotted names.
3695
3696 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3697
3698         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3699         split into two.
3700         (NamespaceEntry.ImplicitParent): Compute on demand.
3701         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3702         parallels the current.
3703         (NamespaceEntry.LookupForUsing): Use it.
3704         (NamespaceEntry.Lookup): If the current namespace-entry is
3705         implicit, don't search aliases and using tables.
3706
3707 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3708
3709         Fix #31984.
3710         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3711         BaseCache here.
3712         (TypeContainer.BaseCache): Compute on demand.
3713         (TypeContainer.FindMembers): Define constants and types if they're
3714         not already created.
3715         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3716         check.
3717         * const.cs (Constant.Define): Make idempotent.
3718
3719 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3720
3721         * pending.cs: Produce better code (no nops produced by using Ldarg
3722         + value).
3723         
3724         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3725         i - 1' it should be arg + 1.
3726
3727         Fixes bug #71819.
3728
3729 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3730
3731         * attribute.cs (Attribute.CheckAttributeType): Make private
3732         non-virtual.
3733         (Attribute.ResolveType): Make virtual.
3734         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3735         handling of RootContext.Tree.Types.
3736
3737 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3738
3739         Update attribute-handling to use the SimpleName/MemberAccess
3740         mechanisms.
3741         * cs-parser.jay (attribute): Pass in an expression to the
3742         constructors of Attribute and GlobalAttribute.
3743         * attribute.cs (Attribute): Take an expression for the name.
3744         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3745         passed in attribute name expression.
3746         (Attribute.CheckAttributeType): Use it.
3747         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3748         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3749         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3750         argument to prevent error messages if the lookup fails.
3751
3752 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3753
3754         * expression.cs (Indirection): Implemented IVariable interface
3755         to support indirection in AddressOf operator.
3756         (PointerArithmetic.Emit): Add optimalization for case where
3757         result can be precomputed.
3758
3759 2005-01-26  Martin Baulig  <martin@ximian.com>
3760
3761         * class.cs (TypeContainer.AttributeTargets): Return the correct
3762         AttributeTargets depending on our `Kind' instead of throwing an
3763         exception; fixes #71632.
3764
3765 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3766
3767         Fix #71257
3768         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3769         constant members.
3770
3771 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3772
3773         Fix #71602.
3774         * expression.cs (MemberAccess.DoResolve): Don't complain with
3775         cs0572 when the LHS of a member access has identical name and type
3776         name.
3777
3778 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3779
3780         Fix #71651, #71675
3781         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3782         CreatePermission.
3783         Create custom PermissionSet only for PermissionSetAttribute.
3784
3785 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3786
3787         Fix #71649
3788         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3789         delegates in static class.
3790
3791 2005-01-24  Martin Baulig  <martin@ximian.com>
3792
3793         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3794         merging an implicit block, just use its reachability.
3795
3796         * statement.cs (Block.Resolve): Make the unreachable code check
3797         work wrt. implicit blocks; see test-337 from #63842.
3798
3799 2005-01-21  Alp Toker  <alp@atoker.com>
3800  
3801         * cs-parser.jay: destructor_declaration's container is PartialContainer
3802         not Class when partial types are used, so use Kind prop instead of
3803         'is'.
3804         
3805 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3806
3807         * cs-parser.jay: Improve error reporting when an interface
3808         declares new types.
3809
3810 2005-01-20  Dick Porter  <dick@ximian.com>
3811
3812         * support.cs: SeekableStreamReader fix from Sandor Dobos
3813         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3814         chars are read.  Fixes bug 70369.
3815
3816 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3817
3818         * cs-parser.jay (catch_clause): Simplify current_block handling
3819         somewhat.
3820
3821 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3822
3823         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3824         code with ImplicitStandardConversion to handle the implicit
3825         conversion of method groups into valid delegate invocations. 
3826
3827         The problem is that in parameter handling we were using this code
3828         path.  Fixes bug #64698
3829
3830 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3831
3832         * cs-parser.jay: Fix several infelicities.
3833         - Avoid assigning to the parser value stack.  Code like 
3834           '$3 = null' is unclean.  Synthesize a value for the code block
3835           instead. 
3836         - Avoid using oob_stack for storing location information.  Use ...
3837         (_mark_): ... this.  New (empty) rule.  Saves the current location
3838         in $$.
3839         (foreach_statement): Avoid using oob_stack for current_block
3840         handling.  Use technique used in for_statement and
3841         using_statement.  Synthesize a value for the code block to store
3842         additional intermediate information.
3843
3844 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3845
3846         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3847         of a different type is only allowed to private fields of a
3848         containing type, not on fields of a base class.
3849
3850         See test-174.cs and error cs0122-9.cs
3851
3852 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3853
3854         Fix test-335.cs (bug #58126).
3855         * cs-parser.jay (argument): Split out non-expression parts of the
3856         rule into 'non_simple_argument'.
3857         (invocation_expression): Support parenthesized invocations with
3858         multiple arguments, and with single non-simple arguments.
3859
3860 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3861
3862         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3863         places.
3864
3865 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3866
3867         Fix cs0038-1.cs, cs1640-6.cs.
3868         * ecore.cs (Expression.Resolve): Remove special-case for
3869         SimpleName in error-handling.
3870         (Expression.almostMatchedMembers): Relax access permission to
3871         protected.
3872         (Expression.MemberLookupFailed): Handle duplicates in
3873         almostMatchedMembers list.
3874         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3875         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3876         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3877         overload if the passed in MemberInfo is a MethodBase.
3878
3879 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3880
3881         Fix #70749
3882         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3883         for non-CAS & merge permission sets properly.
3884
3885 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3886
3887         Improve standard-compliance of simple name and member access 
3888         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3889         * ecore.cs (FullNamedExpression): New abstract base class 
3890         for Namespaces and TypeExpressions.
3891         (ResolveFlags.SimpleName): Remove.
3892         (SimpleName): Remove support for dotted names.
3893         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3894         DeclSpace.FindType and DeclSpace.LookupType.
3895         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3896         (Expression.ExprClassName): Make member function.
3897         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3898         a namespace.  Remove creation of dotted "SimpleName"s.
3899         (MemberAccess.DoResolve): Likewise.
3900         * decl.cs (DeclSpace.Cache): Make private.
3901         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3902         (DeclSpace.FindType): Update.
3903         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3904         FullNamedExpression.
3905         * namespace.cs (Namespace): Derive from FullNamedExpression
3906         so that it can be part of expression resolution.
3907         (Namespace.Lookup): Return an FullNamedExpression.
3908         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3909         namespace.
3910         * rootcontext.cs (NamespaceLookup): Remove.
3911         (LookupType): Move to DeclSpace.
3912         * attribute.cs (CheckAttributeType): Update.
3913         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3914         (FindDocumentedTypeNonArray): Likewise.
3915
3916 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3917
3918         Fix cs0509.cs, cs1632.cs.
3919         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3920         is the same as IsInterface.
3921         (TypeContainer.GetClassBases): Likewise.
3922         * statement.cs (LabeledStatement.ig): New field.
3923         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3924         label.
3925         (LabeledStatement.DoEmit): Check that the label was created with
3926         the same ILGenerator.
3927
3928 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3929
3930         Fix #71058
3931         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3932         accessors to its properties.
3933
3934         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3935         from accessors to property.
3936         
3937 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3938
3939         Fix #70722
3940         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3941         only for overrides.
3942         
3943 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3944
3945         * attribute.cs: Check for null and empty strings.  
3946
3947         I have lost another battle to Paolo.
3948
3949 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3950
3951         Fix #70942
3952         * class.cs (PropertyMethod): Set Parent field in ctors.
3953         (SetMethod.InternalParameters): Add unsafe switch hack.
3954         Override MarkForDuplicationCheck where it is appropriate.
3955
3956         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3957         It says whether container allows members with the same name.
3958         Base default is no.
3959         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3960         Removed is_method parameter.
3961
3962 2005-01-06  Duncan Mak  <duncan@ximian.com>
3963
3964         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3965         because the previous change led to incorrect reporting of CS1032
3966         ("Cannot define/undefine preprocessor symbols after first token in
3967         file"). Instead of using `tokens_seen' as the only flag that
3968         triggers CS1040, introduce `comments_seen'. This new flag is used
3969         to signify having seen comments on the current line, so it is
3970         unset after a newline.
3971
3972 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3973
3974         * doc.cs : When searching for a type, find nested type too.
3975           This fixes bug #71040.
3976
3977 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3978
3979         * doc.cs :
3980           - Warn missing member comment on those classes which also does not
3981             have doc comments. Fixed bug #71041.
3982           - Don't warn missing doc comment on default constructor.
3983             Fixed bug #71042.
3984
3985 2005-01-06  Duncan Mak  <duncan@ximian.com>
3986
3987         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3988         comments, set `tokens_seen' to true. This allows us to detect
3989         misplaced preprocessor directives (i.e. not at the beginning of
3990         the a line, nor after whitespaces). In that case, report error
3991         CS1040. This fixes bug #56460.
3992
3993         * cs-parser.jay (interface_member_declaration): Add checks for
3994         IsExplicitImpl, and report CS0541 error if an interface member is
3995         defined as an explicit interface declaration.
3996
3997 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3998
3999         Fix #70817
4000         * class.cs (PropertyMethod): Set Parent field in ctors.
4001         (SetMethod.InternalParameters): Add unsafe switch hack.
4002         
4003         * decl.cs (MemberCore.Parent): Cannot be readonly.
4004
4005 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4006
4007         * decl.cs (DeclSpace.ResolveType): Remove.
4008         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4009         Merge in code from ...
4010         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4011         * class.cs, enum.cs: Update to changes.
4012
4013 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4014
4015         * anonymous.cs: Ensure that we init the scope of our parent if it
4016         has not been initialized yet.
4017
4018 2004-12-30  Duncan Mak  <duncan@ximian.com>
4019
4020         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4021         if field.FieldBuilder is null. Fixes #70758.
4022
4023         * convert.cs: Fixed some typos and updated some of the comments.
4024         (ImplicitStandardConversionExists):
4025         (TryImplicitIntConversion): If `target_type' is an interface and
4026         the type of `ic' implements this interface, return true or a new
4027         BoxedCast instead of null. This fixes #70468.
4028
4029 2004-12-29  Duncan Mak  <duncan@ximian.com>
4030
4031         * expression.cs (Argument.Emit): Check that Expr is
4032         IMemoryLocation before casting to it, and report CS1510 otherwise.
4033
4034         This fixes #70402.
4035
4036 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4037
4038         * statement.cs (Block.ThisVariable): remove the recursion here, to
4039         make the --profile more sane.
4040
4041 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4042
4043         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4044         assembly, by JB Evain.
4045
4046 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4047
4048         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4049           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4050         "parent" refers to enclosing type/class.  "base" refers to superclass.
4051
4052 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4053
4054         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4055         Ensure that we only have GlobalAttributes.
4056         * attribute.cs (Attribute.Emit): Make non-virtual.
4057         (GlobalAttribute.Emit): Remove.
4058         (Attribute.Resolve): Make virtual.
4059         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4060         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4061         the argument. Don't create one.
4062         (Attribute.GetObsoleteAttribute): Likewise.
4063         (Attribute.GetClsCompliantAttributeValue): Likewise.
4064         * class.cs, decl.cs: Update to changes.
4065
4066 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4067
4068         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4069         
4070         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4071         
4072         * statement.cs (Foreach.Resolve): Add error 186 report.
4073
4074 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4075
4076         * expression.cs (Conditional.DoResolve): Add warning 429.
4077         
4078         * statement.cs (If.Resolve): Add warning 665.
4079
4080 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4081
4082         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4083         except when in the parser, and in GlobalAttribute.
4084         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4085         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4086         RootContext.Tree.Types.NamespaceEntry once work is done.
4087         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4088         and resets RootContext.Tree.Types.NamespaceEntry.
4089
4090 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4091
4092         * cs-parser.jay: Don't create a block for every variable.
4093
4094 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4095
4096         * location.cs: Provide extra information.
4097
4098         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4099         variables from the captured environment, it is the ldarg_0.
4100
4101 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4102
4103         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4104         find a conclusion.
4105         
4106         * class.cs: Changed warning level for 169 to avoid developer
4107         displeasure from warning flooding. It will be changed back when they
4108         fix most of current BCL warnings.
4109         
4110         * RootContext.cs: Pushed default WarningLevel to 3.
4111         
4112         * statement.cs: Removed unused variable.
4113
4114 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4115
4116         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4117         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4118         Add error 502 report.
4119         (StaticClass.DefineType): Add error 441 report.
4120         (Class.AllowedModifiersProp): New virtual property as temporary
4121         extension to AllowedModifiers.
4122         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4123         to share implementation with StaticClass and don't call virtual
4124         methods from ctor.
4125         
4126         * driver.cs (MainDriver): Add error 1558 test.
4127
4128         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4129         report. Moved error 36 test here.
4130
4131         * statement.cs (Throw.Resolve): Add error 724 report.
4132
4133         * typemanager.cs: Add out_attribute_type core type.
4134         
4135 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4136
4137         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4138         3018 report.
4139         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4140
4141         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4142         3017 report.
4143         
4144         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4145
4146         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4147         Add error 3023 report.
4148         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4149
4150         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4151         implementation.
4152
4153 2004-12-12  John Luke  <john.luke@gmail.com>
4154
4155         * driver.cs (AddArgs): take -- into account when
4156         adding arguments, fixes bug 65710 
4157
4158 2004-12-12  Martin Baulig  <martin@ximian.com>
4159
4160         * expression.cs (Unary.TryReduceNegative): Added support for
4161         SByteConstant and ByteConstant.
4162         (Unary.Reduce): Check error values from TryReduceNegative().
4163
4164 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4165
4166         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4167         and report exception as error 182.
4168
4169 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4170
4171         * driver.cs (Main): Fix message when there are warnings.
4172
4173 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4174
4175         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4176
4177 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4178
4179         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4180         Reduced number of warnings.
4181         
4182         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4183
4184 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4185
4186         * driver.cs: Removed message.
4187
4188         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4189
4190 2004-12-08    <vargaz@freemail.hu>
4191
4192         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4193
4194 2004-12-08  Martin Baulig  <martin@ximian.com>
4195
4196         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4197         instead of a CS3002 for properties and indexer.
4198
4199 2004-12-08  Martin Baulig  <martin@ximian.com>
4200
4201         * decl.cs (MemberName.ToString): Make this work again.
4202
4203 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4204
4205         * attribute.cs (Resolve): Add error 591 detection.
4206
4207         * class.cs (FieldMember.Define): Add error 1547 detection.
4208         (Indexer.Define): Add error 620 detection.
4209         (Operator.Define): Add error 590 detection.
4210
4211         * ecore.cs: Missing argument for error 79.
4212
4213         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4214         detection.
4215
4216 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4217
4218         Fix #70106
4219         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4220         only.
4221
4222 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4223
4224         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4225           Some operator comments were suppressed.
4226         * doc.cs : Implicit/explicit operator name in doc comments are like
4227           "op_Explicit(type)~returnType", so added suffix handling.
4228
4229 2004-12-07  Martin Baulig  <martin@ximian.com>
4230
4231         * decl.cs
4232         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4233         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4234         (DeclSpace.ec): New protected field; store the EmitContext here.
4235         (DeclSpace.EmitContext): New public property; moved here from
4236         `TypeContainer'.
4237         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4238         EmitContext.
4239
4240         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4241         (Enum.Emit): Don't create a new EmitContext.
4242
4243         * delegate.cs (Delegate.DefineType): Always create the
4244         EmitContext.
4245
4246         * iterators.cs (Iterators.DefineIterator): Create a new
4247         EmitContext and store it in `ec'.
4248
4249 2004-08-24  Martin Baulig  <martin@ximian.com>
4250
4251         * typemanager.cs
4252         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4253         this for accessibility checks.
4254         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4255         IsNestedFamilyAccessible.
4256         (TypeManager.IsSubclassOf): New method, do what the name actually
4257         says.   
4258
4259 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4260
4261         Fix crash on cs0657-17.cs.
4262         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4263         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4264         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4265         the case where the NamespaceEntry gets overwritten.
4266
4267 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4268
4269         Fixed #69195, #56821
4270         * ecore.cs (ResolveBoolean): Tiny refactoring.
4271
4272         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4273         of right expression resolving when left is false constant and
4274         operator is LogicalAnd OR true constant and operator is LogicalOr.
4275
4276         * statement.cs (ResolveUnreachable): Always reports warning.
4277
4278 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4279
4280         * class.cs: Distinguish between 1721 and 1722 (just a little help
4281         for the programmer).
4282
4283 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4284
4285         * delegate.cs: Only allow this on new versions of the language. 
4286
4287 2004-12-02  Duncan Mak  <duncan@ximian.com>
4288
4289         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4290         Expression class.
4291         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4292         here as a static method. Take an additional bool out parameter
4293         `must_do_cs1540_check' for signaling to InstanceResolve.
4294         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4295         member field from PropertyExpr class and made it an argument of
4296         the method instead.
4297         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4298         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4299         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4300         and `remove_accessor' as well as InstanceResolve: report CS0122
4301         where applicable.
4302
4303         Fixes #70129.
4304
4305 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4306
4307         Fix test-327.cs, test-328.cs, and put in early infrastructure
4308         for eventually fixing #52697.
4309         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4310         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4311         from other methods.
4312         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4313         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4314         (VerifyUsing, error246): Update.
4315         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4316         'NamespaceEntry.LookupNamespaceOrType'.
4317
4318 2004-12-03  Martin Baulig  <martin@ximian.com>
4319
4320         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4321         method as our child, call AnonymousMethod.Compatible() on it.
4322
4323 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4324
4325         Disable XML documentation support in 'basic' profile.
4326         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4327         Redirect XmlElement to System.Object.
4328         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4329         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4330         * mcs.exe.sources: Add doc-bootstrap.cs.
4331         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4332         of doc.cs.
4333
4334 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4335
4336         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4337           comments are allowed.
4338
4339 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4340
4341         * delegate.cs: Add checks for subtypes in paramaters and return values
4342         in VerifyMethod () to add support for Covariance/Contravariance
4343         in delegates.
4344         
4345 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4346
4347         * report.cs: Remove extra closing parenthesis.
4348
4349         * convert.cs (Error_CannotImplicitConversion): If the name of the
4350         types are the same, provide some extra information.
4351
4352         * class.cs (FieldBase): Use an unused bit field from the field to
4353         encode the `has_offset' property from the FieldMember.  This saves
4354         a couple of Ks on bootstrap compilation.
4355
4356         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4357         method as our child, return the AnonymousMethod resolved
4358         expression.
4359
4360         * expression.cs (New.DoResolve): Allow return values from
4361         NewDelegate to also include AnonymousMethods.
4362
4363         Fixes #70150.
4364
4365 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4366
4367         Fix bug #70102
4368         * attribute.cs (Resolve): Improved implementation of params
4369         attribute arguments.
4370
4371         * support.cs (ParameterData): Add HasParams to be faster.
4372
4373 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4374
4375         all things are for /doc support:
4376
4377         * doc.cs: new file that supports XML documentation generation.
4378         * mcs.exe.sources: added doc.cs.
4379         * driver.cs:
4380           Handle /doc command line option.
4381           Report error 2006 instead of 5 for missing file name for /doc.
4382           Generate XML documentation when required, after type resolution.
4383         * cs-tokenizer.cs:
4384           Added support for picking up documentation (/// and /** ... */),
4385           including a new XmlCommentState enumeration.
4386         * cs-parser.jay:
4387           Added lines to fill Documentation element for field, constant,
4388           property, indexer, method, constructor, destructor, operator, event
4389           and class, struct, interface, delegate, enum.
4390           Added lines to warn incorrect comment.
4391         * rootcontext.cs :
4392           Added Documentation field (passed only when /doc was specified).
4393         * decl.cs:
4394           Added DocComment, DocCommentHeader, GenerateDocComment() and
4395           OnGenerateDocComment() and some supporting private members for
4396           /doc feature to MemberCore.
4397         * class.cs:
4398           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4399         * delegate.cs:
4400           Added overriden DocCommentHeader.
4401         * enum.cs:
4402           Added overriden DocCommentHeader and GenerateDocComment().
4403
4404 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4405
4406         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4407         unwrapping the enumeration values, chain to
4408         DoConstantNumericPromotions again, so we can promote things to the
4409         fundamental types (takes care of enums that are bytes, sbytes).
4410
4411         Fixes bug #62054.
4412
4413 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4414
4415         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4416         Fix long-standing bug in type-lookup.  Use FindType instead of
4417         LookupType when ec.ResolvingTypeTree.
4418         (Attribute.ResolveType, Attribute.Resolve)
4419         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4420         Update to changes.
4421         (Attributes.Search): Remove internal version.  Update.
4422         (Attributes.SearchMulti): Update.
4423         (Attributes.GetClsCompliantAttribute): Remove.
4424         (Attributes.GetIndexerNameAttribute): Remove.
4425         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4426         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4427         * class.cs (Indexer.Define): Likewise.
4428
4429 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4430
4431         Fix bug #68790
4432         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4433         MarshallByReference members access.
4434
4435         * expression.cs: Use CheckMarshallByRefAccess;
4436         Better error CS0197 message.
4437
4438         * report.cs: Print whole related error message.
4439
4440 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4441
4442         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4443         the current directory to help debugging.
4444
4445 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4446
4447         * class (GetClassBases): Better error 60 report.
4448         (EventProperty): Disabled warning 67 detection.
4449
4450 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4451
4452         Fix bug #60324
4453         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4454
4455         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4456         precise values.
4457
4458 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4459
4460         Fix bug #49488
4461         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4462
4463         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4464
4465 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4466
4467         * attribute.cs (Attribute.Resolve): Refine error reporting and
4468         report a cs0117 if the identifier does not exist, to distinguish
4469         from 0617 which is a miss-use of the actual identifier.
4470
4471         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4472         between cs0070 and cs0079.
4473
4474         * class.cs (MemberBase.DoDefine): When reporting a wrong
4475         accessibility level, we use MethodCore to compare instead of
4476         Method (this was a regression in some refactoring effort).
4477
4478         So now we correctly report cs0056 again.
4479
4480         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4481         testing the target_type (which was known to be object_type) and
4482         not the source type (which is anonymous_method).
4483
4484         Fixed reporting of error cs1660.
4485
4486         * expression.cs (UserCast.Source): Expose the underlying cast.
4487
4488         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4489         allowed types to find a match to int32 first (most common).
4490
4491         In addition, it ignores any ImplicitUserConversions that did an
4492         internal implicit conversion (as the switch statement allows only
4493         one integral conversion to exist).
4494
4495         * class.cs (PartialContainer.Create): rename `name' to
4496         `member_name' for clarity.  Then replace the string calls with a
4497         call to MemberName.GetPartialName, as now using
4498         MemberName.ToString is an error (this is due to the side effects
4499         it had, that were fixed in the past).
4500
4501         This will restore the error reporting on a number of partial class
4502         errors that were missusing this (and getting an exception as a
4503         results, which is now just a plain textual warning, because
4504         yyparse debug output would crash otherwise).
4505
4506 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4507
4508         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4509
4510 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4511
4512         * rootcontext.cs (LookupType): Make sure to cache lookups that
4513         don't give us a negative result. This saves about 5% of corlib
4514         compilation time.
4515
4516 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4517
4518         * report.cs (AbstractMessage.Print): messages are sent to stderr
4519
4520         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4521         non-interface in the list of interfaces (at this point, either
4522         parent was properly set, or a base class is being listed in the
4523         interfaces section).
4524
4525         This flags error 1722, and resolves the crash from bug 69259.
4526
4527 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4528
4529         * statement.cs (Using.EmitExpressionFinally): make this work right
4530         for valuetypes. Fixes 69926.
4531
4532 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4533
4534         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4535         converted to an enum" here, before we try to change the underlying
4536         type.  This code exists, but it is a different code path than the
4537         one used while encoding constants.
4538
4539         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4540         old bug: when converting from the null literal to a pointer,
4541         return an EmptyCast, not the NullLiteral.
4542
4543         This fixes #69921, the recent null_type changes probably made this
4544         bug more prominent.
4545
4546         (ImplicitReferenceConversionExists): In addition, resynchronized
4547         the code here, so it matches the same code in
4548         ImplicitReferenceConversionExists for the `from any class-type S
4549         to any interface-type T'.
4550         
4551
4552 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4553
4554         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4555
4556 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4557
4558         * cs-parser.jay: Use verbosity accordingly. 
4559
4560 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4561
4562         * expression.cs (Unary.ResolveOperator): Do not report warning;
4563         AddressOf reads from variable.
4564         
4565         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4566
4567 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4568
4569         Fix bug #69462
4570
4571         * attribute.cs (Attributable): Removed CheckTargets.
4572         (Attributes.Emit): Explicit attribute targets are tested here.
4573
4574         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4575         not enabled for interfaces.
4576
4577         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4578         (GetAssemblyName): Ouch next bug there.
4579
4580 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4581
4582         * expression.cs: Error 275 added.
4583         
4584 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4585
4586         Fix bug #69177 (Implemented decimal constant support)
4587
4588         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4589         (BinaryFold): Add DecimalConstant.
4590
4591         * const.cs (Define): Decimal constant 
4592         (is not constant.
4593         (ChangeType): Add decimal type handling.
4594         (LookupConstantValue): Don't set value for decimal type but
4595         emit DecimalConstantAttribute. Needed for constant optimization.
4596
4597         * constant.cs (ToDecimal): New method.
4598         (ConvertToDecimal): New method.
4599         (IntConstant): Implemented ConvertToDecimal.
4600         (DecimalConstant.Emit): Emit optimized version for decimals in
4601         int range.
4602
4603         * expression.cs (ResolveOperator): Changed order of constant
4604         reduction to work correctly with native types which have
4605         overloaded operators.
4606         (ResolveMemberAccess): Extract constant value from attribute
4607         for decimal type.
4608
4609         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4610
4611         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4612         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4613         (ChangeType): Decimal is special.
4614         (TypeToCoreType): Add decimal type.
4615
4616 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4617
4618         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4619         decimal types.
4620
4621 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4622
4623         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4624         test cs1667-5.cs.
4625
4626 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4627
4628         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4629
4630         * pending.cs (PendingImplementation): Grab only interfaces.
4631
4632 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4633
4634         * statement.cs (ForeachHelperMethods): Add location member and
4635         error 202 detection.
4636
4637 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4638
4639         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4640         automatically handled by executable.make.
4641         (PROGRAM): Make profile-specific.
4642
4643 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4644
4645         * expression.cs (DoResolveBase): Fixed wrong warning for out
4646         variables.
4647
4648 2004-11-18  Martin Baulig  <martin@ximian.com>
4649
4650         Merged latest changes into gmcs.  Please keep this comment in
4651         here, it makes it easier for me to see what changed in MCS since
4652         the last time I merged.
4653
4654 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4655
4656         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4657         (TypeHandle.GetMemberCache): New.
4658         (TypeHandle.TypeHandle): Update.
4659         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4660         (TypeManager.LookupParentInterfacesCache):
4661         Rename from LookupInterfaceCache.  Optimize slightly.
4662         (TypeManager.MemberLookup_FindMembers): Update.
4663         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4664         multi-type variant.
4665         (AddCacheContents): Rename from AddHashtable.
4666         * class.cs (TypeContainer.parent_container): Remove.
4667         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4668         (TypeContainer.DoDefineMembers): Don't initialize it.
4669         Update to name changes.
4670         
4671 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4672
4673         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4674         that factors the code to check access modifiers on override.  
4675
4676         (PropertyBase): Use the code here.
4677
4678         Patch from Lluis S'anchez, fixes bug #69361.
4679
4680 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4681
4682         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4683         routine that is used to report the use of a captured variable
4684         whose address has been taken.
4685
4686         There are two checks: one when variables are being captured and
4687         the other check is when the address of a variable is taken. 
4688         
4689         (because an anonymous methods might be resolved before *or* after
4690         the address has been taken) and 
4691
4692         * expression.cs (Conditional.DoResolve): Remove the special
4693         casing that Martin added to trueExpr and falseExpr being both
4694         NullLiteral.  We get the right behavior now just by introducing
4695         the null_type into the compiler. 
4696
4697         * convert.cs (ExplicitConversion): Change the code to use
4698         null_type instead of testing `expr is NullLiteral'.
4699         (ImplicitConversionStandard): use null_type too.
4700         (ImplicitReferenceConversionExists): use null_type too.
4701         (ImplicitReferenceConversion): use null_type too.
4702
4703         * literal.cs: The type of `NullLiteral' is now null_type instead
4704         of object_type. 
4705         (Resolve): Set the type here.
4706
4707         * typemanager.cs: Introduce null_type.
4708
4709 2004-11-17  Martin Baulig  <martin@ximian.com>
4710
4711         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4712         direction, like FindMembers() does.  Fixes #69546, testcase is in
4713         test-315.cs.    
4714
4715 2004-11-16  Martin Baulig  <martin@ximian.com>
4716
4717         This is based on a patch from Marek Safar, see bug #69082.
4718         Fixes bugs #63705 and #67130.
4719
4720         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4721         method; create a MemberCache for an interface type and cache the
4722         result.
4723
4724         * decl.cs (IMemberContainer.ParentContainer): Removed.
4725         (IMemberContainer.ParentCache): New property.
4726         (MemberCache.SetupCacheForInterface): Removed.
4727         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4728         to create a cache for an interface's "parent".
4729
4730         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4731         interfaces too.
4732
4733 2004-11-16  Martin Baulig  <martin@ximian.com>
4734
4735         Merged back from gmcs; these changes already went into gmcs a
4736         couple of weeks ago.
4737
4738         * typemanager.cs
4739         (TypeManager.AddUserType): Removed the `ifaces' argument.
4740         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4741         `TypeExpr []'.
4742         (TypeManager.AddUserInterface): Removed.
4743         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4744         `TypeExpr []'.
4745         (TypeManager.GetInterfaces): Likewise.
4746         (TypeManager.GetExplicitInterfaces): Likewise.
4747
4748         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4749
4750         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4751         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4752
4753 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4754
4755         * statement.cs: Avoid adding bools to a hashtable.
4756
4757 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4758
4759         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4760         calling an unsafe method from a safe location.
4761
4762 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4763
4764         Fix #69167
4765         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4766
4767 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4768
4769         * namespace.cs (VerifyUsing): use GetPartialName instead of
4770         ToString. 
4771
4772 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4773
4774         * statement.cs (Return.Resolve): Fix regression in typo: if
4775         `in_exc', we have to request a NeedReturnLabel, this was a typo
4776         introduced in the anonymous method check-in.  Fixes #69131.
4777
4778         * Indexers were using the ShortName when defining themselves,
4779         causing a regression in the compiler bootstrap when applying the
4780         patch from 2004-11-02 (first part), now they use their full name
4781         and the bug is gone.
4782
4783 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4784
4785         * driver.cs: Strip the path from the names of embedded resources. Fixes
4786         #68519.
4787
4788 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4789
4790         Fix error message regression: cs0104-2.cs.
4791         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4792         (AliasEntry.Resolve): Update.
4793         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4794         'silent' flag.
4795         (RootContext.LookupType): Update.
4796
4797 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4798
4799         * cs-parser.jay: Add support for handling accessor modifiers
4800         * class: Add support port accessor modifiers and error checking,
4801         define PropertyMethod.Define as virtual (not abstract anymore)
4802         * ecore.cs: Add checking for proeprties access with access modifiers
4803         * iterators.cs: Modify Accessor constructor call based in the modified
4804         constructor
4805 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4806
4807         * expression.cs (StringConcat): Handle being called twice,
4808         as when we have a concat in a field init with more than two
4809         ctors in the class
4810
4811 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4812
4813         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4814         special case explicit implementations, we should always produce
4815         the .property or .event declaration.
4816         
4817         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4818         since it will not return correct data if people use this
4819         unresolved in the presence of using statements (see test-313).
4820
4821         * class.cs (MethodData.Define): If we are an explicit interface
4822         implementation, set the method name to the full name of the
4823         interface plus the name of the method.  
4824
4825         Notice that using the method.MethodName.GetFullName() does not
4826         work, as it will only contain the name as declared on the source
4827         file (it can be a shorthand in the presence of using statements)
4828         and not the fully qualifed type name, for example:
4829
4830         using System;
4831
4832         class D : ICloneable {
4833                 object ICloneable.Clone ()  {
4834                 }
4835         }
4836
4837         Would produce a method called `ICloneable.Clone' instead of
4838         `System.ICloneable.Clone'.
4839
4840         * namespace.cs (Alias.Resolve): Use GetPartialName.
4841         
4842 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4843
4844         * cs-parser.jay: Add error 1055 report.
4845
4846 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4847
4848         * assign.cs (Assign.DoResolve): Only do the transform of
4849         assignment into a New if the types are compatible, if not, fall
4850         through and let the implicit code deal with the errors and with
4851         the necessary conversions. 
4852
4853 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4854
4855         * cs-parser.jay: Add error 1031 report.
4856
4857         * cs-tokenizer.cs: Add location for error 1038.
4858
4859 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4860
4861         * cs-parser.jay: Add error 1016 report.
4862
4863 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4864
4865         * cs-parser.jay: Add errors 1575,1611 report.
4866
4867 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4868
4869         * cs-parser.jay: Add error 1001 report.
4870
4871 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4872
4873         Fix #68850
4874         * attribute.cs (GetMarshal): Add method argument for
4875         caller identification.
4876
4877         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4878         agument for GetMarshal and RuntimeMissingSupport.
4879
4880 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4881
4882         * attribute.cs (ExtractSecurityPermissionSet): Removed
4883         TypeManager.code_access_permission_type.
4884
4885         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4886
4887 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4888
4889         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4890         for obsolete use of a variable here.   Fixes regression on errors
4891         cs0619-25 and cs0619-26.
4892
4893 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4894
4895         Fix #62358, implemented security attribute encoding.
4896
4897         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4898         Tests permitted SecurityAction for assembly or other types.
4899         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4900         data from SecurityPermissionAttribute to PermisionSet class.
4901
4902         * class.cs (ApplyAttributeBuilder): Added special handling
4903         for System.Security.Permissions.SecurityAttribute based types.
4904
4905         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4906         special handling for System.Security.Permissions.SecurityAttribute
4907         based types.
4908
4909         * enum.cs (ApplyAttributeBuilder): Added special handling
4910         for System.Security.Permissions.SecurityAttribute based types.
4911
4912         * parameter.cs (ApplyAttributeBuilder): Added special handling
4913         for System.Security.Permissions.SecurityAttribute based types.
4914
4915         * rootcontext.cs: Next 2 core types.
4916
4917         * typemanager.cs (TypeManager.security_permission_attr_type):
4918         Built in type for the SecurityPermission Attribute.
4919         (code_access_permission_type): Build in type.
4920
4921 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4922
4923         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4924         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4925         all of this information into
4926         EmitContext.EmitCapturedVariableInstance.
4927         
4928         * codegen.cs (EmitCapturedVariableInstance): move here the
4929         funcionality of emitting an ldarg.0 in the presence of a
4930         remapping.   This centralizes the instance emit code.
4931
4932         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4933         then emit a load of this: it means that we have reached the
4934         topmost ScopeInfo: the one that contains the pointer to the
4935         instance of the class hosting the anonymous method.
4936
4937         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4938         captures to the topmost CaptureContext.
4939
4940 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4941
4942         * expression.cs (LocalVariableReference): Move the knowledge about
4943         the iterators into codegen's EmitCapturedVariableInstance.
4944
4945 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4946
4947         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4948         all code paths return a value from an anonymous method (it is the
4949         same as the 161 error, but for anonymous methods).
4950
4951 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4952
4953         The introduction of anonymous methods in the compiler changed
4954         various ways of doing things in the compiler.  The most
4955         significant one is the hard split between the resolution phase
4956         and the emission phases of the compiler.
4957
4958         For instance, routines that referenced local variables no
4959         longer can safely create temporary variables during the
4960         resolution phase: they must do so from the emission phase,
4961         since the variable might have been "captured", hence access to
4962         it can not be done with the local-variable operations from the runtime.
4963         
4964         * statement.cs 
4965
4966         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4967         is a toplevel block.
4968
4969         (ToplevelBlock): A new kind of Block, these are the blocks that
4970         are created by the parser for all toplevel method bodies.  These
4971         include methods, accessors and anonymous methods.
4972
4973         These contain some extra information not found in regular blocks:
4974         A pointer to an optional CaptureContext (for tracking captured
4975         local variables and parameters).  A pointer to the parent
4976         ToplevelBlock.
4977         
4978         (Return.Resolve): Catch missmatches when returning a value from an
4979         anonymous method (error 1662).
4980         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4981         phase.
4982
4983         (Break.Resolve): ditto.
4984
4985         (SwitchLabel): instead of defining the labels during the
4986         resolution phase, we now turned the public ILLabel and ILLabelCode
4987         labels into methods called GetILLabelCode() and GetILLabel() that
4988         only define the label during the Emit phase.
4989
4990         (GotoCase): Track the SwitchLabel instead of the computed label
4991         (its contained therein).  Emit the code by using
4992         SwitchLabel.GetILLabelCode ().
4993
4994         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4995         whether the Local has been captured or not.
4996
4997         (LocalInfo.IsCaptured): New property, used to tell whether the
4998         local has been captured.
4999         
5000         * anonymous.cs: Vastly updated to contain the anonymous method
5001         support.
5002
5003         The main classes here are: CaptureContext which tracks any
5004         captured information for a toplevel block and ScopeInfo used to
5005         track the activation frames for various local variables.   
5006
5007         Each toplevel block has an optional capture context associated
5008         with it.  When a method contains an anonymous method both the
5009         toplevel method and the anonymous method will create a capture
5010         context.   When variables or parameters are captured, they are
5011         recorded on the CaptureContext that owns them, for example:
5012
5013         void Demo () {
5014              int a;
5015              MyDelegate d = delegate {
5016                  a = 1;
5017              }
5018         }
5019
5020         Here `a' will be recorded as captured on the toplevel
5021         CapturedContext, the inner captured context will not have anything
5022         (it will only have data if local variables or parameters from it
5023         are captured in a nested anonymous method.
5024
5025         The ScopeInfo is used to track the activation frames for local
5026         variables, for example:
5027
5028         for (int i = 0; i < 10; i++)
5029                 for (int j = 0; j < 10; j++){
5030                    MyDelegate d = delegate {
5031                         call (i, j);
5032                    }
5033                 }
5034
5035         At runtime this captures a single captured variable `i', but it
5036         captures 10 different versions of the variable `j'.  The variable
5037         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5038         recorded on a child.  
5039
5040         The toplevel ScopeInfo will also track information like the `this'
5041         pointer if instance variables were referenced (this is necessary
5042         as the anonymous method lives inside a nested class in the host
5043         type of the method). 
5044
5045         (AnonymousMethod): Expanded to track the Toplevel, implement
5046         `AnonymousMethod.Compatible' to tell whether an anonymous method
5047         can be converted to a target delegate type. 
5048
5049         The routine now also produces the anonymous method content
5050
5051         (AnonymousDelegate): A helper class that derives from
5052         DelegateCreation, this is used to generate the code necessary to
5053         produce the delegate for the anonymous method that was created. 
5054
5055         * assign.cs: API adjustments for new changes in
5056         Convert.ImplicitStandardConversionExists.
5057
5058         * class.cs: Adjustments to cope with the fact that now toplevel
5059         blocks are of type `ToplevelBlock'. 
5060
5061         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5062         insteda of standard blocks.
5063
5064         Flag errors if params arguments are passed to anonymous methods.
5065
5066         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5067         `CurrentAnonymousMethod' which points to the current Anonymous
5068         Method.  The variable points to the AnonymousMethod class that
5069         holds the code being compiled.  It is set in the new EmitContext
5070         created for the anonymous method.
5071
5072         (EmitContext.Phase): Introduce a variable and an enumeration to
5073         assist in enforcing some rules about when and where we are allowed
5074         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5075         only one that enfonces this right now).
5076
5077         (EmitContext.HaveCaptureInfo): new helper method that returns
5078         whether we have a CapturedContext initialized.
5079
5080         (EmitContext.CaptureVariable): New method used to register that a
5081         LocalInfo must be flagged for capturing. 
5082
5083         (EmitContext.CapturedParameter): New method used to register that a
5084         parameters must be flagged for capturing. 
5085         
5086         (EmitContext.CapturedField): New method used to register that a
5087         field must be flagged for capturing. 
5088
5089         (EmitContext.HaveCapturedVariables,
5090         EmitContext.HaveCapturedFields): Return whether there are captured
5091         variables or fields. 
5092
5093         (EmitContext.EmitMethodHostInstance): This is used to emit the
5094         instance for the anonymous method.  The instance might be null
5095         (static methods), this (for anonymous methods that capture nothing
5096         and happen to live side-by-side with the current method body) or a
5097         more complicated expression if the method has a CaptureContext.
5098
5099         (EmitContext.EmitTopBlock): Routine that drives the emission of
5100         code: it will first resolve the top block, then emit any metadata
5101         and then emit the code.  The split is done so that we can extract
5102         any anonymous methods and flag any captured variables/parameters.
5103         
5104         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5105         during this phase, the ILGenerator should not be used as labels
5106         and local variables declared here might not be accessible to any
5107         code that is part of an anonymous method.  
5108
5109         Exceptions to this include the temporary variables that are
5110         created by some statements internally for holding temporary
5111         variables. 
5112         
5113         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5114         metadata for a cb
5115
5116         (EmitContext.TemporaryReturn): This method is typically called
5117         from the Emit phase, and its the only place where we allow the
5118         ReturnLabel to be defined other than the EmitMeta.  The reason is
5119         that otherwise we would have to duplicate a lot of logic in the
5120         Resolve phases of various methods that today is on the Emit
5121         phase. 
5122
5123         (EmitContext.NeedReturnLabel): This no longer creates the label,
5124         as the ILGenerator is not valid during the resolve phase.
5125
5126         (EmitContext.EmitThis): Extended the knowledge in this class to
5127         work in anonymous methods in addition to iterators. 
5128
5129         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5130         code is necessary on the stack to access the instance to a local
5131         variable (the variable will be accessed as a field).
5132
5133         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5134         EmitContext.EmitAddressOfParameter): Routines to support
5135         parameters (not completed at this point). 
5136         
5137         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5138         will also remove the parameters.
5139
5140         * convert.cs (Convert): Define a `ConstantEC' which points to a
5141         null.  This is just to prefity some code that uses
5142         ImplicitStandardConversion code and do not have an EmitContext
5143         handy.
5144
5145         The idea is to flag explicitly that at that point in time, it is
5146         known that the conversion will not trigger the delegate checking
5147         code in implicit conversions (which requires a valid
5148         EmitContext). 
5149
5150         Everywhere: pass new EmitContext parameter since
5151         ImplicitStandardConversionExists now requires it to check for
5152         anonymous method conversions. 
5153
5154         (Convert.ImplicitStandardConversionExists): If the type of an
5155         expression is the anonymous_method_type, and the type is a
5156         delegate, we invoke the AnonymousMethod.Compatible method to check
5157         whether an implicit conversion is possible. 
5158
5159         (Convert.ImplicitConversionStandard): Only do implicit method
5160         group conversions if the language level is not ISO_1.
5161
5162         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5163         MethodInfo for the Invoke method.  used by Delegate and
5164         AnonymousDelegate.
5165
5166         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5167         method conversions if the target type is a delegate.
5168
5169         Removed extra debugging nops.
5170
5171         (LocalVariableReference): Turn the `local_info' into a public
5172         field. 
5173
5174         Add `prepared' field, the same hack used for FieldExprs to cope
5175         with composed assignments, as Local variables do not necessarily
5176         operate purely on the stack as they used to: they can be captured
5177         fields. 
5178
5179         Add `temp' for a temporary result, like fields.
5180
5181         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5182
5183         It now copes with Local variables that are captured and emits the
5184         proper instance variable to load it from a field in the captured
5185         case. 
5186
5187         (ParameterReference.DoResolveBase): During the resolve phase,
5188         capture parameters if we are in an anonymous method.
5189
5190         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5191         anonymous method, use the EmitContext helper routines to emit the
5192         parameter reference.
5193
5194         * iterators.cs: Set RemapToProxy to true/false during the
5195         EmitDispose class.
5196
5197         * parameters.cs (GetParameterByName): New helper method. 
5198
5199         * typemanager.cs (anonymous_method_type) a new type that
5200         represents an anonyous method.  This is always an internal type,
5201         used as a fencepost to test against the anonymous-methodness of an
5202         expression. 
5203         
5204 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5205
5206         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5207         561 report.
5208         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5209
5210 2004-10-18  Martin Baulig  <martin@ximian.com>
5211
5212         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5213         `Type' directly, but call ResolveType() on it.
5214         (Catch.Resolve): Likewise.
5215         (Foreach.Resolve): Likewise.
5216
5217 2004-10-18  Martin Baulig  <martin@ximian.com>
5218
5219         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5220         `Type' directly, but call ResolveType() on it.
5221         (Probe.DoResolve): Likewise.
5222         (ArrayCreation.LookupType): Likewise.
5223         (TypeOf.DoResolve): Likewise.
5224         (SizeOf.DoResolve): Likewise.
5225
5226 2004-10-18  Martin Baulig  <martin@ximian.com>
5227
5228         * expression.cs (Invocation.BetterFunction): Put back
5229         TypeManager.TypeToCoreType().
5230
5231 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5232
5233         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5234         the ResolveType.
5235
5236 2004-10-18  Martin Baulig  <martin@ximian.com>
5237
5238         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5239         `Type' directly, but call ResolveType() on it.
5240
5241 2004-10-18  Martin Baulig  <martin@ximian.com>
5242
5243         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5244         `Type' directly, but call ResolveType() on it.
5245         (MemberBase.DoDefine): Likewise.
5246
5247         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5248         `Type' directly, but call ResolveType() on it.
5249         (ComposedCast.DoResolveAsTypeStep): Likewise.
5250
5251         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5252         `Type' directly, but call ResolveType() on it.
5253
5254 2004-10-17  John Luke  <john.luke@gmail.com>
5255
5256         * class.cs (Operator.GetSignatureForError): use CSharpName
5257
5258         * parameter.cs (Parameter.GetSignatureForError): Returns
5259         correct name even if was not defined.
5260
5261 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5262
5263         Fix #65816.
5264         * class.cs (TypeContainer.EmitContext): New property.
5265         (DefineNestedTypes): Create an emitcontext for each part.
5266         (MethodCore.DoDefineParameters): Use container's emitcontext.
5267         Pass type array to InternalParameters.
5268         (MemberBase.DoDefine): Use container's emitcontext.
5269         (FieldMember.Define): Likewise.
5270         (Event.Define): Likewise.
5271         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5272         Pass type array to InternalParameters.
5273         (SetIndexerMethod.GetParameterInfo): Likewise.
5274         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5275         * delegate.cs (Define): Pass emitcontext to
5276         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5277         array to InternalParameters.
5278         * expression.cs (ParameterReference.DoResolveBase): Pass
5279         emitcontext to GetParameterInfo.
5280         (ComposedCast.DoResolveAsTypeStep): Remove check on
5281         ec.ResolvingTypeTree.
5282         * parameter.cs (Parameter.Resolve): Change argument to
5283         EmitContext.  Use ResolveAsTypeTerminal.
5284         (Parameter.GetSignature): Change argument to EmitContext.
5285         (Parameters.ComputeSignature): Likewise.
5286         (Parameters.ComputeParameterTypes): Likewise.
5287         (Parameters.GetParameterInfo): Likewise.
5288         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5289         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5290         * support.cs (InternalParameters..ctor): Remove variant that takes
5291         a DeclSpace.
5292         * typemanager.cs (system_intptr_expr): New.
5293         (InitExpressionTypes): Initialize it.
5294
5295 2004-10-12  Chris Toshok  <toshok@ximian.com>
5296
5297         * cs-parser.jay: fix location for try_statement and catch_clause.
5298
5299 2004-10-11  Martin Baulig  <martin@ximian.com>
5300
5301         * report.cs: Don't make --fatal abort on warnings, we have
5302         -warnaserror for that.
5303
5304 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5305
5306         More DeclSpace.ResolveType avoidance.
5307         * decl.cs (MemberCore.InUnsafe): New property.
5308         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5309         with newly created EmitContext.
5310         (FieldMember.Define): Likewise.
5311         * delegate.cs (Delegate.Define): Likewise.
5312         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5313         only if normal name-lookup fails.
5314         (TypeExpr.DoResolve): Enable error-checking.
5315         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5316         (SizeOf.DoResolve): Likewise.
5317         (ComposedCast.DoResolveAsTypeStep): Likewise.
5318         (StackAlloc.DoResolve): Likewise.
5319         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5320         (Block.Unsafe): New property.
5321         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5322         (Unsafe): Set 'unsafe' flag of contained block.
5323         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5324         (Fixed.Resolve): Likewise.
5325         (Catch.Resolve): Likewise.
5326         (Using.ResolveLocalVariableDecls): Likewise.
5327         (Foreach.Resolve): Likewise.
5328
5329 2004-10-05  John Luke <john.luke@gmail.com>
5330
5331         * cs-parser.jay: add location to error CS0175
5332
5333 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5334
5335         * ecore.cs (Expression.Constantity): Add support for turning null
5336         into a constant.
5337
5338         * const.cs (Const.Define): Allow constants to be reference types
5339         as long as the value is Null.
5340
5341 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5342
5343         * namespace.cs (NamespaceEntry.Using): No matter which warning
5344         level is set, check if this namespace name has already been added.
5345
5346 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5347
5348         * expression.cs: reftype [!=]= null should always use br[true,false].
5349         # 67410
5350
5351 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5352
5353         Fix #67108
5354         * attribute.cs: Enum conversion moved to 
5355         GetAttributeArgumentExpression to be applied to the all
5356         expressions.
5357
5358 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5359
5360         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5361         * class.c (TypeContainer.DefineType): Flag error if
5362         base types aren't accessible due to access permissions.
5363         * decl.cs (DeclSpace.ResolveType): Move logic to
5364         Expression.ResolveAsTypeTerminal.
5365         (DeclSpace.ResolveTypeExpr): Thin layer over
5366         Expression.ResolveAsTypeTerminal.
5367         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5368         Refactor code into NestedAccess.  Use it.
5369         (DeclSpace.NestedAccess): New.
5370         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5371         argument to silence errors.  Check access permissions.
5372         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5373         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5374         (Cast.DoResolve): Likewise.
5375         (New.DoResolve): Likewise.
5376         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5377         (TypeOf.DoResolve): Likewise.
5378
5379         * expression.cs (Invocation.BetterConversion): Return the Type of
5380         the better conversion.  Implement section 14.4.2.3 more faithfully.
5381         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5382         section 14.4.2.2 explicit.
5383         (Invocation.OverloadResolve): Update.
5384         (Invocation): Remove is_base field.
5385         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5386         (Invocation.Emit): Likewise.
5387
5388 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5389
5390         * README: Update to changes.
5391
5392 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5393
5394         * cs-parser.jay: Reverted 642 warning fix.
5395
5396 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5397
5398         Fix bug #66615
5399         * decl.cs (FindMemberWithSameName): Indexer can have more than
5400         1 argument.
5401
5402 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5403
5404         * expression.cs (LocalVariableReference.DoResolveLValue):
5405         Do not report warning 219 for out values.
5406         (EmptyExpression.Null): New member to avoid extra allocations.
5407
5408 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5409
5410         * cs-parser.jay: Fix wrong warning 642 report.
5411
5412         * cs-tokenizer.cs (CheckNextToken): New helper;
5413         Inspect next character if is same as expected.
5414
5415 2004-09-23  Martin Baulig  <martin@ximian.com>
5416
5417         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5418         (Convert.ImplicitReferenceConversionExists): Likewise.
5419
5420 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5421
5422         * class.cs (Operator.Define): Add error 448 and 559 report.
5423
5424 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5425
5426         * class.cs (MemberBase.IsTypePermitted): New protected
5427         method for checking error CS0610.
5428
5429 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5430
5431         * class.cs (TypeContainer.HasExplicitLayout): New property
5432         Returns whether container has StructLayout attribute set Explicit.
5433         (FieldMember): New abstract class for consts and fields.
5434         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5435         (Field): Reuse FieldMember.
5436
5437         * const.cs (Const): Reuse FieldMember.
5438
5439         * rootcontext.cs: EmitConstants call moved to class.
5440
5441 2004-09-22  Martin Baulig  <martin@ximian.com>
5442
5443         Thanks to Peter Sestoft for this bug report.
5444
5445         * expression.cs (Conditional): If both the `trueExpr' and the
5446         `falseExpr' is a NullLiteral, return a NullLiteral.
5447
5448 2004-09-22  Martin Baulig  <martin@ximian.com>
5449
5450         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5451         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5452         for the "get_Current" call.
5453
5454 2004-09-22  Martin Baulig  <martin@ximian.com>
5455
5456         Marek and me just fixed one of our oldest bugs: #28562 :-)
5457
5458         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5459
5460         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5461         we're an EnumConstant, just return that.
5462         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5463         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5464         to get the value which'll actually be written into the attribute.
5465         However, we have to use GetValue() to access the attribute's value
5466         in the compiler.        
5467
5468 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5469
5470         * constant.cs (Constant.IsNegative): New abstract property
5471         IsNegative.
5472
5473         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5474         (StackAlloc.DoResolve): Reused IsNegative.
5475
5476 2004-09-21  Martin Baulig  <martin@ximian.com>
5477
5478         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5479         if we're used in an iterator, we may be called from different
5480         methods.
5481
5482         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5483         we actually have an exception block.
5484
5485 2004-09-20  John Luke <jluke@cfl.rr.com>
5486
5487         * class.cs, cs-parser.jay: Improve the error report for 1520:
5488         report the actual line where the error happens, not where the
5489         class was declared.
5490
5491         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5492         Pass location information that was available elsewhere.
5493
5494 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5495
5496         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5497         runtime to delay sign assemblies.
5498
5499 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5500
5501         * cs-parser.jay: Do not report the stack trace, this is barely
5502         used nowadays.
5503
5504 2004-08-22  John Luke  <john.luke@gmail.com>
5505  
5506         * driver.cs : check that a resource id is not already used
5507         before adding it, report CS1508 if it is, bug #63637
5508
5509 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5510
5511         * ecore.cs: Removed dead code.
5512
5513 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5514
5515         * class.cs: Do not report warning CS0067 on the interfaces.
5516
5517 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5518
5519         * cs-parser.jay: Add error 504 report.
5520
5521 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5522
5523         * rootcontext.cs: WarningLevel is 4 by default now.
5524
5525         * statement.cs (Fixed.Resolve): Do not null
5526         VariableInfo.
5527
5528 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5529
5530         Fixed bug #55780
5531         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5532         deep search when property is not virtual.
5533         (PropertyExpr.ResolveAccessors): Make one call for both
5534         accessors.
5535
5536 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5537
5538         Fixed bug #65766
5539         * statement.cs: Error 152 report constains also location.
5540
5541 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5542
5543         Fixed bug #65766
5544         * const.cs: Explicitly set constant as static.
5545
5546 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5547
5548         Fixed bug #64226
5549         * cs-parser.jay: Add error 1017 report.
5550
5551 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5552
5553         Fixed bug #59980, #64224
5554         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5555
5556         * typemanager.cs (IsSpecialMethod): Simplified
5557
5558 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5559
5560         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5561         condition with better params.
5562
5563 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5564
5565         Fixed bug #65238
5566         * attribute.cs (Resolve): Property has to have both
5567         accessors.
5568
5569 2004-09-14  Martin Baulig  <martin@ximian.com>
5570
5571         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5572
5573 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5574
5575         Fixed bug #61902
5576         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5577         called and is obsolete then this member suppress message
5578         when call is inside next [Obsolete] method or type.
5579
5580         * expression.cs: Use TestObsoleteMethodUsage member.
5581
5582 2004-09-14  Martin Baulig  <martin@ximian.com>
5583
5584         * cs-parser.jay: Sync a bit with the GMCS version.
5585
5586 2004-09-14  Martin Baulig  <martin@ximian.com>
5587
5588         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5589         (CSharpParser.yacc_verbose_flag): New public field.
5590
5591         * genericparser.cs: Removed.
5592
5593 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5594
5595         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5596
5597 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5598
5599         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5600
5601 2004-09-10  Martin Baulig  <martin@ximian.com>
5602
5603         Backported my MemberName changes from GMCS into MCS.
5604
5605         - we are now using a special `MemberName' class instead of using
5606         strings; in GMCS, the `MemberName' also contains the type
5607         arguments.
5608
5609         - changed the grammar rules a bit:
5610           * the old `member_name' is now a `namespace_or_type_name':
5611             The rule is that we use `namespace_or_type_name' everywhere
5612             where we expect either a "member name" (GetEnumerator) or a
5613             "member name" with an explicit interface name
5614             (IEnumerable.GetEnumerator).
5615             In GMCS, the explicit interface name may include type arguments
5616             (IEnumerable<T>.GetEnumerator).
5617           * we use `member_name' instead of just `IDENTIFIER' for
5618             "member names":
5619             The rule is that we use `member_name' wherever a member may
5620             have type parameters in GMCS.       
5621
5622         * decl.cs (MemberName): New public class.
5623         (MemberCore.MemberName): New public readonly field.
5624         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5625         (DeclSpace): Likewise.
5626
5627         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5628         * enum.cs (Enum.ctor): Likewise.
5629
5630         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5631         MemberName.     
5632         (AliasEntry.ctor): Take a MemberName, not an Expression.
5633         (AliasEntry.UsingAlias): Likewise.
5634
5635         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5636         (IMethodData.MemberName): Changed type from string to MemberName.
5637         (MemberBase.ExplicitInterfaceName): Likewise.
5638         (AbstractPropertyEventMethod.SetupName): Make this private.
5639         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5640         argument; compute the member name here.
5641         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5642         on the `member.MemberName' and the `prefix'.
5643
5644         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5645         not `type_name'.
5646         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5647         thus, we get a `MemberName' instead of a `string'.  These
5648         declarations may have type parameters in GMCS.
5649         (interface_method_declaration, delegate_declaration): Likewise.
5650         (class_declaration, interface_declaration): Likewise.
5651         (method_header): Use `namespace_or_type_name' instead of
5652         `member_name'.  We may be an explicit interface implementation.
5653         (property_declaration, event_declaration): Likewise.
5654         (member_name): This is now just an `IDENTIFIER', not a
5655         `namespace_or_type_name'.
5656         (type_name, interface_type): Removed.
5657         (namespace_or_type_name): Return a MemberName, not an Expression.
5658         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5659         call GetTypeExpression() on the MemberName to get an expression.
5660         (IndexerDeclaration.interface_type): Changed type from string to
5661         MemberName.
5662         (MakeName): Operate on MemberName's instead of string's.
5663
5664 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5665
5666         Fix bug #55770.
5667         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5668         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5669         lookup to avoid symbols introduced by 'using'.
5670         * rootcontext.cs (NamespaceLookup): Update.
5671
5672 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5673
5674         * class.cs (TypeContainer.DoDefineMembers): Do not call
5675         DefineDefaultConstructor for static classes.
5676
5677 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5678
5679         * attribute.cs (Attribute.Resolve): Add error 653 report.
5680
5681         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5682         report.
5683         (Method.ApplyAttributeBuilder): Add error 685 report.
5684         (Operator.Define): Add error 564 report.
5685
5686         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5687
5688         * expression.cs (Invocation.DoResolve): Add error
5689         245 and 250 report.
5690
5691         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5692         error 674 report.
5693
5694 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5695
5696         * class.cs (ConstructorInitializer.Resolve):
5697         Wrong error number (515->516).
5698
5699 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5700
5701         * class.cs (Indexer.Define): Add error 631 report.
5702
5703 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5704
5705         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5706
5707 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5708
5709         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5710
5711 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5712
5713         * cs-parser.jay: Added error CS0241 report.
5714
5715 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5716
5717         * cs-parser.jay (fixed_statement): Introduce a scope for the
5718         declaration in the 'fixed' statement.
5719
5720 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5721
5722         * cs-parser.jay: Added CS0230 error report.
5723
5724 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5725
5726         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5727
5728 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5729
5730         * expression.cs (Argument.Resolve): Added error CS0192 and
5731         CS0199 report.
5732
5733 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5734
5735         C# 2.0 #pragma warning feature
5736
5737         * cs-tokenizer.cs (PreProcessPragma): New method; 
5738         Handles #pragma directive.
5739
5740         * report.cs (WarningRegions): New class; Support
5741         class for #pragma warning directive. It tests whether
5742         warning is enabled for a given line.
5743
5744 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5745
5746         * const.cs: Add more descriptive error report, tahnks to
5747         Sebastien. 
5748
5749 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5750
5751         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5752
5753 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5754
5755         * expression.cs: Apply patch from Ben: Remove dead code from
5756         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5757         as that code just threw an exception anwyays.
5758
5759         * const.cs: Remove the call to the turnintoconstant, for details
5760         see bug: #63144
5761         
5762         * literal.cs: The type of the null-literal is the null type;  So
5763         we use a placeholder type (literal.cs:System.Null, defined here)
5764         for it.
5765
5766         * expression.cs (Conditional.DoResolve): Remove some old code that
5767         is no longer needed, conversions have been fixed.
5768
5769         (ArrayCreationExpression.DoResolve): Return false if we fail to
5770         resolve the inner expression.
5771
5772 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5773
5774         Fix test-290.cs.
5775         * cs-parser.jay (delegate_declaration): Record a delegate
5776         declaration as a type declaration.
5777         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5778
5779 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5780
5781         * parameter.cs: Do not crash if the type can not be resolved. 
5782
5783         * expression.cs: Report errors with unsafe pointers, fixes #64896
5784
5785 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5786
5787         * expression.cs: Pointer arith always needs to do a conv.i
5788         if the operand is a long. fix 65320
5789
5790 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5791
5792         Fixed cs0619-37.cs, cs0619-38.cs
5793
5794         * enum.cs (GetObsoleteAttribute): Removed.
5795
5796         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5797         on Enum member is double staged. The first is tested member
5798         and then enum.
5799
5800 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5801
5802         Fixed #56986, #63631, #65231
5803
5804         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5805         adds member to name container.
5806         (TypeContainer.AddToTypeContainer): New method, adds type to
5807         name container.
5808         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5809         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5810         AddOperator): Simplified by reusing AddToMemberContainer.
5811         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5812         instead of field.
5813         (Method.CheckForDuplications): Fixed implementation to test all
5814         possibilities.
5815         (MemberBase): Detection whether member is explicit interface
5816         implementation is now in constructor.
5817         (MemberBase.UpdateMemberName): Handles IndexerName.
5818         (Accessor): Changed to keep also location information.
5819         (AbstractPropertyEventMethod): Is derived from MemberCore.
5820         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5821         will be emited or not.
5822         (PropertyBase.AreAccessorsDuplicateImplementation):
5823         Tests whether accessors are not in collision with some method.
5824         (Operator): Is derived from MethodCore to simplify common
5825         operations.
5826
5827         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5828         must be performed.
5829         (DeclSpace.AddToContainer): Adds the member to defined_names
5830         table. It tests for duplications and enclosing name conflicts.
5831
5832         * enum.cs (EnumMember): Clean up to reuse the base structures
5833
5834 2004-09-03  Martin Baulig  <martin@ximian.com>
5835
5836         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5837         into TypeContainer, to make partial classes work again.
5838
5839 2004-09-03  Martin Baulig  <martin@ximian.com>
5840
5841         * rootcontext.cs (RootContext.V2): Removed.
5842
5843 2004-03-23  Martin Baulig  <martin@ximian.com>
5844
5845         * expression.cs (Invocation.OverloadResolve): Added `bool
5846         may_fail' argument and use it instead of the Location.IsNull() hack.
5847
5848 2004-09-03  Martin Baulig  <martin@ximian.com>
5849
5850         Merged latest changes into gmcs.  Please keep this comment in
5851         here, it makes it easier for me to see what changed in MCS since
5852         the last time I merged.
5853
5854 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5855
5856         Fix #61128.
5857         * expression.cs (BetterConversion): Don't allow either conversion 
5858         to be null.  Remove redundant implicit conversion test when 'q ==
5859         null' -- when this function is invoked, we already know that the
5860         implicit conversion exists.
5861         (BetterFunction): Assume that 'best' is non-null.  Remove
5862         redundant reimplementation of IsApplicable when 'best' is null.
5863         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5864         number of arguments.
5865         (IsAncestralType): Extract from OverloadResolve.
5866         (OverloadResolve): Make robust to the MethodGroupExpr being
5867         unsorted.  Implement all the logic of Section 14.5.5.1, and
5868         support overloading of methods from multiple applicable types.
5869         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5870
5871         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5872         (RealError, Warning): Append type of report to related symbol.
5873
5874 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5875
5876         * enum.cs: Fixed CLS-Compliance checks for enum members.
5877         Error tests cs3008-8.cs, cs3014-8.cs
5878
5879 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5880
5881         Fixed bug #62342, #63102
5882         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5883         like ImplementMethod.
5884
5885 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5886
5887         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5888         Fixed bug #65170.
5889
5890 2004-09-02  Martin Baulig  <martin@ximian.com>
5891
5892         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5893         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5894         on the MethodBase.
5895
5896 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5897
5898         C# 2.0 Static classes implemented
5899
5900         * class.cs (TypeContainer): instance_constructors,
5901         initialized_fields, initialized_static_fields,
5902         default_constructor, base_inteface_types are protected to be
5903         accessible from StaticClass.
5904         (TypeContainer.DefineDefaultConstructor): New virtual method
5905         for custom default constructor generating
5906         (StaticClass): New class to handle "Static classes" feature.
5907
5908         * cs-parser.jay: Handle static keyword on class like instance
5909         of StaticClass.
5910
5911         * driver.cs: Added "/langversion" command line switch with two
5912         options (iso-1, default).
5913
5914 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5915
5916         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5917
5918 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5919
5920         * delegate.cs: Style.
5921
5922 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5923
5924         * delegate.cs: Add seperate instance expr field for miguel.
5925
5926 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5927
5928         * PointerArithmetic (Resolve): make sure we are not doing
5929         pointer arith on void*. Also, make sure we are resolved
5930         by not setting eclass until resolve.
5931
5932         All callers: Make sure that PointerArithmetic gets resolved.
5933
5934 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5935
5936         * ArrayCreation (LookupType): If the type does not resolve 
5937         to an array, give an error.
5938
5939 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5940
5941         * statement.cs (Try.Resolve): Fixed bug #64222
5942
5943 2004-08-27  Martin Baulig  <martin@ximian.com>
5944
5945         * class.cs
5946         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5947         crash here.     
5948
5949 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5950
5951         * ecore.cs (Constantify): Get underlying type via
5952         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5953         Windows in special cases.
5954
5955 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5956
5957         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5958         for obtaining also private methods.
5959         (GetRemoveMethod): Used GetRemoveMethod (true)
5960         for obtaining also private methods.
5961
5962 2004-08-24  Martin Baulig  <martin@ximian.com>
5963
5964         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5965         MethodAttributes.HideBySig for operators.
5966
5967 2004-08-23  Martin Baulig  <martin@ximian.com>
5968
5969         Back to the old error reporting system :-)
5970
5971         * report.cs (Message): Removed.
5972         (Report.MessageData, ErrorData, WarningData): Removed.
5973         (Report.Error, Warning): Back to the old system.
5974
5975 2004-08-23  Martin Baulig  <martin@ximian.com>
5976
5977         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5978
5979         * class.cs (TypeContainer.ParentContainer): New public virtual
5980         method; replaces the explicit interface implementation.
5981         (ClassPart.ParentContainer): Override.
5982
5983 2004-08-23  Martin Baulig  <martin@ximian.com>
5984
5985         * statement.cs (Switch): Added support for constant switches; see
5986         #59428 or test-285.cs.
5987
5988 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5989
5990         Fixed bug #62740.
5991         * statement.cs (GetEnumeratorFilter): Removed useless
5992         logic because C# specs is strict. GetEnumerator must be
5993         public.
5994
5995 2004-08-22  Martin Baulig  <martin@ximian.com>
5996
5997         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5998         a switch and may break, reset the barrier.  Fixes #59867.
5999
6000 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6001
6002         CLS-Compliance speed up (~5% for corlib)
6003
6004         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6005         New method. Tests container for CLS-Compliant names
6006
6007         * class.cs (TypeContainer.VerifyClsName): New method.
6008         Checks whether container name is CLS Compliant.
6009         (Constructor): Implements IMethodData.
6010
6011         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6012         low-case table for CLS Compliance test.
6013         (MemberCache.VerifyClsParameterConflict): New method.
6014         Checks method parameters for CS3006 error.
6015
6016         * enum.cs (EnumMember): Is derived from MemberCore.
6017         (Enum.VerifyClsName): Optimized for better performance.
6018
6019 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6020
6021         * report.cs: Renamed Error_T to Error and changed all
6022         references.
6023
6024 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6025
6026         * class.cs (TypeContainer.IndexerArrayList): New inner class
6027         container for indexers.
6028         (TypeContainer.DefaultIndexerName): New constant for default
6029         indexer name. Replaced all "Item" with this constant.
6030         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6031
6032         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6033         DefaultMemberAttribute constructor.
6034
6035 2004-08-05  Martin Baulig  <martin@ximian.com>
6036
6037         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6038         Fix bug #59429.
6039
6040 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6041
6042         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6043         multi platforms problem.
6044
6045         * compiler.csproj: Included shared files.
6046
6047 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6048
6049         Fix bug 60333, 55971 in the more general way
6050         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6051         Added arg_type argument for constant conversion.
6052         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6053
6054 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6055
6056         Fix bug #59760
6057         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6058         OperatorArrayList, MethodCoreArrayList for typecontainer
6059         containers. Changed class member types to these new types.
6060         (MethodArrayList.DefineMembers): Added test for CS0659.
6061
6062 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6063
6064         * cfold.cs: Synchronize the folding with the code in expression.cs
6065         Binary.DoNumericPromotions for uint operands.
6066
6067         * attribute.cs: Revert patch from Raja, it introduced a regression
6068         while building Blam-1.2.1 (hard to isolate a test case).
6069
6070 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6071
6072         Fix for #55382
6073         * class.cs:
6074         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6075         name collision.
6076         (MethodCore.parent_method): New member. The method we're overriding
6077         if this is an override method.
6078         (MethodCore.CheckBase): Moved from Method class and made common.
6079         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6080         private.
6081         (MethodCore.CheckForDuplications): New abstract method. For custom
6082         member duplication search in a container
6083         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6084         method and its return type.
6085         (Event.conflict_symbol): New member. Symbol with same name in the
6086         parent class.
6087
6088         * decl.cs:
6089         (MemberCache.FindMemberWithSameName): New method. The method
6090         is looking for conflict with inherited symbols.
6091
6092 2004-08-04  Martin Baulig  <martin@ximian.com>
6093
6094         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6095
6096         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6097
6098 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6099
6100         * report.cs (Message): New enum for better error, warning reference in
6101         the code.
6102         (MessageData): New inner abstract class. It generally handles printing of
6103         error and warning messages.
6104         Removed unused Error, Warning, Message methods.
6105
6106 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6107
6108         Fix for cs0592-8.cs test
6109         * attribute.cs
6110         (Attributable.ValidAttributeTargets): Made public.
6111         (Attribute.ExplicitTarget): New member for explicit target value.
6112         (Attribute.CheckTargets): Now we translate explicit attribute
6113         target to Target here.
6114
6115 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6116
6117         * ecore.cs (MethodGroupExpr): new IsBase property.
6118
6119         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6120
6121         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6122         rather than an instance expr.
6123
6124         (DelegateCreation.Emit): Use the method group rather than
6125         the instance expression. Also, if you have base.Foo as the
6126         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6127
6128         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6129
6130         (NewDelegate.DoResolve): Only check for the existance of Invoke
6131         if the method is going to be needed. Use MethodGroupExpr.
6132
6133         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6134
6135         * expression.cs: For pointer arith., make sure to use
6136         the size of the type, not the size of the pointer to
6137         the type.
6138
6139 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6140
6141         Fix for #60722
6142         * class.cs (Class): Added error CS0502 test.
6143
6144 2004-08-03  John Luke  <jluke@cfl.rr.com>
6145             Raja R Harinath  <rharinath@novell.com>
6146
6147         Fix for #60997.
6148         * attribute.cs (Attribute.complained_before): New flag.
6149         (Attribute.ResolveType, Attribute.Resolve),
6150         (Attribute.DefinePInvokeMethod): Set it.
6151         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6152         
6153 2004-08-03  Martin Baulig  <martin@ximian.com>
6154
6155         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6156         use a user-defined operator; we still need to do numeric
6157         promotions in case one argument is a builtin type and the other
6158         one has an implicit conversion to that type.  Fixes #62322.
6159
6160 2004-08-02  Martin Baulig  <martin@ximian.com>
6161
6162         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6163         (LocalInfo.IsThis): New public property.
6164         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6165
6166 2004-08-01  Martin Baulig  <martin@ximian.com>
6167
6168         * class.cs (TypeContainer.GetClassBases): Don't set the default
6169         here since we may get called from GetPartialBases().
6170         (TypeContainer.DefineType): If GetClassBases() didn't return a
6171         parent, use the default one.
6172
6173 2004-07-30  Duncan Mak  <duncan@ximian.com>
6174
6175         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
6176
6177 2004-07-30  Martin Baulig  <martin@ximian.com>
6178
6179         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6180
6181         * class.cs (SourceMethod): New public class, derive from the
6182         symbol writer's ISourceMethod.
6183         (Method): Use the new symbol writer API.
6184
6185         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6186         as argument and use the new symbol writer.
6187
6188         * location.cs
6189         (SourceFile): Implement the symbol writer's ISourceFile.
6190         (Location.SymbolDocument): Removed.
6191         (Location.SourceFile): New public property.
6192
6193         * symbolwriter.cs: Use the new symbol writer API.
6194
6195 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6196
6197         * Makefile (install-local): Remove.  Functionality moved to
6198         executable.make.
6199
6200 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6201
6202         * Makefile: Install mcs.exe.config file together with mcs.exe.
6203         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6204         correct runtime version.
6205         
6206 2004-07-25  Martin Baulig  <martin@ximian.com>
6207
6208         * class.cs
6209         (TypeContainer.RegisterOrder): Removed, this was unused.
6210         (TypeContainer, interface_order): Removed.
6211         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6212         TypeContainer as argument since we can also be called with a
6213         `PartialContainer' for a partial class/struct/interface.
6214         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6215         of checking whether we're an `Interface' - we could be a
6216         `PartialContainer'.
6217         (PartialContainer.Register): Override; call
6218         AddClass()/AddStruct()/AddInterface() on our parent.
6219
6220         * cs-parser.jay (interface_member_declaration): Add things to the
6221         `current_container', not the `current_class'.
6222
6223         * rootcontext.cs (RegisterOrder): The overloaded version which
6224         takes an `Interface' was unused, removed.
6225
6226         * typemanager.cs (TypeManager.LookupInterface): Return a
6227         `TypeContainer', not an `Interface'.
6228         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6229         contain a `PartialContainer' for an interface, so check it's
6230         `Kind' to figure out what it is.
6231
6232 2004-07-25  Martin Baulig  <martin@ximian.com>
6233
6234         * class.cs (Class.DefaultTypeAttributes): New public constant.
6235         (Struct.DefaultTypeAttributes): Likewise.
6236         (Interface.DefaultTypeAttributes): Likewise.
6237         (PartialContainer.TypeAttr): Override this and add the
6238         DefaultTypeAttributes.
6239
6240 2004-07-25  Martin Baulig  <martin@ximian.com>
6241
6242         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6243         we can just use the `Parent' field instead.
6244
6245 2004-07-25  Martin Baulig  <martin@ximian.com>
6246
6247         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6248
6249 2004-07-25  Martin Baulig  <martin@ximian.com>
6250
6251         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6252         our parts before defining any methods.
6253         (TypeContainer.VerifyImplements): Make this virtual.
6254         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6255         on our PartialContainer.
6256
6257 2004-07-25  Martin Baulig  <martin@ximian.com>
6258
6259         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6260
6261         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6262         argument, we can just use the `Parent' field instead.
6263
6264         * class.cs
6265         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6266         (MemberBase.DoDefine): Likewise.
6267
6268 2004-07-24  Martin Baulig  <martin@ximian.com>
6269
6270         * decl.cs (MemberCore.Parent): New public field.
6271         (DeclSpace.Parent): Moved to MemberCore.
6272
6273         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6274         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6275         parent's .ctor.
6276         (FieldBase, Field, Operator): Likewise.
6277         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6278         (EventField, Event): Likewise.
6279
6280 2004-07-23  Martin Baulig  <martin@ximian.com>
6281
6282         * class.cs (PartialContainer): New public class.
6283         (ClassPart): New public class.
6284         (TypeContainer): Added support for partial classes.
6285         (TypeContainer.GetClassBases): Splitted some of the functionality
6286         out into GetNormalBases() and GetPartialBases().
6287
6288         * cs-tokenizer.cs (Token.PARTIAL): New token.
6289         (Tokenizer.consume_identifier): Added some hacks to recognize
6290         `partial', but only if it's immediately followed by `class',
6291         `struct' or `interface'.
6292
6293         * cs-parser.jay: Added support for partial clases.
6294
6295 2004-07-23  Martin Baulig  <martin@ximian.com>
6296
6297         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6298         a `DeclSpace' and also made it readonly.
6299         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6300         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6301         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6302
6303         * cs-parser.jay: Pass the `current_class', not the
6304         `current_container' (at the moment, this is still the same thing)
6305         to a new Method, Property, Event, Indexer or Constructor.
6306
6307 2004-07-23  Martin Baulig  <martin@ximian.com>
6308
6309         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6310         and removed the `current_interface' one.
6311         (struct_declaration, class_declaration, interface_declaration):
6312         Set `current_class' to the newly created class/struct/interface;
6313         set their `Bases' and call Register() before parsing their body.
6314
6315 2004-07-23  Martin Baulig  <martin@ximian.com>
6316
6317         * class.cs (Kind): New public enum.
6318         (TypeContainer): Made this class abstract.
6319         (TypeContainer.Kind): New public readonly field.
6320         (TypeContainer.CheckDef): New public method; moved here from
6321         cs-parser.jay.
6322         (TypeContainer.Register): New public abstract method.
6323         (TypeContainer.GetPendingImplementations): New public abstract
6324         method.
6325         (TypeContainer.GetClassBases): Removed the `is_class' and
6326         `is_iface' parameters.
6327         (TypeContainer.DefineNestedTypes): Formerly known as
6328         DoDefineType().
6329         (ClassOrStruct): Made this class abstract.
6330
6331         * tree.cs (RootTypes): New public type. 
6332
6333 2004-07-20  Martin Baulig  <martin@ximian.com>
6334
6335         * tree.cs (Tree.RecordNamespace): Removed.
6336         (Tree.Namespaces): Removed.
6337
6338         * rootcontext.cs (RootContext.IsNamespace): Removed.
6339
6340         * cs-parser.jay (namespace_declaration): Just create a new
6341         NamespaceEntry here.
6342
6343 2004-07-20  Martin Baulig  <martin@ximian.com>
6344
6345         * statement.cs (ExceptionStatement): New abstract class.  This is
6346         now used as a base class for everyone who's using `finally'.
6347         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6348         our local variables before using them.
6349
6350         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6351         virtual method.  This is used by Yield.Resolve() to "steal" an
6352         outer block's `finally' clauses.
6353         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6354         argument.
6355
6356         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6357         version which takes an ExceptionStatement.  This version must be
6358         used to create exception branchings.
6359
6360         * iterator.cs
6361         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6362         (Iterator.EmitMoveNext): Added exception support; protect the
6363         block with a `fault' clause, properly handle 'finally' clauses.
6364         (Iterator.EmitDispose): Run all the `finally' clauses here.
6365
6366 2004-07-20  Martin Baulig  <martin@ximian.com>
6367
6368         * iterator.cs: This is the first of a set of changes in the
6369         iterator code.  Match the spec more closely: if we're an
6370         IEnumerable, then GetEnumerator() must be called.  The first time
6371         GetEnumerator() is called, it returns the current instance; all
6372         subsequent invocations (if any) must create a copy.
6373
6374 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6375
6376         * expression.cs: Resolve the constant expression before returning
6377         it. 
6378
6379 2004-07-19  Martin Baulig  <martin@ximian.com>
6380
6381         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6382         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6383         the return type of the new EmitContext.
6384
6385 2004-07-18  Martin Baulig  <martin@ximian.com>
6386
6387         * class.cs (Property.Define): Fix iterators.
6388
6389         * iterators.cs (Iterator.Define): Moved the
6390         `container.AddInterator (this)' call here from the .ctor; only do
6391         it if we resolved successfully.
6392
6393 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6394
6395         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6396         `true' for preprocessing directives that we parse.  The return
6397         value indicates whether we should return to regular tokenizing or
6398         not, not whether it was parsed successfully.
6399
6400         In the past if we were in: #if false ... #line #endif, we would
6401         resume parsing after `#line'.  See bug 61604.
6402
6403         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6404         building: IsEnumType should return true only for enums, not for
6405         enums or System.Enum itself.  This fixes #61593.
6406
6407         Likely what happened is that corlib was wrong: mcs depended on
6408         this bug in some places.  The bug got fixed, we had to add the
6409         hack, which caused bug 61593.
6410
6411         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6412         that was a workaround for the older conditions.
6413
6414 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6415
6416         * assign.cs: IAssignMethod has a new interface, as documented
6417         inline. All assignment code now uses this new api.
6418
6419         * ecore.cs, expression.cs: All classes which implement
6420         IAssignMethod now use the new interface.
6421
6422         * expression.cs (Invocation): add a hack to EmitCall so that
6423         IndexerAccess can be the target of a compound assignment without
6424         evaluating its arguments twice.
6425
6426         * statement.cs: Handle changes in Invocation api.
6427
6428 2004-07-16  Martin Baulig  <martin@ximian.com>
6429
6430         * iterators.cs: Rewrote this.  We're now using one single Proxy
6431         class for both the IEnumerable and the IEnumerator interface and
6432         `Iterator' derives from Class so we can use the high-level API.
6433
6434         * class.cs (TypeContainer.AddIterator): New method.
6435         (TypeContainer.DoDefineType): New protected virtual method, which
6436         is called from DefineType().
6437         (TypeContainer.DoDefineMembers): Call DefineType() and
6438         DefineMembers() on all our iterators.
6439         (TypeContainer.Emit): Call Emit() on all our iterators.
6440         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6441
6442         * codegen.cs (EmitContext.CurrentIterator): New public field.
6443
6444 2004-07-15  Martin Baulig  <martin@ximian.com>
6445
6446         * typemanager.cs
6447         (TypeManager.not_supported_exception_type): New type.   
6448
6449 2004-07-14  Martin Baulig  <martin@ximian.com>
6450
6451         * iterators.cs: Use real error numbers.
6452
6453 2004-07-14  Martin Baulig  <martin@ximian.com>
6454
6455         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6456         requires this to be a System.Collection.IEnumerable and not a
6457         class implementing that interface.
6458         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6459
6460 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6461
6462         * class.cs: Fixed previous fix, it broke some error tests.
6463
6464 2004-07-12  Martin Baulig  <martin@ximian.com>
6465
6466         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6467         Fixes #61293.
6468
6469 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6470
6471         * assign.cs (LocalTemporary): Add new argument: is_address,If
6472         `is_address' is true, then the value that we store is the address
6473         to the real value, and not the value itself.
6474         
6475         * ecore.cs (PropertyExpr): use the new local temporary
6476         stuff to allow us to handle X.Y += z (where X is a struct)
6477
6478 2004-07-08  Martin Baulig  <martin@ximian.com>
6479
6480         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6481         not always return, just like we're doing in Using.Resolve().
6482
6483 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6484
6485         * cs-parser.jay (fixed_statement): flag this as Pinned.
6486
6487 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6488
6489         * typemanager.cs (TypeManager): Removed MakePinned method, this
6490         mechanism is replaced with the .NET 2.x compatible mechanism of
6491         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6492
6493         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6494         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6495         `IsFixed' property which has a different meaning.
6496
6497 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6498
6499         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6500         visible from inside a nested class, not just the names of the
6501         immediately enclosing class.
6502         Fix for bug #60730.
6503
6504 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6505
6506         * expression.cs (BetterConversion): Remove buggy special-case
6507         handling of "implicit constant expression conversions".  At this
6508         point, we already know that the conversion is possible -- we're
6509         only checking to see which is better.
6510
6511 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6512
6513         * cs-parser.jay: Added error CS0210 test.
6514
6515 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6516
6517         * cs-parser.jay: Added error CS0134 test.
6518
6519 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6520
6521         Fix bug #52507
6522         * cs-parser.jay: Added error CS0145 test.
6523
6524 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6525
6526         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6527
6528 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6529         
6530         * expression.cs (StackAlloc.Resolve): The argument may not
6531         be a constant; deal with this case.
6532         
6533 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6534
6535         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6536         GetIndexerAttributeValue.
6537         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6538
6539         * class.cs (Indexer.Define): Added error tests for CS0415,
6540         CS0609.
6541
6542 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6543
6544         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6545         property code.
6546
6547 2004-06-23  Martin Baulig  <martin@ximian.com>
6548
6549         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6550         neither return nor throw, reset the barrier as well.  Fixes #60457.
6551
6552 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6553
6554         * class.cs : EventAttributes is now set to None by default.
6555           This fixes bug #60459.
6556
6557 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6558
6559         Fix bug #60219
6560         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6561         Don't throw exception but return null (it's sufficient now).
6562
6563 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6564
6565         * typemanager.cs (GetArgumentTypes): Faster implementation.
6566
6567 2004-06-18  Martin Baulig  <martin@ximian.com>
6568
6569         * attribute.cs (Attribute.Resolve): Check whether we're an
6570         EmptyCast which a Constant child.  Fixes #60333.
6571
6572 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6573
6574         * statement.cs (EmitCollectionForeach): Account for the fact that
6575         not all valuetypes are in areas which we can take the address of.
6576         For these variables, we store to a temporary variable. Also, make
6577         sure that we dont emit a `callvirt' on a valuetype method.
6578
6579 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6580
6581         * expression.cs (StackAlloc.DoReSolve): Added test for
6582         negative parameter (CS0247).
6583
6584 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6585
6586         Fix bug #59792
6587         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6588
6589 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6590
6591         Fix bug #59781
6592         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6593         ulong.
6594
6595 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6596
6597         Fix bug #58254 & cs1555.cs, cs1556.cs
6598         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6599
6600 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6601
6602         * cs-parser.jay: Added error CS1669 test for indexers.
6603
6604 2004-06-11  Martin Baulig  <martin@ximian.com>
6605
6606         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6607         call this twice: for params and varargs methods.
6608
6609 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6610
6611         * class.cs:
6612         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6613
6614 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6615
6616         * attribute.cs (Attribute.GetValidTargets): Made public.
6617
6618         * class.cs: 
6619         (AbstractPropertyEventMethod): New class for better code sharing.
6620         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6621         CS1667 report.
6622         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6623
6624 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6625
6626         Fix bug #59477.
6627         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6628         that the call to Resolve is part of a MemberAccess.
6629         (Expression.Resolve): Use it for SimpleName resolution.
6630         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6631         Add 'intermediate' boolean argument.
6632         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6633         error message when the SimpleName can be resolved ambiguously
6634         between an expression and a type.
6635         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6636         public.
6637         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6638         call on the left-side.
6639
6640 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6641
6642         * class.cs:
6643         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6644
6645 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6646
6647         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6648
6649 2004-06-11  Martin Baulig  <martin@ximian.com>
6650
6651         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6652         varargs methods if applicable.
6653
6654 2004-06-11  Martin Baulig  <martin@ximian.com>
6655
6656         * expression.cs (Invocation.EmitCall): Don't use
6657         `method.CallingConvention == CallingConventions.VarArgs' since the
6658         method could also have `CallingConventions.HasThis'.
6659
6660 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6661
6662         * class.cs (Event.GetSignatureForError): Implemented.
6663         Fixed crash in error test cs3010.cs
6664
6665 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6666
6667         * cs-tokenizer.cs: Change the way we track __arglist to be
6668         consistent with the other keywords.
6669
6670 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6671
6672         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6673         tomorrow.
6674
6675 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6676
6677         * codegen.cs: Check that all referenced assemblies have a strongname
6678         before strongnaming the compiled assembly. If not report error CS1577.
6679         Fix bug #56563. Patch by Jackson Harper.
6680         * typemanager.cs: Added a method to return all referenced assemblies.
6681         Fix bug #56563. Patch by Jackson Harper.
6682
6683 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6684
6685         * class.cs:
6686         (Method.ApplyAttributeBuilder): Moved and added conditional
6687         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6688
6689         * delegate.cs:
6690         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6691
6692 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6693
6694         Fixed #59640
6695         * class.cs: (EventField.attribute_targets): Changed default target.
6696
6697 2004-06-08  Martin Baulig  <martin@ximian.com>
6698
6699         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6700
6701 2004-06-08  Martin Baulig  <martin@ximian.com>
6702
6703         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6704
6705 2004-06-07  Martin Baulig  <martin@ximian.com>
6706
6707         Added support for varargs methods.
6708
6709         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6710         keyword.
6711
6712         * cs-parser.jay: Added support for `__arglist'.
6713
6714         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6715
6716         * expression.cs (Argument.AType): Added `ArgList'.
6717         (Invocation): Added support for varargs methods.
6718         (ArglistAccess): New public class.
6719         (Arglist): New public class.
6720
6721         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6722
6723         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6724         a method's top-level block if the method has varargs.
6725
6726         * support.cs (ReflectionParameters, InternalParameters): Added
6727         support for varargs methods.    
6728
6729 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6730
6731         * class.cs: Provide location in indexer error report.
6732
6733         * driver.cs: Use standard names.
6734
6735         * namespace.cs: Catch the use of using after a namespace has been
6736         declared also on using aliases.
6737
6738 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6739
6740         Bug #50820.
6741         * typemanager.cs (closure_private_ok, closure_invocation_type)
6742         (closure_qualifier_type, closure_invocation_assembly)
6743         (FilterWithClosure): Move to ...
6744         (Closure): New internal nested class.
6745         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6746         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6747         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6748         (MemberLookup, MemberLookupFailed): Use it.
6749         * expression.cs (New.DoResolve): Treat the lookup for the
6750         constructor as being qualified by the 'new'ed type.
6751         (Indexers.GetIndexersForTypeOrInterface): Update.
6752
6753 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6754
6755         * attribute.cs
6756         (GetConditionalAttributeValue): New method. Returns
6757         condition of ConditionalAttribute.
6758         (SearchMulti): New method.  Returns all attributes of type 't'.
6759         Use it when attribute is AllowMultiple = true.
6760         (IsConditionalMethodExcluded): New method.
6761
6762         * class.cs
6763         (Method.IsExcluded): Implemented. Returns true if method has conditional
6764         attribute and the conditions is not defined (method is excluded).
6765         (IMethodData): Extended interface for ConditionalAttribute support.
6766         (PropertyMethod.IsExcluded): Implemented.
6767
6768         * decl.cs
6769         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6770
6771         * expression.cs
6772         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6773         on the method.
6774
6775 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6776
6777         * expression.cs (ArrayCreationExpression): Make this just an
6778         `expression'. It can't be a statement, so the code here was
6779         dead.
6780
6781 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6782
6783         Fixed #59072
6784         * typemanager.cs (GetFullNameSignature): New method for
6785         MethodBase types.
6786
6787 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6788
6789         Fixed #56452
6790         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6791         Use this method when MethodBuilder is null.
6792         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6793         Added test for error CS0626 (MONO reports error for this situation).
6794         (IMethodData.GetSignatureForError): Extended interface.
6795
6796 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6797
6798         * attribute.cs
6799         (AttributeTester.GetObsoleteAttribute): Returns instance of
6800         ObsoleteAttribute when type is obsolete.
6801
6802         * class.cs
6803         (TypeContainer.VerifyObsoleteAttribute): Override.
6804         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6805         (MethodCode.VerifyObsoleteAttribute): Override.
6806         (MemberBase.VerifyObsoleteAttribute): Override.
6807
6808         * decl.cs
6809         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6810         and report proper error.
6811
6812         *delegate.cs
6813         Delegate.VerifyObsoleteAttribute): Override.
6814
6815         * ecore.cs
6816         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6817         and report proper error.
6818         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6819
6820         * enum.cs
6821         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6822         and enum member.
6823
6824         * expression.cs
6825         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6826         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6827         Added test for ObsoleteAttribute.
6828
6829         * statement.cs
6830         (Catch): Derived from Statement.
6831
6832 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6833  
6834         Fixed bug #59071 & cs0160.cs
6835  
6836         * statement.cs (Try.Resolve): Check here whether order of catch
6837         clauses matches their dependencies.
6838
6839 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6840
6841         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6842         caused a regression: #59343.  Referencing nested classes from an
6843         assembly stopped working.
6844
6845 2004-05-31  Martin Baulig  <martin@ximian.com>
6846
6847         MCS is now frozen for beta 2.
6848
6849 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6850
6851         * convert.cs: add a trivial cache for overload operator resolution.
6852
6853 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6854
6855         * decl.cs: If possible, use lookuptypedirect here. We can only do
6856         this if there is no `.' after the namespace. Avoids using
6857         LookupType, which does lots of slow processing.
6858         (FindNestedType) New method, does what it says :-).
6859         * namespace.cs: use LookupTypeDirect.
6860         * rootcontext.cs: use membercache, if possible.
6861         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6862
6863 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6864
6865         * expression.cs:
6866         According to the spec, 
6867
6868         In a member access of the form E.I, if E is a single identifier,
6869         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6870         field, property, localvariable, or parameter with the same type as
6871         the meaning of E as a type-name (§3.8), then both possible
6872         meanings of E are permitted.
6873
6874         We did not check that E as a simple-name had the same type as E as
6875         a type name.
6876
6877         This trivial check gives us 5-7% on bootstrap time.
6878
6879 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6880
6881         * expression.cs (Invocation.OverloadResolve): Avoid the
6882         use of hashtables and boxing here by allocating on demand.
6883
6884 2004-05-30  Martin Baulig  <martin@ximian.com>
6885
6886         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6887         we're doing a silent lookup.  Don't try to lookup nested types in
6888         TypeManager.object_type (thanks to Ben Maurer).
6889
6890 2004-05-30  Martin Baulig  <martin@ximian.com>
6891
6892         Committing a patch from Ben Maurer.
6893
6894         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6895
6896 2004-05-29  Martin Baulig  <martin@ximian.com>
6897
6898         * class.cs (IMethodData.ShouldIgnore): New method.
6899
6900         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6901         `Location' argument, we don't need it anywhere.  Use
6902         `IMethodData.ShouldIgnore ()' instead of
6903         `MethodData.GetMethodFlags ()'.
6904         (TypeManager.AddMethod): Removed.
6905         (TypeManager.AddMethod2): Renamed to AddMethod.
6906
6907 2004-05-29  Martin Baulig  <martin@ximian.com>
6908
6909         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6910
6911         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6912         converting from a class type S to an interface type and we already
6913         have an object on the stack, don't box it again.  Fixes #52578.
6914
6915 2004-05-29  Martin Baulig  <martin@ximian.com>
6916
6917         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6918         Added support for `params' parameters.  Fixes #59267.
6919
6920 2004-05-29  Martin Baulig  <martin@ximian.com>
6921
6922         * literal.cs (NullPointer): Provide a private .ctor which sets
6923         `type' to TypeManager.object_type.  Fixes #59048.
6924
6925 2004-05-29  Martin Baulig  <martin@ximian.com>
6926
6927         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6928         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6929
6930         * ecore.cs (EventExpr.instance_expr): Make the field private.
6931
6932 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6933
6934         Fixed bug #50080 & cs0214-2.cs
6935         * expression.cs (Cast.DoResolve): Check unsafe context here.
6936         
6937         * statement.cs (Resolve.DoResolve): Likewise.
6938
6939 2004-05-26  Martin Baulig  <martin@ximian.com>
6940
6941         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6942
6943         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6944         (RootContext.LookupType): Pass down the `silent' flag.
6945
6946 2004-05-25  Martin Baulig  <martin@ximian.com>
6947
6948         * expression.cs
6949         (MethodGroupExpr.IdenticalTypeName): New public property.
6950         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6951         expression actually refers to a type.
6952
6953 2004-05-25  Martin Baulig  <martin@ximian.com>
6954
6955         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6956         for #56176 and made it actually work.
6957
6958 2004-05-25  Martin Baulig  <martin@ximian.com>
6959
6960         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6961         (FieldExpr, PropertyExpr): Override and implement
6962         CacheTemporaries.  Fixes #52279.
6963
6964 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6965
6966         * location.cs: In the new compiler listing a file twice is a
6967         warning, not an error.
6968
6969 2004-05-24  Martin Baulig  <martin@ximian.com>
6970
6971         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6972         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6973
6974 2004-05-24  Martin Baulig  <martin@ximian.com>
6975
6976         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6977         walking the `using' list.  Fixes #53921.
6978
6979 2004-05-24  Martin Baulig  <martin@ximian.com>
6980
6981         * const.cs (Const.LookupConstantValue): Added support for
6982         EmptyCast's; fixes #55251.
6983
6984 2004-05-24  Martin Baulig  <martin@ximian.com>
6985
6986         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6987         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6988         which does the CS0135 check.  The reason is that we first need to
6989         check whether the variable actually exists.
6990
6991 2004-05-24  Martin Baulig  <martin@ximian.com>
6992
6993         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6994         than RootContext.LookupType() to find the explicit interface
6995         type.  Fixes #58584.
6996
6997 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6998
6999         * Makefile: Simplify.  Use executable.make.
7000         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7001
7002 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7003
7004         * decl.cs:
7005         * enum.cs:
7006         Use the invariant culture when doing String.Compare for CLS case
7007         sensitivity.
7008         
7009 2004-05-23  Martin Baulig  <martin@ximian.com>
7010
7011         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7012         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7013
7014         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7015         
7016 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7017
7018         * class.cs (MemberBase.Define): Reuse MemberType member for 
7019         resolved type. Other methods can use it too.
7020
7021 2004-05-23  Martin Baulig  <martin@ximian.com>
7022
7023         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7024         the variable also exists in the current block (otherwise, we need
7025         to report a CS0103).  Fixes #58670.
7026
7027 2004-05-23  Martin Baulig  <martin@ximian.com>
7028
7029         * flowanalysis.cs (Reachability.Reachable): Compute this
7030         on-the-fly rather than storing it as a field.
7031
7032 2004-05-23  Martin Baulig  <martin@ximian.com>
7033
7034         * flowanalysis.cs (Reachability.And): Manually compute the
7035         resulting `barrier' from the reachability.      
7036        
7037 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7038
7039         Fix bug #57835
7040         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7041         instance of ObsoleteAttribute when symbol is obsolete.
7042
7043         * class.cs
7044         (IMethodData): Extended interface for ObsoleteAttribute support.
7045
7046 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7047
7048         * attribute.cs: Fix bug #55970
7049
7050 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7051
7052         Fix bug #52705
7053         * attribute.cs
7054         (GetObsoleteAttribute): New method. Creates the instance of
7055         ObsoleteAttribute.
7056         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7057         ObsoleteAttribute when member is obsolete.
7058         (AttributeTester.Report_ObsoleteMessage): Common method for
7059         Obsolete error/warning reporting.
7060
7061         * class.cs
7062         (TypeContainer.base_classs_type): New member for storing parent type.
7063
7064         * decl.cs
7065         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7066         for this MemberCore.
7067
7068 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7069
7070         * attribute.cs, const.cs: Fix bug #58590
7071
7072 2004-05-21  Martin Baulig  <martin@ximian.com>
7073
7074         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7075         out parameters if the end of the method is unreachable.  Fixes
7076         #58098. 
7077
7078 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7079
7080         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7081         Hari was right, why extra method.
7082
7083 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7084
7085         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7086
7087 2004-05-20  Martin Baulig  <martin@ximian.com>
7088
7089         Merged this back from gmcs to keep the differences to a minumum.
7090
7091         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
7092         instead of a Declspace.
7093         (Attribute.ResolveType): Likewise.
7094         (Attributes.Search): Likewise.
7095         (Attributes.Contains): Likewise.
7096         (Attributes.GetClsCompliantAttribute): Likewise.
7097
7098         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
7099         argument.
7100         (MethodData.ApplyAttributes): Take an EmitContext instead of a
7101         DeclSpace.
7102
7103 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7104
7105         Fix bug #58688 (MCS does not report error when the same attribute
7106         is assigned twice)
7107
7108         * attribute.cs (Attribute.Emit): Distinction between null and default.
7109
7110 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7111
7112         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7113         of a top-level attribute without an attribute target.
7114         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7115         Make non-static.
7116         (Attribute.Conditional_GetConditionName), 
7117         (Attribute.Obsolete_GetObsoleteMessage): Update.
7118         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7119         part of ScanForIndexerName.
7120         (Attribute.CanIgnoreInvalidAttribute): New function.
7121         (Attribute.ScanForIndexerName): Move to ...
7122         (Attributes.ScanForIndexerName): ... here.
7123         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7124         (Attributes.Search): New internal variant that can choose not to
7125         complain if types aren't resolved.  The original signature now
7126         complains.
7127         (Attributes.GetClsCompliantAttribute): Use internal variant, with
7128         complaints suppressed.
7129         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7130         only if it not useful.
7131         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7132         top-level for attributes that are shared between the assembly
7133         and a top-level class.
7134         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7135         * class.cs: Update to reflect changes.
7136         (DefineIndexers): Fuse loops.
7137         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7138         a couple more variants of attribute names.
7139
7140 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7141
7142         Fix bug #52585 (Implemented explicit attribute declaration)
7143
7144         * attribute.cs:
7145         (Attributable.ValidAttributeTargets): New abstract method. It gets
7146         list of valid attribute targets for explicit target declaration.
7147         (Attribute.Target): It holds target itself.
7148         (AttributeSection): Removed.
7149         (Attribute.CheckTargets): New method. It checks whether attribute
7150         target is valid for the current element.
7151
7152         * class.cs:
7153         (EventProperty): New class. For events that are declared like
7154         property (with add and remove accessors).
7155         (EventField): New class. For events that are declared like field.
7156         class.cs
7157
7158         * cs-parser.jay: Implemented explicit attribute target declaration.
7159
7160         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7161         Override ValidAttributeTargets.
7162
7163         * parameter.cs:
7164         (ReturnParameter): Class for applying custom attributes on 
7165         the return type.
7166         (ParameterAtribute): New class. Class for applying custom
7167         attributes on the parameter type.
7168
7169 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7170
7171         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7172         definitions. 
7173
7174         (Method): Allow UNSAFE here.
7175
7176         * modifiers.cs: Support unsafe reporting.
7177
7178 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7179
7180         * decl.cs: Fix bug #58478.
7181
7182 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7183
7184         * statement.cs: When checking for unreachable code on an EmptyStatement,
7185         set the location. Fixes bug #58488.
7186
7187 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7188
7189         * driver.cs: Add -pkg handling.
7190
7191         From Gonzalo: UseShelLExecute=false
7192
7193 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7194
7195         * attribute.cs:
7196         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7197         for attribute.
7198         (Attribute.IsClsCompliaceRequired): Moved to base for better
7199         accesibility.
7200         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7201         when attribute is AttributeUsageAttribute.
7202         (Attribute.GetValidTargets): Simplified.
7203         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7204         attribute for this type.
7205         (Attribute.ApplyAttributes): Method renamed to Emit and make
7206         non-static.
7207         (GlobalAttributeSection): New class for special handling of global
7208         attributes (assembly, module).
7209         (AttributeSection.Emit): New method.
7210
7211         * class.cs: Implemented Attributable abstract methods.
7212         (MethodCore.LabelParameters): Moved to Parameter class.
7213         (Accessor): Is back simple class.
7214         (PropertyMethod): Implemented Attributable abstract class.
7215         (DelegateMethod): Implemented Attributable abstract class.
7216         (Event): New constructor for disctintion between normal Event
7217         and Event with accessors.
7218
7219         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7220
7221         * codegen.cs, const.cs, decl.cs, delegate.cs:
7222         (CommonAssemblyModulClass): Implemented Attributable abstract class
7223         and simplified.
7224
7225         * enum.cs: Implement IAttributeSupport interface.
7226         (EnumMember): New class for emum members. Implemented Attributable
7227         abstract class
7228
7229         * parameter.cs:
7230         (ParameterBase): Is abstract.
7231         (ReturnParameter): New class for easier [return:] attribute handling.
7232
7233         * typemanager.cs: Removed builder_to_attr.
7234
7235 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7236
7237         Fix bug #57151.
7238         * attribute.cs (Attribute.GetPositionalValue): New function.
7239         * class.cs (TypeContainer.VerifyMembers): New function.
7240         (TypeContainer.Emit): Use it.
7241         (ClassOrStruct): New base class for Class and Struct.
7242         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7243         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7244         class.
7245         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7246         then each non-static field should have a FieldOffset attribute.
7247         Otherwise, none of the fields should have a FieldOffset attribute.
7248         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7249         and FieldOffset attributes.
7250         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7251         (TypeManager.field_offset_attribute_type): New core types.
7252         (TypeManager.InitCoreTypes): Initialize them.
7253
7254 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7255
7256         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7257         Return correct type.
7258         From bug #58270.
7259
7260 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7261
7262         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7263         be implicitly converted to ulong.
7264         
7265         * expression.cs: The logic for allowing operator &, | and ^ worked
7266         was wrong, it worked before because we did not report an error in
7267         an else branch.  Fixes 57895.
7268
7269         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7270         allow volatile fields to be reference types.
7271
7272 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7273
7274         * driver.cs: Add support for /debug-
7275
7276 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7277
7278         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7279         Add a 'complain' parameter to silence errors.
7280         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7281         silently overlooked type-resolutions.
7282         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7283         to reflect changes.
7284         (Attributes.Search): New function.
7285         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7286         (Attributes.GetAttributeFullName): Remove hack.
7287         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7288         Update to reflect changes.
7289         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7290         Use Attributes.Search instead of nested loops.
7291
7292 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7293
7294         * decl.cs:
7295         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7296         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7297         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7298
7299         * report.cs: (Report.Warning): Renamed to Warning_T because of
7300         parameter collision.
7301
7302 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7303
7304         * expression.cs (MemberAccess.ResolveMemberAccess):
7305         Exit with non-zero status after Report.Error.
7306         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7307         Likewise.
7308         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7309
7310 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7311
7312         * support.cs: Don't hang when the file is empty.
7313
7314 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7315
7316         * support.cs: In SeekableStreamReader, compute the preamble size of the
7317           underlying stream. Position changes should take into account that initial
7318           count of bytes.
7319
7320 2004-05-03  Todd Berman  <tberman@sevenl.net>
7321
7322         * driver.cs: remove unused GetSysVersion function.
7323
7324 2004-05-03  Todd Berman  <tberman@sevenl.net>
7325
7326         * driver.cs: Remove the hack from saturday, as well as the hack
7327         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7328         link_paths to get that bit proper.
7329
7330 2004-05-01  Todd Berman  <tberman@sevenl.net>
7331
7332         * driver.cs: Try a LoadFrom before a Load, this checks the current
7333         path. This is currently a bug in mono that is be fixed, however, this
7334         provides a workaround for now. This will be removed when the bug
7335         is fixed.
7336
7337 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7338
7339         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7340         incomplete key pairs (#57941).
7341
7342 2004-05-01  Todd Berman  <tberman@sevenl.net>
7343
7344         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7345         from the GAC
7346
7347 2004-04-30  Jackson Harper  <jackson@ximian.com>
7348
7349         * codegen.cs: Open keys readonly.
7350         
7351 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7352
7353         * typemanager.cs: don't report cyclic struct layout when a struct
7354         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7355         which has 2 Pango.Rectangle fields.
7356
7357 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7358
7359         * expression.cs: Handle IntPtr comparisons with IL code
7360         rather than a method call.
7361
7362 2004-04-29  Martin Baulig  <martin@ximian.com>
7363
7364         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7365         the list of PropertyInfo's in class hierarchy and find the
7366         accessor.  Fixes #56013.
7367
7368 2004-04-29  Martin Baulig  <martin@ximian.com>
7369
7370         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7371
7372 2004-04-29  Martin Baulig  <martin@ximian.com>
7373
7374         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7375
7376         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7377
7378 2004-04-29  Martin Baulig  <martin@ximian.com>
7379
7380         * class.cs (ConstructorInitializer.Resolve): Check whether the
7381         parent .ctor is accessible.  Fixes #52146.
7382
7383 2004-04-29  Martin Baulig  <martin@ximian.com>
7384
7385         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7386
7387         * statement.cs (Using.EmitLocalVariableDecls): Use
7388         TypeManager.idisposable_type, not typeof (IDisposable).
7389         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7390
7391 2004-04-29  Martin Baulig  <martin@ximian.com>
7392
7393         * class.cs (Event.Define): Don't emit the field and don't set
7394         RTSpecialName and SpecialName for events on interfaces.  Fixes
7395         #57703. 
7396
7397 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7398
7399         Refactor Attribute.ApplyAttributes.
7400         * attribute.cs (Attributable): New base class for objects that can
7401         have Attributes applied on them.
7402         (Attribute): Make AttributeUsage fields public.
7403         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7404         (Attribute.IsInternalCall): New property.
7405         (Attribute.UsageAttr): Convert to a public read-only property.
7406         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7407         (Attribute.ResolveType, Attribute.Resolve)
7408         (Attribute.ScanForIndexerName): Update to reflect changes.
7409         (Attribute.CheckAttributeTarget): Re-format.
7410         (Attribute.ApplyAttributes): Refactor, to various
7411         Attributable.ApplyAttributeBuilder methods.
7412         * decl.cs (MemberCore): Make Attributable.
7413         * class.cs (Accessor): Make Attributable.
7414         (MethodData.ApplyAttributes): Use proper attribute types, not
7415         attribute names.
7416         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7417         (TypeContainer.ApplyAttributeBuilder)
7418         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7419         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7420         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7421         (Operator.ApplyAttributeBuilder): New factored-out methods.
7422         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7423         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7424         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7425         * parameter.cs (ParameterBase): New Attributable base class
7426         that can also represent Return types.
7427         (Parameter): Update to the changes.
7428
7429 2004-04-29  Jackson Harper  <jackson@ximian.com>
7430
7431         * driver.cs: Prefer the corlib system version when looking for
7432         assemblies in the GAC. This is still a hack, but its a better hack
7433         now.
7434         
7435 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7436
7437         * decl.cs, enum.cs: Improved error 3005 reporting.
7438   
7439         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7440         (related_symbols): New private member for list of symbols
7441         related to reported error/warning.
7442         
7443         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7444
7445 2004-04-29  Martin Baulig  <martin@ximian.com>
7446
7447         * ecore.cs (Expression.Constantify): If we're an enum and
7448         TypeManager.TypeToCoreType() doesn't give us another type, use
7449         t.UnderlyingSystemType.  Fixes #56178.  
7450
7451 2004-04-29  Martin Baulig  <martin@ximian.com>
7452
7453         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7454         interfaces and for each interface, only add members directly
7455         declared in that interface.  Fixes #53255.
7456
7457 2004-04-28  Martin Baulig  <martin@ximian.com>
7458
7459         * expression.cs (ConditionalLogicalOperator): Use a temporary
7460         variable for `left' to avoid that we evaluate it more than once;
7461         bug #52588.
7462
7463 2004-04-28  Martin Baulig  <martin@ximian.com>
7464
7465         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7466         `void[]' (CS1547).
7467
7468 2004-04-28  Martin Baulig  <martin@ximian.com>
7469
7470         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7471         void (CS1547).
7472
7473         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7474         whether the type is not void (CS1547).
7475
7476 2004-04-28  Martin Baulig  <martin@ximian.com>
7477
7478         * expression.cs (Unary.DoResolveLValue): Override this and report
7479         CS0131 for anything but Operator.Indirection.
7480
7481 2004-04-28  Martin Baulig  <martin@ximian.com>
7482
7483         Committing a patch from Ben Maurer; see bug #50820.
7484
7485         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7486         check for classes.
7487
7488         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7489         classes.        
7490
7491 2004-04-28  Martin Baulig  <martin@ximian.com>
7492
7493         Committing a patch from Ben Maurer; see bug #50820.
7494
7495         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7496         check for classes.
7497
7498         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7499         classes.        
7500
7501 2004-04-28  Martin Baulig  <martin@ximian.com>
7502
7503         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7504         (Block.AddLabel): Call DoLookupLabel() to only search in the
7505         current block.
7506
7507 2004-04-28  Martin Baulig  <martin@ximian.com>
7508
7509         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7510         comparing StringConstants and NullLiterals in Equality and Inequality.
7511
7512 2004-04-28  Jackson Harper  <jackson@ximian.com>
7513
7514         * driver.cs: Attempt to load referenced assemblies from the
7515         GAC. This is the quick and dirty version of this method that
7516         doesnt take into account versions and just takes the first
7517         canidate found. Will be good enough for now as we will not have more
7518         then one version installed into the GAC until I update this method.
7519
7520 2004-04-28  Martin Baulig  <martin@ximian.com>
7521
7522         * typemanager.cs (TypeManager.CheckStructCycles): New public
7523         static method to check for cycles in the struct layout.
7524
7525         * rootcontext.cs (RootContext.PopulateTypes): Call
7526         TypeManager.CheckStructCycles() for each TypeContainer.
7527         [Note: We only need to visit each type once.]
7528
7529 2004-04-28  Martin Baulig  <martin@ximian.com>
7530
7531         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7532
7533         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7534         success and added `out object value'.  Use a `bool resolved' field
7535         to check whether we've already been called rather than
7536         `ConstantValue != null' since this breaks for NullLiterals.
7537
7538 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7539
7540         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7541         setting of this flag, since the 'set' method may be non-public.
7542
7543 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7544
7545         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7546         check on current_vector.Block.
7547
7548 2004-04-27  Martin Baulig  <martin@ximian.com>
7549
7550         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7551         a field initializer.  Fixes #56459.
7552
7553 2004-04-27  Martin Baulig  <martin@ximian.com>
7554
7555         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7556         we're not attempting to use an indexer.  Fixes #52154.
7557
7558 2004-04-27  Martin Baulig  <martin@ximian.com>
7559
7560         * statement.cs (Return): Don't create a return label if we don't
7561         need it; reverts my change from January 20th.  Thanks to Ben
7562         Maurer for this.
7563
7564 2004-04-27  Martin Baulig  <martin@ximian.com>
7565
7566         According to the spec, `goto' can only leave a nested scope, but
7567         never enter it.
7568
7569         * statement.cs (Block.LookupLabel): Only lookup in the current
7570         block, don't recurse into parent or child blocks.
7571         (Block.AddLabel): Check in parent and child blocks, report
7572         CS0140/CS0158 if we find a duplicate.
7573         (Block): Removed this indexer for label lookups.
7574         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7575         this already does the error reporting for us.
7576
7577         * flowanalysis.cs
7578         (FlowBranching.UsageVector.Block): New public variable; may be null.
7579         (FlowBranching.CreateSibling): Added `Block' argument.
7580         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7581         label for the target of a `goto' and check whether we're not
7582         leaving a `finally'.
7583
7584 2004-04-27  Martin Baulig  <martin@ximian.com>
7585
7586         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7587         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7588         just for returns).
7589
7590 2004-04-27  Martin Baulig  <martin@ximian.com>
7591
7592         * statement.cs (Block.AddLabel): Also check for implicit blocks
7593         and added a CS0158 check.
7594
7595 2004-04-27  Martin Baulig  <martin@ximian.com>
7596
7597         * flowanalysis.cs (FlowBranchingLoop): New class.
7598         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7599         UsageVector's instead of an ArrayList.
7600         (FlowBranching.Label): Likewise.
7601         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7602         (FlowBranching.AddBreakVector): New method.
7603
7604 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7605
7606         * attribute.cs: Small regression fix: only convert the type if we
7607         the type is different, fixes System.Drawing build.
7608
7609 2004-04-27  Martin Baulig  <martin@ximian.com>
7610
7611         * attribute.cs (Attribute.Resolve): If we have a constant value
7612         for a named field or property, implicity convert it to the correct
7613         type.
7614
7615 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7616
7617         * statement.cs (Block.Block): Implicit blocks share
7618         'child_variable_names' fields with parent blocks.
7619         (Block.AddChildVariableNames): Remove.
7620         (Block.AddVariable): Mark variable as "used by a child block" in
7621         every surrounding block.
7622         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7623         been used in a child block, complain about violation of "Invariant
7624         meaning in blocks" rule.
7625         * cs-parser.jay (declare_local_variables): Don't use
7626         AddChildVariableNames.
7627         (foreach_statement): Don't create an implicit block: 'foreach'
7628         introduces a scope.
7629
7630 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7633         converting from 0L to ulong.  Fixes 57522.
7634
7635 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7636
7637         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7638         derived class hides via 'new' keyword field from base class (test-242.cs).
7639         TODO: Handle this in the more general way.
7640         
7641         * class.cs (CheckBase): Ditto.
7642
7643 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7644
7645         * decl.cs (caching_flags): New member for storing cached values
7646         as bit flags.
7647         (MemberCore.Flags): New enum where bit flags for caching_flags
7648         are defined.
7649         (MemberCore.cls_compliance): Moved to caching_flags.
7650         (DeclSpace.Created): Moved to caching_flags.
7651
7652         * class.cs: Use caching_flags instead of DeclSpace.Created
7653         
7654 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7655
7656         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7657         if we are only a derived class, not a nested class.
7658
7659         * typemanager.cs: Same as above, but do this at the MemberLookup
7660         level (used by field and methods, properties are handled in
7661         PropertyExpr).   Allow for the qualified access if we are a nested
7662         method. 
7663
7664 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7665
7666         * class.cs: Refactoring.
7667         (IMethodData): New inteface; Holds links to parent members
7668         to avoid member duplication (reduced memory allocation).
7669         (Method): Implemented IMethodData interface.
7670         (PropertyBase): New inner classes for get/set methods.
7671         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7672         (Event): New inner classes for add/remove methods.
7673         (Event.DelegateMethod): Implemented IMethodData interface.
7674
7675         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7676         EmitContext (related to class.cs refactoring).
7677
7678 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7679
7680         * delegate.cs (Delegate.VerifyApplicability): If the number of
7681         arguments are the same as the number of parameters, first try to
7682         verify applicability ignoring  any 'params' modifier on the last
7683         parameter.
7684         Fixes #56442.
7685
7686 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7687
7688         * class.cs (TypeContainer.AddIndexer): Use
7689         'ExplicitInterfaceName' to determine if interface name was
7690         explicitly specified.  'InterfaceType' is not initialized at this time.
7691         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7692         Indexers array is already in the required order.  Initialize
7693         'IndexerName' only if there are normal indexers.
7694         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7695         (TypeContainer.Emit): Emit DefaultMember attribute only if
7696         IndexerName is initialized.
7697         Fixes #56300.
7698
7699 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7700
7701         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7702         Fixes #57007
7703
7704 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7705
7706         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7707         attributes.
7708         Fix for #56456.
7709
7710         * attribute.cs (Attribute.Resolve): Check for duplicate named
7711         attributes.
7712         Fix for #56463.
7713
7714 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7715
7716         * iterators.cs (MarkYield): track whether we are in an exception,
7717         and generate code accordingly.  Use a temporary value to store the
7718         result for our state.
7719
7720         I had ignored a bit the interaction of try/catch with iterators
7721         since their behavior was not entirely obvious, but now it is
7722         possible to verify that our behavior is the same as MS .NET 2.0
7723
7724         Fixes 54814
7725
7726 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7727
7728         * iterators.cs: Avoid creating temporaries if there is no work to
7729         do. 
7730
7731         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7732         Enumerations, use TypeManager.EnumToUnderlying and call
7733         recursively. 
7734
7735         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7736         bug #57013
7737
7738         (This.Emit): Use EmitContext.EmitThis to emit our
7739         instance variable.
7740
7741         (This.EmitAssign): Ditto.
7742
7743         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7744         codepaths, we will move all the functionality into
7745         Mono.CSharp.This 
7746
7747         (FieldExpr.EmitAssign): Ditto.
7748
7749         This fixes several hidden bugs that I uncovered while doing a code
7750         review of this today.
7751
7752         * codegen.cs (EmitThis): reworked so the semantics are more clear
7753         and also support value types "this" instances.
7754
7755         * iterators.cs: Changed so that for iterators in value types, we
7756         do not pass the value type as a parameter.  
7757
7758         Initialization of the enumerator helpers is now done in the caller
7759         instead of passing the parameters to the constructors and having
7760         the constructor set the fields.
7761
7762         The fields have now `assembly' visibility instead of private.
7763
7764 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7765
7766         * expression.cs (Argument.Resolve): Check if fields passed as ref
7767         or out are contained in a MarshalByRefObject.
7768
7769         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7770         another compiler type.
7771
7772 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7773
7774         * class.cs (Indexer.Define): use the new name checking method.
7775         Also, return false on an error.
7776         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7777         (is_identifier_[start/part]_character): make static.
7778
7779 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7780
7781         * expression.cs (Binary.ResolveOperator): Do no append strings
7782         twice: since we can be invoked more than once (array evaluation)
7783         on the same concatenation, take care of this here.  Based on a fix
7784         from Ben (bug #56454)
7785
7786 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7787
7788         * codegen.cs: Fix another case where CS1548 must be reported (when 
7789         delay-sign isn't specified and no private is available #56564). Fix
7790         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7791         error when MCS is used on the MS runtime and we need to delay-sign 
7792         (which seems unsupported by AssemblyBuilder - see #56621).
7793
7794 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7795
7796         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7797         (TypeManager.ComputeNamespaces): Faster implementation for
7798         Microsoft runtime.
7799
7800         * compiler.csproj: Updated AssemblyName to mcs.
7801
7802 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7803
7804         * rootcontext.cs: Add new types to the boot resolution.
7805
7806         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7807         MulticastDelegate is not allowed.
7808
7809         * typemanager.cs: Add new types to lookup: System.TypedReference
7810         and ArgIterator.
7811
7812         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7813         check for TypedReference or ArgIterator, they are not allowed. 
7814
7815         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7816         makes us properly catch 1510 in some conditions (see bug 56016 for
7817         details). 
7818
7819 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7820
7821         * CryptoConvert.cs: update from corlib version
7822         with endian fixes.
7823
7824 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7825
7826         * class.cs (Indexer.Define): Check indexername declaration
7827
7828 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7829
7830         * attribute.cs (IsClsCompliant): Fixed problem with handling
7831         all three states (compliant, not-compliant, undetected).
7832
7833 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7834
7835         * attribute.cs (Attribute): Location is now public.
7836         (Resolve): Store resolved arguments (pos_values) in attribute class.
7837         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7838         (GetClsCompliantAttributeValue): New method that gets
7839         CLSCompliantAttribute value.
7840         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7841         if exists else null.
7842         (AttributeTester): New class for CLS-Compliant verification routines.
7843
7844         * class.cs (Emit): Add CLS-Compliant verification.
7845         (Method.GetSignatureForError): Implemented.
7846         (Constructor.GetSignatureForError): Implemented
7847         (Constructor.HasCompliantArgs): Returns if constructor has
7848         CLS-Compliant arguments.
7849         (Constructor.Emit): Override.
7850         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7851         is needed to test only parameters.
7852         (FieldBase.GetSignatureForError): Implemented.
7853         (TypeContainer): New member for storing base interfaces.
7854         (TypeContainer.FindMembers): Search in base interfaces too.
7855
7856         * codegen.cs (GetClsComplianceAttribute): New method that gets
7857         assembly or module CLSCompliantAttribute value.
7858         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7859         for assembly.
7860         (ModuleClass.Emit): Add error 3012 test.
7861
7862         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7863
7864         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7865         state for all decl types.
7866         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7867         if CLS-Compliant tests are required.
7868         (IsClsCompliaceRequired): New method. Analyze whether code
7869         must be CLS-Compliant.
7870         (IsExposedFromAssembly): New method. Returns true when MemberCore
7871         is exposed from assembly.
7872         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7873         value or gets cached value.
7874         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7875         is explicitly marked with CLSCompliantAttribute.
7876         (IsIdentifierClsCompliant): New abstract method. This method is
7877         used to testing error 3005.
7878         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7879         for identifier and parameters CLS-Compliant testing.
7880         (VerifyClsCompliance): New method. The main virtual method for
7881         CLS-Compliant verifications.
7882         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7883         null. I don't know why is null (too many public members !).
7884         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7885         and get value of first CLSCompliantAttribute that found.
7886
7887         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7888         (VerifyClsCompliance): Override and add extra tests.
7889
7890         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7891         clscheck- disable CLS-Compliant verification event if assembly is has
7892         CLSCompliantAttribute(true).
7893
7894         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7895         ApllyAttribute is now called in emit section as in the other cases.
7896         Possible future Emit integration.
7897         (IsIdentifierClsCompliant): New override.
7898         (VerifyClsCompliance): New override.
7899         (GetEnumeratorName): Returns full enum name.
7900
7901         * parameter.cs (GetSignatureForError): Implemented.
7902
7903         * report.cs (WarningData): New struct for Warning message information.
7904         (LocationOfPreviousError): New method.
7905         (Warning): New method. Reports warning based on the warning table.
7906         (Error_T): New method. Reports error based on the error table.
7907
7908         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7909         verifications are done here.
7910
7911         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7912
7913         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7914         CLSCompliantAttribute.
7915         (all_imported_types): New member holds all imported types from other
7916         assemblies.
7917         (LoadAllImportedTypes): New method fills static table with exported types
7918         from all referenced assemblies.
7919         (Modules): New property returns all assembly modules.
7920
7921 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7922
7923         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7924         throwing a parser error.
7925
7926         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7927         which removes the hardcoded get_/set_ prefixes for properties, as
7928         IL allows for the properties to be named something else.  
7929
7930         Bug #56013
7931
7932         * expression.cs: Do not override operand before we know if it is
7933         non-null.  Fix 56207
7934
7935 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7936
7937         * typemanager.cs: support for pinned variables.
7938
7939 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7940
7941         * decl.cs, typemanager.cs: Avoid using an arraylist
7942         as a buffer if there is only one result set.
7943
7944 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7945
7946         * expression.cs: Make sure you cant call a static method
7947         with an instance expression, bug #56174.
7948
7949 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7950
7951         * class.cs (IsDuplicateImplementation): Improve error reporting to
7952         flag 663 (method only differs in parameter modifier).
7953
7954         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7955         in preprocessor directives.
7956
7957         * location.cs (LookupFile): Allow for the empty path.
7958
7959         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7960         better approach for some of that patch, but its failing with the
7961         CharSet enumeration.  For now try/catch will do.
7962
7963         * typemanager.cs: Do not crash if a struct does not have fields.
7964         Fixes 56150.
7965
7966 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7967
7968         * expression.cs: cs0213, cant fix a fixed expression.
7969         fixes 50231.
7970
7971 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7972
7973         * cs-parser.jay: detect invalid embeded statements gracefully.
7974         bug #51113.
7975
7976 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7977
7978         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7979         As a regex:
7980         s/
7981         the invocation type may not be a subclass of the tye of the item/
7982         The type of the item must be a subclass of the invocation item.
7983         /g
7984
7985         Fixes bug #50820.
7986
7987 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7988
7989         * attribute.cs: Added methods to get a string and a bool from an
7990         attribute. Required to information from AssemblyKeyFileAttribute,
7991         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7992         * codegen.cs: Modified AssemblyName creation to include support for
7993         strongnames. Catch additional exceptions to report them as CS1548.
7994         * compiler.csproj: Updated include CryptoConvert.cs.
7995         * compiler.csproj.user: Removed file - user specific configuration.
7996         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7997         Mono.Security assembly. The original class is maintained and tested in
7998         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7999         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8000         like CSC 8.0 (C# v2) supports.
8001         * Makefile: Added CryptoConvert.cs to mcs sources.
8002         * rootcontext.cs: Added new options for strongnames.
8003
8004 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8005
8006         * driver.cs: For --expect-error, report error code `2'
8007         if the program compiled with no errors, error code `1' if
8008         it compiled with an error other than the one expected.
8009
8010 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8011
8012         * compiler.csproj: Updated for Visual Studio .NET 2003.
8013         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8014         * compiler.sln: Updated for Visual Studio .NET 2003.
8015
8016 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8017
8018         * expression.cs: Fix bug #47234. We basically need to apply the
8019         rule that we prefer the conversion of null to a reference type
8020         when faced with a conversion to 'object' (csc behaviour).
8021
8022 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8023
8024         * statement.cs: Shorter form for foreach, eliminates
8025         a local variable. r=Martin.
8026
8027 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8028
8029         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8030         checks if we can use brtrue/brfalse to test for 0.
8031         * expression.cs: use the above in the test for using brtrue/brfalse.
8032         cleanup code a bit.
8033
8034 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8035
8036         * expression.cs: Rewrite string concat stuff. Benefits:
8037
8038         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8039         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8040         rather than a concat chain.
8041
8042         * typemanager.cs: Add lookups for more concat overloads.
8043
8044 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8045
8046         * expression.cs: Emit shorter il code for array init.
8047
8048         newarr
8049         dup
8050         // set 1
8051
8052         // set 2
8053
8054         newarr
8055         stloc.x
8056
8057         ldloc.x
8058         // set 1
8059
8060         ldloc.x
8061         // set 2
8062
8063 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8064
8065         * statement.cs: Before, two switch blocks would be merged if the
8066         total size of the blocks (end_item - begin_item + 1) was less than
8067         two times the combined sizes of the blocks.
8068
8069         Now, it will only merge if after the merge at least half of the
8070         slots are filled.
8071
8072         fixes 55885.
8073
8074 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8075
8076         * class.cs : csc build fix for GetMethods(). See bug #52503.
8077
8078 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8079
8080         * expression.cs: Make sure fp comparisons work with NaN.
8081         This fixes bug #54303. Mig approved this patch a long
8082         time ago, but we were not able to test b/c the runtime
8083         had a related bug.
8084
8085 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8086
8087         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8088
8089 2004-03-19  Martin Baulig  <martin@ximian.com>
8090
8091         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8092         error here and not in our caller.
8093
8094 2004-03-19  Martin Baulig  <martin@ximian.com>
8095
8096         * interface.cs: Completely killed this file.
8097         (Interface): We're now a TypeContainer and live in class.cs.
8098
8099         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8100         argument; we're now also called for interfaces.
8101         (TypeContainer.DefineMembers): Allow this method being called
8102         multiple times.
8103         (TypeContainer.GetMethods): New public method; formerly known as
8104         Interface.GetMethod().  This is used by PendingImplementation.
8105         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8106         it's now private and non-static.
8107         (Interface): Moved this here; it's now implemented similar to
8108         Class and Struct.
8109         (Method, Property, Event, Indexer): Added `bool is_interface'
8110         argument to their .ctor's.
8111         (MemberBase.IsInterface): New public field.
8112
8113         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8114         instances instead of InterfaceMethod, InterfaceProperty, etc.
8115         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8116         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8117
8118 2004-03-19  Martin Baulig  <martin@ximian.com>
8119
8120         * class.cs (MethodCore.IsDuplicateImplementation): New private
8121         method which does the CS0111 checking.
8122         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8123         Use IsDuplicateImplementation().
8124
8125 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8126
8127         * decl.cs (FindMemberToOverride): New method to find the correct
8128         method or property to override in the base class.
8129         * class.cs
8130             - Make Method/Property use the above method to find the
8131               version in the base class.
8132             - Remove the InheritableMemberSignatureCompare as it is now
8133               dead code.
8134
8135         This patch makes large code bases much faster to compile, as it is
8136         O(n) rather than O(n^2) to do this validation.
8137
8138         Also, it fixes bug 52458 which is that nested classes are not
8139         taken into account when finding the base class member.
8140
8141         Reviewed/Approved by Martin.
8142
8143 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8144
8145         * interface.cs: In all interface classes removed redundant
8146         member initialization.
8147
8148 2004-03-16  Martin Baulig  <martin@ximian.com>
8149
8150         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8151
8152 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8153
8154         * decl.cs (DefineTypeAndParents): New helper method to define a
8155         type's containers before the type itself is defined;  This is a
8156         bug exposed by the recent changes to Windows.Forms when an
8157         implemented interface was defined inside a class that had not been
8158         built yet.   
8159
8160         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8161
8162         (Check): Loop correctly to report errors modifiers
8163         (UNSAFE was not in the loop, since it was the same as TOP).
8164
8165         * interface.cs: Every interface member now takes a ModFlags,
8166         instead of a "is_new" bool, which we set on the base MemberCore. 
8167
8168         Every place where we called "UnsafeOk" in the interface, now we
8169         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8170         the unsafe settings from the member declaration instead of the
8171         container interface. 
8172
8173         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8174
8175         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8176         `set_indexer_name' to the pending bits (one per type).
8177
8178         We fixed a bug today that was picking the wrong method to
8179         override, since for properties the existing InterfaceMethod code
8180         basically ignored the method name.  Now we make sure that the
8181         method name is one of the valid indexer names.
8182
8183 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8184  
8185         * support.cs (SeekableStreamReader): Keep track of stream byte
8186         positions and don't mix them with character offsets to the buffer.
8187
8188         Patch from Gustavo Giráldez
8189
8190 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8191
8192         * interface.cs (InterfaceSetGetBase): Removed double member
8193         initialization, base class does it as well.
8194
8195 2004-03-13  Martin Baulig  <martin@ximian.com>
8196
8197         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8198         when compiling corlib.
8199
8200 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8201
8202         * convert.cs (ExplicitConversion): We were reporting an error on
8203         certain conversions (object_type source to a value type, when the
8204         expression was `null') before we had a chance to pass it through
8205         the user defined conversions.
8206
8207         * driver.cs: Replace / and \ in resource specifications to dots.
8208         Fixes 50752
8209
8210         * class.cs: Add check for duplicate operators.  Fixes 52477
8211
8212 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8213
8214         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8215         that are in the middle of the statements, not only at the end.
8216         Fixes #54987
8217
8218         * class.cs (TypeContainer.AddField): No longer set the
8219         `HaveStaticConstructor' flag, now we call it
8220         `UserDefineStaticConstructor' to diferentiate the slightly
8221         semantic difference.
8222
8223         The situation is that we were not adding BeforeFieldInit (from
8224         Modifiers.TypeAttr) to classes that could have it.
8225         BeforeFieldInit should be set to classes that have no static
8226         constructor. 
8227
8228         See:
8229
8230         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8231
8232         And most importantly Zoltan's comment:
8233
8234         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8235
8236         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8237          before its static fields are used', i.e. initialization does not need
8238          to be triggered by the first access to the type. Setting this flag
8239          helps the JIT to compile better code, since it can run the static
8240          constructor at JIT time, and does not need to generate code to call it
8241          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8242          this flag for lots of classes like String. 
8243          
8244          csc sets this flag if the type does not have an explicit static 
8245          constructor. The reasoning seems to be that if there are only static
8246          initalizers for a type, and no static constructor, then the programmer
8247          does not care when this initialization happens, so beforefieldinit
8248          can be used.
8249          
8250          This bug prevents the AOT compiler from being usable, since it 
8251          generates so many calls to mono_runtime_class_init that the AOT code
8252          is much slower than the JITted code. The JITted code is faster, 
8253          because it does not generate these calls if the vtable is type is
8254          already initialized, which is true in the majority of cases. But the
8255          AOT compiler can't do this."
8256
8257 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8258
8259         * class.cs (MethodData.Emit): Refactor the code so symbolic
8260         information is generated for destructors;  For some reasons we
8261         were taking a code path that did not generate symbolic information
8262         before. 
8263
8264 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8265
8266         * class.cs: Create a Constructor.CheckBase method that
8267         takes care of all validation type code. The method
8268         contains some code that was moved from Define.
8269
8270         It also includes new code that checks for duplicate ctors.
8271         This fixes bug #55148.
8272
8273 2004-03-09  Joshua Tauberer <tauberer@for.net>
8274
8275         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8276         a { ... }-style array creation invokes EmitStaticInitializers
8277         which is not good for reference-type arrays.  String, decimal
8278         and now null constants (NullCast) are not counted toward
8279         static initializers.
8280
8281 2004-03-05  Martin Baulig  <martin@ximian.com>
8282
8283         * location.cs (SourceFile.HasLineDirective): New public field;
8284         specifies whether the file contains or is referenced by a "#line"
8285         directive.
8286         (Location.DefineSymbolDocuments): Ignore source files which
8287         either contain or are referenced by a "#line" directive.        
8288
8289 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8290
8291         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8292         direct access to our parent, so check the method inline there.
8293
8294 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8295
8296         * expression.cs (Invocation.EmitCall): Miguel's last commit
8297         caused a regression. If you had:
8298
8299             T t = null;
8300             t.Foo ();
8301
8302         In Foo the implict this would be null.
8303
8304 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8305
8306         * expression.cs (Invocation.EmitCall): If the method is not
8307         virtual, do not emit a CallVirt to it, use Call.
8308
8309         * typemanager.cs (GetFullNameSignature): Improve the method to
8310         cope with ".ctor" and replace it with the type name.
8311
8312         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8313         as an argument the ConstructorBuilder where it is being defined,
8314         to catch the recursive constructor invocations.
8315
8316 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8317
8318         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8319         routines to check if a type is an enumerable/enumerator allow
8320         classes that implement the IEnumerable or IEnumerator interfaces.
8321
8322         * class.cs (Property, Operator): Implement IIteratorContainer, and
8323         implement SetYields.
8324
8325         (Property.Define): Do the block swapping for get_methods in the
8326         context of iterators.   We need to check if Properties also
8327         include indexers or not.
8328
8329         (Operator): Assign the Block before invoking the
8330         OperatorMethod.Define, so we can trigger the Iterator code
8331         replacement. 
8332
8333         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8334         Property and Operator classes are not created when we parse the
8335         declarator but until we have the block completed, so we use a
8336         singleton SimpleIteratorContainer.Simple to flag whether the
8337         SetYields has been invoked.
8338
8339         We propagate this setting then to the Property or the Operator to
8340         allow the `yield' to function.
8341
8342 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8343
8344         * codegen.cs: Implemented attribute support for modules.
8345         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8346         Assembly/Module functionality.
8347
8348         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8349         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8350         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8351
8352 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8353
8354         * interface.cs (FindMembers): The operation is performed on all base
8355         interfaces and not only on the first. It is required for future CLS Compliance patch.
8356
8357 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8358
8359         * statement.cs, codegen.cs:
8360         This patch deals with patterns such as:
8361
8362         public class List : IEnumerable {
8363
8364                 public MyEnumerator GetEnumerator () {
8365                         return new MyEnumerator(this);
8366                 }
8367
8368                 IEnumerator IEnumerable.GetEnumerator () {
8369                         ...
8370                 }
8371                 
8372                 public struct MyEnumerator : IEnumerator {
8373                         ...
8374                 }
8375         }
8376
8377         Before, there were a few things we did wrong:
8378         1) we would emit callvirt on a struct, which is illegal
8379         2) we emited ldarg when we needed to emit ldarga
8380         3) we would mistakenly call the interface methods on an enumerator
8381         type that derived from IEnumerator and was in another assembly. For example:
8382
8383         public class MyEnumerator : IEnumerator
8384
8385         Would have the interface methods called, even if there were public impls of the
8386         method. In a struct, this lead to invalid IL code.
8387
8388 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8389
8390         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8391           renamed to Emit.
8392
8393         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8394
8395 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8396
8397         * cs-parser.jay: Fix small regression: we were not testing V2
8398         compiler features correctly.
8399
8400         * interface.cs: If the emit context is null, then create one
8401
8402 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8403
8404         * decl.cs (GetSignatureForError): New virtual method to get full name
8405           for error messages.
8406
8407         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8408           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8409
8410         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8411           Duplicated members and code in these classes has been removed.
8412           Better encapsulation in these classes.
8413
8414 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8415
8416         * assign.cs (Assign.DoResolve): When dealing with compound
8417         assignments, there is a new rule in ECMA C# 2.4 (might have been
8418         there before, but it is documented here) that states that in:
8419
8420         a op= b;
8421
8422         If b is of type int, and the `op' is a shift-operator, then the
8423         above is evaluated as:
8424
8425         a = (int) a op b 
8426
8427         * expression.cs (Binary.ResolveOperator): Instead of testing for
8428         int/uint/long/ulong, try to implicitly convert to any of those
8429         types and use that in pointer arithmetic.
8430
8431         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8432         method to print information for from the type, not from the
8433         null-method we were given.
8434
8435 2004-02-01  Duncan Mak  <duncan@ximian.com>
8436
8437         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8438         parsing for cmd, fixes bug #53694.
8439
8440 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8441
8442         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8443         in the member name duplication tests. Property and operator name duplication
8444         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8445
8446 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8447
8448         * interface.cs (PopulateMethod): Fixed crash when interface method
8449         returns not existing type (error test cs0246-3.cs).
8450
8451 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8452
8453         * cs-parser.jay (interface_accessors): Re-write actions to also
8454         store attributes attached to get and set methods. Fix spelling
8455         while at it.
8456
8457         (inteface_property_declaration): Modify accordingly.
8458
8459         (InterfaceAccessorInfo): New helper class to store information to pass
8460         around between rules that use interface_accessors.
8461
8462         * interface.cs (Emit): Apply attributes on the get and set
8463         accessors of properties and indexers too.
8464
8465         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8466         right MethodBuilder when applying attributes to the get and set accessors.
8467
8468 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8469
8470         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8471
8472 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8473
8474         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8475
8476 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8477
8478         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8479         changes that treat `yield' specially when present before `break'
8480         or `return' tokens.
8481
8482         * cs-tokenizer.cs: yield is no longer a keyword.
8483
8484 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8485
8486         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8487         setting for default constructors.
8488         For default constructors are almost every time set wrong Modifier. The
8489         generated IL code has been alright. But inside mcs this values was
8490         wrong and this was reason why several of my CLS Compliance tests
8491         failed.
8492
8493 2004-01-22  Martin Baulig  <martin@ximian.com>
8494
8495         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8496         not a QualifiedIdentifier.  This is what `type_name_expression'
8497         was previously doing.
8498         (type_name_expression): Removed; the code is now in
8499         `namespace_or_type_name'.
8500         (qualified_identifier): Removed, use `namespace_or_type_name'
8501         instead.
8502         (QualifiedIdentifier): Removed this class.      
8503
8504 2004-01-22  Martin Baulig  <martin@ximian.com>
8505
8506         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8507         not a string as alias name.
8508
8509 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8510
8511         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8512         #52730 bug, and instead compute correctly the need to use a
8513         temporary variable when requesting an address based on the
8514         static/instace modified of the field and the constructor.
8515  
8516 2004-01-21  Martin Baulig  <martin@ximian.com>
8517
8518         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8519         class and namespace before looking up aliases.  Fixes #52517.
8520
8521 2004-01-21  Martin Baulig  <martin@ximian.com>
8522
8523         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8524         assinged in a 'try'; fixes exception4.cs.
8525
8526 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8527         * class.cs : Implemented parameter-less constructor for TypeContainer
8528
8529         * decl.cs: Attributes are now stored here. New property OptAttributes
8530
8531         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8532
8533         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8534
8535 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8536
8537         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8538           (CSharpSignature): New method for indexer and property signature.
8539
8540 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8541
8542         * pending.cs (IsVirtualFilter): Faster implementation.
8543
8544 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8545
8546         * typemanager.cs: Avoid inclusion of same assembly more than once.
8547
8548 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8549
8550         * cs-parser.jay: Fixed problem where the last assembly attribute
8551           has been applied also to following declaration (class, struct, etc.)
8552           
8553 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8554
8555         * class.cs: Added error CS0538, CS0539 reporting.
8556         Fixed crash on Microsoft runtime when field type is void.
8557
8558         * cs-parser.jay: Added error CS0537 reporting.
8559
8560         * pending.cs: Added error CS0535 reporting.
8561         Improved error report for errors CS0536, CS0534.
8562
8563 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8564
8565         Merge a few bits from the Anonymous Method MCS tree.
8566
8567         * statement.cs (ToplevelBlock): New class for toplevel methods,
8568         will hold anonymous methods, lifted variables.
8569
8570         * cs-parser.jay: Create toplevel blocks for delegates and for
8571         regular blocks of code. 
8572
8573 2004-01-20  Martin Baulig  <martin@ximian.com>
8574
8575         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8576         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8577         and `NeedExplicitReturn'; added `IsLastStatement'.
8578         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8579         have a `ReturnLabel' or we're not unreachable.
8580
8581         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8582         child's reachability; don't just override ours with it.  Fixes
8583         #58058 (lluis's example).
8584         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8585         InFinally(), InLoop(), InSwitch() and
8586         BreakCrossesTryCatchBoundary() methods.
8587
8588         * statement.cs (Return): Do all error checking in Resolve().
8589         Unless we are the last statement in a top-level block, always
8590         create a return label and jump to it.
8591         (Break, Continue): Do all error checking in Resolve(); also make
8592         sure we aren't leaving a `finally'.
8593         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8594         statement in a top-level block.
8595         (Block.Flags): Added `IsDestructor'.
8596         (Block.IsDestructor): New public property.
8597
8598 2004-01-20  Martin Baulig  <martin@ximian.com>
8599
8600         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8601
8602 2004-01-20  Martin Baulig  <martin@ximian.com>
8603
8604         * statement.cs (Statement.ResolveUnreachable): New public method.
8605         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8606         (Block.Resolve): Resolve unreachable statements.
8607
8608 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8609
8610         * expression.cs: We need to fix the case where we do
8611         not have a temp variable here.
8612
8613         * assign.cs: Only expression compound assignments need
8614         temporary variables.
8615
8616 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8617
8618         * flowanalysis.cs: Reduce memory allocation in a few ways:
8619           - A block with no variables should not allocate a bit
8620             vector for itself.
8621           - A method with no out parameters does not need any tracking
8622             for assignment of the parameters, so we need not allocate
8623             any data for it.
8624           - The arrays:
8625                 public readonly Type[] VariableTypes;
8626                 public readonly string[] VariableNames;
8627             Are redundant. The data is already stored in the variable
8628             map, so we need not allocate another array for it.
8629           - We need to add alot of checks for if (params | locals) == null
8630             due to the first two changes.
8631
8632 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8633
8634         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8635         implement IMemoryLocation, we store a copy on a local variable and
8636         take the address of it.  Patch from Benjamin Jemlich
8637
8638         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8639         to use a special "type_name_expression" rule which reduces the
8640         number of "QualifiedIdentifier" classes created, and instead
8641         directly creates MemberAccess expressions.
8642
8643 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8644
8645         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8646         that fixes #52853.  Null literal assignment to ValueType
8647
8648         * class.cs (MethodData.Emit): Instead of checking the name of the
8649         method to determine if its a destructor, create a new derived
8650         class from Method called Destructor, and test for that.  
8651
8652         * cs-parser.jay: Create a Destructor object instead of a Method.  
8653
8654         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8655
8656         Fixes: 52933
8657
8658 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8659
8660         * expression.cs (Binary.ResolveOperator): Perform an implicit
8661         conversion from MethodGroups to their delegate types on the
8662         Addition operation.
8663
8664         * delegate.cs: Introduce a new class DelegateCreation that is the
8665         base class for `NewDelegate' and `ImplicitDelegateCreation',
8666         factor some code in here.
8667
8668         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8669         conversion from MethodGroups to compatible delegate types. 
8670
8671         * ecore.cs (Expression.Resolve): Do not flag error 654
8672         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8673         we allow conversions from MethodGroups to delegate types now.
8674
8675         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8676         assignments in v2 either.
8677
8678 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8679
8680         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8681         static read-only fields in ctors.
8682
8683         Applied patch from Benjamin Jemlich 
8684
8685         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8686
8687 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8688
8689         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8690         here to return true, as they can be used like this:
8691
8692                 (XXX) int.MEMBER ()
8693
8694         Fixed 49836 and all the other dups
8695
8696 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8697
8698         * driver.cs: Implement /win32res and /win32icon.
8699
8700 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8701
8702         * cs-parser.jay: Add a rule to improve error handling for the
8703         common mistake of placing modifiers after the type.
8704
8705 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8706
8707         * cs-parser.jay (interface_event_declaration): Catch
8708         initialization of events on interfaces, and report cs0068
8709
8710         * cs-parser.jay (interface_event_declaration): Catch
8711         initialization of events. 
8712
8713         * ecore.cs: Better report missing constructors.
8714
8715         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8716         the error reporting done in the wrong place.  Fix.
8717
8718         * expression.cs (Binary.ResolveOperator): Catch the 
8719         operator + (E x, E y) error earlier, and later allow for implicit
8720         conversions in operator +/- (E e, U x) from U to the underlying
8721         type of E.
8722
8723         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8724         52596, if the container class is abstract, the default constructor
8725         is protected otherwise its public (before, we were always public).
8726
8727         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8728         fixed statement.
8729
8730         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8731         Jemlich that fixes bug #52597, MCS was generating invalid code for
8732         idisposable structs.   Thanks to Ben for following up with this
8733         bug as well.
8734
8735 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8736
8737         * driver.cs: Allow assemblies without code to be generated, fixes
8738         52230.
8739
8740 2004-01-07  Nick Drochak <ndrochak@gol.com>
8741
8742         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8743
8744 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8745
8746         * cs-parser.jay: Add rules to improve error reporting if fields or
8747         methods are declared at the namespace level (error 116)
8748
8749         * Add rules to catch event add/remove
8750
8751 2004-01-04  David Sheldon <dave-mono@earth.li>
8752
8753   * expression.cs: Added matching ")" to error message for 
8754   CS0077
8755
8756 2004-01-03 Todd Berman <tberman@gentoo.org>
8757
8758         * ecore.cs, attribute.cs:
8759         Applying fix from #52429.
8760
8761 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8762
8763         * ecore.cs, expression.cs, statement.cs:
8764         Total rewrite of how we handle branching. We
8765         now handle complex boolean expressions with fewer
8766         jumps. As well if (x == 0) no longer emits a ceq.
8767
8768         if (x is Foo) is much faster now, because we generate
8769         better code.
8770
8771         Overall, we get a pretty big improvement on our benchmark
8772         tests. The code we generate is smaller and more readable.
8773
8774         I did a full two-stage bootstrap. The patch was reviewed
8775         by Martin and Miguel.
8776
8777 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8778
8779         * cs-parser.jay: Make primary_expression not take a QI.
8780         we dont need this because the member_access rule covers
8781         us here. So we replace the rule with just IDENTIFIER.
8782
8783         This has two good effects. First, we remove a s/r conflict.
8784         Second, we allocate many fewer QualifiedIdentifier objects.
8785
8786 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8787
8788         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8789         set the correct information via SRE. This prevents
8790         hanging on the MS runtime. Fixes #29374.
8791
8792 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8793
8794         * convert.cs: correctly handle conversions to value types
8795         from Enum and ValueType as unboxing conversions.
8796
8797         Fixes bug #52569. Patch by Benjamin Jemlich.
8798
8799 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8800
8801         * expression.cs (BetterConversion): Prefer int -> uint
8802         over int -> ulong (csc's behaviour). This fixed bug #52046.
8803
8804 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8805
8806         * decl.cs (MemberCache.FindMembers): now returns a
8807         MemberInfo [].
8808
8809         * typemanager.cs: In general, go with with ^^.
8810         (CopyNewMethods): take an IList.
8811         (RealMemberLookup): Only allocate an arraylist
8812         if we copy from two sets of methods.
8813
8814         This change basically does two things:
8815         1) Fewer array lists allocated due to CopyNewMethods.
8816         2) the explicit cast in MemberList costed ALOT.
8817
8818 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8819
8820         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8821         a hashtable to avoid needless string allocations when an identifier is
8822         used more than once (the common case).
8823
8824 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8825
8826         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8827         is broken, it will not return anything. So, we
8828         have to use the information we have in mcs to
8829         do the task.
8830
8831         * typemanager.cs: Add a cache for GetInterfaces,
8832         since this will now be used more often (due to ^^)
8833
8834         (GetExplicitInterfaces) New method that gets the
8835         declared, not effective, interfaces on a type
8836         builder (eg, if you have interface IFoo, interface
8837         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8838         { IBar }.
8839
8840         This patch makes MCS able to bootstrap itself on
8841         Windows again.
8842
8843 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8844
8845         * expression.cs: Remove the Nop's that Miguel put
8846         in by mistake.
8847
8848 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8849
8850         * report.cs, codegen.cs: Give the real stack trace to
8851         the error when an exception is thrown.
8852
8853 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8854
8855         * decl.cs: only allocate hashtables for ifaces if 
8856         it is an iface!
8857
8858 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8859
8860         * expression.cs: fix the error from cs0121-2.cs
8861         (a parent interface has two child interfaces that
8862         have a function with the same name and 0 params
8863         and the function is called through the parent).
8864
8865 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8866
8867         * class.cs, rootcontext.cs, typmanager.cs: do not
8868         leak pointers.
8869
8870 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8871
8872         * codegen.cs: remove stack for the ec flow branching.
8873         It is already a linked list, so no need.
8874
8875 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8876
8877         * Makefile: Allow custom profiler here.
8878
8879 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8880
8881         * typemanager.cs (LookupType):
8882           - Use a static char [], because split takes
8883             a param array for args, so it was allocating
8884             every time.
8885           - Do not store true in a hashtable, it boxes.
8886
8887 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8888
8889         * flowanalysis.cs: bytify common enums.
8890
8891 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8892
8893         * modifiers.cs: Add a new set of flags for the
8894         flags allowed on explicit interface impls.
8895         * cs-parser.jay: catch the use of modifiers in
8896         interfaces correctly.
8897         * class.cs: catch private void IFoo.Blah ().
8898
8899         All related to bug #50572.
8900
8901 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8902
8903         * decl.cs: Rewrite the consistant accessability checking.
8904         Accessability is not linear, it must be implemented in
8905         a tableish way. Fixes #49704.
8906
8907 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8908
8909         * expression.cs: Handle negation in a checked context.
8910         We must use subtraction from zero. Fixes #38674.
8911
8912 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8913
8914         * class.cs: Ignore static void main in DLLs.
8915         * rootcontext.cs: Handle the target type here,
8916         since we are have to access it from class.cs
8917         * driver.cs: account for the above.
8918
8919 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8920
8921         * report.cs: Give line numbers and files if available.
8922
8923 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8924
8925         * driver.cs: Implement /addmodule.
8926
8927         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8928         ModuleBuilders.
8929
8930 2003-12-20  Martin Baulig  <martin@ximian.com>
8931
8932         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8933         (FieldBase.IsAssigned): Removed this field.
8934         (FieldBase.SetAssigned): New public method.
8935         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8936
8937 2003-12-20  Martin Baulig  <martin@ximian.com>
8938
8939         * expression.cs (LocalVariableReference.DoResolve): Don't set
8940         `vi.Used' if we're called from DoResolveLValue().
8941
8942         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8943         returns the usage vector it just merged into the current one -
8944         pass this one to UsageWarning().
8945         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8946         of the `EmitContext', don't call this recursively on our children.
8947
8948 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8949
8950         * driver.cs: Implement /target:module.
8951
8952 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8953
8954         * support.cs (CharArrayHashtable): New helper class.
8955
8956         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8957         char arrays, not strings, so we can avoid creating a string in
8958         consume_identifier if the identifier is a keyword.
8959
8960 2003-12-16  Martin Baulig  <martin@ximian.com>
8961
8962         * statement.cs (LocalInfo.Assigned): Removed this property.
8963         (LocalInfo.Flags): Removed `Assigned'.
8964         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8965         and uses flow analysis.
8966         (Block.UsageWarning): Made this method private.
8967         (Block.Resolve): Call UsageWarning() if appropriate.
8968
8969         * expression.cs (LocalVariableReference.DoResolve): Always set
8970         LocalInfo.Used here.
8971
8972 2003-12-13  Martin Baulig  <martin@ximian.com>
8973
8974         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8975         any value here; we're now using flow analysis to figure out
8976         whether a statement/block returns a value.
8977
8978 2003-12-13  Martin Baulig  <martin@ximian.com>
8979
8980         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8981         working again.
8982         (FlowBranching.MergeFinally): Don't call
8983         `branching.CheckOutParameters()' here, this is called in
8984         MergeTopBlock().
8985         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8986         when adding the `finally' vector.       
8987
8988 2003-12-13  Martin Baulig  <martin@ximian.com>
8989
8990         * flowanalysis.cs
8991         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8992         actually work and also fix #48962.
8993
8994 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8995
8996         * decl.cs: Do not check System.Object for nested types,
8997         since we know it does not have any. Big bang for buck:
8998
8999         BEFORE:
9000            Run 1:   8.35 seconds
9001            Run 2:   8.32 seconds
9002            corlib:  17.99 seconds
9003         AFTER:
9004            Run 1:   8.17 seconds
9005            Run 2:   8.17 seconds
9006            corlib:  17.39 seconds
9007
9008 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9009
9010         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9011         time we are returning 0 members, so we save alot here.
9012
9013 2003-12-11  Martin Baulig  <martin@ximian.com>
9014
9015         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9016         `MergeChild()', also just take the `FlowBranching' as argument;
9017         call Merge() on it and return the result.
9018         (FlowBranching.Merge): We don't need to do anything if we just
9019         have one sibling.
9020
9021 2003-12-11  Martin Baulig  <martin@ximian.com>
9022
9023         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9024         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9025         Maurer for this idea.
9026
9027 2003-12-11  Martin Baulig  <martin@ximian.com>
9028
9029         * flowanalysis.cs (MergeResult): This class is now gone; we now
9030         use the `UsageVector' for this.  The reason for this is that if a
9031         branching just has one sibling, we don't need to "merge" them at
9032         all - that's the next step to do.
9033         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9034         `MergeResult'.
9035
9036 2003-12-11  Martin Baulig  <martin@ximian.com>
9037
9038         Reworked flow analyis and made it more precise and bug-free.  The
9039         most important change is that we're now using a special `Reachability'
9040         class instead of having "magic" meanings of `FlowReturns'.  I'll
9041         do some more cleanups and optimizations and also add some more
9042         documentation this week.
9043
9044         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9045         largely reworked this class.
9046         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9047         the new `Reachability' class instead of having "magic" values here.
9048         (FlowBranching): We're now using an instance of `Reachability'
9049         instead of having separate `Returns', `Breaks' etc. fields.
9050
9051         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9052         based on flow analysis; ignore the return value of block.Emit ().
9053
9054 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9055
9056         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9057         if they are private.
9058
9059 2003-12-09  Martin Baulig  <martin@ximian.com>
9060
9061         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9062         call them directly on the UsageVector.
9063
9064 2003-12-09  Martin Baulig  <martin@ximian.com>
9065
9066         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9067         Changed return type from `FlowReturns' to `Reachability'.
9068
9069 2003-12-09  Martin Baulig  <martin@ximian.com>
9070
9071         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9072         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9073         `Reachable' fields with a single `Reachability' one.
9074
9075 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9076
9077         * class.cs (FindMembers): Remove foreach's.
9078
9079         Bootstrap times:
9080
9081         BEFORE
9082                 Run 1:   8.74 seconds
9083                 Run 2:   8.71 seconds
9084
9085         AFTER
9086                 Run 1:   8.64 seconds
9087                 Run 2:   8.58 seconds
9088
9089
9090 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9091
9092         * cs-parser.jay:
9093         * gen-treedump.cs:
9094         * statement.cs:
9095         This patch does a few things:
9096                 1. EmptyStatement is now a singleton, so it is never reallocated.
9097                 2. All blah is EmptyStatement constructs have been changed to
9098                    blah == EmptyStatement.Value, which is much faster and valid
9099                    now that EmptyStatement is a singleton.
9100                 3. When resolving a block, rather than allocating a new array for
9101                    the non-empty statements, empty statements are replaced with
9102                    EmptyStatement.Value
9103                 4. Some recursive functions have been made non-recursive.
9104         Mainly the performance impact is from (3), however (1) and (2) are needed for
9105         this to work. (4) does not make a big difference in normal situations, however
9106         it makes the profile look saner.
9107
9108         Bootstrap times:
9109
9110         BEFORE
9111         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9112         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9113         Total memory allocated: 56397 KB
9114
9115         AFTER
9116         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9117         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9118         Total memory allocated: 55666 KB
9119
9120 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9121
9122         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9123         than the hashtable in a hashtable version
9124
9125         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9126         we always end up concating a string. This results in a huge perf
9127         loss, because many strings have to be tracked by the GC. In this
9128         patch, we first use a hashtable that works with two keys, so that
9129         the strings do not need to be concat'ed.
9130
9131         Bootstrap times:
9132         BEFORE
9133                 Run 1:   8.74 seconds
9134                 Run 2:   8.71 seconds
9135
9136         AFTER
9137                 Run 1:   8.65 seconds
9138                 Run 2:   8.56 seconds
9139
9140 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9141
9142         * Makefile: Add a new target `do-time' that does a quick and simple
9143         profile, leaving easy to parse output.
9144
9145 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9146
9147         * codegen.cs (Init): Create the dynamic assembly with 
9148         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9149
9150 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9151
9152         * support.cs: Make the PtrHashtable use only one
9153         instance of its comparer.
9154
9155 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9156
9157         * typemanager.cs: Fix lookup of GetNamespaces.
9158
9159 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9160
9161         * expression.cs: Removed redundant line.
9162
9163         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9164         ArrayLists, use for loops with bounds.  
9165
9166         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9167         arraylist.
9168
9169         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9170         arraylists, use for loop with bounds.
9171
9172         The above three changes give us a 0.071 second performance
9173         improvement out of 3.294 seconds down to 3.223.  On my machine
9174         the above changes reduced the memory usage by 1,387 KB during
9175         compiler bootstrap.
9176
9177         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9178         QualifiedIdentifiers.  Before we created a new string through
9179         concatenation, and mostly later on, the result would be
9180         manipulated by DecomposeQI through string manipulation.
9181
9182         This reduced the compiler memory usage for bootstrapping from
9183         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9184         compile times in 0.05 seconds.
9185
9186 2003-11-28  Dick Porter  <dick@ximian.com>
9187
9188         * support.cs: Do string compares with the Invariant culture.
9189
9190         * rootcontext.cs: 
9191         * gen-treedump.cs: 
9192         * expression.cs: 
9193         * driver.cs: 
9194         * decl.cs: 
9195         * codegen.cs: 
9196         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9197         the comparison is done with the Invariant culture.
9198
9199 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9200
9201         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9202         GetEnumerator method.
9203
9204         (ProbeCollectionType): Iterate starting at the most specific type
9205         upwards looking for a GetEnumerator
9206
9207         * expression.cs: Shift count can be up to 31 for int/uint and 63
9208         for long/ulong.
9209
9210 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9211
9212         * statement.cs (Block.LookupLabel): Also look for the label on the
9213         children blocks.  Use a hash table to keep track of visited
9214         nodes. 
9215
9216         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9217         we actually did transform the other operand, otherwise fall back
9218         to the common codepath that casts to long.
9219
9220         * cs-tokenizer.cs: Use the same code pattern as the int case.
9221         Maybe I should do the parsing myself, and avoid depending on the
9222         Parse routines to get this done.
9223
9224 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9225
9226         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9227         which fixes bug 51347.  This time test it.
9228
9229         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9230         attributes for example can not tell the difference between these.
9231         The difference was only a syntax feature of the language. 
9232
9233         * attribute.cs: Apply attributes to delegates.
9234
9235         * delegate.cs: Call the apply attributes method.
9236
9237 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9238
9239         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9240         comparing 0 vs Byte.MinValue, not the value
9241
9242         (ImplicitConversionRequired): When reporting a conversion error,
9243         use error 31 to print out the constant error instead of the
9244         simpler 29.
9245
9246         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9247         which fixes bug 51347.
9248
9249 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9250
9251         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9252         which fixes the -warnaserror command line option.
9253
9254 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9255
9256         * cfold.cs (DoNumericPromotions): During constant folding of
9257         additions on UIntConstant, special case intconstants with
9258         IntConstants like we do on the expression binary operator. 
9259
9260 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9261
9262         * convert.cs (ImplicitReferenceConversion): We were missing a case
9263         (System.Enum are not value types or class types, so we need to
9264         classify them separatedly).
9265
9266         * driver.cs: We do not support error 2007.
9267
9268 2003-11-12 Jackson Harper <jackson@ximian.com>
9269
9270         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9271         system directory. Also use the full file name so users can
9272         libraries names mscorlib-o-tron.dll in a non system dir.
9273
9274 2003-11-10  Martin Baulig  <martin@ximian.com>
9275
9276         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9277         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9278         calling `ResolveType()' on them, directly assign their `Type'.
9279
9280 2003-11-08  Martin Baulig  <martin@ximian.com>
9281
9282         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9283         return value and the `out parent' parameter.
9284         (TypeContainer.DefineType): Moved the CS0644 check into
9285         GetClassBases().  Don't pass the interface types to the
9286         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9287         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9288
9289         * ecore.cs (TypeExpr.IsAttribute): New property.
9290         (TypeExpr.GetInterfaces): New method.
9291
9292         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9293         TypeExpr instead of a Type.
9294         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9295         (Interface.DefineType): Don't pass the interface types to the
9296         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9297         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9298
9299         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9300         instead of a `Type[]'.
9301         (TypeManager.RegisterBuilder): Likewise.
9302         (TypeManager.AddUserInterface): Likewise.
9303         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9304         `Type[]' and also return a `TypeExpr[]'.
9305         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9306
9307 2003-11-08  Martin Baulig  <martin@ximian.com>
9308
9309         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9310         Expression.     
9311
9312 2003-11-08  Martin Baulig  <martin@ximian.com>
9313
9314         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9315         TypeManager.ResolveExpressionTypes().
9316
9317         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9318         instead of an Expression.
9319         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9320         (TypeExpression): New public class; formerly known as `TypeExpr'.
9321
9322         * expression.cs (ComposedCast): Derive from TypeExpr.
9323
9324         * typemanager.cs (TypeManager.system_*_expr): These are now
9325         TypExpr's instead of Expression's.
9326         (TypeManager.ResolveExpressionTypes): New public static function;
9327         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9328         of them.        
9329
9330 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9331
9332         * expression.cs (New.DoResolve): Do not dereference value that
9333         might be a null return.
9334
9335         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9336         sure that the constant value has the right type.  Fixes an
9337         unreported bug, similar to 50425.
9338
9339         * const.cs (Const.LookupConstantValue): Call
9340         ImplicitStandardConversionExists before doing a conversion to
9341         avoid havng the TypeManager.ChangeType do conversions.
9342
9343         Reduced the number of casts used
9344
9345         (Const.ChangeType): New routine to enable reuse of the constant
9346         type changing code from statement.
9347
9348         * typemanager.cs (ChangeType): Move common initialization to
9349         static global variables.
9350
9351         Fixes #50425.
9352
9353         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9354         every value type to go through, even if it was void.  Fix that. 
9355
9356         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9357         character of the define, and the is_identifier_part_character for
9358         the rest of the string.
9359
9360 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9361
9362         * expression.cs (UnaryMutator.EmitCode): When I updated
9363         LocalVariableReference.DoResolve, I overdid it, and dropped an
9364         optimization done on local variable references.
9365
9366 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9367
9368         * ecore.cs: Convert the return from Ldlen into an int.
9369
9370 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9371
9372         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9373         the accessibility, this is a special case for toplevel non-public
9374         classes (internal for instance).
9375
9376 2003-10-20  Nick Drochak <ndrochak@gol.com>
9377
9378         * ecore.cs: Fix typo and build.  Needed another right paren.
9379
9380 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9381
9382         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9383         `internal' case regular and protected, but not allowing protected
9384         to be evaluated later.  Bug 49840
9385
9386 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9387
9388         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9389         to kb.Nlast, and not the kb.nFirst to isolate the switch
9390         statement.
9391
9392         Extract the underlying type, so enumerations of long/ulong are
9393         treated like long/ulong.
9394
9395 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9396
9397         * expression.cs (New): Overload the meaning of RequestedType to
9398         track the possible creation of the NewDelegate type, since
9399         DoResolve is invoked more than once for new constructors on field
9400         initialization.
9401
9402         See bugs: #48800 and #37014
9403
9404         * cs-parser.jay (declare_local_constants): Take an arraylist
9405         instead of a single constant.
9406
9407         (local_constant_declaration): It should take a
9408         constant_declarators, not a constant_declarator.  Fixes 49487
9409
9410         * convert.cs: Fix error report.
9411
9412 2003-10-13 Jackson Harper <jackson@ximian.com>
9413
9414         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9415         bug #49611
9416
9417 2003-10-09  Martin Baulig  <martin@ximian.com>
9418
9419         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9420         to the .ctor.
9421         (MethodCore.DoDefineParameters): Removed the TypeContainer
9422         argument; use the DeclSpace which was passed to the .ctor instead.
9423         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9424         TypeContainer; we only need a DeclSpace here.
9425
9426 2003-10-09  Martin Baulig  <martin@ximian.com>
9427
9428         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9429         to the .ctor.
9430         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9431         EmitContext's .ctor.    
9432
9433 2003-10-09  Martin Baulig  <martin@ximian.com>
9434
9435         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9436         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9437         AsAccessible(), moved them as well.
9438
9439         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9440
9441 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9442
9443         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9444
9445 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9446
9447         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9448         generation for >=, as spotted by Paolo, bug 48679.  
9449         Patch from David Waite.
9450
9451         * cs-tokenizer.cs: Add handling for #pragma.
9452
9453         * cs-parser.jay: Allow for both yield and yield return in the
9454         syntax.  The anti-cobolization of C# fight will go on!
9455
9456         * class.cs (TypeBuilder.DefineType): Catch error condition here
9457         (Parent.DefineType erroring out and returning null).
9458
9459         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9460         coping with enumerations variables, we were mistakenly processing
9461         them as a regular value type instead of built-in types.  Fixes the
9462         bug #48063
9463
9464         * typemanager.cs (IsBuiltinOrEnum): New method.
9465
9466 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9467
9468         * cs-parser.jay: Upgrade: yield now needs the return clause.
9469
9470 2003-09-19  Martin Baulig  <martin@ximian.com>
9471
9472         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9473         `MemberCache parent' argument.  Normally, an interface doesn't
9474         have a parent type except System.Object, but we use this in gmcs
9475         for generic type parameters.
9476
9477 2003-09-18  Martin Baulig  <martin@ximian.com>
9478
9479         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9480         on `type.IsInterface'; don't check whether the type has a parent
9481         to determine whether it's an interface.
9482
9483 2003-09-15  Martin Baulig  <martin@ximian.com>
9484
9485         * class.cs (TypeContainer.DefineType): Added an error flag to
9486         avoid reporting duplicate CS0146's ("class definition is
9487         circular.").
9488
9489         * driver.cs (Driver.MainDriver): Abort if
9490         RootContext.ResolveTree() reported any errors.
9491
9492 2003-09-07  Martin Baulig  <martin@ximian.com>
9493
9494         * report.cs (Error, Warning): Added overloaded versions which take
9495         a `params object[] args' and call String.Format().
9496
9497 2003-09-07  Martin Baulig  <martin@ximian.com>
9498
9499         * decl.cs (DeclSpace..ctor): Don't call
9500         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9501         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9502         (DeclSpace.RecordDecl): New method.
9503
9504         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9505
9506 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9507
9508         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9509         value attributes to be applied to ParameterBuilders.
9510
9511         * class.cs (MethodCore.LabelParameters): Make static and more
9512         generic so that it can be used from other places - like interface
9513         methods, for instance.
9514
9515         * interface.cs (Interface.Emit): Call LabelParameters before
9516         emitting attributes on the InterfaceMethod.
9517
9518 2003-08-26  Martin Baulig  <martin@ximian.com>
9519
9520         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9521         resolving aliases; fixes #47927.
9522
9523 2003-08-26  Martin Baulig  <martin@ximian.com>
9524
9525         * statement.cs (Using.DoResolve): This is internally emitting a
9526         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9527         do not always return.  Fixes #47681.
9528
9529 2003-08-26  Martin Baulig  <martin@ximian.com>
9530
9531         * decl.cs (MemberCore): Moved WarningNotHiding(),
9532         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9533         into MemberBase.
9534         (AdditionResult): Make this nested in DeclSpace.
9535         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9536         argument; call NamespaceEntry.Define() unless we're nested in a
9537         class or struct.
9538
9539         * namespace.cs (Namespace.DefineName): New public function.  This
9540         is called from DeclSpace's .ctor to add 
9541         (Namespace.Lookup): Include DeclSpaces in the lookup.
9542
9543         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9544
9545         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9546
9547 2003-08-25  Martin Baulig  <martin@ximian.com>
9548
9549         * convert.cs (Convert.ExplicitReferenceConversion): When
9550         converting from an interface type to a class, unbox if the target
9551         type is a struct type.  Fixes #47822.
9552
9553 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9554
9555         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9556         #47854.
9557
9558 2003-08-22  Martin Baulig  <martin@ximian.com>
9559
9560         * class.cs (TypeManager.DefineType): When defining a nested type,
9561         call DefineType() on our parent; fixes #47801.
9562
9563 2003-08-22  Martin Baulig  <martin@ximian.com>
9564
9565         * class.cs (MethodData.Define): While checking if a method is an
9566         interface implementation, improve the test a bit more to fix #47654.
9567
9568 2003-08-22  Martin Baulig  <martin@ximian.com>
9569
9570         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9571         correctly; fixes #47722.
9572
9573 2003-08-22  Martin Baulig  <martin@ximian.com>
9574
9575         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9576         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9577
9578         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9579
9580 2003-08-22  Martin Baulig  <martin@ximian.com>
9581
9582         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9583         can only be assigned in static constructors.  Fixes #47161.
9584
9585 2003-08-22  Martin Baulig  <martin@ximian.com>
9586
9587         Rewrote and improved the flow analysis code.
9588
9589         * flowbranching.cs (FlowBranching): Make this class abstract.
9590         (FlowBranching.CreateBranching): New static function to create a
9591         new flow branching.
9592         (FlowBranchingBlock, FlowBranchingException): New classes.
9593         (FlowBranching.UsageVector.Type): New public readonly field.
9594         (FlowBranching.UsageVector.Breaks): Removed the setter.
9595         (FlowBranching.UsageVector.Returns): Removed the setter.
9596         (FlowBranching.UsageVector): Added Break(), Return(),
9597         NeverReachable() and Throw() methods to modify the reachability.
9598         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9599         done by FlowBranching.Merge().
9600         (FlowBranching.UsageVector.MergeChild): New method; merges the
9601         merge result into the current vector.
9602         (FlowBranching.Merge): New abstract method to merge a branching.
9603
9604 2003-08-12  Martin Baulig  <martin@ximian.com>
9605
9606         * expression.cs (Indirection.CacheTemporaries): Create the
9607         LocalTemporary with the pointer type, not its element type.
9608
9609 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9610
9611         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9612         token was a keyword or not.
9613
9614         Add `error' options where an IDENTIFIER was expected;  Provide
9615         CheckToken and CheckIdentifierToken convenience error reporting
9616         functions. 
9617
9618         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9619
9620         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9621         NameSpaceEntry NameSpaceEntry.
9622
9623         (LookupInterfaceOrClass): Avoid creating a full qualified name
9624         from namespace and name: avoid doing lookups when we know the
9625         namespace is non-existant.   Use new Tree.LookupByNamespace which
9626         looks up DeclSpaces based on their namespace, name pair.
9627
9628         * driver.cs: Provide a new `parser verbose' to display the
9629         exception thrown during parsing.  This is turned off by default
9630         now, so the output of a failure from mcs is more graceful.
9631
9632         * namespace.cs: Track all the namespaces defined in a hashtable
9633         for quick lookup.
9634
9635         (IsNamespace): New method
9636
9637 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9638
9639         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9640         we know that we need to concatenate (full typename can never be
9641         null). 
9642
9643         * class.cs: ditto.
9644
9645         * statement.cs: Use a bitfield;  Do not initialize to null things
9646         which are done by the constructor by default.
9647
9648         * cs-parser.jay: bug fix, parameter was 4, not 3.
9649
9650         * expression.cs: Just use the property;
9651
9652         * statement.cs: No need for GetVariableInfo method.
9653
9654 2003-08-08  Martin Baulig  <martin@ximian.com>
9655
9656         * flowanalysis.cs (FlowReturns): This is now nested in the
9657         `FlowBranching' class.
9658         (MyBitVector): Moved this here from statement.cs.
9659         (FlowBranching.SiblingType): New enum type.
9660         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9661
9662 2003-08-07  Martin Baulig  <martin@ximian.com>
9663
9664         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9665         `FlowBranching' class and called `BranchingType'.
9666
9667 2003-08-07  Martin Baulig  <martin@ximian.com>
9668
9669         * flowanalysis.cs: Moved all the control flow analysis code into
9670         its own file.
9671
9672 2003-08-07  Martin Baulig  <martin@ximian.com>
9673
9674         * assign.cs (Assign.DoResolve): `target' must either be an
9675         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9676         #37319.
9677
9678 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9679
9680         * expression.cs (BinaryMethod): This kind of expression is created by the
9681         Binary class if it determines that the operator has to be handled
9682         by a method.
9683
9684         (BinaryDelegate): This kind of expression is created if we are
9685         dealing with a + or - operator on delegates.
9686
9687         (Binary): remove method, argumetns, and DelegateOperator: when
9688         dealing with methods, 
9689
9690         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9691
9692         * statement.cs (Block): use bitfields for the three extra booleans
9693         we had in use.   Remove unused topblock parameter.
9694
9695         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9696
9697         * assign.cs: Drop extra unneeded tests.
9698
9699 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9700
9701         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9702
9703         * statement.cs (Foreach): Use VariableStorage instead of
9704         LocalBuilders.   
9705
9706         * codegen.cs (VariableStorage): New class used by clients that
9707         require a variable stored: locals or fields for variables that
9708         need to live across yield.
9709
9710         Maybe provide a convenience api for EmitThis+EmitLoad?
9711
9712         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9713         these bad boys.
9714
9715 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9716
9717         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9718         RemapParameterLValue): New methods that are used to turn a
9719         precomputed FieldInfo into an expression like this:
9720
9721                 instance.FieldInfo
9722
9723         The idea is to use this instead of making LocalVariableReference
9724         have more than one meaning.
9725
9726         * cs-parser.jay: Add error production to BASE.
9727
9728         * ecore.cs: Deal with TypeManager.GetField returning null, which
9729         is now a valid return value.
9730
9731         (FieldExprNoAddress): New expression for Fields whose address can
9732         not be taken.
9733
9734         * expression.cs (LocalVariableReference): During the resolve
9735         phases, create new expressions if we are in a remapping context.
9736         Remove code that dealt with remapping here.
9737
9738         (ParameterReference): same.
9739
9740         (ProxyInstance): New expression, like the `This' expression, but
9741         it is born fully resolved.  We know what we are doing, so remove
9742         the errors that are targeted to user-provided uses of `this'.
9743
9744         * statement.cs (Foreach): our variable is now stored as an
9745         Expression;  During resolution, follow the protocol, dont just
9746         assume it will return this.
9747
9748 2003-08-06  Martin Baulig  <martin@ximian.com>
9749
9750         * support.cs (SeekableStreamReader.cs): New public class.
9751
9752         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9753         SeekableStreamReader instead of the normal StreamReader.
9754
9755 2003-08-04  Martin Baulig  <martin@ximian.com>
9756
9757         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9758         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9759         deambiguate casts and delegate invocations.
9760         (parenthesized_expression): Use the new tokens to ensure this is
9761         not a cast of method invocation.
9762
9763         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9764         when reading a `)' and Deambiguate_CloseParens () was previously
9765         called.
9766
9767         * expression.cs (ParenthesizedExpression): New class.  This is
9768         just used for the CS0075 test.
9769         (Binary.DoResolve): Check for CS0075.   
9770
9771 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9772
9773         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9774         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9775         reference comparison.
9776
9777         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9778         examine the ReturnType for equality - this is necessary in the
9779         cases of implicit and explicit operators whose signature also
9780         includes the return type.
9781
9782 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9783
9784         * namespace.cs: Cache the result of the namespace computation,
9785         instead of computing it every time.
9786
9787 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9788
9789         * decl.cs: Use a global arraylist that we reuse over invocations
9790         to avoid excesive memory consumption.  Reduces memory usage on an
9791         mcs compile by one meg (45 average).
9792
9793         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9794         private, work around that.
9795
9796 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * literal.cs (IntLiteral): Define Zero and One static literals. 
9799
9800         * cs-parser.jay (integer_literal): use static literals to reduce
9801         memory usage for the most used literals (0, 1 and -1).  211kb
9802         reduced in memory usage.
9803
9804         Replace all calls to `new ArrayList' with `new
9805         ArrayList(4)' which is a good average number for most allocations,
9806         and also requires only 16 bytes of memory for its buffer by
9807         default. 
9808
9809         This reduced MCS memory usage in seven megabytes for the RSS after
9810         bootstrapping.
9811
9812 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9813
9814         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9815         handle params methods the correct way by forming only one
9816         applicable set with params and normal methods in them. Earlier we
9817         were looking at params methods only if we found no normal methods
9818         which was not the correct thing to do.
9819
9820         (Invocation.BetterFunction): Take separate arguments indicating
9821         when candidate and the best method are params methods in their
9822         expanded form.
9823
9824         This fixes bugs #43367 and #46199.
9825
9826         * attribute.cs: Documentation updates.
9827
9828         (CheckAttribute): Rename to CheckAttributeTarget.
9829         (GetValidPlaces): Rename to GetValidTargets.
9830
9831         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9832         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9833
9834         Fixes bug #44468.
9835
9836 2003-07-28  Martin Baulig  <martin@ximian.com>
9837
9838         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9839         name when looking up the base class of a nested class.  Fixes #46977.
9840
9841 2003-07-26  Martin Baulig  <martin@ximian.com>
9842
9843         * expression.cs (Indexers.Indexer): New nested struct; contains
9844         getter, setter and the indexer's type.
9845         (Indexers.Properties): This is now an ArrayList of
9846         Indexers.Indexer's.
9847         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9848         indexer doesn't have any getters.
9849
9850         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9851         for embedded property and indexer assignments.
9852
9853 2003-07-26  Martin Baulig  <martin@ximian.com>
9854
9855         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9856         preprocessor directive is not the first non-whitespace character
9857         on a line.
9858
9859 2003-07-26  Martin Baulig  <martin@ximian.com>
9860
9861         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9862         namespace parsing, follow the spec more closely.
9863
9864         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9865         NamespaceEntry.Lookup().
9866
9867 2003-07-25  Martin Baulig  <martin@ximian.com>
9868
9869         * MethodCore.cs (OverridesSomething): New public field; it's set
9870         from TypeContainer.DefineMembers if this method overrides
9871         something (which doesn't need to be a method).  Fix #39462.
9872
9873 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9874
9875         * typemanager.cs (GetMembers): Ensure that the list of members is
9876         reversed. This keeps things in sync.
9877
9878         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9879         find an AttributeUsage attribute.
9880
9881         * expression.cs (Invocation.OverloadResolve): Perform the check
9882         which disallows Invoke to be directly called on a Delegate.
9883
9884         (Error_InvokeOnDelegate): Report error cs1533.
9885
9886 2003-07-25  Martin Baulig  <martin@ximian.com>
9887
9888         * expression.cs (Indexers.GetIndexersForType): Only look in the
9889         interface hierarchy if the requested type is already an
9890         interface.  Fixes #46788 while keeping #46502 fixed.
9891
9892 2003-07-25  Martin Baulig  <martin@ximian.com>
9893
9894         * class.cs (TypeContainer.DefineMembers): Check whether all
9895         readonly fields have been assigned and report warning CS0649 if
9896         not.
9897
9898         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9899         a valuetype.
9900
9901 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9902
9903         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9904         returned from GetMethods to make things consistent with the
9905         assumptions MCS makes about ordering of methods.
9906
9907         This should comprehensively fix bug #45127 and it does :-)
9908
9909         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9910         ordering is actually reverse.
9911
9912         * Clean up some debug messages I left lying around.
9913
9914         * interface.cs (Populate*): Get rid of code which emits attributes
9915         since the stage in which we emit attributes is the 'Emit' stage,
9916         not the define stage.
9917
9918         (Emit): Move attribute emission for interface members here.
9919
9920 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9921
9922         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9923         closely: we eliminate methods in base types when we have an
9924         applicable method in a top-level type.
9925
9926         Please see section 14.5.5.1 for an exact description of what goes
9927         on. 
9928
9929         This fixes bug #45127 and a host of other related to corlib compilation.
9930
9931         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9932         array is the method corresponding to the top-level type (this is
9933         because of the changes made to icall.c) so we change this
9934         accordingly.
9935
9936         (MethodGroupExpr.Name): This too.
9937
9938         * typemanager.cs (GetElementType): New method which does the right
9939         thing when compiling corlib. 
9940
9941         * everywhere: Make use of the above in the relevant places.
9942
9943 2003-07-22  Martin Baulig  <martin@ximian.com>
9944
9945         * cs-parser.jay (invocation_expression): Moved
9946         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9947         `cast_expression', but create a InvocationOrCast which later
9948         resolves to either an Invocation or a Cast.
9949
9950         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9951         method; call this before EmitStatement() to make sure that this
9952         expression can be used as a statement.
9953
9954         * expression.cs (InvocationOrCast): New class; resolves to either
9955         an Invocation or a Cast.
9956
9957         * statement.cs (StatementExpression): Call ResolveStatement() on
9958         the ExpressionStatement before emitting it.
9959
9960 2003-07-21  Martin Baulig  <martin@ximian.com>
9961
9962         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9963         `ref' and `out' attributes match; fixes #46220.
9964         (MemberAccess.ResolveMemberAccess): You can't reference a type
9965         through an expression; fixes #33180.
9966         (Indexers.GetIndexersForType): Don't return the indexers from
9967         interfaces the class implements; fixes #46502.
9968
9969 2003-07-21  Martin Baulig  <martin@ximian.com>
9970
9971         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9972         CS0661 checks; fixes bug #30442.
9973
9974 2003-07-21  Martin Baulig  <martin@ximian.com>
9975
9976         * decl.cs (AdditionResult): Added `Error'.
9977
9978         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9979
9980         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9981         makes cs0031.cs actually work.
9982
9983 2003-07-20  Martin Baulig  <martin@ximian.com>
9984
9985         * namespace.cs: Fixed that bug which caused a crash when compiling
9986         the debugger's GUI.
9987
9988 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9989
9990         * typemanager.cs (LookupTypeReflection): Never expose types which
9991         are NotPublic, NestedPrivate, NestedAssembly, or
9992         NestedFamANDAssem.  We used to return these, and later do a check
9993         that would report a meaningful error, but the problem is that we
9994         would not get the real match, if there was a name override.
9995
9996 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9997
9998         * namespace.cs (Namespace, Name): Do not compute the namespace
9999         name dynamically, compute it in the constructor.  This reduced
10000         memory usage by 1697 KB.
10001
10002         * driver.cs: Use --pause to pause at the end.
10003
10004 2003-07-17  Peter Williams  <peter@newton.cx>
10005
10006         * Makefile: Change the name of the test target so that it doesn't
10007         conflict with the recursive test target.
10008
10009 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10010
10011         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10012         AddressOf): Do not use EmitThis, that was wrong, use the actual
10013         this pointer.
10014
10015 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10016
10017         * class.cs (MethodData.Define): While checking if a method is an
10018         interface implementation, improve the test: If we are not public
10019         (use new test here: use the computed MethodAttributes directly,
10020         instead of the parsed modifier flags) check if the `implementing'
10021         method comes from an interface or not.
10022
10023         * pending.cs (VerifyPendingMethods): Slightly better error
10024         message.
10025
10026         * makefile: add test target that does the mcs bootstrap.
10027
10028 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10029
10030         * interface.cs (Define): Do nothing here since there are no
10031         members to populate etc. Move the attribute emission out of here
10032         since this was just totally the wrong place to put it. Attribute
10033         application happens during the 'Emit' phase, not in the 'Define'
10034         phase.
10035
10036         (Emit): Add this method and move the attribute emission here
10037
10038         * rootcontext.cs (EmitCode): Call the Emit method on interface
10039         types too.
10040
10041 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10042
10043         * expression.cs (OverloadResolve): Report error only if Location
10044         is not 'Null' which means that there was a probe going on.
10045
10046 2003-07-14  Martin Baulig  <martin@ximian.com>
10047
10048         * expression.cs (ConditionalLogicalOperator): New public class to
10049         implement user defined conditional logical operators.
10050         This is section 14.11.2 in the spec and bug #40505.
10051
10052 2003-07-14  Martin Baulig  <martin@ximian.com>
10053
10054         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10055
10056 2003-07-14  Martin Baulig  <martin@ximian.com>
10057
10058         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10059
10060         * ecore.cs (IVariable.VerifyFixed): New interface method.
10061
10062         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10063         operator, check whether the variable is actually fixed.  Fixes bug
10064         #36055.  Set a variable definitely assigned when taking its
10065         address as required by the spec.
10066
10067         * statement.cs (LocalInfo.IsFixed): New field.
10068         (LocalInfo.MakePinned): Set `IsFixed' to true.
10069
10070 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10071
10072         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10073         for .ctors, ensure that we only ask for members declared in the
10074         attribute type (BindingFlags.DeclaredOnly).
10075
10076         Fixes bug #43632.
10077
10078         * expression.cs (Error_WrongNumArguments): Report error 1501
10079         correctly the way CSC does.
10080
10081 2003-07-13  Martin Baulig  <martin@ximian.com>
10082
10083         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10084         lookup on the fully qualified name, to make things like "X.X" work
10085         where "X.X" is a fully qualified type name, but we also have a
10086         namespace "X" in the using list.  Fixes #41975.
10087
10088 2003-07-13  Martin Baulig  <martin@ximian.com>
10089
10090         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10091         function. If we're a CompoundAssign, we need to create an embedded
10092         CompoundAssign, not an embedded Assign.
10093         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10094         Fixes #45854.
10095
10096 2003-07-13  Martin Baulig  <martin@ximian.com>
10097
10098         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10099         work to fix bug #46088.
10100
10101 2003-07-13  Ravi Pratap <ravi@ximian.com>
10102
10103         * class.cs (Operator.Emit): Do not emit attributes here - it is
10104         taken care of by the Method class that we delegate too. This takes
10105         care of bug #45876.
10106
10107 2003-07-10  Martin Baulig  <martin@ximian.com>
10108
10109         * expression.cs (TypeOfVoid): New class.
10110         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10111
10112 2003-07-10  Martin Baulig  <martin@ximian.com>
10113
10114         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10115         bug #35957.
10116
10117 2003-07-10  Martin Baulig  <martin@ximian.com>
10118
10119         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10120         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10121
10122         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10123
10124         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10125
10126 2003-07-10  Martin Baulig  <martin@ximian.com>
10127
10128         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10129         of decimal.  Fixes #42850.
10130
10131         NOTE: I also fixed the created byte blob, but this doesn't work on
10132         the MS runtime and csc never produces any byte blobs for decimal
10133         arrays.
10134
10135 2003-07-10  Martin Baulig  <martin@ximian.com>
10136
10137         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10138         structs; fixes #32068.
10139         (Block.AddChildVariableNames): Fixed #44302.
10140
10141 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10142
10143         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10144
10145 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10146
10147         * attribute.cs: And this test is onger needed.
10148
10149 2003-07-08  Martin Baulig  <martin@ximian.com>
10150
10151         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10152         inaccessible types.  Fixes #36313.
10153
10154         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10155
10156         * namespace.cs (NamespaceEntry): Create implicit entries for all
10157         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10158         implicit entries for N1.N2 and N1.
10159
10160 2003-07-08  Martin Baulig  <martin@ximian.com>
10161
10162         Rewrote the handling of namespaces to fix a lot of the issues
10163         wrt. `using' aliases etc.
10164
10165         * namespace.cs (Namespace): Splitted this class into a
10166         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10167
10168         * typemanager.cs (TypeManager.IsNamespace): Removed.
10169         (TypeManager.ComputeNamespaces): Only compute namespaces from
10170         loaded assemblies here, not the namespaces from the assembly we're
10171         currently compiling.
10172
10173 2003-07-08  Martin Baulig  <martin@ximian.com>
10174
10175         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10176
10177 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10178
10179         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10180         already fixed it.  
10181
10182         I thought about the memory savings here, but LookupTypeReflection
10183         is used under already very constrained scenarios.  Compiling
10184         corlib or mcs only exposes one hit, so it would not really reduce
10185         any memory consumption.
10186
10187 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10188
10189         * typemanager.cs: fixes bug #45889 by only adding public types from
10190         other assemblies to the list of known types.
10191
10192 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10193
10194         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10195         on the type we resolved.
10196
10197 2003-07-05  Martin Baulig  <martin@ximian.com>
10198
10199         * pending.cs (PendingImplementation.ParentImplements): Don't
10200         create the proxy if the parent is abstract.
10201
10202         * class.cs (TypeContainer.DefineIndexers): Process explicit
10203         interface implementations first.  Fixes #37714.
10204
10205 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10208         defined recursively;  but since we modify the input parameters
10209         (left is set to `this' temporarily), we reset this value if the
10210         left_is_explicit is false, which gives the original semantics to
10211         the code.  
10212
10213         * literal.cs (NullPointer): new class used to represent a null
10214         literal in a pointer context.
10215
10216         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10217         type is a pointer, use a NullPointer object instead of a
10218         NullLiteral.   Closes 43687
10219
10220         (ExplicitConversion): Convert pointer values using
10221         the conv opcode to the proper type.
10222
10223         * ecore.cs (New): change ValueTypeVariable property into a method,
10224         that returns whether the valuetype is suitable for being used.
10225
10226         * expression.cs (Binary.DoNumericPromotions): Only return if we
10227         the int constant was a valid uint, and we can return both left and
10228         right as uints.  If not, we continue processing, to trigger the
10229         type conversion.  This fixes 39018.
10230
10231         * statement.cs (Block.EmitMeta): During constant resolution, set
10232         the CurrentBlock property on the emitcontext, so that we resolve
10233         constants propertly.
10234
10235 2003-07-02  Martin Baulig  <martin@ximian.com>
10236
10237         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10238         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10239
10240         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10241         than emitting it here.
10242
10243         * statement.cs: Fixed some more flow analysis bugs.
10244
10245 2003-07-02  Martin Baulig  <martin@ximian.com>
10246
10247         * class.cs (MethodData.Define): When implementing interface
10248         methods, set Final unless we're Virtual.
10249
10250         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10251         check work for interface methods.
10252
10253 2003-07-01  Martin Baulig  <martin@ximian.com>
10254
10255         * ecore.cs (EmitContext.This): Replaced this property with a
10256         GetThis() method which takes a Location argument.  This ensures
10257         that we get the correct error location for a CS0188.
10258
10259 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10260
10261         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10262         ImplicitStandardConversion.
10263
10264         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10265
10266 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10267
10268         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10269         optimization.
10270
10271 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10272
10273         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10274         constructors.
10275
10276         (MethodData.Define): Turn off initlocals for unsafe methods.
10277
10278 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10279
10280         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10281         complete;  Fixes #37521.
10282
10283         * delegate.cs: Use Modifiers.TypeAttr to compute the
10284         TypeAttributes, instead of rolling our own.  This makes the flags
10285         correct for the delegates.
10286
10287 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10288
10289         * class.cs (Constructor.Define): Set the private flag for static
10290         constructors as well.
10291
10292         * cs-parser.jay (statement_expression): Set the return value to
10293         null, to avoid a crash when we catch an error.
10294
10295 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10296
10297         * cs-parser.jay: Applied patch from Jackson that adds support for
10298         extern and unsafe modifiers to destructor declarations.
10299
10300         * expression.cs: Report error 21 if the user is trying to index a
10301         System.Array.
10302
10303         * driver.cs: Add an error message, suggested by the bug report.
10304
10305         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10306         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10307
10308 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10309
10310         * namespace.cs: Add some information to reduce FAQs.
10311
10312 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10315         underlying enumeration types.  Fixes #43915.
10316
10317         * expression.cs: Treat ushort/short as legal values to be used in
10318         bitwise operations.
10319
10320 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10321
10322         * delegate.cs: transfer custom attributes for paramenters from
10323         the delegate declaration to Invoke and BeginInvoke.
10324
10325 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10326
10327         * attribute.cs: handle custom marshalers and emit marshal info
10328         for fields, too.
10329
10330 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10331
10332         * makefile.gnu: Added anonymous.cs to the compiler sources.
10333
10334 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10335
10336         * iterators.cs: Change the name of the proxy class to include two
10337         underscores.
10338
10339         * cs-parser.jay: Update grammar to include anonymous methods.
10340
10341         * anonymous.cs: new file.
10342
10343 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10344
10345         * class.cs (Field.Define): Add missing test for pointers and
10346         safety. 
10347
10348 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10349
10350         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10351         we use the stobj opcode.
10352
10353         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10354         since it wasn't the correct fix. 
10355
10356         It still is puzzling that we are required to use stobj for IntPtr
10357         which seems to be a ValueType.
10358
10359 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10360
10361         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10362         during regular simple name resolution.   Now, the trick is that
10363         instead of returning for processing the simplename, we do a
10364         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10365         contextual lookup type).   If a match is found, return that, if
10366         not, return for further composition.
10367
10368         This fixes long-standing 30485.
10369
10370         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10371         using the address to initialize an object, do an Stobj instead of
10372         using the regular Stelem.
10373
10374         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10375         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10376         Because if we are a BaseIndexerAccess that value will be true.
10377         Fixes 43643.
10378
10379         * statement.cs (GotoCase.Resolve): Return after reporting an
10380         error, do not attempt to continue. 
10381
10382         * expression.cs (PointerArithmetic.Emit): If our operand is a
10383         long, convert our constants to match the operand before
10384         multiplying.  Convert to I type before adding.   Fixes 43670.
10385
10386 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10387
10388         * enum.cs (ImplicitConversionExists) : Rename to
10389         ImplicitEnumConversionExists to remove ambiguity. 
10390
10391         * ecore.cs (NullCast): New type of cast expression class which
10392         basically is very similar to EmptyCast with the difference being
10393         it still is a constant since it is used only to cast a null to
10394         something else
10395         (eg. (string) null)
10396
10397         * convert.cs (ImplicitReferenceConversion): When casting a null
10398         literal, we return a NullCast.
10399
10400         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10401         should be around anymore.
10402
10403         The renaming (reported was slightly wrong). Corrections:
10404
10405         ConvertImplicitStandard -> ImplicitConversionStandard
10406         ConvertExplicitStandard -> ExplicitConversionStandard
10407
10408         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10409         before passing them in !
10410
10411         * convert.cs (ImplicitConversionStandard): When comparing for
10412         equal expr and target types, ensure that expr is not a
10413         NullLiteral.
10414
10415         In general, we must not be checking (expr_type ==
10416         target_type) in the top level conversion methods
10417         (ImplicitConversion, ExplicitConversion etc). This checking is
10418         done in the methods that they delegate to.
10419
10420 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10421
10422         * convert.cs: Move Error_CannotConvertType,
10423         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10424         ImplicitNumericConversion, ImplicitConversionExists,
10425         ImplicitUserConversionExists, StandardConversionExists,
10426         FindMostEncompassedType, FindMostSpecificSource,
10427         FindMostSpecificTarget, ImplicitUserConversion,
10428         ExplicitUserConversion, GetConversionOperators,
10429         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10430         TryImplicitIntConversion, Error_CannotConvertImplicit,
10431         ConvertImplicitRequired, ConvertNumericExplicit,
10432         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10433         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10434         its own file.
10435
10436         Perform the following renames:
10437
10438         StandardConversionExists -> ImplicitStandardConversionExists
10439         ConvertImplicit -> ImplicitConversion
10440         ConvertImplicitStandard -> ImplicitStandardConversion
10441         TryImplicitIntConversion -> ImplicitIntConversion
10442         ConvertImplicitRequired -> ImplicitConversionRequired
10443         ConvertNumericExplicit -> ExplicitNumericConversion
10444         ConvertReferenceExplicit -> ExplicitReferenceConversion
10445         ConvertExplicit -> ExplicitConversion
10446         ConvertExplicitStandard -> ExplicitStandardConversion
10447
10448 2003-05-19  Martin Baulig  <martin@ximian.com>
10449
10450         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10451         (TypeInfo): Added support for structs having structs as fields.
10452
10453         * ecore.cs (FieldExpr): Implement IVariable.
10454         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10455         VariableInfo for the field.
10456
10457 2003-05-18  Martin Baulig  <martin@ximian.com>
10458
10459         * expression.cs (This.DoResolve): Report a CS0027 if we're
10460         emitting a field initializer.
10461
10462 2003-05-18  Martin Baulig  <martin@ximian.com>
10463
10464         * expression.cs (This.ResolveBase): New public function.
10465         (This.DoResolve): Check for CS0188.
10466
10467         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10468         This.Resolve().
10469
10470         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10471         `instance_expression' to null if we don't have any non-static
10472         methods.
10473
10474 2003-05-18  Martin Baulig  <martin@ximian.com>
10475
10476         Reworked the way how local variables and parameters are handled by
10477         the flow analysis code.
10478
10479         * statement.cs (TypeInfo, VariableMap): New public classes.
10480         (VariableInfo): New public class.  This is now responsible for
10481         checking whether a variable has been assigned.  It is used for
10482         parameters and local variables.
10483         (Block.EmitMeta): Take the InternalParameters as argument; compute
10484         the layout of the flow vectors here.
10485         (Block.LocalMap, Block.ParameterMap): New public properties.
10486         (FlowBranching): The .ctor doesn't get the InternalParameters
10487         anymore since Block.EmitMeta() now computes the layout of the flow
10488         vector.
10489         (MyStructInfo): This class is now known as `StructInfo' and nested
10490         in `TypeInfo'; we don't access this directly anymore.
10491
10492         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10493         property and removed IsAssigned(), IsFieldAssigned(),
10494         SetAssigned() and SetFieldAssigned(); we now call them on the
10495         VariableInfo so we don't need to duplicate this code everywhere.
10496
10497         * expression.cs (ParameterReference): Added `Block block' argument
10498         to the .ctor.
10499         (LocalVariableReference, ParameterReference, This): The new
10500         VariableInfo class is now responsible for all the definite
10501         assignment stuff.
10502
10503         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10504         IsParameterAssigned, SetParameterAssigned): Removed.
10505
10506 2003-05-18  Martin Baulig  <martin@ximian.com>
10507
10508         * typemanager.cs (InitCoreTypes): Try calling
10509         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10510         the 3-args-version.  Corlib now also needs our `void_type'.
10511         (GetMethod): Added overloaded version which takes an optional
10512         `bool report_errors' to allow lookups of optional methods.
10513
10514 2003-05-12  Martin Baulig  <martin@ximian.com>
10515
10516         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10517         only used for locals and not for parameters.
10518
10519 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10520
10521         * support.cs (InternalParameters.ParameterType): Return the
10522         ExternalType of the parameter.
10523
10524         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10525         they were unused.
10526
10527 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * class.cs (MethodData.Define): Do not set the `newslot' on
10530         interface members, if they are also flagged as "override".
10531
10532         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10533         better code for ++i and i++.  This only works for static fields
10534         and local variables.
10535
10536         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10537         want to pull the DeclSpace out of the builder_to_declspace instead
10538         of the TypeBuilder (like in TypeContainer.FindMembers).
10539
10540         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10541         instead of LookupTypeContainer.  Fixes the crash on .NET for
10542         looking up interface members.
10543
10544         * const.cs: Create our own emit context during the Definition
10545         stage, so that constants are evaluated in the proper context, when
10546         a recursive definition happens.
10547
10548 2003-05-11  Martin Baulig  <martin@ximian.com>
10549
10550         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10551         new block for a switch section.
10552         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10553         the adding/lookup in the switch block.  Fixes #39828.
10554
10555 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10556
10557         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10558         functionality: I needed to convert the data after I had performed
10559         the add/sub operation into the operands type size.
10560
10561         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10562         pass the type for the box operation, otherwise the resulting
10563         object would have been of type object.
10564
10565         (BoxedCast): Add constructor to specify the type to box as.
10566
10567 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10568
10569         * iterators.cs: I was reusing the `count' variable inadvertently,
10570         take steps to not allow this to happen.
10571
10572 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10573
10574         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10575         by creating an array at the point where the params starts and
10576         putting all those arguments there, then adjusting the size of the
10577         array.
10578
10579 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10580
10581         * expression.cs (New.AddressOf): Implement interface
10582         IMemoryLocation.  This is used when the `new' operator is used in
10583         the context of an invocation to a method on a value type.
10584
10585         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10586         example. 
10587
10588         * namespace.cs: Also check the using aliases here.
10589
10590         * driver.cs: Move the test for using validity after the types have
10591         been entered, so we do a single pass that also includes the using
10592         aliases. 
10593
10594         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10595         in the regular case.   CreateSiblingForFinally is doing extra
10596         error checking.
10597
10598         * attribute.cs (GetAttributeArgumentExpression): Store the result
10599         on an out value, and use the return value to indicate failure
10600         instead of using null (which is a valid return for Constant.GetValue).
10601
10602         * statement.cs: Perform the analysis flow for the increment
10603         portion after the statement, because this will be the real flow of
10604         execution.  Fixes #42385
10605
10606         * codegen.cs (EmitContext.EmitArgument,
10607         EmitContext.EmitStoreArgument): New helper functions when the
10608         RemapToProxy flag is set.
10609
10610         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10611         function.
10612
10613         Add support for remapping parameters. 
10614
10615         * iterators.cs: Propagate parameter values;  Store parameter
10616         values in the proxy classes.
10617
10618 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10619
10620         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10621         need a proxy reference;  I do not know what I was thinking
10622
10623         * cs-parser.jay (constructor_initializer): catch another error,
10624         and display nice message.
10625
10626         (field_declaration): catch void field declaration
10627         to flag a better error. 
10628
10629         * class.cs (MemberBase.CheckBase): Report an error instead of a
10630         warning if a new protected member is declared in a struct. 
10631         (Field.Define): catch the error of readonly/volatile.
10632
10633         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10634
10635         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10636         volatile variable is taken
10637
10638 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10639
10640         * statement.cs (Fixed.Resolve): Report an error if we are not in
10641         an unsafe context.
10642
10643 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10644
10645         * typemanager.cs: reuse the code that handles type clashes for
10646         delegates and enumerations.
10647
10648         * class.cs (Report28): Always report.
10649
10650         * expression.cs (EncodeAsAttribute): Allow nulls here.
10651
10652 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10653
10654         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10655         the functionality for testing whether an expression is valid for
10656         an attribute here.  Also handle the case of arrays of elements
10657         being stored. 
10658
10659         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10660         encoding a linear array into an array of objects that are suitable
10661         to be passed to an CustomAttributeBuilder.
10662
10663         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10664
10665         * ecore.cs: (FieldExpr): Handle field remapping here.
10666
10667         * iteratators.cs: Pass the instance variable (if the method is an
10668         instance method) to the constructors, so we can access the field
10669         variables on the class.
10670
10671         TODO: Test this with structs.  I think the THIS variable on
10672         structs might have to be a pointer, and not a refenrece
10673
10674 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10675
10676         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10677         local variables to fields in a proxy class.
10678
10679         * iterators.cs (PopulateProxy): Rename our internal fields to
10680         <XXX>.  
10681         Create a <THIS> field if we are an instance method, so we can
10682         reference our parent container variables.
10683         (MapVariable): Called back from the EmitContext code to enter a
10684         new variable to field mapping into the proxy class (we just create
10685         a FieldBuilder).
10686
10687         * expression.cs
10688         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10689         for using the remapped locals to fields.
10690
10691         I placed the code here, because that gives the same semantics to
10692         local variables, and only changes the Emit code.
10693
10694         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10695         statements inside iterators.
10696         (VariableInfo): Add a FieldBuilder for the cases when we are
10697         remapping local variables to fields in a proxy class
10698
10699         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10700         current_block != null.
10701
10702         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10703         not cope with strings, as it has been moved to the
10704         TableSwitchEmit.  Fixed bug in switch generation.
10705
10706         * expression.cs (New.DoResolve): Provide more context for the user
10707         when reporting an error.
10708
10709         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10710         pointers. 
10711
10712         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10713         check the permissions for it.  Note than in a type-resolution
10714         context the check was already present in DeclSpace.ResolveType,
10715         but was missing from the MemberAccess.
10716
10717         (ArrayCreation.CheckIndices): warn if the user has
10718         more nested levels of expressions, but there are no more
10719         dimensions specified.  Avoids crash on bug 41906.
10720
10721 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * statement.cs (Block): replace Implicit bool, for a generic
10724         flags.   
10725         New flag: `Unchecked'.  This is used during the EmitMeta phase
10726         (which is out-of-line with the regular Resolve/Emit process for a
10727         statement, as this is done ahead of time, but still gets a chance
10728         to call constant resolve).
10729
10730         (Block.Flags): new enum for adding a new flag.
10731
10732         (Block.EmitMeta): track the state of unchecked.
10733
10734         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10735         to enable constant resolution to work there as well.
10736
10737 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10738
10739         * typemanager.cs (ienumerable_type): Also look up
10740         System.Collections.IEnumerable. 
10741
10742 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10743
10744         TODO: Test more than one conditional per method.
10745
10746         * class.cs (Indexer.Define): Report the location where the user is
10747         referencing the unsupported feature.
10748
10749         (MethodData): Overload the use of `conditionals' to
10750         minimize the creation of needless ArrayLists.   This saves roughly
10751         212kb on my machine.
10752
10753         (Method): Implement the new IIteratorContainer interface.
10754         (Method.SetYields): Implement the method by setting the ModFlags
10755         to contain METHOD_YIELDS.
10756
10757         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10758         which just got set to null.
10759
10760         * iterators.cs: New file.
10761
10762         (Yield, YieldBreak): New statements.
10763
10764         * statement.cs (Return.Resolve): Flag an error if we are used in
10765         an iterator method.
10766
10767         * codegen.cs (InIterator): New flag set if the code is being
10768         compiled in an iterator method.
10769
10770         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10771         internal modifier, and we just use it to avoid adding extra
10772         fields, as this is seldom used.  
10773
10774         * cs-parser.jay: Add yield_statement (yield and yield break).
10775
10776         * driver.cs: New flag -v2 to turn on version 2 features. 
10777
10778         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10779         hashtable when v2 is enabled.
10780
10781 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10784         there is already a namespace defined with this name.
10785
10786         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10787         people upgraded their corlibs.
10788
10789         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10790         always use fully qualified types, no need to use the compiler
10791         front end.
10792
10793         (TypeManager.IsNamespace): Use binarysearch.
10794
10795         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10796         AddDelegate): I did not quite use the new IsValid API properly: I
10797         have to pass the short-name and the fullname.  I was passing only
10798         the basename instead of the fullname sometimes. 
10799
10800         (TypeContainer.DefineType): call NamespaceClash.
10801
10802         * interface.cs (Interface.DefineType): use NamespaceClash before
10803         defining the type.
10804
10805         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10806         defining the type.
10807
10808         * enum.cs: (Enum.DefineType): use NamespaceClash before
10809         defining the type.
10810
10811         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10812         speed increase.  First, use the negative_hits cache when we get a
10813         negative.  Second, add the type with its full original name
10814         instead of the new . and + encoded name (reflection uses + to
10815         separate type from a nested type).  Use LookupTypeReflection
10816         directly which bypasses the type->name hashtable (that we already
10817         know does not contain the type.
10818
10819         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10820         location/container type. 
10821
10822         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10823
10824 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10825
10826         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10827
10828         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10829         method is being referenced in the method group from a static
10830         context, and report error 120 if so.
10831
10832         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10833         Error118. 
10834
10835         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10836         is created, we create the A namespace).
10837
10838         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10839         Fixes #41591
10840
10841 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10842
10843         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10844         invocation to ModuleBuilder.GetType with the same values will
10845         return a new type instance, so we need to cache its return
10846         values. 
10847
10848         * expression.cs (Binary.ResolveOperator): Only allow the compare
10849         operators on enums if they are of the same type.
10850
10851         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10852         types of ValueType on their own case.  Before we were giving them
10853         the same treatment as objects.
10854
10855         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10856         fullname.  Short name is used to compare against container name.
10857         Fullname is used to check against defined namespace names.
10858
10859         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10860         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10861
10862         (Method.CheckBase): Call parent.
10863         (MemberBase.CheckBase): Check for protected members on sealed
10864         classes.
10865         (PropertyBase.CheckBase): Call parent.
10866         (Field.Define): Call parent.
10867
10868         * report.cs: Negative error codes are now mapped to 8000 - code,
10869         so that the display is render more nicely.
10870
10871         * typemanager.cs: Do not use try/catch, instead report a regular
10872         error. 
10873
10874         (GetPointerType, GetReferenceType): These methods provide
10875         mechanisms to obtain the T* and T& from a T.  We had the code
10876         previously scattered around the code base, and it also used
10877         TypeManager.LookupType that would go through plenty of caches.
10878         This one goes directly to the type source.
10879
10880         In some places we did the Type.GetType followed by
10881         ModuleBuilder.GetType, but not in others, so this unifies the
10882         processing as well.
10883
10884         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10885         statements now that we have namespace information.
10886
10887         * typemanager.cs (IsNamespace): New method, returns whether the
10888         string presented is a namespace or not.
10889
10890         (ComputeNamespaces): New public entry point, computes the list of
10891         available namespaces, using the GetNamespaces API call in Mono, or
10892         the slower version in MS.NET.   
10893
10894         Now before we start the semantic analysis phase, we have a
10895         complete list of namespaces including everything that the user has
10896         provided.
10897
10898         Deleted old code to cache namespaces in .nsc files.
10899
10900 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10901
10902         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10903         class/struct location definition Location for the implicit
10904         constructor location.
10905
10906         (Operator.Define): Use the location of the operator for the
10907         implicit Method definition.
10908
10909         (Constructor.Emit): use the constructor location for the implicit
10910         base initializer constructor.
10911
10912         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10913         and the Expression class now contains two new methods:
10914
10915         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10916         isolate type lookup from the rest of the resolution process.
10917
10918         Since we use Expressions to hold type definitions due to the way
10919         we parse the input we have historically overloaded Resolve to
10920         perform the Type lookups if a special flag is passed.  Now this is
10921         eliminated and two methods take their place. 
10922
10923         The differences in the two methods between xStep and xTerminal is
10924         that xStep is involved in our current lookup system that uses
10925         SimpleNames to compose a name, while xTerminal is used just to
10926         catch the case where the simplename lookup failed.
10927
10928 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10929
10930         * expression.cs (ResolveMemberAccess): Remove redundant code.
10931         TypeExpr expressions are always born fully resolved.
10932
10933         * interface.cs (PopulateMethod): Do not lookup the types twice.
10934         We were doing it once during SemanticAnalysis and once during
10935         PopulateMethod.
10936
10937         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10938         in local variable type definitions, were being returned as a
10939         SimpleName (we decomposed everything into a string), that is
10940         because primary_expression was being used instead of a type in the
10941         grammar (reduce/reduce conflicts).
10942
10943         The part that was wrong is that we converted the expression into a
10944         string (an oversimplification in one hand, compounded with primary
10945         expressions doing string concatenation).
10946
10947         So things like:
10948
10949         A.B.C [] x;
10950
10951         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10952         using clauses from working on this particular context.  And a type
10953         was being matched directly against "A.B.C[]".
10954
10955         We now use the correct approach, and allow for ComposedCast to be
10956         part of the unary expression.  So the "A.B.C []" become a composed
10957         cast of "A.B.C" (as a nested group of MemberAccess with a
10958         SimpleName at the end) plus the rank composition "[]". 
10959
10960         Also fixes 35567
10961
10962 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10963
10964         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10965         for the access level checking.
10966
10967         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10968         `TypeContainer container', because I kept getting confused when I
10969         was debugging this code.
10970
10971         * expression.cs (Indexers): Instead of tracking getters/setters,
10972         we now track them in parallel.  We create one arraylist less, but
10973         most importantly it is possible now for the LValue code to find a
10974         matching get for a set.
10975
10976         (IndexerAccess.DoResolveLValue): Update the code.
10977         GetIndexersForType has been modified already to extract all the
10978         indexers from a type.  The code assumed it did not.
10979
10980         Also make the code set the correct return type for the indexer.
10981         This was fixed a long time ago for properties, but was missing for
10982         indexers.  It used to be void_type.
10983
10984         (Binary.Emit): Test first for doubles instead of
10985         floats, as they are more common.
10986
10987         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10988         when dealing with floats and the <=, >= operators.  This fixes bug
10989         #39314 
10990
10991         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10992         to load the array value by emitting a load on the foreach variable
10993         type.  This was incorrect.  
10994
10995         We now emit the code to load an element using the the array
10996         variable type, and then we emit the conversion operator.
10997
10998         Fixed #40176
10999
11000 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11001
11002         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11003
11004 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11005
11006         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11007         test for protection before we test for signatures. 
11008
11009         (MethodSignature.ToString): implement.
11010
11011         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11012         to the case where we reduced into a LongConstant.
11013
11014         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11015         depend on whether the information is acurrate, because the
11016         Microsoft runtime will always claim that the array type is public,
11017         regardless of the real state.
11018
11019         If the type is a pointer, another problem happens: the type is
11020         reported as non-public in Microsoft.  
11021
11022         In both cases we have to call CheckAccessLevel recursively with
11023         the underlying type as the argument to be tested.
11024
11025 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11026
11027         * assign.cs (Assign.Emit): If we are dealing with a compound
11028         assignment expression, we should use the code path that stores the
11029         intermediate result in a temporary value.  This fixes #40903.
11030
11031         *expression.cs (Indirection.ToString): Provide ToString method for
11032         debugging. 
11033
11034 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11035
11036         * class.cs: Null out fields holding references to Block objects so
11037         they can be garbage collected.
11038
11039         * expression.cs (OverloadResolve): Remove unused local.
11040
11041 2003-04-07  Martin Baulig  <martin@ximian.com>
11042
11043         * codegen.cs (EmitContext.CurrentFile): New public field.
11044         (EmitContext.Mark): Use the CurrentFile to check whether the
11045         location is in the correct file.
11046         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11047
11048 2003-04-07  Martin Baulig  <martin@ximian.com>
11049
11050         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11051
11052         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11053         location.  [FIXME: The location argument which gets passed to this
11054         method is sometimes wrong!]
11055
11056 2003-04-07  Nick Drochak <ndrochak@gol.com>
11057
11058         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11059
11060 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11061
11062         * expression.cs (Indirection.EmitAssign): We were using the
11063         temporary, but returning immediately instead of continuing the
11064         EmitAssing flow.
11065
11066 2003-04-06  Martin Baulig  <martin@ximian.com>
11067
11068         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11069         if it's a nested child, but also deriving from the outer class.
11070         See test 190.cs.
11071
11072         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11073         nested child, but also deriving from the outer class.  See
11074         test-190.cs.
11075         (FilterWithClosure): We may access private members of the outer
11076         class if we're a nested child and deriving from the outer class.
11077         (RealMemberLookup): Only set `closure_private_ok' if the
11078         `original_bf' contained BindingFlags.NonPublic.
11079
11080 2003-04-05  Martin Baulig  <martin@ximian.com>
11081
11082         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
11083
11084 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11085
11086         * class.cs (Event.Define): Do not allow abstract events to have
11087         initializers. 
11088
11089 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11090
11091         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11092         block in event declarations.
11093
11094         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11095         value type, get its address.
11096
11097         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11098         leaving a class on the stack instead of a boolean value (int
11099         0/1).  Change the code so we compare against null, and then the
11100         result against zero.
11101
11102         * class.cs (TypeContainer.GetClassBases): We were checking for the
11103         parent class being sealed too late.
11104
11105         * expression.cs (Binary.Emit): For <= and >= when dealing with
11106         floating point values, use cgt.un and clt.un instead of cgt and
11107         clt alone.
11108
11109 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11110
11111         * statement.cs: Apply the same optimization as MS: skip the 
11112         GetEnumerator returning an IEnumerator, and use the one returning a 
11113         CharEnumerator instead. This allows us to avoid the try-finally block 
11114         and the boxing.
11115
11116 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11117
11118         * cs-parser.jay: Attributes cannot be applied to
11119                          namespaces. Fixes #40473
11120
11121 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11122
11123         * class.cs:
11124         (Add*): check if the name is valid using the full name for constants,
11125         fields, properties and events.
11126
11127 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11128
11129         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11130         char constants to be part of the enumeration.
11131
11132         * expression.cs (Conditional.DoResolve): Add support for operator
11133         true. Implements the missing functionality from 14.12
11134
11135         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11136         operator true/false as required by the spec.
11137
11138         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11139         implicit conversion to boolean.
11140
11141         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11142         also one where the type implements `operator true'. 
11143
11144         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11145         get an expression that will invoke operator true based on an
11146         expression.  
11147
11148         (GetConversionOperators): Removed the hack that called op_True
11149         here.  
11150
11151         (Expression.ResolveBoolean): Move this from Statement.
11152
11153 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11154
11155         * ecore.cs (FieldExpr): do not allow initialization of initonly
11156         fields on derived classes
11157
11158 2003-03-13  Martin Baulig  <martin@ximian.com>
11159
11160         * statement.cs (Block.Emit): Call ig.BeginScope() and
11161         ig.EndScope() when compiling with debugging info; call
11162         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11163
11164 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11165
11166         * expression.cs (Indexers): Do not construct immediately, allow
11167         for new members to be appended as we go.  Fixes 38143
11168
11169 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11170
11171         * expression.cs: save/restore context when resolving an unchecked
11172         expression.
11173
11174 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11175
11176         * cfold.cs: Catch division by zero in modulus operator during
11177         constant folding.
11178
11179 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11180
11181         * interface.cs (Interface.DefineMembers): Avoid defining members
11182         twice. 
11183
11184 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * driver.cs: handle the +/- options for -noconfig
11187
11188         * statement.cs (Unckeched.Resolve): Also track the state of
11189         unchecked in the Resolve phase.
11190
11191 2003-02-27  Martin Baulig  <martin@ximian.com>
11192
11193         * ecore.cs (Expression.MemberLookup): Don't create a
11194         MethodGroupExpr for something which is not a method.  Fixes #38291.
11195
11196 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11197
11198         * class.cs (MemberBase.CheckParameters): Also check that the type
11199         is unmanaged if it is a pointer.
11200
11201         * expression.cs (SizeOf.Resolve): Add location information.
11202
11203         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11204         a managed type is declared.
11205
11206         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11207         parameter modifiers as well.  Fixes bug 38606
11208
11209         * class.cs: Very sad.  Am backing out the speed up changes
11210         introduced by the ArrayList -> Array in the TypeContainer, as they
11211         were not actually that much faster, and introduced a bug (no error
11212         reports on duplicated methods).
11213
11214         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11215         source first, this will guarantee that we have a valid expression
11216         before calling in lower levels functions that will require a
11217         resolved object.  Then use this original_source in the
11218         target.ResolveLValue instead of the original source that was
11219         passed to us.
11220
11221         Another change.  Use target.Resolve instead of LValueResolve.
11222         Although we are resolving for LValues, we will let the Assign code
11223         take care of that (it will be called again from Resolve).  This
11224         basically allows code like this:
11225
11226         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11227         class Y { void A (X x) { x [0] += o; }
11228
11229         The problem was that the indexer was trying to resolve for
11230         set_Item (idx, object o) and never finding one.  The real set_Item
11231         was set_Item (idx, X).  By delaying the process we get the right
11232         semantics. 
11233
11234         Fixes bug 36505
11235
11236 2003-02-23  Martin Baulig  <martin@ximian.com>
11237
11238         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11239         while calling DoEmit ().
11240
11241         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11242         source files; if you use the #line directive inside a method, the
11243         compiler stops emitting line numbers for the debugger until it
11244         reaches the end of the method or another #line directive which
11245         restores the original file.
11246
11247 2003-02-23  Martin Baulig  <martin@ximian.com>
11248
11249         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11250
11251 2003-02-23  Martin Baulig  <martin@ximian.com>
11252
11253         * statement.cs (Block.AddChildVariableNames): We need to call this
11254         recursively, not just for our immediate children.
11255
11256 2003-02-23  Martin Baulig  <martin@ximian.com>
11257
11258         * class.cs (Event.Define): Always make the field private, like csc does.
11259
11260         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11261         actually work, fixes bug #37521.
11262
11263 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11264
11265         * delegate.cs: When creating the various temporary "Parameters"
11266         classes, make sure that we call the ComputeAndDefineParameterTypes
11267         on those new parameters (just like we do with the formal ones), to
11268         allow them to be resolved in the context of the DeclSpace.
11269
11270         This fixes the bug that Dick observed in Bugzilla #38530.
11271
11272 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11273
11274         * expression.cs (ResolveMemberAccess): When resolving a constant,
11275         do not attempt to pull a constant if the value was not able to
11276         generate a valid constant.
11277
11278         * const.cs (LookupConstantValue): Do not report more errors than required.
11279
11280 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11281
11282         * expression.cs: fixes bug #38328.
11283
11284 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11285
11286         * class.cs: Changed all the various members that can be part of a
11287         class from being an ArrayList to be an Array of the right type.
11288         During the DefineType type_list, interface_list, delegate_list and
11289         enum_list are turned into types, interfaces, delegates and enums
11290         arrays.  
11291
11292         And during the member population, indexer_list, event_list,
11293         constant_list, field_list, instance_constructor_list, method_list,
11294         operator_list and property_list are turned into their real arrays.
11295
11296         Although we could probably perform this operation earlier, for
11297         good error reporting we need to keep the lists and remove the
11298         lists for longer than required.
11299
11300         This optimization was triggered by Paolo profiling the compiler
11301         speed on the output of `gen-sample-program.pl' perl script. 
11302
11303         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11304         not crash in methods like MemberLookupFailed that use this field.  
11305
11306         This problem arises when the compiler fails to resolve a type
11307         during interface type definition for example.
11308
11309 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11310
11311         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11312         inherit from System.Object, so we have to stop at null, not only
11313         when reaching System.Object.
11314
11315 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11316
11317         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11318         DeclaredOnly because the parent indexer might have had a different
11319         name, but did not loop until the top of the hierarchy was reached.
11320
11321         The problem this one fixes is 35492: when a class implemented an
11322         indexer from an interface, we were getting the interface method
11323         (which was abstract) and we were flagging an error (can not invoke
11324         abstract method).
11325
11326         This also keeps bug 33089 functioning, and test-148 functioning.
11327
11328         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11329         out if a method is special is to see if it is declared in a
11330         property or event, or whether it is one of the predefined operator
11331         names.   This should fix correctly #36804.
11332
11333 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11334
11335         The goal here is to remove the dependency on EmptyCast.Peel ().
11336         Killing it completely.
11337
11338         The problem is that currently in a number of places where
11339         constants are expected, we have to "probe" for an EmptyCast, and
11340         Peel, which is not the correct thing to do, as this will be
11341         repetitive and will likely lead to errors. 
11342
11343         The idea is to remove any EmptyCasts that are used in casts that
11344         can be reduced to constants, so we only have to cope with
11345         constants. 
11346
11347         This bug hunt was triggered by Bug 37363 and the desire to remove
11348         the duplicate pattern where we were "peeling" emptycasts to check
11349         whether they were constants.  Now constants will always be
11350         constants.
11351
11352         * ecore.cs: Use an enumconstant here instead of wrapping with
11353         EmptyCast.  
11354
11355         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11356         throwing me off.  By handling this we can get rid of a few hacks.
11357
11358         * statement.cs (Switch): Removed Peel() code.
11359
11360 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11361
11362         * class.cs: Location information for error 508
11363
11364         * expression.cs (New.DoResolve): Add a guard against double
11365         resolution of an expression.  
11366
11367         The New DoResolve might be called twice when initializing field
11368         expressions (see EmitFieldInitializers, the call to
11369         GetInitializerExpression will perform a resolve on the expression,
11370         and later the assign will trigger another resolution
11371
11372         This leads to bugs (#37014)
11373
11374         * delegate.cs: The signature for EndInvoke should contain any ref
11375         or out parameters as well.  We were not doing this in the past. 
11376
11377         * class.cs (Field.Define): Do not overwrite the type definition
11378         inside the `volatile' group.  Turns out that volatile enumerations
11379         were changing the type here to perform a validity test, which
11380         broke conversions. 
11381
11382 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11383
11384         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11385         and structs, we do not want to load the instance variable
11386
11387         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11388         enum_type has to be handled like an object reference (implicit
11389         conversions exists from this to object), but the regular IsClass
11390         and IsValueType tests will never return true for this one.
11391
11392         Also we use TypeManager.IsValueType instead of type.IsValueType,
11393         just for consistency with the rest of the code (this is only
11394         needed if we ever use the construct exposed by test-180.cs inside
11395         corlib, which we dont today).
11396
11397 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11398
11399         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11400         just InternalCall.
11401
11402 2003-02-09  Martin Baulig  <martin@ximian.com>
11403
11404         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11405         (Namespace.DefineNamespaces): New static public method; this is
11406         called when we're compiling with debugging to add all namespaces
11407         to the symbol file.
11408
11409         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11410         pass it to the Namespace's .ctor.
11411
11412         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11413         and MethodBase arguments; pass the namespace ID to the symwriter;
11414         pass the MethodBase instead of the token to the symwriter.
11415         (SymbolWriter.DefineNamespace): New method to add a namespace to
11416         the symbol file.
11417
11418 2003-02-09  Martin Baulig  <martin@ximian.com>
11419
11420         * symbolwriter.cs: New file.  This is a wrapper around
11421         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11422         methods here in near future.
11423
11424 2003-02-09  Martin Baulig  <martin@ximian.com>
11425
11426         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11427         ILGenerator.MarkSequencePoint() which are actually used by the
11428         symbol writer.
11429
11430 2003-02-09  Martin Baulig  <martin@ximian.com>
11431
11432         * location.cs (SourceFile): New public sealed class.  This
11433         contains the name and an index which is used in the location's token.
11434         (Location): Reserve an appropriate number of bits in the token for
11435         the source file instead of walking over that list, this gives us a
11436         really huge performance improvement when compiling with debugging.
11437
11438         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11439         `SourceFile' argument instead of a string.
11440         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11441         but don't parse/tokenize here, we need to generate the list of all
11442         source files before we do that.
11443         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11444         the files.
11445
11446         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11447         instead of a string.
11448
11449         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11450         of a string.
11451
11452 2003-02-09  Martin Baulig  <martin@ximian.com>
11453
11454         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11455         filename on `#line default'.
11456
11457 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11458
11459         * statement.cs: don't clear the pinned var when the fixed statement
11460         returns from the method (fixes bug#37752).
11461
11462 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11463
11464         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11465         to IsValueType.
11466
11467 2003-02-07  Martin Baulig  <martin@ximian.com>
11468
11469         * driver.cs: Removed the `--debug-args' command line argument.
11470
11471         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11472         automatically by the AsssemblyBuilder.
11473         (CodeGen.InitializeSymbolWriter): We don't need to call any
11474         initialization function on the symbol writer anymore.  This method
11475         doesn't take any arguments.
11476
11477 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11478
11479         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11480         from referenced assemblies as well.
11481
11482 2003-02-02  Martin Baulig  <martin@ximian.com>
11483
11484         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11485
11486 2003-02-02  Martin Baulig  <martin@ximian.com>
11487
11488         * class.cs (Constructor.Emit): Open the symbol writer before
11489         emitting the constructor initializer.
11490         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11491         single-stepping through constructor initializers.
11492
11493 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11494
11495         * class.cs: Handle error 549: do not allow virtual methods in
11496         sealed classes. 
11497
11498 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11499
11500         * decl.cs: Check access levels when resolving types
11501
11502 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11503
11504         * statement.cs: Add parameters and locals set in catch blocks that might 
11505         return to set vector
11506
11507 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11508
11509         * class.cs (Operator): Set the SpecialName flags for operators.
11510
11511         * expression.cs (Invocation.DoResolve): Only block calls to
11512         accessors and operators on SpecialName methods.
11513
11514         (Cast.TryReduce): Handle conversions from char constants.
11515
11516
11517 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11518
11519         * statement.cs: small memory and time optimization in FlowBranching.
11520
11521 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11522
11523         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11524         problem that the last fix but in the other sid (Set).
11525
11526         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11527         access when there is no indexer in the hierarchy.
11528
11529 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11530
11531         * class.cs: Combine some if statements.
11532
11533 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11534
11535         * driver.cs: fixed bug #37187.
11536
11537 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11538
11539         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11540         any indexer, it's needed to build a list with all the indexers in the
11541         hierarchy (AllGetters), else we have problems. Fixes #35653.
11542
11543 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11544
11545         * class.cs (MethodData.Define): It is wrong for an interface
11546         implementation to be static in both cases: explicit and implicit.
11547         We were only handling this in one case.
11548
11549         Improve the if situation there to not have negations.
11550
11551         * class.cs (Field.Define): Turns out that we do not need to check
11552         the unsafe bit on field definition, only on usage.  Remove the test.
11553
11554 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11555
11556         * driver.cs: use assembly.Location instead of Codebase (the latest
11557         patch made mcs fail when using MS assemblies).
11558
11559 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11560
11561         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11562         get the path to *corlib.dll.
11563
11564 2003-01-21  Nick Drochak <ndrochak@gol.com>
11565
11566         * cs-tokenizer.cs:
11567         * pending.cs:
11568         * typemanager.cs: Remove compiler warnings
11569
11570 2003-01-20  Duncan Mak  <duncan@ximian.com>
11571
11572         * AssemblyInfo.cs: Bump the version number to 0.19.
11573
11574 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11575
11576         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11577
11578 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11579
11580         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11581
11582 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11583
11584         * cs-parser.jay: Small fix: we were not comparing the constructor
11585         name correctly.   Thanks to Zoltan for the initial pointer.
11586
11587 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11588
11589         * cs-tokenizer.cs: Set file name when specified with #line
11590
11591 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11592
11593         * cs-parser.jay: Only perform the constructor checks here if we
11594         are named like the class;  This will help provider a better
11595         error.  The constructor path is taken when a type definition is
11596         not found, but most likely the user forgot to add the type, so
11597         report that rather than the constructor error.
11598
11599 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11600
11601         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11602         allocations.
11603
11604 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11605
11606         * cs-parser.jay: Add cleanup call.
11607
11608 2003-01-13  Duncan Mak  <duncan@ximian.com>
11609
11610         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11611         consistent with other methods.
11612
11613 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11614
11615         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11616
11617 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11618
11619         * attribute.cs: only set GuidAttr to true when we have a
11620         GuidAttribute.
11621
11622 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11623
11624         * ecore.cs:
11625         * expression.cs:
11626         * typemanager.cs: fixes to allow mcs compile corlib with the new
11627         Type.IsSubclassOf fix.
11628
11629 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11630
11631         * expression.cs (LocalVariableReference.DoResolve): Classify a
11632         constant as a value, not as a variable.   Also, set the type for
11633         the variable.
11634
11635         * cs-parser.jay (fixed_statement): take a type instead of a
11636         pointer_type, so we can produce a better error message later.
11637
11638         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11639         as an error.  
11640
11641         (For.DoEmit): Make inifinite loops have a
11642         non-conditional branch back.
11643
11644         (Fixed.DoEmit): First populate the pinned variables, then emit the
11645         statement, then clear the variables.  Before I was emitting the
11646         code once for each fixed piece.
11647
11648
11649 2003-01-08  Martin Baulig  <martin@ximian.com>
11650
11651         * statement.cs (FlowBranching.MergeChild): A break in a
11652         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11653
11654 2003-01-08  Martin Baulig  <martin@ximian.com>
11655
11656         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11657         lives in the same number space than `param_map'.  Fixes #36154.
11658
11659 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11660
11661         * cs-parser.jay (constructor_declaration): Set the
11662         Constructor.ModFlags before probing for it.  This makes the
11663         compiler report 514, 515 and 132 (the code was there, but got
11664         broken). 
11665
11666         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11667         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11668         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11669
11670 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11671
11672         * enum.cs: create the enum static fields using the enum type.
11673
11674 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11675
11676         * class.cs: don't try to create the ParamBuilder for the return
11677         type if it's not needed (and handle it breaking for the ms runtime
11678         anyway).
11679
11680 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11681
11682         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11683
11684 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11685
11686         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11687         the command.   This showed up while compiling the JANET source
11688         code, which used \r as its only newline separator.
11689
11690 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11691
11692         * class.cs (Method.Define): If we are an operator (because it
11693         reuses our code), then set the SpecialName and HideBySig.  #36128
11694
11695 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11696
11697         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11698         exception, report error 120 `object reference required'.
11699
11700         * driver.cs: Add --pause option, used during to measure the size
11701         of the process as it goes with --timestamp.
11702
11703         * expression.cs (Invocation.DoResolve): Do not allow methods with
11704         SpecialName to be invoked.
11705
11706 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11707
11708         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11709         number before adding it.
11710
11711 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11712
11713         * ecore.cs (StandardImplicitConversion): When in an unsafe
11714         context, we allow conversion between void * to any other pointer
11715         type. This fixes bug #35973.
11716
11717 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11718
11719         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11720         is not thrown when extensionless outputs are used 
11721
11722 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11723
11724         * rootcontext.cs: fixed compilation of corlib.
11725
11726 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11727
11728         * attribute.cs (Attributes.Contains): Add new method.
11729
11730         * class.cs (MethodCore.LabelParameters): if the parameter is an
11731         `out' parameter, check that no attribute `[In]' has been passed.
11732
11733         * enum.cs: Handle the `value__' name in an enumeration.
11734
11735 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11736
11737         * decl.cs: Added special case to allow overrides on "protected
11738         internal" methods
11739
11740 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11741
11742         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11743         since it makes much more sense.
11744
11745         (Attributes.ctor): Don't require a Location parameter.
11746
11747         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11748
11749         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11750         since we already have that information per attribute.
11751
11752         * everywhere : make appropriate changes.
11753
11754         * class.cs (LabelParameters): Write the code which actually
11755         applies attributes to the return type. We can't do this on the MS
11756         .NET runtime so we flag a warning in the case an exception is
11757         thrown.
11758
11759 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11760
11761         * const.cs: Handle implicit null conversions here too.
11762
11763 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11764
11765         * class.cs (MethodCore.LabelParameters): Remove the extra
11766         Type [] parameter since it is completely unnecessary. Instead
11767         pass in the method's attributes so that we can extract
11768         the "return" attribute.
11769
11770 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11771
11772         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11773         of ignoring it and letting the compile continue.
11774
11775         * typemanager.cs (ChangeType): use an extra argument to return an
11776         error condition instead of throwing an exception.
11777
11778 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11779
11780         * expression.cs (Unary.TryReduce): mimic the code for the regular
11781         code path.  Perform an implicit cast in the cases where we can
11782         implicitly convert to one of the integral types, and then reduce
11783         based on that constant.   This fixes bug #35483.
11784
11785 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11786
11787         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11788
11789 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11790
11791         * namespace.cs: fixed bug #35489.
11792
11793 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11794
11795         * class.cs: Remove some dead code.
11796
11797         * cs-parser.jay: Estimate the number of methods needed
11798         (RootContext.MethodCount);
11799
11800         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11801         numbers instead of StringBuilders.
11802
11803         * support.cs (PtrHashtable): Add constructor with initial size;
11804         We can now reduce reallocations of the method table.
11805
11806 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11807
11808         * attribute.cs (ApplyAttributes): Keep track of the emitted
11809         attributes on a per-target basis. This fixes bug #35413.
11810
11811 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11814         default to the Windows 1252 encoding.
11815
11816         (UnixParseOption): Support version, thanks to Alp for the missing
11817         pointer. 
11818
11819         * AssemblyInfo.cs: Add nice assembly information.
11820
11821         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11822         (bug 35169).
11823
11824         * cs-parser.jay: Allow a trailing comma before the close bracked
11825         in the attribute_section production.
11826
11827         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11828         address of the instance was being taken, I will take this out,
11829         because we take the address of the object immediately here.
11830
11831 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11832
11833         * typemanager.cs (AreMultipleAllowed): Take care of the most
11834         obvious case where attribute type is not in the current assembly -
11835         stupid me ;-)
11836
11837 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11838
11839         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11840         definitions, instead of doing that afterwards.  
11841
11842         Also we use a nice little hack, depending on the constructor, we
11843         know if we are a "composed" name or a simple name.  Hence, we
11844         avoid the IndexOf test, and we avoid 
11845
11846         * codegen.cs: Add code to assist in a bug reporter to track down
11847         the source of a compiler crash. 
11848
11849 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11850
11851         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11852         types have been emitted for a given element and flag an error
11853         if something which does not have AllowMultiple set is used more
11854         than once.
11855
11856         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11857         attribute types and their corresponding AllowMultiple properties
11858
11859         (AreMultipleAllowed): Check the property for a given type.
11860
11861         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11862         property in the case we have a TypeContainer.
11863
11864         (Attributes.AddAttribute): Detect duplicates and just skip on
11865         adding them. This trivial fix catches a pretty gross error in our
11866         attribute emission - global attributes were being emitted twice!
11867
11868         Bugzilla bug #33187 is now fixed.
11869
11870 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11871
11872         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11873         instead of pp_and).
11874
11875         * expression.cs (Binary.ResolveOperator): I can only use the
11876         Concat (string, string, string) and Concat (string, string,
11877         string, string) if the child is actually a concatenation of
11878         strings. 
11879
11880 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11881
11882         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11883         context where we need a 2-character lookahead.
11884
11885         * pending.cs (PendingImplementation): Rework so we can keep track
11886         of interface types all the time, and flag those which were
11887         implemented by parents as optional.
11888
11889 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * expression.cs (Binary.ResolveOperator): Use
11892         String.Concat(string,string,string) or
11893         String.Concat(string,string,string,string) when possible. 
11894
11895         * typemanager: More helper methods.
11896
11897
11898 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11899
11900         * pending.cs: remove the bogus return from GetMissingInterfaces()
11901         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11902
11903 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11904
11905         * namespace.cs: avoid duplicated 'using xxx' being added to
11906         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11907         when we get more than one 'using' statement for the same namespace.
11908         Report a CS0105 warning for it.
11909
11910 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11913         of calling getChar/putback, uses internal knowledge of it.    
11914
11915         (xtoken): Reorder tokenizer so most common patterns are checked
11916         first.  This reduces the compilation time in another 5% (from 8.11s
11917         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11918
11919         The parsing time is 22% of the compilation in mcs, and from that
11920         64% is spent on the tokenization process.  
11921
11922         I tried using a binary search for keywords, but this is slower
11923         than the hashtable.  Another option would be to do a couple of
11924         things:
11925
11926                 * Not use a StringBuilder, instead use an array of chars,
11927                   with a set value.  Notice that this way we could catch
11928                   the 645 error without having to do it *afterwards*.
11929
11930                 * We could write a hand-parser to avoid the hashtable
11931                   compares altogether.
11932
11933         The identifier consumption process takes 37% of the tokenization
11934         time.  Another 15% is spent on is_number.  56% of the time spent
11935         on is_number is spent on Int64.Parse:
11936
11937                 * We could probably choose based on the string length to
11938                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11939                   computations. 
11940
11941         Another 3% is spend on wrapping `xtoken' in the `token' function.
11942
11943         Handle 0xa0 as whitespace (#34752)
11944
11945 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11946
11947         * typemanager.cs (IsCLRType): New routine to tell whether a type
11948         is one of the builtin types.  
11949
11950         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11951         typecode in more places instead of doing pointer comparissions.
11952         We could leverage some knowledge about the way the typecodes are
11953         laid out.
11954
11955         New code to cache namespaces in assemblies, it is currently not
11956         invoked, to be used soon.
11957
11958         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11959
11960         * expression.cs (Binary.ResolveOperator): specially handle
11961         strings, and do not perform user-defined operator overloading for
11962         built-in types.
11963
11964 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11965
11966         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11967         internalcall as it is a pretty simple operation;  Avoid whenever
11968         possible to call Char.IsLetter.
11969
11970         (consume_identifier): Cut by half the number of
11971         hashtable calls by merging the is_keyword and GetKeyword behavior.
11972
11973         Do not short-circuit, because if we do, we
11974         report errors (ie, #if false && true would produce an invalid
11975         directive error);
11976
11977
11978 2002-11-24  Martin Baulig  <martin@ximian.com>
11979
11980         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11981         check constant ranges and report a CS0221.  Fixes #33186.
11982
11983 2002-11-24  Martin Baulig  <martin@ximian.com>
11984
11985         * cs-parser.jay: Make this work for uninitialized variable
11986         declarations in the `for' initializer.  Fixes #32416.
11987
11988 2002-11-24  Martin Baulig  <martin@ximian.com>
11989
11990         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11991         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11992
11993 2002-11-24  Martin Baulig  <martin@ximian.com>
11994
11995         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11996         argument; if true, we also check for user-defined conversions.
11997         This is only needed if both arguments are of a user-defined type.
11998         Fixes #30443, added test-175.cs.
11999         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12000
12001         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12002
12003 2002-11-24  Martin Baulig  <martin@ximian.com>
12004
12005         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12006         function to get the store opcode.
12007         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12008         only emit the Ldelema if the store opcode is Stobj.  You must run
12009         both test-34 and test-167 to test this.  Fixes #34529.
12010
12011 2002-11-23  Martin Baulig  <martin@ximian.com>
12012
12013         * ecore.cs (Expression.MemberLookup): Added additional
12014         `qualifier_type' argument which is used when we're being called
12015         from MemberAccess.DoResolve() and null if we're called from a
12016         SimpleName lookup.
12017         (Expression.MemberLookupFailed): New method to report errors; this
12018         does the CS1540 check and reports the correct error message.
12019
12020         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12021         argument for the CS1540 check and redone the way how we're dealing
12022         with private members.  See the comment in the source code for details.
12023         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12024         `closure_start_type' to `closure_qualifier_type' and check whether
12025         it's not null.  It was not this filter being broken, it was just
12026         being called with the wrong arguments.
12027
12028         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12029         and pass it the correct `qualifier_type'; this also does the error
12030         handling for us.
12031
12032 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12033
12034         * expression.cs (Invocation.EmitParams): If the we are dealing
12035         with a non-built-in value type, load its address as well.
12036
12037         (ArrayCreation): Use a a pretty constant instead
12038         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12039         static initializers.  
12040
12041         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12042         because they are not really value types, just glorified integers. 
12043
12044         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12045
12046         * ecore.cs: Remove redundant code for enumerations, make them use
12047         the same code path as everything else, fixes the casting issue
12048         with enumerations in Windows.Forms.
12049
12050         * attribute.cs: Do only cast to string if it is a string, the
12051         validation happens later.
12052
12053         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12054         people upgrade their corlibs.
12055
12056         * ecore.cs: Oops, enumerations were not following the entire code path
12057
12058 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12059
12060         * typemanager.cs (FilterWithClosure): Commented out the test for
12061         1540 in typemanager.cs, as it has problems when accessing
12062         protected methods from a parent class (see test-174.cs). 
12063
12064         * attribute.cs (Attribute.ValidateGuid): new method.
12065         (Attribute.Resolve): Use above.
12066
12067 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12068
12069         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12070
12071         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12072         handling for enumerations, as we only needed the TypeContainer
12073         functionality to begin with (this is required for the fix below to
12074         work for enums that reference constants in a container class for
12075         example). 
12076
12077         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12078
12079         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12080         a valid TypeBuilder to perform lookups on.o
12081
12082         * class.cs (InheritableMemberSignatureCompare): Use true in the
12083         call to GetGetMethod and GetSetMethod, because we are comparing
12084         the signature, and we need to get the methods *even* if they are
12085         private. 
12086
12087         (PropertyBase.CheckBase): ditto.
12088
12089         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12090         GotoCase.Resolve): Use Peel on EmpytCasts.
12091
12092         * ecore.cs (EmptyCast): drop child, add Peel method.
12093
12094 2002-11-17  Martin Baulig  <martin@ximian.com>
12095
12096         * ecore.cs (EmptyCast.Child): New public property.
12097
12098         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12099         label resolved to an EmptyCast.  Fixes #34162.
12100         (GotoCase.Resolve): Likewise.
12101         (Block.EmitMeta): Likewise.
12102
12103 2002-11-17  Martin Baulig  <martin@ximian.com>
12104
12105         * expression.cs (Invocation.BetterConversion): Prefer int over
12106         uint; short over ushort; long over ulong for integer literals.
12107         Use ImplicitConversionExists instead of StandardConversionExists
12108         since we also need to check for user-defined implicit conversions.
12109         Fixes #34165.  Added test-173.cs.
12110
12111 2002-11-16  Martin Baulig  <martin@ximian.com>
12112
12113         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12114         with the `true' and `false' literals.  Fixes #33151.
12115
12116 2002-11-16  Martin Baulig  <martin@ximian.com>
12117
12118         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12119         October 22nd; don't do the cs1540 check for static members.
12120
12121         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12122         now using our own filter here and doing the cs1540 check again.
12123
12124 2002-11-16  Martin Baulig  <martin@ximian.com>
12125
12126         * support.cs (InternalParameters): Don't crash if we don't have
12127         any fixed parameters.  Fixes #33532.
12128
12129 2002-11-16  Martin Baulig  <martin@ximian.com>
12130
12131         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12132         when looking up static methods to make this work on Windows.
12133         Fixes #33773.
12134
12135 2002-11-16  Martin Baulig  <martin@ximian.com>
12136
12137         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12138         a setter rather than using PropertyInfo.CanWrite.
12139
12140 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12141
12142         * class.cs: Allow acces to block member by subclasses. Fixes build
12143         breaker.
12144
12145 2002-11-14  Martin Baulig  <martin@ximian.com>
12146
12147         * class.cs (Constructor.Emit): Added the extern/block check.
12148         Fixes bug #33678.
12149
12150 2002-11-14  Martin Baulig  <martin@ximian.com>
12151
12152         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12153         iteration while looking for indexers, this is needed because the
12154         indexer may have a different name in our base classes.  Fixed the
12155         error reporting (no indexers at all, not get accessor, no
12156         overloaded match).  Fixes bug #33089.
12157         (IndexerAccess.DoResolveLValue): Likewise.
12158
12159 2002-11-14  Martin Baulig  <martin@ximian.com>
12160
12161         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12162         indexers.  Fixes the first part of bug #33089.
12163         (MethodSignature.InheritableMemberSignatureCompare): Added support
12164         for properties.
12165
12166 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12167
12168         * attribute.cs (Attribute.Resolve): Catch the
12169         NullReferenceException and report it since it isn't supposed to
12170         happen. 
12171
12172 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12173
12174         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12175         LogicalOr and LogicalAnd that can benefit from recursively
12176         handling EmitBranchable.  The code now should be nice for Paolo.
12177
12178 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12181         the Type lookups, as we perform quite a number of lookups on
12182         non-Types.  This can be removed once we can deterministically tell
12183         whether we have a type or a namespace in advance.
12184
12185         But this might require special hacks from our corlib.
12186
12187         * TODO: updated.
12188
12189         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12190         and double which avoids a conversion from an integer to a double.
12191
12192         * expression.cs: tiny optimization, avoid calling IsConstant,
12193         because it effectively performs the lookup twice.
12194
12195 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12196
12197         But a bogus return here to keep the semantics of the old code
12198         until the Mono runtime is fixed.
12199
12200         * pending.cs (GetMissingInterfaces): New method used to remove all
12201         the interfaces that are already implemented by our parent
12202         classes from the list of pending methods. 
12203
12204         * interface.cs: Add checks for calls after ResolveTypeExpr.
12205
12206 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12207
12208         * class.cs (Class.Emit): Report warning 67: event not used if the
12209         warning level is beyond 3.
12210
12211         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12212         being a NullLiteral.
12213
12214         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12215         specifiers. 
12216
12217         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12218         path that might fail if a type can not be resolved.
12219
12220         * expression.cs (Binary.Emit): Emit unsigned versions of the
12221         operators. 
12222
12223         * driver.cs: use error 5.
12224
12225 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12226
12227         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12228
12229 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * cs-parser.jay (switch_section): A beautiful patch from Martin
12232         Baulig that fixed 33094.
12233
12234 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12237         Check whether the base is abstract and report an error if so.
12238
12239         * expression.cs (IndexerAccess.DoResolveLValue,
12240         IndexerAccess.DoResolve): ditto. 
12241
12242         (Invocation.DoResolve): ditto.
12243
12244         (Invocation.FullMethodDesc): Improve the report string.
12245
12246         * statement.cs (Block): Eliminate IsVariableDefined as it is
12247         basically just a wrapper for GetVariableInfo.
12248
12249         * ecore.cs (SimpleName): Use new 
12250
12251         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12252         type, as we return the actual parameter ref/unref state on a
12253         different call.
12254
12255 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12256
12257         * support.cs: Return proper flags REF/OUT fixing the previous
12258         commit.  
12259
12260         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12261         not used to mean `ref' but `ref or out' in ParameterReference
12262
12263         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12264         full type signature instead of calling TypeManger.CSharpName
12265         ourselves. 
12266
12267         * support.cs (InternalParameters.ParameterDesc): Do not compare
12268         directly to the modflags, because REF/OUT will actually be bitsets
12269         if set. 
12270
12271         * delegate.cs (VerifyMethod): Check also the modifiers.
12272
12273         * cs-tokenizer.cs: Fix bug where floating point values with an
12274         exponent where a sign was missing was ignored.
12275
12276         * driver.cs: Allow multiple assemblies to be specified in a single
12277         /r: argument
12278
12279 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12280
12281         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12282         because identifiers after a parenthesis would end up in this kind
12283         of production, and we needed to desamiguate it for having casts
12284         like:
12285
12286                 (UserDefinedType *) xxx
12287
12288 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12289
12290         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12291         we should set on the Bindingflags.NonPublic, but not turn on
12292         private_ok.  private_ok controls whether a Private member is
12293         returned (this is chekced on the filter routine), while the
12294         BindingFlags.NonPublic just controls whether private/protected
12295         will be allowed.   This fixes the problem part of the problem of
12296         private properties being allowed to be used in derived classes.
12297
12298         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12299         so we can call the children DoResolveLValue method (this will
12300         properly signal errors on lvalue assignments to base properties)
12301
12302         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12303         getter are null, and we have a property info, we know that this
12304         happened because the lookup failed, so we report an error 122 for
12305         protection level violation.
12306
12307         We also silently return if setter and getter are null in the
12308         resolve functions, this condition only happens if we have flagged
12309         the error before.  This is the other half of the problem. 
12310
12311         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12312         not have accessibility information, that is why we were returning
12313         true in the filter function in typemanager.cs.
12314
12315         To properly report 122 (property is inaccessible because of its
12316         protection level) correctly, we report this error in ResolveAccess
12317         by failing if both the setter and the getter are lacking (ie, the
12318         lookup failed). 
12319
12320         DoResolve and DoLResolve have been modified to check for both
12321         setter/getter being null and returning silently, the reason being
12322         that I did not want to put the knowledge about this error in upper
12323         layers, like:
12324
12325         int old = Report.Errors;
12326         x = new PropertyExpr (...);
12327         if (old != Report.Errors)
12328                 return null;
12329         else
12330                 return x;
12331
12332         So the property expr is returned, but it is invalid, so the error
12333         will be flagged during the resolve process. 
12334
12335         * class.cs: Remove InheritablePropertySignatureCompare from the
12336         class, as we no longer depend on the property signature to compute
12337         whether it is possible to implement a method or not.
12338
12339         The reason is that calling PropertyInfo.GetGetMethod will return
12340         null (in .NET, in Mono it works, and we should change this), in
12341         cases where the Get Method does not exist in that particular
12342         class.
12343
12344         So this code:
12345
12346         class X { public virtual int A { get { return 1; } } }
12347         class Y : X { }
12348         class Z : Y { public override int A { get { return 2; } } }
12349
12350         Would fail in Z because the parent (Y) would not have the property
12351         defined.  So we avoid this completely now (because the alternative
12352         fix was ugly and slow), and we now depend exclusively on the
12353         method names.
12354
12355         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12356         reference method, instead of using the property.
12357
12358         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12359         routines are gone now.
12360
12361         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12362         names, they were incorrectly named.
12363
12364         * cs-tokenizer.cs: Return are more gentle token on failure. 
12365
12366         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12367         had an out-of-sync index variable, which caused it to remove from
12368         the list of pending methods the wrong method sometimes.
12369
12370 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12373         CanWrite, because those refer to this particular instance of the
12374         property, and do not take into account the fact that we can
12375         override single members of a property.
12376
12377         Constructor requires an EmitContext.  The resolution process does
12378         not happen here, but we need to compute the accessors before,
12379         because the resolution does not always happen for properties.
12380
12381         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12382         subclass, before we did not update this flag, but we did update
12383         bindingflags. 
12384
12385         (GetAccessors): Drop this routine, as it did not work in the
12386         presence of partially overwritten set/get methods. 
12387
12388         Notice that this broke the cs1540 detection, but that will require
12389         more thinking. 
12390
12391 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12392
12393         * class.cs:
12394         * codegen.cs:
12395         * driver.cs: issue a warning instead of an error if we don't support
12396         debugging for the platform. Also ignore a couple of errors that may
12397         arise when trying to write the symbols. Undo my previous patch.
12398
12399 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12400
12401         * driver.cs: ignore /debug switch except for Unix platforms.
12402
12403 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12404
12405         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12406
12407 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12408
12409         * driver.cs: Do not make mcs-debug conditional, so we do not break
12410         builds that use it.
12411
12412         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12413         review this patch.  But basically after all the children variables
12414         have been merged, the value of "Breaks" was not being set to
12415         new_breaks for Switch blocks.  I think that it should be set after
12416         it has executed.  Currently I set this to the value of new_breaks,
12417         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12418         conservative, but I do not understand this code very well.
12419
12420         I did not break anything in the build, so that is good ;-)
12421
12422         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12423
12424 2002-10-20  Mark Crichton  <crichton@gimp.org>
12425
12426         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12427
12428 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12429
12430         * cfold.cs: Fixed compile blocker.
12431
12432 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12433
12434         * driver.cs: I was chekcing the key, not the file.
12435
12436 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12437
12438         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12439         message that we were generating - we just need to silently return
12440         a null.
12441
12442 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12443
12444         * class.cs (Event.Define): Change my previous commit, as this
12445         breaks the debugger.  This is a temporary hack, as it seems like
12446         the compiler is generating events incorrectly to begin with.
12447
12448         * expression.cs (Binary.ResolveOperator): Added support for 
12449         "U operator - (E x, E y)"
12450
12451         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12452         y)".
12453
12454         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12455         init-only variables, but this path did not take into account that
12456         there might be also instance readonly variables.  Correct this
12457         problem. 
12458
12459         This fixes bug 32253
12460
12461         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12462         delegates as well.
12463
12464         * driver.cs: Change the extension for modules to `netmodule'
12465
12466         * cs-parser.jay: Improved slightly the location tracking for
12467         the debugger symbols.
12468
12469         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12470         modifiers that were specified instead of the hardcoded value
12471         (FamAndAssem).  This was basically ignoring the static modifier,
12472         and others.  Fixes 32429.
12473
12474         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12475         fixed a bug in the process (32476)
12476
12477         * expression.cs (ArrayAccess.EmitAssign): Patch from
12478         hwang_rob@yahoo.ca that fixes bug 31834.3
12479
12480 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12481
12482         * driver.cs: Make the module extension .netmodule.
12483
12484 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * driver.cs: Report an error if the resource file is not found
12487         instead of crashing.
12488
12489         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12490         false, like Emit does.
12491
12492 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12493
12494         * typemanager.cs: Remove unused private member.  Also reported mcs
12495         bug to report this as a warning like csc.
12496
12497 2002-10-15  Martin Baulig  <martin@gnome.org>
12498
12499         * statement.cs (Statement.Emit): Made this a virtual method; emits
12500         the line number info and calls DoEmit().
12501         (Statement.DoEmit): New protected abstract method, formerly knows
12502         as Statement.Emit().
12503
12504         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12505
12506 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12507
12508         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12509         have fixed a remaining problem: not every AddXXXX was adding a
12510         fully qualified name.  
12511
12512         Now everyone registers a fully qualified name in the DeclSpace as
12513         being defined instead of the partial name.  
12514
12515         Downsides: we are slower than we need to be due to the excess
12516         copies and the names being registered this way.  
12517
12518         The reason for this is that we currently depend (on the corlib
12519         bootstrap for instance) that types are fully qualified, because
12520         we dump all the types in the namespace, and we should really have
12521         types inserted into the proper namespace, so we can only store the
12522         basenames in the defined_names array.
12523
12524 2002-10-10  Martin Baulig  <martin@gnome.org>
12525
12526         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12527         from bug #31834, see the bug report for a testcase which is
12528         miscompiled.
12529
12530 2002-10-10  Martin Baulig  <martin@gnome.org>
12531
12532         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12533         flow analysis code for this.
12534
12535         * statement.cs (Do, While, For): Tell the flow analysis code about
12536         infinite loops.
12537         (FlowBranching.UsageVector): Added support for infinite loops.
12538         (Block.Resolve): Moved the dead code elimination here and use flow
12539         analysis to do it.
12540
12541 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12542
12543         * class.cs (Field.Define): Catch cycles on struct type
12544         definitions. 
12545
12546         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12547         fields if the fields are static.  We only need to check instance
12548         fields. 
12549
12550         * expression.cs (As.DoResolve): Test for reference type.
12551
12552         * statement.cs (Using.ResolveExpression): Use
12553         ConvertImplicitRequired, not ConvertImplicit which reports an
12554         error on failture
12555         (Using.ResolveLocalVariableDecls): ditto.
12556
12557         * expression.cs (Binary.ResolveOperator): Report errors in a few
12558         places where we had to.
12559
12560         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12561
12562 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12563
12564         * expression.cs: Use StoreFromPtr instead of extracting the type
12565         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12566
12567         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12568         an enumeration value to a System.Enum, but System.Enum is not a
12569         value type, but an class type, so we need to box.
12570
12571         (Expression.ConvertExplicit): One codepath could return
12572         errors but not flag them.  Fix this.  Fixes #31853
12573
12574         * parameter.cs (Resolve): Do not allow void as a parameter type.
12575
12576 2002-10-06  Martin Baulig  <martin@gnome.org>
12577
12578         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12579         if it's a class type and not a struct.  Fixes #31815.
12580
12581 2002-10-06  Martin Baulig  <martin@gnome.org>
12582
12583         * statement.cs: Reworked the flow analysis code a bit to make it
12584         usable for dead code elimination.
12585
12586 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12587
12588         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12589
12590 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12591
12592         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12593         to fix the test 165, will investigate deeper.
12594
12595 2002-10-04  Martin Baulig  <martin@gnome.org>
12596
12597         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12598         finally blocks actually work.
12599         (Try.Resolve): We don't need to create a sibling for `finally' if
12600         there is no finally block.
12601
12602 2002-10-04  Martin Baulig  <martin@gnome.org>
12603
12604         * class.cs (Constructor.Define): The default accessibility for a
12605         non-default constructor is private, not public.
12606
12607 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12608
12609         * class.cs (Constructor): Make AllowedModifiers public, add
12610         EXTERN.
12611
12612         * cs-parser.jay: Perform the modifiers test here, as the
12613         constructor for the Constructor class usually receives a zero
12614         because of the way we create it (first we create, later we
12615         customize, and we were never checking the modifiers).
12616
12617         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12618         is a version of LookupTypeReflection that includes the type-name
12619         cache.  This can be used as a fast path for functions that know
12620         the fully qualified name and are only calling into *.GetType() to
12621         obtain a composed type.
12622
12623         This is also used by TypeManager.LookupType during its type
12624         composition.
12625
12626         (LookupType): We now also track the real type name, as sometimes
12627         we can get a quey for the real type name from things like
12628         ComposedCast.  This fixes bug 31422.
12629
12630         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12631         complete type fullname, it does not have to go through the type
12632         resolution system to obtain the composed version of the type (for
12633         obtaining arrays or pointers).
12634
12635         (Conditional.Emit): Use the EmitBoolExpression to
12636         generate nicer code, as requested by Paolo.
12637
12638         (ArrayCreation.CheckIndices): Use the patch from
12639         hwang_rob@yahoo.ca to validate the array initializers. 
12640
12641 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * class.cs (ConstructorInitializer.Emit): simplify code by using
12644         Invocation.EmitCall, and at the same time, fix the bugs in calling
12645         parent constructors that took variable arguments. 
12646
12647         * ecore.cs (Expression.ConvertNumericExplicit,
12648         Expression.ImplicitNumericConversion): Remove the code that
12649         manually wrapped decimal (InternalTypeConstructor call is now gone
12650         as well).
12651
12652         * expression.cs (Cast.TryReduce): Also handle decimal types when
12653         trying to perform a constant fold on the type.
12654
12655         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12656
12657         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12658         that only turned off an error report, and did nothing else. 
12659
12660 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12661
12662         * driver.cs: Handle and ignore /fullpaths
12663
12664 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * expression.cs (Binary.ResolveOperator): Catch the case where
12667         DoNumericPromotions returns true, 
12668
12669         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12670
12671 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12674         report error 70.
12675
12676 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12677
12678         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12679         conversion exists, but it is also required that the conversion be
12680         performed.  This manifested in "(Type64Enum) 2".  
12681
12682         * class.cs (TypeManager.AddMethod): The fix is not to change
12683         AddEnum, because that one was using a fully qualified name (every
12684         DeclSpace derivative does), but to change the AddMethod routine
12685         that was using an un-namespaced name.  This now correctly reports
12686         the duplicated name.
12687
12688         Revert patch until I can properly fix it.  The issue
12689         is that we have a shared Type space across all namespaces
12690         currently, which is wrong.
12691
12692         Options include making the Namespace a DeclSpace, and merge
12693         current_namespace/current_container in the parser.
12694
12695 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12696
12697         * cs-parser.jay: Improve error reporting when we get a different
12698         kind of expression in local_variable_type and
12699         local_variable_pointer_type. 
12700
12701         Propagate this to avoid missleading errors being reported.
12702
12703         * ecore.cs (ImplicitReferenceConversion): treat
12704         TypeManager.value_type as a target just like object_type.   As
12705         code like this:
12706
12707         ValueType v = 1;
12708
12709         Is valid, and needs to result in the int 1 being boxed before it
12710         is assigned to the value type v.
12711
12712         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12713         to validate the enumeration name.
12714
12715         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12716         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12717         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12718
12719         * ecore.cs (TryImplicitIntConversion): When doing an
12720         implicit-enumeration-conversion, check if the type is 64-bits and
12721         perform a conversion before passing to EnumConstant.
12722
12723 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12724
12725         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12726         report ambiguous type references.  Unlike the MS version, we
12727         report what the ambiguity is.   Innovation at work ;-)
12728
12729         (DeclSpace.FindType): Require a location argument to
12730         display when we display an ambiguous error.
12731
12732         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12733
12734         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12735
12736         * expression.cs (EmitDynamicInitializers): Apply patch from
12737         hwang_rob@yahoo.ca that fixes the order in which we emit our
12738         initializers. 
12739
12740 2002-09-21  Martin Baulig  <martin@gnome.org>
12741
12742         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12743         delegate takes no arguments.
12744
12745 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12746
12747         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12748         from integers.
12749
12750         * expression.cs: Extract the underlying type.
12751
12752         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12753
12754         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12755
12756 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12757
12758         * class.cs (TypeContainer.DefineType): We can not use the nice
12759         PackingSize with the size set to 1 DefineType method, because it
12760         will not allow us to define the interfaces that the struct
12761         implements.
12762
12763         This completes the fixing of bug 27287
12764
12765         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12766         means also structs.  This fixes part of the problem. 
12767         (Expresion.ImplicitReferenceConversionExists): ditto.
12768
12769         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12770         error if there were no errors reported during the type lookup
12771         process, to avoid duplicates or redundant errors.  Without this
12772         you would get an ambiguous errors plus a type not found.  We have
12773         beaten the user enough with the first error.  
12774
12775         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12776         reference. 
12777
12778         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12779         during the resolution process, stop the lookup, this avoids
12780         repeated error reports (same error twice).
12781
12782         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12783
12784         * typemanager.cs (LookupType): Redo the type lookup code to match
12785         the needs of System.Reflection.  
12786
12787         The issue is that System.Reflection requires references to nested
12788         types to begin with a "+" sign instead of a dot.  So toplevel
12789         types look like: "NameSpace.TopLevelClass", and nested ones look
12790         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12791         levels. 
12792
12793 2002-09-19  Martin Baulig  <martin@gnome.org>
12794
12795         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12796         says that a method always returns or always throws an exception,
12797         don't report the CS0161.
12798
12799         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12800         set `Returns = new_returns'.
12801
12802 2002-09-19  Martin Baulig  <martin@gnome.org>
12803
12804         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12805         to an enum constant, check for a CS0176.
12806
12807 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12808
12809         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12810         for operators that must be in pairs and report errors.
12811
12812         * ecore.cs (SimpleName.DoResolveType): During the initial type
12813         resolution process, when we define types recursively, we must
12814         check first for types in our current scope before we perform
12815         lookups in the enclosing scopes.
12816
12817         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12818
12819         (Invocation.VerifyArgumentsCompat): Call
12820         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12821         I thought we were supposed to always call this, but there are a
12822         few places in the code where we dont do it.
12823
12824 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12825
12826         * driver.cs: Add support in -linkres and -resource to specify the
12827         name of the identifier.
12828
12829 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12830
12831         * ecore.cs (StandardConversionExists): Sync with the conversion
12832         code: allow anything-* to void* conversions.
12833
12834         (FindMostSpecificSource): Use an Expression argument
12835         instead of a Type, because we might be handed over a Literal which
12836         gets a few more implicit conversions that plain types do not.  So
12837         this information was being lost.
12838
12839         Also, we drop the temporary type-holder expression when not
12840         required.
12841
12842 2002-09-17  Martin Baulig  <martin@gnome.org>
12843
12844         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12845         this is an explicit interface implementation.
12846
12847 2002-09-17  Martin Baulig  <martin@gnome.org>
12848
12849         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12850         different `IndexerName' attributes.
12851
12852         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12853         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12854         virtual CommonResolve().
12855
12856 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12857
12858         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12859         and convert that to the UnderlyingType.
12860
12861         * statement.cs (Foreach.Resolve): Indexers are just like variables
12862         or PropertyAccesses.
12863
12864         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12865         inside quoted strings, we were not doing this before.
12866
12867 2002-09-16  Martin Baulig  <martin@gnome.org>
12868
12869         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12870         resolve it.  This is needed for the definite assignment check of the
12871         instance expression, fixes bug #29846.
12872         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12873
12874 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12875
12876         * parameter.cs: Fix compile error.  Cannot reference static member
12877         from an instance object.  Is this an mcs bug?
12878
12879 2002-09-14  Martin Baulig  <martin@gnome.org>
12880
12881         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12882         multiple times.  Fixes bug #30295, added test-166.cs.
12883
12884 2002-09-14  Martin Baulig  <martin@gnome.org>
12885
12886         * statement.cs (Block.Emit): Don't emit unreachable code.
12887         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12888         `break' statements.
12889         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12890
12891 2002-09-14  Martin Baulig  <martin@gnome.org>
12892
12893         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12894         is set.
12895
12896 2002-09-14  Martin Baulig  <martin@gnome.org>
12897
12898         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12899         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12900         be false on the ms runtime.
12901
12902 2002-09-13  Martin Baulig  <martin@gnome.org>
12903
12904         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12905         the CS0038 error message.
12906
12907 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12908
12909         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12910         constant inside, return it.
12911
12912 2002-09-12  Martin Baulig  <martin@gnome.org>
12913
12914         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12915         implicit conversion can be done between enum types.
12916
12917         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12918         check whether an implicit conversion to the current enum's UnderlyingType
12919         exists and report an error if not.
12920
12921         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12922         without debugging support.
12923
12924         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12925         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12926
12927 2002-09-12  Martin Baulig  <martin@gnome.org>
12928
12929         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12930
12931         * ecore.cs (IMemberExpr.DeclaringType): New property.
12932         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12933         nonstatic member of an outer type (CS0038).
12934
12935 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12936
12937         * driver.cs: Activate the using-error detector at warning level
12938         4 (at least for MS-compatible APIs).
12939
12940         * namespace.cs (VerifyUsing): Small buglett fix.
12941
12942         * pending.cs (PendingImplementation): pass the container pointer. 
12943
12944         * interface.cs (GetMethods): Allow for recursive definition.  Long
12945         term, I would like to move every type to support recursive
12946         definitions, not the current ordering mechanism that we have right
12947         now.
12948
12949         The situation is this: Attributes are handled before interfaces,
12950         so we can apply attributes to interfaces.  But some attributes
12951         implement interfaces, we will now handle the simple cases
12952         (recursive definitions will just get an error).  
12953
12954         * parameter.cs: Only invalidate types at the end if we fail to
12955         lookup all types.  
12956
12957 2002-09-09  Martin Baulig  <martin@gnome.org>
12958
12959         * ecore.cs (PropertyExpr.Emit): Also check for
12960         TypeManager.system_int_array_get_length so this'll also work when
12961         compiling corlib.  Fixes #30003.
12962
12963 2002-09-09  Martin Baulig  <martin@gnome.org>
12964
12965         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12966         and throw an exception if we can't get the type's size.  Fixed #30040,
12967         added test-165.cs.
12968
12969 2002-09-09  Martin Baulig  <martin@gnome.org>
12970
12971         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12972
12973         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12974         context.  Fixes bug #30027.
12975
12976         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12977         virtual functions.  Fixes bug #30043, added test-164.cs.
12978
12979 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12980
12981         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12982
12983 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12984
12985         * driver.cs: Use an object to get the windows codepage since it's not a
12986         static property.
12987
12988 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12989
12990         * statement.cs (For.Emit): for infinite loops (test == null)
12991         return whether there is a break inside, not always "true".
12992
12993         * namespace.cs (UsingEntry): New struct to hold the name of the
12994         using definition, the location where it is defined, and whether it
12995         has been used in a successful type lookup.
12996
12997         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12998         strings.
12999
13000         * decl.cs: ditto.
13001
13002 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13003
13004         * attribute.cs : Fix incorrect code which relied on catching
13005         a NullReferenceException to detect a null being passed in
13006         where an object was expected.
13007
13008 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13009
13010         * statement.cs (Try): flag the catch variable as assigned
13011
13012         * expression.cs (Cast): Simplified by using ResolveType instead of
13013         manually resolving.
13014
13015         * statement.cs (Catch): Fix bug by using ResolveType.
13016
13017 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13018
13019         * expression.cs (BetterConversion): Special case for when we have
13020         a NullLiteral as the argument and we have to choose between string
13021         and object types - we choose string the way csc does.
13022
13023         * attribute.cs (Attribute.Resolve): Catch the
13024         NullReferenceException and report error #182 since the Mono
13025         runtime no more has the bug and having this exception raised means
13026         we tried to select a constructor which takes an object and is
13027         passed a null.
13028
13029 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13030
13031         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13032         message (1502, 1503) when we can't locate a method after overload
13033         resolution. This is much more informative and closes the bug
13034         Miguel reported.
13035
13036         * interface.cs (PopulateMethod): Return if there are no argument
13037         types. Fixes a NullReferenceException bug.
13038
13039         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13040         expressions too. Previously we were checking only in one place for
13041         positional arguments leaving out named arguments.
13042
13043         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13044         type to the enum type is not allowed. Remove code corresponding to
13045         that.
13046
13047         (ConvertNumericExplicit): Allow explicit conversions from
13048         the underlying type to enum type. This precisely follows the spec
13049         and closes a bug filed by Gonzalo.
13050
13051 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13052
13053         * compiler.csproj:
13054         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13055
13056 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13057
13058         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13059         it was important that we stored the right value after the
13060         reduction in `converted'.
13061
13062 2002-09-04  Martin Baulig  <martin@gnome.org>
13063
13064         * location.cs (Location.SymbolDocument): Use full pathnames for the
13065         source files.
13066
13067 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13068
13069         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13070         of the expression resolve mechanism, because that will catch the
13071         SimpleName error failures.
13072
13073         (Conditional): If we can not resolve the
13074         expression, return, do not crash.
13075
13076 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13077
13078         * cs-tokenizer.cs:
13079         (location): display token name instead of its number.
13080
13081 2002-08-28  Martin Baulig  <martin@gnome.org>
13082
13083         * expression.cs (Binary.ResolveOperator): Don't silently return
13084         but return an error if an operator cannot be applied between two
13085         enum types.
13086
13087 2002-08-28  Martin Baulig  <martin@gnome.org>
13088
13089         * class.cs (Constructor.Define): Set the permission attributes
13090         correctly instead of making all constructors public.
13091
13092 2002-08-28  Martin Baulig  <martin@gnome.org>
13093
13094         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13095         for private members before reporting a CS0103; if we find anything,
13096         it's a CS0122.
13097
13098 2002-08-28  Martin Baulig  <martin@gnome.org>
13099
13100         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13101         to check whether `closure_start_type == closure_invocation_type',
13102         we also need to check whether `m.DeclaringType == closure_invocation_type'
13103         before bypassing the permission checks.  We might be accessing
13104         protected/private members from the base class.
13105         (TypeManager.RealMemberLookup): Only set private_ok if private
13106         members were requested via BindingFlags.NonPublic.
13107
13108         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13109
13110         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13111         MethodGroupExpr.IsExplicitImpl if appropriate.
13112         (Invocation.DoResolve): Don't report the CS0120 for explicit
13113         interface implementations.
13114
13115 2002-08-27  Martin Baulig  <martin@gnome.org>
13116
13117         * expression.cs (Invocation.DoResolve): If this is a static
13118         method and we don't have an InstanceExpression, we must report
13119         a CS0120.
13120
13121 2002-08-25  Martin Baulig  <martin@gnome.org>
13122
13123         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13124         `==' between a valuetype and an object.
13125
13126 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13127
13128         * ecore.cs (TypeExpr): Provide a ToString method.
13129
13130 2002-08-24  Martin Baulig  <martin@gnome.org>
13131
13132         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13133         now called proggie.dbg and it's a binary file.
13134
13135 2002-08-23  Martin Baulig  <martin@gnome.org>
13136
13137         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13138
13139 2002-08-23  Martin Baulig  <martin@gnome.org>
13140
13141         * struct.cs (MyStructInfo.ctor): Make this work with empty
13142         structs; it's not allowed to use foreach() on null.
13143
13144 2002-08-23  Martin Baulig  <martin@gnome.org>
13145
13146         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13147         writer the full pathname of the generated assembly.
13148
13149 2002-08-23  Martin Baulig  <martin@gnome.org>
13150
13151         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13152         A `finally' block never returns or breaks; improved handling of
13153         unreachable code.
13154
13155 2002-08-23  Martin Baulig  <martin@gnome.org>
13156
13157         * statement.cs (Throw.Resolve): Allow `throw null'.
13158
13159 2002-08-23  Martin Baulig  <martin@gnome.org>
13160
13161         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13162         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13163         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13164         MemberLookup would return a wrong event if this is an explicit
13165         interface implementation and the class has an event with the same
13166         name.
13167
13168 2002-08-23  Martin Baulig  <martin@gnome.org>
13169
13170         * statement.cs (Block.AddChildVariableNames): New public method.
13171         (Block.AddChildVariableName): Likewise.
13172         (Block.IsVariableNameUsedInChildBlock): Likewise.
13173         (Block.AddVariable): Check whether a variable name has already
13174         been used in a child block.
13175
13176         * cs-parser.jay (declare_local_variables): Mark all variable names
13177         from the current block as being used in a child block in the
13178         implicit block.
13179
13180 2002-08-23  Martin Baulig  <martin@gnome.org>
13181
13182         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13183         find the symbol writer.
13184
13185         * driver.cs: csc also allows the arguments to /define being
13186         separated by commas, not only by semicolons.
13187
13188 2002-08-23  Martin Baulig  <martin@gnome.org>
13189
13190         * interface.cs (Interface.GetMembers): Added static check for events.
13191
13192 2002-08-15  Martin Baulig  <martin@gnome.org>
13193
13194         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13195         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13196
13197         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13198         why the MethodData.EmitDestructor() change was necessary.
13199
13200 2002-08-20  Martin Baulig  <martin@gnome.org>
13201
13202         * class.cs (TypeContainer.FindMembers): Added static check for events.
13203
13204         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13205
13206         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13207         use Type.GetEvents(), not Type.FindMembers().
13208
13209 2002-08-20  Martin Baulig  <martin@gnome.org>
13210
13211         * decl.cs (MemberCache): Added a special method cache which will
13212         be used for method-only searched.  This ensures that a method
13213         search will return a MethodInfo with the correct ReflectedType for
13214         inherited methods.      
13215
13216 2002-08-20  Martin Baulig  <martin@gnome.org>
13217
13218         * decl.cs (DeclSpace.FindMembers): Made this public.
13219
13220 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13221
13222         * delegate.cs: fixed build on windows.
13223         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13224
13225 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13226
13227         * ecore.cs (StandardConversionExists): Return a false
13228         if we are trying to convert the void type to anything else
13229         since that is not allowed.
13230
13231         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13232         we flag error 70 in the event an event is trying to be accessed
13233         directly from outside the declaring type.
13234
13235 2002-08-20  Martin Baulig  <martin@gnome.org>
13236
13237         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13238         MemberCache from typemanager.cs to decl.cs.
13239
13240 2002-08-19  Martin Baulig  <martin@gnome.org>
13241
13242         * class.cs (TypeContainer): Implement IMemberContainer.
13243         (TypeContainer.DefineMembers): Create the MemberCache.
13244         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13245         return public members if BindingFlags.Public was given, check
13246         whether members are static.
13247
13248 2002-08-16  Martin Baulig  <martin@gnome.org>
13249
13250         * decl.cs (DeclSpace.Define): Splitted this in Define and
13251         DefineMembers.  DefineMembers is called first and initializes the
13252         MemberCache.
13253
13254         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13255         DefineMembers() on all our DeclSpaces.
13256
13257         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13258         but call DefineMembers() on all nested interfaces.  We call their
13259         Define() in our new Define() function.
13260
13261         * interface.cs (Interface): Implement IMemberContainer.
13262         (Interface.Define): Moved all code except the attribute stuf to
13263         DefineMembers().
13264         (Interface.DefineMembers): Initialize the member cache.
13265
13266         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13267         need this anymore since we can use MemberCache.FindMembers directly.
13268
13269 2002-08-19  Martin Baulig  <martin@gnome.org>
13270
13271         * typemanager.cs (MemberCache): When creating the cache for an
13272         interface type, add all inherited members.
13273         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13274         to `out bool used_cache' and documented it.
13275         (TypeManager.MemberLookup): If we already used the cache in the first
13276         iteration, we don't need to do the interfaces check.
13277
13278 2002-08-19  Martin Baulig  <martin@gnome.org>
13279
13280         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13281         here from IMemberFinder and don't implement this interface anymore.
13282         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13283
13284         * typemanager.cs (IMemberFinder): This interface is now only used by
13285         classes which actually support the member cache.
13286         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13287         since we only put DeclSpaces into this Hashtable.
13288         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13289         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13290
13291 2002-08-16  Martin Baulig  <martin@gnome.org>
13292
13293         * typemanager.cs (ICachingMemberFinder): Removed.
13294         (IMemberFinder.MemberCache): New property.
13295         (TypeManager.FindMembers): Merged this with RealFindMembers().
13296         This function will never be called from TypeManager.MemberLookup()
13297         so we can't use the cache here, just the IMemberFinder.
13298         (TypeManager.MemberLookup_FindMembers): Check whether the
13299         IMemberFinder has a MemberCache and call the cache's FindMembers
13300         function.
13301         (MemberCache): Rewrote larger parts of this yet another time and
13302         cleaned it up a bit.
13303
13304 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13305
13306         * driver.cs (LoadArgs): Support quoting.
13307
13308         (Usage): Show the CSC-like command line arguments.
13309
13310         Improved a few error messages.
13311
13312 2002-08-15  Martin Baulig  <martin@gnome.org>
13313
13314         * typemanager.cs (IMemberContainer.Type): New property.
13315         (IMemberContainer.IsInterface): New property.
13316
13317         The following changes are conditional to BROKEN_RUNTIME, which is
13318         defined at the top of the file.
13319
13320         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13321         class'es members, but add all members from TypeHandle.ObjectType
13322         if we're an interface.
13323         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13324         is the current type.
13325         (MemberCache.CacheEntry.Container): Removed this field.
13326         (TypeHandle.GetMembers): Include inherited members.
13327
13328 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13329
13330         * typemanager.cs: fixed compilation and added a comment on a field that
13331         is never used.
13332
13333 2002-08-15  Martin Baulig  <martin@gnome.org>
13334
13335         * class.cs (ConstructorInitializer.Resolve): In the
13336         Expression.MemberLookup call, use the queried_type as
13337         invocation_type.
13338
13339         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13340         declared' attribute, it's always true.
13341         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13342         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13343         temporary wrapper for FindMembers which tells MemberLookup whether
13344         members from the base classes are included in the return value.
13345         This will go away soon.
13346         (TypeManager.MemberLookup): Use this temporary hack here; once the
13347         new MemberCache is completed, we don't need to do the DeclaredOnly
13348         looping here anymore since the MemberCache will take care of this.
13349         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13350         (MemberCache): When creating the MemberCache for a class, get
13351         members from the current class and all its base classes.
13352         (MemberCache.CacheEntry.Container): New field.  This is a
13353         temporary hack until the Mono runtime is fixed to distinguish
13354         between ReflectedType and DeclaringType.  It allows us to use MCS
13355         with both the MS runtime and the unfixed Mono runtime without
13356         problems and without accecting performance.
13357         (MemberCache.SearchMembers): The DeclaredOnly looping from
13358         TypeManager.MemberLookup is now done here.      
13359
13360 2002-08-14  Martin Baulig  <martin@gnome.org>
13361
13362         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13363         Type.GetFields on dynamic types but get the fields from the
13364         corresponding TypeContainer.
13365         (MyStructInfo.GetStructInfo): Added check for enum types.
13366
13367         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13368         (MemberList.SyncRoot): Implemented.
13369         (TypeManager.FilterWithClosure): No need to check permissions if
13370         closure_start_type == closure_invocation_type, don't crash if
13371         closure_invocation_type is null.
13372
13373 2002-08-13  Martin Baulig  <martin@gnome.org>
13374
13375         Rewrote TypeContainer.FindMembers to use a member cache.  This
13376         gives us a speed increase of about 35% for the self-hosting MCS
13377         build and of about 15-20% for the class libs (both on GNU/Linux).
13378
13379         * report.cs (Timer): New class to get enhanced profiling.  This
13380         whole class is "TIMER" conditional since it remarkably slows down
13381         compilation speed.
13382
13383         * class.cs (MemberList): New class.  This is an IList wrapper
13384         which we're now using instead of passing MemberInfo[]'s around to
13385         avoid copying this array unnecessarily.
13386         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13387         (ICachingMemberFinder, IMemberContainer): New interface.
13388         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13389         has already been checked, otherwise use it for the name comparision.
13390         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13391         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13392         if possible.  Returns a MemberList, not a MemberInfo [].
13393         (TypeHandle): New class, implements IMemberContainer.  We create
13394         one instance of this class per type, it contains a MemberCache
13395         which is used to do the member lookups.
13396         (MemberCache): New class.  Each instance of this class contains
13397         all members of a type and a name-based hash table.
13398         (MemberCache.FindMembers): This is our new member lookup
13399         function.  First, it looks up all members of the requested name in
13400         the hash table.  Then, it walks this list and sorts out all
13401         applicable members and returns them.
13402
13403 2002-08-13  Martin Baulig  <martin@gnome.org>
13404
13405         In addition to a nice code cleanup, this gives us a performance
13406         increase of about 1.4% on GNU/Linux - not much, but it's already
13407         half a second for the self-hosting MCS compilation.
13408
13409         * typemanager.cs (IMemberFinder): New interface.  It is used by
13410         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13411         Enum, Delegate or Interface.
13412         (TypeManager.finder_to_member_finder): New PtrHashtable.
13413         (TypeManager.finder_to_container): Removed.
13414         (TypeManager.finder_to_delegate): Removed.
13415         (TypeManager.finder_to_interface): Removed.
13416         (TypeManager.finder_to_enum): Removed.
13417
13418         * interface.cs (Interface): Implement IMemberFinder.
13419
13420         * delegate.cs (Delegate): Implement IMemberFinder.
13421
13422         * enum.cs (Enum): Implement IMemberFinder.
13423
13424         * class.cs (TypeContainer): Implement IMemberFinder.
13425
13426 2002-08-12  Martin Baulig  <martin@gnome.org>
13427
13428         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13429
13430 2002-08-12  Martin Baulig  <martin@gnome.org>
13431
13432         * ecore.cs (ITypeExpression): New interface for expressions which
13433         resolve to a type.
13434         (TypeExpression): Renamed to TypeLookupExpression.
13435         (Expression.DoResolve): If we're doing a types-only lookup, the
13436         expression must implement the ITypeExpression interface and we
13437         call DoResolveType() on it.
13438         (SimpleName): Implement the new ITypeExpression interface.
13439         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13440         hack, the situation that we're only looking up types can't happen
13441         anymore when this method is called.  Moved the type lookup code to
13442         DoResolveType() and call it.
13443         (SimpleName.DoResolveType): This ITypeExpression interface method
13444         is now doing the types-only lookup.
13445         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13446         (ResolveFlags): Added MaskExprClass.
13447
13448         * expression.cs (MemberAccess): Implement the ITypeExpression
13449         interface.
13450         (MemberAccess.DoResolve): Added support for a types-only lookup
13451         when we're called via ITypeExpression.DoResolveType().
13452         (ComposedCast): Implement the ITypeExpression interface.
13453
13454         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13455         Expression.Resolve() with ResolveFlags.Type instead.
13456
13457 2002-08-12  Martin Baulig  <martin@gnome.org>
13458
13459         * interface.cs (Interface.Define): Apply attributes.
13460
13461         * attribute.cs (Attribute.ApplyAttributes): Added support for
13462         interface attributes.
13463
13464 2002-08-11  Martin Baulig  <martin@gnome.org>
13465
13466         * statement.cs (Block.Emit): Only check the "this" variable if we
13467         do not always throw an exception.
13468
13469         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13470         whether the property has a set accessor.
13471
13472 2002-08-11  Martin Baulig  <martin@gnome.org>
13473
13474         Added control flow analysis support for structs.
13475
13476         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13477         with control flow analysis turned off.
13478         (IVariable): New interface.
13479         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13480         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13481         (FieldExpr.DoResolve): Resolve the instance expression with flow
13482         analysis turned off and do the definite assignment check after the
13483         resolving when we know what the expression will resolve to.
13484
13485         * expression.cs (LocalVariableReference, ParameterReference):
13486         Implement the new IVariable interface, only call the flow analysis
13487         code if ec.DoFlowAnalysis is true.
13488         (This): Added constructor which takes a Block argument.  Implement
13489         the new IVariable interface.
13490         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13491         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13492         This does the definite assignment checks for struct members.
13493
13494         * class.cs (Constructor.Emit): If this is a non-static `struct'
13495         constructor which doesn't have any initializer, call
13496         Block.AddThisVariable() to tell the flow analysis code that all
13497         struct elements must be initialized before control returns from
13498         the constructor.
13499
13500         * statement.cs (MyStructInfo): New public class.
13501         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13502         argument to this indexer.  If non-zero, check an individual struct
13503         member, not the whole struct.
13504         (FlowBranching.CheckOutParameters): Check struct members.
13505         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13506         overloaded versions of these methods which take an additional
13507         `int field_idx' argument to check struct members.
13508         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13509         overloaded versions of these methods which take an additional
13510         `string field_name' argument to check struct member.s
13511         (VariableInfo): Implement the IVariable interface.
13512         (VariableInfo.StructInfo): New public property.  Returns the
13513         MyStructInfo instance of the variable if it's a struct or null.
13514         (Block.AddThisVariable): New public method.  This is called from
13515         Constructor.Emit() for non-static `struct' constructor which do
13516         not have any initializer.  It creates a special variable for the
13517         "this" instance variable which will be checked by the flow
13518         analysis code to ensure that all of the struct's fields are
13519         initialized before control returns from the constructor.
13520         (UsageVector): Added support for struct members.  If a
13521         variable/parameter is a struct with N members, we reserve a slot
13522         in the usage vector for each member.  A struct is considered fully
13523         initialized if either the struct itself (slot 0) or all its
13524         members are initialized.
13525
13526 2002-08-08  Martin Baulig  <martin@gnome.org>
13527
13528         * driver.cs (Driver.MainDriver): Only report an error CS5001
13529         if there were no compilation errors.
13530
13531         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13532         `UnsafeContext' property to determine whether the parent is in
13533         unsafe context rather than checking the parent's ModFlags:
13534         classes nested in an unsafe class are unsafe as well.
13535
13536 2002-08-08  Martin Baulig  <martin@gnome.org>
13537
13538         * statement.cs (UsageVector.MergeChildren): Distinguish between
13539         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13540         we return.  Added test17() and test18() to test-154.cs.
13541
13542 2002-08-08  Martin Baulig  <martin@gnome.org>
13543
13544         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13545         Family access, make sure the invoking type isn't a subclass of the
13546         queried type (that'd be a CS1540).
13547
13548         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13549         this method which takes an additional `Type invocation_type'.
13550
13551         * expression.cs (BaseAccess.DoResolve): Use the base type as
13552         invocation and query type.
13553         (MemberAccess.DoResolve): If the lookup failed and we're about to
13554         report a CS0122, try a lookup with the ec.ContainerType - if this
13555         succeeds, we must report a CS1540.
13556
13557 2002-08-08  Martin Baulig  <martin@gnome.org>
13558
13559         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13560         (MethodGroupExpr): Implement the IMemberExpr interface.
13561
13562         * expression (MemberAccess.ResolveMemberAccess): No need to have
13563         any special code for MethodGroupExprs anymore, they're now
13564         IMemberExprs.   
13565
13566 2002-08-08  Martin Baulig  <martin@gnome.org>
13567
13568         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13569         Family, FamANDAssem and FamORAssem permissions.
13570         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13571
13572 2002-08-08  Martin Baulig  <martin@gnome.org>
13573
13574         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13575         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13576         or loop block.
13577
13578 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13579
13580         * driver.cs: implemented /resource option to embed managed resources.
13581
13582 2002-08-07  Martin Baulig  <martin@gnome.org>
13583
13584         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13585         (FieldBase.HasFieldInitializer): New public property.
13586         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13587         returns the field initializer and makes sure it is only resolved once.
13588         (TypeContainer.EmitFieldInitializers): Call
13589         FieldBase.GetInitializerExpression to get the initializer, this ensures
13590         that it isn't resolved multiple times.
13591
13592         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13593         the resolving process (SimpleName/MemberLookup) that we're currently
13594         emitting a field initializer (which must not access any instance members,
13595         this is an error CS0236).
13596
13597         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13598         argument, if the `IsFieldInitializer' flag is set, we must report and
13599         error CS0236 and not an error CS0120.   
13600
13601 2002-08-07  Martin Baulig  <martin@gnome.org>
13602
13603         * ecore.cs (IMemberExpr): New public interface.
13604         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13605         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13606         if the expression is an IMemberExpr.
13607
13608         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13609         to be null, implicitly default to `this' if we're non-static in
13610         this case.  Simplified the code a lot by using the new IMemberExpr
13611         interface.  Also fixed bug #28176 here.
13612
13613 2002-08-06  Martin Baulig  <martin@gnome.org>
13614
13615         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13616         ParameterReferences during semantic analysis so that we can do a
13617         type-only search when resolving Cast, TypeOf and SizeOf.
13618         (block): Pass the `current_local_parameters' to the Block's
13619         constructor.
13620
13621         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13622         argument to the constructor.
13623         (ConstructorInitializer.Resolve): Create a temporary implicit
13624         block with the parameters.
13625
13626         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13627         references here if we aren't doing a type-only search.
13628
13629         * statement.cs (Block): Added constructor which takes a
13630         `Parameters parameters' argument.
13631         (Block.Parameters): New public property.
13632
13633         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13634         to `Parameters' and made it public readonly.
13635
13636 2002-08-06  Martin Baulig  <martin@gnome.org>
13637
13638         * ecore.cs (Expression.Warning): Made this public as well.
13639
13640         * report.cs (Report.Debug): Print the contents of collections.
13641
13642 2002-08-06  Martin Baulig  <martin@gnome.org>
13643
13644         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13645         used to tell Resolve() which kinds of expressions it may return.
13646         (Expression.Resolve): Added overloaded version of this method which
13647         takes a `ResolveFlags flags' argument.  This can be used to tell
13648         Resolve() which kinds of expressions it may return.  Reports a
13649         CS0118 on error.
13650         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13651         ResolveFlags.SimpleName.
13652         (Expression.Error118): Added overloaded version of this method which
13653         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13654         which kinds of expressions are allowed.
13655
13656         * expression.cs (Argument.ResolveMethodGroup): New public method.
13657         Resolves an argument, but allows a MethodGroup to be returned.
13658         This is used when invoking a delegate.
13659
13660         * TODO: Updated a bit.
13661
13662 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13663
13664         Fixed compilation with csc.
13665
13666         * ecore.cs: Expression.Error made public. Is this correct? Should
13667         Warning be made public too?
13668
13669         * expression.cs: use ea.Location instead of ea.loc.
13670         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13671
13672 2002-08-06  Martin Baulig  <martin@gnome.org>
13673
13674         * ecore.cs (Expression.loc): Moved the location here instead of
13675         duplicating it in all derived classes.
13676         (Expression.Location): New public property.
13677         (Expression.Error, Expression.Warning): Made them non-static and
13678         removed the location argument.
13679         (Expression.Warning): Added overloaded version which takes an
13680         `int level' argument.
13681         (Expression.Error118): Make this non-static and removed the
13682         expression and location arguments.
13683         (TypeExpr): Added location argument to the constructor.
13684
13685         * expression.cs (StaticCallExpr): Added location argument to
13686         the constructor.
13687         (Indirection, PointerArithmetic): Likewise.
13688         (CheckedExpr, UnCheckedExpr): Likewise.
13689         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13690         (StringPtr): Likewise.
13691
13692
13693 2002-08-05  Martin Baulig  <martin@gnome.org>
13694
13695         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13696
13697         * assign.cs (Assign.DoResolve): Check whether the source
13698         expression is a value or variable.
13699
13700         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13701         while resolving the corresponding blocks.
13702
13703         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13704         an error, don't silently return null.
13705
13706         * statement.cs (Block.AddVariable): Do the error reporting here
13707         and distinguish between CS0128 and CS0136.
13708         (Block.DoResolve): Report all unused labels (warning CS0164).
13709         (LabeledStatement): Pass the location to the constructor.
13710         (LabeledStatement.HasBeenReferenced): New property.
13711         (LabeledStatement.Resolve): Set it to true here.
13712
13713         * statement.cs (Return.Emit): Return success even after reporting
13714         a type mismatch error (CS0126 or CS0127), this is what csc does and
13715         it avoids confusing the users with any consecutive errors.
13716
13717 2002-08-05  Martin Baulig  <martin@gnome.org>
13718
13719         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13720
13721         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13722
13723         * expression.cs (MemberAccess.DoResolve): Silently return if an
13724         error has already been reported.
13725
13726         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13727         error has already been reported.
13728
13729 2002-08-05  Martin Baulig  <martin@gnome.org>
13730
13731         * statement.cs (UsageVector): Only initialize the `parameters'
13732         vector if we actually have any "out" parameters.
13733
13734 2002-08-05  Martin Baulig  <martin@gnome.org>
13735
13736         * expression.cs (Binary.ResolveOperator): When combining delegates,
13737         they must have the same type.
13738
13739 2002-08-05  Martin Baulig  <martin@gnome.org>
13740
13741         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13742         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13743         work with the ms runtime and we also don't need it: if we're a
13744         PropertyBuilder and not in the `indexer_arguments' hash, then we
13745         are a property and not an indexer.
13746
13747         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13748         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13749         since the latter one doesn't work with the ms runtime.
13750
13751 2002-08-03  Martin Baulig  <martin@gnome.org>
13752
13753         Fixed bugs #27998 and #22735.
13754
13755         * class.cs (Method.IsOperator): New public field.
13756         (Method.CheckBase): Report CS0111 if there's already a method
13757         with the same parameters in the current class.  Report CS0508 when
13758         attempting to change the return type of an inherited method.
13759         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13760         and it's not marked abstract or extern.
13761         (PropertyBase): New abstract base class for Property and Indexer.
13762         (PropertyBase.CheckBase): Moved here from Property and made it work
13763         for indexers.
13764         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13765         the same so we can reuse it there.
13766         (Property, Indexer): Derive from PropertyBase.
13767         (MethodSignature.inheritable_property_signature_filter): New delegate
13768         to find properties and indexers.
13769
13770         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13771         argument and improved error reporting.
13772
13773         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13774         EmptyReadOnlyParameters and made it a property.
13775
13776         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13777         version of this method which takes a `PropertyInfo indexer'.
13778         (TypeManager.RegisterIndexer): New method.
13779
13780         * class.cs: Added myself as author of this file :-)
13781
13782 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13783
13784         * class.cs: fixed compilation on windoze.
13785
13786 2002-08-03  Martin Baulig  <martin@gnome.org>
13787
13788         * interface.cs (Interface.GetInterfaceBases): Check whether all
13789         base interfaces are at least as accessible than the current one.
13790
13791         * class.cs (TypeContainer.GetClassBases): Check whether base types
13792         are at least as accessible than the current type.
13793         (TypeContainer.AsAccessible): Implemented and made non-static.
13794         (MemberBase.CheckParameters): Report errors if the accessibility
13795         checks fail.
13796
13797         * delegate.cs (Delegate.Delegate): The default visibility is
13798         internal for top-level types and private for nested types.
13799         (Delegate.Define): Report errors if the accessibility checks fail.
13800
13801         * enum.cs (Enum.Enum): The default visibility is internal for
13802         top-level types and private for nested types.
13803         (Enum.DefineType): Compute the correct visibility.
13804
13805         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13806         function which takes a `bool is_toplevel' instead of a TypeContainer.
13807
13808         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13809         builtin type.
13810
13811 2002-08-02  Martin Baulig  <martin@gnome.org>
13812
13813         * expression.cs (LocalVariableReferenc): Added constructor which
13814         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13815         (LocalVariableReference.IsReadOnly): New property.
13816         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13817         variable is readonly, use our own readonly flag to do this; you can
13818         use the new constructor to get a writable reference to a read-only
13819         variable.
13820
13821         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13822         reference to the local variable.
13823
13824 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13825
13826         * rootcontext.cs (ResolveCore): Also include System.Exception
13827
13828         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13829         we reach an EmptyStatement.
13830
13831         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13832         is also fine.
13833
13834         * expression.cs (Binary.ResolveOperator): Check error result in
13835         two places.
13836
13837         use brtrue/brfalse directly and avoid compares to null.
13838
13839 2002-08-02  Martin Baulig  <martin@gnome.org>
13840
13841         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13842         Fixes bug #28407, added test-155.cs.
13843
13844 2002-08-01  Martin Baulig  <martin@gnome.org>
13845
13846         * class.cs (Event.EmitDefaultMethod): Make this work with static
13847         events.  Fixes #28311, added verify-3.cs.
13848
13849 2002-08-01  Martin Baulig  <martin@gnome.org>
13850
13851         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13852         `is_disposable' fields.
13853         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13854         `hm.is_disposable' if we're using the collection pattern.
13855         (Foreach.EmitCollectionForeach): Use the correct type for the
13856         enumerator's local variable, only emit the try/finally block if
13857         necessary (fixes #27713).
13858
13859 2002-08-01  Martin Baulig  <martin@gnome.org>
13860
13861         * ecore.cs (Expression.report118): Renamed to Error118 and made
13862         it public static.
13863
13864         * statement.cs (Throw.Resolve): Check whether the expression is of
13865         the correct type (CS0118) and whether the type derives from
13866         System.Exception (CS0155).
13867         (Catch.Resolve): New method.  Do the type lookup here and check
13868         whether it derives from System.Exception (CS0155).
13869         (Catch.CatchType, Catch.IsGeneral): New public properties.
13870
13871         * typemanager.cs (TypeManager.exception_type): Added.
13872
13873 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * driver.cs: Updated About function.
13876
13877 2002-07-31  Martin Baulig  <martin@gnome.org>
13878
13879         Implemented Control Flow Analysis.
13880
13881         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13882         (EmitContext.CurrentBranching): Added.
13883         (EmitContext.StartFlowBranching): Added.
13884         (EmitContext.EndFlowBranching): Added.
13885         (EmitContext.KillFlowBranching): Added.
13886         (EmitContext.IsVariableAssigned): Added.
13887         (EmitContext.SetVariableAssigned): Added.
13888         (EmitContext.IsParameterAssigned): Added.
13889         (EmitContext.SetParameterAssigned): Added.
13890         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13891         Added control flow analysis stuff here.
13892
13893         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13894         resolve the expression as lvalue.
13895         (LocalVariableReference.DoResolve): Check whether the variable has
13896         already been assigned.
13897         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13898         the parameter as assigned here.
13899         (ParameterReference.DoResolve): Check whether the parameter has already
13900         been assigned.
13901         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13902         expression as lvalue.
13903
13904         * statement.cs (FlowBranching): New class for the flow analysis code.
13905         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13906         (LabeledStatement.IsDefined): New public property.
13907         (LabeledStatement.AddUsageVector): New public method to tell flow
13908         analyis that the label may be reached via a forward jump.
13909         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13910         flow analysis.
13911         (VariableInfo.Number): New public field.  This is used by flow analysis
13912         to number all locals of a block.
13913         (Block.CountVariables): New public property.  This is the number of
13914         local variables in this block (including the locals from all parent
13915         blocks).
13916         (Block.EmitMeta): Number all the variables.
13917
13918         * statement.cs: Added flow analysis support to all classes.
13919
13920 2002-07-31  Martin Baulig  <martin@gnome.org>
13921
13922         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13923         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13924         then use this argument.
13925
13926         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13927
13928         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13929         use this to specify /define options.
13930
13931 2002-07-29  Martin Baulig  <martin@gnome.org>
13932
13933         * statement.cs (Fixed): Moved all code that does variable lookups
13934         and resolvings from Emit to Resolve.
13935
13936         * statement.cs (For): Moved all code that does variable lookups
13937         and resolvings from Emit to Resolve.
13938
13939         * statement.cs (Using): Moved all code that does variable lookups
13940         and resolvings from Emit to Resolve.
13941
13942 2002-07-29  Martin Baulig  <martin@gnome.org>
13943
13944         * attribute.cs (Attribute.Resolve): Explicitly catch a
13945         System.NullReferenceException when creating the
13946         CustromAttributeBuilder and report a different warning message.
13947
13948 2002-07-29  Martin Baulig  <martin@gnome.org>
13949
13950         * support.cs (ParameterData.ParameterName): Added method to
13951         get the name of a parameter.
13952
13953         * typemanager.cs (TypeManager.IsValueType): New public method.
13954
13955 2002-07-29  Martin Baulig  <martin@gnome.org>
13956
13957         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13958         is a flag which specifies that it's either ref or out.
13959         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13960         the out parameter to `out Parameter.Modifier mod', also set the
13961         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13962
13963         * support.cs (InternalParameters.ParameterModifier): Distinguish
13964         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13965         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13966
13967         * expression.cs (Argument.GetParameterModifier): Distinguish
13968         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13969         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13970
13971 2002-07-29  Martin Baulig  <martin@gnome.org>
13972
13973         * expression.cs (ParameterReference.ParameterReference): Added
13974         `Location loc' argument to the constructor.
13975
13976         * cs-parser.jay: Pass location to ParameterReference.
13977
13978 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * statement.cs (Try): Initialize the location.
13981
13982         * cs-parser.jay: pass location to Try.
13983
13984         * expression.cs (Unary.Reduce): Change the prototype to return
13985         whether a constant fold could be performed or not.  The result is
13986         returned in an out parameters.  In the case of Indirection and
13987         AddressOf, we want to perform the full tests.
13988
13989 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13990
13991         * statement.cs (Statement.Emit): Flag dead code.
13992
13993 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13994
13995         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13996
13997 2002-07-27  Martin Baulig  <martin@gnome.org>
13998
13999         * class.cs (MethodData.Define): Put back call to
14000         TypeManager.AddMethod(), accidentally commented this out.
14001
14002         * report.cs (Debug): New public method to print debugging information,
14003         this is `[Conditional ("DEBUG")]'.
14004
14005 2002-07-26  Martin Baulig  <martin@gnome.org>
14006
14007         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14008         (switch_statement): Push the current_block to the switch_stack and
14009         pop it again when we're done with the switch.
14010         (switch_section): The new block is a child of the current_block.
14011         Fixes bug #24007, added test-152.cs.
14012
14013 2002-07-27  Martin Baulig  <martin@gnome.org>
14014
14015         * expression.cs (Invocation.EmitArguments): When calling a varargs
14016         function with only its fixed arguments, we need to pass an empty
14017         array.
14018
14019 2002-07-27  Martin Baulig  <martin@gnome.org>
14020
14021         Mono 0.13 has been released.
14022
14023 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14024
14025         * driver.cs: Rename --resource to --linkres, because that is what
14026         we do currently, we dont support --resource yet.
14027
14028         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14029
14030 2002-07-25  Martin Baulig  <martin@gnome.org>
14031
14032         * class.cs (MethodData): New public class.  This is a `method builder'
14033         class for a method or one accessor of a Property/Indexer/Event.
14034         (MethodData.GetMethodFlags): Moved here from MemberBase.
14035         (MethodData.ApplyAttributes): Likewise.
14036         (MethodData.ApplyObsoleteAttribute): Likewise.
14037         (MethodData.ApplyConditionalAttribute): Likewise.
14038         (MethodData.ApplyDllImportAttribute): Likewise.
14039         (MethodData.CheckAbstractAndExternal): Likewise.
14040         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14041         (MethodData.Emit): Formerly known as Method.Emit().
14042         (MemberBase): Moved everything which was specific to a single
14043         accessor/method to MethodData.
14044         (Method): Create a new MethodData and call Define() and Emit() on it.
14045         (Property, Indexer, Event): Create a new MethodData objects for each
14046         accessor and call Define() and Emit() on them.
14047
14048 2002-07-25  Martin Baulig  <martin@gnome.org>
14049
14050         Made MethodCore derive from MemberBase to reuse the code from there.
14051         MemberBase now also checks for attributes.
14052
14053         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14054         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14055         as virtual.
14056         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14057         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14058         (MemberBase.ApplyAttributes): New virtual method; applies the
14059         attributes to a method or accessor.
14060         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14061         (MemberBase.ApplyConditionalAttribute): Likewise.
14062         (MemberBase.ApplyDllImportAttribute): Likewise.
14063         (MemberBase.CheckAbstractAndExternal): Likewise.
14064         (MethodCore.ParameterTypes): This is now a property instead of a
14065         method, it's initialized from DoDefineParameters().
14066         (MethodCore.ParameterInfo): Removed the set accessor.
14067         (MethodCore.DoDefineParameters): New protected virtual method to
14068         initialize ParameterTypes and ParameterInfo.
14069         (Method.GetReturnType): We can now simply return the MemberType.
14070         (Method.GetMethodFlags): Override the MemberBase version and add
14071         the conditional flags.
14072         (Method.CheckBase): Moved some code from Define() here, call
14073         DoDefineParameters() here.
14074         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14075         here to avoid some larger code duplication.
14076         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14077         ensure that abstract and external accessors don't declare a body.
14078
14079         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14080         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14081         lookup in the attribute's parent classes, so we need to abort as soon
14082         as we found the first match.
14083         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14084         the attribute has no arguments.
14085
14086         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14087         of a Method.
14088
14089 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14090
14091         * cs-parser.jay: reverted previous patch.
14092
14093 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14094
14095         * cs-parser.jay: fixed bug #22119.
14096
14097 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14098
14099         * attribute.cs: fixed compilation. The error was:
14100         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14101         be assigned to before control leaves the current method."
14102         [FIXME:  Filed as bug #28186: MCS must report this error.]
14103
14104 2002-07-25  Martin Baulig  <martin@gnome.org>
14105
14106         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14107         method to pull the condition name ouf of a Conditional attribute.
14108         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14109         the obsolete message and error flag out of an Obsolete attribute.
14110
14111         * class.cs (Method.GetMethodFlags): New public method to get the
14112         TypeManager.MethodFlags for this method.
14113         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14114         private methods.
14115         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14116         if we're overriding a virtual function, set the new private variable
14117         `parent_method'; call the new TypeManager.AddMethod().
14118
14119         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14120         the MethodBuilder and the Method in a PtrHashtable.
14121         (TypeManager.builder_to_method): Added for this purpose.
14122         (TypeManager.MethodFlags): Added IsObsoleteError.
14123         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14124         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14125         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14126         the message from the attribute.
14127
14128 2002-07-24  Martin Baulig  <martin@gnome.org>
14129
14130         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14131         preprocessor directives, ensure that the argument to #define/#undef is
14132         exactly one identifier and that it's actually an identifier.
14133
14134         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14135         did not work ....
14136
14137 2002-07-24  Martin Baulig  <martin@gnome.org>
14138
14139         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14140         initialize it to TypeManager.object_type in the constructor.
14141         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14142         of the `hm.get_current' method if we're using the collection pattern.
14143         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14144         for the explicit conversion to make it work when we're using the collection
14145         pattern and the `Current' property has a different return type than `object'.
14146         Fixes #27713.
14147
14148 2002-07-24  Martin Baulig  <martin@gnome.org>
14149
14150         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14151         does not match, but don't report any errors.  This method is called in
14152         order for all methods in a MethodGroupExpr until a matching method is
14153         found, so we don't want to bail out if the first method doesn't match.
14154         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14155         matches, report the 123.  Fixes #28070.
14156
14157 2002-07-24  Martin Baulig  <martin@gnome.org>
14158
14159         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14160         TypeManager.TypeToCoreType() to the top of the method so the
14161         following equality checks will work.  Fixes #28107.
14162
14163 2002-07-24  Martin Baulig  <martin@gnome.org>
14164
14165         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14166         operand is of type uint, and the other operand is of type sbyte,
14167         short or int, the operands are converted to type long." -
14168         Actually do what this comment already told us.  Fixes bug #28106,
14169         added test-150.cs.
14170
14171 2002-07-24  Martin Baulig  <martin@gnome.org>
14172
14173         * class.cs (MethodBase): New abstract class.  This is now a base
14174         class for Property, Indexer and Event to avoid some code duplication
14175         in their Define() and DefineMethods() methods.
14176         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14177         generic methods for Define() and DefineMethods().
14178         (FieldBase): Derive from MemberBase, not MemberCore.
14179         (Property): Derive from MemberBase, not MemberCore.
14180         (Property.DefineMethod): Moved all the code from this method to the
14181         new MethodBase.DefineAccessor(), just call it with appropriate
14182         argumetnts.
14183         (Property.Define): Call the new Property.DoDefine(), this does some
14184         sanity checks and we don't need to duplicate the code everywhere.
14185         (Event): Derive from MemberBase, not MemberCore.
14186         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14187         accessors, this will also make them work with interface events.
14188         (Indexer): Derive from MemberBase, not MemberCore.
14189         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14190         (Indexer.Define): Use the new MethodBase functions.
14191
14192         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14193         argument to the constructor.
14194         (Interface.FindMembers): Added support for interface events.
14195         (Interface.PopluateEvent): Implemented.
14196
14197         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14198
14199 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14200
14201         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14202         but this is required to check for a method name being the same as
14203         the containing class.  
14204
14205         Handle this now.
14206
14207 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14208
14209         * interface.cs: initialize variable.
14210
14211 2002-07-23  Martin Baulig  <martin@gnome.org>
14212
14213         Implemented the IndexerName attribute in interfaces.
14214
14215         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14216         name if this is an explicit interface implementation.
14217         (Indexer.InterfaceIndexerName): New public variable.  If we're
14218         implementing an interface indexer, this is the IndexerName in that
14219         interface.  Otherwise, it's the IndexerName.
14220         (Indexer.DefineMethod): If we're implementing interface indexer,
14221         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14222         and Pending.ImplementIndexer methods.
14223         (Indexer.Define): Also define the PropertyBuilder if we're
14224         implementing an interface indexer and this is neither an explicit
14225         interface implementation nor do the IndexerName match the one in
14226         the interface.
14227
14228         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14229         If a method is defined here, then we always need to create a proxy
14230         for it.  This is used when implementing interface indexers.
14231         (Pending.IsInterfaceIndexer): New public method.
14232         (Pending.ImplementIndexer): New public method.
14233         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14234         This is used when implementing interface indexers to define a proxy
14235         if necessary.
14236         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14237         define a proxy if necessary.
14238
14239         * interface.cs (Interface.IndexerName): New public variable.
14240         (Interface.PopulateIndexer): Set the IndexerName.
14241         (Interface.DefineIndexers): New private method.  Populate all the
14242         indexers and make sure their IndexerNames match.
14243
14244         * typemanager.cs (IndexerPropertyName): Added support for interface
14245         indexers.
14246
14247 2002-07-22  Martin Baulig  <martin@gnome.org>
14248
14249         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14250         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14251         ret if HasReturnLabel.
14252         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14253         variables.
14254
14255         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14256         and set the ec.LoopBeginTryCatchLevel.
14257         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14258         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14259         the current ec.TryCatchLevel, the branch goes out of an exception
14260         block.  In this case, we need to use Leave and not Br.
14261
14262 2002-07-22  Martin Baulig  <martin@gnome.org>
14263
14264         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14265         block unless the block does not always return or it is contained in
14266         another try { ... } catch { ... } block.  Fixes bug #26506.
14267         Added verify-1.cs to the test suite.
14268
14269 2002-07-22  Martin Baulig  <martin@gnome.org>
14270
14271         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14272         then we do not always return.  Fixes bug #24985.
14273
14274 2002-07-22  Martin Baulig  <martin@gnome.org>
14275
14276         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14277         lookup on a per-class level; ie. walk up the class hierarchy until we
14278         found at least one applicable method, then choose the best among them.
14279         Fixes bug #24463 and test-29.cs.
14280
14281 2002-07-22  Martin Baulig  <martin@gnome.org>
14282
14283         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14284         return types of the methods.  The return type is not part of the
14285         signature and we must not check it to make the `new' modifier work.
14286         Fixes bug #27999, also added test-147.cs.
14287         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14288
14289         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14290         on the method's return type.
14291
14292 2002-07-21  Martin Baulig  <martin@gnome.org>
14293
14294         * assign.cs: Make this work if the rightmost source is a constant and
14295         we need to do an implicit type conversion.  Also adding a few more tests
14296         to test-38.cs which should have caught this.
14297
14298         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14299         target in the makefile for this.  The makefile.gnu is primarily intended
14300         for end-users who don't want to debug the compiler.
14301
14302 2002-07-21  Martin Baulig  <martin@gnome.org>
14303
14304         * assign.cs: Improved the Assign class so it can now handle embedded
14305         assignments (X = Y = Z = something).  As a side-effect this'll now also
14306         consume less local variables.  test-38.cs now passes with MCS, added
14307         a few new test cases to that test.
14308
14309 2002-07-20  Martin Baulig  <martin@gnome.org>
14310
14311         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14312         instructions.  Fixes bug #27977, also added test-146.cs.
14313
14314 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14315
14316         * cs-tokenizer.cs: fixed getHex ().
14317
14318 2002-07-19  Martin Baulig  <martin@gnome.org>
14319
14320         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14321         not Type.GetType() to lookup the array type.  This is needed when
14322         we're constructing an array of a user-defined type.
14323         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14324         single-dimensional arrays, but also for single-dimensial arrays of
14325         type decimal.
14326
14327 2002-07-19  Martin Baulig  <martin@gnome.org>
14328
14329         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14330         this function is called, it's not allowed to share LocalBuilders
14331         among ILGenerators.
14332
14333 2002-07-19  Martin Baulig  <martin@gnome.org>
14334
14335         * expression.cs (Argument.Resolve): Report an error 118 when trying
14336         to pass a type as argument.
14337
14338 2002-07-18  Martin Baulig  <martin@gnome.org>
14339
14340         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14341         Conv_R_Un for the signed `long' type.
14342
14343 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14344
14345         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14346         `expr' for the temporary result, as that will fail if we do
14347         multiple resolves on the same expression.
14348
14349 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14350
14351         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14352         ec.TypeContainer for looking up aliases. 
14353
14354         * class.cs (TypeContainer): Remove LookupAlias from here.
14355
14356         * decl.cs (DeclSpace); Move here.
14357
14358 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * class.cs (FindMembers): Only call filter if the constructor
14361         bulider is not null.
14362
14363         Also handle delegates in `NestedTypes' now.  Now we will perform
14364         type lookups using the standard resolution process.  This also
14365         fixes a bug.
14366
14367         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14368         This uses Expressions (the limited kind that can be parsed by the
14369         tree) instead of strings.
14370
14371         * expression.cs (ComposedCast.ToString): Implement, used to flag
14372         errors since now we have to render expressions.
14373
14374         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14375         FormArrayType. 
14376
14377         * ecore.cs (SimpleName.ToString): ditto.
14378
14379         * cs-parser.jay: Instead of using strings to assemble types, use
14380         Expressions to assemble the type (using SimpleName, ComposedCast,
14381         MemberAccess).  This should fix the type lookups in declarations,
14382         because we were using a different code path for this.
14383
14384         * statement.cs (Block.Resolve): Continue processing statements
14385         even when there is an error.
14386
14387 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14388
14389         * class.cs (Event.Define): Also remove the `remove' method from
14390         the list of pending items.
14391
14392         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14393         generate more compact code. 
14394
14395 2002-07-17  Martin Baulig  <martin@gnome.org>
14396
14397         * const.cs (Const.LookupConstantValue): Add support for constant
14398         `unchecked' and `checked' expressions.
14399         Also adding test case test-140.cs for this.
14400
14401 2002-07-17  Martin Baulig  <martin@gnome.org>
14402
14403         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14404         check whether mi.ReturnType implements the IEnumerator interface; the
14405         `==' and the IsAssignableFrom() will fail in this situation.
14406
14407 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14408
14409         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14410         here too.
14411
14412 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14413
14414         * expression.cs: fixed bug #27811.
14415
14416 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14417
14418         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14419         Molaro: when we are a ref, the value already contains a pointer
14420         value, do not take the address of it.
14421
14422 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14423         * removed mb-parser.jay and mb-tokenizer.cs
14424
14425 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14426
14427         * expression.cs: check against the building corlib void type.
14428
14429 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14430
14431         * ecore.cs: fix for valuetype static readonly fields: when 
14432         initializing them, we need their address, not the address of a copy.
14433
14434 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14435
14436         * typemanager.cs: register also enum_type in corlib.
14437
14438 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14439
14440         * class.cs: allow calling this (but not base) initializers in structs.
14441
14442 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14443
14444         * ecore.cs: make sure we compare against the building base types
14445         in GetTypeSize ().
14446
14447 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14448
14449         * typemanager.cs: fix TypeToCoreType() to handle void and object
14450         (corlib gets no more typerefs after this change).
14451
14452 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14453
14454         * expression.cs (ArrayCreation.EmitArrayArguments): use
14455         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14456
14457         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14458         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14459         array indexes, the runtime actually forbids them.
14460
14461         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14462         for array arguments here.
14463
14464         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14465         instead of the default for ValueTypes.
14466
14467         (New.DoEmit): Use IsValueType instead of
14468         IsSubclassOf (value_type)
14469         (New.DoResolve): ditto.
14470         (Invocation.EmitCall): ditto.
14471
14472         * assign.cs (Assign): ditto.
14473
14474         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14475         Statements *are* currently doing part of their resolution during
14476         Emit.  
14477
14478         Expressions do always resolve during resolve, but statements are
14479         only required to propagate resolution to their children.
14480
14481 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14484
14485         (LoadAssembly): Do not add the dll if it is already specified
14486
14487         (MainDriver): Add the System directory to the link path at the end,
14488         after all the other -L arguments. 
14489
14490         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14491         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14492         ldelem.u1) and using the opposite for sbytes.
14493
14494         This fixes Digger, and we can finally run it.
14495
14496         * driver.cs (UnixParseOption): Move the option parsing here.  
14497         (CSCParseOption): Implement CSC-like parsing of options.
14498
14499         We now support both modes of operation, the old Unix way, and the
14500         new CSC-like way.  This should help those who wanted to make cross
14501         platform makefiles.
14502
14503         The only thing broken is that /r:, /reference: and /lib: are not
14504         implemented, because I want to make those have the same semantics
14505         as the CSC compiler has, and kill once and for all the confussion
14506         around this.   Will be doing this tomorrow.
14507
14508         * statement.cs (Unsafe.Resolve): The state is checked during
14509         resolve, not emit, so we have to set the flags for IsUnsfe here.
14510
14511 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14512
14513         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14514         not catch the Error_ObjectRefRequired in SimpleName (as it is
14515         possible to have a class/instance variable name that later gets
14516         deambiguated), we have to check this here.      
14517
14518 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14519
14520         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14521         make static and put into Expression.
14522
14523         (Event.Define): Register the private field of the event with the 
14524         TypeManager so that GetFieldFromEvent can get at it.
14525
14526         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14527         keep track of the private field associated with an event which
14528         has no accessors.
14529
14530         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14531         private field.
14532
14533         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14534
14535 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * expression.cs (Binary.EmitBranchable): this routine emits the
14538         Binary expression in a branchable context.  This basically means:
14539         we need to branch somewhere, not just get the value on the stack.
14540
14541         This works together with Statement.EmitBoolExpression.
14542
14543         * statement.cs (Statement.EmitBoolExpression): Use
14544         EmitBranchable. 
14545
14546 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14547
14548         * statement.cs (For): Reduce the number of jumps in loops.
14549
14550         (For): Implement loop inversion for the For statement.
14551
14552         (Break): We can be breaking out of a Try/Catch controlled section
14553         (foreach might have an implicit try/catch clause), so we need to
14554         use Leave instead of Br.
14555
14556         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14557         now).  If the instace expression supports IMemoryLocation, we use
14558         the AddressOf method from the IMemoryLocation to extract the
14559         address instead of emitting the instance.
14560
14561         This showed up with `This', as we were emitting the instance
14562         always (Emit) instead of the Address of This.  Particularly
14563         interesting when This is a value type, as we dont want the Emit
14564         effect (which was to load the object).
14565
14566 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14567
14568         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14569
14570         * statement.cs (Checked): Set the CheckedState during the resolve
14571         process too, as the ConvCast operations track the checked state on
14572         the resolve process, and not emit.
14573
14574         * cs-parser.jay (namespace_member_declaration): Flag that we have
14575         found a declaration when we do.  This is used to flag error 1529
14576
14577         * driver.cs: Report ok when we display the help only.
14578
14579 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14580
14581         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14582
14583 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14584
14585         * cs-tokenizer.cs (define): We also have to track locally the
14586         defines.  AllDefines is just used for the Conditional Attribute,
14587         but we also need the local defines for the current source code. 
14588
14589 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14590
14591         * statement.cs (While, For, Do): These loops can exit through a
14592         Break statement, use this information to tell whether the
14593         statement is the last piece of code.
14594
14595         (Break): Flag that we break.
14596
14597         * codegen.cs (EmitContexts): New `Breaks' state variable.
14598
14599 2002-07-03  Martin Baulig  <martin@gnome.org>
14600
14601         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14602         modifiers in method declarations in structs.  Otherwise, you won't
14603         be able to override things like Object.Equals().
14604
14605 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14606
14607         * class.cs (Method, Property, Indexer): Do not allow the public
14608         modifier to be used in explicit interface implementations.
14609
14610         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14611         override modifiers in method declarations in structs
14612
14613 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14614
14615         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14616         integer or real overflow, report an error
14617
14618 2002-07-02  Martin Baulig  <martin@gnome.org>
14619
14620         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14621         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14622         to tell the runtime about our newly created System.Object and
14623         System.ValueType types.
14624
14625 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14626
14627         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14628         struct instead of Ldarg/Starg.
14629
14630 2002-07-02  Martin Baulig  <martin@gnome.org>
14631
14632         * expression.cs (Indirection.Indirection): Call
14633         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14634
14635 2002-07-02  Martin Baulig  <martin@gnome.org>
14636
14637         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14638         ValueType, call TypeManager.TypeToCoreType() on it.
14639         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14640         the OpCodes.Newarr argument.
14641
14642 2002-07-02  Martin Baulig  <martin@gnome.org>
14643
14644         * expression.cs (Invocation.EmitCall): When compiling corlib,
14645         replace all calls to the system's System.Array type to calls to
14646         the newly created one.
14647
14648         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14649         System.Array methods.
14650         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14651         from the system's System.Array type which must be replaced.
14652
14653 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14654
14655         * typemanager.cs: load unverifiable_code_ctor so we can build
14656         corlib using the correct type. Avoid using GetTypeCode() with
14657         TypeBuilders.
14658         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14659         TypeManager.object_type to allow building corlib.
14660
14661 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14662
14663         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14664
14665 2002-07-01  Martin Baulig  <martin@gnome.org>
14666
14667         * class.cs: Make the last change actually work, we need to check
14668         whether `ifaces != null' to avoid a crash.
14669
14670 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14671
14672         * class.cs: when we build structs without fields that implement
14673         interfaces, we need to add the interfaces separately, since there is
14674         no API to both set the size and add the interfaces at type creation
14675         time.
14676
14677 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14678
14679         * expression.cs: the dimension arguments to the array constructors
14680         need to be converted if they are a long.
14681
14682 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14683
14684         * class.cs: don't emit ldarg.0 if there is no parent constructor
14685         (fixes showstopper for corlib).
14686
14687 2002-06-29  Martin Baulig  <martin@gnome.org>
14688
14689         MCS now compiles corlib on GNU/Linux :-)
14690
14691         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14692         ie. check for MethodImplOptions.InternalCall.
14693
14694         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14695         and TypeManager.attribute_type are null, so we must explicitly check
14696         whether parent is not null to find out whether it's an attribute type.
14697         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14698         and SetBuilder, not only if the property is neither abstract nor external.
14699         This is necessary to set the MethodImplOptions on the accessor methods.
14700         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14701         SetBuilder, see Property.Emit().
14702
14703         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14704         populate "System.Object", "System.ValueType" and "System.Attribute" since
14705         they've already been populated from BootCorlib_PopulateCoreTypes().
14706
14707 2002-06-29  Martin Baulig  <martin@gnome.org>
14708
14709         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14710         is the NullLiteral, we also need to make sure that target_type is not
14711         an enum type.   
14712
14713 2002-06-29  Martin Baulig  <martin@gnome.org>
14714
14715         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14716         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14717         before calling BootstrapCorlib_ResolveDelegate ().
14718
14719 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14720
14721         * statement.cs: fixed build-breaker. All tests passed ok.
14722
14723 2002-06-27  Martin Baulig  <martin@gnome.org>
14724
14725         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14726         for System.Decimal when compiling corlib.
14727
14728 2002-06-27  Martin Baulig  <martin@gnome.org>
14729
14730         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14731         switch blocks which contain nothing but a default clause.
14732
14733 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14734
14735        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14736
14737 2002-06-27  Martin Baulig  <martin@gnome.org>
14738
14739         * ecore.cs (PropertyExpr.PropertyExpr): Call
14740         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14741
14742         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14743         is already a TypeBuilder.
14744
14745 2002-06-27  Martin Baulig  <martin@gnome.org>
14746
14747         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14748         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14749         the "from an array-type to System.Array" case.  This makes it work
14750         when compiling corlib.
14751
14752 2002-06-27  Martin Baulig  <martin@gnome.org>
14753
14754         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14755         non-static PropertyExpr, set its InstanceExpression.  This makes
14756         the `ICollection.Count' property work in System/Array.cs.
14757
14758 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14759
14760         * driver.cs: Made error handling more consistent.  Errors now
14761         tracked by Report class, so many methods which used to return int
14762         now return void.  Main() now prints success/failure and 
14763         errors/warnings message.
14764
14765         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14766         the magic number return values (123 and 124).  Now, if the
14767         expected error occurs, the compiler exits with success (exit value
14768         0).  If the compilation completes without seeing that particular
14769         error, the compiler exits with failure (exit value 1).  The
14770         makefile in mcs/errors has been changed to handle the new behaviour.
14771
14772         * report.cs: Made 'expected error' number a property and renamed
14773         it from 'Probe' to 'ExpectedError'.
14774
14775         * genericparser.cs: Removed error handling support, since it is
14776         now all done by Report class.
14777
14778         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14779         class, so parse() no longer returns an int.
14780
14781         * namespace.cs: Use Report.Error instead of GenericParser.error
14782
14783 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14784
14785         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14786         TypeContainer.AddOperator): At the front of the list put the
14787         explicit implementations, so they get resolved/defined first. 
14788
14789 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14790
14791         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14792         interface type is implemented by this TypeContainer.  Used during
14793         explicit interface implementation.
14794
14795         (Property.Define, Indexer.Define, Method.Define): Validate that
14796         the given interface in the explicit implementation is one of the
14797         base classes for the containing type.
14798
14799         Also if we are explicitly implementing an interface, but there is
14800         no match in the pending implementation table, report an error.
14801
14802         (Property.Define): Only define the property if we are
14803         not explicitly implementing a property from an interface.  Use the
14804         correct name also for those properties (the same CSC uses,
14805         although that is really not needed).
14806
14807         (Property.Emit): Do not emit attributes for explicitly implemented
14808         properties, as there is no TypeBuilder.
14809
14810         (Indexer.Emit): ditto.
14811
14812         Hiding then means that we do not really *implement* a pending
14813         implementation, which makes code fail.
14814
14815 2002-06-22  Martin Baulig  <martin@gnome.org>
14816
14817         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14818         the return value of Object.GetType().  [FIXME: we need to do this whenever
14819         we get a type back from the reflection library].
14820
14821 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14822
14823         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14824
14825 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14826
14827         * attribute.cs: Return null if we can not look up the type.
14828
14829         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14830         the interface types found.
14831
14832         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14833         interface types found.
14834
14835         * typemanager.cs (GetInterfaces): Make this routine returns alll
14836         the interfaces and work around the lame differences between
14837         System.Type and System.Reflection.Emit.TypeBuilder in the results
14838         result for GetInterfaces.
14839
14840         (ExpandInterfaces): Given an array of interface types, expand and
14841         eliminate repeated ocurrences of an interface.  This expands in
14842         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14843         be IA, IB, IC.
14844
14845 2002-06-21  Martin Baulig  <martin@gnome.org>
14846
14847         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14848         on System.Enum.
14849
14850 2002-06-21  Martin Baulig  <martin@gnome.org>
14851
14852         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14853         and called with one of the core types, return the corresponding typebuilder for
14854         that type.
14855
14856         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14857         element type.
14858
14859 2002-06-21  Martin Baulig  <martin@gnome.org>
14860
14861         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14862         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14863         (Expression.ConvertReferenceExplicit): Likewise.
14864
14865         * expression.cs (ElementAccess.DoResolve): Likewise.
14866         (ElementAccess.DoResolveLValue): Likewise.
14867
14868 2002-06-10  Martin Baulig  <martin@gnome.org>
14869
14870         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14871         add the "value" parameter to the parameter list.
14872
14873         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14874         to our caller.
14875
14876 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14877
14878         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14879         the argument to an int, uint, long or ulong, per the spec.  Also
14880         catch negative constants in array creation.
14881
14882 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14883
14884         * class.cs: do not allow the same interface to appear twice in
14885         the definition list.
14886
14887 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14888
14889         * ecore.cs: don't use ldlen with System.Array.
14890
14891 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14892
14893         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14894
14895 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14896
14897         * modifiers.cs: produce correct field attributes for protected
14898         internal. Easy fix so miguel can work on ther harder stuff:-)
14899
14900 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14901
14902         * pending.cs: New file.  Move the code from class.cs here.
14903         Support clearning the pending flag for all methods (when not doing
14904         explicit interface implementation).
14905
14906 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14907
14908         * rootcontext.cs: added a couple more types needed to bootstrap.
14909
14910 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14911
14912         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14913         constructor in the type, instead of any constructor in the type
14914         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14915         a bug in the Mono runtime when applying the params attribute). 
14916
14917 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14918         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14919
14920 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14921
14922         * expression.cs (Unary.ResolveOperator): Use TypeManager
14923         to resolve the type.
14924
14925 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14926
14927         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14928         attached.
14929
14930         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14931         with each member too.
14932
14933         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14934         field builders too - this takes care of the enum member case.
14935
14936 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14937
14938         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14939         address-of operator on both value types and pointers.
14940
14941 2002-06-10  Martin Baulig  <martin@gnome.org>
14942
14943         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14944         PropertyBuilder to the `property_builders' list.
14945
14946         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14947         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14948         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14949         find any indexers which are inherited from an interface.
14950
14951 2002-06-09  Martin Baulig  <martin@gnome.org>
14952
14953         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14954         the same type as the constant if necessary.  There's also a test-130.cs
14955         for this.
14956
14957         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14958
14959         * typemanager.cs (TypeManager.ChangeType): Previously known as
14960         Enum.ChangeEnumType().
14961
14962 2002-06-09  Martin Baulig  <martin@gnome.org>
14963
14964         * expression.cs (Cast.TryReduce): Added support for consts.
14965
14966 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14967
14968         * class.cs (Accessor): Hold attributes information so we can pass
14969         it along.
14970
14971         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14972         Modify to pass in attributes attached to the methods.
14973
14974         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14975
14976         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14977         to handle the Accessor kind :-)
14978
14979         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14980
14981 2002-06-08  Martin Baulig  <martin@gnome.org>
14982
14983         * expression.cs (Unary.TryReduceNegative): Added support for
14984         ULongConstants.
14985
14986 2002-06-08  Martin Baulig  <martin@gnome.org>
14987
14988         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14989         name can't be found in the `defined_names' - the caller will do a
14990         MemberLookup in this case and thus find methods in System.Enum
14991         such as Enum.IsDefined().
14992
14993 2002-06-08  Martin Baulig  <martin@gnome.org>
14994
14995         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14996         Convert.ChangeType() which works with TypeBuilder created types.
14997         (Enum.LookupEnumValue, Enum.Define): Use it here.
14998
14999         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15000         `TypeBuilder.BaseType != null' check.
15001         (TypeContainer.FindMembers): Only lookup parent members if we
15002         actually have a parent.
15003         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15004         (ConstructorInitializer.Resolve): Likewise.
15005
15006         * interface.cs (Interface.FindMembers): Added
15007         `TypeBuilder.BaseType != null' check.
15008
15009         * rootcontext.cs (RootContext.ResolveCore): Added
15010         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15011         classes_second_stage.
15012
15013         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15014         debug_type and trace_type when compiling with --nostdlib.       
15015
15016 2002-06-07  Martin Baulig  <martin@gnome.org>
15017
15018         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15019         (AddField): Set it to true when adding a non-static field.
15020         (DefineType): Use `have_nonstatic_fields' to find out whether we
15021         have non-static fields, not `Fields != null'.
15022
15023 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15024
15025         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15026         dereferencing a null on the static-field code path)
15027
15028 2002-05-30  Martin Baulig  <martin@gnome.org>
15029
15030         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15031         to take command line arguments.  Use reflection to call the new
15032         custom `Initialize' function on the symbol writer and pass it the
15033         command line arguments.
15034
15035         * driver.cs (--debug-args): New command line argument to pass command
15036         line arguments to the symbol writer.
15037
15038 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15041         the target type for indexers and properties.  Thanks to Joe for
15042         catching this.
15043
15044 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15045
15046         * typemanager.cs (MethodFlags): returns the method flags
15047         (Obsolete/ShouldIgnore) that control warning emission and whether
15048         the invocation should be made, or ignored. 
15049
15050         * expression.cs (Invocation.Emit): Remove previous hack, we should
15051         not do this on matching a base type, we should do this based on an attribute
15052
15053         Only emit calls to System.Diagnostics.Debug and
15054         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15055         on the command line.
15056
15057         * rootcontext.cs: Global settings for tracing and debugging.
15058
15059         * cs-tokenizer.cs (define): New utility function to track
15060         defines.   Set the global settings for TRACE and DEBUG if found.
15061
15062 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15063
15064         * interface.cs (Populate*): Pass in the TypeContainer as well as
15065         the DeclSpace as parameters so that we can create EmitContexts and
15066         then use that to apply attributes etc.
15067
15068         (PopulateMethod, PopulateEvent, PopulateProperty)
15069         (PopulateIndexer): Apply attributes everywhere.
15070
15071         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15072         etc.
15073
15074         (ApplyAttributes): Update accordingly.
15075
15076         We now apply interface attributes for all members too.
15077
15078 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * class.cs (Indexer.Define); Correctly check if we are explicit
15081         implementation (instead of checking the Name for a ".", we
15082         directly look up if the InterfaceType was specified).
15083
15084         Delay the creation of the PropertyBuilder.
15085
15086         Only create the PropertyBuilder if we are not an explicit
15087         interface implementation.   This means that explicit interface
15088         implementation members do not participate in regular function
15089         lookups, and hence fixes another major ambiguity problem in
15090         overload resolution (that was the visible effect).
15091
15092         (DefineMethod): Return whether we are doing an interface
15093         implementation. 
15094
15095         * typemanager.cs: Temporary hack until we get attributes in
15096         interfaces (Ravi is working on that) and we get IndexerName
15097         support in interfaces.
15098
15099         * interface.cs: Register the indexers as properties.
15100
15101         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15102         warning, I have verified that this is a bug in the .NET runtime
15103         (JavaScript suffers of the same problem).
15104
15105         * typemanager.cs (MemberLookup): When looking up members for
15106         interfaces, the parent of an interface is the implicit
15107         System.Object (so we succeed in searches of Object methods in an
15108         interface method invocation.  Example:  IEnumerable x;  x.ToString
15109         ()) 
15110
15111 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15112
15113         * class.cs (Event): Events should also register if they do
15114         implement the methods that an interface requires.
15115
15116         * typemanager.cs (MemberLookup); use the new GetInterfaces
15117         method. 
15118
15119         (GetInterfaces): The code used to lookup interfaces for a type is
15120         used in more than one place, factor it here. 
15121
15122         * driver.cs: Track the errors at the bottom of the file, we kept
15123         on going.
15124
15125         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15126         instance if the method we are calling is static!
15127
15128 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15129
15130         * attribute.cs (ApplyAttributes): Make this function filter out
15131         the IndexerName attribute (as that attribute in reality is never
15132         applied) and return the string constant for the IndexerName
15133         attribute. 
15134
15135         * class.cs (TypeContainer.Emit): Validate that all the indexers
15136         have the same IndexerName attribute, and if so, set the
15137         DefaultName attribute on the class. 
15138
15139         * typemanager.cs: The return value might contain other stuff (not
15140         only methods).  For instance, consider a method with an "Item"
15141         property and an Item method.
15142
15143         * class.cs: If there is a problem with the parameter types,
15144         return. 
15145
15146 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15147
15148         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15149         looks at user defined conversion after making a call to 
15150         StandardConversionExists - we need this for overload resolution.
15151
15152         * expression.cs : Update accordingly the various method calls.
15153
15154         This fixes 2 bugs filed against implicit user defined conversions 
15155
15156 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15157
15158         * statement.cs: Track the result of the assignment.
15159
15160 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * expression.cs (MemberAccess): Improved error reporting for
15163         inaccessible members.
15164
15165 2002-05-22  Martin Baulig  <martin@gnome.org>
15166
15167         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15168         itself with debugging support.
15169
15170 2002-05-22  Martin Baulig  <martin@gnome.org>
15171
15172         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15173         Removed, this isn't needed anymore.
15174
15175 2002-05-20  Martin Baulig  <martin@gnome.org>
15176
15177         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15178         be underlying type for an enum.
15179
15180 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15181
15182         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15183         that splits out the loading of just the core types.
15184
15185         * rootcontext.cs (ResolveCore): Split the struct resolution in
15186         two, so we can load the enumeration underlying types before any
15187         enums are used.
15188
15189         * expression.cs (Is): Bandaid until we fix properly Switch (see
15190         bug #24985 for details).
15191
15192         * typemanager.cs (ImplementsInterface): The hashtable will contain
15193         a null if there are no interfaces implemented.
15194
15195 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15196
15197         * cs-parser.jay (indexer_declarator): It is fine to have array
15198         parameters
15199
15200 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15201
15202         * typemanager.cs: (RegisterBuilder): New function used to register
15203         TypeBuilders that implement interfaces.  Since
15204         TypeBuilder.GetInterfaces (as usual) does not work with lame
15205         Reflection.Emit. 
15206         (AddUserType): register interfaces.
15207
15208         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15209         dealing with TypeBuilder.  Also, arrays are showing up as
15210         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15211         methods can not be invoked on them!
15212
15213         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15214         (ImplicitReferenceConversionExists): Split out from
15215         StandardConversionExists. 
15216
15217         * expression.cs (As): We were only implementing one of the three
15218         cases for the as operator.  We now implement them all.
15219         (Is): Implement the various other cases for Is as well.
15220
15221         * typemanager.cs (CACHE): New define used to control if we want or
15222         not the FindMembers cache.  Seems to have a negative impact on
15223         performance currently
15224
15225         (MemberLookup): Nested types have full acess to
15226         enclosing type members
15227
15228         Remove code that coped with instance/static returns for events, we
15229         now catch this in RealFindMembers.
15230
15231         (RealFindMembers): only perform static lookup if the instance
15232         lookup did not return a type or an event.  
15233
15234 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15235
15236         * assign.cs (CompoundAssign): We pass more semantic information
15237         now to Compound Assignments than we did before: now we have all
15238         the information at hand, and now we resolve the target *before* we
15239         do the expression expansion, which allows the "CacheValue" method
15240         to have the effect we intended (before, a [x] += 1 would generate
15241         two differen ArrayAccess expressions from the ElementAccess,
15242         during the resolution process).
15243
15244         (CompoundAssign.DoResolve): Resolve target and original_source here.
15245
15246 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15247
15248         * expression.cs (ArrayAccess): dropped debugging information. 
15249
15250         * typemanager.cs: Small bug fix: I was always returning i_members,
15251         instead of one of i_members or s_members (depending on which had
15252         the content).
15253
15254         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15255         method is invoked before any code generation takes place, and it
15256         is a mechanism to inform that the expression will be invoked more
15257         than once, and that the method should use temporary values to
15258         avoid having side effects
15259
15260         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15261
15262         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15263         implementation.
15264
15265         * expression.cs (Indirection, ArrayAccess): Add support for
15266         CacheTemporaries in these two bad boys. 
15267
15268         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15269         ldobj or ldind_ref.  
15270         (StoreFromPtr): Handle stobj as well.
15271
15272         * expression.cs (UnaryMutator): Share more code.
15273
15274         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15275         down: I was not tracking the Filter function as well, which
15276         was affecting the results of the cache.
15277
15278 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * attribute.cs: Remove the hack to handle the CharSet property on
15281         StructLayouts. 
15282
15283 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15284
15285         * attribute.cs (DoResolve): More uglyness, we now only try to
15286         resolve the attribute partially, to extract the CharSet
15287         information (only if we are a StructLayout attribute).  Otherwise 
15288
15289         (GetExtraTypeInfo): Add some code to conditionally kill in the
15290         future this.   I am more and more convinced that the .NET
15291         framework has special code to handle the attribute setting on
15292         certain elements.
15293
15294         * expression.cs (IsParamsMethodApplicable): Revert my previous
15295         foreach change here, it was wrong.
15296
15297 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15300         (pp_expr): do not abort on unknown input, just return.
15301         (eval): abort if there are pending chars.
15302
15303         * attribute.cs (Attribute.Resolve): Positional parameters are
15304         optional.  Deal with that case.
15305
15306         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15307         the Ansi/Unicode/Auto information for the type.
15308
15309         (TypeContainer.DefineType): instantiate the EmitContext here, as
15310         we will be using it during the type definition (to resolve
15311         attributes) and during the emit phase.
15312
15313         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15314         to pull type information out of the attributes
15315
15316         (Attribute.Resolve): track the constructor builder, and allow for
15317         multiple invocations (structs and classes will use this).
15318
15319         * ecore.cs (MemberLookupFinal): new version with all the
15320         parameters customizable.
15321
15322         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15323         constructors.  Return if the result value is null (as the error
15324         would have been flagged already by MemberLookupFinal)
15325
15326         Do not allow instances of abstract classes or interfaces to be
15327         created.
15328
15329         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15330         We have to compare the assembly property here when dealing with
15331         FamANDAssem and Assembly access modifiers, because we might be
15332         creating an assembly from *modules* (that means that we are not
15333         getting TypeBuilders for types defined in other modules that are
15334         part of this assembly).
15335
15336         (Method.Emit): If the method is marked abstract and has a body,
15337         emit an error. 
15338
15339         (TypeContainer.DefineMembers): If both the defined member and the
15340         parent name match are methods, then do not emit any warnings: let
15341         the Method.Define routine take care of flagging warnings.  But if
15342         there is a mismatch (method overrides something else, or method is
15343         overriwritten by something, then emit warning).
15344
15345         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15346         set to null, this means `do not check for the return type on the
15347         signature'. 
15348
15349         (Method.Define): set the return type for the method signature to
15350         null, so that we get methods with the same name and parameters and
15351         different return types.  This is used to flag warning 114 (you are
15352         hiding a method, and you probably want to use the new/override
15353         keywords instead).
15354
15355         * typemanager.cs (MemberLookup): Implemented proper access
15356         control, closing a long standing set of bug reports.  The problem
15357         was that the Framework only has two bits: Public and NonPublic,
15358         and NonPublic includes private and protected methods, but we need
15359         to enforce the FamANDAssem, FamOrAssem and Family. 
15360
15361 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15362
15363         * statement.cs (GotoCase): Return true: Ammounts to giving up
15364         knowledge on whether we return or not, and letting the other case
15365         be responsible for it.
15366
15367 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15368
15369         * driver.cs: Do not load directories for each file processed, only
15370         do it if there is a pattern.
15371
15372         * ecore.cs: Report readonly assigns here as well, as we might have
15373         been resolved only by MemberAccess.
15374
15375         (SimpleName.SimpleNameResolve): Also be useful for LValue
15376         resolution.   We need this to propagate assign to local readonly variables
15377
15378         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15379         do not want to reuse potential criteria memory.
15380
15381         * class.cs (MyEventBuilder): Set reflected_type;
15382
15383         * ecore.cs (Constantify): Added support for constifying bools.
15384
15385         (RootContext.LookupType): Added a cache for values looked up in
15386         the declaration space.
15387
15388         * typemanager.cs (FindMembers): Now is a front-end to
15389         RealFindMembers, and provides a two-level hashtable-based cache to
15390         the request.  
15391
15392         15% performance improvement: from 22.5 to 19.2 seconds.
15393
15394         * expression.cs (IsParamsMethodApplicable): use foreach.
15395         (Invocation.DoResolve): ditto.
15396         (New.DoResolve): ditto.
15397         (ArrayCreation.DoResolve): ditto.
15398
15399         * ecore.cs (FindMostEncompassingType): use foreach.
15400
15401         * delegate.cs (NewDelegate.DoResolve): Use foreach
15402
15403         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15404         (RemoveMethods): use foreach.
15405
15406         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15407         nested foreach statements instead of for, and also break out of
15408         the inner loop once a match is found.
15409
15410         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15411
15412 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15415         we actually unwrap the expression to allow for extra information
15416         to be extracted. 
15417
15418         * expression.cs: Use Shr_Un on unsigned operations. 
15419
15420 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15421
15422         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15423         applicable operators was not being considered correctly. This closes
15424         the bug Miguel reported.
15425
15426 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15427
15428         * attribute.cs: check that the type derives from System.Attribute
15429         and report the correct error in that case (moved the duplicate code to
15430         its own method, too).
15431
15432 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15433
15434         * attribute.cs: lookup attribute type name as the spec says: first the
15435         bare attribute name and then name + "Attribute" (nant compiles with
15436         mcs after this fix).
15437
15438 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15439
15440         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15441         Because of the way we parse things, we should try to see if a
15442         UIntConstant can fit in an integer.
15443
15444 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15445
15446         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15447         when we are in an explicit context.
15448
15449         (ConvertReferenceExplicit): When converting from Iface type S to Class
15450         T make sure the rules are implemented as an OR.
15451
15452         * parameter.cs (ParameterType): Make it a property for now although the
15453         purpose really isn't anything immediate.
15454
15455         * expression.cs (Is*Applicable): Do better checking on the parameter type
15456         of a ref/out parameter. The ones from the system assemblies are already 
15457         marked with the correct type so we don't need to do any correction.
15458
15459         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15460         the object type is standard too so include that.
15461
15462 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15463
15464         * ecore.cs (StandardConversionExists): Augment with missing code:
15465         deal with IntConstant, LongConstants and Enumerations.
15466
15467         * assign.cs: Report the error, instead of failing silently
15468
15469         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15470         typecontainer that they are declared, because the
15471         typecontainer/namespace will have the list of using clauses that
15472         need to be applied.
15473
15474         Assembly Attributes were escaping the normal registration
15475         mechanism. 
15476
15477         (EmitCode): Apply attributes within an EmitContext that represents
15478         the container they were declared on.
15479
15480         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15481
15482 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15483
15484         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15485         Revamp completely - make much cleaner as we now operate only
15486         on a set of Types.
15487
15488         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15489         to implement the logic detailed in the spec more correctly.
15490
15491         (UserDefinedConversion): Update accordingly.
15492
15493 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15494
15495         * statement.cs: Return flow analysis information up.
15496
15497         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15498         and the default.
15499
15500         (token): Do not consume an extra character before calling
15501         decimal_digits.
15502
15503 2002-05-06  Piers Haken <piersh@friskit.com>
15504
15505         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15506
15507 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15508
15509         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15510         EmitContext during the instance constructor initializer
15511         resolution, to stop access to instance variables.
15512
15513         This is mandated by the spec, last paragraph of the `constructor
15514         initializers' section. 
15515
15516 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15517
15518         * cs-parser.jay, class.cs (Accessor): new class used to represent
15519         an accessor (get or set).  In the past we used `null' to represent
15520         a missing accessor.  But this is ambiguous because there was no
15521         way to tell in abstract indexers/properties if one of them was
15522         specified.
15523
15524         Now there is a way of addressing that.
15525
15526         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15527         instead of FindMembers.
15528
15529         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15530         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15531
15532         * attribute.cs: Treat indexers and properties as the same in terms
15533         of applying attributes
15534
15535         * ecore.cs (FindMostEncompassedType): Use statically initialized
15536         EmptyExpressions()s like we do elsewhere to avoid creating useless
15537         objects (and we take this out of the tight loop).
15538
15539         (GetConversionOperators): Move the code to extract the actual
15540         operators to a separate routine to clean things up.
15541
15542 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15543
15544         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15545         events are always registered FieldBuilders.
15546
15547         * class.cs (FieldBase): New class shared by Fields 
15548
15549         * delegate.cs: If we are a toplevel delegate, use our full name.
15550         If we are a nested delegate, then only use our tail name.
15551
15552 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15553
15554         * expression.cs (IsApplicable): Ensure that we add the "&" to
15555         ref/out types before comparing it with the type of the argument.
15556
15557         (IsParamsMethodApplicable): Ditto.
15558
15559         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15560         silly me ;-)
15561
15562         * delegate.cs : Handle the case when we have more than one applicable
15563         method. Flag an error only when we finish checking all.
15564
15565 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15566
15567         * expression.cs: Add support for boolean static initializers.
15568
15569 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15572
15573         * parameter.cs (ComputeParameterTypes,
15574         ComputeAndDefineParameterTypes): Better error handling: now we
15575         clear the `types' cache if we fail during any of the type lookups.
15576         We also return the status code correctly to our caller
15577
15578         * delegate.cs: If we fail to define a delegate, abort the extra
15579         steps. 
15580
15581         * expression.cs (Binary.ResolveOperator): for
15582         operator==(object,object) and operator !=(object, object) we also
15583         have to verify that there is an implicit conversion from one to
15584         the other.
15585
15586         (ArrayAccess.DoResolve): Array Access can operate on
15587         non-variables. 
15588
15589 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15590
15591         * assign.cs (CompoundAssign): A new class used as a "flag" that
15592         the assignment actually is happening as part of a compound
15593         assignment operator.
15594
15595         During compound assignment, a few new rules exist to enable things
15596         like:
15597
15598         byte b |= 1 + 2
15599
15600         From the spec:
15601
15602         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15603         to the type of x) if y is implicitly convertible to the type of x,
15604         and the operator is a builtin operator and the return type of the
15605         operator is explicitly convertible to the type of x. 
15606
15607         * rootcontext.cs: Reset warning level to 2.  4 catches various
15608         "interesting" features in mcs, we must clean this up at some
15609         point, but currently am trying to kill other bugs ;-)
15610
15611         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15612         in container classes as well.  
15613
15614         * expression.cs (Binary.ResolveOperator): Handle string case
15615         before anything else (as operator overloading does emit an error
15616         before doing anything else).
15617
15618         This code could go away when we move to a table driven model, but
15619         i could not come up with a good plan last night.
15620
15621 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15622
15623         * typemanager.cs (CSharpName): reimplementation using regex.
15624         * class.cs: added null check for fields in Emit
15625         * rootcontext.cs: set warninglevel to 4
15626
15627 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15628
15629         * typemanager.cs (CSharpName): reimplemented with Lupus
15630         suggestion.
15631
15632 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * statement.cs (If): correclty implement Resolve, because we were
15635         not catching sem errors in there.  The same process is needed
15636         everywhere else. 
15637         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15638
15639
15640         (Statement.Warning_DeadCodeFound): Factorize code.
15641         (While): Report dead code here too.
15642
15643         (Statement): Added Resolve virtual method to allow
15644         for resolution split from the emit code.
15645
15646 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * statement.cs (EmitBoolExpression): No longer try to resolve the
15649         expression here.    
15650         (MakeBoolean): New utility function that resolve, implicitly
15651         converts to boolean and tags the expression. 
15652
15653
15654         (If, Do): Implement dead code elimination.
15655         (While): Implement loop inversion
15656
15657         (Do, While, For, If): Resolve the expression prior to calling our
15658         code generation.
15659
15660 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15661
15662         * class.cs:
15663           - added method Report28 (warning: program has more than one entry point)
15664           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15665           - modified method Method.Define, the part at the end of the method
15666
15667         * rootcontext.cs: added static public Location EntryPointLocation;
15668           
15669         * ../errors/cs0028.cs : Add test case for the above warning.              
15670
15671         * typemanager.cs:
15672           - modified method CSharpName to allow arrays of primitive type to
15673             be printed nicely (e.g. instead of System.Int32[][] it now prints
15674             int[][])
15675           - added method CSharpSignature: returns the signature of a method
15676             in string format to be used in reporting errors, warnings, etc.
15677
15678         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15679         with String.Empty.
15680
15681 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15682
15683         * delegate.cs (Define): Fix extremely silly bug where I was
15684         setting the type of the 'object' parameter of the BeginInvoke
15685         method to System.IAsyncResult instead of System.Object ;-)
15686
15687 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15690         here. 
15691
15692         (Constructor.Emit): return if we fail to initialize the
15693         constructor.  Another door closed!  
15694
15695         * expression.cs (New.DoResolve): Improve error message (from -6 to
15696         1501).  Use DeclaredOnly lookup to find the exact constructor.
15697
15698         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15699         loop.  This is useful.
15700
15701         * cs-parser.jay: Adjust the default parameters so that destructors
15702         have the proper signature.
15703
15704 2002-04-26  Martin Baulig  <martin@gnome.org>
15705
15706         * driver.cs (LoadAssembly): If `assembly' contains any characters
15707         which are only valid in path names and not in assembly names
15708         (currently slash, backslash and point), use Assembly.LoadFrom ()
15709         instead of Assembly.Load () on the `assembly' (before iteration
15710         over the link_paths).
15711
15712 2002-04-26  Martin Baulig  <martin@gnome.org>
15713
15714         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15715
15716 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * class.cs (Property): use the new typemanager.MemberLookup
15719
15720         (TypeContainer.MemberLookup): Implement using the
15721         TypeManager.MemberLookup now. 
15722
15723         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15724         and return MemberInfos, so that these can be used without an
15725         EmitContext (what we had before).
15726
15727 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15728
15729         * expression.cs: Fix the case where the argument to params if the
15730         type of the params.  I omitted handling this before.   Fixed
15731
15732 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15733
15734         * driver.cs: Call BootCorlib_PopulateCoreType
15735
15736         * class.cs (Property.CheckBase): Check for properties only, not
15737         for all members. 
15738
15739         * interface.cs: Temporary hack: try/catch around the
15740         CustomAttributeBuilder, because I am getting an exception that I
15741         do not understand.
15742
15743         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15744         types whose definitions are required to be there (attributes are
15745         defined before standard types).
15746
15747         Compute definitions as we boot the various types, as they are used
15748         immediately (value_type class will need object_type, but if we do
15749         not initialize object_type, we will pass a null, which will let
15750         the runtime pick the System.Object from the existing corlib, which
15751         is not what we want).
15752
15753 2002-04-22  Patrik Torstensson <totte@labs2.com>
15754
15755         * cs-tokenizer.cs: fixed a number of trim() issues.
15756
15757 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15758
15759         * expression.cs (Argument.Type): Ensure that we return the correct
15760         type when we have out or ref parameters [in which case we 
15761         append a "&"].
15762
15763 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * class.cs (Property, Indexer): Allow extern modifier in there. 
15766
15767         * typemanager.cs (InitBaseTypes): Initializes object_type and
15768         value_type, since those will be used early on during the bootstrap
15769         process to compile corlib.
15770
15771         (InitCoreTypes): Move code from here to InitBaseTypes.
15772
15773 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15774
15775         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15776         single-dimension arrays as using the ldlen opcode.  
15777
15778         Daniel Lewis discovered this optimization.  
15779
15780         * typemanager.cs: Add signature for System.Array::get_Length
15781
15782 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15783
15784         * statement.cs: report the error when the foreach does not apply to an
15785         array nor a collection.
15786
15787 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15788
15789         * expression.cs: Add implicit conversions to the operator ~.
15790
15791         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15792
15793         * typemanager.cs: Locate the decimal constructor.
15794
15795 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15796
15797         * attribute.cs: use the new property of TypeOf.
15798         * expression.cs: added 'get' property around typearg.
15799
15800         These changes fix a build breaker reported by NickD. Is this the
15801         correct way to fix?  If not, please, revert my changes and make it
15802         work :-).
15803
15804 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * attribute.cs: Add support for typeof in attribute invocations.
15807         I am not sure that this is right though.
15808
15809 2002-04-14  Duncan Mak  <duncan@ximian.com>
15810
15811         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15812         Binary.Operator.Division case.
15813
15814 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15815
15816         * class.cs (DefineType): Ensure that we do a proper check on
15817         attribute types and also register it with the TypeManager.
15818
15819         (TypeContainer.Targets): The default for attribute types is
15820         AttributeTargets.All.
15821
15822         * attribute.cs (ApplyAttributes): Registering the attribute type
15823         is done elsewhere, not when we discover we have a Usage attribute.
15824
15825 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15826
15827         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15828         and get rid of is_delegate parameter.
15829
15830         * everywhere : update.
15831
15832 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15833
15834         * cs-parser.jay (compilation_unit): Revamp completely to use
15835         some new ideas that I got from Rhys' grammar to solve the problems
15836         with assembly level attributes.
15837
15838         (outer_declaration): New grammar production.
15839
15840         (attribute_sections): Add.
15841
15842         (opt_attributes): Base on attribute_sections
15843
15844         (namespace_declaration): Allow opt_attributes to tackle the case
15845         when we have assembly level attributes - we are clever in this
15846         regard now ;-)
15847
15848         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15849         attributes in the non-global context.
15850
15851         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15852         instead of SetGlobalAttributes.
15853
15854         * class.cs, rootcontext.cs : Ensure we define and generate 
15855         attribute types before anything else.
15856
15857         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15858         and flag the new error -20 for the case when the attribute type
15859         does not have valid targets specified. csc does not catch this.
15860
15861         * ../errors/errors.txt : update for error # -20
15862
15863 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15864
15865         * support.cs (InternalParameters.ParameterModifier): Do some null
15866         checking and return sane values.
15867
15868         * class.cs (Method.Define): If we are a PInvoke method, ensure
15869         that we are static and extern. Report error # 601
15870
15871         * ../errors/cs0601.cs : Add test case for the above error.
15872
15873 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15874
15875         * rootcontext.cs (attribute_types): We need to keep type of
15876         all attribute types separately and emit code for them first.
15877
15878         (RegisterAttribute) : Implement.
15879
15880         * class.cs (DefineType): Check if the current Type is a custom
15881         attribute type and register it accordingly.
15882
15883         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15884         adding the first attribute twice and rename to
15885
15886         (SetGlobalAttributes): this.
15887
15888         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15889         lookups.
15890
15891         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15892         if we are processing global arguments. Hmm, I am unsure of this.
15893
15894 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15895
15896         * expression.cs: added static array of strings to avoid calling
15897         Enum.ToString () for Operator in Binary. Significant recover of
15898         performance.
15899
15900 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * class.cs (FindMembers): Allow the Builders of the various
15903         members to be null.  If they are skip them.  This only happens
15904         during the PInvoke declaration.
15905
15906 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15909         failure, so we do not keep going afterwards.
15910
15911         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15912         wanted to pass `false' as the `is_delegate' argument.  If this is
15913         the case, why not use delegate_type == null to mean `is_delegate =
15914         false' and anything else as is_delegate = true.
15915
15916 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15917
15918         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15919         code for the section, not the beginning of the tests.
15920
15921 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15922
15923         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15924
15925         * expression.cs (Binary): same.  Warn about errors where we have
15926         Enum/Enum in operator + as well.
15927
15928 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15929
15930         * statement.cs:
15931                 - added support for switch(bool)
15932                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15933                 - add TableSwitchEmit() to handle table-based switch statements
15934
15935 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15936
15937         * expression.cs (Invocation.OverloadResolve): Factor out code which
15938         does parameter compatibility checking with arguments so that we can 
15939         re-use the code even from Delegate.VerifyApplicability
15940
15941         (VerifyArgumentsCompat): Move above code here.
15942
15943         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15944         and instead make a call to the above method.
15945
15946 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15947
15948         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15949         We use it to keep track of classes which are attribute types.
15950
15951 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15952
15953         * delegate.cs (Delegate.Define): Correctly define the types in the
15954         presence of fixed and array parameters.
15955
15956         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15957         doing FindMembers.
15958
15959         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15960         include NonPublic after the first iteration.
15961
15962         * class.cs (Indexer.CheckBase): Only check if both parents are
15963         non-null. 
15964
15965         * cs-parser.jay (accessor_body): If empty, set to null.
15966
15967         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15968         same code path here to resolve constants names that we did have in
15969         MemberAccess.DoResolve.  There is too much code duplicated here.
15970
15971 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15972
15973         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15974
15975         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15976         to MakeUnionSet.
15977
15978         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15979         tokens, numbers and strings.
15980
15981         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15982         parenthesis.
15983
15984         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15985         asyncronous parameters and the regular parameters.  
15986
15987         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15988         specify the target directory.
15989
15990         * expression.cs: (This.DoResolve): Simplify
15991         (As.Emit): Optimize, do not generate IsInst if the expression is
15992         always of the given type.
15993
15994         (Is.DoResolve): Bug fix, we were reporting both always/never for
15995         the is expression.
15996
15997         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15998         creating too many unnecessary arrays.
15999
16000 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16003         fields instead of rolling our own initializer.   Takes care of all
16004         implicit conversions, and drops unnecessary static checks/argument.
16005
16006 2002-03-31  Dick Porter  <dick@ximian.com>
16007
16008         * driver.cs: use the GetDirectories() return values properly, and
16009         use "/" as path separator.
16010
16011 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * expression.cs (Unary): Optimize - - expr into expr.
16014         (Binary): Optimize a + (-b) into a -b.
16015
16016         * codegen.cs (CodeGen): Made all methods static.
16017
16018 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16019
16020         * rootcontext.cs: 
16021
16022         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16023         TypeBuilder property.
16024
16025         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16026         instead. 
16027
16028         * tree.cs: Removed the various RecordXXXX, and replaced with a
16029         single RecordDecl.  Removed all the accessor methods, and just
16030         left a single access point Type 
16031
16032         * enum.cs: Rename DefineEnum to DefineType.
16033
16034         * decl.cs: New abstract method `DefineType' used to unify the
16035         Defines for Enumerations, Interfaces, TypeContainers and
16036         Delegates.
16037
16038         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16039         LookupBaseClasses method that used to live in class.cs and
16040         interface.cs here, and renamed to FindType.
16041
16042         * delegate.cs: Implement DefineType.  Take advantage of the
16043         refactored pattern for locating the parent builder without taking
16044         the parent_builder argument (which we know does not work if we are
16045         nested, and triggering a toplevel definition).
16046
16047 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16048
16049         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16050         accessibility of a member has changed during override and report
16051         an error if so.
16052
16053         * class.cs (Method.Define, Property.Define): Only complain on
16054         overrides if the method is private, any other accessibility is
16055         fine (and since we just checked the permission is the same, we are
16056         good to go).
16057
16058         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16059         and elif are processed always.  The other pre-processing
16060         directives are only processed if we are "taking" the path
16061
16062 2002-03-29  Martin Baulig  <martin@gnome.org>
16063
16064         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16065         current location is not Null.
16066
16067         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16068         a separate method so we can profile it.
16069
16070         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16071         `span.Seconds' are just seconds, but no minutes or hours.
16072         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16073
16074 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16077         Remove the gratuitous set of Final:
16078
16079                                 // If an interface implementation, then we can set Final.
16080                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16081                                     implementing.DeclaringType.IsInterface)
16082                                         flags |= MethodAttributes.Final;
16083
16084         I do not know what I was smoking when I used that.
16085
16086
16087         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16088         step into fixing the name resolution issues for delegates and
16089         unifying the toplevel name resolution.
16090
16091 2002-03-28  Martin Baulig  <martin@gnome.org>
16092
16093         * class.cs (Method.Emit): If we have a symbol writer, call its
16094         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16095         tell it about the current method.
16096
16097         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16098         writer that we're going to emit the first byte of IL code for a new
16099         statement (a new source line).
16100         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16101         EmitContext.Mark() before emitting any code.
16102
16103         * location.cs (SymbolDocument): Return null when we're Null.
16104
16105         * statement.cs (Statement): Moved the `Location loc' variable here.
16106         (Statement.EmitBoolExpression): If we have a symbol writer, call
16107         ec.Mark() before emitting any code to tell it that we're at the
16108         beginning of a new statement.
16109         (StatementExpression): Added `Location' argument to the constructor.
16110         (Block): Added public readonly variable `StartLocation' and public
16111         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16112         (Block): Added constructor which takes a start and end location.
16113         (Block.SetEndLocation): New method. This sets the end location.
16114         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16115         local variables we create.
16116         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16117         each statement and do also mark the begin and end of the block.
16118
16119         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16120         tell it the current lexer.Location, use Location.Null for the end of the
16121         block.
16122         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16123         current block, set its end location using SetEndLocation().
16124         (statement_expression): StatementExpression constructor now takes the
16125         lexer.Location as additional argument.
16126         (for_statement, declare_local_variables): Likewise.
16127         (declare_local_variables): When creating a new implicit block, use the
16128         new Block constructor and pass it the lexer.Location.
16129
16130 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16131
16132         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16133         members also on the parent interfaces recursively.
16134
16135 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16136
16137         * report.cs: Use new formats, since Gonzalo finished the missing
16138         bits. 
16139
16140         * expression.cs (Binary.ResolveOperator): added missing operator|
16141         operator& and operator^ for bool/bool.
16142
16143         * cs-parser.jay: CheckDef now takes a Location argument that is
16144         used to report errors more precisly (instead of reporting the end
16145         of a definition, we try to track something which is a lot closer
16146         to the source of the problem).
16147
16148         * cs-tokenizer.cs: Track global token use, so we can properly flag
16149         the use of #define/#undef after the first token has been seen.
16150
16151         Also, rename the reportXXXX to Error_DescriptiveName
16152
16153         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16154         TypeContainer, so that Enum and Interface can use this too.
16155
16156         * class.cs (TypeContainer.LookupInterfaceOrClass,
16157         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16158         `builder' argument.  Typically this was used to pass the parent
16159         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16160         the definition).  
16161
16162         The problem is that a nested class could trigger the definition of
16163         a toplevel class, and the builder would be obviously wrong in that
16164         case. 
16165
16166         So we drop this argument, and we compute dynamically the
16167         TypeBuilder/ModuleBuilder (the correct information was available
16168         to us anyways from DeclSpace.Parent)
16169
16170         * interface.cs (Interface.DefineInterface): Drop builder
16171         parameter cleanup like class.cs
16172
16173         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16174         like class.cs
16175
16176         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16177         values. 
16178
16179         (Try.Emit): Propagate the returns value from the statement.
16180
16181         (Return.Emit): Even if we are leavning 
16182
16183         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16184
16185         * modifiers.cs: Fix the computation of MethodAttributes flags.
16186
16187 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16188
16189         * driver.cs: allow compilation of files that start with '/'.
16190         Add a default case when checking the argument of --target.
16191
16192 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16193
16194         * interface.cs: Implement the same search algorithm for types in
16195         the interface code.
16196
16197         * delegate.cs: Do not allow multiple definition.
16198
16199         * Recovered ChangeLog that got accidentally amputated
16200
16201         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16202
16203         * rootcontext.cs: Load manually enum to allow core classes to
16204         contain enumerations.
16205
16206         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16207         Update to new static methods in TypeManager.
16208
16209         * typemanager.cs (GetMethod, GetConstructor): Use our
16210         implementation of FindMembers to find the members, since during
16211         corlib compilation, the types are TypeBuilders and GetMethod and
16212         GetConstructor do not work.
16213
16214         Make all methods in TypeManager static.
16215
16216         (InitCodeHelpers): Split the functionality from
16217         the InitCodeTypes function.
16218
16219         * driver.cs: Call InitCodeHelpers after we have populated the
16220         types. 
16221
16222         * cs-parser.jay (delegate_declaration): we did not used to compute
16223         the delegate name correctly for void delegates.
16224
16225 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16226
16227         * rootcontext.cs (RootContext): Init the interface_resolve_order
16228         and type_container_resolve_order always.
16229
16230         (ResolveCore, BootstrapCorlib_ResolveClass,
16231         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16232         compiler when compiling with --nostdlib
16233
16234         * class.cs (TypeContainer.DefineType): Check that our parent is
16235         not null.  This test is most important when we are bootstraping
16236         the core types.
16237
16238         * codegen.cs: Split out the symbol writing code.
16239
16240 2002-03-25  Martin Baulig  <martin@gnome.org>
16241
16242         * driver.cs (-g): Made -g an alias for --debug.
16243
16244 2002-03-24  Martin Baulig  <martin@gnome.org>
16245
16246         * codegen.cs (SymbolWriter): New public variable. Returns the
16247         current symbol writer.
16248         (CodeGen): Added `bool want_debugging_support' argument to the
16249          constructor. If true, tell the ModuleBuild that we want debugging
16250         support and ask it for the ISymbolWriter.
16251         (Save): If we have a symbol writer, call it's Close() method after
16252         saving the assembly.
16253
16254         * driver.c (--debug): New command line argument to create a
16255         debugger information file.
16256
16257         * location.cs (SymbolDocument): New public property. Returns an
16258         ISymbolDocumentWriter object for the current source file or null
16259         if we don't have a symbol writer.
16260
16261 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16262
16263         * driver.cs (LoadAssembly): Correctly return when all the paths
16264         have been tried and not before.
16265
16266         * statement.cs (Switch.Emit): return the actual coverage for this
16267         statement (returns/not-returns)
16268
16269         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16270         switch of the statement if we are the last switch section.  That
16271         kills two problems: try/catch problems (we used to emit an empty
16272         nop at the end) and switch statements where all branches would
16273         return. 
16274
16275 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16276
16277         * driver.cs: Add default assemblies (the equivalent to the
16278         Microsoft CSC.RSP file)
16279
16280         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16281         also update tokens_seen and set it to false.
16282
16283         * driver.cs: Implement --recurse for Mike.
16284
16285         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16286         correctly splitting out the paths.
16287
16288 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16289
16290         * interface.cs (Interface.PopulateProperty): Instead of using
16291         `parent' as the declaration space for the set parameters, use
16292         `this' 
16293
16294         * support.cs (InternalParameters): InternalParameters constructor
16295         takes a DeclSpace instead of a TypeContainer.
16296
16297         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16298         types are being initialized, load the address of it before calling
16299         the function.  
16300
16301         (New): Provide a mechanism to disable the generation of local
16302         value type temporaries when the caller will be providing us with
16303         an address to store it.
16304
16305         (ArrayCreation.EmitDynamicInitializers): Use it.
16306
16307 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16308
16309         * expression.cs (Invocation.EmitArguments): Only probe for array
16310         property if there is more than one argument.  Sorry about that.
16311
16312         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16313         empty param arrays.
16314
16315         * class.cs (Method.LabelParameters): Fix incorrect code path that
16316         prevented the `ParamArrayAttribute' from being applied to the
16317         params attribute.
16318
16319 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * support.cs (ReflectionParameters): Correctly compute whether the
16322         last argument is a params array.  Fixes the problem with
16323         string.Split ('a')
16324
16325         * typemanager.cs: Make the assemblies array always be non-null
16326         (empty, but non-null)
16327
16328         * tree.cs (RecordDecl): New function that abstracts the recording
16329         of names.  This reports error 101, and provides a pointer to the
16330         previous declaration.  Fixes a crash in the compiler.
16331
16332         * cs-parser.jay (constructor_declaration): Update to new grammar,
16333         and provide a constructor_body that can be empty.
16334
16335 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16336
16337         * driver.cs: Add support for --resources.
16338
16339         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16340         Make all types for the various array helper methods be integer.
16341
16342         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16343         CheckState to ConvCast.
16344
16345         (ConvCast): Now it takes a `checked' state argument, to avoid
16346         depending on the emit context for the conversion, and just using
16347         the resolve time setting.
16348
16349         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16350         instead of Invocation.EmitArguments.  We do not emit the original
16351         arguments, instead we emit those which have been converted to
16352         unsigned int expressions.
16353
16354         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16355
16356         * codegen.cs: ditto.
16357
16358         * expression.cs (LocalVariableReference): Drop the use of the
16359         Store function that depended on the variable index.
16360
16361         * statement.cs (VariableInfo): Drop the `Idx' property from this
16362         class, as this is not taking into account the indexes for
16363         temporaries tat we generate during the execution, getting the
16364         indexes wrong.
16365
16366         * class.cs: First emit class initializers, then call the parent
16367         constructor. 
16368
16369         * expression.cs (Binary): Fix opcode emision.
16370         (UnaryMutator.EmitCode): Support checked code generation
16371
16372         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16373         matches for events for both the Static and Instance scans,
16374         pointing to the same element.   Fix that.
16375
16376 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * rootcontext.cs (ResolveTree): Always set the
16379         interface_resolve_order, because nested interfaces will be calling
16380         into us.
16381
16382         * class.cs (GetInterfaceOrClass): Track the same resolution
16383         process used by TypeManager.LookupType.  This fixes the nested
16384         type lookups in class declarations (separate path from
16385         LookupType). 
16386
16387         (TypeContainer.DefineType): Also define nested interfaces.
16388         (TypeContainer.RegisterOrder): New public function used to
16389         register the order in which child interfaces need to be closed.
16390
16391         Nested interfaces need to be closed after their parents have been
16392         created. 
16393
16394         * interface.cs (InterfaceAttr): Put all the logic for computing
16395         the interface attribute here. 
16396
16397         (DefineInterface): Register our interface order with the
16398         RootContext or with the TypeContainer depending on the case.
16399
16400 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16401
16402         * cs-parser.jay: rework foreach statement to work with the new
16403         changes to the policy on SimpleNames.
16404
16405         * report.cs: support Stacktrace on warnings as well.
16406
16407         * makefile: drop --unsafe and /unsafe from the compile.
16408
16409 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16410
16411         * ecore.cs (StandardConversionExists): Modify to take an Expression
16412         as the first parameter. Ensure we do null -> reference type conversion
16413         checking.
16414
16415         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16416         temporary Expression objects.
16417
16418 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16419
16420         * interface.cs: workaround bug in method overloading resolution
16421         (there is already a bugzilla bug for it).
16422
16423 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16424
16425         We could also solve this problem by having a separate path for
16426         performing type lookups, instead of DoResolve, we could have a
16427         ResolveType entry point, and only participating pieces of the
16428         production (simplename, deref, array) would implement this. 
16429
16430         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16431         signal SimpleName to only resolve type names and not attempt to
16432         resolve anything else.
16433
16434         * expression.cs (Cast): Set the flag.
16435
16436         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16437
16438         * class.cs: Only report 108 if there is no `new' modifier.
16439
16440         * cs-parser.jay: rework foreach statement to work with the new
16441         changes to the policy on SimpleNames.
16442
16443         * report.cs: support Stacktrace on warnings as well.
16444
16445         * makefile: drop --unsafe and /unsafe from the compile.
16446
16447 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16450         lookups here, instead of doing that at parse time.  This means
16451         that our grammar will not introduce `LocalVariableReferences' as
16452         expressions at this point.  That solves the problem of code like
16453         this:
16454
16455         class X {
16456            static void Main ()
16457            { int X = 1;
16458             { X x = null }}}
16459
16460         This is only half the fix.  The full fix requires parameters to
16461         also be handled in this way.
16462
16463         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16464         makes the use more obvious of the DeclSpace.  The
16465         ec.TypeContainer.TypeBuilder is now only used to pull the
16466         TypeBuilder for it.
16467
16468         My theory is that I can get rid of the TypeBuilder completely from
16469         the EmitContext, and have typecasts where it is used (from
16470         DeclSpace to where it matters).  
16471
16472         The only pending problem is that the code that implements Aliases
16473         is on TypeContainer, and probably should go in DeclSpace.
16474
16475         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16476         lookups here, instead of doing that at parse time.  This means
16477         that our grammar will not introduce `LocalVariableReferences' as
16478         expressions at this point.  That solves the problem of code like
16479         this:
16480
16481         class X {
16482            static void Main ()
16483            { int X = 1;
16484             { X x = null }}}
16485
16486         This is only half the fix.  The full fix requires parameters to
16487         also be handled in this way.
16488
16489         * class.cs (Property.DefineMethod): When implementing an interface
16490         method, set newslot, when implementing an abstract method, do not
16491         set the flag (before we tried never setting it, or always setting
16492         it, which is the difference).
16493         (Indexer.DefineMethod): same.
16494         (Method.DefineMethod): same.
16495
16496         * ecore.cs: Only set the status used flag if we get back a Field.
16497
16498         * attribute.cs: Temporary hack, so Paolo can keep working.
16499
16500 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16501
16502         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16503         the unmanaged type in the case we have a MarshalAs attribute.
16504
16505         (Resolve): Handle the case when we are parsing the special MarshalAs
16506         attribute [we need to store the unmanaged type to use later]
16507
16508         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16509         MarshalAs Attribute.
16510
16511         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16512         on parameters and accordingly set the marshalling info.
16513
16514 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * class.cs: Optimizing slightly by removing redundant code after
16517         we switched to the `NoTypes' return value.
16518         (Property.DefineMethod): use NoTypes here too.
16519
16520         This fixes the bug I introduced in my last batch of changes.
16521
16522 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16523
16524         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16525
16526         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16527         Enums since those are types too. 
16528
16529         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16530
16531         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16532         thanks to a call during the lookup process.
16533
16534 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16535
16536         * statement.cs (Foreach): Lots of work to accomodate a particular
16537         kind of foreach statement that I had not kept in mind.  It is
16538         possible to have foreachs on classes that provide a GetEnumerator
16539         method that return objects that implement the "pattern" for using
16540         a foreach, there is no need to support GetEnumerator
16541         specifically. 
16542
16543         This is needed to compile nant.
16544
16545         * decl.cs: Only report 114 if the member is not `Finalize' and if
16546         the warning level is at least 2.
16547
16548         * class.cs: Moved the compare function from Method to
16549         MethodSignature. 
16550
16551         (MethodSignature.InheritableMemberSignatureCompare): Add new
16552         filter function that is used to extract inheritable methods from a
16553         class. 
16554
16555         (Method.Define): Use the new `inheritable_method_signature_filter'
16556         delegate
16557
16558         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16559         command. 
16560
16561 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16562
16563         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16564
16565         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16566
16567         * expression.cs: Pass location information to
16568         ConvertImplicitStandard. 
16569
16570         * class.cs: Added debugging code to track return values from
16571         interfaces. 
16572
16573 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16574
16575         * expression.cs (Is.DoResolve): If either side of the `is' is an
16576         interface, do not flag the warning.
16577
16578         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16579         for interfaces
16580
16581         * report.cs: Allow for --fatal to be used with --probe.
16582
16583         * typemanager.cs (NoTypes): Move the definition for the empty Type
16584         array here. 
16585
16586         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16587         properties. 
16588         (TypeContainer.DefineProxy): New function used to proxy to parent
16589         implementations when implementing interfaces.
16590         (TypeContainer.ParentImplements): used to lookup if our parent
16591         implements a public function that is required by an interface.
16592         (TypeContainer.VerifyPendingMethods): Hook this up.
16593
16594         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16595         `modules' and `assemblies' arraylists into arrays.  We only grow
16596         these are the very early start up of the program, so this improves
16597         the speedof LookupType (nicely measured).
16598
16599         * expression.cs (MakeByteBlob): Replaced unsafe code with
16600         BitConverter, as suggested by Paolo.
16601
16602         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16603         folding of string concatenation, but if either side is a string,
16604         and the other is not, then return null, and let the runtime use
16605         the concatenation on the string plus the object (using
16606         `Object.ToString'). 
16607
16608 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16609
16610         Constant Folding has been implemented now.
16611
16612         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16613         the error instead on types that are not supported in one's
16614         complement. 
16615
16616         * constant.cs (Constant and all children): New set of functions to
16617         perform implict and explicit conversions.
16618
16619         * ecore.cs (EnumConstant): Implement the new functions to perform
16620         conversion by proxying to the child expression.
16621
16622         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16623         own separate setting that can not be turned off from the command
16624         line using --unchecked or --checked and is only controlled using
16625         the checked/unchecked statements and expressions.  This setting is
16626         used by the constant folder to flag errors.
16627
16628         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16629         ConstantCheckState as well.   
16630
16631         During Resolve, they also have to flag the state, because the
16632         constant folder runs completely in the Resolve phase.
16633
16634         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16635         well.
16636
16637 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16638
16639         * cfold.cs: New file, this file contains the constant folder.
16640
16641         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16642         argument to track whether we are using the resulting address to
16643         load or store a value and provide better error messages. 
16644
16645         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16646         new AddressOf arguments.
16647
16648         * statement.cs (Foreach.EmitCollectionForeach): Update
16649
16650         * expression.cs (Argument.Emit): Call AddressOf with proper
16651         arguments to track usage.
16652
16653         (New.DoEmit): Call AddressOf with new arguments.
16654
16655         (Unary.Emit): Adjust AddressOf call.
16656
16657 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16658
16659         * cs-parser.jay (member_access): Change the case for pre-defined types
16660         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16661         this suggestion.
16662
16663         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16664         a method body.
16665
16666         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16667         essentially like methods and apply attributes like MethodImplOptions to them too.
16668
16669         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16670         not being null.
16671
16672         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16673         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16674         is the DeclSpace.
16675
16676         * Update code everywhere accordingly.
16677
16678         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16679
16680         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16681
16682 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16683
16684         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16685         try performing lookups against those instead of jumping straight into using
16686         the 'using' clauses.
16687
16688         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16689
16690         (LookupType): Perform lookups in implicit parents too.
16691
16692         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16693         sequence as RootContext.LookupType. 
16694
16695         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16696         the various cases of namespace lookups into this method.
16697
16698 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16701         in positional arguments)
16702
16703         * class.cs (Operator): Update the AllowedModifiers to contain
16704         extern. 
16705
16706         * cs-parser.jay: Update operator declaration to allow for the
16707         operator body to be empty.
16708
16709         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16710         values. 
16711
16712 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * class.cs (Method.Emit): Label parameters.
16715
16716         * driver.cs: Return 1 or 0 as the program exit code.
16717
16718 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16719
16720         * expression.cs: Special case the `null' object when trying to
16721         auto-compute the type, as anything can be explicitly converted to
16722         that. 
16723
16724         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16725         spotting this Paolo.
16726
16727         (Expression.ImplicitNumericConversion): Perform comparissions of
16728         the type using the underlying type in the case of an enumeration
16729         rather than using the enumeration type for the compare.
16730
16731         Cope with the underlying == type case, which is not possible to
16732         catch before. 
16733
16734         (Expression.ConvertNumericExplicit): Perform comparissions of
16735         the type using the underlying type in the case of an enumeration
16736         rather than using the enumeration type for the compare.
16737
16738         * driver.cs: If the user does not supply an extension, assume .exe
16739
16740         * cs-parser.jay (if_statement): Rewrote so that we can track the
16741         location for the if statement.
16742
16743         * expression.cs (Binary.ConstantFold): Only concat strings when
16744         the operation is "+", not everything ;-)
16745
16746         * statement.cs (Statement.EmitBoolExpression): Take a location
16747         argument. 
16748         (If, While, Do): Track location.
16749
16750         * expression.cs (Binary.ResolveOperator): In the object + string
16751         case, I was missing a call to ConvertImplicit
16752
16753 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16754
16755         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16756         Location arguments. Ensure we use RootContext.LookupType to do our work
16757         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16758
16759         * interface.cs (PopulateMethod): Handle the type of the parameter being
16760         null gracefully.
16761
16762         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16763         have a params method with no fixed arguments and a call is made with no
16764         arguments.
16765
16766 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16767
16768         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16769         the verbatim-string-literal
16770
16771         * support.cs (InternalParameters.ParameterModifier): handle null
16772         fixed parameters.
16773         (InternalParameters.ParameterType): ditto.
16774
16775         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16776         duplicating the name of the variable parameter.
16777         (GetParameterByName): Fix bug where we were not looking up array
16778         paramters if they were the only present (thanks Paolo!).
16779         (GetParameterInfo): We only have an empty set of types if both
16780         fixed and array are set to null.
16781         (GetParameterInfo-idx): Handle FixedParameter == null
16782
16783         * cs-parser.jay: Handle the case where there is no catch
16784         statements (missing null test).
16785
16786 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * driver.cs (MainDriver): Be conservative on our command line
16789         handling.
16790
16791         Catch DirectoryNotFoundException when calling GetFiles.
16792
16793         (SplitPathAndPattern): Used to split the input specification into
16794         a path and a pattern that we can feed to Directory.GetFiles.
16795
16796 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16797
16798         * statement.cs (Fixed): Implement the last case of the Fixed
16799         statement (string handling).
16800
16801         * expression.cs (StringPtr): New class used to return a char * to
16802         a string;  Used by the Fixed statement.
16803
16804         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16805
16806         * expression.cs (Binary.ResolveOperator): Remove redundant
16807         MemberLookup pn parent type.
16808         Optimize union call, we do not need a union if the types are the same.
16809         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16810         type.
16811
16812         Specialize the use of MemberLookup everywhere, instead of using
16813         the default settings. 
16814
16815         (StackAlloc): Implement stackalloc keyword.
16816
16817         * cs-parser.jay: Add rule to parse stackalloc.
16818
16819         * driver.cs: Handle /h, /help, /?
16820
16821         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16822         before we supported unsafe code.
16823
16824         * makefile: add --unsafe to the self compilation of mcs.
16825
16826 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * expression.cs (PointerArithmetic): New class that is used to
16829         perform pointer arithmetic.
16830         (Binary.Resolve): Handle pointer arithmetic
16831         Handle pointer comparission.
16832         (ArrayPtr): Utility expression class that is used to take the
16833         address of an array.
16834
16835         (ElementAccess): Implement array access for pointers
16836
16837         * statement.cs (Fixed): Implement fixed statement for arrays, we
16838         are missing one more case before we are done.
16839
16840         * expression.cs (Indirection): Implement EmitAssign and set the
16841         ExprClass to Variable.  This allows pointer dereferences to be
16842         treated as variables, and to have values assigned to them.
16843
16844         * ecore.cs (Expression.StoreFromPtr): New utility function to
16845         store values dereferencing.
16846
16847 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16848
16849         * expression.cs (Binary.ResolveOperator): Ensure that we are
16850         not trying to operate on a void type - this fixes the reported
16851         bug.
16852
16853         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16854         the parent implementation is sealed.
16855
16856         * ../errors/cs0239.cs : Add.
16857
16858         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16859
16860         * typemanager.cs (unverifiable_code_type): Corresponds to 
16861         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16862         which have unsafe code in them.
16863
16864         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16865         unsafe context.
16866
16867 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16868
16869         * cs-tokenizer.cs: Add support for @"litreal strings"
16870
16871         Make tokenizer accept pre-processor directives
16872         on any column (remove the old C-like limitation). 
16873
16874         * rootcontext.cs (EmitCode): Emit any global attributes.
16875         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16876
16877         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16878
16879         * cs-parser.jay: Add support for global attributes.  
16880
16881 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16882
16883         * expression.cs (Indirection): New helper class.  Unary will
16884         create Indirection classes to be able to implement the
16885         IMemoryLocation interface on it.
16886
16887 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16888
16889         * cs-parser.jay (fixed_statement): reference the right statement.
16890
16891         * statement.cs (Fixed.Emit): Finish implementing the fixed
16892         statement for the &x case.
16893
16894 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16895
16896         * class.cs (Property.Define, Method.Define): Remove newslot when
16897         `implementing'.  
16898
16899         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16900         wrong.  NewSlot should only be used if the `new' keyword is present.
16901
16902         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16903         locating our system dir.  Sorry about this.
16904
16905 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16906
16907         * driver.cs (GetSystemDir): Compute correctly the location of our
16908         system assemblies.  I was using the compiler directory instead of
16909         the library directory.
16910
16911 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16912
16913         * expression.cs (BetterFunction): Put back in what Miguel commented out
16914         since it is the correct fix. The problem is elsewhere ;-)
16915
16916         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16917         parameters of the parms method are themselves compatible or not !
16918
16919         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16920         to check that a class implements an interface before saying that an implicit
16921         conversion was allowed. Use ImplementsInterface to do the checking.
16922
16923 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16924
16925         * class.cs (Method.Define): Track whether we are an explicit
16926         implementation or not.  And only call DefineMethodOverride if we
16927         are an explicit implementation.
16928
16929         (Property.DefineMethod): Ditto.
16930
16931 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16932
16933         * expression.cs (BetterFunction): Catch hideous bug which was
16934          preventing us from detecting ambiguous calls due to implicit casts i.e
16935         cs0121.
16936
16937 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16938
16939         * support.cs (Pair): Remove un-needed method.  I figured why I was
16940         getting the error in cs-parser.jay, the variable in a foreach loop
16941         is readonly, and the compiler does not really treat this as a variable.
16942
16943         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16944         instead of EQUALS in grammar.  
16945
16946         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16947
16948         * expression.cs (Unary.DoResolve): Check whether the argument is
16949         managed or not.
16950
16951 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16952
16953         * support.cs: Api for Pair to set a value.  Despite the fact that
16954         the variables are public the MS C# compiler refuses to compile
16955         code that accesses the field if the variable is part of a foreach
16956         statement. 
16957
16958         * statement.cs (Fixed): Begin implementation of the fixed
16959         statement.
16960
16961         (Block.AddVariable): Return the VariableInfo on success and null
16962         on failure instead of true/false. 
16963
16964         * cs-parser.jay (foreach): Catch errors on variables already
16965         defined (we were ignoring this value before) and properly unwind
16966         the block hierarchy
16967
16968         (fixed_statement): grammar for the fixed statement.
16969
16970 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16971
16972         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16973         pointer types to be incretemented.
16974
16975         (SizeOf): Implement.
16976
16977         * cs-parser.jay (pointer_member_access): Implement
16978         expr->IDENTIFIER production.
16979
16980         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16981         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16982         on safe contexts.
16983
16984         (Unary): Implement indirection.
16985
16986         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16987         use in non-unsafe context).
16988
16989         (SimpleName.DoResolve): Check for pointers in field access on safe
16990         contexts. 
16991
16992         (Expression.LoadFromPtr): Factor the load-indirect code in this
16993         function.  This was duplicated in UnboxCast and ParameterReference
16994
16995 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16996
16997         * expression.cs (ComposedCast): report an error if a pointer cast
16998         is used in a safe region.
16999
17000         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17001         pointer type casts in unsafe context.
17002
17003         * codegen.cs (EmitContext): Set up IsUnsafe.
17004
17005         * cs-parser.jay (non_expression_type): Add productions for pointer
17006         casts. 
17007
17008         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17009         code.  We should not use force into static mode if the method is
17010         not virtual.  Fixes bug in MIS
17011
17012         * statement.cs (Do.Emit, While.Emit, For.Emit,
17013         Statement.EmitBoolExpression): Add support to Do and While to
17014         propagate infinite loop as `I do return' semantics.
17015
17016         Improve the For case to also test for boolean constants.
17017
17018         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17019         to the list of attributes we can add.
17020
17021         Remove `EmitContext' argument.
17022
17023         * class.cs (Method.Define): Apply parameter attributes.
17024         (Constructor.Define): Apply parameter attributes.
17025         (MethodCore.LabelParameters): Move here the core of labeling
17026         parameters. 
17027
17028         * support.cs (ReflectionParameters.ParameterModifier,
17029         InternalParameters.ParameterModifier): Use IsByRef on the type and
17030         only return the OUT bit for these parameters instead of in/out/ref
17031         flags.
17032
17033         This is because I miss-understood things.  The ParameterInfo.IsIn
17034         and IsOut represent whether the parameter has the [In] and [Out]
17035         attributes set.  
17036
17037 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * ecore.cs (FieldExpr.Emit): Release temporaries.
17040
17041         * assign.cs (LocalTemporary.Release): new function.
17042
17043         * codegen.cs (EmitContext.GetTemporaryStorage,
17044         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17045         temporary storage.  Now we can "put back" localbuilders when we
17046         are done with them
17047
17048 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17051         need to make a copy of the variable to generate verifiable code.
17052
17053 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17054
17055         * driver.cs: Compute dynamically the system directory.
17056
17057         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17058         Slower, but more generally useful.  Used by the abstract
17059         registering implementation. 
17060
17061         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17062         the rules for the special rule on Type/instances.  First check if
17063         we have the same name, and if so, try that special static path
17064         rather than the instance path.
17065
17066 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17067
17068         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17069         for, while and if.
17070
17071         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17072         Enum, ValueType, Delegate or Array for non-corlib compiles.
17073
17074         * cs-tokenizer.cs: Catch long identifiers (645)
17075
17076         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17077         piece of code.
17078
17079         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17080         fix, we were returning too early, so we were not registering
17081         pending methods from abstract classes.
17082
17083         Do not register pending methods if the class is abstract.
17084
17085         * expression.cs (Conditional.DoResolve): Report circular implicit
17086         conversions when we neecd to compute it for conditional
17087         expressions. 
17088
17089         (Is.DoResolve): If the expression is always of the provided type,
17090         flag warning 183.  If the expression can not ever be of the
17091         provided type flag warning 184.
17092
17093         * class.cs: Catch 169 as well.
17094
17095         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17096         read. 
17097
17098 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17099
17100         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17101
17102 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17103
17104         * interface.cs: (PopulateMethod): Check for pointers being defined
17105         only if the unsafe context is active.
17106         (PopulateProperty): ditto.
17107         (PopulateIndexer): ditto.
17108
17109         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17110         specified.  If pointers are present, make sure that they are
17111         present in an unsafe context.
17112         (Constructor, Constructor.Define): ditto.
17113         (Field, Field.Define): ditto.
17114         (Property, Property.Define): ditto.
17115         (Event, Event.Define): ditto.
17116
17117         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17118         hashtable if there are classes or structs defined.
17119
17120         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17121         code, as the constant resolution moved.
17122
17123         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17124         the metadata, so we can flag error 133. 
17125
17126         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17127         pointer is being declared in an unsafe context.
17128
17129 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17130
17131         * modifiers.cs (Modifiers.Check): Require a Location argument.
17132         Report error 227 for Unsafe use.
17133
17134         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17135
17136         * statement.cs (For.Emit): If the test is null, then report that
17137         we do `return', as we wont reach anything afterwards.
17138
17139         (Switch.SwitchGoverningType): Track the expression that matched
17140         the conversion.
17141
17142         * driver.cs: Allow negative numbers as an error code to flag.
17143
17144         * cs-parser.jay: Handle 1551.
17145
17146         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17147
17148 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * cs-parser.jay: Report 1518 (type declaration can only contain
17151         class, struct, interface, enum or delegate)
17152
17153         (switch_label): Report 1523 (keywords `case' or `default' must
17154         preced code)
17155
17156         (opt_switch_sections): Report 1522 (empty switch)
17157
17158         * driver.cs: Report 1515 (response file specified multiple times)
17159         Report 1516 (Source file specified multiple times).
17160
17161         * expression.cs (Argument.Resolve): Signal 1510
17162
17163         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17164         access not allowed in static code)
17165
17166 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17167
17168         * typemanager.cs (IsPointerType): Utility method which we are going
17169         to need a lot.
17170
17171         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17172         the object type, so we take care of that.
17173
17174         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17175
17176         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17177         added to non-params parameters :-)
17178
17179         * typemanager.cs (CSharpName): Include 'void' type too. 
17180
17181         (void_ptr_type): Include in the set of core types.
17182
17183         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17184         duplicating code.
17185
17186         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17187         an unsafe context.
17188
17189         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17190         completely forgotten about it.
17191
17192 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17193
17194         * cs-parser.jay (pointer_type): Add. This begins our implementation
17195         of parsing rules for unsafe code.
17196
17197         (unsafe_statement): Implement.
17198
17199         (embedded_statement): Modify to include the above.
17200
17201         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17202
17203         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17204         if the current context is an unsafe one.
17205
17206         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17207         are handled differently, we need separate rules for them.
17208
17209         (local_variable_declaration): Update to use local_variable_pointer_type
17210         to allow variable declarations of unmanaged pointer types.
17211
17212         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17213         in unsafe contexts.
17214
17215         * ../errors/cs0214.cs : Add.
17216
17217 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17218
17219         * makefile: remove 'response' file when cleaning.
17220
17221 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * cs-parser.jay: Report 1524.
17224
17225 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17226
17227         * typemanager.cs (RegisterMethod): drop checking if we have
17228         registered this from here
17229
17230 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * class.cs (Method.EmitDestructor): Implement calling our base
17233         destructor. 
17234
17235         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17236         value of InFinally.
17237
17238         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17239         this routine and will wrap the call in a try/catch block.  Deal
17240         with the case.
17241
17242 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17243
17244         * ecore.cs (Expression.MemberLookup): instead of taking a
17245         parameter `same_type' that was used to tell whether we could
17246         access private members we compute our containing type from the
17247         EmitContext.
17248
17249         (FieldExpr): Added partial support for volatile fields.  This does
17250         not work for volatile fields exposed from assemblies, as I can not
17251         figure out how to extract the modreq from it.
17252
17253         Updated all the source files to use this.
17254
17255         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17256         because it is referenced by MemberLookup very often. 
17257
17258 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17259
17260         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17261         TypeBuilder.GetCustomAttributes to retrieve what we need.
17262
17263         Get rid of redundant default_member_attr_type as this is the same as
17264         default_member_type which already exists.
17265
17266         * interface.cs, attribute.cs : Update accordingly.
17267
17268 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17271         work for TYpeBuilders though.  Ravi, can you please fix this?
17272
17273         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17274
17275         * expression.cs (Argument.Emit): Handle the case of ref objects
17276         being passed to ref functions;  
17277
17278         (ParameterReference.EmitLoad): Loads the content of the pointer
17279         without dereferencing.
17280
17281 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17282
17283         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17284
17285 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17286
17287         * class.cs (Indexer.DefineMethod): Incorporate the interface
17288         type in the name of the method if we are doing explicit interface
17289         implementation.
17290
17291         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17292
17293         (BetterConversion): Fix extremely trivial bug where we were referring to
17294         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17295         again !
17296
17297         * ../errors/bug16.cs : Add although we have fixed it.
17298
17299 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17300
17301         * expression.cs (BaseIndexer): Begin implementation.
17302
17303         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17304
17305         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17306         production directly to remove a shift/reduce, and implement
17307         explicit interface implementation.
17308
17309         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17310         after a floating point suffix.
17311
17312         * expression.cs (DoNumericPromotions): Improved the conversion for
17313         uint/uint.  If we have a constant, we avoid doing a typecast to a
17314         larger type.
17315
17316         * class.cs (Indexer): Implement explicit interface implementation
17317         for indexers.
17318
17319 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17320
17321         * class.cs: make the default instance constructor public and hidebysig.
17322
17323 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17324
17325         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17326         so we can call it from elsewhere.
17327
17328         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17329         we emit it internally if the class has a defined indexer; otherwise the user
17330         emits it by decorating the class definition with the DefaultMemberAttribute.
17331
17332         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17333         attribute is not used on a type which defines an indexer.
17334
17335         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17336         character when we skip whitespace.
17337
17338         * ../errors/cs0646.cs : Add.
17339
17340 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17343         again. 
17344
17345         * makefile: Add practical target `mcs3.exe' which builds the third
17346         generation compiler. 
17347
17348         * expression.cs (New): Fix structures constructor calling.
17349
17350         * class.cs (Property, Method, Indexer): Emit Final flag on the
17351         method if we are an interface implementation and we are not
17352         abstract. 
17353
17354         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17355         whether this property is referencing a `base' method.
17356
17357         * expression.cs (Invocation.EmitCall): take an extra argument:
17358         is_base, this is used to determine whether the `call' or
17359         `callvirt' opcode should be used.
17360
17361
17362         * delegate.cs: update EmitCall.
17363
17364         * class.cs (Method.Define): Set NewSlot for the cases where we are
17365         not implementing an interface method.
17366
17367         (Property.Define): ditto.
17368
17369 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17370
17371         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17372         'r'.  Allows mcs to parse itself fully.
17373
17374 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17375
17376         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17377         of the number of initializers that require the InitializeArray method.
17378
17379         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17380         update the above field where necessary.
17381
17382         (MakeByteBlob): Update accordingly.
17383
17384         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17385         greater than 2.
17386
17387         (EmitDynamicInitializers): Update in accordance with the new optimization.
17388
17389         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17390         same OpCode applies.
17391
17392         * cs-parser.jay : Fix some glaring errors I introduced.
17393
17394 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17395
17396         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17397         so that we can check for name clashes there too.
17398
17399         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17400         for interface indexers.
17401
17402         * interfaces.cs (Define): Emit the default member attribute.
17403
17404         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17405         variable was being referred to while setting the value ;-)
17406
17407 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17408
17409         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17410         byte-by-byte information when we know the data is zero.
17411
17412         Make the block always a multiple of 4, because
17413         DefineInitializedData has a bug.
17414
17415         * assign.cs: Fix, we should assign from the temporary, not from
17416         the source. 
17417
17418         * expression.cs (MakeByteBlob): Fix my incorrect code.
17419
17420 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17421
17422         * typemanager.cs (EnumToUnderlying): This function is used to get
17423         the underlying type from an enumeration, because it does not
17424         always work. 
17425
17426         * constant.cs: Use the I4_S form for values between -128 and 127.
17427
17428         * statement.cs (Block.LookupLabel): Looks up a label.
17429         (Block): Drop support for labeled blocks.
17430
17431         (LabeledStatement): New kind of statement that represents a label
17432         only.
17433
17434         (Goto): Finally implement this bad boy.
17435
17436         * cs-parser.jay: Update to reflect new mechanism to implement
17437         labels.
17438
17439 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * codegen.cs (EmitContext.This): a codegen property that keeps the
17442         a single instance of this instead of creating many different this
17443         instances. 
17444
17445         * delegate.cs (Delegate.DoResolve): Update to use the property;
17446
17447         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17448
17449         * expression.cs (BaseAccess.DoResolve): Ditto.
17450
17451 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17452
17453         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17454         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17455
17456         (InitCoreTypes): Update accordingly.
17457
17458         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17459         so we can quickly store the state.
17460
17461         (ApplyAttributes): Set the correct implementation flags
17462         for InternalCall methods.
17463
17464 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * expression.cs (EmitCall): if a method is not virtual, then do
17467         not use callvirt on it.
17468
17469         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17470         user defined stuff) requires the use of stobj, which takes an
17471         address on the stack instead of an array and an index.  So emit
17472         the Ldelema operation for it.
17473
17474         (EmitStoreOpcode): Use stobj for valuetypes.
17475
17476         (UnaryMutator.EmitCode): Use the right 1 value depending on
17477         whether we are dealing with int64/uint64, float or doubles.
17478
17479         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17480         constructors that I implemented last night.
17481
17482         (Constructor.IsDefault): Fix to work properly for static
17483         constructors.
17484
17485         * cs-parser.jay (CheckDef): report method signature errors.
17486         Update error number 103 to be 132.
17487
17488         * decl.cs: New AdditionResult enumeration value: MethodExists.
17489         Although we do this check for methods later on in the semantic
17490         analysis, catching repeated default constructors is so easy that
17491         we catch these here. 
17492
17493         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17494         promotions code.
17495
17496         (ParameterReference.EmitAssign, Emit): handle
17497         bools as bytes.
17498
17499         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17500         (ArrayAccess.EmitStoreOpcode): ditto.
17501
17502         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17503
17504         * expression.cs (MakeByteBlob): Complete all the missing types
17505         (uint, short, ushort, byte, sbyte)
17506
17507         * class.cs: Only init instance field initializers on instance
17508         constructors. 
17509
17510         Rename `constructors' to instance_constructors. 
17511
17512         (TypeContainer.AddConstructor): Only add constructors to the list
17513         if it is not static.
17514
17515         Make sure that we handle default_static_constructor independently
17516         everywhere where we handle instance_constructors
17517
17518 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * class.cs: Do not lookup or create a base initializer for a
17521         static constructor.
17522
17523         (ConstructorInitializer.Resolve): use the proper type to lookup
17524         for constructors.
17525
17526         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17527
17528         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17529         in DeclSpace. 
17530
17531         * decl.cs: CloseType is now an virtual method, the default
17532         implementation just closes this type.
17533
17534 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17535
17536         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17537         to PreserveSig by default. Also emit HideBySig on such methods.
17538
17539         Basically, set the defaults to standard values.
17540
17541         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17542         argument, if candidate is better, it can't be worse than the best !
17543
17544         (Invocation): Re-write bits to differentiate between methods being
17545         applicable in their expanded form and their normal form - for params
17546         methods of course.
17547
17548         Get rid of use_standard everywhere as only standard conversions are allowed
17549         in overload resolution. 
17550
17551         More spec conformance.
17552
17553 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17554
17555         * driver.cs: Add --timestamp, to see where the compiler spends
17556         most of its time.
17557
17558         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17559         `this' in static code.
17560
17561         (SimpleName.DoResolve): Implement in terms of a helper function
17562         that allows static-references to be passed upstream to
17563         MemberAccess.
17564
17565         (Expression.ResolveWithSimpleName): Resolve specially simple
17566         names when called by MemberAccess to implement the special
17567         semantics. 
17568
17569         (Expression.ImplicitReferenceConversion): Handle conversions from
17570         Null to reference types before others, as Null's type is
17571         System.Object. 
17572
17573         * expression.cs (Invocation.EmitCall): Handle the special case of
17574         calling methods declared on a reference type from a ValueType
17575         (Base classes System.Object and System.Enum)
17576
17577         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17578         the left hand side is a TypeExpr, not on every enumeration. 
17579
17580         (Binary.Resolve): If types are reference types, then do a cast to
17581         object on operators != and == of both arguments.
17582
17583         * typemanager.cs (FindMembers): Extract instance and static
17584         members if requested.
17585
17586         * interface.cs (PopulateProperty): Use void_type instead of null
17587         as the return type for the setter method.
17588
17589         (PopulateIndexer): ditto.
17590
17591 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17592
17593         * support.cs (ReflectionParameters): Fix minor bug where we
17594         were examining the wrong parameter for the ParamArray attribute.
17595
17596         Cope with requests for the type of the parameter at position
17597         greater than the params parameter's. We now return the element
17598         type of the params array as that makes more sense.
17599
17600         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17601         accordingly as we no longer have to extract the element type
17602         ourselves.
17603
17604         (Invocation.OverloadResolve): Update.
17605
17606 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17607
17608         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17609         against IEnumerator, test whether the return value is a descendant
17610         of the IEnumerator interface.
17611
17612         * class.cs (Indexer.Define): Use an auxiliary method to implement
17613         the other bits of the method definition.  Begin support for
17614         explicit interface implementation.
17615
17616         (Property.DefineMethod): Use TypeManager.void_type instead of null
17617         for an empty return value.
17618
17619 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17620
17621         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17622         dealing with a FieldExpr which is composed of a FieldBuilder, in
17623         the code path we did extract the constant, but we should have
17624         obtained the underlying value to be able to cast it (otherwise we
17625         end up in an infinite loop, this is what Ravi was running into).
17626
17627         (ArrayCreation.UpdateIndices): Arrays might be empty.
17628
17629         (MemberAccess.ResolveMemberAccess): Add support for section
17630         14.5.4.1 that deals with the special case of E.I when E is a type
17631         and something else, that I can be a reference to a static member.
17632
17633         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17634         handle a particular array type to create byte blobs, it is just
17635         something we dont generate byteblobs for.
17636
17637         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17638         arguments. 
17639
17640         * location.cs (Push): remove the key from the hashtable that we
17641         are about to add.   This happens for empty files.
17642
17643         * driver.cs: Dispose files after we have parsed them.
17644
17645         (tokenize): new function that only runs the tokenizer on its
17646         input, for speed testing.
17647
17648 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17649
17650         * class.cs (Event.Define): Define the private field only if there
17651         are no accessors defined.
17652
17653         * expression.cs (ResolveMemberAccess): If there is no associated
17654         field with the event, that means we have an event defined with its
17655         own accessors and we should flag error cs0070 since transforming
17656         ourselves into a field is not valid in that case.
17657
17658         * ecore.cs (SimpleName.DoResolve): Same as above.
17659
17660         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17661         and charset to sane values.
17662
17663 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17664
17665         * assign.cs (DoResolve): Perform check on events only if they 
17666         are being accessed outside the declaring type.
17667
17668         * cs-parser.jay (event_declarations): Update rules to correctly
17669         set the type of the implicit parameter etc.
17670
17671         (add_accessor, remove_accessor): Set current local parameters.
17672
17673         * expression.cs (Binary): For delegate addition and subtraction,
17674         cast the return value from the method into the appropriate delegate
17675         type.
17676
17677 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17678
17679         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17680         of these as the workaround is unnecessary.
17681
17682         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17683         delegate data - none of that is needed at all.
17684
17685         Re-write bits to extract the instance expression and the delegate method
17686         correctly.
17687
17688         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17689         on delegates too.
17690
17691         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17692         of attaching attributes instead of duplicating code everywhere.
17693
17694         * everywhere : Update code to do attribute emission using the above method.
17695
17696 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17697
17698         * expression.cs (IsParamsMethodApplicable): if there are not
17699         parameters, return immediately.
17700
17701         * ecore.cs: The 0 literal can be implicity converted to an enum
17702         type. 
17703
17704         (SimpleName.DoResolve): First lookup the type, then lookup the
17705         members. 
17706
17707         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17708         want to get its address.  If the InstanceExpression is not
17709         addressable, store the result in a temporary variable, then get
17710         the address of it.
17711
17712         * codegen.cs: Only display 219 errors on warning level or above. 
17713
17714         * expression.cs (ArrayAccess): Make it implement the
17715         IMemoryLocation interface.
17716
17717         (Binary.DoResolve): handle the operator == (object a, object b)
17718         and operator != (object a, object b) without incurring into a
17719         BoxedCast (because 5 != o should never be performed).
17720
17721         Handle binary enumerator operators.
17722
17723         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17724         value type, otherwise use Ldelem_ref.
17725
17726         Use precomputed names;
17727
17728         (AddressOf): Implement address of
17729
17730         * cs-parser.jay (labeled_statement): Fix recursive block
17731         addition by reworking the production.
17732
17733         * expression.cs (New.DoEmit): New has a special case:
17734                 
17735                  If we are dealing with a ValueType, we have a few
17736                  situations to deal with:
17737                 
17738                     * The target of New is a ValueType variable, that is
17739                       easy, we just pass this as the variable reference
17740                 
17741                     * The target of New is being passed as an argument,
17742                       to a boxing operation or a function that takes a
17743                       ValueType.
17744                 
17745                       In this case, we need to create a temporary variable
17746                       that is the argument of New.
17747
17748
17749 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17750
17751         * rootcontext.cs (LookupType): Check that current_type is not null before
17752         going about looking at nested types.
17753
17754         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17755         not implement the IAssignMethod interface any more.
17756
17757         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17758         where we tranform them into FieldExprs if they are being resolved from within
17759         the declaring type.
17760
17761         * ecore.cs (SimpleName.DoResolve): Do the same here.
17762
17763         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17764
17765         * ../errors/bug10.cs : Add.
17766
17767         * ../errors/cs0070.cs : Add.
17768
17769         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17770
17771         * assign.cs : Get rid of EventIsLocal everywhere.
17772
17773 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * ecore.cs (ConvertIntLiteral): finished the implementation.
17776
17777         * statement.cs (SwitchLabel): Convert the value we are using as a
17778         key before looking up the table.
17779
17780 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17781
17782         * codegen.cs (EmitTopBlock): Require a Location argument now.
17783
17784         * cs-parser.jay (constructor_declarator): We need to setup
17785         current_local_parameters before we parse the
17786         opt_constructor_initializer, to allow the variables to be bound
17787         to the constructor arguments.
17788
17789         * rootcontext.cs (LookupType): First lookup nested classes in our
17790         class and our parents before we go looking outside our class.
17791
17792         * expression.cs (ConstantFold): Extract/debox the values at the
17793         beginnning. 
17794
17795         * rootcontext.cs (EmitCode): Resolve the constants first before we
17796         resolve the types.  This is not really needed, but it helps debugging.
17797
17798         * statement.cs: report location.
17799
17800         * cs-parser.jay: pass location to throw statement.
17801
17802         * driver.cs: Small bug fix.
17803
17804         * report.cs: Updated format to be 4-zero filled digits.
17805
17806 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17807
17808         * expression.cs (CheckIndices): Fix minor bug where the wrong
17809         variable was being referred to ;-)
17810
17811         (DoEmit): Do not call EmitStaticInitializers when the 
17812         underlying type is System.Object.
17813
17814 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17815
17816         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17817         and do the usual workaround for SRE.
17818
17819         * class.cs (MyEventBuilder.EventType): New member to get at the type
17820         of the event, quickly.
17821
17822         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17823
17824         * assign.cs (Assign.DoResolve): Handle the case when the target
17825         is an EventExpr and perform the necessary checks.
17826
17827         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17828         interface.
17829
17830         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17831
17832         (EventExpr): Set the type in the constructor itself since we 
17833         are meant to be born fully resolved.
17834
17835         (EventExpr.Define): Revert code I wrote earlier.
17836                 
17837         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17838         instance expression is null. The instance expression is a This in that case
17839         or a null, depending on whether it is a static method or not.
17840
17841         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17842         refers to more than one method.
17843
17844         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17845         and accordingly flag errors.
17846
17847 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17848
17849         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17850
17851 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17852
17853         * location.cs (ToString): Provide useful rutine.
17854
17855 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17856
17857         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17858         objects, return the actual integral boxed.
17859
17860         * statement.cs (SwitchLabel): define an ILLabel for each
17861         SwitchLabel. 
17862
17863         (Switch.CheckSwitch): If the value is a Literal, extract
17864         the underlying literal.
17865
17866         Also in the unused hashtable we had, add the SwitchLabel so we can
17867         quickly look this value up.
17868
17869         * constant.cs: Implement a bunch of new constants.  Rewrite
17870         Literal based on this.  Made changes everywhere to adapt to this.
17871
17872         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17873         dereferencing array only once, and also copes with enumrations.
17874
17875         bytes are two bytes wide, not one.
17876
17877         (Cast): Perform constant conversions.
17878
17879         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17880         wrappers to the literals here.
17881
17882         * expression.cs (DoNumericPromotions): long literals can converted
17883         to ulong implicity (this is taken care of elsewhere, but I was
17884         missing this spot).
17885
17886         * ecore.cs (Expression.Literalize): Make the return type Literal,
17887         to improve type checking.
17888
17889         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17890
17891 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17892
17893         * literal.cs: Revert code from ravi that checked the bounds.  The
17894         bounds are sane by the definition of the type itself. 
17895
17896         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17897         need to actually look up in our parent hierarchy for interfaces
17898         implemented. 
17899
17900         * const.cs: Use the underlying type for enumerations
17901
17902         * delegate.cs: Compute the basename for the delegate creation,
17903         that should fix the delegate test case, and restore the correct
17904         Type Lookup semantics in rootcontext
17905
17906         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17907         referencing a nested type with the Reflection API is using the "+"
17908         sign. 
17909
17910         * cs-parser.jay: Do not require EOF token at the end.
17911
17912 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17913
17914         * rootcontext.cs (LookupType): Concatenate type names with
17915         a '.' instead of a '+' The test suite passes again.
17916
17917         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17918         field of the enumeration.
17919
17920         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17921         the case when the member is an EventExpr.
17922
17923         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17924         static has an associated instance expression.
17925
17926         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17927
17928         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17929
17930         * class.cs (Event.Define): Register event and perform appropriate checks
17931         for error #111.
17932
17933         We define the Add and Remove methods even if the use provides none because
17934         in that case, we provide default implementations ourselves.
17935
17936         Define a private field of the type of the event. This is done by the CSC compiler
17937         and we should be doing it too ;-)
17938
17939         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17940         More methods we use in code we generate.
17941
17942         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17943         is important.
17944
17945         (InitCoreTypes): Update accordingly for the above.
17946
17947         * class.cs (Event.Emit): Generate code for default accessors that we provide
17948
17949         (EmitDefaultMethod): Do the job in the above.
17950
17951         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17952         appropriate place.
17953
17954 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17955
17956         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17957         builders even if we were missing one.
17958
17959         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17960         pass the Basename as our class name instead of the Name.  The
17961         basename will be correctly composed for us.
17962
17963         * parameter.cs (Paramters): Now takes a Location argument.
17964
17965         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17966         make all the code call directly LookupType in RootContext and take
17967         this chance to pass the Location information everywhere.
17968
17969         * Everywhere: pass Location information.
17970
17971 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * class.cs (Constructor.Define): Updated way of detecting the
17974         length of the parameters.
17975
17976         (TypeContainer.DefineType): Use basename as the type name for
17977         nested types.
17978
17979         (TypeContainer.Define): Do not recursively define types here, as
17980         definition is taken care in order by the RootContext.
17981
17982         * tree.cs: Keep track of namespaces in a per-file basis.
17983
17984         * parameter.cs (Parameter.ComputeSignature): Update to use
17985         DeclSpace. 
17986
17987         (Parameters.GetSignature): ditto.
17988
17989         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17990         instead of a TypeContainer.
17991
17992         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17993         resolve names.  Because we need to be resolve in our context, not
17994         our parents.
17995
17996         * driver.cs: Implement response files.
17997
17998         * class.cs (TypeContainer.DefineType): If we are defined, do not
17999         redefine ourselves.
18000
18001         (Event.Emit): Emit the code for add/remove handlers.
18002         (Event.Define): Save the MethodBuilders for add/remove.
18003
18004         * typemanager.cs: Use pair here too.
18005
18006         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18007         DictionaryEntry requires the first argument to be non-null.  
18008
18009         (enum_declaration): Compute full name for registering the
18010         enumeration.
18011
18012         (delegate_declaration): Instead of using
18013         formal_parameter_list, use opt_formal_parameter_list as the list
18014         can be empty.
18015
18016         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18017         (EventParsing): New property that controls whether `add' and
18018         `remove' are returned as tokens or identifiers (for events);
18019
18020 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18021
18022         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18023         use MyEventBuilder only and let it wrap the real builder for us.
18024
18025         (MyEventBuilder): Revamp constructor etc.
18026
18027         Implement all operations that we perform on EventBuilder in precisely the same
18028         way here too.
18029
18030         (FindMembers): Update to use the EventBuilder member.
18031
18032         (Event.Emit): Update accordingly.
18033
18034 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18035
18036         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18037         by calling the appropriate methods.
18038
18039         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18040         useful.
18041
18042         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18043
18044 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18045
18046         * delegate.cs (Delegate.Populate): Check that the return type
18047         and various parameters types are indeed accessible.
18048
18049         * class.cs (Constructor.Define): Same here.
18050
18051         (Field.Define): Ditto.
18052
18053         (Event.Define): Ditto.
18054
18055         (Operator.Define): Check that the underlying Method defined itself
18056         correctly - so it's MethodBuilder should not be null.
18057
18058         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18059         expression happens to be null.
18060
18061         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18062         members but as of now we don't seem to be able to do anything really useful with it.
18063
18064         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18065         not the EventBuilder.
18066
18067 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * cs-tokenizer.cs: Add support for defines.
18070         Add support for #if, #elif, #else, #endif
18071
18072         (eval_var): evaluates a variable.
18073         (eval): stubbed for evaluating functions.
18074
18075         * cs-parser.jay: Pass the defines information
18076
18077         * driver.cs: Add --define command line option.
18078
18079         * decl.cs: Move MemberCore here.
18080
18081         Make it the base class for DeclSpace.  This allows us to catch and
18082         report 108 and 109 for everything now.
18083
18084         * class.cs (TypeContainer.Define): Extract all the members
18085         before populating and emit the warning 108 (new keyword required
18086         to override) instead of having each member implement this.
18087
18088         (MemberCore.Define): New abstract method, we will be using this in
18089         the warning reporting engine in Populate.
18090
18091         (Operator.Define): Adjust to new MemberCore protocol. 
18092
18093         * const.cs (Const): This does not derive from Expression, it is a
18094         temporary object we use to create fields, it is a MemberCore. 
18095
18096         * class.cs (Method.Define): Allow the entry point to be in a
18097         specific class.
18098
18099         * driver.cs: Rewrite the argument handler to clean it up a bit.
18100
18101         * rootcontext.cs: Made it just an auxiliary namespace feature by
18102         making everything static.
18103
18104         * driver.cs: Adapt code to use RootContext type name instead of
18105         instance variable.
18106
18107         * delegate.cs: Remove RootContext argument.
18108
18109         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18110         argument. 
18111
18112         * class.cs (Event.Define): The lookup can fail.
18113
18114         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18115
18116         * expression.cs: Resolve the this instance before invoking the code.
18117
18118 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18119
18120         * cs-parser.jay: Add a production in element_access that allows
18121         the thing to become a "type" reference.  This way we can parse
18122         things like "(string [])" as a type.
18123
18124         Note that this still does not handle the more complex rules of
18125         casts. 
18126
18127
18128         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18129
18130         * ecore.cs: (CopyNewMethods): new utility function used to
18131         assemble the list of methods from running FindMembers.
18132
18133         (MemberLookup): Rework FindMembers so that 
18134
18135 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * class.cs (TypeContainer): Remove Delegates who fail to be
18138         defined.
18139
18140         * delegate.cs (Populate): Verify that we dont get null return
18141         values.   TODO: Check for AsAccessible.
18142
18143         * cs-parser.jay: Use basename to emit error 574 (destructor should
18144         have the same name as container class), not the full name.
18145
18146         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18147         possible representation.  
18148
18149         Also implements integer type suffixes U and L.
18150
18151 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18152
18153         * expression.cs (ArrayCreation.DoResolve): We need to do the
18154         argument resolution *always*.
18155
18156         * decl.cs: Make this hold the namespace.  Hold the root context as
18157         well.
18158         (LookupType): Move here.
18159
18160         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18161
18162         * location.cs (Row, Name): Fixed the code, it was always returning
18163         references to the first file.
18164
18165         * interface.cs: Register properties defined through interfaces.
18166
18167         * driver.cs: Add support for globbing on the command line
18168
18169         * class.cs (Field): Make it derive from MemberCore as well.
18170         (Event): ditto.
18171
18172 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18173
18174         * class.cs (Event::Define): Check that the type of the event is a delegate
18175         type else flag error #66.
18176
18177         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18178         same.
18179
18180         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18181         values of EntryPoint, CharSet etc etc.
18182
18183         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18184
18185         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18186         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18187         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18188         which needs this to do its work.
18189
18190         * ../errors/cs0066.cs : Add.
18191
18192 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18195         helper functions.
18196
18197         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18198         clears out the parameters field.
18199         (MemberSignatureCompare): Cleanup
18200
18201         (MemberCore): New base class used to share code between MethodCore
18202         and Property.
18203
18204         (RegisterRequiredImplementations) BindingFlags.Public requires
18205         either BindingFlags.Instace or Static.  Use instance here.
18206
18207         (Property): Refactored code to cope better with the full spec.
18208
18209         * parameter.cs (GetParameterInfo): Return an empty array instead
18210         of null on error.
18211
18212         * class.cs (Property): Abstract or extern properties have no bodies.
18213
18214         * parameter.cs (GetParameterInfo): return a zero-sized array.
18215
18216         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18217         method modifier validation to the typecontainer so we can reuse
18218         this on properties.
18219
18220         (MethodCore.ParameterTypes): return an empty sized array of types.
18221
18222         (Property.Define): Test property modifier validity.
18223
18224         Add tests for sealed/override too.
18225
18226         (Method.Emit): abstract or extern methods have no bodies.
18227
18228 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18229
18230         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18231         thing.
18232
18233         (Method::Define, ::Emit): Modify accordingly.
18234
18235         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18236
18237         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18238
18239         * makefile: Pass in /unsafe.
18240
18241 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18242
18243         * class.cs (MakeKey): Kill routine.
18244
18245         * class.cs (TypeContainer.Define): Correctly define explicit
18246         method implementations (they require the full interface name plus
18247         the method name).
18248
18249         * typemanager.cs: Deply the PtrHashtable here and stop using the
18250         lame keys.  Things work so much better.
18251
18252         This of course broke everyone who depended on `RegisterMethod' to
18253         do the `test for existance' test.  This has to be done elsewhere.
18254
18255         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18256         the object stupid Equals method (because, that like fails all over
18257         the place).  We still do not use it.
18258
18259         * class.cs (TypeContainer.SetRequiredInterface,
18260         TypeContainer.RequireMethods): Killed these two routines and moved
18261         all the functionality to RegisterRequiredImplementations.
18262
18263         (TypeContainer.RegisterRequiredImplementations): This routine now
18264         registers all the implementations required in an array for the
18265         interfaces and abstract methods.  We use an array of structures
18266         which can be computed ahead of time to reduce memory usage and we
18267         also assume that lookups are cheap as most classes will not
18268         implement too many interfaces.
18269
18270         We also avoid creating too many MethodSignatures.
18271
18272         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18273         clear the "pending" bit if we find that there are problems with
18274         the declaration.
18275
18276         (TypeContainer.VerifyPendingMethods): Update to report errors of
18277         methods that look like implementations but are not.
18278
18279         (TypeContainer.Define): Add support for explicit interface method
18280         implementation. 
18281
18282 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18283
18284         * typemanager.cs: Keep track of the parameters here instead of
18285         being a feature of the TypeContainer.
18286
18287         * class.cs: Drop the registration of parameters here, as
18288         InterfaceMethods are also interface declarations.
18289
18290         * delegate.cs: Register methods with the TypeManager not only with
18291         the TypeContainer.  This code was buggy.
18292
18293         * interface.cs: Full registation here.
18294
18295 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18296
18297         * expression.cs: Remove reducer for binary expressions, it can not
18298         be done this way.
18299
18300         * const.cs: Put here the code that used to go into constant.cs
18301
18302         * constant.cs: Put here the code for constants, this is a new base
18303         class for Literals.
18304
18305         * literal.cs: Make Literal derive from Constant.
18306
18307 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * statement.cs (Return.Emit): Report error 157 if the user
18310         attempts to return from a finally block.
18311
18312         (Return.Emit): Instead of emitting a return, jump to the end of
18313         the function.
18314
18315         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18316         LocalBuilder to store the result of the function.  ReturnLabel is
18317         the target where we jump.
18318
18319
18320 2001-12-09  Radek Doulik  <rodo@ximian.com>
18321
18322         * cs-parser.jay: remember alias in current namespace
18323
18324         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18325         namespaces
18326
18327         * class.cs (LookupAlias): lookup alias in my_namespace
18328
18329         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18330         aliases hashtable
18331         (LookupAlias): lookup alias in this and if needed in parent
18332         namespaces
18333
18334 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * support.cs: 
18337
18338         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18339         making things static.  I need this to avoid passing the
18340         TypeContainer when calling ParameterType.
18341
18342         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18343         that did string manipulation to compute the type and then call
18344         GetType.  Use Parameter.ParameterType instead.
18345
18346         * cs-tokenizer.cs: Consume the suffix for floating values.
18347
18348         * expression.cs (ParameterReference): figure out whether this is a
18349         reference parameter or not.  Kill an extra variable by computing
18350         the arg_idx during emission.
18351
18352         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18353         function that returns whether a parameter is an out/ref value or not.
18354
18355         (Parameter.ParameterType): The type of the parameter (base,
18356         without ref/out applied).
18357
18358         (Parameter.Resolve): Perform resolution here.
18359         (Parameter.ExternalType): The full type (with ref/out applied).
18360
18361         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18362         support for expressions on the using statement.
18363
18364 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * statement.cs (Using.EmitLocalVariableDecls): Split the
18367         localvariable handling of the using statement.
18368
18369         (Block.EmitMeta): Keep track of variable count across blocks.  We
18370         were reusing slots on separate branches of blocks.
18371
18372         (Try.Emit): Emit the general code block, we were not emitting it. 
18373
18374         Check the type of the declaration to be an IDisposable or
18375         something that can be implicity converted to it. 
18376
18377         Emit conversions if required.
18378
18379         * ecore.cs (EmptyExpression): New utility class.
18380         (Expression.ImplicitConversionExists): New utility function.
18381
18382 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18383
18384         * statement.cs (Using): Implement.
18385
18386         * expression.cs (LocalVariableReference): Support read only variables.
18387
18388         * statement.cs: Remove the explicit emit for the Leave opcode.
18389         (VariableInfo): Add a readonly field.
18390
18391 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18392
18393         * ecore.cs (ConvCast): new class used to encapsulate the various
18394         explicit integer conversions that works in both checked and
18395         unchecked contexts.
18396
18397         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18398         properly generate the overflow opcodes.
18399
18400 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18401
18402         * statement.cs: The correct type for the EmptyExpression is the
18403         element_type, not the variable type.  Ravi pointed this out.
18404
18405 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18406
18407         * class.cs (Method::Define): Handle PInvoke methods specially
18408         by using DefinePInvokeMethod instead of the usual one.
18409
18410         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18411         above to do the task of extracting information and defining the method.
18412
18413 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18414
18415         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18416         of the condition for string type.
18417
18418         (Emit): Move that here. 
18419
18420         (ArrayCreation::CheckIndices): Keep string literals in their expression
18421         form.
18422
18423         (EmitDynamicInitializers): Handle strings appropriately.
18424
18425 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18426
18427         * codegen.cs (EmitContext): Replace multiple variables with a
18428         single pointer to the current Switch statement.
18429
18430         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18431         EmitContext.
18432
18433 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18434
18435         * statement.cs 
18436
18437         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18438         default'.
18439
18440         (Foreach.Emit): Foreach on arrays was not setting
18441         up the loop variables (for break/continue).
18442
18443         (GotoCase): Semi-implented.
18444
18445 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18446
18447         * attribute.cs (CheckAttribute): Handle system attributes by using
18448         Attribute.GetAttributes to examine information we need.
18449
18450         (GetValidPlaces): Same here.
18451
18452         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18453
18454         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18455
18456         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18457
18458         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18459
18460         (Method::Emit): Handle the case when we are a PInvoke method.
18461
18462 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * expression.cs: Use ResolveWithSimpleName on compound names.
18465
18466 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18467
18468         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18469         before trying to reduce it.
18470
18471         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18472
18473         * constant.cs (LookupConstantValue): Implement.
18474
18475         (EmitConstant): Use the above in emitting the constant.
18476
18477         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18478         that are user-defined by doing a LookupConstantValue on them.
18479
18480         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18481         too, like above.
18482
18483 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18484
18485         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18486
18487         (BaseAccess.DoResolve): Implement.
18488
18489         (MemberAccess.DoResolve): Split this routine into a
18490         ResolveMemberAccess routine that can be used independently
18491
18492 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18493
18494         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18495         As that share bits of the implementation.  Is returns a boolean,
18496         while As returns the Type that is being probed.
18497
18498 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18499
18500         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18501         instead of a Literal - much easier.
18502
18503         (EnumInTransit): Remove - utterly useless :-)
18504
18505         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18506
18507         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18508
18509         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18510         chain when we have no associated expression.
18511
18512 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18513
18514         * constant.cs (Define): Use Location while reporting the errror.
18515
18516         Also emit a warning when 'new' is used and there is no inherited
18517         member to hide.
18518
18519         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18520         populated.
18521
18522         (LookupEnumValue): Implement to lookup an enum member's value and define it
18523         if necessary.
18524
18525         (Populate): Re-write accordingly to use the above routine.
18526
18527 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18528
18529         * expression.cs (This): Fix prototype for DoResolveLValue to
18530         override the base class DoResolveLValue.
18531
18532         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18533         declarations) 
18534
18535         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18536         (we need to load the address of the field here).  This fixes
18537         test-22. 
18538
18539         (FieldExpr.DoResolveLValue): Call the DoResolve
18540         function to initialize the Instance expression.
18541
18542         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18543         correctly the GetEnumerator operation on a value type.
18544
18545         * cs-parser.jay: Add more simple parsing error catches.
18546
18547         * statement.cs (Switch): Add support for string switches.
18548         Handle null specially.
18549
18550         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18551
18552 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18553
18554         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18555
18556         (declare_local_constant): New helper function.
18557
18558         * statement.cs (AddConstant): Keep a separate record of constants
18559
18560         (IsConstant): Implement to determine if a variable is a constant.
18561
18562         (GetConstantExpression): Implement.
18563
18564         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18565
18566         * statement.cs (IsVariableDefined): Re-write.
18567
18568 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18569
18570         * class.cs (TypeContainer::FindMembers): Look for constants
18571         in the case when we are looking for MemberTypes.Field
18572
18573         * expression.cs (MemberAccess::DoResolve): Check that in the
18574         case we are a FieldExpr and a Literal, we are not being accessed
18575         by an instance reference.
18576
18577         * cs-parser.jay (local_constant_declaration): Implement.
18578
18579         (declaration_statement): Implement for constant declarations.
18580
18581 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18582
18583         * statement.cs (Switch): Catch double defaults.
18584
18585         (Switch): More work on the switch() statement
18586         implementation.  It works for integral values now, need to finish
18587         string support.
18588
18589
18590 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18591
18592         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18593         integer literals into other integer literals.  To be used by
18594         switch. 
18595
18596 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18597
18598         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18599         some memory.
18600
18601         (EmitDynamicInitializers): Cope with the above since we extract data
18602         directly from ArrayData now.
18603
18604         (ExpectInitializers): Keep track of whether initializers are mandatory
18605         or not.
18606
18607         (Bounds): Make it a hashtable to prevent the same dimension being 
18608         recorded for every element in that dimension.
18609
18610         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18611         from being found.
18612
18613         Also fix bug which was causing the indices to be emitted in the reverse
18614         order.
18615
18616 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18617
18618         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18619         unfinished.  They do not work, because the underlying code is
18620         sloppy.
18621
18622 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18623
18624         * cs-parser.jay: Remove bogus fixme.
18625
18626         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18627         on Switch statement.
18628
18629 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18630
18631         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18632         the same. 
18633
18634         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18635         parameter. Apparently, any expression is allowed. 
18636
18637         (ValidateInitializers): Update accordingly.
18638
18639         (CheckIndices): Fix some tricky bugs thanks to recursion.
18640
18641         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18642         I was being completely brain-dead.
18643
18644         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18645         and re-write acordingly.
18646
18647         (DelegateInvocation): Re-write accordingly.
18648
18649         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18650
18651         (MakeByteBlob): Handle types more correctly.
18652
18653         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18654         initialization from expressions but it is incomplete because I am a complete
18655         Dodo :-|
18656
18657 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18658
18659         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18660         on If.  Basically, we have to return `true' (ie, we do return to
18661         our caller) only if both branches of the if return.
18662
18663         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18664         short-circuit operators, handle them as short circuit operators. 
18665
18666         (Cast.DoResolve): Resolve type.
18667         (Cast.Cast): Take an expression as the target type.
18668
18669         * cs-parser.jay (cast_expression): Remove old hack that only
18670         allowed a limited set of types to be handled.  Now we take a
18671         unary_expression and we resolve to a type during semantic
18672         analysis.
18673
18674         Use the grammar productions from Rhys to handle casts (this is
18675         not complete like Rhys syntax yet, we fail to handle that corner
18676         case that C# has regarding (-x), but we will get there.
18677
18678 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18679
18680         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18681         field which is an array type.
18682
18683         * cs-parser.jay (declare_local_variables): Support array initialization too.
18684
18685         * typemanager.cs (MakeKey): Implement.
18686
18687         (everywhere): Use the above appropriately.
18688
18689         * cs-parser.jay (for_statement): Update for array initialization while
18690         declaring variables.
18691
18692         * ecore.cs : The error message was correct, it's the variable's names that
18693         were misleading ;-) Make the code more readable.
18694
18695         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18696         the correct type etc.
18697
18698         (ConvertExplicit): Handle Enum types by examining the underlying type.
18699
18700 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18701
18702         * parameter.cs (GetCallingConvention): Always return
18703         CallingConventions.Standard for now.
18704
18705 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18706
18707         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18708         and `r' after calling DoNumericPromotions.
18709
18710         * ecore.cs: Fix error message (the types were in the wrong order).
18711
18712         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18713         BindingFlags.Instance as well 
18714
18715         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18716         implicit int literal conversion in an empty cast so that we
18717         propagate the right type upstream.
18718
18719         (UnboxCast): new class used to unbox value types.
18720         (Expression.ConvertExplicit): Add explicit type conversions done
18721         by unboxing.
18722
18723         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18724         the target type before applying the implicit LongLiterals to ULong
18725         literal cast.
18726
18727 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18728
18729         * cs-parser.jay (for_statement): Reworked the way For works: now
18730         we declare manually any variables that are introduced in
18731         for_initializer to solve the problem of having out-of-band code
18732         emition (that is what got for broken).
18733
18734         (declaration_statement): Perform the actual variable declaration
18735         that used to be done in local_variable_declaration here.
18736
18737         (local_variable_declaration): Do not declare anything, just pass
18738         the information on a DictionaryEntry
18739
18740 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18741
18742         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18743         re-write of the logic to now make it recursive.
18744
18745         (UpdateIndices): Re-write accordingly.
18746
18747         Store element data in a separate ArrayData list in the above methods.
18748
18749         (MakeByteBlob): Implement to dump the array data into a byte array.
18750
18751 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18752
18753         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18754         into CheckIndices.
18755
18756         * constant.cs (Define): Implement.
18757
18758         (EmitConstant): Re-write fully.
18759
18760         Pass in location info.
18761
18762         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18763         respectively.
18764
18765         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18766         DictionaryEntry since we need location info too.
18767
18768         (constant_declaration): Update accordingly.
18769
18770         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18771         code into another method : UpdateIndices.
18772
18773 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18774
18775         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18776         some type checking etc.
18777
18778 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18779
18780         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18781         bits to provide dimension info if the user skips doing that.
18782
18783         Update second constructor to store the rank correctly.
18784
18785 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18786
18787         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18788         and try to implement.
18789
18790         * ../errors/cs0150.cs : Add.
18791
18792         * ../errors/cs0178.cs : Add.
18793
18794 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * statement.cs: Implement foreach on multi-dimensional arrays. 
18797
18798         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18799         name of the params argument.
18800
18801         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18802         initializing the array.
18803
18804         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18805         we can use this elsewhere.
18806
18807         * statement.cs: Finish implementation of foreach for single
18808         dimension arrays.
18809
18810         * cs-parser.jay: Use an out-of-band stack to pass information
18811         around, I wonder why I need this.
18812
18813         foreach_block: Make the new foreach_block the current_block.
18814
18815         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18816         function used to return a static Parameters structure.  Used for
18817         empty parameters, as those are created very frequently.
18818
18819         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18820
18821 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18822
18823         * interface.cs : Default modifier is private, not public. The
18824         make verify test passes again.
18825
18826 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18827
18828         * support.cs (ReflectionParameters): Fix logic to determine
18829         whether the last parameter is a params one. Test 9 passes again.
18830
18831         * delegate.cs (Populate): Register the builders we define with
18832         RegisterParameterForBuilder. Test 19 passes again.
18833
18834         * cs-parser.jay (property_declaration): Reference $6 instead
18835         of $$ to get at the location.
18836
18837         (indexer_declaration): Similar stuff.
18838
18839         (attribute): Ditto.
18840
18841         * class.cs (Property): Register parameters for the Get and Set methods
18842         if they exist. Test 23 passes again.
18843
18844         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18845         call to EmitArguments as we are sure there aren't any params arguments. 
18846         Test 32 passes again.
18847
18848         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18849         IndexOutOfRangeException. 
18850
18851         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18852         Test 33 now passes again.
18853
18854 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18857         broke a bunch of things.  Will have to come up with a better way
18858         of tracking locations.
18859
18860         * statement.cs: Implemented foreach for single dimension arrays.
18861
18862 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18863
18864         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18865         an error.  This removes the lookup from the critical path.
18866
18867         * cs-parser.jay: Removed use of temporary_loc, which is completely
18868         broken. 
18869
18870 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18871
18872         * support.cs (ReflectionParameters.ParameterModifier): Report
18873         whether the argument is a PARAMS argument or not.
18874
18875         * class.cs: Set the attribute `ParamArrayAttribute' on the
18876         parameter argument.
18877
18878         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18879         and cons_param_array_attribute (ConstructorInfo for
18880         ParamArrayAttribute)., 
18881
18882         * codegen.cs: Emit the return using the `Return' statement, that
18883         way we can report the error correctly for missing return values. 
18884
18885         * class.cs (Method.Emit): Clean up.
18886
18887         * expression.cs (Argument.Resolve): Take another argument: the
18888         location where this argument is used.  Notice that this is not
18889         part of the "Argument" class as to reduce the size of the
18890         structure (we know the approximate location anyways).
18891
18892         Test if the argument is a variable-reference, if not, then
18893         complain with a 206.
18894
18895         (Argument.Emit): Emit addresses of variables.
18896
18897         (Argument.FullDesc): Simplify.
18898
18899         (Invocation.DoResolve): Update for Argument.Resolve.
18900
18901         (ElementAccess.DoResolve): ditto.
18902
18903         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18904         method should be virtual, as this method is always virtual.
18905
18906         (NewDelegate.DoResolve): Update for Argument.Resolve.
18907
18908         * class.cs (ConstructorInitializer.DoResolve): ditto.
18909
18910         * attribute.cs (Attribute.Resolve): ditto.
18911
18912 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18913
18914         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18915
18916         * expression.cs (ParameterReference): Drop IStackStorage and implement
18917         IAssignMethod instead. 
18918
18919         (LocalVariableReference): ditto.
18920
18921         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18922         IAssignMethod instead. 
18923
18924 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18925
18926         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18927         enumerations that are used in heavily used structures derive from
18928         byte in a laughable and pathetic attempt to reduce memory usage.
18929         This is the kind of pre-optimzations that you should not do at
18930         home without adult supervision.
18931
18932         * expression.cs (UnaryMutator): New class, used to handle ++ and
18933         -- separatedly from the other unary operators.  Cleans up the
18934         code, and kills the ExpressionStatement dependency in Unary.
18935
18936         (Unary): Removed `method' and `Arguments' from this class, making
18937         it smaller, and moving it all to SimpleCall, so I can reuse this
18938         code in other locations and avoid creating a lot of transient data
18939         strucutres when not required.
18940
18941         * cs-parser.jay: Adjust for new changes.
18942
18943 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18944
18945         * enum.cs (Enum.Populate): If there is a failure during
18946         definition, return
18947
18948         * cs-parser.jay (opt_enum_base): we used to catch type errors
18949         here, but this is really incorrect.  The type error should be
18950         catched during semantic analysis.
18951
18952 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18953
18954         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18955         current_local_parameters as expected since I, in my stupidity, had forgotten
18956         to do this :-)
18957
18958         * attribute.cs (GetValidPlaces): Fix stupid bug.
18959
18960         * class.cs (Method::Emit): Perform check on applicability of attributes.
18961
18962         (Constructor::Emit): Ditto.
18963
18964         (Field::Emit): Ditto.
18965
18966         (Field.Location): Store location information.
18967
18968         (Property, Event, Indexer, Operator): Ditto.
18969
18970         * cs-parser.jay (field_declaration): Pass in location for each field.
18971
18972         * ../errors/cs0592.cs : Add.
18973
18974 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18975
18976         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18977
18978         (InitCoreTypes): Update accordingly.
18979
18980         (RegisterAttrType, LookupAttr): Implement.
18981
18982         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18983         info about the same.
18984
18985         (Resolve): Update to populate the above as necessary.
18986
18987         (Error592): Helper.
18988
18989         (GetValidPlaces): Helper to the above.
18990
18991         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18992
18993         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18994
18995 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18996
18997         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18998
18999         * ../errors/cs0617.cs : Add.
19000
19001 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19002
19003         * enum.cs (Emit): Rename to Populate to be more consistent with what
19004         we expect it to do and when exactly it is called.
19005
19006         * class.cs, rootcontext.cs : Update accordingly.
19007
19008         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19009         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19010
19011         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19012
19013         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19014         of a fieldinfo using the above, when dealing with a FieldBuilder.
19015
19016 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19017
19018         * ../errors/cs0031.cs : Add.
19019
19020         * ../errors/cs1008.cs : Add.
19021
19022         * ../errrors/cs0543.cs : Add.
19023
19024         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19025         enum type.
19026
19027         (FindMembers): Implement.
19028
19029         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19030         enums and delegates too.
19031
19032         (enum_types): Rename to builder_to_enum.
19033
19034         (delegate_types): Rename to builder_to_delegate.
19035
19036         * delegate.cs (FindMembers): Implement.
19037
19038 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19039
19040         * typemanager.cs (IsEnumType): Implement.
19041
19042         * enum.cs (Emit): Re-write parts to account for the underlying type
19043         better and perform checking etc.
19044
19045         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19046         of the underlying type.
19047
19048         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19049         value
19050
19051         * enum.cs (error31): Helper to report error #31.
19052
19053         * cs-parser.jay (enum_declaration): Store location of each member too.
19054
19055         * enum.cs (member_to_location): New hashtable. 
19056
19057         (AddEnumMember): Update location hashtable.
19058
19059         (Emit): Use the location of each member while reporting errors.
19060
19061 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19062
19063         * cs-parser.jay: A for_initializer if is a
19064         local_variable_declaration really ammount to have an implicit
19065         block with the variable declaration and no initializer for for.
19066
19067         * statement.cs (For.Emit): Cope with null initializers.
19068
19069         This fixes the infinite loop on for initializers.
19070
19071 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19072
19073         * enum.cs: More cleanup.
19074
19075         * ecore.cs: Remove dead code.
19076
19077         * class.cs (Property.Emit): More simplification.
19078         (Event.Emit): ditto.
19079
19080         Reworked to have less levels of indentation.
19081
19082 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19083
19084         * class.cs (Property): Emit attributes.
19085
19086         (Field): Ditto.
19087
19088         (Event): Ditto.
19089
19090         (Indexer): Ditto.
19091
19092         (Operator): Ditto.
19093
19094         * enum.cs (Emit): Ditto.
19095
19096         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19097         Enums too.
19098
19099         * class.cs (Field, Event, etc.): Move attribute generation into the
19100         Emit method everywhere.
19101
19102         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19103         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19104         as we had no way of defining nested enums !
19105
19106         * rootcontext.cs : Adjust code accordingly.
19107
19108         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19109
19110 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19111
19112         * expression.cs (EvalConstantExpression): Move into ecore.cs
19113
19114         * enum.cs (Enum): Rename some members and make them public and readonly
19115         according to our convention.
19116
19117         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19118         nothing else.
19119
19120         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19121
19122         (Enum::Emit): Write a simple version for now which doesn't try to compute
19123         expressions. I shall modify this to be more robust in just a while.
19124
19125         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19126
19127         (TypeContainer::CloseType): Create the Enum types too.
19128
19129         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19130
19131         * expression.cs (EvalConstantExpression): Get rid of completely.
19132
19133         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19134         user-defined values and other cases.
19135
19136         (IsValidEnumLiteral): Helper function.
19137
19138         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19139         out there in the case we had a literal FieldExpr.
19140
19141         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19142
19143         (Literalize): Revamp a bit to take two arguments.
19144
19145         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19146
19147 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19148
19149         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19150
19151         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19152
19153         (Resolve): Use the above to ensure we have proper initializers.
19154
19155 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19156
19157         * expression.cs (Expression::EvalConstantExpression): New method to 
19158         evaluate constant expressions.
19159
19160         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19161
19162 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19163
19164         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19165         in an array.
19166
19167         (Binary.ResolveOperator): Handle operator != (object a, object b)
19168         and operator == (object a, object b);
19169
19170         (Binary.DoNumericPromotions): Indicate whether the numeric
19171         promotion was possible.
19172
19173         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19174         Implement.  
19175
19176         Made the ArrayAccess implement interface IAssignMethod instead of
19177         IStackStore as the order in which arguments are passed reflects
19178         this.
19179
19180         * assign.cs: Instead of using expr.ExprClass to select the way of
19181         assinging, probe for the IStackStore/IAssignMethod interfaces.
19182
19183         * typemanager.cs: Load InitializeArray definition.
19184
19185         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19186         static data that can be used to initialize arrays. 
19187
19188 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * expression.cs: Handle operator== and operator!= for booleans.
19191
19192         (Conditioal.Reduce): Implement reducer for the ?: operator.
19193
19194         (Conditional.Resolve): Implement dead code elimination.
19195
19196         (Binary.Resolve): Catch string literals and return a new
19197         concatenated string.
19198
19199         (Unary.Reduce): Implement reduction of unary expressions.
19200
19201         * ecore.cs: Split out the expression core handling here.
19202
19203         (Expression.Reduce): New method used to perform constant folding
19204         and CSE.  This is needed to support constant-expressions. 
19205
19206         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19207         targets, and optimize for !x.
19208
19209 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19210
19211         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19212         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19213         set custom atttributes.
19214
19215         * literal.cs (Literal::GetValue): New abstract method to return the actual
19216         value of the literal, cast as an object.
19217
19218         (*Literal): Implement GetValue method.
19219
19220         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19221         expressions to the arraylist but objects of type Argument.
19222
19223         * class.cs (TypeContainer::Emit): Emit our attributes too.
19224
19225         (Method::Emit, Constructor::Emit): Ditto.
19226
19227         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19228         to be ignoring earlier.
19229
19230 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19231
19232         * attribute.cs (AttributeSection::Define): Implement to do the business
19233         of constructing a CustomAttributeBuilder.
19234
19235         (Attribute): New trivial class. Increases readability of code.  
19236
19237         * cs-parser.jay : Update accordingly.
19238
19239         (positional_argument_list, named_argument_list, named_argument): New rules
19240
19241         (attribute_arguments): Use the above so that we are more correct.
19242
19243 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19244
19245         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19246         to perform all checks for a method with a params parameter.
19247
19248         (Invocation::OverloadResolve): Update to use the above method and therefore
19249         cope correctly with params method invocations.
19250
19251         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19252         params too.
19253
19254         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19255         constructors in our parent too because we can't afford to miss out on 
19256         protected ones ;-)
19257
19258         * attribute.cs (AttributeSection): New name for the class Attribute
19259
19260         Other trivial changes to improve readability.
19261
19262         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19263         use the new class names.
19264
19265 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19266
19267         * class.cs (Method::Define): Complete definition for params types too
19268
19269         (Indexer::Define): Ditto.
19270
19271         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19272         Cope everywhere with a request for info about the array parameter.
19273
19274 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19275
19276         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19277
19278         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19279         local_variable_type to extract the string corresponding to the type.
19280
19281         (local_variable_type): Fixup the action to use the new helper method.
19282
19283         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19284         go.
19285
19286         * expression.cs : Clean out code which uses the above.
19287
19288 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19289
19290         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19291         and bale out if necessary by returning a false.
19292
19293         (RegisterProperty): Ditto.
19294
19295         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19296         and print out appropriate error messages.
19297
19298         * interface.cs (everywhere): Ditto.
19299
19300         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19301         location to constructor.
19302
19303         * class.cs (Property, Event, Indexer): Update accordingly.
19304
19305         * ../errors/cs111.cs : Added.
19306
19307         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19308         of a method, as laid down by the spec.
19309
19310         (Invocation::OverloadResolve): Use the above method.
19311
19312 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19313
19314         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19315         now take a TypeContainer and a Parameters object.
19316
19317         (ParameterData): Modify return type of ParameterModifier method to be 
19318         Parameter.Modifier and not a string.
19319
19320         (ReflectionParameters, InternalParameters): Update accordingly.
19321
19322         * expression.cs (Argument::GetParameterModifier): Same here.
19323
19324         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19325         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19326         symbol in it at all so maybe this is only for now.
19327
19328 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19329
19330         * support.cs (InternalParameters): Constructor now takes an extra argument 
19331         which is the actual Parameters class.
19332
19333         (ParameterDesc): Update to provide info on ref/out modifiers.
19334
19335         * class.cs (everywhere): Update call to InternalParameters to pass in
19336         the second argument too.
19337
19338         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19339         to return the modifier info [ref/out etc]
19340
19341         (InternalParameters, ReflectionParameters): Implement the above.
19342
19343         * expression.cs (Argument::ParameterModifier): Similar function to return
19344         info about the argument's modifiers.
19345
19346         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19347         too.
19348
19349         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19350         a new SetFormalParameters object which we pass to InternalParameters.
19351
19352 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19353
19354         * expression.cs (NewArray): Merge into the ArrayCreation class.
19355
19356 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19357
19358         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19359         NewUserdefinedArray into one as there wasn't much of a use in having
19360         two separate ones.
19361
19362         * expression.cs (Argument): Change field's name to ArgType from Type.
19363
19364         (Type): New readonly property which returns the proper type, taking into 
19365         account ref/out modifiers.
19366
19367         (everywhere): Adjust code accordingly for the above.
19368
19369         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19370         whether we are emitting for a ref or out parameter.
19371
19372         * expression.cs (Argument::Emit): Use the above field to set the state.
19373
19374         (LocalVariableReference::Emit): Update to honour the flag and emit the
19375         right stuff.
19376
19377         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19378
19379         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19380
19381         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19382
19383         (ReflectionParameters, InternalParameters): Implement the above method.
19384
19385         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19386         reporting errors.
19387
19388         (Invocation::FullMethodDesc): Ditto. 
19389
19390 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * cs-parser.jay: Add extra production for the second form of array
19393         creation. 
19394
19395         * expression.cs (ArrayCreation): Update to reflect the above
19396         change. 
19397
19398         * Small changes to prepare for Array initialization.
19399
19400 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19401
19402         * typemanager.cs (ImplementsInterface): interface might be null;
19403         Deal with this problem;
19404
19405         Also, we do store negative hits on the cache (null values), so use
19406         this instead of calling t.GetInterfaces on the type everytime.
19407
19408 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19409
19410         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19411
19412         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19413         split functionality out into different classes.
19414
19415         (New::FormArrayType): Move into NewBuiltinArray.
19416
19417         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19418         quite useless.
19419
19420         (NewBuiltinArray): New class to handle creation of built-in arrays.
19421
19422         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19423         account creation of one-dimensional arrays.
19424
19425         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19426
19427         (NewUserdefinedArray::DoResolve): Implement.
19428
19429         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19430
19431         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19432         we maintain inside the TypeManager. This is necessary to perform lookups on the
19433         module builder.
19434
19435         (LookupType): Update to perform GetType on the module builders too.     
19436
19437         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19438
19439         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19440
19441 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19442
19443         * expression.cs (New::DoResolve): Implement guts of array creation.
19444
19445         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19446
19447 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19448
19449         * expression.cs: Fix bug I introduced lsat night that broke
19450         Delegates. 
19451
19452         (Expression.Resolve): Report a 246 error (can not resolve name)
19453         if we find a SimpleName in the stream.
19454
19455         (Expression.ResolveLValue): Ditto.
19456
19457         (Expression.ResolveWithSimpleName): This function is a variant of
19458         ResolveName, this one allows SimpleNames to be returned without a
19459         warning.  The only consumer of SimpleNames is MemberAccess
19460
19461 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19462
19463         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19464         might arrive here.  I have my doubts that this is correct.
19465
19466         * statement.cs (Lock): Implement lock statement.
19467
19468         * cs-parser.jay: Small fixes to support `lock' and `using'
19469
19470         * cs-tokenizer.cs: Remove extra space
19471
19472         * driver.cs: New flag --checked, allows to turn on integer math
19473         checking. 
19474
19475         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19476         Threading.Monitor.Exit 
19477
19478 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19479
19480         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19481         Expression Class to be IndexerAccess.
19482
19483         Notice that Indexer::DoResolve sets the eclass to Value.
19484
19485 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19486
19487         * class.cs (TypeContainer::Emit): Emit code for indexers.
19488
19489         * assign.cs (IAssignMethod): New interface implemented by Indexers
19490         and Properties for handling assignment.
19491
19492         (Assign::Emit): Simplify and reuse code. 
19493
19494         * expression.cs (IndexerAccess, PropertyExpr): Implement
19495         IAssignMethod, clean up old code. 
19496
19497 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19498
19499         * typemanager.cs (ImplementsInterface): New method to determine if a type
19500         implements a given interface. Provides a nice cache too.
19501
19502         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19503         method.
19504
19505         (ConvertReferenceExplicit): Ditto.
19506
19507         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19508         various methods, with correct names etc.
19509
19510         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19511         Operator.UnaryNegation.
19512
19513         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19514         we have a unary plus or minus operator.
19515
19516         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19517         UnaryMinus.
19518
19519         * everywhere : update accordingly.
19520
19521         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19522         respectively.
19523
19524         * class.cs (Method::Define): For the case where we are implementing a method
19525         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19526         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19527
19528 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19529
19530         * interface.cs (FindMembers): Implement to work around S.R.E
19531         lameness.
19532
19533         * typemanager.cs (IsInterfaceType): Implement.
19534
19535         (FindMembers): Update to handle interface types too.
19536
19537         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19538         use IsAssignableFrom as that is not correct - it doesn't work.
19539
19540         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19541         and accordingly override EmitStatement.
19542
19543         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19544         using the correct logic :-)
19545
19546 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19547
19548         * ../errors/cs-11.cs : Add to demonstrate error -11 
19549
19550 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19551
19552         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19553         then pass this as a hint to ResolveLValue.
19554
19555         * expression.cs (FieldExpr): Add Location information
19556
19557         (FieldExpr::LValueResolve): Report assignment to readonly
19558         variable. 
19559
19560         (Expression::ExprClassFromMemberInfo): Pass location information.
19561
19562         (Expression::ResolveLValue): Add new method that resolves an
19563         LValue. 
19564
19565         (Expression::DoResolveLValue): Default invocation calls
19566         DoResolve. 
19567
19568         (Indexers): New class used to keep track of indexers in a given
19569         Type. 
19570
19571         (IStackStore): Renamed from LValue, as it did not really describe
19572         what this did.  Also ResolveLValue is gone from this interface and
19573         now is part of Expression.
19574
19575         (ElementAccess): Depending on the element access type
19576
19577         * typemanager.cs: Add `indexer_name_type' as a Core type
19578         (System.Runtime.CompilerServices.IndexerNameAttribute)
19579
19580         * statement.cs (Goto): Take a location.
19581
19582 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19583
19584         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19585         if two delegates are compatible.
19586
19587         (NewDelegate::DoResolve): Update to take care of the case when
19588         we instantiate a delegate from another delegate.
19589
19590         * typemanager.cs (FindMembers): Don't even try to look up members
19591         of Delegate types for now.
19592
19593 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19594
19595         * delegate.cs (NewDelegate): New class to take care of delegate
19596         instantiation.
19597
19598         * expression.cs (New): Split the delegate related code out into 
19599         the NewDelegate class.
19600
19601         * delegate.cs (DelegateInvocation): New class to handle delegate 
19602         invocation.
19603
19604         * expression.cs (Invocation): Split out delegate related code into
19605         the DelegateInvocation class.
19606
19607 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19608
19609         * expression.cs (New::DoResolve): Implement delegate creation fully
19610         and according to the spec.
19611
19612         (New::DoEmit): Update to handle delegates differently.
19613
19614         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19615         because of which we were printing out arguments in reverse order !
19616
19617         * delegate.cs (VerifyMethod): Implement to check if the given method
19618         matches the delegate.
19619
19620         (FullDelegateDesc): Implement.
19621
19622         (VerifyApplicability): Implement.
19623
19624         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19625         delegate invocations too.
19626
19627         (Invocation::Emit): Ditto.
19628
19629         * ../errors/cs1593.cs : Added.
19630
19631         * ../errors/cs1594.cs : Added.
19632
19633         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19634
19635 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19636
19637         * typemanager.cs (intptr_type): Core type for System.IntPtr
19638
19639         (InitCoreTypes): Update for the same.
19640
19641         (iasyncresult_type, asynccallback_type): Ditto.
19642
19643         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19644         correct.
19645
19646         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19647         too.
19648
19649         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19650         the builders for the 4 members of a delegate type :-)
19651
19652         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19653         type.
19654
19655         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19656
19657         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19658
19659 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19660
19661         * statement.cs (Break::Emit): Implement.   
19662         (Continue::Emit): Implement.
19663
19664         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19665         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19666         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19667         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19668         end loop
19669
19670         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19671         properties that track the label for the current loop (begin of the
19672         loop and end of the loop).
19673
19674 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19675
19676         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19677         use of emitting anything at all.
19678
19679         * class.cs, rootcontext.cs : Get rid of calls to the same.
19680
19681         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19682
19683         (Populate): Define the constructor correctly and set the implementation
19684         attributes.
19685
19686         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19687         have been defined.
19688
19689         (AddDelegateType): Implement.
19690
19691         (IsDelegateType): Implement helper method.
19692
19693         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19694
19695         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19696         and accordingly handle it.
19697
19698         * delegate.cs (Populate): Take TypeContainer argument.
19699         Implement bits to define the Invoke method. However, I still haven't figured out
19700         how to take care of the native int bit :-(
19701
19702         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19703         Qualify the name of the delegate, not its return type !
19704
19705         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19706         conversion.
19707
19708         (StandardConversionExists): Checking for array types turns out to be recursive.
19709
19710         (ConvertReferenceExplicit): Implement array conversion.
19711
19712         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19713
19714 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19715
19716         * cs-parser.jay (delegate_declaration): Store the fully qualified
19717         name as it is a type declaration.
19718
19719         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19720         readonly.
19721
19722         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19723         as TypeContainer::DefineType.
19724
19725         (Populate): Method in which all the definition of the various methods (Invoke)
19726         etc is done.
19727
19728         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19729         see.
19730
19731         (CloseDelegate): Finally creates the delegate.
19732
19733         * class.cs (TypeContainer::DefineType): Update to define delegates.
19734         (Populate, Emit and CloseType): Do the same thing here too.
19735
19736         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19737         delegates in all these operations.
19738
19739 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19740
19741         * expression.cs: LocalTemporary: a new expression used to
19742         reference a temporary that has been created.
19743
19744         * assign.cs: Handle PropertyAccess back here, so that we can
19745         provide the proper semantic access to properties.
19746
19747         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19748         a few more explicit conversions. 
19749
19750         * modifiers.cs: `NEW' modifier maps to HideBySig.
19751
19752         * expression.cs (PropertyExpr): Make this into an
19753         ExpressionStatement, and support the EmitStatement code path. 
19754
19755         Perform get/set error checking, clean up the interface.
19756
19757         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19758         them into toplevel access objects.
19759
19760 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19761
19762         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19763         SRE.
19764
19765         * typemanager.cs: Keep track here of our PropertyBuilders again to
19766         work around lameness in SRE.
19767
19768 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19769
19770         * expression.cs (LValue::LValueResolve): New method in the
19771         interface, used to perform a second resolution pass for LValues. 
19772
19773         (This::DoResolve): Catch the use of this in static methods.
19774
19775         (This::LValueResolve): Implement.
19776
19777         (This::Store): Remove warning, assigning to `this' in structures
19778         is 
19779
19780         (Invocation::Emit): Deal with invocation of
19781         methods on value types.  We need to pass the address to structure
19782         methods rather than the object itself.  (The equivalent code to
19783         emit "this" for structures leaves the entire structure on the
19784         stack instead of a pointer to it). 
19785
19786         (ParameterReference::DoResolve): Compute the real index for the
19787         argument based on whether the method takes or not a `this' pointer
19788         (ie, the method is static).
19789
19790         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19791         value types returned from functions when we need to invoke a
19792         method on the sturcture.
19793
19794
19795 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19796
19797         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19798         defining the type in the Modulebuilder or Typebuilder. This is to take
19799         care of nested types which need to be defined on the TypeBuilder using
19800         DefineNestedMethod.
19801
19802         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19803         methods in RootContext, only ported to be part of TypeContainer.
19804
19805         (TypeContainer::GetInterfaceOrClass): Ditto.
19806
19807         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19808
19809         * interface.cs (Interface::DefineInterface): New method. Does exactly
19810         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19811         too.
19812
19813         (Interface::GetInterfaces): Move from RootContext here and port.
19814
19815         (Interface::GetInterfaceByName): Same here.
19816
19817         * rootcontext.cs (ResolveTree): Re-write.
19818
19819         (PopulateTypes): Re-write.
19820
19821         * class.cs (TypeContainer::Populate): Populate nested types too.
19822         (TypeContainer::Emit): Emit nested members too.
19823
19824         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19825         instead just use the name argument passed in as it is already fully
19826         qualified.
19827
19828         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19829         to TypeContainer mapping to see if a type is user-defined.
19830
19831         * class.cs (TypeContainer::CloseType): Implement. 
19832
19833         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19834         the default constructor.
19835
19836         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19837         twice.
19838
19839         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19840
19841         * interface.cs (CloseType): Create the type here.
19842
19843         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19844         the hierarchy.
19845
19846         Remove all the methods which are now in TypeContainer.
19847
19848 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19849
19850         * delegate.cs (Define): Re-write bits to define the delegate
19851         correctly.
19852
19853 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19856
19857         * expression.cs (ImplicitReferenceConversion): handle null as well
19858         as a source to convert to any reference type.
19859
19860         * statement.cs (Return): Perform any implicit conversions to
19861         expected return type.  
19862
19863         Validate use of return statement.  
19864
19865         * codegen.cs (EmitContext): Pass the expected return type here.
19866
19867         * class.cs (Method, Constructor, Property): Pass expected return
19868         type to EmitContext.
19869
19870 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * expression.cs: Make DoResolve take an EmitContext instead of a
19873         TypeContainer.
19874
19875         Replaced `l' and `location' for `loc', for consistency.
19876
19877         (Error, Warning): Remove unneeded Tc argument.
19878
19879         * assign.cs, literal.cs, constant.cs: Update to new calling
19880         convention. 
19881
19882         * codegen.cs: EmitContext now contains a flag indicating whether
19883         code is being generated in a static method or not.
19884
19885         * cs-parser.jay: DecomposeQI, new function that replaces the old
19886         QualifiedIdentifier.  Now we always decompose the assembled
19887         strings from qualified_identifier productions into a group of
19888         memberaccesses.
19889
19890 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19891
19892         * rootcontext.cs: Deal with field-less struct types correctly now
19893         by passing the size option to Define Type.
19894
19895         * class.cs: Removed hack that created one static field. 
19896
19897 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19898
19899         * statement.cs: Moved most of the code generation here. 
19900
19901 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19902
19903         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19904         seem very right.
19905
19906         (ElementAccess): Remove useless bits for now - keep checks as the spec
19907         says.
19908
19909 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19910
19911         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19912         and start performing checks according to the spec.
19913
19914 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19915
19916         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19917         rank_specifiers instead.
19918
19919         (rank_specifiers): Change the order in which the rank specifiers are stored
19920
19921         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19922
19923         * expression.cs (ElementAccess): Implement the LValue interface too.
19924
19925 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19926
19927         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19928         except that user defined conversions are not included.
19929
19930         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19931         perform the conversion of the return type, if necessary.
19932
19933         (New::DoResolve): Check whether we are creating an array or an object
19934         and accordingly do the needful.
19935
19936         (New::Emit): Same here.
19937
19938         (New::DoResolve): Implement guts of array creation.
19939
19940         (New::FormLookupType): Helper function.
19941
19942 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19943
19944         * codegen.cs: Removed most of the code generation here, and move the
19945         corresponding code generation bits to the statement classes. 
19946
19947         Added support for try/catch/finalize and throw.
19948
19949         * cs-parser.jay: Added support for try/catch/finalize.
19950
19951         * class.cs: Catch static methods having the flags override,
19952         virtual or abstract.
19953
19954         * expression.cs (UserCast): This user cast was not really doing
19955         what it was supposed to do.  Which is to be born in fully resolved
19956         state.  Parts of the resolution were being performed at Emit time! 
19957
19958         Fixed this code.
19959
19960 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19961
19962         * expression.cs: Implicity convert the result from UserCast.
19963
19964 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19965
19966         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19967         prevented it from working correctly. 
19968
19969         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19970         merely ConvertImplicit.
19971
19972 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19973
19974         * typemanager.cs: Make the LookupTypeContainer function static,
19975         and not per-instance.  
19976
19977         * class.cs: Make static FindMembers (the one that takes a Type
19978         argument). 
19979
19980         * codegen.cs: Add EmitForeach here.
19981
19982         * cs-parser.jay: Make foreach a toplevel object instead of the
19983         inline expansion, as we need to perform semantic analysis on it. 
19984
19985 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19986
19987         * expression.cs (Expression::ImplicitUserConversion): Rename to
19988         UserDefinedConversion.
19989
19990         (Expression::UserDefinedConversion): Take an extra argument specifying 
19991         whether we look for explicit user conversions too.
19992
19993         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19994
19995         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19996
19997         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19998         with the appropriate arguments.
19999
20000         * cs-parser.jay (cast_expression): Record location too.
20001
20002         * expression.cs (Cast): Record location info.
20003
20004         (Expression::ConvertExplicit): Take location argument.
20005
20006         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20007         to determine if we are doing explicit conversions.
20008
20009         (UserCast::Emit): Update accordingly.
20010
20011         (Expression::ConvertExplicit): Report an error if everything fails.
20012
20013         * ../errors/cs0030.cs : Add.
20014
20015 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20016
20017         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20018         virtual and newslot bits. 
20019
20020         * class.cs (TypeContainer::RegisterRequiredImplementations):
20021         Record methods we need.
20022
20023         (TypeContainer::MakeKey): Helper function to make keys for
20024         MethodBases, since the Methodbase key is useless.
20025
20026         (TypeContainer::Populate): Call RegisterRequiredImplementations
20027         before defining the methods.   
20028
20029         Create a mapping for method_builders_to_methods ahead of time
20030         instead of inside a tight loop.
20031
20032         (::RequireMethods):  Accept an object as the data to set into the
20033         hashtable so we can report interface vs abstract method mismatch.
20034
20035 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20036
20037         * report.cs: Make all of it static.
20038
20039         * rootcontext.cs: Drop object_type and value_type computations, as
20040         we have those in the TypeManager anyways.
20041
20042         Drop report instance variable too, now it is a global.
20043
20044         * driver.cs: Use try/catch on command line handling.
20045
20046         Add --probe option to debug the error reporting system with a test
20047         suite. 
20048
20049         * report.cs: Add support for exiting program when a probe
20050         condition is reached.
20051
20052 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20053
20054         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20055         we do a forcible conversion regardless of type, to check if 
20056         ForceConversion returns a null.
20057
20058         (Binary::error19): Use location to report error.
20059
20060         (Unary::error23): Use location here too.
20061
20062         * ../errors/cs0019.cs : Check in.
20063
20064         * ../errors/cs0023.cs : Check in.
20065
20066         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20067         case of a non-null MethodInfo object with a length of 0 !
20068
20069         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20070         an applicable member - according to the spec :-)
20071         Also fix logic to find members in base types.
20072
20073         (Unary::ResolveOperator): Same here.
20074
20075         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20076         as I was getting thoroughly confused between this and error19 :-)
20077
20078         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20079         (::FindMostEncompassedType): Implement.
20080         (::FindMostEncompassingType): Implement.
20081         (::StandardConversionExists): Implement.
20082
20083         (UserImplicitCast): Re-vamp. We now need info about most specific
20084         source and target types so that we can do the necessary conversions.
20085
20086         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20087         mathematical union with no duplicates.
20088
20089 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20090
20091         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20092         in order from base classes to child classes, so that we can in
20093         child classes look up in our parent for method names and
20094         attributes (required for handling abstract, virtual, new, override
20095         constructs: we need to instrospect our base class, and if we dont
20096         populate the classes in order, the introspection might be
20097         incorrect.  For example, a method could query its parent before
20098         the parent has any methods and would determine that the parent has
20099         no abstract methods (while it could have had them)).
20100
20101         (RootContext::CreateType): Record the order in which we define the
20102         classes.
20103
20104 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * class.cs (TypeContainer::Populate): Also method definitions can
20107         fail now, keep track of this.
20108
20109         (TypeContainer::FindMembers): Implement support for
20110         DeclaredOnly/noDeclaredOnly flag.
20111
20112         (Constructor::Emit) Return the ConstructorBuilder.
20113
20114         (Method::Emit) Return the MethodBuilder. 
20115         Check for abstract or virtual methods to be public.
20116
20117         * rootcontext.cs (RootContext::CreateType): Register all the
20118         abstract methods required for the class to be complete and the
20119         interface methods that must be implemented. 
20120
20121         * cs-parser.jay: Report error 501 (method requires body if it is
20122         not marked abstract or extern).
20123
20124         * expression.cs (TypeOf::Emit): Implement.
20125
20126         * typemanager.cs: runtime_handle_type, new global type.
20127
20128         * class.cs (Property::Emit): Generate code for properties.
20129
20130 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20131
20132         * expression.cs (Unary::ResolveOperator): Find operators on base type
20133         too - we now conform exactly to the spec.
20134
20135         (Binary::ResolveOperator): Same here.
20136
20137         * class.cs (Operator::Define): Fix minor quirk in the tests.
20138
20139         * ../errors/cs0215.cs : Added.
20140
20141         * ../errors/cs0556.cs : Added.
20142
20143         * ../errors/cs0555.cs : Added.
20144
20145 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20146
20147         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20148         single integer which is really efficient
20149
20150 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20151
20152         *  expression.cs (Expression::ImplicitUserConversion): Use location
20153         even in the case when we are examining True operators.
20154  
20155         * class.cs (Operator::Define): Perform extensive checks to conform
20156         with the rules for operator overloading in the spec.
20157
20158         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20159         some of the other conversions mentioned in the spec.
20160
20161         * typemanager.cs (array_type): New static member for the System.Array built-in
20162         type.
20163
20164         (cloneable_interface): For System.ICloneable interface.
20165
20166         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20167         we start resolving the tree and populating types.
20168
20169         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20170  
20171 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20172
20173         * expression.cs (Expression::ExprClassFromMemberInfo,
20174         Expression::Literalize): Create literal expressions from
20175         FieldInfos which are literals.
20176
20177         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20178         type casts, because they were wrong.  The test suite in tests
20179         caught these ones.
20180
20181         (ImplicitNumericConversion): ushort to ulong requires a widening
20182         cast. 
20183
20184         Int32 constant to long requires widening cast as well.
20185
20186         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20187         for integers because the type on the stack is not i4.
20188
20189 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * expression.cs (report118): require location argument. 
20192
20193         * parameter.cs: Do not dereference potential null value.
20194
20195         * class.cs: Catch methods that lack the `new' keyword when
20196         overriding a name.  Report warnings when `new' is used without
20197         anything being there to override.
20198
20199         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20200
20201         * class.cs: Only add constructor to hashtable if it is non-null
20202         (as now constructors can fail on define).
20203
20204         (TypeManager, Class, Struct): Take location arguments.
20205
20206         Catch field instance initialization in structs as errors.
20207
20208         accepting_filter: a new filter for FindMembers that is static so
20209         that we dont create an instance per invocation.
20210
20211         (Constructor::Define): Catch errors where a struct constructor is
20212         parameterless 
20213
20214         * cs-parser.jay: Pass location information for various new
20215         constructs. 
20216
20217         * delegate.cs (Delegate): take a location argument.
20218
20219         * driver.cs: Do not call EmitCode if there were problesm in the
20220         Definition of the types, as many Builders wont be there. 
20221
20222         * decl.cs (Decl::Decl): Require a location argument.
20223
20224         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20225         into integers, and find the most appropiate integer for it.
20226
20227         * literal.cs: Implement ULongLiteral.
20228
20229         * rootcontext.cs: Provide better information about the location of
20230         failure when CreateType fails.
20231
20232 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20233
20234         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20235         as well.
20236
20237         * expression.cs (Binary::CheckShiftArguments): Add missing type
20238         computation.
20239         (Binary::ResolveOperator): Add type to the logical and and logical
20240         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20241         before.
20242
20243         (Binary::DoNumericPromotions): In the case where either argument
20244         is ulong (and most signed types combined with ulong cause an
20245         error) perform implicit integer constant conversions as well.
20246
20247 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20248
20249         * expression.cs (UserImplicitCast): Method should always be
20250         non-null. 
20251         (Invocation::BetterConversion): Simplified test for IntLiteral.
20252
20253         (Expression::ImplicitNumericConversion): Split this routine out.
20254         Put the code that performs implicit constant integer conversions
20255         here. 
20256
20257         (Expression::Resolve): Become a wrapper around DoResolve so we can
20258         check eclass and type being set after resolve.
20259
20260         (Invocation::Badness): Remove this dead function
20261
20262         (Binary::ResolveOperator): Do not compute the expensive argumnets
20263         unless we have a union for it.
20264
20265         (Probe::Emit): Is needs to do an isinst and then
20266         compare against null.
20267
20268         (::CanConvert): Added Location argument.  If the Location argument
20269         is null (Location.Null), then we do not report errors.  This is
20270         used by the `probe' mechanism of the Explicit conversion.  We do
20271         not want to generate an error for something that the user
20272         explicitly requested to be casted.  But the pipeline for an
20273         explicit cast first tests for potential implicit casts.
20274
20275         So for now, if the Location is null, it means `Probe only' to
20276         avoid adding another argument.   Might have to revise this
20277         strategy later.
20278
20279         (ClassCast): New class used to type cast objects into arbitrary
20280         classes (used in Explicit Reference Conversions).
20281
20282         Implement `as' as well.
20283
20284         Reverted all the patches from Ravi below: they were broken:
20285
20286                 * The use of `level' as a mechanism to stop recursive
20287                   invocations is wrong.  That was there just to catch the
20288                   bug with a strack trace but not as a way of addressing
20289                   the problem.
20290
20291                   To fix the problem we have to *understand* what is going
20292                   on and the interactions and come up with a plan, not
20293                   just get things going.
20294
20295                 * The use of the type conversion cache that I proposed
20296                   last night had an open topic: How does this work across
20297                   protection domains.  A user defined conversion might not
20298                   be public in the location where we are applying the
20299                   conversion, a different conversion might be selected
20300                   (ie, private A->B (better) but public B->A (worse),
20301                   inside A, A->B applies, but outside it, B->A will
20302                   apply).
20303
20304                 * On top of that (ie, even if the above is solved),
20305                   conversions in a cache need to be abstract.  Ie, `To
20306                   convert from an Int to a Short use an OpcodeCast', not
20307                   `To convert from an Int to a Short use the OpcodeCast on
20308                   the variable 5' (which is what this patch was doing).
20309
20310 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20311
20312         * expression.cs (Invocation::ConversionExists): Re-write to use
20313         the conversion cache
20314
20315         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20316         cache all conversions done, not just user-defined ones.
20317
20318         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20319         to determine if a conversion exists instead of acutually trying to 
20320         perform the conversion. It's faster too.
20321
20322         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20323         and only then attempt the implicit conversion.
20324
20325 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20326
20327         * expression.cs (ConvertImplicit): Use a cache for conversions
20328         already found. Check level of recursion and bail out if necessary.
20329
20330 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20331
20332         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20333         Export standard methods that we expect for string operations.
20334
20335         * statement.cs (Block::UsageWarning): Track usage of variables and
20336         report the errors for not used variables.
20337
20338         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20339         operator. 
20340
20341 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20342
20343         * codegen.cs: remove unnneded code 
20344
20345         * expression.cs: Removed BuiltinTypeAccess class
20346
20347         Fix the order in which implicit conversions are
20348         done.  
20349
20350         The previous fixed dropped support for boxed conversions (adding a
20351         test to the test suite now)
20352
20353         (UserImplicitCast::CanConvert): Remove test for source being null,
20354         that code is broken.  We should not feed a null to begin with, if
20355         we do, then we should track the bug where the problem originates
20356         and not try to cover it up here.
20357
20358         Return a resolved expression of type UserImplicitCast on success
20359         rather than true/false.  Ravi: this is what I was talking about,
20360         the pattern is to use a static method as a "constructor" for
20361         objects. 
20362
20363         Also, do not create arguments until the very last minute,
20364         otherwise we always create the arguments even for lookups that
20365         will never be performed. 
20366
20367         (UserImplicitCast::Resolve): Eliminate, objects of type
20368         UserImplicitCast are born in a fully resolved state. 
20369
20370         * typemanager.cs (InitCoreTypes): Init also value_type
20371         (System.ValueType). 
20372
20373         * expression.cs (Cast::Resolve): First resolve the child expression.
20374
20375         (LValue): Add new method AddressOf to be used by
20376         the `&' operator.  
20377
20378         Change the argument of Store to take an EmitContext instead of an
20379         ILGenerator, because things like FieldExpr need to be able to call
20380         their children expression to generate the instance code. 
20381
20382         (Expression::Error, Expression::Warning): Sugar functions for
20383         reporting errors.
20384
20385         (Expression::MemberLookup): Accept a TypeContainer instead of a
20386         Report as the first argument.
20387
20388         (Expression::ResolvePrimary): Killed.  I still want to improve
20389         this as currently the code is just not right.
20390
20391         (Expression::ResolveMemberAccess): Simplify, but it is still
20392         wrong. 
20393
20394         (Unary::Resolve): Catch errors in AddressOf operators.
20395
20396         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20397         index to a byte for the short-version, or the compiler will choose
20398         the wrong Emit call, which generates the wrong data.
20399
20400         (ParameterReference::Emit, ::Store): same.
20401
20402         (FieldExpr::AddressOf): Implement.
20403
20404         * typemanager.cs: TypeManager: made public variable instead of
20405         property.
20406
20407         * driver.cs: document --fatal.
20408
20409         * report.cs (ErrorMessage, WarningMessage): new names for the old
20410         Error and Warning classes.
20411
20412         * cs-parser.jay (member_access): Turn built-in access to types
20413         into a normal simplename
20414
20415 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20416
20417         * expression.cs (Invocation::BetterConversion): Fix to cope
20418         with q being null, since this was introducing a bug.
20419
20420         * expression.cs (ConvertImplicit): Do built-in conversions first.
20421
20422 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20423
20424         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20425
20426 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20427
20428         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20429         I had introduced long ago (what's new ?).
20430
20431         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20432         the work of all the checking. 
20433         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20434         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20435
20436         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20437         that is the right way. 
20438
20439         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20440         overloading resolution. Use everywhere instead of cutting and pasting code.
20441
20442         (Binary::ResolveOperator): Use MakeUnionSet.
20443
20444         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20445         we have to convert to bool types. Not complete yet.
20446
20447 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20448
20449         * typemanager.cs (TypeManager::CSharpName): support ushort.
20450
20451         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20452         to provide an expression that performsn an implicit constant int
20453         conversion (section 6.1.6).
20454         (Expression::ConvertImplicitRequired): Reworked to include
20455         implicit constant expression conversions.
20456
20457         (Expression::ConvertNumericExplicit): Finished.
20458
20459         (Invocation::Emit): If InstanceExpression is null, then it means
20460         that we perform a call on this.
20461
20462 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20463
20464         * expression.cs (Unary::Emit): Remove some dead code.
20465         (Probe): Implement Resolve and Emit for `is'.
20466         (Expression::ConvertImplicitRequired): Attempt to do constant
20467         expression conversions here.  Maybe should be moved to
20468         ConvertImplicit, but I am not sure.
20469         (Expression::ImplicitLongConstantConversionPossible,
20470         Expression::ImplicitIntConstantConversionPossible): New functions
20471         that tell whether is it possible to apply an implicit constant
20472         expression conversion.
20473
20474         (ConvertNumericExplicit): Started work on explicit numeric
20475         conversions.
20476
20477         * cs-parser.jay: Update operator constants.
20478
20479         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20480         (Parameters::GetSignature): Hook up VerifyArgs here.
20481         (Parameters::VerifyArgs): Verifies that no two arguments have the
20482         same name. 
20483
20484         * class.cs (Operator): Update the operator names to reflect the
20485         ones that the spec expects (as we are just stringizing the
20486         operator names).
20487
20488         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20489         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20490         previous usage did only work for our methods.
20491         (Expression::ConvertImplicit): Handle decimal implicit numeric
20492         conversions as well.
20493         (Expression::InternalTypeConstructor): Used to invoke constructors
20494         on internal types for default promotions.
20495
20496         (Unary::Emit): Implement special handling for the pre/post
20497         increment/decrement for overloaded operators, as they need to have
20498         the same semantics as the other operators.
20499
20500         (Binary::ResolveOperator): ditto.
20501         (Invocation::ConversionExists): ditto.
20502         (UserImplicitCast::Resolve): ditto.
20503
20504 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20505
20506         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20507         operator, return after emitting body. Regression tests pass again !
20508
20509         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20510         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20511         (Invocation::OverloadResolve): Ditto.
20512         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20513
20514         * everywhere : update calls to the above methods accordingly.
20515
20516 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20519
20520         * expression.cs (ExpressionStatement): New base class used for
20521         expressions that can appear in statements, so that we can provide
20522         an alternate path to generate expression that do not leave a value
20523         on the stack.
20524
20525         (Expression::Emit, and all the derivatives): We no longer return
20526         whether a value is left on the stack or not.  Every expression
20527         after being emitted leaves a single value on the stack.
20528
20529         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20530         facilties of ExpressionStatement if possible.
20531
20532         * cs-parser.jay: Update statement_expression.
20533
20534 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20535
20536         * driver.cs: Change the wording of message
20537
20538 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20539
20540         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20541         the type of the expression to the return type of the method if
20542         we have an overloaded operator match ! The regression tests pass again !
20543         (Unary::ResolveOperator): Ditto.
20544
20545         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20546         to find "op_Implicit", not "implicit" ;-)
20547         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20548         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20549
20550         * everywhere : Correct calls to the above accordingly.
20551
20552         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20553         (ConvertImplicit): Do user-defined conversion if it exists.
20554
20555 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20556
20557         * assign.cs: track location.
20558         (Resolve): Use implicit conversions on assignment.
20559
20560         * literal.cs: Oops.  Not good, Emit of short access values should
20561         pass (Bytes) or the wrong argument will be selected.
20562
20563         * expression.cs (Unary::Emit): Emit code for -expr.
20564
20565         (Unary::ResolveOperator): Handle `Substract' for non-constants
20566         (substract from zero from the non-constants).
20567         Deal with Doubles as well. 
20568
20569         (Expression::ConvertImplicitRequired): New routine that reports an
20570         error if no implicit conversion exists. 
20571
20572         (Invocation::OverloadResolve): Store the converted implicit
20573         expressions if we make them
20574
20575 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20576
20577         * class.cs (ConstructorInitializer): Take a Location argument.
20578         (ConstructorBaseInitializer): Same here.
20579         (ConstructorThisInitializer): Same here.
20580
20581         * cs-parser.jay : Update all calls accordingly.
20582
20583         * expression.cs (Unary, Binary, New): Take location argument.
20584         Update accordingly everywhere.
20585
20586         * cs-parser.jay : Update all calls to the above to take a location
20587         argument.
20588
20589         * class.cs : Ditto.
20590
20591 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20592
20593         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20594         (Invocation::BetterConversion): Same here
20595         (Invocation::ConversionExists): Ditto.
20596
20597         (Invocation::ConversionExists): Implement.
20598
20599 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20600
20601         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20602         Also take an additional TypeContainer argument.
20603
20604         * All over : Pass in TypeContainer as argument to OverloadResolve.
20605
20606         * typemanager.cs (CSharpName): Update to check for the string type and return
20607         that too.
20608
20609         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20610         a given method.
20611
20612 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20613
20614         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20615         (Invocation::BetterFunction): Implement.
20616         (Invocation::BetterConversion): Implement.
20617         (Invocation::ConversionExists): Skeleton, no implementation yet.
20618
20619         Okay, things work fine !
20620
20621 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20622
20623         * typemanager.cs: declare and load enum_type, delegate_type and
20624         void_type. 
20625
20626         * expression.cs (Expression::Emit): Now emit returns a value that
20627         tells whether a value is left on the stack or not.  This strategy
20628         might be reveted tomorrow with a mechanism that would address
20629         multiple assignments.
20630         (Expression::report118): Utility routine to report mismatches on
20631         the ExprClass.
20632
20633         (Unary::Report23): Report impossible type/operator combination
20634         utility function.
20635
20636         (Unary::IsIncrementableNumber): Whether the type can be
20637         incremented or decremented with add.
20638         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20639         complemented. 
20640         (Unary::ResolveOperator): Implement ++, !, ~,
20641
20642         (Invocation::Emit): Deal with new Emit convetion.
20643
20644         * All Expression derivatives: Updated their Emit method to return
20645         whether they leave values on the stack or not.
20646
20647         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20648         stack for expressions that are statements. 
20649
20650 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20651
20652         * expression.cs (LValue): New interface.  Must be implemented by
20653         LValue objects.
20654         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20655         LValue interface.
20656
20657         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20658         interface for generating code, simplifies the code.
20659
20660 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20661
20662         * expression.cs (everywhere): Comment out return statements in ::Resolve
20663         methods to avoid the warnings.
20664
20665 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20666
20667         * driver.cs (parse): Report error 2001 if we can not open the
20668         source file.
20669
20670         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20671         not resolve it.
20672
20673         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20674         object. 
20675
20676         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20677         otherwise nested blocks end up with the same index.
20678
20679         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20680
20681         * expression.cs:  Instead of having FIXMEs in the Resolve
20682         functions, throw exceptions so it is obvious that we are facing a
20683         bug. 
20684
20685         * cs-parser.jay (invocation_expression): Pass Location information.
20686
20687         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20688         Use a basename for those routines because .NET does not like paths
20689         on them. 
20690
20691         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20692         already defined.
20693
20694 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20695
20696         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20697         are loading the correct data types (throws an exception if not).
20698         (TypeManager::InitCoreTypes): Use CoreLookupType
20699
20700         * expression.cs (Unary::ResolveOperator): return the child
20701         expression for expressions which are just +expr.
20702         (Unary::ResolveOperator): Return negative literals for -LITERAL
20703         expressions (otherwise they are Unary {Literal}).
20704         (Invocation::Badness): Take into account `Implicit constant
20705         expression conversions'.
20706
20707         * literal.cs (LongLiteral): Implement long literal class.
20708         (IntLiteral): export the `Value' of the intliteral. 
20709
20710 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20711
20712         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20713
20714         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20715         instead of 'Operator'
20716
20717         * expression.cs (Binary::ResolveOperator): Update accordingly.
20718         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20719         and 'Minus'
20720
20721         * cs-parser.jay (unary_expression): Update to use the new names.
20722
20723         * gen-treedump.cs (GetUnary): Same here.
20724
20725         * expression.cs (Unary::Resolve): Implement.
20726         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20727         operators are found instead of making noise ;-)
20728         (Unary::ResolveOperator): New method to do precisely the same thing which
20729         Binary::ResolveOperator does for Binary expressions.
20730         (Unary.method, .Arguments): Add.
20731         (Unary::OperName): Implement.   
20732         (Unary::ForceConversion): Copy and Paste !
20733
20734         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20735         a unary operator.
20736
20737         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20738         for the inbuilt operators. Only overloading works for now ;-)
20739
20740 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20741
20742         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20743         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20744
20745         * expression.cs (This::Emit): Implement. 
20746         (This::Resolve): Implement.
20747         (TypeOf:Resolve): Implement.
20748         (Expression::ResolveSimpleName): Add an implicit this to instance
20749         field references. 
20750         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20751         Bind instance variable to Field expressions.
20752         (FieldExpr::Instance): New field used to track the expression that
20753         represents the object instance.
20754         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20755         binding 
20756         (FieldExpr::Emit): Implement.
20757
20758         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20759         the last instruction contains a return opcode to avoid generating
20760         the last `ret' instruction (this generates correct code, and it is
20761         nice to pass the peverify output).
20762
20763         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20764         initializer for static and instance variables.
20765         (Constructor::Emit): Allow initializer to be null in the case of
20766         static constructors.  Only emit initializer for instance
20767         constructors. 
20768
20769         (TypeContainer::FindMembers): Return a null array if there are no
20770         matches.
20771
20772         Also fix the code for the MemberTypes.Method branch, as it was not
20773         scanning that for operators (or tried to access null variables before).
20774
20775         * assign.cs (Assign::Emit): Handle instance and static fields. 
20776
20777         * TODO: Updated.
20778
20779         * driver.cs: Stop compilation if there are parse errors.
20780
20781         * cs-parser.jay (constructor_declaration): Provide default base
20782         initializer for non-static constructors.
20783         (constructor_declarator): Do not provide a default base
20784         initializers if none was specified.
20785         Catch the fact that constructors should not have parameters.
20786
20787         * class.cs: Do not emit parent class initializers for static
20788         constructors, that should be flagged as an error.
20789
20790 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20791
20792         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20793         Move back code into TypeContainer::Populate.
20794
20795 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20796
20797         * class.cs (TypeContainer::AddConstructor): Fix the check to
20798         compare against Name, not Basename. 
20799         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20800
20801         * cs-parser.jay : Update accordingly.
20802
20803         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20804         for methods, don't forget to look into the operators too.
20805         (RegisterMethodBuilder): Helper method to take care of this for
20806         methods, constructors and operators.
20807         (Operator::Define): Completely revamp.
20808         (Operator.OperatorMethod, MethodName): New fields.
20809         (TypeContainer::Populate): Move the registering of builders into
20810         RegisterMethodBuilder.
20811         (Operator::Emit): Re-write.
20812
20813         * expression.cs (Binary::Emit): Comment out code path to emit method
20814         invocation stuff for the case when we have a user defined operator. I am
20815         just not able to get it right !
20816
20817 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20818
20819         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20820         argument. 
20821
20822         (Expression::MemberLookup): Provide a version that allows to
20823         specify the MemberTypes and BindingFlags. 
20824
20825         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20826         so it was not fetching variable information from outer blocks.
20827
20828         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20829         Beforefieldinit as it was buggy.
20830
20831         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20832         that Ravi put here.  
20833
20834         * class.cs (Constructor::Emit): Only emit if block is not null.
20835         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20836         deal with this by semantically definining it as if the user had
20837         done it.
20838
20839         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20840         constructors as we now "emit" them at a higher level.
20841
20842         (TypeContainer::DefineDefaultConstructor): Used to define the
20843         default constructors if none was provided.
20844
20845         (ConstructorInitializer): Add methods Resolve and Emit. 
20846
20847         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20848
20849 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20850
20851         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20852         the default constructor builder with our hashtable for methodbuilders
20853         to methodcores.
20854
20855         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20856         and argument_count is 0 in which case we have a match.
20857         (Binary::ResolveOperator): More null checking and miscellaneous coding
20858         style cleanup.
20859
20860 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20861
20862         * rootcontext.cs (IsNameSpace): Compare against null.
20863
20864         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20865
20866         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20867         and Unary::Operator.
20868
20869         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20870         accordingly.
20871
20872         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20873         we have overloaded operators.
20874         (Binary::ResolveOperator): Implement the part which does the operator overload
20875         resolution.
20876
20877         * class.cs (Operator::Emit): Implement.
20878         (TypeContainer::Emit): Emit the operators we have too.
20879
20880         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20881         the case when we have a user-defined operator.
20882
20883 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20884
20885         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20886
20887 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20888
20889         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20890         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20891         (Constructor::Emit): Implement.
20892         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20893         if we have no work to do. 
20894         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20895         Emit method.
20896
20897         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20898         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20899
20900         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20901         of parent.parent.
20902
20903 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20904
20905         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20906         in the source.
20907         (Tree::RecordNamespace): Method to do what the name says ;-)
20908         (Tree::Namespaces): Property to get at the namespaces hashtable.
20909
20910         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20911         keep track.
20912
20913         * rootcontext.cs (IsNamespace): Fixed it :-)
20914
20915 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * class.cs (TypeContainer::FindMembers): Add support for
20918         constructors. 
20919         (MethodCore): New class that encapsulates both the shared aspects
20920         of a Constructor and a Method.  
20921         (Method, Constructor): Factored pieces into MethodCore.
20922
20923         * driver.cs: Added --fatal which makes errors throw exceptions.
20924         Load System assembly as well as part of the standard library.
20925
20926         * report.cs: Allow throwing exceptions on errors for debugging.
20927
20928         * modifiers.cs: Do not use `parent', instead use the real type
20929         container to evaluate permission settings.
20930
20931         * class.cs: Put Ravi's patch back in.  He is right, and we will
20932         have to cope with the
20933
20934 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20935
20936         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20937         FamORAssem, not FamANDAssem.
20938
20939 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20940
20941         * driver.cs: Added --parse option that only parses its input files
20942         and terminates.
20943
20944         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20945         incorrect.  IsTopLevel is not used to tell whether an object is
20946         root_types or not (that can be achieved by testing this ==
20947         root_types).  But to see if this is a top-level *class* (not
20948         necessarly our "toplevel" container). 
20949
20950 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20951
20952         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20953         parent instead of a direct call to GetType.
20954
20955 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20956
20957         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20958         Modifiers.TypeAttr. This should just be a call to that method.
20959
20960         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20961         object so that we can determine if we are top-level or not.
20962
20963         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20964         TypeContainer too.
20965
20966         * enum.cs (Enum::Define): Ditto.
20967
20968         * modifiers.cs (FieldAttr): Re-write.
20969
20970         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20971         (TypeContainer::HaveStaticConstructor): New property to provide access
20972         to precisely that info.
20973
20974         * modifiers.cs (MethodAttr): Re-write.
20975         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20976
20977         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20978         of top-level types as claimed.
20979
20980 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20981
20982         * expression.cs (MemberLookup): Fruitless attempt to lookup
20983         constructors.  Maybe I need to emit default constructors?  That
20984         might be it (currently .NET emits this for me automatically).
20985         (Invocation::OverloadResolve): Cope with Arguments == null.
20986         (Invocation::EmitArguments): new function, shared by the new
20987         constructor and us.
20988         (Invocation::Emit): Handle static and instance methods.  Emit
20989         proper call instruction for virtual or non-virtual invocations.
20990         (New::Emit): Implement.
20991         (New::Resolve): Implement.
20992         (MemberAccess:Resolve): Implement.
20993         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20994         to track instances.
20995         (FieldExpr::Resolve): Set type.
20996
20997         * support.cs: Handle empty arguments.
20998                 
20999         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21000         SimpleLookup): Auxiliary routines to help parse a qualifier
21001         identifier.  
21002
21003         Update qualifier_identifier rule.
21004
21005         * codegen.cs: Removed debugging messages.
21006
21007         * class.cs: Make this a global thing, this acts just as a "key" to
21008         objects that we might have around.
21009
21010         (Populate): Only initialize method_builders_to_methods once.
21011
21012         * expression.cs (PropertyExpr): Initialize type from the
21013         PropertyType. 
21014
21015         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21016         Resolve pattern.  Attempt to implicitly convert value to boolean.
21017         Emit code.
21018
21019         * expression.cs: Set the type for the int32/int32 argument case.
21020         (Binary::ResolveOperator): Set the return type to boolean for
21021         comparission operators
21022
21023         * typemanager.cs: Remove debugging print code.
21024
21025         (Invocation::Resolve): resolve type.
21026
21027         * class.cs: Allocate a MemberInfo of the correct size, as the code
21028         elsewhere depends on the test to reflect the correct contents.
21029
21030         (Method::) Keep track of parameters, due to System.Reflection holes
21031
21032         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21033         mapping here.
21034
21035         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21036         of the exact size and return that.
21037
21038         (Class::LookupMethodByBuilder): New function that maps
21039         MethodBuilders to its methods.  Required to locate the information
21040         on methods because System.Reflection bit us again.
21041
21042         * support.cs: New file, contains an interface ParameterData and
21043         two implementations: ReflectionParameters and InternalParameters
21044         used to access Parameter information.  We will need to grow this
21045         as required.
21046
21047         * expression.cs (Invocation::GetParameterData): implement a cache
21048         and a wrapper around the ParameterData creation for methods. 
21049         (Invocation::OverloadResolve): Use new code.
21050
21051 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21052
21053         * class.cs (TypeContainer::EmitField): Remove and move into 
21054         (Field::Define): here and modify accordingly.
21055         (Field.FieldBuilder): New member.
21056         (TypeContainer::Populate): Update accordingly.
21057         (TypeContainer::FindMembers): Implement.
21058
21059 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21060
21061         * statement.cs: (VariableInfo::VariableType): New field to be
21062         initialized with the full type once it is resolved. 
21063
21064 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21065
21066         * parameter.cs (GetParameterInfo): Use a type cache to compute
21067         things only once, and to reuse this information
21068
21069         * expression.cs (LocalVariableReference::Emit): Implement.
21070         (OpcodeCast::Emit): fix.
21071
21072         (ParameterReference::Resolve): Implement.
21073         (ParameterReference::Emit): Implement.
21074
21075         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21076         that are expressions need to stay as Expressions.
21077
21078         * typemanager.cs (CSharpName): Returns the C# name of a type if
21079         possible. 
21080
21081         * expression.cs (Expression::ConvertImplicit): New function that
21082         implements implicit type conversions.
21083
21084         (Expression::ImplicitReferenceConversion): Implements implicit
21085         reference conversions.
21086
21087         (EmptyCast): New type for transparent casts.
21088
21089         (OpcodeCast): New type for casts of types that are performed with
21090         a sequence of bytecodes.
21091
21092         (BoxedCast): New type used for casting value types into reference
21093         types.  Emits a box opcode.
21094
21095         (Binary::DoNumericPromotions): Implements numeric promotions of
21096         and computation of the Binary::Type.
21097
21098         (Binary::EmitBranchable): Optimization.
21099
21100         (Binary::Emit): Implement code emission for expressions.
21101
21102         * typemanager.cs (TypeManager): Added two new core types: sbyte
21103         and byte.
21104
21105 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21106
21107         * class.cs (TypeContainer::FindMembers): Method which does exactly
21108         what Type.FindMembers does, only we don't have to use reflection. No
21109         implementation yet.
21110
21111         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21112         typecontainer objects as we need to get at them.
21113         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21114
21115         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21116         typecontainer object.
21117
21118         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21119         of just a Report object.
21120
21121 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21122
21123         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21124         "remove_"
21125         (TypeContainer::Populate): Now define the delegates of the type too.
21126         (TypeContainer.Delegates): Property to access the list of delegates defined
21127         in the type.
21128
21129         * delegates.cs (Delegate::Define): Implement partially.
21130
21131         * modifiers.cs (TypeAttr): Handle more flags.
21132
21133 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21134
21135         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21136         and not <=
21137         (Operator::Define): Re-write logic to get types by using the LookupType method
21138         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21139         (Indexer::Define): Ditto.
21140         (Event::Define): Ditto.
21141         (Property::Define): Ditto.
21142
21143 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21144
21145         * class.cs (TypeContainer::Populate): Now define operators too. 
21146         (TypeContainer.Operators): New property to access the list of operators
21147         in a type.
21148         (Operator.OperatorMethodBuilder): New member to hold the method builder
21149         for the operator we are defining.
21150         (Operator::Define): Implement.
21151
21152 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21153
21154         * class.cs (Event::Define): Make the prefixes of the accessor methods
21155         addOn_ and removeOn_ 
21156
21157         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21158         of the location being passed in too. Ideally, this should go later since all
21159         error reporting should be done through the Report object.
21160
21161         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21162         (Populate): Iterate thru the indexers we have and define them too.
21163         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21164         for the get and set accessors.
21165         (Indexer::Define): Implement.
21166
21167 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21170         my previous implementation, did not work.
21171
21172         * typemanager.cs: Add a couple of missing types (the longs).
21173
21174         * literal.cs: Use TypeManager.bool_type instead of getting it.
21175
21176         * expression.cs (EventExpr): New kind of expressions.
21177         (Expressio::ExprClassFromMemberInfo): finish
21178
21179 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21180
21181         * assign.cs: Emit stores to static fields differently.
21182
21183 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21184
21185         * Merge in changes and adjust code to tackle conflicts. Backed out my
21186         code in Assign::Resolve ;-) 
21187
21188 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21189
21190         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21191         instead Report.Error and also pass in the location.
21192         (CSharpParser::Lexer): New readonly property to return the reference
21193         to the Tokenizer object.
21194         (declare_local_variables): Use Report.Error with location instead of plain 
21195         old error.
21196         (CheckDef): Ditto.
21197
21198         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21199         (Operator.CheckBinaryOperator): Ditto.
21200
21201         * cs-parser.jay (operator_declarator): Update accordingly.
21202
21203         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21204         (CheckBinaryOperator): Same here.
21205
21206         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21207         on the name without any prefixes of namespace names etc. This is because we
21208         already might have something already fully qualified like 
21209         'System.Console.WriteLine'
21210
21211         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21212
21213 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21214
21215         * cs-tokenizer.cs (location): Return a string which also contains
21216         the file name.
21217
21218         * expression.cs (ElementAccess): New class for expressions of the
21219         type 'element access.'
21220         (BaseAccess): New class for expressions of the type 'base access.'
21221         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21222         respectively.
21223
21224         * cs-parser.jay (element_access): Implement action.
21225         (base_access): Implement actions.
21226         (checked_expression, unchecked_expression): Implement.
21227
21228         * cs-parser.jay (local_variable_type): Correct and implement.
21229         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21230
21231         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21232
21233         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21234         name and the specifiers.
21235
21236         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21237
21238         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21239         making them all public ;-)
21240
21241         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21242         class anyways.
21243
21244 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21245
21246         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21247         PropertyExprs.
21248         (FieldExpr, PropertyExprs): New resolved expressions.
21249         (SimpleName::MemberStaticCheck): Perform static checks for access
21250         to non-static fields on static methods. Maybe this should be
21251         generalized for MemberAccesses. 
21252         (SimpleName::ResolveSimpleName): More work on simple name
21253         resolution. 
21254
21255         * cs-parser.jay (primary_expression/qualified_identifier): track
21256         the parameter index.
21257
21258         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21259         (EmitContext::EmitBoolExpression): Chain to expression generation
21260         instead of temporary hack.
21261         (::EmitStatementExpression): Put generic expression code generation.
21262
21263         * assign.cs (Assign::Emit): Implement variable assignments to
21264         local variables, parameters and fields.
21265
21266 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21267
21268         * statement.cs (Block::GetVariableInfo): New method, returns the
21269         VariableInfo for a variable name in a block.
21270         (Block::GetVariableType): Implement in terms of GetVariableInfo
21271
21272         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21273         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21274
21275 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21276
21277         * cs-parser.jay (operator_declaration): Continue on my quest : update
21278         to take attributes argument.
21279         (event_declaration): Ditto.
21280         (enum_declaration): Ditto.
21281         (indexer_declaration): Ditto.
21282
21283         * class.cs (Operator::Operator): Update constructor accordingly.
21284         (Event::Event): Ditto.
21285
21286         * delegate.cs (Delegate::Delegate): Same here.
21287
21288         * enum.cs (Enum::Enum): Same here.
21289
21290 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21291
21292         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21293
21294         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21295
21296         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21297         being passed around as an arraylist.
21298         (Attributes::AddAttribute): Method to add attribute sections.
21299
21300         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21301         (struct_declaration): Update accordingly.
21302         (constant_declaration): Update.
21303         (field_declaration): Update.
21304         (method_header): Update.
21305         (fixed_parameter): Update.
21306         (parameter_array): Ditto.
21307         (property_declaration): Ditto.
21308         (destructor_declaration): Ditto.
21309
21310         * class.cs (Struct::Struct): Update constructors accordingly.
21311         (Class::Class): Ditto.
21312         (Field::Field): Ditto.
21313         (Method::Method): Ditto.
21314         (Property::Property): Ditto.
21315         (TypeContainer::OptAttribute): update property's return type.
21316
21317         * interface.cs (Interface.opt_attributes): New member.
21318         (Interface::Interface): Update to take the extra Attributes argument.
21319
21320         * parameter.cs (Parameter::Parameter): Ditto.
21321
21322         * constant.cs (Constant::Constant): Ditto.
21323
21324         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21325         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21326         the attributes as a parameter.
21327         (InterfaceProperty): Update constructor call.
21328         (InterfaceEvent): Ditto.
21329         (InterfaceMethod): Ditto.
21330         (InterfaceIndexer): Ditto.
21331
21332         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21333         pass the attributes too.
21334         (interface_event_declaration): Ditto.
21335         (interface_property_declaration): Ditto.
21336         (interface_method_declaration): Ditto.
21337         (interface_declaration): Ditto.
21338
21339 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21340
21341         * class.cs (Method::Define): Track the "static Main" definition to
21342         create an entry point. 
21343
21344         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21345         EntryPoint if we find it. 
21346
21347         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21348         (EmitContext::ig): Make this variable public.
21349
21350         * driver.cs: Make the default output file be the first file name
21351         with the .exe extension.  
21352
21353         Detect empty compilations
21354
21355         Handle various kinds of output targets.  Handle --target and
21356         rename -t to --dumper.
21357
21358         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21359         methods inherited from Expression return now an Expression.  This
21360         will is used during the tree rewriting as we resolve them during
21361         semantic analysis.
21362
21363         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21364         the spec.  Missing entirely is the information about
21365         accessability of elements of it.
21366
21367         (Expression::ExprClassFromMemberInfo): New constructor for
21368         Expressions that creates a fully initialized Expression based on
21369         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21370         a Type.
21371
21372         (Invocation::Resolve): Begin implementing resolution of invocations.
21373
21374         * literal.cs (StringLiteral):  Implement Emit.
21375
21376 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21377
21378         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21379         member.
21380
21381 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21382
21383         * cs-parser.jay (attribute_arguments): Implement actions.
21384         (attribute): Fix bug in production. Implement action.
21385         (attribute_list): Implement.
21386         (attribute_target): Implement.
21387         (attribute_target_specifier, opt_target_specifier): Implement
21388         (CheckAttributeTarget): New method to check if the attribute target
21389         is valid.
21390         (attribute_section): Implement.
21391         (opt_attributes): Implement.
21392
21393         * attribute.cs : New file to handle attributes.
21394         (Attribute): Class to hold attribute info.
21395
21396         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21397         (attribute_section): Modify production to use 2 different rules to 
21398         achieve the same thing. 1 s/r conflict down !
21399         Clean out commented, useless, non-reducing dimension_separator rules.
21400
21401         * class.cs (TypeContainer.attributes): New member to hold list
21402         of attributes for a type.
21403         (Struct::Struct): Modify to take one more argument, the attribute list.
21404         (Class::Class): Ditto.
21405         (Field::Field): Ditto.
21406         (Method::Method): Ditto.
21407         (Property::Property): Ditto.
21408
21409         * cs-parser.jay (struct_declaration): Update constructor call to
21410         pass in the attributes too.
21411         (class_declaration): Ditto.
21412         (constant_declaration): Ditto.
21413         (field_declaration): Ditto.
21414         (method_header): Ditto.
21415         (fixed_parameter): Ditto.
21416         (parameter_array): Ditto.
21417         (property_declaration): Ditto.
21418
21419         * constant.cs (Constant::Constant): Update constructor similarly.
21420         Use System.Collections.
21421
21422         * parameter.cs (Parameter::Parameter): Update as above.
21423
21424 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21425
21426         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21427         (TypeContainer.delegates): New member to hold list of delegates.
21428
21429         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21430         this time as I seem to be on crack ;-)
21431
21432 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21433
21434         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21435         tell whether an identifier represents a namespace.
21436
21437         * expression.cs (NamespaceExpr): A namespace expression, used only
21438         temporarly during expression resolution.
21439         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21440         utility functions to resolve names on expressions.
21441
21442 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21443
21444         * codegen.cs: Add hook for StatementExpressions. 
21445
21446         * class.cs: Fix inverted test for static flag in methods.
21447
21448 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21449
21450         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21451         to make it coincide with MS' number.
21452         (Operator::CheckBinaryOperator): Ditto.
21453
21454         * ../errors/errors.txt : Remove error numbers added earlier.
21455
21456         * ../errors/cs1019.cs : Test case for error # 1019
21457
21458         * ../errros/cs1020.cs : Test case for error # 1020
21459
21460         * cs-parser.jay : Clean out commented cruft.
21461         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21462         used anywhere - non-reducing rule.
21463         (namespace_declarations): Non-reducing rule - comment out.
21464
21465         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21466         with TypeContainer::AddEnum.
21467
21468         * delegate.cs : New file for delegate handling classes.
21469         (Delegate): Class for declaring delegates.
21470
21471         * makefile : Update.
21472
21473         * cs-parser.jay (delegate_declaration): Implement.
21474
21475 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21476
21477         * class.cs (Event::Define): Implement.
21478         (Event.EventBuilder): New member.
21479
21480         * class.cs (TypeContainer::Populate): Update to define all enums and events
21481         we have.
21482         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21483         readonly fields for all these cases ?
21484
21485 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21486
21487         * class.cs (Property): Revamp to use the convention of making fields readonly.
21488         Accordingly modify code elsewhere.
21489
21490         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21491         the Define method of the Property class.
21492
21493         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21494         trivial bug.
21495         (TypeContainer::Populate): Update to define all the properties we have. Also
21496         define all enumerations.
21497
21498         * enum.cs (Define): Implement.
21499
21500 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21501
21502         * cs-parser.jay (overloadable_operator): The semantic value is an
21503         enum of the Operator class.
21504         (operator_declarator): Implement actions.
21505         (operator_declaration): Implement.
21506
21507         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21508         validity of definitions.
21509         (Operator::CheckBinaryOperator): Static method to check for binary operators
21510         (TypeContainer::AddOperator): New method to add an operator to a type.
21511
21512         * cs-parser.jay (indexer_declaration): Added line to actually call the
21513         AddIndexer method so it gets added ;-)
21514
21515         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21516         already taken care of by the MS compiler ?  
21517
21518 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21519
21520         * class.cs (Operator): New class for operator declarations.
21521         (Operator::OpType): Enum for the various operators.
21522
21523 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21524
21525         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21526         ostensibly handle this in semantic analysis.
21527
21528         * cs-parser.jay (general_catch_clause): Comment out
21529         (specific_catch_clauses, specific_catch_clause): Ditto.
21530         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21531         (catch_args, opt_catch_args): New productions.
21532         (catch_clause): Rewrite to use the new productions above
21533         (catch_clauses): Modify accordingly.
21534         (opt_catch_clauses): New production to use in try_statement
21535         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21536         and re-write the code in the actions to extract the specific and
21537         general catch clauses by being a little smart ;-)
21538
21539         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21540         Hooray, try and catch statements parse fine !
21541
21542 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21543
21544         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21545         string from the hashtable of variables.
21546
21547         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21548         I end up making that mistake ;-)
21549         (catch_clauses): Fixed gross error which made Key and Value of the 
21550         DictionaryEntry the same : $1 !!
21551
21552 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21553
21554         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21555
21556         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21557         when the add and remove accessors are specified. 
21558
21559 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21560
21561         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21562         information about indexer_declarator.
21563         (indexer_declarator): Implement actions.
21564         (parsing_indexer): New local boolean used to keep track of whether
21565         we are parsing indexers or properties. This is necessary because 
21566         implicit_parameters come into picture even for the get accessor in the 
21567         case of an indexer.
21568         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21569
21570         * class.cs (Indexer): New class for indexer declarations.
21571         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21572         (TypeContainer::indexers): New member to hold list of indexers for the
21573         type.
21574
21575 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21576
21577         * cs-parser.jay (add_accessor_declaration): Implement action.
21578         (remove_accessor_declaration): Implement action.
21579         (event_accessors_declaration): Implement
21580         (variable_declarators): swap statements for first rule - trivial.
21581
21582         * class.cs (Event): New class to hold information about event
21583         declarations.
21584         (TypeContainer::AddEvent): New method to add an event to a type
21585         (TypeContainer::events): New member to hold list of events.
21586
21587         * cs-parser.jay (event_declaration): Implement actions.
21588
21589 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21590
21591         * cs-parser.jay (dim_separators): Implement. Make it a string
21592         concatenating all the commas together, just as they appear.
21593         (opt_dim_separators): Modify accordingly
21594         (rank_specifiers): Update accordingly. Basically do the same
21595         thing - instead, collect the brackets here.
21596         (opt_rank_sepcifiers): Modify accordingly.
21597         (array_type): Modify to actually return the complete type string
21598         instead of ignoring the rank_specifiers.
21599         (expression_list): Implement to collect the expressions
21600         (variable_initializer): Implement. We make it a list of expressions
21601         essentially so that we can handle the array_initializer case neatly too.
21602         (variable_initializer_list): Implement.
21603         (array_initializer): Make it a list of variable_initializers
21604         (opt_array_initializer): Modify accordingly.
21605
21606         * expression.cs (New::NType): Add enumeration to help us
21607         keep track of whether we have an object/delegate creation
21608         or an array creation.
21609         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21610         members to hold data about array creation.
21611         (New:New): Modify to update NewType
21612         (New:New): New Overloaded contructor for the array creation
21613         case.
21614
21615         * cs-parser.jay (array_creation_expression): Implement to call
21616         the overloaded New constructor.
21617
21618 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21619
21620         * class.cs (TypeContainer::Constructors): Return member
21621         constructors instead of returning null.
21622
21623 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21624
21625         * typemanager.cs (InitCoreTypes): Initialize the various core
21626         types after we have populated the type manager with the user
21627         defined types (this distinction will be important later while
21628         compiling corlib.dll)
21629
21630         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21631         on Expression Classification.  Now all expressions have a method
21632         `Resolve' and a method `Emit'.
21633
21634         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21635         generation from working.     Also add some temporary debugging
21636         code. 
21637
21638 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * codegen.cs: Lots of code generation pieces.  This is only the
21641         beginning, will continue tomorrow with more touches of polish.  We
21642         handle the fundamentals of if, while, do, for, return.  Others are
21643         trickier and I need to start working on invocations soon.
21644
21645         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21646         s.InitStatement. 
21647
21648         * codegen.cs (EmitContext): New struct, used during code
21649         emission to keep a context.   Most of the code generation will be
21650         here. 
21651
21652         * cs-parser.jay: Add embedded blocks to the list of statements of
21653         this block.  So code generation proceeds in a top down fashion.
21654
21655 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21656
21657         * statement.cs: Add support for multiple child blocks.
21658
21659 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21660
21661         * codegen.cs (EmitCode): New function, will emit the code for a
21662         Block of code given a TypeContainer and its ILGenerator. 
21663
21664         * statement.cs (Block): Standard public readonly optimization.
21665         (Block::Block constructors): Link children. 
21666         (Block::Child): Child Linker.
21667         (Block::EmitVariables): Emits IL variable declarations.
21668
21669         * class.cs: Drop support for MethodGroups here, delay until
21670         Semantic Analysis.
21671         (Method::): Applied the same simplification that I did before, and
21672         move from Properties to public readonly fields.
21673         (Method::ParameterTypes): Returns the parameter types for the
21674         function, and implements a cache that will be useful later when I
21675         do error checking and the semantic analysis on the methods is
21676         performed.
21677         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21678         and made a method, optional argument tells whether this is a class
21679         or a structure to apply the `has-this' bit.
21680         (Method::GetCallingConvention): Implement, returns the calling
21681         convention. 
21682         (Method::Define): Defines the type, a second pass is performed
21683         later to populate the methods.
21684
21685         (Constructor::ParameterTypes): implement a cache similar to the
21686         one on Method::ParameterTypes, useful later when we do semantic
21687         analysis. 
21688
21689         (TypeContainer::EmitMethod):  New method.  Emits methods.
21690
21691         * expression.cs: Removed MethodGroup class from here.
21692
21693         * parameter.cs (Parameters::GetCallingConvention): new method.
21694
21695 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21696
21697         * class.cs (TypeContainer::Populate): Drop RootContext from the
21698         argument. 
21699
21700         (Constructor::CallingConvention): Returns the calling convention.
21701         (Constructor::ParameterTypes): Returns the constructor parameter
21702         types. 
21703
21704         (TypeContainer::AddConstructor): Keep track of default constructor
21705         and the default static constructor.
21706
21707         (Constructor::) Another class that starts using `public readonly'
21708         instead of properties. 
21709
21710         (Constructor::IsDefault): Whether this is a default constructor. 
21711
21712         (Field::) use readonly public fields instead of properties also.
21713
21714         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21715         track of static constructors;  If none is used, turn on
21716         BeforeFieldInit in the TypeAttributes. 
21717
21718         * cs-parser.jay (opt_argument_list): now the return can be null
21719         for the cases where there are no arguments. 
21720
21721         (constructor_declarator): If there is no implicit `base' or
21722         `this', then invoke the default parent constructor. 
21723
21724         * modifiers.cs (MethodAttr): New static function maps a set of
21725         modifiers flags into a MethodAttributes enum
21726         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21727         MethodAttr, TypeAttr to represent the various mappings where the
21728         modifiers are used.
21729         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21730
21731 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21732
21733         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21734         method arguments.
21735
21736         * interface.cs (PopulateIndexer): Implemented the code generator
21737         for interface indexers.
21738
21739 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21740
21741         * interface.cs (InterfaceMemberBase): Now we track the new status
21742         here.  
21743
21744         (PopulateProperty): Implement property population.  Woohoo!  Got
21745         Methods and Properties going today. 
21746
21747         Removed all the properties for interfaces, and replaced them with
21748         `public readonly' fields. 
21749
21750 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21751
21752         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21753         initialize their hashtables/arraylists only when they are needed
21754         instead of doing this always.
21755
21756         * parameter.cs: Handle refs and out parameters.
21757
21758         * cs-parser.jay: Use an ArrayList to construct the arguments
21759         instead of the ParameterCollection, and then cast that to a
21760         Parameter[] array.
21761
21762         * parameter.cs: Drop the use of ParameterCollection and use
21763         instead arrays of Parameters.
21764
21765         (GetParameterInfo): Use the Type, not the Name when resolving
21766         types. 
21767
21768 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21769
21770         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21771         and instead use public readonly fields.
21772
21773         * class.cs: Put back walking code for type containers.
21774
21775 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21776
21777         * class.cs (MakeConstant): Code to define constants.
21778
21779         * rootcontext.cs (LookupType): New function.  Used to locate types 
21780
21781
21782 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21783
21784         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21785         this System.Reflection code is.  Kudos to Microsoft
21786
21787         * typemanager.cs: Implement a type cache and avoid loading all
21788         types at boot time.  Wrap in LookupType the internals.  This made
21789         the compiler so much faster.  Wow.  I rule!
21790
21791         * driver.cs: Make sure we always load mscorlib first (for
21792         debugging purposes, nothing really important).
21793
21794         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21795         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21796
21797         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21798         on namespaces that have been imported using the `using' keyword.
21799
21800         * class.cs (TypeContainer::TypeAttr): Virtualize.
21801         (Class::TypeAttr): Return attributes suitable for this bad boy.
21802         (Struct::TypeAttr): ditto.
21803         Handle nested classes.
21804         (TypeContainer::) Remove all the type visiting code, it is now
21805         replaced with the rootcontext.cs code
21806
21807         * rootcontext.cs (GetClassBases): Added support for structs. 
21808
21809 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21810
21811         * interface.cs, statement.cs, class.cs, parameter.cs,
21812         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21813         Drop use of TypeRefs, and use strings instead.
21814
21815 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21816
21817         * rootcontext.cs: 
21818
21819         * class.cs (Struct::Struct): set the SEALED flags after
21820         checking the modifiers.
21821         (TypeContainer::TypeAttr): new property, returns the
21822         TypeAttributes for a class.  
21823
21824         * cs-parser.jay (type_list): Oops, list production was creating a
21825         new list of base types.
21826
21827         * rootcontext.cs (StdLib): New property.
21828         (GetInterfaceTypeByName): returns an interface by type name, and
21829         encapsulates error handling here.
21830         (GetInterfaces): simplified.
21831         (ResolveTree): Encapsulated all the tree resolution here.
21832         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21833         types. 
21834
21835         * driver.cs: Add support for --nostdlib, to avoid loading the
21836         default assemblies.
21837         (Main): Do not put tree resolution here. 
21838
21839         * rootcontext.cs: Beginning of the class resolution.
21840
21841 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21842
21843         * rootcontext.cs: Provide better error reporting. 
21844
21845         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21846
21847         * rootcontext.cs (CreateInterface): Handle the case where there
21848         are no parent interfaces.
21849
21850         (CloseTypes): Routine to flush types at the end.
21851         (CreateInterface): Track types.
21852         (GetInterfaces): Returns an array of Types from the list of
21853         defined interfaces.
21854
21855         * typemanager.c (AddUserType): Mechanism to track user types (puts
21856         the type on the global type hash, and allows us to close it at the
21857         end). 
21858
21859 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21860
21861         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21862         RecordInterface instead.
21863
21864         * cs-parser.jay: Updated to reflect changes above.
21865
21866         * decl.cs (Definition): Keep track of the TypeBuilder type that
21867         represents this type here.  Not sure we will use it in the long
21868         run, but wont hurt for now.
21869
21870         * driver.cs: Smaller changes to accomodate the new code.
21871
21872         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21873         when done. 
21874
21875         * rootcontext.cs (CreateInterface):  New method, used to create
21876         the System.TypeBuilder type for interfaces.
21877         (ResolveInterfaces): new entry point to resolve the interface
21878         hierarchy. 
21879         (CodeGen): Property, used to keep track of the code generator.
21880
21881 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21882
21883         * cs-parser.jay: Add a second production for delegate_declaration
21884         with `VOID'.
21885
21886         (enum_body): Put an opt_comma here instead of putting it on
21887         enum_body or enum_member_declarations so we can handle trailing
21888         commas on enumeration members.  Gets rid of a shift/reduce.
21889
21890         (type_list): Need a COMMA in the middle.
21891
21892         (indexer_declaration): Tell tokenizer to recognize get/set
21893
21894         * Remove old targets.
21895
21896         * Re-add the parser target.
21897
21898 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21899
21900         * cs-parser.jay: Add precendence rules for a number of operators
21901         ot reduce the number of shift/reduce conflicts in the grammar.
21902
21903 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21904
21905         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21906         and put it here.
21907
21908         Get rid of old crufty code.
21909
21910         * rootcontext.cs: Use this to keep track of the parsed
21911         representation and the defined types available to the program. 
21912
21913         * gen-treedump.cs: adjust for new convention.
21914
21915         * type.cs: Split out the type manager, and the assembly builder
21916         from here. 
21917
21918         * typemanager.cs: the type manager will live here now.
21919
21920         * cil-codegen.cs: And the code generator here. 
21921
21922 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21923
21924         * makefile: Fixed up for easy making.
21925
21926 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21927
21928         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21929         the 
21930
21931         (unary_expression): Expand pre_increment_expression and
21932         post_decrement_expression to reduce a shift/reduce.
21933
21934 2001-07-11  Simon Cozens
21935
21936         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21937
21938         Improve allow_keyword_as_indent name.
21939
21940 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21941
21942         * Adjustments for Beta2. 
21943
21944 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21945
21946         * decl.cs: Added `Define' abstract method.
21947         (InTransit): new property, used to catch recursive definitions. 
21948
21949         * interface.cs: Implement `Define'. 
21950
21951         * modifiers.cs: Map Modifiers.constants to
21952         System.Reflection.TypeAttribute flags.
21953
21954         * class.cs: Keep track of types and user-defined types.
21955         (BuilderInit): New method for creating an assembly
21956         (ResolveType): New function to launch the resolution process, only
21957         used by interfaces for now.
21958
21959         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21960         that are inserted into the name space. 
21961
21962 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21963
21964         * ARGH.  I have screwed up my tree so many times due to the use of
21965         rsync rather than using CVS.  Going to fix this at once. 
21966
21967         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21968         load types.
21969
21970 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21971
21972         * Experiment successful: Use System.Type rather that our own
21973         version of Type.  
21974
21975 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21976
21977         * cs-parser.jay: Removed nsAliases from here.
21978
21979         Use new namespaces, handle `using XXX;' 
21980
21981         * namespace.cs: Reimplemented namespace handling, use a recursive
21982         definition of the class.  Now we can keep track of using clauses
21983         and catch invalid using clauses.
21984
21985 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21986
21987         * gen-treedump.cs: Adapted for all the renaming.
21988
21989         * expression.cs (Expression): this class now has a Type property
21990         which returns an expression Type.
21991
21992         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21993         `Type', as this has a different meaning now in the base
21994
21995 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21996
21997         * interface.cs, class.cs: Removed from all the sources the
21998         references to signature computation, as we can not do method
21999         signature computation during the parsing time, as we are not
22000         trying to solve at that point distinguishing:
22001
22002         class X {
22003                 void a (Blah x) {}
22004                 void a (NS.Blah x) {}
22005         }
22006
22007         Which depending on the context might be valid or not, as we do not
22008         know if Blah is the same thing as NS.Blah at that point.
22009
22010         * Redid everything so the code uses TypeRefs now instead of
22011         Types.  TypeRefs are just temporary type placeholders, that need
22012         to be resolved.  They initially have a pointer to a string and the
22013         current scope in which they are used.  This is used later by the
22014         compiler to resolve the reference to an actual Type. 
22015
22016         * DeclSpace is no longer a CIR.Type, and neither are
22017         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22018         are all DeclSpaces, but no Types. 
22019
22020         * type.cs (TypeRefManager): This implements the TypeRef manager,
22021         which keeps track of all the types that need to be resolved after
22022         the parsing has finished. 
22023
22024 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22025
22026         * ARGH.  We are going to have to store `foreach' as a class rather
22027         than resolving it, as we need to verify error 1579 after name
22028         resolution.   *OR* we could keep a flag that says `This request to
22029         IEnumerator comes from a foreach statement' which we can then use
22030         to generate the error.
22031
22032 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * class.cs (TypeContainer.AddMethod): we now add methods to the
22035         MethodGroup instead of the method hashtable.  
22036
22037         * expression.cs: Add MethodGroup abstraction, which gets us one
22038         step closer to the specification in the way we handle method
22039         declarations.  
22040
22041         * cs-parser.jay (primary_expression): qualified_identifier now
22042         tried to match up an identifier to a local variable reference or
22043         to a parameter reference.
22044
22045         current_local_parameters is now a parser global variable that
22046         points to the current parameters for the block, used during name
22047         lookup.
22048
22049         (property_declaration): Now creates an implicit `value' argument to
22050         the set accessor.
22051
22052 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22053
22054         * parameter.cs: Do not use `param' arguments as part of the
22055         signature, per the spec.
22056
22057 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22058
22059         * decl.cs: Base class for classes, structs and interfaces.  This
22060         is the "Declaration Space" 
22061
22062         * cs-parser.jay: Use CheckDef for checking declaration errors
22063         instead of having one on each function.
22064
22065         * class.cs: Factor out some code for handling error handling in
22066         accordance to the "Declarations" section in the "Basic Concepts"
22067         chapter in the ECMA C# spec.
22068
22069         * interface.cs: Make all interface member classes derive from
22070         InterfaceMemberBase.
22071
22072 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22073
22074         * Many things: all interfaces are parsed and generated in
22075         gen-treedump.  Support for member variables, constructors,
22076         destructors, properties, constants is there.
22077
22078         Beginning of the IL backend, but very little done, just there for
22079         testing purposes. 
22080
22081 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22082
22083         * cs-parser.jay: Fix labeled statement.
22084
22085         * cs-tokenizer.cs (escape): Escape " and ' always.
22086         ref_line, ref_name: keep track of the line/filename as instructed
22087         by #line by the compiler.
22088         Parse #line.
22089
22090 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22091
22092         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22093         to match the values in System.CodeDOM.
22094
22095         Divid renamed to Divide.
22096
22097         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22098         statements. 
22099         (Statements.set): remove.
22100
22101         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22102         statements. 
22103
22104         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22105         falseStatements always have valid values. 
22106
22107         * cs-parser.jay: Use System.CodeDOM now.
22108