2005-12-23 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2
3         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4         parent if its the same scope.  Fixes #77060.
5
6 2005-12-21  Miguel de Icaza  <miguel@novell.com>
7
8         * driver.cs: Report the case of no source files and no -out:
9         argument provided.
10
11 2005-12-20  Raja R Harinath  <rharinath@novell.com>
12
13         Fix #77035.
14         * expression.cs (ComposedCast.GetSignatureForError): Define.
15
16 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
17
18         Fix #76995
19
20         * namespace.cs (NamespaceEntry): Add extern_aliases as a
21         ListDictionary, to contain the ExternAliasEntry entries (in
22         addition to the NamespaceEntry.aliases hashtable). This field is
23         shared between the original entry and its doppelganger (bodyless 
24         copy of it).
25         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
26         extern_aliases field.
27         (NamespaceEntry.Lookup): Move the IsImplicit check after the
28         lookup in extern_aliases.
29
30 2005-12-16  Raja R Harinath  <rharinath@novell.com>
31
32         Fix #77006.
33         * class.cs (TypeContainer.Mark_HasEquals): New.
34         (TypeContainer.Mark_HasGetHashCode): New.
35         (ClassPart): Override them.
36         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
37
38         Fix #77008.
39         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
40         'parent' argument to the base constructor.
41
42         Remove all mention of TypeContainer from decl.cs.
43         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
44         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
45         (DeclSpace.DeclSpace): Likewise.
46         (DeclSpace.DefineMembers): Remove unused argument.
47         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
48         debugging check -- we don't care if the debug code throws an
49         InvalidCastException instead of an InternalErrorException.
50         * class.cs (TypeContainer.DefineMembers): Update to changes.
51         (TypeContainer.DoDefineMembers): Likewise.
52         (TypeContainer.GetMethods): Likewise.
53         (PropertyMember.Define): Likewise.
54         (MemberBase.Parent): New property that forwards to
55         MemberCore.Parent, but ensures that we get a TypeContainer.
56         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
57         (RootContext.PopulateTypes): Likewise.  Remove special case code
58         for !RootContext.StdLib: DefineMembers is idempotent.
59
60 2005-12-14  Miguel de Icaza  <miguel@novell.com>
61
62         * convert.cs (ExplicitConversionCore): Check the return value from
63         ExplicitConversionCore which can return null on failure.  Fixes #76914
64
65 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
66
67         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
68
69 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
70
71         * doc.cs : The search for referenced namespace was insufficient to
72           get global one as it used to do. Fixed bug #76965.
73
74 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
75
76         * doc.cs : check name in cref in the last phase that whether it is
77           namespace or not.
78
79 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
80
81         * cs-tokenizer.cs : reverted the latest change: it somehow broke
82           Mono.C5.
83
84 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
85
86         * doc.cs : so it turned out that we cannot skip override check for 
87           interface members. Fixed bug #76954.
88
89 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
90
91         * cs-tokenizer.cs : fixed bug #75984:
92           - #warning and #error should not be handled when the source line
93             is disabled.
94           - #line is not checked strictly when the source line is disabled.
95           - #define and #undef is on the other hand checked strictly at any
96             state.
97
98 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
99
100         * cs-tokenizer.cs : missing Location (actually, filename) in one of
101           CS1027 report.
102
103 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
104
105         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
106
107         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
108         event initializers.
109         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
110         (FieldBase.Initializer): Initializer is now optional.
111         (EventField.Define): Only event field can have initializer.
112
113         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
114
115         * const.cs (Const): Reuse initializer.
116
117         * cs-parser.jay: Updated after FieldBase changes.
118         Added current_array_type to simplify array initializers.
119
120         * ecore.cs (NullCast.IsDefaultValue): Implemented.
121
122         * expression.cs, iterators.cs: Updated.
123
124         * namespace.cs (NamespaceEntry): Made UsingFound private.
125
126 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
127
128         * parameterCollection.cs: Obsolete, removed.
129         * parser.cs: Obsolete, removed.
130
131 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
132
133         Fix #76849.
134         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
135
136         * enum.cs (Enum.Define): Set obsolete context here.
137
138 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
139
140         * doc.cs :
141           - FindDocumentedMember() now expects 1) paramList as null
142             when "we don't have to check the number of parameters" and
143             2) Type.EmptyTypes when "there is no arguments".
144           - Introduced FoundMember struct to hold the exact type which was
145             used to find the documented member (the above change broke
146             test-xml-044; it might be better just to use DeclaringType than
147             what MS does, like this change does, but it depends on usage.)
148
149 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
150
151         * doc.cs : documented member might be from DeclaringType for nested
152           types. Fixed bug #76782.
153
154 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
155
156         * anonymous.cs: Have the param code handle leaving copies on the
157         stack etc. Allows anonymous params to take part in the assignment
158         code (++, +=, etc). Fixes bug #76550
159
160         * expression.cs: Handle the prepare_for_load/leave_copy by passing
161         it down to the anon code.
162
163         * iterators.cs: Use dummy var here
164
165         * codegen.cs: Handle new vars
166
167 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
168
169         Fix #76849.
170         * class.cs (MethodData.Define): Set proper Obsolete context.
171
172         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
173         obsolete context.
174         (FieldExpr.DoResolve): Ditto.
175
176 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
177
178         Fix #76849.
179         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
180         parent is not obsolete.
181
182 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
183
184         * doc.cs : (FindDocumentedMember) find parameterless members first
185           and get CS0419 in the early stage. Fixed first case of bug #76727.
186
187 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
188
189         Fix #76859.
190         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
191         no error was reported.
192
193         *expression.cs (Binary.DoResolve): left can be null.
194
195 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
196
197         Fix #76783.
198         * class.cs (MethodData.Emit): Parameters should be labeled first.
199
200 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
201
202         Fix #76761.
203         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
204
205 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
206
207         * attribute.cs (AreParametersCompliant): Moved to Parameter.
208
209         * class.cs (MethodCore): Parameter clean up.
210         (IMethodData): Added ParameterInfo.
211         (MethodData): Parameter clean up.
212         (Indexer.Define): Parameter clean up.
213
214         * anonymous.cs,
215         * codegen.cs,
216         * cs-parser.jay,
217         * decl.cs,
218         * doc.cs,
219         * ecore.cs,
220         * flowanalysis.cs,
221         * iterators.cs,
222         * pending.cs,
223         * statement.cs,
224         * typemanager.cs: Parameter clean up.
225
226         * delegate.cs (Define): Get rid of duplicated code.
227
228         * expression.cs (ParameterReference): Removed useless parameters
229         and simplified.
230         (Invocation): Ditto.
231
232         * parameter.cs (ParamsParameter): New class, params specialization.
233         (ArglistParameter): Attemp to separate arglist.
234         (Parameter): Refactored to be reusable and faster.
235         (Parameter.Modifier): Made understandable.
236         (Parameters): Changed to be used as a class for `this' assembly
237         parameters. Refactored to use new specialized classes.
238
239         * support.cs (ParameterData): Added Types property.
240         (InternalParameters): Deleted.
241
242 2005-08-20  Martin Baulig  <martin@ximian.com>
243
244         Merging this patch from GMCS to fix #75867.
245
246         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
247         scope if we don't already have it.
248
249 2005-11-17  Martin Baulig  <martin@ximian.com>
250
251         * anonymous.cs
252         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
253         inherit the scope from our parent.  Fixes #76653.
254
255 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
256
257         * doc.cs : the previous patch does not actually fix the bug.
258           PropertyInfo override check is now implemented and really fixed it.
259         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
260
261 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
262
263         * doc.cs : apply "override filter" also to properties.
264           Fixed bug #76730.
265
266 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
267
268         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
269           no need to check overrides. For classes, omit those results from 
270           interfaces since they must exist in the class. Fixed bug #76726.
271
272 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
273
274         * typemanager.cs : (GetFullNameSignature) differentiate indexers
275           with different parameters. Fixed the second problem in #76685.
276
277 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
278
279         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
280           get expected 'protected' access in CheckValidFamilyAccess()).
281           Fixed bug #76692.
282
283 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
284
285         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
286           Fixed bug #76705.  CS1569 was incorrectly commented out.
287
288 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
289
290         * doc.cs : use Invocation.IsOverride() to do real override check.
291         * expression.cs : made Invocation.IsOverride() internal.
292
293 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
294
295         * doc.cs : use TypeManager.FindMembers() instead of (possible)
296           TypeBuilder.FindMembers() and filter overriden base members out.
297           Fixed bug #76990.
298
299 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
300
301         * doc.cs : ref/out parameters are represented as '@' (instead of
302           '&' in type FullName). Fixed bug #76630 (additionally crefs).
303
304 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
305
306         * doc.cs : when there was no '.' in cref to methods in doc comment,
307           then parameters were missing in the output. Fixed bug #76691.
308
309 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
310
311         * driver.cs : don't output docs when there is an error.
312           Fixed bug #76693.
313
314 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
315
316         * doc.cs :
317           Now it should detect indexers. Fixed primary concern in bug #76685.
318           Fixed CS0419 message to not show the identical member signature in
319           the message.
320
321 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
322
323         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
324           instead of Type.FindMembers() since it does not handle events.
325           Fixed bug #71604.
326
327 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
328
329         * codegen.cs: Fixed typo (speficied -> specified).
330
331 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
332
333         Fix #76369.
334         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
335
336 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
337
338         * attribute.cs: Changed error message.
339
340         * cs-tokenizer.cs: One more check.
341
342 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
343
344         * statement.cs (Block.Resolve): Ignore empty statement.
345
346 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
347
348         * report.cs: Made error/warning methods more strict to avoid
349         their misuse.
350
351         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
352         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
353         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
354         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
355
356 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
357
358         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
359         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
360
361         * class.cs (TypeContainer.IsComImport): New property.
362         (Constructor.Define): Create proper ctor for ComImport types.
363
364         * expression.cs (New.CheckComImport): Fixed.
365
366 2005-11-07  Miguel de Icaza  <miguel@novell.com>
367
368         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
369         that a parameter has been captured does not mean that we do not
370         have to do the rest of the processing.  This fixes the second part
371         of #76592.  If there was another anonymous method capturing
372         values in the past, the Scope would never be set for the second
373         method that captured the same parameter.
374
375         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
376         properly manipulate the stack.   Second part of fix for #76592.
377
378         * expression.cs (New): Add support for invoking "new" on
379         interfaces that have been flagged with the ComImport attribute and
380         the CoClass.  Fixes #76637 
381
382         * statement.cs (Try.DoEmit): When a variable is captured, do not
383         try to emit the vi.LocalBuilder variable as it has been captured.
384         Create a temporary variable and store the results on the
385         FieldBuilder.  Fixes #76642
386
387 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
388
389         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
390
391         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
392
393         * expression.cs (Binary.DoResolve): Added && optimalization.
394     
395         * typemanager.cs (AddUserType): Removed useless argument.
396
397 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
398
399         * statement.cs (Block.variables): Uses ListDictionary.
400
401 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
402
403         Fix #75969.
404         * class.cs (PartialContainer.EmitType): Customized to emit
405         security attributes.
406         (ClassPart.ApplyAttributeBuilder): Transform security attribute
407         for partial classes.
408
409 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
410
411         Fix #76599.
412         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
413         access has to be fixed.
414         
415         * typemanager.cs (IsUnmanagedType): Wrong common field type.
416
417 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
418
419         Fix #76590.
420         * ecore.cs (NullCast.Reduce): Implemented.
421
422         * expression.cs (ArrayCreation.CheckIndices): Correcly check
423         constant type.
424         
425         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
426         properly.
427         (Foreach.Resolve): Catch null properly.
428
429 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
430  
431         * cs-tokenizer.cs: Warning text fix.
432
433         * driver.cs: AllWarningNumbers exposed on public interface.
434
435         * report.cs (): Reviewed warning numbers.
436         (IsValidWarning): Use binary search.
437
438 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
439  
440         * driver.cs: Implemeted resource visibility.
441         (Resources): New class for code sharing between /res: and
442         /linkres:
443  
444 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
445
446         Fix #76568.
447         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
448         folding.
449         
450         * convert (Convert.ImplicitReferenceConversion): NullCast holds
451         contants only.
452         
453         * ecore.cs (NullCast): Child is contant only.
454         
455         * literal.cs (NullLiteral.Reduce): null can be converted to any
456         reference type.
457
458 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
459
460         * driver.cs: Use Encoding.Default as default code page instead
461           of ISO-28591.
462
463 2005-10-27  Raja R Harinath  <rharinath@novell.com>
464
465         Fix #76085.
466         * expression.cs (Invocation.Error_InvalidArguments): Handle
467         __arglist parameters.
468         (Invocation.VerifyArgumentsCompat): Likewise.
469         * support.cs (ReflectionParameters.GetSignatureForError): Print
470         __arglist parameters.
471         (InternalParamters.GetSignatureForError): Likewise.
472         * parameter.cs (Parameters.GetSignatureForError): Likewise.
473
474 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
475
476         * attribute.cs (GetPropertyValue): Made public.
477
478         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
479         Resolve.
480         Add new property WrapNonExceptionThrows to handle 2.0 assembly
481         attribute.
482         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
483         is not defined.
484         
485         * driver.cs: Reflect method name change.
486         
487         * statement.cs (Try.Resolve): Warn when try has both general
488         exception handlers.
489         
490         * typemanager.cs: runtime_compatibility_attr_type new predefined
491         type.
492
493 2005-10-26  Raja R Harinath  <harinath@gmail.com>
494
495         Fix #76419.
496         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
497         treat it as an empty parameter list.
498
499 2005-10-26  Raja R Harinath  <rharinath@novell.com>
500
501         Fix #76271.     
502         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
503         ResolveAsTypeStep silent.
504         * statement.cs (Block.AddConstant): Mark block as used.
505         (Block.ResolveMeta): Avoid piling on error messages
506         if a constant initializer resolution fails.
507
508 2005-10-25  Raja R Harinath  <rharinath@novell.com>
509
510         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
511         Remove.
512         (NamespaceEntry.VerifyAllUsing): New.
513         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
514         behaviour.  Delegates actual resolution of alias to ...
515         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
516         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
517         Update.
518         * driver.cs (Driver.MainDriver): Update.
519         
520         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
521         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
522         property.
523         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
524         Remove.
525         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
526         RootNamespace.DefineNamespacesForAll.
527
528 2005-10-24  Raja R Harinath  <harinath@gmail.com>
529
530         * typemanager.cs (assemblies, external_aliases, modules)
531         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
532         (ComputeNamespaces, GetRootNamespace): Remove extra staging
533         overhead.  Move resposibility ...
534         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
535         * driver.cs, attribute.cs, codegen.cs: Update to changes.
536
537 2005-10-23  Raja R Harinath  <harinath@gmail.com>
538
539         * namespace.cs (RootNamespace.all_namespaces): Renamed from
540         cached_namespaces.  Improve usage.
541         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
542         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
543         Move from GlobalRootNamespace and simplify.
544         (RootNamespace.Global): Make instance variable.
545         (RootNamespace.RootNamespace): Add "alias name" parameter.
546         (GlobalRootNamespace): Simplify drastically.
547         (Namespace.Lookup): Don't use GetNamespace.
548         * typemanager.cs (GetRootNamespace): Rename from
549         ComputeNamespaceForAlias.
550         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
551
552 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
553
554         * anonymous.cs (AnonymousContainer): Don't crash when container
555         doesn't exist.
556
557 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
558
559         * expression.cs (Binary.DoResolve): Warn when comparing same
560         values.
561
562 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
563
564         Fix #76486.
565         * expression.cs (Binary.DoResolve): It looks like there are no
566         convetsion rules in enum context.
567
568 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
569
570         Add support for extern alias qualifiers.
571         * typemanager.cs: Move some LookupTypeReflection code
572         to namespace.cs, to have cleaner code. Added some methods
573         to help us keep track of the extern aliased references.
574         * driver.cs: Add suport for extern alias assemblies on command
575         line and check for their warnings/errors. Also keep track of the
576         extern aliased assemblies.
577         * namespace.cs: Move the global functionality of Namespace
578         to GlobalRootNamespace/RootNamespace. Now the global namespace
579         is GlobalRootNamespace.Globa. Also the code moved from 
580         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
581         Finally added LocalAliasEntry (AliasEntry before) and
582         ExternAliasEntry, to handle alias statements.
583         * cs-parser.jay: Add support in the grammar for extern alias
584         statement.
585         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
586         Update callings to Namespace (now in GlobalRootNamespace).
587
588 2005-10-18  Raja R Harinath  <rharinath@novell.com>
589
590         Fix #76371.
591         * class.cs (TypeContainer.DefineType): Move updating of
592         topological sort earlier in the code.
593         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
594
595 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
596
597         Fix #76273.
598         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
599         
600         * constant.cs (Constant.TryReduce): Moved from Cast class.
601         (Reduce): Made little bit more OO and fixed missing conversions.
602         
603         * ecore.cs (Reduce): Implemented.
604         (Binary.EnumLiftUp): New method to upgrade values to enum values.
605         
606         * literal.cs (Reduce): Implemented.
607         
608         * class.cs: Reverted Miguel's wrong commit.
609
610 2005-10-14  Miguel de Icaza  <miguel@novell.com>
611
612         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
613
614 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
615
616         * cs-parser.jay, expression.cs : CS0214 was missing error location
617           for constants. Fixed bug #76404.
618
619 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
620
621         Fix #76370.
622         * convert.cs (ExplicitConversionCore): Fixed object->enum
623         conversion.
624
625 2005-10-10  Raja R Harinath  <rharinath@novell.com>
626
627         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
628         InstanceExpression.
629         (PropertyExpr.EmitCall): Likewise.
630         * expression.cs (Invocation.EmitArguments): Handle case where
631         arguments == null.
632         (Invocation.EmitCall): Avoid allocating temporary variable if
633         there are no arguments.
634
635 2005-10-07  Raja R Harinath  <rharinath@novell.com>
636
637         Fix #76323.
638         * convert.cs (ImplicitConversionStandard): Move conversion of
639         void* to arbitrary pointer types ...
640         (ExplicitConversionStandard): .. here.
641         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
642         error to always print typenames.
643
644 2005-10-07  Raja R Harinath  <rharinath@novell.com>
645
646         * convert.cs (GetConversionOperator): Rename from
647         GetConversionOperators.  Move operator selection code from ...
648         (UserDefinedConversion): ... here.
649
650 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
651
652         * convert.cs (ExplicitConversionCore): Removed duplicate enum
653         conversion.
654
655 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
656
657         * assign.cs (Assign.DoResolve): Error method changed.
658
659         * cfold.cs (DoConstantNumericPromotions): Error method changed.
660         
661         * const.cs (ResolveValue): Reset in_transit immediately.
662         
663         * constant.cs: Error method changed.
664         
665         * convert.cs: Removed useless location parameter.
666         (ExplicitNumericConversion): Don't do double enum check.
667         (ExplicitConversionCore): Renamed from ExplicitConversion.
668         (ExplicitUnsafe): Extracted from ExplicitConversion.
669         (ExplicitConversion): Uses for error reporting.
670         
671         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
672         error messages.
673         (ResolveBoolean): Uses common error method.
674         (CastToDecimal): Get rid of ec.
675         (CastFromDecimal): Optimized.
676         (ConvCast): Get rid of ec.
677         
678         * enum.cs (ResolveValue): Reset in_transit immediately.
679         (Emit): Return after first error.
680         
681         * expression.cs: Convert changes.
682         
683         * literal.cs: Error method changed.
684         
685         * statement.cs: Error method changed.
686
687 2005-10-03  Raja R Harinath  <rharinath@novell.com>
688
689         * support.cs (SeekableStreamReader.Position): Don't error out when
690         the requested position is just beyond the end of the current
691         buffered data.
692
693 2005-09-28  Raja R Harinath  <rharinath@novell.com>
694
695         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
696         try to keep in sync with the byte count of the underlying Stream.
697         However, this limits us to a window size of 2048 characters: i.e.,
698         the maximum lookahead of our lexer/parser can be 2048 characters.
699
700 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
701
702         Fix #76255.
703         * driver.cs: Fix compilation files with full root path.
704
705 2005-09-25  Miguel de Icaza  <miguel@novell.com>
706
707         * report.cs (SymbolRelatedToPreviousError): Format the output so
708         it does not use an open parenthesis that is never closed. 
709
710         * driver.cs: Follow coding guidelines
711
712 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
713
714         Fix #72930.
715         * const.cs (Const.ResolveValue): Check for assigning non-null
716         value to reference type.
717
718 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
719
720         * anonymous.cs: Implemented ExprClassName.
721         
722         * assign.cs (Assign.DoResolve): Don't chrash when type is not
723         delegate.
724         
725         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
726         check.
727         
728         * class.cs (StaticClass.DefineContainerMembers): Report protected
729         members as error.
730         
731         * codegen.cs: if(ed) PRODUCTION.
732         
733         * convert.cs (Error_CannotImplicitConversion): Better error
734         distinction.
735         
736         * cs-parser.jay: More error checks.
737         
738         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
739         
740         * driver.cs (CSCParseOption): Enabled wrong option check.
741         
742         * ecore.cs (Expression.ExprClassName): Turned to property.
743         (MemberExpr.CheckIntermediateModification): For checking boxed
744         value types     modification.
745         
746         * statement.cs (Fixed.Resolve): Expression type must be
747         convertible to fixed type.
748         (CollectionForeach.GetEnumeratorFilter,TryType):
749         Small refactoring for easier error checking.
750
751 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
752
753         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
754         attributes.
755         
756         * class.cs (GeneratedBaseInitializer): New class for customization
757         compiler generated initializers.
758         (MemberBase.DoDefine): Check Obsolete attribute here.
759         (FieldMember.DoDefine): Ditto.
760         
761         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
762         constants.
763         
764         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
765         (MemberCore.GetObsoleteAttribute): Removed argument.
766         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
767         (MemberCore.CheckObsoleteType): New helper.
768         
769         * delegate.cs,
770         * enum.cs,
771         * statement.cs: Updates after MemberCore changes.
772         
773         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
774         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
775         
776         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
777         obsolete attribute for compiler construct.
778         (As.DoResolve): Cache result.
779         
780         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
781
782 2005-09-26  Raja R Harinath  <rharinath@novell.com>
783
784         Fix #76133.
785         * expression.cs (This.VerifyFixed): In a value type T, the type of
786         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
787         value type R, 'this' is treated as a value parameter.
788
789 2005-09-22  Miguel de Icaza  <miguel@novell.com>
790
791         * statement.cs (Lock): Use the TemporaryVariable class instead of
792         manually using local variables as those do not work when variables
793         are captured.
794
795         * ecore.cs: Moved the TemporaryVariable class from being a nested
796         class inside Foreach to be a public class that can be employed in
797         other places. 
798
799 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
800
801         * cs-parser.jay: interface_accessors replaced by
802         accessor_declarations.
803
804         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
805         location.
806         
807         * statement.cs (GotoCase.Resolve): Convert null constant to
808         null case.
809         (SwitchLabel.ResolveAndReduce): Ditto.
810         (SwitchLabel.NullStringCase): Custom null stamp.
811         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
812         
813         typemanager.cs (CSharpSignature): Don't skip first argument
814         for full names.
815
816 2005-09-18  Miguel de Icaza  <miguel@novell.com>
817
818         * driver.cs: Set InEmacs based on the environment variable EMACS. 
819
820         * location.cs (InEmacs): in this mode, do not report column
821         location as it confuses Emacs.
822
823 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
824
825         * cfold.cs, constant.cs, convert.cs, ecore.cs,
826         expression.cs, iterators.cs, literal.cs: Store constants and
827         literals location.
828         
829         * class.cs (MemberBase.ShortName): Pass location.
830         
831         * cs-parser.jay: Some location fixes.
832         
833         * ecore.cs (Expression.Location): Made virtual.
834
835 2005-09-05  Miguel de Icaza  <miguel@novell.com>
836
837         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
838         if the underlying types are the same, otherwise we need to produce
839         code that will do the proper cast.
840
841         This was exposed by Marek's constant rewrite which produced
842         invalid code for the call site:
843
844         enum X : long { a }
845         void Method (X v) {}
846
847         Method ((X) 5)
848
849         This fixes test-49.cs
850
851 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
852
853         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
854           Type/Object should be allowed as well. Fixed bug #75968.
855
856 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
857
858         * expression.cs : (Binary.DoResolve): when one is enum constant and
859           another is constant 0, then return enum one *as enum type*.
860           Fixed bug 74846.
861
862 2005-09-02  Raja R Harinath  <rharinath@novell.com>
863
864         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
865         internal.
866
867         Fix #75941.
868         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
869         flow-branching for LocalVariableReferences in case we were invoked
870         from a MemberAccess.
871         * expression.cs (LocalVariableReference.VerifyAssigned): New.
872         Carved out of ...
873         (LocalVariableReference.DoResolveBase): ... this.
874         (MemberAccess.Resolve): Do the check that was disabled during
875         SimpleNameResolve.
876
877 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
878
879         * class.cs :
880           (PartialContainer.Create): check abstract/sealed/static strictly
881           but abstract/sealed can exist only at one side. Fixed bug #75883.
882
883 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
884
885         Fix #75945.
886         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
887         specified, don't default to UnmanagedType.I4.
888
889 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
890
891         * expression.cs : conditional operator should check possibly
892           incorrect assign expression. Fixed bug #75946.
893
894 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
895
896         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
897           Reverting the change. gmcs is much complex than mcs on this matter.
898
899 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
900
901         * cs-tokenizer.cs : To read another token ahead of the actual 
902           consumption, use new SavedToken and cache token instead of moving
903           back the stream with SeekableStreamReader (it seemed problematic).
904         * cs-parser.jay,
905           driver.cs : Thus use StreamReader directly.
906         * support.cs : Thus removed SeekableStreamReader.
907
908 2005-08-30  Raja R Harinath  <rharinath@novell.com>
909
910         Fix #75934.
911         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
912         (ScopeInfo.EmitScopeType): Use it to construct field names from
913         names of captured locals.
914
915         Fix #75929.
916         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
917         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
918         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
919         (ExplicitConversion): Remove enum cases already handled by
920         implicit conversion.  Move implicit conversion check to the beginning.
921         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
922         * expression.cs (ArrayCreation.EmitDynamicInitializers):
923         Don't treat System.Enum as a struct.
924
925 2005-08-30  Jb Evain  <jbevain@gmail.com>
926
927         * attribute.cs: handles as expression in parameters.
928
929 2005-08-30  Raja R Harinath  <rharinath@novell.com>
930
931         Fix #75802.
932         * class.cs (TypeContainer.VerifyClsName): Don't use a
933         PartialContainer when verifying CLS compliance.
934         (AbstractPropertyEventMethod): Set Parent here, ...
935         (PropertyMethod): ... not here.
936
937 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
938
939         * attribute.cs : escaped attribute name should not be allowed to be
940           resolved (e.g. @class as classAttribute). Fixed bug #75930.
941
942 2005-08-29  Raja R Harinath  <rharinath@novell.com>
943
944         Fix #75927.
945         * convert.cs (ImplicitStandardConversionExists): Allow zero also
946         when converting a long constant to unsigned long.
947         * expression.cs (Invocation.OverloadResolve): Add sanity check to
948         detect where IsApplicable and VerifyArgumentsCompat disagree.
949
950 2005-08-29  Raja R Harinath  <rharinath@novell.com>
951         and Carlos Alberto Cortez  <carlos@unixmexico.org>
952
953         Fix #75848.
954         * class.cs (TypeContainer.CanElideInitializer): New helper.
955         (TypeContainer.EmitFieldInitializers): Use it to determine if we
956         can safely emitting the initializer of a field.
957
958 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
959
960         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
961           allowed inside a switch (without loop). Fixed bug #75433.
962
963 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
964
965         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
966         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
967
968 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
969
970         * driver.cs : kinda reverting the default encoding changes (not exact 
971           revert since I noticed that "codepage:reset" might not work fine).
972
973 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
974
975         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
976           Location. Now getter and setter store location correctly.
977           (errors/cs0111-12.cs now reports the expected location.)
978
979 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
980
981         * driver.cs : Use default encoding on the environment.
982           Removed (now that) extra parameter for SeekableStreamReader.
983         * support.cs : (SeekableStreamReader) third .ctor() argument for
984           StreamReader is not required (always true). preamble size could
985           be acquired in simpler and safe way.
986
987 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
988
989         * cs-parser.jay: report CS0642 at warning level 3
990           and report CS0642 for an if else statement also
991           fixes bug #74745. Patch by John Luke (and a bit
992           modified by me).
993           Removed extra CS0642 warning check for "while",
994           "for" and "fixed".
995         * statement.cs: In Block.Resolve(), CS0642 check
996           is reimplemented to check a sequence of an empty
997           statement and a block.
998
999           Both fix bug #66777.
1000
1001 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1002
1003         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1004         detection until I fix it.
1005         
1006         * cs-tokenizer.cs: Changed error message.
1007         
1008         * cs-parser.jay: Fixed 2 error locations.
1009         
1010         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1011         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1012         properties.
1013         
1014         * enum.cs (GetSignatureForError): Fixed.
1015         
1016         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1017         method detection.
1018         
1019         * class.cs,
1020         * typemanager.cs (RegisterProperty): Removed.
1021         
1022         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1023
1024 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1025
1026         Fix #75874.
1027         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1028         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1029
1030 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1031
1032         * expression.cs : tiny fix is required for not warning positive ulong.
1033           See test-441.cs.
1034
1035 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1036
1037         * expression.cs : add CS0652 check for constant and integral
1038           expression. Fixed bug #53974.
1039
1040 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1041
1042         * expression.cs : in DoNumericPromotions(), check if there is implicit
1043           conversion overload for string (to check CS0034). Fixed bug #52492.
1044
1045 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1046
1047         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1048
1049 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1050
1051         * ecore.cs : report location when it is *not* Null.
1052
1053 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1054
1055         * codegen.cs,
1056           ecore.cs,
1057           flowanalysis.cs,
1058           expression.cs:
1059           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1060           correctly. Fixed bug #75721.
1061
1062 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1063
1064         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1065         loop that performs 'min (pos, char_count)'.
1066
1067         Fix #75862.
1068         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1069         converted value in Operator.OnesComplement.
1070
1071 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1072
1073         * anonymous.cs: If the anon method is pulled into a helper class,
1074         it needs to be `internal' not `private'. Fixes runtime behavior on
1075         msft. bug #75704
1076
1077 2005-08-20  Martin Baulig  <martin@ximian.com>
1078
1079         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1080         scope if we don't already have it.
1081
1082         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1083         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1084         fixes #75867.
1085
1086 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1087
1088         Fix #75803
1089         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1090         is a partial class.
1091
1092 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1093
1094         The big constants rewrite
1095         Fix #75746, #75685 and more
1096         As a side effect saved 1MB for MWF ;-)
1097         
1098         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1099         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1100         enum based for corlib compilation.
1101         
1102         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1103         subtractions.
1104         
1105         * class.cs (FixedField.Define): Use ResolveAsConstant.
1106         
1107         * const.cs (IConstant): Interface constants and enums.
1108         (Const.ResolveValue): New method for constant resolvning.
1109         (ExternalConstant): Constants from imported assemblies.
1110         
1111         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1112         conversion; like enums.
1113         (Constant.ToType): Converts this constant to different type.
1114         (Constant.Increment): Adds 1.
1115         
1116         * convert.cs (ImplicitConversionRequired): Simplified.
1117         
1118         * cs-parser.jay: Create EnumMember directly.
1119         
1120         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1121         
1122         * doc.cs (GenerateEnumDocComment): Removed.
1123         
1124         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1125         (ConvertIntLiteral): Removed.
1126         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1127         
1128         * enum.cs (EnumMember): Implement IConstant.
1129         (Enum.IsValidEnumConstant): Removed.
1130         (Enum.GetNextDefaultValue): Removed.
1131         (Enum.FindMembers): Updated.
1132         (Enum.GenerateDocComment): Iterate enum members.
1133         
1134         * expression.cs (Cast.TryReduce): Handle enums correctly.
1135         (New.Constantify): Made public.
1136         (MemberAccess.DoResolve): Removed contant specific if(s).
1137         
1138         * literal.cs (NullLiteral): Implement new abstract methods.
1139         
1140         * statement.cs (GotoCase.Resolve): Use new constant methods.
1141         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1142         
1143         * typemanager.cs (LookupEnum): Removed.
1144         (IsEnumType): Fixed to work with corlib.
1145         (RegisterConstant): Removed.
1146         (LookupConstant): Removed.
1147         (GetConstant): Changed to work with IConstant.
1148
1149 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1150
1151         * location.cs : Fixed overflown (>255) column number.
1152
1153 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1154
1155         First cut of the qualified-alias-member feature.
1156         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1157         token.
1158         * cs-parser.jay (DOUBLE_COLON): New token.
1159         (namespace_or_type_name): Add rule for recognizing
1160         qualified-alias-members.
1161         (primary_expression): Likewise.
1162         (element_access): Allow QualifiedAliasMember as a possible
1163         type-bearing expression.
1164         (local_variable_type, local_variable_pointer_type): Likewise.
1165         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1166         aliases in the current and enclosing namespace declarations.
1167         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1168         * decl.cs (MemberName.is_double_colon): New.
1169         (MemberName.MemberName): Add new constructor for alias-member.
1170         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1171         * expression.cs (QualifiedAliasMember): New expression type.
1172
1173 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1174
1175         * location.cs : it borked when no argument was specified.
1176
1177 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1178
1179         * location.cs : tiny ToString() format fix.
1180
1181 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1182
1183         * statement.cs : oops, it was missing.
1184
1185 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1186
1187         A set of fixes for precise line/column location.
1188
1189         * location.cs :
1190           "token" field now holds a file/line "delta", a line number offset 
1191           from the segment, and a column number. See also:
1192           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1193           December/009508.html
1194           Removed static IsNull. Use instance IsNull property instead.
1195         * cs-tokenizer.cs :
1196           For some tokens it stores Location. For Identifier it stores
1197           LocatedToken which is a pair of string name and location.
1198           Column numbers are adjusted only at getChar().
1199         * report.cs :
1200           Use Location.ToString() for reporting (it now contains column).
1201         * cs-parser.jay :
1202           Largely modified to use LocatedToken instead of
1203           string (IDENTIFIER), and to acquire Location from some tokens.
1204         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1205           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1206           codegen.cs :
1207           Now MemberName holds Location. DeclSpace.ctor() receives Location
1208           as a parameter. Removed extra parameters to all derived classes.
1209           Replaced Location.IsNull() with instance property.
1210         * assign.cs, expression.cs :
1211           Added .ctor() overload that omits Location.
1212         * attribute.cs :
1213           Added "nameEscaped" flag that indicates the identifier was escaped
1214           in the source file. This fixes bug #57047.
1215
1216 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1217
1218         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1219         New method, looking for lo-case imported cls type.
1220
1221         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1222         here.
1223
1224         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1225
1226         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1227
1228         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1229         all_imported_types.
1230         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1231
1232         Optimized to save 3.5 MB for SWF compilation.
1233
1234 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1235
1236         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1237         (PartialContainer.Create): Moved logic AddToContainer.
1238         (PartialContainer.MarkForDuplicationCheck): Shares name.
1239         
1240         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1241         place.
1242         
1243         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1244         initialization.
1245         (Namespace.GetSignatureForError): New method.
1246         
1247         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1248         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1249
1250 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1251
1252         Fix #75669.
1253         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1254         member lookup rather than qualifier_type, since qualifier_type can
1255         be null.
1256
1257 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1258
1259         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1260         enum member.
1261
1262 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1263
1264         * statement.cs: Copy the local exception into the exception
1265         captured local.  Fixes 75674
1266
1267 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1268
1269         Fix #75658.
1270         * expression.cs (Invocation.OverloadResolve): Don't report error
1271         CS1501 if error CS1502 has been reported.
1272         (New.DoResolve): Delegate CS1501 reporting to
1273         Invocation.OverloadResolve.
1274
1275         Fix #75656.
1276         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1277         invariant-meaning-in-block property in an enclosing block if
1278         necessary.
1279
1280 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1283         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1284         (Switch.CheckSwitch): Just save 50kb for SWF.
1285
1286 2005-07-27  Martin Baulig  <martin@ximian.com>
1287
1288         * anonymous.cs (CaptureContext.AddField): Added
1289         `AnonymousContainer am' argument; compute its toplevel scope if
1290         it's not already computed.  Fixes #75649.
1291
1292 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1293
1294         Fix #75628.
1295         * class.cs (Constructor.Emit): Reset block to null if the block
1296         resolve fails.
1297
1298 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1299
1300         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1301
1302 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1303
1304         * class.cs (MethodData.Define): Check whether accessor implementing
1305         interface is public.
1306
1307         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1308
1309 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1310
1311         Fix #57245
1312         * namespace.cs (LookupType): Moved same type check to...
1313         
1314         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1315         with the same name.
1316
1317 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1318
1319         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1320         already found a typebuilder.
1321         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1322         MemberNames, not strings.
1323
1324         * const.cs (Error_ExpressionMustBeConst): 
1325         Rename from Error_EpressionMustBeConst.
1326         * const.cs, class.cs, statement.cd: Update.
1327
1328 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1329
1330         Fix #65573
1331
1332         * const.cs (Const.LookupConstantValue): Report missing contant expression
1333         everytime.
1334         (Error_EpressionMustBeConstant): Only one error method.
1335
1336         * class.cs, statement.c: Updated.
1337
1338 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1339
1340         * statement.cs (Block.Flags): Add back HasVarargs.
1341         (Block.flags): Make protected.
1342         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1343
1344         * typemanager.cs (types, typecontainers, user_types): Remove.
1345         (UserTypes, TypeContainers): Likewise.
1346         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1347         (CleanUp, Reset): Update.
1348         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1349         (GetNestedType): Use Type.GetNestedType.
1350         (CoreLookupType): Take two arguments, the namespace and the
1351         basename of the type.  Update to use the Namespace.Lookup
1352         mechanism.
1353         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1354         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1355         string concatenation and substring matches.
1356         * class.cs, enum.cs, delegate.cs: Update to changes.
1357
1358 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1359
1360         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1361         Expression and made virtual.
1362
1363         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1364         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1365
1366         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1367
1368         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1369         error message.
1370
1371         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1372         change.
1373
1374 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1375
1376         Fix #57707
1377         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1378         AssemblyCultureAttribute is not used on executable.
1379
1380         * rootcontext.cs,
1381         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1382
1383 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1384
1385         Fix #60638.
1386         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1387         New.  Reports CS0252/CS0253.
1388         Mostly taken from preliminary patch by Duncak Mak.
1389         (Binary.DoResolveOperator): Store results of operator lookup.
1390         Use them to detect if we need to warn about unintended reference
1391         comparisons.
1392
1393 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1394
1395         Fix #72969.
1396         * namespace.cs (Namespace.Lookup): Add back location parameter.
1397         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1398         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1399
1400         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1401         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1402         (Namespace.LookupType): ... this.
1403         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1404         of namespaces.
1405         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1406         purported to handle pointers.
1407         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1408         CoreLookupType.
1409
1410 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1411
1412         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1413         type as namespace.
1414
1415 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1416
1417         * namespace.cs (Namespace.Lookup): Drop location parameter.
1418         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1419         (NamespaceEntry.Lookup): ... this.
1420         (NamespaceEntry.Error_AmbiguousTypeReference):
1421         Move here from DeclSpace.
1422         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1423         names ...
1424         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1425         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1426         Move to NamespaceEntry.
1427         * delegate.cs, expression.cs: Update to changes.
1428
1429 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1432         CheckAttributeType and refactored.
1433         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1434         ResolveAsTypeTerminal error handling.
1435         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1436         handling.
1437         (GetSignatureForError): Print errors in same way.
1438
1439         * class.cs,
1440         * codegen.cs: Reflect attribute GetSignatureForError change.
1441
1442         * ecore.cs,
1443         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1444
1445         * namespace.cs (UsingEntry): Refactored to make fields private.
1446
1447         * assign.cs,
1448         statement.cs: Error_UnexpectedKind has extra parameter.
1449
1450 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1451
1452         * ecore.cs (IAlias): Remove.
1453         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1454         that implement the interface.
1455         * namespace.cs (Namespace): Likewise.
1456         (Namespace.declspaces): Renamed from 'defined_names'.
1457         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1458         DeclSpace instead of an IAlias.
1459         * tree.cs (Tree.AddDecl): Update.
1460
1461 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1462
1463         * statement.cs (Block.Flags); Remove HasVarargs.
1464         (Block.HasVarargs): Move to ToplevelBlock.
1465         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1466         (Block.Variables): Make protected.  Initialize variable hashtable
1467         if necessary.
1468         (Block.AddVariable): Update.
1469         (Block.Resolve): Update to changes.
1470         (ToplevelBlock.HasVarargs): New boolean.
1471         (ToplevelBlock.ThisVariable): Move here from Block.
1472         (ToplevelBlock.AddThisVariable): Likewise.
1473         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1474         * expression.cs (This.ResolveBase): Update to changes.
1475         (ArglistAccess.DoResolve): Likewise.
1476
1477 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1478
1479         Fix #75321
1480         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1481
1482         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1483         not used and not used & assigned.
1484         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1485
1486 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1487
1488         Fix #75053
1489         * expression.cs (Is.DoResolve): null is never provided type.
1490
1491 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1492
1493         Fix #52496
1494         * cs-parser.jay: Less strict event error rule to catch more errors.
1495
1496 2005-07-08  Martin Baulig  <martin@ximian.com>
1497
1498         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1499         gettter (allowed) or setter (not allowed).
1500
1501         * class.cs (Accessor): Implement IIteratorContainer.
1502         (Accessor.Yields): New public field.
1503         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1504         per-accessor basis.
1505
1506         * cs-parser.jay
1507         (get_accessor_declaration, set_accessor_declaration): Set the
1508         `yields' flag on the accessor, not the property.
1509         (property_declaration): Do the iterators check on a per-accessor
1510         basis and not for the whole property.
1511
1512 2005-07-08  Martin Baulig  <martin@ximian.com>
1513
1514         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1515         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1516
1517 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1518
1519         Fix #74975
1520         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1521         (ExtractSecurityPermissionSet): Cope with self referencing security
1522         attributes properly.
1523
1524         * driver.cs (SetOutputFile): Made public property OutputFile.
1525
1526 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1527
1528         Fix #75486.
1529         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1530         has_nonstatic_fields.  Make into a FieldBase pointer.
1531         (TypeContainer.AddField): Add CS0282 check.
1532         (TypeContainer.EmitType): Update.
1533
1534 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1535
1536         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1537         compare if they start with __.
1538
1539 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1540
1541         * statement.cs (Switch.SwitchGoverningType): Only look at
1542         UserCasts that don't need implicit standard conversions to one of
1543         the allowed switch types (Fixes test-322.cs).
1544         (LocalInfo.Resolve): Re-enable sanity-test.
1545
1546 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1547
1548         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1549         
1550         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1551         
1552         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1553
1554 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1555
1556         Fix #75472.
1557         * ecore.cs (SimpleName.GetSignatureForError): Add.
1558         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1559         (MemberAccess.GetSignatureForError): Add.
1560
1561 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1562  
1563         The big error and warning messages review.
1564         
1565         * anonymous.cs,
1566         * assign.cs,
1567         * attribute.cs,
1568         * class.cs,
1569         * codegen.cs,
1570         * convert.cs,
1571         * cs-parser.jay,
1572         * cs-tokenizer.cs,
1573         * decl.cs,
1574         * delegate.cs,
1575         * doc.cs,
1576         * driver.cs,
1577         * ecore.cs,
1578         * enum.cs,
1579         * expression.cs,
1580         * flowanalysis.cs,
1581         * iterators.cs,
1582         * literal.cs,
1583         * location.cs,
1584         * modifiers.cs,
1585         * namespace.cs,
1586         * parameter.cs,
1587         * pending.cs,
1588         * report.cs,
1589         * rootcontext.cs,
1590         * statement.cs,
1591         * support.cs,
1592         * tree.cs,
1593         * typemanager.cs: Updated.
1594         
1595         * class.cs: (MethodCore.SetYields): Moved here to share.
1596         (PropertyMethod.Define): Moved iterator setup here.
1597         
1598         * iterators.cs: Add orig_method to have full access to parent
1599         container.
1600
1601 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1602
1603         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1604         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1605         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1606         variable of struct type.
1607         * expression.cs (Unary.ResolveOperator): Update to change.
1608         (Indirection.VerifyFixed): Likewise.
1609         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1610         (ParameterReference.VerifyFixed): Value parameters are fixed.
1611         (This.VerifyFixed): Treat 'this' as a value parameter.
1612         * statement.cs (LocalInfo.IsFixed): Remove.
1613
1614 2005-07-01  Martin Baulig  <martin@ximian.com>
1615
1616         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1617         `ec.EmitThis ()' to get the correct scope.
1618
1619 2005-07-01  Martin Baulig  <martin@ximian.com>
1620
1621         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1622         instance is a ParameterReference; fixes #75299.
1623
1624 2005-07-01  Martin Baulig  <martin@ximian.com>
1625
1626         Reverted Marek's latest patch (r46725):
1627         - it contains structural changes which are neither mentioned in
1628           the ChangeLog nor explained anywhere; for example the additional
1629           argument of EmitContext's and Iterator's .ctor's and the
1630           TypeContainer.DefineMembers() change.
1631         - structural changes like this should go in in seperate patches
1632           and not be hidden in a huge patch which just seems to affect
1633           warnings and errors.
1634           a big and hard to understand patch.
1635         - it breaks iterators and causes regressions, for instance in
1636           test-iter-03.cs.      
1637
1638 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1639
1640         Fix #75412.
1641         * expression.cs (Indexers.map): Remove.
1642         (Indexers.Append): Filter out inaccessible setters and getters.
1643         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1644
1645         Fix #75283.
1646         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1647         Refactored from ...
1648         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1649         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1650         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1651         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1652
1653 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1654
1655         Fix #75322
1656         * class.cs (FieldBase.GetInitializerExpression): One more field
1657         for backup.
1658
1659 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1660
1661         * pending.cs: Do not define a proxy if the base method is virtual,
1662         it will be picked up by the runtime (bug 75270).
1663
1664 2005-06-08  Martin Baulig  <martin@ximian.com>
1665
1666         The big Iterators rewrite :-)
1667
1668         * iterators.cs: Rewrite this to use the anonymous methods framework.
1669
1670         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1671         before the TypeContainers; see 2test-21.cs.
1672
1673         * class.cs
1674         (TypeContainer.DefineType): Don't create a new EmitContext if we
1675         already have one (this only happens if we're an Iterator).
1676         (TypeContainer.Define): Also call Define() on all our iterators.
1677         (Method.CreateEmitContext): Added support for iterators.
1678
1679         * anonymous.cs
1680         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1681         (AnonymousContainer.CreateMethodHost): Moved here from
1682         AnonymousMethod and made abstract.
1683         (AnonymousContainer.CreateScopeType): New abstract method.
1684         (AnonymousContainer.IsIterator): New public property.
1685         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1686         get the ScopeTypeBuilder rather than manually defining it here. 
1687         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1688         iterators here.
1689
1690         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1691         before RootContext.DefineTypes().
1692
1693         * codegen.cs (EmitContext.RemapToProxy): Removed.
1694         (EmitContext.CurrentAnonymousMethod): Changed type from
1695         AnonymousMethod -> AnonymousContainer.
1696         (EmitContext.ResolveTopBlock): Protect from being called twice.
1697         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1698         (EmitContext.EmitThis): Removed the iterators hacks; use the
1699         anonymous methods framework for that.
1700
1701         * statement.cs
1702         (ToplevelBlock.Container): Make this a property, not a field.
1703         (ToplevelBlock.ReParent): New public method; move the
1704         ToplevelBlock into a new container.
1705         (Foreach.TemporaryVariable): Simplify.
1706
1707 2005-06-05  Martin Baulig  <martin@ximian.com>
1708
1709         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1710         (Block.AddTemporaryVariable): New public method; creates a new
1711         `LocalInfo' for a temporary variable.
1712         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1713         variables here.
1714         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1715         non-iterator variables.
1716
1717 2005-06-05  Martin Baulig  <martin@ximian.com>
1718
1719         * statement.cs (Foreach.TemporaryVariable): Create the
1720         LocalBuilder in the Emit phase and not in Resolve since in some
1721         situations, we don't have an ILGenerator during Resolve; see
1722         2test-19.cs for an example.
1723
1724 2005-06-04  Martin Baulig  <martin@ximian.com>
1725
1726         **** Merged r45395 from GCS ****
1727
1728         The big Foreach rewrite - Part II.
1729
1730         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1731         with `PropertyInfo ienumerator_getcurrent'.
1732
1733         * codegen.cs (VariableStorage): Removed.
1734
1735         * statement.cs
1736         (Foreach): Derive from Statement, not ExceptionStatement.
1737         (Foreach.CollectionForeach): New nested class.  Moved all the code
1738         dealing with collection foreach here.
1739         (Foreach.ForeachHelperMethods): Removed.
1740         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1741
1742 2005-05-23  Martin Baulig  <martin@ximian.com>
1743
1744         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1745         don't need to.  Fix #75014.
1746
1747 2005-05-20  Martin Baulig  <martin@ximian.com>
1748
1749         Merged r44808 from GMCS.
1750
1751         * class.cs (TypeContainer.CircularDepException): Removed.
1752         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1753         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1754         (CS0146) and interface (CS0529) dependencies here.
1755
1756 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1757
1758         * expression.cs (Invocation.EmitCall): Fix initialization
1759         'this_call' to reflect current behaviour.  Fix indentation.
1760
1761         * convert.cs (FindMostEncompassedType): Add two trivial special
1762         cases (number_of_types == 0 || number_of_types == 1).
1763         (FindMostEncompasingType): Likewise.
1764
1765 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1766
1767         Some cleanups preparing for the fix of #75283.
1768         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1769         error testing.
1770         (EventExpr.InstanceResolve): Likewise.
1771         (EventExpr.DoResolve): Remove redundant checks.
1772
1773 2005-06-10  Duncan Mak  <duncan@novell.com>
1774
1775         * cs-tokenizer.cs (process_directives): New flag for controlling
1776         the processing of preprocessor directives.
1777         (x_token): After seeing a '#', return Token.NONE instead of going
1778         to handle_preprocessing_directive() when not processing
1779         directives. This avoids unnecessary processing during the token peek in
1780         is_punct().
1781
1782         This fixes #74939.
1783
1784         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1785         the existing error reporting methods instead of Report.Error.
1786
1787         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1788         after Raja's rewrite.
1789
1790 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1791
1792         * class.cs: Small fix.
1793
1794 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1795
1796         Fix #75160.
1797         * class.cs (GetPartialBases): Fix return value check of
1798         part.GetClassBases.
1799
1800 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1801
1802         Ensure that partial classes are registered in their enclosing
1803         namespace.  Initial part of fix of #75160.
1804         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1805         Register declspace with namespace here, not in
1806         DeclSpace.RecordDecl.
1807         * cs-parser.jay: Pass namespace to RecordDecl.
1808         * class.cs (PartialContainer.Create): Likewise.
1809         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1810         called.
1811         * decl.cs (Declspace.RecordDecl): Remove.
1812         * namespace.cs (NamespaceEntry.DefineName): Remove.
1813
1814 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1815
1816         * rootcontext.cs: Reset TargetExt as well.
1817
1818 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1819
1820         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1821         -langversion:ISO-1.
1822
1823 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1824
1825         Fix #75080, cs0119.cs.
1826         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1827         of ...
1828         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1829         allowing ExprClass.Type and ExprClass.Namespace for
1830         ResolveFlags.VariableOrValue.
1831         (Expression.Resolve) [1-argument variant]: Change default resolve
1832         flags based on language version.
1833         (Expression.Error_UnexpectedKind): Use a simple string array
1834         rather than an ArrayList.
1835         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1836         not ExprClass.Type.
1837         (TypeOfVoid.DoResolve): Likewise.
1838         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1839         flags argument -- it always has the same value.
1840
1841 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1842
1843         Fix #75081.
1844         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1845         Use it in the error message.
1846         * assign.cs, expression.cs, statement.cs: Update.
1847
1848 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1849
1850         Fix #75088.
1851         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1852         the "almostMatchedMember" case too.
1853         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1854         that failed the accessibility checks to 'almost_match'.
1855
1856 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1857
1858         * attribute.cs: Use internal MethodBuilder methods to set
1859         ExactSpelling and SetLastError on PInvoke methods, instead
1860         of passing them via charset.  Fixes #75060.
1861
1862 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1863
1864         * parameter.cs (Parameter): Remove TODO comment.
1865         (Parameter.DefineParameter): Remove Location parameter.
1866         (Parameters.LabelParameters): Likewise.
1867         * class.cs (Constructor.Emit): Update to change.
1868         (MethodData.Emit): Likewise.
1869         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1870         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1871
1872 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1873
1874         * parameter.cs,
1875           Removed Parameters.Location and added Parameter.Location instead.
1876           Removed Location parameter from Emit() and GetSignature().
1877         * anonymous.cs,
1878           class.cs,
1879           cs-parser.jay,
1880           delegate.cs,
1881           iterators.cs,
1882           statement.cs :
1883           Modified all related calls.
1884
1885 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1886
1887         Improve user-defined conversion handling.
1888         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1889         applicable operators.
1890         (AddConversionOperators): New.  Helper for GetConversionOperators.
1891         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1892         there is only one most encompassed/encompassing type.
1893         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1894         "applicable operator" handling.
1895         (UserConversion): Move cache here from GetConversionOperators.
1896         Directly cache the chosen operator, rather than the whole
1897         MethodGroup.
1898         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1899         case.  Allow conversion of decimal to sbyte and byte too.
1900         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1901         New static methods.  Used to avoid allocating EmptyExpressions in
1902         convert.cs.
1903
1904 2005-05-24  Duncan Mak  <duncan@novell.com>
1905
1906         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1907         another class, used in Convert.ExplicitNumericConversion.
1908         (CastToDecimal): New class, similar to above, but casts to
1909         System.Decimal, used in Convert.ImplicitNumericConversion and also
1910         in explicit convesion from double/float to decimal.
1911
1912         * convert.cs (ImplicitNumericConversion): Handle implicit
1913         conversions to System.Decimal.
1914         (ExplicitNumericConversion): handle explicit conversions to
1915         System.Decimal.
1916
1917         This fixes #68711.
1918         
1919 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1920
1921         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1922         know the type at this stage, just break through.   Fixes #75008 
1923
1924 2005-05-19  Martin Baulig  <martin@ximian.com>
1925
1926         * delegate.cs
1927         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1928         to disable error reporting.
1929
1930         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1931         here since we don't want to report an error; see the new test-336.cs.
1932
1933 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1934
1935         * statement.cs (ToplevelBlock.GetParameterReference)
1936         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1937         Move here from class Block.
1938         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1939         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1940
1941 2005-05-18  Martin Baulig  <martin@ximian.com>
1942
1943         Fix #74978.
1944
1945         * flowanalysis.cs
1946         (FlowBranching.Reachability): Add non-static public And() and Or()
1947         methods.
1948         (FlowBranchingSwitch): New class; do the `break_origins' thing
1949         like in FlowBranchingLoop.
1950         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1951         reachability, not just locals and parameters.
1952         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1953         switch; MergeBreakOrigins() now takes care of that.
1954
1955 2005-05-18  Martin Baulig  <martin@ximian.com>
1956
1957         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1958         a loop and may leave it, reset the barrier; fixes #74974.
1959
1960 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1961         
1962         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1963         is back.
1964         
1965         * cs-parser.jay: Catch more lexical errors.
1966         
1967         * report.cs: Add one more Error method.
1968         
1969         * rootcontext.cs,
1970         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1971
1972 2005-05-17  Martin Baulig  <martin@ximian.com>
1973
1974         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1975         #70970. 
1976
1977 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1978
1979         Fix test-382.cs.  Emit values of decimal constants.
1980         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1981         Carved out of ...
1982         (TypeContainer.AddField): ... this.
1983         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1984         with initializers to include 'Const's.
1985         (ClassPart.RegisterFieldForInitialization): Forward to
1986         PartialContainer.
1987         * const.cs (Const.Const): Pass initializer to base class.
1988         (Const.Define): In case of decimal constants, register them for
1989         initialization in a static constructor.
1990
1991 2005-05-14  Martin Baulig  <martin@ximian.com>
1992
1993         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1994         do not call ResolveUnreachable() on unreachable statements in
1995         here, see the comment in the source code.
1996
1997 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1998
1999         Fix #74934.
2000         * expression.cs (BinaryResolveOperator): If one of the operands of
2001         an equality comparison is 'null' and the other is a pointer type,
2002         convert the null to a NullPointer.
2003         * convert.cs (ImplicitReferenceConversion): If the expression is a
2004         NullLiteral and the target type is a pointer type, return a
2005         NullPointer instead.
2006         (ImplicitConversionStandard): Likewise.
2007
2008 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
2009         
2010         * cs-parser.jay: Set readonly context based on special constructs.
2011         
2012         * expression.cs (LocalVariableReference.DoResolveBase): Improved
2013         readonly variable error handling.
2014         
2015         * rootcontext.cs (EmitCode): Don't verify members when error
2016         occurred.
2017         
2018         * statement.cs (LocalInfo): Add reaodnly context information.
2019         (SetReadOnlyContext, GetReadOnlyContext): New methods.
2020
2021 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2022
2023         * statement.cs (Block.Resolve): Revert change below.  Modify fix
2024         for #74041 to initialize 'resolved' to false only for explicit
2025         blocks.  Fixes #74873.
2026
2027 2005-05-12  Raja R Harinath  <harinath@gmail.com>
2028
2029         Fix #74920.
2030         * typemanager.cs (unmanaged_enclosing_types): New.
2031         (IsUnmanagedType): Avoid infloops by using
2032         'unmanaged_enclosing_types' to talk with recursive invocations.
2033
2034 2005-05-13  Martin Baulig  <martin@ximian.com>
2035
2036         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2037         instance variable, not a local.  Fix #74873.
2038         (Block.ResolveUnreachable): Set it to true here.
2039
2040 2005-05-11  Duncan Mak  <duncan@novell.com>
2041
2042         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2043         continuing to process for 'arg'.
2044         (handle_preprocessing_directive): Check the argument of the #endif
2045         directive and report error CS1025 if there are any trailing
2046         characters.
2047
2048         According to the C# spec, having even whitespace after the #endif
2049         directive is illegal; however, because we call arg.TrimEnd ()
2050         beforehand, we have the same behavior as csc, allowing whitespace
2051         after the directive.
2052
2053         Fixes #74892.
2054
2055 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
2056
2057         Fix #74863.
2058         
2059         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2060         (Constructor.GetObsoleteAttribute): Implemented correctly.
2061
2062 2005-05-10  Martin Baulig  <martin@ximian.com>
2063
2064         * support.cs (ReflectionParameters.ParameterModifier): Use
2065         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2066         and `ParameterAttributes.In'.  Fixes #74884.
2067
2068 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
2069
2070         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2071         
2072         * expression.cs (Argument.GetParameterModifier): Turned to property.
2073         (Invocation.Error_InvalidArguments): Add more descriptive errors.
2074         
2075         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2076         its C# equivalent.
2077         
2078 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2079
2080         Fix #74852.
2081         * decl.cs (MemberCache.AddMethods): Register override methods,
2082         rather than non-override methods.
2083         * typemanager.cs (RegisterOverride): New.
2084         (IsOverride): Update.
2085
2086 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2087
2088         Fix #73105.
2089         
2090         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2091         recursive declaration.
2092         
2093         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2094         
2095 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2096
2097         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2098         
2099         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2100
2101 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2102
2103         Fix #74797.
2104         * decl.cs (DeclSpace.FamilyAccessible): 
2105         Use TypeManager.IsNestedFamilyAccessible.
2106
2107         Fix reopened #64812.
2108         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2109         internal'.
2110
2111 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2112             Abin Thomas  <projectmonokochi@rediffmail.com>
2113             Anoob V E  <projectmonokochi@rediffmail.com>
2114             Harilal P R  <projectmonokochi@rediffmail.com>
2115
2116         Fix #64812.
2117         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2118         allow access to all static members.
2119
2120 2005-05-04  Martin Baulig  <martin@ximian.com>
2121
2122         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2123
2124 2005-05-04  Martin Baulig  <martin@ximian.com>
2125
2126         Fix #74655.
2127
2128         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2129         section at the end; make things work if `default' is not the last
2130         section.        
2131
2132 2005-05-04  Martin Baulig  <martin@ximian.com>
2133
2134         Fix #70400.
2135
2136         * statement.cs (Switch): Replaced the `got_default' field with a
2137         `default_section' one.
2138         (Switch.CheckSwitch): Set `default_section' here.
2139         (Switch.Resolve): If we're a constant switch and the constant is
2140         not found, use the default section.
2141
2142 2005-05-03  Martin Baulig  <martin@ximian.com>
2143
2144         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2145
2146         * statement.cs (Foreach.ArrayForeach): New nested class.
2147         (Foreach.TemporaryVariable): New nested class.
2148         (Foreach.EmitArrayForeach): Removed; this is now in the new
2149         ArrayForeach class.
2150
2151 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2152
2153         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2154         more conservative.
2155         (VerifyPendingMethods): Revert change below.
2156
2157         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2158         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2159         that used to trigger warning -28.  Remove warning -28.
2160         * expression.cs (Invocation.OverloadResolve): Use
2161         TypeManager.IsOverride to distinguish override methods.
2162
2163         Fix #74773.
2164         * pending.cs (VerifyPendingMethods): If a base type implements the
2165         requested interface, don't bother checking individual methods of
2166         the base type.  As a side-effect, this prevents the creation of
2167         unnecessary proxies.
2168
2169 2005-05-02  Martin Baulig  <martin@ximian.com>
2170
2171         Fix #70182.
2172
2173         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2174         Also `And' the locals if the old vector is null.
2175         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2176         null; in this case we basically reset all the variables.        
2177
2178 2005-05-02  Martin Baulig  <martin@ximian.com>
2179
2180         Fix #74529.
2181
2182         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2183         Added `FlowBranching branching' argument; always `and' the
2184         variables instead of `or'ing them unless we're an infinite loop.
2185
2186         * statement.cs (While.Resolve): Create a new sibling unless we're
2187         infinite.       
2188
2189 2005-05-02  Martin Baulig  <martin@ximian.com>
2190
2191         Fix #70140.
2192
2193         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2194         arguments; use it instead of creating a new TopLevelBlock.
2195         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2196         our ConstructorInitializer.
2197
2198         * statement.cs
2199         (TopLevelBlock.TopLevelBranching): New public property.
2200         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2201         and create our `TopLevelBranching'.
2202
2203         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2204         anonymous method host, use `block.TopLevelBranching' rather than
2205         creating a new branching.
2206
2207 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2208
2209         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2210         a ScopeInfo, if any of the current children is a child of the new
2211         entry, move those children there.
2212
2213 2005-04-30  Martin Baulig  <martin@ximian.com>
2214
2215         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2216         at the beginning of a SwitchSection.  Fix #73335.
2217
2218 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2219
2220         Fix #74378
2221         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2222         
2223         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2224         (FieldExpr.DoResolve): Obsolete members are ignored for field
2225         initializers.
2226         
2227 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2228
2229         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2230         of arrays detection.
2231
2232         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2233         verification.
2234         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2235
2236         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2237         arrays report.
2238
2239 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2240
2241         * cs-parser.jay: Use the prefered version of -unsafe in error
2242         message.
2243
2244 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2245
2246         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2247         circumstances.
2248
2249 2005-04-20  John Luke  <john.luke@gmail.com>
2250
2251         * driver.cs: fix typo in error message, --outout to --output
2252
2253 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2254
2255         * codegen.cs (InRefOutArgumentResolving): New field.
2256         
2257         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2258         fields outside contructor.
2259         
2260         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2261         
2262 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2263
2264         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2265         parameter code was not completed ever, so it was not as up-to-date
2266         as local variables.  Must finish it.
2267
2268         The bug fix was to compare the Toplevel of the block, not the
2269         current block.  Thanks for Ben for pointing this out. 
2270
2271 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2272
2273         * decl.cs (AddMethods): Use the declaring type of the problem
2274         method to determine if we want to squash a warning.
2275
2276 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2277
2278         * attribute.cs: Removed debug output.
2279
2280         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2281         
2282         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2283         Report.Stderr.
2284         
2285 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2286
2287         Fix #74481.
2288         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2289         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2290         all null comparisons against reference types.
2291
2292 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2293
2294         Fix# 74565
2295         * class.cs (TypeContainer.CircularDepException) New nested
2296         exception class.
2297         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2298         (TypeContainer.DefineType): Removed error, reset InTransit before
2299         exit.
2300         (Class.DefineType): Throw exception when is in Transit.
2301         Catch exception and report error.
2302         (Struct.DefineType): Throw exception when is in Transit.
2303         Catch exception and report error.
2304         (Interface.DefineType): Throw exception when is in Transit.
2305         Catch exception and report error.
2306
2307         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2308         handle nested exception handlers.
2309
2310         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2311         a catch.
2312
2313         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2314         InFinally and InCatch storage.
2315
2316         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2317         (Catch.Resolve): Set and Restore ec.InCatch.
2318         (Try.Resolve): Set and Restore ec.InFinally.
2319         (Try.HasCatch): True when try has catch.
2320
2321 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2322
2323         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2324           for the same event member, so exclude such cases from warning 419.
2325           Fixed bug #74633.
2326
2327 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2328
2329         * expression.cs (Binary.ResolveOperator): Apply patch from John
2330         Luke to fix bug 59864: operators &, | and ^ on enumerations
2331         require that the same enum type on both sides.
2332
2333         * driver.cs: Add warnings to old flag usage, this is to assist
2334         people who produce Makefiles and hope that the Makefiles will be
2335         used on Windows.
2336
2337         * class.cs (TypeContainer.EmitType): Moved the definition of the
2338         special $PRIVATE$ field from the resolve phase to the Emit phase.
2339         During resolve we do not know if we are a struct with
2340         HasExplicitLayout, we know this only after the attributes for the
2341         type are emitted.
2342
2343         Set the FieldOffset to zero on the dummy field that we create for
2344         the class.   Fixes 74590.
2345
2346 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2347
2348         Fix #73834.
2349         * ecore.cs (PropertyExpr.resolved): New.
2350         (DoResolve): Use it to handle a case of double resolution here.
2351         Handle a case of identical-name-and-type-name.
2352         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2353         resolution by storing the results of expression resolution back
2354         into the "probes" array.
2355
2356 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2357
2358         Fix cs0208-7.cs and cs0208-8.cs.
2359         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2360         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2361         error reporting to point out the reason a struct is not unmanaged.
2362
2363 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2364
2365         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2366           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2367
2368 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2369
2370         Fix #74528.
2371         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2372         IdenticalNameAndTypeName here.
2373         (EventExpr.InstanceResolve): Likewise.
2374
2375 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2376
2377         C# 2.0 DefaultCharSetAttribute implementation
2378         
2379         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2380         which allows us to set GlobalNamespace for every resolve.
2381         (Attribute.ResolveArguments): Cut from Resolve.
2382         (Attribute.GetCharSetValue): Returns CharSet named argument.
2383         (Attribute.DefinePInvokeMethod): Gets default charset from
2384         module settings.
2385         (GlobalAttribute.ResolveAsTypeStep): Override.
2386         (GlobalAttribute.ResolveArguments): Override.
2387         
2388         * class.cs (TypeAttr): Is protected.
2389         
2390         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2391         (ModuleClass.DefaultCharSetType): New memeber.
2392         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2393         
2394         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2395         charset from module.
2396         
2397         * delegate.cs (TypeAttr): Override.
2398         (Delegate.DefineType): Use this TypeAttr.
2399         
2400         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2401         at very early stage (before types are defined) to resolve model
2402         module attributes. It will probably not work with corlib but it
2403         should be ok.
2404         
2405         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2406         charset from module.
2407         
2408         * typemanager.cs (default_charset_type): New type.
2409
2410 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2411
2412         * decl.cs (MemberCache.AddMethods): Don't warn if
2413         System.Object.Finalize has buggy MethodAttributes.
2414
2415         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2416         removed below.
2417
2418 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2419
2420         * doc.cs : detect ambiguous reference to overloaded members.
2421           Fixed bug #71603. MS 1.1 csc does not detect it.
2422
2423 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2424
2425         * doc.cs : delegates must not be referenced with parameters.
2426           Fixed bug #71605.
2427
2428 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2429
2430         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2431
2432 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2433
2434         * driver.cs (MainDriver): Stop processing if the CLS stage found
2435         errors. 
2436
2437         (CompilerCallableEntryPoint.InvokeCompiler): Always
2438         reset after execution;   Take a TextWriter argument for the
2439         output.
2440
2441         * report.cs: Use the error stream instead of hardcoding stderr. 
2442
2443 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2444
2445         * class.cs: Reduce code paths to test, too small of an
2446         optimization to make it worth the extra testing.  Always perform
2447         it. 
2448
2449 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2450
2451         Fix #74510.
2452         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2453         operators that had errors reported on them.
2454
2455 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2456
2457         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2458         argument types.
2459         (Attribute.Resolve): Add named argument type checking.
2460         
2461         * class.cs (FixedField.Define): Use IsPrimitiveType
2462         
2463         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2464         
2465         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2466         unsafe parameter types.
2467         
2468         * statement.cs (Using.ResolveExpression): Add better error description.
2469         
2470         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2471         
2472 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2473
2474         Fix #74484.
2475         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2476         AttributeUsageAttribute in the emitcontext of the attribute class,
2477         not in the emitcontext of the attributable entity it was attached to.
2478         * cs-parser.jay: Use 'current_class', not 'current_container',
2479         when creating a GlobalAttribute.
2480
2481 2005-04-08  Alp Toker  <alp@atoker.com>
2482
2483         * pending.cs: The fix to #58413 failed to compile methods implementing
2484         interfaces with/without params modifiers and vice versa, even though
2485         params modifiers aren't part of the signature. Make the modifier check
2486         less strict as in csc.
2487
2488 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2489             Anoob V E  <projectmonokochi@rediffmail.com>
2490             Harilal P R  <projectmonokochi@rediffmail.com>
2491
2492         Fix #58413.
2493         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2494         modifiers of pending methods.
2495         (PendingImplementation.PendingImplementation): Initialize it.
2496         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2497         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2498         with ParameterData.  Add check for modifiers.
2499         * class.cs (MethodData.Define): Update to changes.
2500
2501 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2502
2503         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2504
2505 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2506
2507         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2508         property.
2509         
2510         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2511         
2512         * rootcontext.cs,
2513         * typemanager.cs: Registered RequiredAttributeAttribute.
2514         
2515 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2516
2517         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2518         Warning CS0169 is back at level 3.
2519         (IMethodData.SetMemberIsUsed): New method.
2520         
2521         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2522         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2523         
2524         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2525
2526         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2527         contants.
2528         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2529         is used.
2530         
2531         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2532         is used.
2533         
2534         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2535         to avoid the problems with nested types.
2536
2537 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2538             Anoob V.E  <projectmonokochi@rediffmail.com>
2539             Harilal P.R  <projectmonokochi@rediffmail.com>
2540             Raja R Harinath  <rharinath@novell.com>
2541
2542         Fix #73820.
2543         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2544         attribute.
2545         * typemanager (GetConstructor): Make public.
2546
2547 2005-04-05  John Luke  <john.luke@gmail.com>
2548             Raja R Harinath  <rharinath@novell.com>
2549
2550         Fix #62232.
2551         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2552         struct too.  Return false quicker in a few cases.
2553         (VerifyUnManaged): Use it.
2554
2555 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2556
2557         Fix #74041.
2558         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2559         not 'unreachable_seen'.
2560
2561 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2562
2563         * attribute.cs (Attribute.GetValue): Removed unused.
2564         
2565         * codegen.cs (CodeGen.TrimExt): Removed unused.
2566         
2567         * cs-parser.jay (output): Removed unused.
2568         
2569         * cs-tokenizer.cs (hex_digits): Removed unused.
2570         
2571         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2572         
2573         * expression.cs (Indirection.LoadExprValue): Removed unused.
2574         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2575         
2576         * iterators.cs (Iterator.param_types): Removed unused.
2577         
2578         * statement.cs (Goto.block): Removed unused.
2579         (ToplevelBlock.did): Removed unused.
2580         (Switch.ResolveConstantSwitch): Removed unused.
2581
2582 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2583
2584         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2585         resetting thingy.
2586
2587 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2588
2589         Fix #74232 and cs0208-3.cs.
2590         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2591         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2592         unmanaged type.  Don't use FieldBuilders when 't' is a
2593         TypeBuilder.  Use ModFlags and MemberType fields.
2594         * class.cs (MemberBase.member_type): Rename from MemberType.
2595         (MemberBase.MemberType): New property.  Determines member_type on
2596         demand.
2597         (MemberBase.DoDefine): Don't initialize MemberType here.
2598         (FieldMember.Define): Likewise.
2599
2600 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2601
2602         Fix #74241
2603         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2604         Attributes are emitted there.
2605         
2606 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2607
2608         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2609         keyword in 'partial enum' too.
2610         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2611         is not allowed).
2612         Report from Kamil Skalski <nazgul@omega.pl>.
2613
2614         Fix #74309.
2615         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2616         have partial containers too.
2617
2618         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2619         in block' checks to Block.CheckInvariantMeaningInBlock.
2620         * statement.cs (Block.GetKnownVariableInfo): Make private.
2621         (Block.IsVariableUsedInChildBlock): Remove.
2622         (Block.IsVariableUsedInBlock): Likewise.
2623         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2624         conflicting declaration.
2625         (Block.AddVariable): Make error messages less long-winded and more
2626         specific.  Show location of conflicting declaration.
2627         * parameter.cs (Parameters.Location): New readonly property.
2628
2629 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2630
2631         Clean up semantics of invoking ResolveMemberAccess.
2632         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2633         can have an instance, ensure that we pass in a non-TypeExpression
2634         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2635         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2636         argument.  Update to changes and simplify.
2637         (FieldExpr.Emitinstance): Remove CS0120 check.
2638         (PropertyExpr.EmitInstance): Likewise.
2639         * expression.cs (Argument.Resolve): Likewise.
2640         (Invocation.DoResolve): Update to changes in semantics of
2641         InstanceExpression.
2642
2643 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2644
2645         Fix #74241
2646         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2647         customization.
2648         
2649         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2650
2651 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2652
2653         Fix difference in behaviour with commandline invocation.
2654         * driver.cs (Driver.Reset): New.
2655         (CompilerCallableEntryPoint): Call it.
2656
2657         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2658         variable" warnings if the boolean expression failed to resolve.
2659
2660 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2661
2662         * attribute.cs: Fix the union of several permissions when some of them
2663         are unrestricted (so the result isn't an unrestricted permission set).
2664         Fix #74036.
2665
2666 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2667
2668         * ecore.cs (MemberExpr): New class.  Convert from interface
2669         IMemberExpr.
2670         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2671         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2672         error checks.
2673         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2674         (MethodGroupExpr.IsExplicitImpl): Remove.
2675         (Expression.GetFieldFromEvent): Remove.
2676         (SimpleName.MemberStaticCheck): Remove.
2677         (SimpleName.DoSimpleNameResolve): Update to changes.
2678         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2679         (MemberAccess.IdenticalNameAndTypeName): Remove.
2680         (MemberAccess.error176): Move to MemberExpr.
2681         (MemberAccess.DoResolve): Update to changes.
2682         (BaseAccess.DoResolve): Likewise.
2683
2684 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2685
2686         C# 2.0 Conditional attribute class implementation
2687         
2688         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2689         Analyzes class whether it has attribute which has ConditionalAttribute
2690         and its condition is not defined.
2691         
2692         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2693         (Class.IsExcluded): New method. Search for at least one defined
2694         condition in ConditionalAttribute of attribute class.
2695
2696 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2697
2698         * ecore.cs (PropertyExpr): Derive from Expression, not
2699         ExpressionStatement.
2700         (PropertyExpr.EmitStatement): Remove.
2701
2702 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2703
2704         Fix #74060.
2705         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2706         internal field "value__" of an enum be private.  The examples for
2707         "value__" that I found on MSDN all used FieldAttributes.Private.
2708
2709         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2710         Don't mention IL method attribute names.
2711
2712         Fix #47991.  Remove a TODO.
2713         * statement.cs (Block.Toplevel): Make into a field.
2714         (Block.Parameters): Move into ToplevelBlock.
2715         (Block.known_variables): Rename from child_variable_names.
2716         (Block.Block): Remove variants that take Parameters.  Initialize
2717         'Toplevel' with the immediately surrounding toplevel block.
2718         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2719         LocalInfo parameter.
2720         (Block.GetKnownVariableInfo): New.
2721         (Block.IsVariableNameUsedInChildBlock): Update.
2722         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2723         the block, even though it may not be in scope.
2724         (Block.AddVariable): Remove Parameters parameter.  Use
2725         Toplevel.Parameters instead.
2726         (Block.AddConstant): Remove Parameters parameter.
2727         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2728         (Block.IsParamaterReference): Likewise.
2729         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2730         (ToplevelBlock.Parameters): New.  Moved from Block.
2731         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2732         initialize Parameters to a non-null value.
2733         * cs-parser.jay: Update to changes.
2734         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2735         simple names that mean different things in the same block.  Use
2736         Block.IsVariableNameUsedInBlock.
2737
2738 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2739
2740         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2741         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2742         GetTypeHandle.  It is possible for a reflected type to derive from
2743         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2744         System.Array during mscorlib compilation).
2745         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2746         contain a method_hash, don't create one either.  Don't create a
2747         deep copy of the base cache's method_hash.
2748         (MemberCache.SetupCache): Rename back from DeepCopy.
2749         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2750         already initialized.  If we see an override function, add its
2751         underlying base virtual function to the member_hash too.
2752
2753         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2754
2755 2005-03-26  Raja R Harinath  <harinath@acm.org>
2756
2757         Fix #73038.
2758         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2759         fails to resolve, ensure that the LHS is still resolved as an
2760         lvalue.
2761
2762 2005-03-25  Raja R Harinath  <harinath@acm.org>
2763
2764         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2765         ec.ContainerType.
2766         (Enum.current_ec): Remove.
2767         (Enum.LookupEnumValue): Remove EmitContext argument.
2768         Just uses the one created during DefineType.
2769         (Enum.FindMembers): Update.
2770         * expression.cs (MemberAccess.DoResolve): Update.
2771
2772 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2773
2774         * assign.cs (Assign.DoResolve): Check for CS1717 when
2775         source and target are same (uses Equals).
2776
2777         * expression.cs (LocalVariableReference, ParameterReference,
2778         This): Implemented Equals, GetHashCode.
2779
2780         * statement.cs (Block.GetParameterReference): Removed useless
2781         local variable.
2782
2783 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2784
2785         Fix cs0128.cs
2786         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2787         blocks before deciding whether the error is cs0136 or cs0128.
2788
2789         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2790         (using_alias_directive, using_namespace_directive): Pass
2791         MemberName, not an expression to Namespace.UsingAlias and
2792         Namespace.Using.
2793         (MakeName): Use the MemberName of the namespace.
2794         * namespace.cs (Namespace.MemberName): New.
2795         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2796         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2797         Likewise.
2798         * decl.cs (MemberName.Name): Make readonly.
2799         (MemberName.FromDotted): New "constructor".
2800         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2801         (MemberCore.Name): Compute from MemberName on demand.
2802         (MemberCore.SetMemberName): Provide a way to change the
2803         MemberName.
2804         (MemberCore.AddToContainer): Don't take a fullname parameter.
2805         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2806         fully qualified name of the container to the member name.
2807         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2808         only if the type is a member of the root container.
2809         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2810         MemberName.Left rather than searching for an embedded ".".
2811         (PartialContainer.CreatePart): Update to changes in RootContext.
2812         (MemberBase.ShortName): Turn into a property.  Use
2813         MemberCore.SetMemberName.
2814         (MemberBase.ExplicitInterfaceName): Remove.
2815         (MemberBase.UpdateMemberName): Remove.
2816         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2817         (PropertyBase.SetMemberName): New override.
2818         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2819         (Tree.GetDecl): New.
2820         (Tree.AllDecls): Rename from Decls.
2821         * attribute.cs, enum.cs, report.cs: Update to changes.
2822         * driver.cs (MainDriver): Use MemberName.FromDotted on
2823         RootContext.MainClass.
2824
2825 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2826
2827         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2828         checks.
2829
2830         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2831
2832 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2835         property accessor modifiers.
2836
2837         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2838         fixed buffer attribute (CS1716).
2839         (PropertyMethod.HasCustomAccessModifier): When property accessor
2840         has custom modifier.
2841
2842         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2843         modifiers.
2844         (PropertyExpr.DoResolveLValue): Add CS0272.
2845
2846 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2847
2848         * convert.cs: When converting to a pointer, use the proper Conv.U
2849         or Conv.I depending on the source data type.
2850
2851         * cs-tokenizer.cs: Make the size for large decimal constants,
2852         fixes #72957.
2853
2854 2005-03-17  Martin Baulig  <martin@ximian.com>
2855
2856         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2857         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2858
2859 2005-03-17  Martin Baulig  <martin@ximian.com>
2860
2861         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2862         to bool so we can return an error condition.
2863         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2864         returned an error.
2865
2866 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2867
2868         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2869         attributes.
2870
2871 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2872
2873         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2874         Refactor to avoid traversing the list of assemblies, and to avoid
2875         string concatenation.
2876         * typemanager.cs (guid_attr_type): Remove.
2877         (negative_hits, pointers, references): Remove hashes.
2878         (type_hash): New.
2879         (GetConstructedType): New.  Uses type_hash to handle constructed
2880         types (arrays, references, pointers).
2881         (GetReferenceType, GetPointerType): Use it.
2882         (GetNestedType): New.  Uses type_hash to handle nested types of
2883         reflected types.
2884         (LookupType, LookupTypeDirect): Remove.
2885         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2886         'types' hash and LookupTypeReflection directly.
2887         (params_string, params_object): Use GetConstructedType.
2888         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2889         top-level types.
2890         (Namespace.Lookup): Use cached_types.
2891         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2892         provided by old TypeManager.LookupType.
2893         * rootcontext.cs (MakeFQN): Remove.
2894         * decl.cs (DeclSpace.MakeFQN): Likewise.
2895         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2896         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2897         TypeManager.GetConstructedType.
2898         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2899
2900 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2901
2902         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2903         indexers.
2904
2905         * cs-parser.jay: Reports CS1527 for any namespace element.
2906
2907         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2908         Added CS0407.
2909
2910         * expression.cs (ParameterReference.IsAssigned): Changed error to
2911         CS0269.
2912         (Error_WrongNumArguments): Moved CS0245 detection here.
2913
2914         * statement.cs (Return.Resolve): Add CS1622 report.
2915
2916 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2917
2918         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2919
2920 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2921
2922         * attribute.cs expression.cs: Get rid of some allocations.
2923
2924 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2925
2926         * doc.cs : just eliminate the latest change.
2927
2928 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2929
2930         * doc.cs : commented out the latest change. It breaks xml-030.cs
2931
2932 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2933
2934         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2935           fail. So invoke CreateType() in FindDocumentedType().
2936
2937 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2938
2939         * cs-tokenizer.cs : added IsKeyword().
2940         * doc.cs : Detect keyword incorrectly used as identifier.
2941           Allow identifiers prefixed by @.
2942
2943 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2944
2945         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2946         It caused exception in namespace resolving (again!).
2947         
2948         * class.cs (Class.ctor): Removed exit.
2949         (PropertyMethod.ctor): ditto.
2950         
2951         * codegen.cs (Codegen.Reset): Reset static data.
2952         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2953         
2954         * cs-tokenizer.cs (Cleanup): Removed.
2955         
2956         * driver.cs (GetSystemDir): Rewrote to one line command.
2957         It caused problem with unloaded dynamic modules.
2958         (UnixParseOption): Removed Exit.
2959         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2960         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2961         Now can be mcs used as library.
2962         
2963         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2964         empty location.
2965         
2966         * location.cs (Reset): Reset static data.
2967         
2968         * namespace.cs (Reset): Reset static data.
2969         
2970         * report.cs (Report.Reset): Reset static data.
2971         
2972         * rootcontext.cs (RootContext.Reset): Reset static data.
2973         
2974         * tree.cs (RootTypes.ctor): Use Location.Null
2975         
2976         * typemanager.cs (TypeManager.Reset): Reset static data.
2977         (CoreLookupType): Removed Exit.
2978         (TypeHandle.Reset): Reset static data.
2979         
2980 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2981
2982         Fix #73516.
2983         * typemanager.cs (ComputeNamespaces): Import namespaces from
2984         referenced modules too.
2985
2986 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2987
2988         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2989         than '.'.
2990
2991 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2992
2993         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2994         enclosing DeclSpace.  This ensures that a name-lookup populates
2995         more caches and there are fewer 'TypeExpression's.  Carve out
2996         nested type lookup into ...
2997         (LookupNestedTypeInHierarchy): ... this.
2998
2999 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3000
3001         Clean up a few partial-class semantics.  
3002         Fixes test-357.cs and cs1618-2.cs.
3003         * cs-parser.jay (struct_declaration): Use 'current_class' as
3004         parent of newly-created struct.  Remove call to Register ().
3005         Use 'pop_current_class' to complete handing the current struct.
3006         (interface_declaration): Likewise.
3007         (class_declaration): Likewise.
3008         (enum_declaration): Use 'current_class' as parent of newly created
3009         enum.
3010         (delegate_declaration): Likewise.
3011         (pop_current_class): New function.  This is used to handle closing
3012         up the 'current_class' and 'current_container', and pointing them
3013         to the enclosing class/container.
3014         (CSharpParser): Initialize 'current_class' too.
3015         * decl.cs (MemberCore): Add check for invariant: a partial
3016         container is not a parsed entity, and thus does not enclose any
3017         parsed members.
3018         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3019         (DeclSpace.BaseTypeExpr): Use it.
3020         (DeclSpace.LookupType): Add check for invariant.
3021         * class.cs (TypeContainer): Add check for invariant: a nested
3022         class should have the same NamespaceEntry as its enclosing class.
3023         (TypeContainer.EmitFieldInitializers): Make virtual.
3024         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3025         MemberCore.
3026         (TypeContainer.Register): Remove.
3027         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3028         null.  Use TypeResolveEmitContext for resolving base types and
3029         interfaces.  Move initialization of Parts.TypeBuilder here from
3030         ...
3031         (TypeContainer.DefineNestedTypes): ... here.
3032         (PartialContainer): Take a Namespace not a NamespaceEntry.
3033         (PartialContainer.Create): Don't use Register.  Call the
3034         appropriate Add... function directly.
3035         (ClassPart): Take both the PartialContainer and the enclosing
3036         class as constructor arguments.
3037         (ClassPart.EmitFieldInitializers): Override.
3038         (ClassPart.PartFindNestedTypes): Remove.
3039         (FieldBase.GetInitializerExpression): Resolve the initializer
3040         expression in the emit context of the enclosing class.
3041         * tree.cs (RootTypes): Remove Register ().
3042         
3043 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
3044
3045         * cs-parser.jay: Removed CS0134.
3046         
3047         * driver.cs: Removed CS1901.
3048         
3049         * expression.cs (SizeOf.DoResolve): Don't report CS0233
3050         for predefined types.
3051
3052 2005-03-07  Duncan Mak  <duncan@novell.com>
3053
3054         * codegen.cs (Save):  Catch UnauthorizedAccessException as
3055         well. Fixes bug #73454.
3056
3057 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3058
3059         * cs-tokenizer.cs (xtoken): Add CS1035.
3060         
3061         * class.cs (MethodData.Define): Add CS0683.
3062         (FieldMember.ctor): Add CS0681.
3063
3064 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3065
3066         * ecore.cs (SimpleName.DoResolve): Rename from
3067         SimpleName.DoResolveAllowStatic.
3068         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3069         Pass 'intermediate' flag to MemberStaticCheck.
3070         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3071         of "intermediate" lookups via MemberAccess.
3072         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3073         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3074
3075 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3076
3077         Fix #73394.
3078         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3079         slipped in because of variable names that are identical to a
3080         builtin type's BCL equivalent ('string String;', 'int Int32;').
3081         (PropertyExpr.EmitInstance): Likewise.
3082
3083 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3084
3085         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3086         
3087         * report.cs (warning_ignore_table): Made public.
3088
3089 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3090
3091         Fix #73282.
3092         * class.cs (MethodData.Emit): Pass 'container' to
3093         container.GetObsoleteAttribute instead of 'container.Parent'.
3094
3095 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3096
3097         * cs-parser.jay: Add 1534 error test.
3098
3099         * iterators.cs (Yield.CheckContext): Add error 1629.
3100         (Iterator.ctor): Save unsafe modifier.
3101         (MoveNextMethod.DoEmit): Restore unsafe context.
3102
3103         * namespace.cs (UsingAlias): Better error message.
3104
3105 2005-03-03  Dan Winship  <danw@novell.com>
3106
3107         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3108         the warning message [#73219]
3109
3110 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3111
3112         Fix compile with MCS 1.0.0.0.
3113         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3114         w_restore to not depend on string constant folding.
3115
3116 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3117
3118         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3119         CS0246 check to users who passed 'silent = false'.
3120         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3121         check.
3122         (SimpleName.SimpleNameResolve): Update.
3123         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3124         (MemberAccess.IdenticalNameAndTypeName): Update.
3125         * doc.cs (FindDocumentedTypeNonArray): Update.
3126
3127 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3128
3129         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3130         * parameters.cs (ComputeAndDefineParameters): Remove.
3131         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3132         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3133         Use GetParameterInfo.
3134
3135 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3136
3137         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3138
3139 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3140
3141         Unify DeclSpace.LookupType and DeclSpace.FindType.
3142         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3143         is in charge of defining nested types on demand.
3144         (DeclSpace.LookupType): Use it when the current_type is a
3145         TypeBuilder.  Use LookupTypeDirect for reflected types.
3146         (DeclSpace.FindType): Remove.
3147         (DeclSpace.LookupInterfaceOrClass): Likewise.
3148         (DeclSpace.DefineTypeAndParents): Likewise.
3149         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3150         DeclSpace.LookupType.
3151         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3152         * typemanager.cs (LookupType): Simplify.
3153         (AddUserType): Remove type from negative_hits.
3154         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3155         * class.cs (TypeContainer.FindMembers): Move handling of nested
3156         types ...
3157         (TypeContainer.FindMembers_NestedTypes): ... here.
3158         (TypeContainer.FindNestedType): Implement override.
3159         (ClassPart.FindNestedType): Delegate to PartialContainer.
3160         (ClassPart.PartFindNestedType): Looks up the nested types of the
3161         part alone.
3162
3163 2005-03-02  Martin Baulig  <martin@ximian.com>
3164
3165         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3166         static constructor in static classes.
3167
3168 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3169
3170         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3171         sizeParamIndex is not specified.
3172
3173 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3174
3175         Fix #73117
3176         * report.cs (WarningMessage.IsEnabled): Missing null check.
3177
3178 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3179
3180         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3181         in the fields and not in the properties.
3182
3183 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3184
3185         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3186         fields as well.
3187
3188 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3189
3190         * attribute.cs: Small refactoring (improved robustness).
3191         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3192         (ValidateGuid): Removed.
3193         (Resolve): Removed referenced to above mentioned.
3194         (GetAttributeUsage): Made private and changed to work without
3195         class assistance.
3196         (GetIndexerAttributeValue): Don't crash.
3197         (GetConditionalAttributeValue): Ditto.
3198         (GetClsCompliantAttributeValue): Ditto.
3199         (ExtractSecurityPermissionSet): All attributes exceptions are
3200         error 648.
3201         (GetPropertyValue): New helper.
3202         (GetMethodImplOptions): New method.
3203         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3204         some missing properties.
3205         
3206         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3207         (Method.ApplyAttributeBuilder): Updated.
3208         
3209         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3210         exception.
3211
3212 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3213
3214         Fix #73052.
3215         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3216         non-simple types (array, pointer, reference).
3217
3218 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3221
3222         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3223         for operators.
3224         (Method.CheckBase): Catch wrong destructor here.
3225         (MethodData.Define): Add errors 550, 668.
3226
3227         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3228
3229         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3230
3231         * pending.cs (VerifyPendingMethods): Add error 551.
3232
3233         * typemanager.cs (CSharpName): Next error report helper.
3234
3235 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3236
3237         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3238         attributes. Removed useless attribute double check.
3239         It saves almost 2MBs for corlib.
3240
3241 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3242
3243         Fix #72924.
3244         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3245         called twice in case of error.
3246
3247 2005-02-23  Chris Toshok  <toshok@ximian.com>
3248
3249         Fix compiler portions of #72827.
3250         * statement.cs (Block.Emit): call Begin/EndScope on the
3251         EmitContext instead of the ILGenerator.
3252
3253         * codegen.cs (EmitContext.BeginScope): new method, call
3254         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3255         we have one.)
3256         (EmitContext.BeginScope): same, but EndScope and CloseScope
3257
3258         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3259         offset and call the superclass's OpenScope(int) with it.
3260         (SymbolWriter.CloseScope): get the current il
3261         offset and call superclass's CloseScope(int) with it.
3262
3263 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3264
3265         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3266         CS1677 for out and ref as well.
3267
3268         * class.cs (Method.Define): Add error CS1599 detection.
3269         
3270         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3271         
3272         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3273         
3274         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3275         
3276         * support.cs.cs (ModifierDesc): New helper method.
3277
3278 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3279             Abin Thomas  <projectmonokochi@rediffmail.com>
3280             Anoob V E  <projectmonokochi@rediffmail.com>
3281             Harilal P R  <projectmonokochi@rediffmail.com>
3282
3283         Fix #57851, #72718.
3284         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3285         MemberLookup (used for error reporting) actually returns a result.
3286         Fix error report number (122, not 112).
3287
3288 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3289             Anoob V E  <projectmonokochi@rediffmail.com>
3290             Harilal P R  <projectmonokochi@rediffmail.com>
3291
3292         Fix #71134.
3293         * pending.cs (PendingImplementation.GetAbstractMethods):
3294         Find NonPublic members too.
3295
3296 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3297
3298         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3299         Fixed error 217.
3300         
3301         * class.cs (MethodCore.CheckMethodAgainstBase):
3302         Add error 239 report.
3303
3304 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3305
3306         Fix #68955.
3307         * expression.cs (Invocation.IsApplicable): Make public.
3308         (Invocation.IsParamsMethodApplicable): Likewise.
3309         * delegate.cs (Delegate.VerifyApplicability): Don't use
3310         Invocation.VerifyArgumentCompat for parameter applicability
3311         testing.  Use Invocation.IsApplicable and
3312         Invocation.IsParamsMethodApplicable.
3313
3314 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3315
3316         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3317         
3318         * class.cs (Operator.Define): Add error 217 report.
3319         
3320 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3321
3322         * namespace.cs (UsingEntry.Resolve): Undo change below.
3323
3324 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3325
3326         Fix #72756.
3327         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3328         disable the error message when the extended MemberLookup also
3329         fails.
3330         (Expression.MemberLookupFinal): Update.
3331         (SimpleName.DoSimpleNameResolve): Update.
3332         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3333         Don't use MemberLookupFinal.
3334         (New.DoResolve): Update.
3335         (BaseAccess.CommonResolve): Update.
3336
3337 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3338
3339         Fix #72732.
3340         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3341         occured previously, don't resolve again.
3342
3343 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3344
3345         Fix #69949
3346         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3347         argument. Call ResolveAttributeUsage for unresolved.
3348         when types doesn't match ctor arguments.
3349         
3350         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3351         for nested attribute classes.
3352         (Class.attribute_usage): Removed.
3353         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3354         for attribute class.
3355         
3356         * ecore.cs (IsAttribute): Removed.
3357         
3358         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3359         
3360         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3361         now normal types.
3362         (attribute_types): Removed.
3363         (EmitCode): Global attributes are emited as the latest.
3364
3365 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3366
3367         * class.cs (EmitFieldInitializers): Don't emit field initializer
3368         for default values when optimilization is on.
3369         
3370         * constant.cs (Constant.IsDefaultValue): New property.
3371         
3372         * driver.cs: Add /optimize handling.
3373         
3374         * constant.cs,
3375         * ecore.cs,
3376         * literal.cs: Implement new IsDefaultValue property.
3377         
3378         * rootcontext.cs (Optimize): New field, holds /optimize option.
3379
3380 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3381
3382         Fix crasher in re-opened #72347.
3383         * namespace.cs (Namespace.Lookup): Return null if
3384         DeclSpace.DefineType returns null.
3385
3386         Fix #72678.
3387         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3388
3389 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3390
3391         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3392         now returns null if it cannot resolve to an lvalue.
3393         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3394         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3395         returned null.  Remove check for SimpleName.
3396         (EventExpr.DoResolveLValue): New.
3397         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3398         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3399         error from ...
3400         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3401         avoid CS0131 error.
3402         (Unary.ResolveOperator): Move CS0211 check ...
3403         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3404         CS0131 error.
3405         (Unary.DoResolveLValue): Simplify.
3406         (AddressOf.DoResolveLValue): New.
3407         (ArrayAccess.DoResolveLValue): New.
3408
3409 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3410
3411         * attribute.cs (Attribute.Resolve): Add arguments casting for
3412         when types doesn't match ctor arguments.
3413
3414 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3415
3416         Fix parts of #63202.
3417         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3418         lookup of operator in base type.  Ensure that all checks happen
3419         when the operator resolves to an "op_..." method.
3420
3421 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3422
3423         Fix #71992.
3424         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3425         'ignore_cs0104' parameter.  Pass it to ...
3426         (NamespaceEntry.Lookup): ... this.
3427         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3428         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3429         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3430         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3431         Update.  Request that cs0104 errors be ignored.
3432         (ComposedCast.ResolveAsTypeStep): Update.
3433
3434 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3435
3436         Fix #59209.
3437         * expression.cs (Invocation.BetterFunction): Remove support for
3438         comparing virtual functions and their overrides.
3439         (Invocation.IsOverride): New.
3440         (Invocation.OverloadResolve): Don't consider 'override' functions
3441         during candidate selection.  Store them in a lookaside list.
3442         If the selected method is a 'virtual' function, use the list to
3443         find any overrides that are closer to the LHS type.
3444
3445 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3446
3447         * expression.cs (New.DoResolve): Add complex core type reduction.
3448         (New.Constantify): Converts complex core type syntax like 'new int ()'
3449         to simple constant.
3450         
3451 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3452
3453         * decl.cs (EntryType.EntryType): New constructor to create an
3454         updated copy of a cache entry.
3455         (MemberCache.AddMethods): Use it.
3456         (MemberCache.ClearDeclaredOnly): Remove.
3457         (MemberCache.MemberCache): Update.
3458
3459 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3460
3461         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3462         variable.  This one is represents the actual low-level declaration
3463         of the method, as opposed to the semantic level `IsStatic'.   
3464
3465         An anonymous method which is hosted into a static method might be
3466         actually an instance method.  IsStatic would reflect the
3467         container, while MethodIsStatic represents the actual code
3468         generated.
3469
3470         * expression.cs (ParameterReference): Use the new MethodIsStatic
3471         instead of IsStatic.
3472
3473         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3474         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3475         set on the current EmitContext. 
3476
3477         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3478         resolve our casted expression as an LValue.  This triggers the
3479         proper LValue processing that is later required by Assign.
3480
3481         This fixes 72347.
3482
3483         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3484
3485 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3486
3487         C# 2.0 Fixed buffer implementation
3488
3489         * anonymous.cs: Update after RegisterHelperClass renaming.
3490
3491         * attribute.cs (AttributeTester.fixed_buffer_cache):
3492         Cache of external fixed buffers.
3493         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3494         implementation if field is fixed buffer else null.
3495
3496         * class.cs
3497         (TypeContainer.AddField): Accept FieldMember instead of Field.
3498         (FieldBase.IsFieldClsCompliant): Extracted code from
3499         VerifyClsCompliance descendant customization.
3500         (FixedField): New class handles fixed buffer fields.
3501         (FixedFieldExternal): Keeps information about imported fixed
3502         buffer.
3503         (IFixedField): Make access to internal or external fixed buffer
3504         same.
3505
3506         * cs-parser.jay: Add fixed buffer parsing.
3507
3508         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3509         buffer.
3510
3511         * expression.cs (Indirection): Extended implementation to accept
3512         fixed buffer field.
3513         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3514         (ElementAccess.MakePointerAccess): Get type as parameter.
3515         (DoResolve): Add fixed buffer field expression conversion.
3516         (DoResolveLValue): Ditto.
3517         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3518         (ArrayPtr): Derives from FixedBufferPtr.
3519         (ArrayPtr.Emit): Add extra emit for array elements.
3520
3521         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3522
3523         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3524         for compiler generated types.
3525         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3526
3527         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3528         and consume less memory.
3529         (Fixed.Resolve): Add fixed buffer case.
3530
3531         * typemanager.cs (compiler_generated_attr_ctor,
3532         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3533         (HasElementType): Add our own implementation to work on every
3534         runtime.
3535
3536 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3537
3538         * anonymous.cs (CaptureContext): Track whether `this' has been
3539         referenced.   
3540
3541         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3542         only captured `this' if it was implicitly done (instance
3543         methods/variables were used). 
3544
3545         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3546         `this' must be captured.
3547
3548 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3549  
3550         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3551         is null it means that there has been no need to capture anything,
3552         so we just create a sibling.
3553
3554         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3555
3556         Just a partial fix.  The other half is fairly elusive.
3557         
3558 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3559
3560         Fix #52586, cs0121-4.cs.
3561         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3562         and return a hashtable.
3563         (MemberCache.ClearDeclaredOnly): New.
3564         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3565         the method_hash of a base type too.
3566         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3567         type methods.  Overwrite entries with the same MethodHandle so
3568         that the ReflectedType is correct.  The process leaves in base
3569         virtual functions and their overrides as distinct entries.
3570         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3571         matters since it was boxed in a ArrayList before.
3572         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3573         modifier.
3574         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3575         case of a virtual function and its override (choose the overload
3576         as better).
3577         (Invocation.OverloadResolve): Avoid 'override' members during
3578         'applicable_type' calculation.
3579
3580 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3581
3582         Combine two near-redundant caches.
3583         * typemanager.cs (method_params): Rename from method_internal_params.
3584         (TypeManager.GetParameterData): New.  Replace
3585         Invocation.GetParameterData.
3586         (TypeManager.LookupParametersByBuilder): Remove.
3587         * expression.cs (Invocation.method_parameter_cache): Remove.
3588         (Invocation.GetParameterData): Remove.
3589         Update to changes.
3590         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3591         Update to changes.
3592
3593 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3594
3595         Fix #72015.
3596         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3597         TypeManager.multicast_delegate_type is null, resolve it by looking
3598         up "System.MulticastDelegate".
3599         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3600
3601 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3602             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3603             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3604
3605         Fix cs0164.cs.
3606         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3607         (LabeledStatement.AddReference): New.  Set 'referenced'.
3608         (Goto.Resolve): Use it.
3609
3610 2005-02-05  John Luke  <john.luke@gmail.com>
3611
3612         * driver.cs: remove duplicate -doc line in Usage ()
3613
3614 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3615
3616         * location.cs (Location.AddFile): Fix CS2002 error report.
3617
3618 2005-02-02  Martin Baulig  <martin@ximian.com>
3619
3620         * delegate.cs (Delegate.DefineType): Report an internal error if
3621         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3622         details.        
3623
3624 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3625
3626         Fix a crasher in a variant of #31984.
3627         * const.cs (Constant.CheckBase): New override that defers the
3628         new-or-override check in case the base type hasn't been populated
3629         yet.
3630         (Constant.Define): Ensure the new-or-override check is performed.
3631
3632 2005-02-01  Duncan Mak  <duncan@ximian.com>
3633
3634         * const.cs (LookupConstantValue): Check that `ce' is not null
3635         before calling GetValue ().
3636
3637 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3638
3639         Fix test-334.cs (#69519).
3640         * cs-parser.jay (using_alias_directive): Pass in an expression to
3641         NamespaceEntry.UsingAlias.
3642         (using_namespace_directive): Pass in an expression to
3643         NamespaceEntry.Using.
3644         (namespace_name): Don't flatten to a string.
3645         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3646         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3647         ResolveAsTypeStep.
3648         (NamespaceEntry.UsingEntry): Likewise.
3649         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3650         changes.
3651         (NamespaceEntry.LookupForUsing): Remove.
3652         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3653         names.
3654         (NamespaceEntry.Lookup): Remove support for dotted names.
3655
3656 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3657
3658         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3659         split into two.
3660         (NamespaceEntry.ImplicitParent): Compute on demand.
3661         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3662         parallels the current.
3663         (NamespaceEntry.LookupForUsing): Use it.
3664         (NamespaceEntry.Lookup): If the current namespace-entry is
3665         implicit, don't search aliases and using tables.
3666
3667 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3668
3669         Fix #31984.
3670         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3671         BaseCache here.
3672         (TypeContainer.BaseCache): Compute on demand.
3673         (TypeContainer.FindMembers): Define constants and types if they're
3674         not already created.
3675         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3676         check.
3677         * const.cs (Constant.Define): Make idempotent.
3678
3679 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3680
3681         * pending.cs: Produce better code (no nops produced by using Ldarg
3682         + value).
3683         
3684         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3685         i - 1' it should be arg + 1.
3686
3687         Fixes bug #71819.
3688
3689 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3690
3691         * attribute.cs (Attribute.CheckAttributeType): Make private
3692         non-virtual.
3693         (Attribute.ResolveType): Make virtual.
3694         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3695         handling of RootContext.Tree.Types.
3696
3697 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3698
3699         Update attribute-handling to use the SimpleName/MemberAccess
3700         mechanisms.
3701         * cs-parser.jay (attribute): Pass in an expression to the
3702         constructors of Attribute and GlobalAttribute.
3703         * attribute.cs (Attribute): Take an expression for the name.
3704         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3705         passed in attribute name expression.
3706         (Attribute.CheckAttributeType): Use it.
3707         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3708         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3709         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3710         argument to prevent error messages if the lookup fails.
3711
3712 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3713
3714         * expression.cs (Indirection): Implemented IVariable interface
3715         to support indirection in AddressOf operator.
3716         (PointerArithmetic.Emit): Add optimalization for case where
3717         result can be precomputed.
3718
3719 2005-01-26  Martin Baulig  <martin@ximian.com>
3720
3721         * class.cs (TypeContainer.AttributeTargets): Return the correct
3722         AttributeTargets depending on our `Kind' instead of throwing an
3723         exception; fixes #71632.
3724
3725 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3726
3727         Fix #71257
3728         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3729         constant members.
3730
3731 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3732
3733         Fix #71602.
3734         * expression.cs (MemberAccess.DoResolve): Don't complain with
3735         cs0572 when the LHS of a member access has identical name and type
3736         name.
3737
3738 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3739
3740         Fix #71651, #71675
3741         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3742         CreatePermission.
3743         Create custom PermissionSet only for PermissionSetAttribute.
3744
3745 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3746
3747         Fix #71649
3748         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3749         delegates in static class.
3750
3751 2005-01-24  Martin Baulig  <martin@ximian.com>
3752
3753         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3754         merging an implicit block, just use its reachability.
3755
3756         * statement.cs (Block.Resolve): Make the unreachable code check
3757         work wrt. implicit blocks; see test-337 from #63842.
3758
3759 2005-01-21  Alp Toker  <alp@atoker.com>
3760  
3761         * cs-parser.jay: destructor_declaration's container is PartialContainer
3762         not Class when partial types are used, so use Kind prop instead of
3763         'is'.
3764         
3765 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3766
3767         * cs-parser.jay: Improve error reporting when an interface
3768         declares new types.
3769
3770 2005-01-20  Dick Porter  <dick@ximian.com>
3771
3772         * support.cs: SeekableStreamReader fix from Sandor Dobos
3773         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3774         chars are read.  Fixes bug 70369.
3775
3776 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3777
3778         * cs-parser.jay (catch_clause): Simplify current_block handling
3779         somewhat.
3780
3781 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3782
3783         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3784         code with ImplicitStandardConversion to handle the implicit
3785         conversion of method groups into valid delegate invocations. 
3786
3787         The problem is that in parameter handling we were using this code
3788         path.  Fixes bug #64698
3789
3790 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3791
3792         * cs-parser.jay: Fix several infelicities.
3793         - Avoid assigning to the parser value stack.  Code like 
3794           '$3 = null' is unclean.  Synthesize a value for the code block
3795           instead. 
3796         - Avoid using oob_stack for storing location information.  Use ...
3797         (_mark_): ... this.  New (empty) rule.  Saves the current location
3798         in $$.
3799         (foreach_statement): Avoid using oob_stack for current_block
3800         handling.  Use technique used in for_statement and
3801         using_statement.  Synthesize a value for the code block to store
3802         additional intermediate information.
3803
3804 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3805
3806         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3807         of a different type is only allowed to private fields of a
3808         containing type, not on fields of a base class.
3809
3810         See test-174.cs and error cs0122-9.cs
3811
3812 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3813
3814         Fix test-335.cs (bug #58126).
3815         * cs-parser.jay (argument): Split out non-expression parts of the
3816         rule into 'non_simple_argument'.
3817         (invocation_expression): Support parenthesized invocations with
3818         multiple arguments, and with single non-simple arguments.
3819
3820 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3821
3822         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3823         places.
3824
3825 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3826
3827         Fix cs0038-1.cs, cs1640-6.cs.
3828         * ecore.cs (Expression.Resolve): Remove special-case for
3829         SimpleName in error-handling.
3830         (Expression.almostMatchedMembers): Relax access permission to
3831         protected.
3832         (Expression.MemberLookupFailed): Handle duplicates in
3833         almostMatchedMembers list.
3834         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3835         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3836         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3837         overload if the passed in MemberInfo is a MethodBase.
3838
3839 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3840
3841         Fix #70749
3842         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3843         for non-CAS & merge permission sets properly.
3844
3845 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3846
3847         Improve standard-compliance of simple name and member access 
3848         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3849         * ecore.cs (FullNamedExpression): New abstract base class 
3850         for Namespaces and TypeExpressions.
3851         (ResolveFlags.SimpleName): Remove.
3852         (SimpleName): Remove support for dotted names.
3853         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3854         DeclSpace.FindType and DeclSpace.LookupType.
3855         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3856         (Expression.ExprClassName): Make member function.
3857         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3858         a namespace.  Remove creation of dotted "SimpleName"s.
3859         (MemberAccess.DoResolve): Likewise.
3860         * decl.cs (DeclSpace.Cache): Make private.
3861         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3862         (DeclSpace.FindType): Update.
3863         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3864         FullNamedExpression.
3865         * namespace.cs (Namespace): Derive from FullNamedExpression
3866         so that it can be part of expression resolution.
3867         (Namespace.Lookup): Return an FullNamedExpression.
3868         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3869         namespace.
3870         * rootcontext.cs (NamespaceLookup): Remove.
3871         (LookupType): Move to DeclSpace.
3872         * attribute.cs (CheckAttributeType): Update.
3873         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3874         (FindDocumentedTypeNonArray): Likewise.
3875
3876 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3877
3878         Fix cs0509.cs, cs1632.cs.
3879         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3880         is the same as IsInterface.
3881         (TypeContainer.GetClassBases): Likewise.
3882         * statement.cs (LabeledStatement.ig): New field.
3883         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3884         label.
3885         (LabeledStatement.DoEmit): Check that the label was created with
3886         the same ILGenerator.
3887
3888 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3889
3890         Fix #71058
3891         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3892         accessors to its properties.
3893
3894         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3895         from accessors to property.
3896         
3897 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3898
3899         Fix #70722
3900         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3901         only for overrides.
3902         
3903 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3904
3905         * attribute.cs: Check for null and empty strings.  
3906
3907         I have lost another battle to Paolo.
3908
3909 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3910
3911         Fix #70942
3912         * class.cs (PropertyMethod): Set Parent field in ctors.
3913         (SetMethod.InternalParameters): Add unsafe switch hack.
3914         Override MarkForDuplicationCheck where it is appropriate.
3915
3916         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3917         It says whether container allows members with the same name.
3918         Base default is no.
3919         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3920         Removed is_method parameter.
3921
3922 2005-01-06  Duncan Mak  <duncan@ximian.com>
3923
3924         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3925         because the previous change led to incorrect reporting of CS1032
3926         ("Cannot define/undefine preprocessor symbols after first token in
3927         file"). Instead of using `tokens_seen' as the only flag that
3928         triggers CS1040, introduce `comments_seen'. This new flag is used
3929         to signify having seen comments on the current line, so it is
3930         unset after a newline.
3931
3932 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3933
3934         * doc.cs : When searching for a type, find nested type too.
3935           This fixes bug #71040.
3936
3937 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3938
3939         * doc.cs :
3940           - Warn missing member comment on those classes which also does not
3941             have doc comments. Fixed bug #71041.
3942           - Don't warn missing doc comment on default constructor.
3943             Fixed bug #71042.
3944
3945 2005-01-06  Duncan Mak  <duncan@ximian.com>
3946
3947         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3948         comments, set `tokens_seen' to true. This allows us to detect
3949         misplaced preprocessor directives (i.e. not at the beginning of
3950         the a line, nor after whitespaces). In that case, report error
3951         CS1040. This fixes bug #56460.
3952
3953         * cs-parser.jay (interface_member_declaration): Add checks for
3954         IsExplicitImpl, and report CS0541 error if an interface member is
3955         defined as an explicit interface declaration.
3956
3957 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3958
3959         Fix #70817
3960         * class.cs (PropertyMethod): Set Parent field in ctors.
3961         (SetMethod.InternalParameters): Add unsafe switch hack.
3962         
3963         * decl.cs (MemberCore.Parent): Cannot be readonly.
3964
3965 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3966
3967         * decl.cs (DeclSpace.ResolveType): Remove.
3968         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3969         Merge in code from ...
3970         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3971         * class.cs, enum.cs: Update to changes.
3972
3973 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3974
3975         * anonymous.cs: Ensure that we init the scope of our parent if it
3976         has not been initialized yet.
3977
3978 2004-12-30  Duncan Mak  <duncan@ximian.com>
3979
3980         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3981         if field.FieldBuilder is null. Fixes #70758.
3982
3983         * convert.cs: Fixed some typos and updated some of the comments.
3984         (ImplicitStandardConversionExists):
3985         (TryImplicitIntConversion): If `target_type' is an interface and
3986         the type of `ic' implements this interface, return true or a new
3987         BoxedCast instead of null. This fixes #70468.
3988
3989 2004-12-29  Duncan Mak  <duncan@ximian.com>
3990
3991         * expression.cs (Argument.Emit): Check that Expr is
3992         IMemoryLocation before casting to it, and report CS1510 otherwise.
3993
3994         This fixes #70402.
3995
3996 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3997
3998         * statement.cs (Block.ThisVariable): remove the recursion here, to
3999         make the --profile more sane.
4000
4001 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4002
4003         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4004         assembly, by JB Evain.
4005
4006 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4007
4008         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4009           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4010         "parent" refers to enclosing type/class.  "base" refers to superclass.
4011
4012 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4013
4014         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4015         Ensure that we only have GlobalAttributes.
4016         * attribute.cs (Attribute.Emit): Make non-virtual.
4017         (GlobalAttribute.Emit): Remove.
4018         (Attribute.Resolve): Make virtual.
4019         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4020         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4021         the argument. Don't create one.
4022         (Attribute.GetObsoleteAttribute): Likewise.
4023         (Attribute.GetClsCompliantAttributeValue): Likewise.
4024         * class.cs, decl.cs: Update to changes.
4025
4026 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4027
4028         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4029         
4030         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4031         
4032         * statement.cs (Foreach.Resolve): Add error 186 report.
4033
4034 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4035
4036         * expression.cs (Conditional.DoResolve): Add warning 429.
4037         
4038         * statement.cs (If.Resolve): Add warning 665.
4039
4040 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4041
4042         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4043         except when in the parser, and in GlobalAttribute.
4044         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4045         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4046         RootContext.Tree.Types.NamespaceEntry once work is done.
4047         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4048         and resets RootContext.Tree.Types.NamespaceEntry.
4049
4050 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4051
4052         * cs-parser.jay: Don't create a block for every variable.
4053
4054 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4055
4056         * location.cs: Provide extra information.
4057
4058         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4059         variables from the captured environment, it is the ldarg_0.
4060
4061 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4062
4063         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4064         find a conclusion.
4065         
4066         * class.cs: Changed warning level for 169 to avoid developer
4067         displeasure from warning flooding. It will be changed back when they
4068         fix most of current BCL warnings.
4069         
4070         * RootContext.cs: Pushed default WarningLevel to 3.
4071         
4072         * statement.cs: Removed unused variable.
4073
4074 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4075
4076         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4077         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4078         Add error 502 report.
4079         (StaticClass.DefineType): Add error 441 report.
4080         (Class.AllowedModifiersProp): New virtual property as temporary
4081         extension to AllowedModifiers.
4082         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4083         to share implementation with StaticClass and don't call virtual
4084         methods from ctor.
4085         
4086         * driver.cs (MainDriver): Add error 1558 test.
4087
4088         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4089         report. Moved error 36 test here.
4090
4091         * statement.cs (Throw.Resolve): Add error 724 report.
4092
4093         * typemanager.cs: Add out_attribute_type core type.
4094         
4095 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4096
4097         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4098         3018 report.
4099         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4100
4101         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4102         3017 report.
4103         
4104         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4105
4106         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4107         Add error 3023 report.
4108         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4109
4110         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4111         implementation.
4112
4113 2004-12-12  John Luke  <john.luke@gmail.com>
4114
4115         * driver.cs (AddArgs): take -- into account when
4116         adding arguments, fixes bug 65710 
4117
4118 2004-12-12  Martin Baulig  <martin@ximian.com>
4119
4120         * expression.cs (Unary.TryReduceNegative): Added support for
4121         SByteConstant and ByteConstant.
4122         (Unary.Reduce): Check error values from TryReduceNegative().
4123
4124 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4125
4126         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4127         and report exception as error 182.
4128
4129 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4130
4131         * driver.cs (Main): Fix message when there are warnings.
4132
4133 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4134
4135         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4136
4137 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4140         Reduced number of warnings.
4141         
4142         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4143
4144 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4145
4146         * driver.cs: Removed message.
4147
4148         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4149
4150 2004-12-08    <vargaz@freemail.hu>
4151
4152         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4153
4154 2004-12-08  Martin Baulig  <martin@ximian.com>
4155
4156         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4157         instead of a CS3002 for properties and indexer.
4158
4159 2004-12-08  Martin Baulig  <martin@ximian.com>
4160
4161         * decl.cs (MemberName.ToString): Make this work again.
4162
4163 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4164
4165         * attribute.cs (Resolve): Add error 591 detection.
4166
4167         * class.cs (FieldMember.Define): Add error 1547 detection.
4168         (Indexer.Define): Add error 620 detection.
4169         (Operator.Define): Add error 590 detection.
4170
4171         * ecore.cs: Missing argument for error 79.
4172
4173         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4174         detection.
4175
4176 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4177
4178         Fix #70106
4179         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4180         only.
4181
4182 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4183
4184         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4185           Some operator comments were suppressed.
4186         * doc.cs : Implicit/explicit operator name in doc comments are like
4187           "op_Explicit(type)~returnType", so added suffix handling.
4188
4189 2004-12-07  Martin Baulig  <martin@ximian.com>
4190
4191         * decl.cs
4192         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4193         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4194         (DeclSpace.ec): New protected field; store the EmitContext here.
4195         (DeclSpace.EmitContext): New public property; moved here from
4196         `TypeContainer'.
4197         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4198         EmitContext.
4199
4200         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4201         (Enum.Emit): Don't create a new EmitContext.
4202
4203         * delegate.cs (Delegate.DefineType): Always create the
4204         EmitContext.
4205
4206         * iterators.cs (Iterators.DefineIterator): Create a new
4207         EmitContext and store it in `ec'.
4208
4209 2004-08-24  Martin Baulig  <martin@ximian.com>
4210
4211         * typemanager.cs
4212         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4213         this for accessibility checks.
4214         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4215         IsNestedFamilyAccessible.
4216         (TypeManager.IsSubclassOf): New method, do what the name actually
4217         says.   
4218
4219 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4220
4221         Fix crash on cs0657-17.cs.
4222         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4223         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4224         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4225         the case where the NamespaceEntry gets overwritten.
4226
4227 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4228
4229         Fixed #69195, #56821
4230         * ecore.cs (ResolveBoolean): Tiny refactoring.
4231
4232         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4233         of right expression resolving when left is false constant and
4234         operator is LogicalAnd OR true constant and operator is LogicalOr.
4235
4236         * statement.cs (ResolveUnreachable): Always reports warning.
4237
4238 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4239
4240         * class.cs: Distinguish between 1721 and 1722 (just a little help
4241         for the programmer).
4242
4243 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4244
4245         * delegate.cs: Only allow this on new versions of the language. 
4246
4247 2004-12-02  Duncan Mak  <duncan@ximian.com>
4248
4249         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4250         Expression class.
4251         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4252         here as a static method. Take an additional bool out parameter
4253         `must_do_cs1540_check' for signaling to InstanceResolve.
4254         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4255         member field from PropertyExpr class and made it an argument of
4256         the method instead.
4257         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4258         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4259         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4260         and `remove_accessor' as well as InstanceResolve: report CS0122
4261         where applicable.
4262
4263         Fixes #70129.
4264
4265 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4266
4267         Fix test-327.cs, test-328.cs, and put in early infrastructure
4268         for eventually fixing #52697.
4269         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4270         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4271         from other methods.
4272         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4273         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4274         (VerifyUsing, error246): Update.
4275         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4276         'NamespaceEntry.LookupNamespaceOrType'.
4277
4278 2004-12-03  Martin Baulig  <martin@ximian.com>
4279
4280         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4281         method as our child, call AnonymousMethod.Compatible() on it.
4282
4283 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4284
4285         Disable XML documentation support in 'basic' profile.
4286         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4287         Redirect XmlElement to System.Object.
4288         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4289         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4290         * mcs.exe.sources: Add doc-bootstrap.cs.
4291         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4292         of doc.cs.
4293
4294 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4295
4296         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4297           comments are allowed.
4298
4299 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4300
4301         * delegate.cs: Add checks for subtypes in paramaters and return values
4302         in VerifyMethod () to add support for Covariance/Contravariance
4303         in delegates.
4304         
4305 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4306
4307         * report.cs: Remove extra closing parenthesis.
4308
4309         * convert.cs (Error_CannotImplicitConversion): If the name of the
4310         types are the same, provide some extra information.
4311
4312         * class.cs (FieldBase): Use an unused bit field from the field to
4313         encode the `has_offset' property from the FieldMember.  This saves
4314         a couple of Ks on bootstrap compilation.
4315
4316         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4317         method as our child, return the AnonymousMethod resolved
4318         expression.
4319
4320         * expression.cs (New.DoResolve): Allow return values from
4321         NewDelegate to also include AnonymousMethods.
4322
4323         Fixes #70150.
4324
4325 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4326
4327         Fix bug #70102
4328         * attribute.cs (Resolve): Improved implementation of params
4329         attribute arguments.
4330
4331         * support.cs (ParameterData): Add HasParams to be faster.
4332
4333 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4334
4335         all things are for /doc support:
4336
4337         * doc.cs: new file that supports XML documentation generation.
4338         * mcs.exe.sources: added doc.cs.
4339         * driver.cs:
4340           Handle /doc command line option.
4341           Report error 2006 instead of 5 for missing file name for /doc.
4342           Generate XML documentation when required, after type resolution.
4343         * cs-tokenizer.cs:
4344           Added support for picking up documentation (/// and /** ... */),
4345           including a new XmlCommentState enumeration.
4346         * cs-parser.jay:
4347           Added lines to fill Documentation element for field, constant,
4348           property, indexer, method, constructor, destructor, operator, event
4349           and class, struct, interface, delegate, enum.
4350           Added lines to warn incorrect comment.
4351         * rootcontext.cs :
4352           Added Documentation field (passed only when /doc was specified).
4353         * decl.cs:
4354           Added DocComment, DocCommentHeader, GenerateDocComment() and
4355           OnGenerateDocComment() and some supporting private members for
4356           /doc feature to MemberCore.
4357         * class.cs:
4358           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4359         * delegate.cs:
4360           Added overriden DocCommentHeader.
4361         * enum.cs:
4362           Added overriden DocCommentHeader and GenerateDocComment().
4363
4364 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4365
4366         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4367         unwrapping the enumeration values, chain to
4368         DoConstantNumericPromotions again, so we can promote things to the
4369         fundamental types (takes care of enums that are bytes, sbytes).
4370
4371         Fixes bug #62054.
4372
4373 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4374
4375         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4376         Fix long-standing bug in type-lookup.  Use FindType instead of
4377         LookupType when ec.ResolvingTypeTree.
4378         (Attribute.ResolveType, Attribute.Resolve)
4379         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4380         Update to changes.
4381         (Attributes.Search): Remove internal version.  Update.
4382         (Attributes.SearchMulti): Update.
4383         (Attributes.GetClsCompliantAttribute): Remove.
4384         (Attributes.GetIndexerNameAttribute): Remove.
4385         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4386         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4387         * class.cs (Indexer.Define): Likewise.
4388
4389 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4390
4391         Fix bug #68790
4392         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4393         MarshallByReference members access.
4394
4395         * expression.cs: Use CheckMarshallByRefAccess;
4396         Better error CS0197 message.
4397
4398         * report.cs: Print whole related error message.
4399
4400 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4401
4402         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4403         the current directory to help debugging.
4404
4405 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4406
4407         * class (GetClassBases): Better error 60 report.
4408         (EventProperty): Disabled warning 67 detection.
4409
4410 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4411
4412         Fix bug #60324
4413         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4414
4415         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4416         precise values.
4417
4418 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4419
4420         Fix bug #49488
4421         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4422
4423         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4424
4425 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4426
4427         * attribute.cs (Attribute.Resolve): Refine error reporting and
4428         report a cs0117 if the identifier does not exist, to distinguish
4429         from 0617 which is a miss-use of the actual identifier.
4430
4431         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4432         between cs0070 and cs0079.
4433
4434         * class.cs (MemberBase.DoDefine): When reporting a wrong
4435         accessibility level, we use MethodCore to compare instead of
4436         Method (this was a regression in some refactoring effort).
4437
4438         So now we correctly report cs0056 again.
4439
4440         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4441         testing the target_type (which was known to be object_type) and
4442         not the source type (which is anonymous_method).
4443
4444         Fixed reporting of error cs1660.
4445
4446         * expression.cs (UserCast.Source): Expose the underlying cast.
4447
4448         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4449         allowed types to find a match to int32 first (most common).
4450
4451         In addition, it ignores any ImplicitUserConversions that did an
4452         internal implicit conversion (as the switch statement allows only
4453         one integral conversion to exist).
4454
4455         * class.cs (PartialContainer.Create): rename `name' to
4456         `member_name' for clarity.  Then replace the string calls with a
4457         call to MemberName.GetPartialName, as now using
4458         MemberName.ToString is an error (this is due to the side effects
4459         it had, that were fixed in the past).
4460
4461         This will restore the error reporting on a number of partial class
4462         errors that were missusing this (and getting an exception as a
4463         results, which is now just a plain textual warning, because
4464         yyparse debug output would crash otherwise).
4465
4466 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4467
4468         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4469
4470 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4471
4472         * rootcontext.cs (LookupType): Make sure to cache lookups that
4473         don't give us a negative result. This saves about 5% of corlib
4474         compilation time.
4475
4476 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4477
4478         * report.cs (AbstractMessage.Print): messages are sent to stderr
4479
4480         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4481         non-interface in the list of interfaces (at this point, either
4482         parent was properly set, or a base class is being listed in the
4483         interfaces section).
4484
4485         This flags error 1722, and resolves the crash from bug 69259.
4486
4487 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4488
4489         * statement.cs (Using.EmitExpressionFinally): make this work right
4490         for valuetypes. Fixes 69926.
4491
4492 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4493
4494         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4495         converted to an enum" here, before we try to change the underlying
4496         type.  This code exists, but it is a different code path than the
4497         one used while encoding constants.
4498
4499         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4500         old bug: when converting from the null literal to a pointer,
4501         return an EmptyCast, not the NullLiteral.
4502
4503         This fixes #69921, the recent null_type changes probably made this
4504         bug more prominent.
4505
4506         (ImplicitReferenceConversionExists): In addition, resynchronized
4507         the code here, so it matches the same code in
4508         ImplicitReferenceConversionExists for the `from any class-type S
4509         to any interface-type T'.
4510         
4511
4512 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4513
4514         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4515
4516 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4517
4518         * cs-parser.jay: Use verbosity accordingly. 
4519
4520 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4521
4522         * expression.cs (Unary.ResolveOperator): Do not report warning;
4523         AddressOf reads from variable.
4524         
4525         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4526
4527 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4528
4529         Fix bug #69462
4530
4531         * attribute.cs (Attributable): Removed CheckTargets.
4532         (Attributes.Emit): Explicit attribute targets are tested here.
4533
4534         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4535         not enabled for interfaces.
4536
4537         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4538         (GetAssemblyName): Ouch next bug there.
4539
4540 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4541
4542         * expression.cs: Error 275 added.
4543         
4544 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4545
4546         Fix bug #69177 (Implemented decimal constant support)
4547
4548         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4549         (BinaryFold): Add DecimalConstant.
4550
4551         * const.cs (Define): Decimal constant 
4552         (is not constant.
4553         (ChangeType): Add decimal type handling.
4554         (LookupConstantValue): Don't set value for decimal type but
4555         emit DecimalConstantAttribute. Needed for constant optimization.
4556
4557         * constant.cs (ToDecimal): New method.
4558         (ConvertToDecimal): New method.
4559         (IntConstant): Implemented ConvertToDecimal.
4560         (DecimalConstant.Emit): Emit optimized version for decimals in
4561         int range.
4562
4563         * expression.cs (ResolveOperator): Changed order of constant
4564         reduction to work correctly with native types which have
4565         overloaded operators.
4566         (ResolveMemberAccess): Extract constant value from attribute
4567         for decimal type.
4568
4569         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4570
4571         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4572         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4573         (ChangeType): Decimal is special.
4574         (TypeToCoreType): Add decimal type.
4575
4576 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4577
4578         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4579         decimal types.
4580
4581 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4582
4583         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4584         test cs1667-5.cs.
4585
4586 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4587
4588         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4589
4590         * pending.cs (PendingImplementation): Grab only interfaces.
4591
4592 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4593
4594         * statement.cs (ForeachHelperMethods): Add location member and
4595         error 202 detection.
4596
4597 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4598
4599         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4600         automatically handled by executable.make.
4601         (PROGRAM): Make profile-specific.
4602
4603 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4604
4605         * expression.cs (DoResolveBase): Fixed wrong warning for out
4606         variables.
4607
4608 2004-11-18  Martin Baulig  <martin@ximian.com>
4609
4610         Merged latest changes into gmcs.  Please keep this comment in
4611         here, it makes it easier for me to see what changed in MCS since
4612         the last time I merged.
4613
4614 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4615
4616         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4617         (TypeHandle.GetMemberCache): New.
4618         (TypeHandle.TypeHandle): Update.
4619         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4620         (TypeManager.LookupParentInterfacesCache):
4621         Rename from LookupInterfaceCache.  Optimize slightly.
4622         (TypeManager.MemberLookup_FindMembers): Update.
4623         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4624         multi-type variant.
4625         (AddCacheContents): Rename from AddHashtable.
4626         * class.cs (TypeContainer.parent_container): Remove.
4627         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4628         (TypeContainer.DoDefineMembers): Don't initialize it.
4629         Update to name changes.
4630         
4631 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4632
4633         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4634         that factors the code to check access modifiers on override.  
4635
4636         (PropertyBase): Use the code here.
4637
4638         Patch from Lluis S'anchez, fixes bug #69361.
4639
4640 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4641
4642         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4643         routine that is used to report the use of a captured variable
4644         whose address has been taken.
4645
4646         There are two checks: one when variables are being captured and
4647         the other check is when the address of a variable is taken. 
4648         
4649         (because an anonymous methods might be resolved before *or* after
4650         the address has been taken) and 
4651
4652         * expression.cs (Conditional.DoResolve): Remove the special
4653         casing that Martin added to trueExpr and falseExpr being both
4654         NullLiteral.  We get the right behavior now just by introducing
4655         the null_type into the compiler. 
4656
4657         * convert.cs (ExplicitConversion): Change the code to use
4658         null_type instead of testing `expr is NullLiteral'.
4659         (ImplicitConversionStandard): use null_type too.
4660         (ImplicitReferenceConversionExists): use null_type too.
4661         (ImplicitReferenceConversion): use null_type too.
4662
4663         * literal.cs: The type of `NullLiteral' is now null_type instead
4664         of object_type. 
4665         (Resolve): Set the type here.
4666
4667         * typemanager.cs: Introduce null_type.
4668
4669 2004-11-17  Martin Baulig  <martin@ximian.com>
4670
4671         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4672         direction, like FindMembers() does.  Fixes #69546, testcase is in
4673         test-315.cs.    
4674
4675 2004-11-16  Martin Baulig  <martin@ximian.com>
4676
4677         This is based on a patch from Marek Safar, see bug #69082.
4678         Fixes bugs #63705 and #67130.
4679
4680         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4681         method; create a MemberCache for an interface type and cache the
4682         result.
4683
4684         * decl.cs (IMemberContainer.ParentContainer): Removed.
4685         (IMemberContainer.ParentCache): New property.
4686         (MemberCache.SetupCacheForInterface): Removed.
4687         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4688         to create a cache for an interface's "parent".
4689
4690         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4691         interfaces too.
4692
4693 2004-11-16  Martin Baulig  <martin@ximian.com>
4694
4695         Merged back from gmcs; these changes already went into gmcs a
4696         couple of weeks ago.
4697
4698         * typemanager.cs
4699         (TypeManager.AddUserType): Removed the `ifaces' argument.
4700         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4701         `TypeExpr []'.
4702         (TypeManager.AddUserInterface): Removed.
4703         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4704         `TypeExpr []'.
4705         (TypeManager.GetInterfaces): Likewise.
4706         (TypeManager.GetExplicitInterfaces): Likewise.
4707
4708         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4709
4710         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4711         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4712
4713 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4714
4715         * statement.cs: Avoid adding bools to a hashtable.
4716
4717 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4718
4719         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4720         calling an unsafe method from a safe location.
4721
4722 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4723
4724         Fix #69167
4725         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4726
4727 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4728
4729         * namespace.cs (VerifyUsing): use GetPartialName instead of
4730         ToString. 
4731
4732 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4733
4734         * statement.cs (Return.Resolve): Fix regression in typo: if
4735         `in_exc', we have to request a NeedReturnLabel, this was a typo
4736         introduced in the anonymous method check-in.  Fixes #69131.
4737
4738         * Indexers were using the ShortName when defining themselves,
4739         causing a regression in the compiler bootstrap when applying the
4740         patch from 2004-11-02 (first part), now they use their full name
4741         and the bug is gone.
4742
4743 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4744
4745         * driver.cs: Strip the path from the names of embedded resources. Fixes
4746         #68519.
4747
4748 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4749
4750         Fix error message regression: cs0104-2.cs.
4751         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4752         (AliasEntry.Resolve): Update.
4753         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4754         'silent' flag.
4755         (RootContext.LookupType): Update.
4756
4757 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4758
4759         * cs-parser.jay: Add support for handling accessor modifiers
4760         * class: Add support port accessor modifiers and error checking,
4761         define PropertyMethod.Define as virtual (not abstract anymore)
4762         * ecore.cs: Add checking for proeprties access with access modifiers
4763         * iterators.cs: Modify Accessor constructor call based in the modified
4764         constructor
4765 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4766
4767         * expression.cs (StringConcat): Handle being called twice,
4768         as when we have a concat in a field init with more than two
4769         ctors in the class
4770
4771 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4772
4773         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4774         special case explicit implementations, we should always produce
4775         the .property or .event declaration.
4776         
4777         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4778         since it will not return correct data if people use this
4779         unresolved in the presence of using statements (see test-313).
4780
4781         * class.cs (MethodData.Define): If we are an explicit interface
4782         implementation, set the method name to the full name of the
4783         interface plus the name of the method.  
4784
4785         Notice that using the method.MethodName.GetFullName() does not
4786         work, as it will only contain the name as declared on the source
4787         file (it can be a shorthand in the presence of using statements)
4788         and not the fully qualifed type name, for example:
4789
4790         using System;
4791
4792         class D : ICloneable {
4793                 object ICloneable.Clone ()  {
4794                 }
4795         }
4796
4797         Would produce a method called `ICloneable.Clone' instead of
4798         `System.ICloneable.Clone'.
4799
4800         * namespace.cs (Alias.Resolve): Use GetPartialName.
4801         
4802 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4803
4804         * cs-parser.jay: Add error 1055 report.
4805
4806 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4807
4808         * assign.cs (Assign.DoResolve): Only do the transform of
4809         assignment into a New if the types are compatible, if not, fall
4810         through and let the implicit code deal with the errors and with
4811         the necessary conversions. 
4812
4813 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4814
4815         * cs-parser.jay: Add error 1031 report.
4816
4817         * cs-tokenizer.cs: Add location for error 1038.
4818
4819 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4820
4821         * cs-parser.jay: Add error 1016 report.
4822
4823 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * cs-parser.jay: Add errors 1575,1611 report.
4826
4827 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4828
4829         * cs-parser.jay: Add error 1001 report.
4830
4831 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4832
4833         Fix #68850
4834         * attribute.cs (GetMarshal): Add method argument for
4835         caller identification.
4836
4837         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4838         agument for GetMarshal and RuntimeMissingSupport.
4839
4840 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4841
4842         * attribute.cs (ExtractSecurityPermissionSet): Removed
4843         TypeManager.code_access_permission_type.
4844
4845         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4846
4847 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4848
4849         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4850         for obsolete use of a variable here.   Fixes regression on errors
4851         cs0619-25 and cs0619-26.
4852
4853 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4854
4855         Fix #62358, implemented security attribute encoding.
4856
4857         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4858         Tests permitted SecurityAction for assembly or other types.
4859         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4860         data from SecurityPermissionAttribute to PermisionSet class.
4861
4862         * class.cs (ApplyAttributeBuilder): Added special handling
4863         for System.Security.Permissions.SecurityAttribute based types.
4864
4865         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4866         special handling for System.Security.Permissions.SecurityAttribute
4867         based types.
4868
4869         * enum.cs (ApplyAttributeBuilder): Added special handling
4870         for System.Security.Permissions.SecurityAttribute based types.
4871
4872         * parameter.cs (ApplyAttributeBuilder): Added special handling
4873         for System.Security.Permissions.SecurityAttribute based types.
4874
4875         * rootcontext.cs: Next 2 core types.
4876
4877         * typemanager.cs (TypeManager.security_permission_attr_type):
4878         Built in type for the SecurityPermission Attribute.
4879         (code_access_permission_type): Build in type.
4880
4881 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4882
4883         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4884         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4885         all of this information into
4886         EmitContext.EmitCapturedVariableInstance.
4887         
4888         * codegen.cs (EmitCapturedVariableInstance): move here the
4889         funcionality of emitting an ldarg.0 in the presence of a
4890         remapping.   This centralizes the instance emit code.
4891
4892         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4893         then emit a load of this: it means that we have reached the
4894         topmost ScopeInfo: the one that contains the pointer to the
4895         instance of the class hosting the anonymous method.
4896
4897         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4898         captures to the topmost CaptureContext.
4899
4900 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4901
4902         * expression.cs (LocalVariableReference): Move the knowledge about
4903         the iterators into codegen's EmitCapturedVariableInstance.
4904
4905 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4906
4907         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4908         all code paths return a value from an anonymous method (it is the
4909         same as the 161 error, but for anonymous methods).
4910
4911 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4912
4913         The introduction of anonymous methods in the compiler changed
4914         various ways of doing things in the compiler.  The most
4915         significant one is the hard split between the resolution phase
4916         and the emission phases of the compiler.
4917
4918         For instance, routines that referenced local variables no
4919         longer can safely create temporary variables during the
4920         resolution phase: they must do so from the emission phase,
4921         since the variable might have been "captured", hence access to
4922         it can not be done with the local-variable operations from the runtime.
4923         
4924         * statement.cs 
4925
4926         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4927         is a toplevel block.
4928
4929         (ToplevelBlock): A new kind of Block, these are the blocks that
4930         are created by the parser for all toplevel method bodies.  These
4931         include methods, accessors and anonymous methods.
4932
4933         These contain some extra information not found in regular blocks:
4934         A pointer to an optional CaptureContext (for tracking captured
4935         local variables and parameters).  A pointer to the parent
4936         ToplevelBlock.
4937         
4938         (Return.Resolve): Catch missmatches when returning a value from an
4939         anonymous method (error 1662).
4940         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4941         phase.
4942
4943         (Break.Resolve): ditto.
4944
4945         (SwitchLabel): instead of defining the labels during the
4946         resolution phase, we now turned the public ILLabel and ILLabelCode
4947         labels into methods called GetILLabelCode() and GetILLabel() that
4948         only define the label during the Emit phase.
4949
4950         (GotoCase): Track the SwitchLabel instead of the computed label
4951         (its contained therein).  Emit the code by using
4952         SwitchLabel.GetILLabelCode ().
4953
4954         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4955         whether the Local has been captured or not.
4956
4957         (LocalInfo.IsCaptured): New property, used to tell whether the
4958         local has been captured.
4959         
4960         * anonymous.cs: Vastly updated to contain the anonymous method
4961         support.
4962
4963         The main classes here are: CaptureContext which tracks any
4964         captured information for a toplevel block and ScopeInfo used to
4965         track the activation frames for various local variables.   
4966
4967         Each toplevel block has an optional capture context associated
4968         with it.  When a method contains an anonymous method both the
4969         toplevel method and the anonymous method will create a capture
4970         context.   When variables or parameters are captured, they are
4971         recorded on the CaptureContext that owns them, for example:
4972
4973         void Demo () {
4974              int a;
4975              MyDelegate d = delegate {
4976                  a = 1;
4977              }
4978         }
4979
4980         Here `a' will be recorded as captured on the toplevel
4981         CapturedContext, the inner captured context will not have anything
4982         (it will only have data if local variables or parameters from it
4983         are captured in a nested anonymous method.
4984
4985         The ScopeInfo is used to track the activation frames for local
4986         variables, for example:
4987
4988         for (int i = 0; i < 10; i++)
4989                 for (int j = 0; j < 10; j++){
4990                    MyDelegate d = delegate {
4991                         call (i, j);
4992                    }
4993                 }
4994
4995         At runtime this captures a single captured variable `i', but it
4996         captures 10 different versions of the variable `j'.  The variable
4997         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4998         recorded on a child.  
4999
5000         The toplevel ScopeInfo will also track information like the `this'
5001         pointer if instance variables were referenced (this is necessary
5002         as the anonymous method lives inside a nested class in the host
5003         type of the method). 
5004
5005         (AnonymousMethod): Expanded to track the Toplevel, implement
5006         `AnonymousMethod.Compatible' to tell whether an anonymous method
5007         can be converted to a target delegate type. 
5008
5009         The routine now also produces the anonymous method content
5010
5011         (AnonymousDelegate): A helper class that derives from
5012         DelegateCreation, this is used to generate the code necessary to
5013         produce the delegate for the anonymous method that was created. 
5014
5015         * assign.cs: API adjustments for new changes in
5016         Convert.ImplicitStandardConversionExists.
5017
5018         * class.cs: Adjustments to cope with the fact that now toplevel
5019         blocks are of type `ToplevelBlock'. 
5020
5021         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5022         insteda of standard blocks.
5023
5024         Flag errors if params arguments are passed to anonymous methods.
5025
5026         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5027         `CurrentAnonymousMethod' which points to the current Anonymous
5028         Method.  The variable points to the AnonymousMethod class that
5029         holds the code being compiled.  It is set in the new EmitContext
5030         created for the anonymous method.
5031
5032         (EmitContext.Phase): Introduce a variable and an enumeration to
5033         assist in enforcing some rules about when and where we are allowed
5034         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5035         only one that enfonces this right now).
5036
5037         (EmitContext.HaveCaptureInfo): new helper method that returns
5038         whether we have a CapturedContext initialized.
5039
5040         (EmitContext.CaptureVariable): New method used to register that a
5041         LocalInfo must be flagged for capturing. 
5042
5043         (EmitContext.CapturedParameter): New method used to register that a
5044         parameters must be flagged for capturing. 
5045         
5046         (EmitContext.CapturedField): New method used to register that a
5047         field must be flagged for capturing. 
5048
5049         (EmitContext.HaveCapturedVariables,
5050         EmitContext.HaveCapturedFields): Return whether there are captured
5051         variables or fields. 
5052
5053         (EmitContext.EmitMethodHostInstance): This is used to emit the
5054         instance for the anonymous method.  The instance might be null
5055         (static methods), this (for anonymous methods that capture nothing
5056         and happen to live side-by-side with the current method body) or a
5057         more complicated expression if the method has a CaptureContext.
5058
5059         (EmitContext.EmitTopBlock): Routine that drives the emission of
5060         code: it will first resolve the top block, then emit any metadata
5061         and then emit the code.  The split is done so that we can extract
5062         any anonymous methods and flag any captured variables/parameters.
5063         
5064         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5065         during this phase, the ILGenerator should not be used as labels
5066         and local variables declared here might not be accessible to any
5067         code that is part of an anonymous method.  
5068
5069         Exceptions to this include the temporary variables that are
5070         created by some statements internally for holding temporary
5071         variables. 
5072         
5073         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5074         metadata for a cb
5075
5076         (EmitContext.TemporaryReturn): This method is typically called
5077         from the Emit phase, and its the only place where we allow the
5078         ReturnLabel to be defined other than the EmitMeta.  The reason is
5079         that otherwise we would have to duplicate a lot of logic in the
5080         Resolve phases of various methods that today is on the Emit
5081         phase. 
5082
5083         (EmitContext.NeedReturnLabel): This no longer creates the label,
5084         as the ILGenerator is not valid during the resolve phase.
5085
5086         (EmitContext.EmitThis): Extended the knowledge in this class to
5087         work in anonymous methods in addition to iterators. 
5088
5089         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5090         code is necessary on the stack to access the instance to a local
5091         variable (the variable will be accessed as a field).
5092
5093         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5094         EmitContext.EmitAddressOfParameter): Routines to support
5095         parameters (not completed at this point). 
5096         
5097         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5098         will also remove the parameters.
5099
5100         * convert.cs (Convert): Define a `ConstantEC' which points to a
5101         null.  This is just to prefity some code that uses
5102         ImplicitStandardConversion code and do not have an EmitContext
5103         handy.
5104
5105         The idea is to flag explicitly that at that point in time, it is
5106         known that the conversion will not trigger the delegate checking
5107         code in implicit conversions (which requires a valid
5108         EmitContext). 
5109
5110         Everywhere: pass new EmitContext parameter since
5111         ImplicitStandardConversionExists now requires it to check for
5112         anonymous method conversions. 
5113
5114         (Convert.ImplicitStandardConversionExists): If the type of an
5115         expression is the anonymous_method_type, and the type is a
5116         delegate, we invoke the AnonymousMethod.Compatible method to check
5117         whether an implicit conversion is possible. 
5118
5119         (Convert.ImplicitConversionStandard): Only do implicit method
5120         group conversions if the language level is not ISO_1.
5121
5122         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5123         MethodInfo for the Invoke method.  used by Delegate and
5124         AnonymousDelegate.
5125
5126         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5127         method conversions if the target type is a delegate.
5128
5129         Removed extra debugging nops.
5130
5131         (LocalVariableReference): Turn the `local_info' into a public
5132         field. 
5133
5134         Add `prepared' field, the same hack used for FieldExprs to cope
5135         with composed assignments, as Local variables do not necessarily
5136         operate purely on the stack as they used to: they can be captured
5137         fields. 
5138
5139         Add `temp' for a temporary result, like fields.
5140
5141         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5142
5143         It now copes with Local variables that are captured and emits the
5144         proper instance variable to load it from a field in the captured
5145         case. 
5146
5147         (ParameterReference.DoResolveBase): During the resolve phase,
5148         capture parameters if we are in an anonymous method.
5149
5150         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5151         anonymous method, use the EmitContext helper routines to emit the
5152         parameter reference.
5153
5154         * iterators.cs: Set RemapToProxy to true/false during the
5155         EmitDispose class.
5156
5157         * parameters.cs (GetParameterByName): New helper method. 
5158
5159         * typemanager.cs (anonymous_method_type) a new type that
5160         represents an anonyous method.  This is always an internal type,
5161         used as a fencepost to test against the anonymous-methodness of an
5162         expression. 
5163         
5164 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5165
5166         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5167         561 report.
5168         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5169
5170 2004-10-18  Martin Baulig  <martin@ximian.com>
5171
5172         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5173         `Type' directly, but call ResolveType() on it.
5174         (Catch.Resolve): Likewise.
5175         (Foreach.Resolve): Likewise.
5176
5177 2004-10-18  Martin Baulig  <martin@ximian.com>
5178
5179         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5180         `Type' directly, but call ResolveType() on it.
5181         (Probe.DoResolve): Likewise.
5182         (ArrayCreation.LookupType): Likewise.
5183         (TypeOf.DoResolve): Likewise.
5184         (SizeOf.DoResolve): Likewise.
5185
5186 2004-10-18  Martin Baulig  <martin@ximian.com>
5187
5188         * expression.cs (Invocation.BetterFunction): Put back
5189         TypeManager.TypeToCoreType().
5190
5191 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5192
5193         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5194         the ResolveType.
5195
5196 2004-10-18  Martin Baulig  <martin@ximian.com>
5197
5198         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5199         `Type' directly, but call ResolveType() on it.
5200
5201 2004-10-18  Martin Baulig  <martin@ximian.com>
5202
5203         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5204         `Type' directly, but call ResolveType() on it.
5205         (MemberBase.DoDefine): Likewise.
5206
5207         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5208         `Type' directly, but call ResolveType() on it.
5209         (ComposedCast.DoResolveAsTypeStep): Likewise.
5210
5211         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5212         `Type' directly, but call ResolveType() on it.
5213
5214 2004-10-17  John Luke  <john.luke@gmail.com>
5215
5216         * class.cs (Operator.GetSignatureForError): use CSharpName
5217
5218         * parameter.cs (Parameter.GetSignatureForError): Returns
5219         correct name even if was not defined.
5220
5221 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5222
5223         Fix #65816.
5224         * class.cs (TypeContainer.EmitContext): New property.
5225         (DefineNestedTypes): Create an emitcontext for each part.
5226         (MethodCore.DoDefineParameters): Use container's emitcontext.
5227         Pass type array to InternalParameters.
5228         (MemberBase.DoDefine): Use container's emitcontext.
5229         (FieldMember.Define): Likewise.
5230         (Event.Define): Likewise.
5231         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5232         Pass type array to InternalParameters.
5233         (SetIndexerMethod.GetParameterInfo): Likewise.
5234         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5235         * delegate.cs (Define): Pass emitcontext to
5236         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5237         array to InternalParameters.
5238         * expression.cs (ParameterReference.DoResolveBase): Pass
5239         emitcontext to GetParameterInfo.
5240         (ComposedCast.DoResolveAsTypeStep): Remove check on
5241         ec.ResolvingTypeTree.
5242         * parameter.cs (Parameter.Resolve): Change argument to
5243         EmitContext.  Use ResolveAsTypeTerminal.
5244         (Parameter.GetSignature): Change argument to EmitContext.
5245         (Parameters.ComputeSignature): Likewise.
5246         (Parameters.ComputeParameterTypes): Likewise.
5247         (Parameters.GetParameterInfo): Likewise.
5248         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5249         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5250         * support.cs (InternalParameters..ctor): Remove variant that takes
5251         a DeclSpace.
5252         * typemanager.cs (system_intptr_expr): New.
5253         (InitExpressionTypes): Initialize it.
5254
5255 2004-10-12  Chris Toshok  <toshok@ximian.com>
5256
5257         * cs-parser.jay: fix location for try_statement and catch_clause.
5258
5259 2004-10-11  Martin Baulig  <martin@ximian.com>
5260
5261         * report.cs: Don't make --fatal abort on warnings, we have
5262         -warnaserror for that.
5263
5264 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5265
5266         More DeclSpace.ResolveType avoidance.
5267         * decl.cs (MemberCore.InUnsafe): New property.
5268         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5269         with newly created EmitContext.
5270         (FieldMember.Define): Likewise.
5271         * delegate.cs (Delegate.Define): Likewise.
5272         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5273         only if normal name-lookup fails.
5274         (TypeExpr.DoResolve): Enable error-checking.
5275         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5276         (SizeOf.DoResolve): Likewise.
5277         (ComposedCast.DoResolveAsTypeStep): Likewise.
5278         (StackAlloc.DoResolve): Likewise.
5279         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5280         (Block.Unsafe): New property.
5281         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5282         (Unsafe): Set 'unsafe' flag of contained block.
5283         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5284         (Fixed.Resolve): Likewise.
5285         (Catch.Resolve): Likewise.
5286         (Using.ResolveLocalVariableDecls): Likewise.
5287         (Foreach.Resolve): Likewise.
5288
5289 2004-10-05  John Luke <john.luke@gmail.com>
5290
5291         * cs-parser.jay: add location to error CS0175
5292
5293 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5294
5295         * ecore.cs (Expression.Constantity): Add support for turning null
5296         into a constant.
5297
5298         * const.cs (Const.Define): Allow constants to be reference types
5299         as long as the value is Null.
5300
5301 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5302
5303         * namespace.cs (NamespaceEntry.Using): No matter which warning
5304         level is set, check if this namespace name has already been added.
5305
5306 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5307
5308         * expression.cs: reftype [!=]= null should always use br[true,false].
5309         # 67410
5310
5311 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5312
5313         Fix #67108
5314         * attribute.cs: Enum conversion moved to 
5315         GetAttributeArgumentExpression to be applied to the all
5316         expressions.
5317
5318 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5319
5320         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5321         * class.c (TypeContainer.DefineType): Flag error if
5322         base types aren't accessible due to access permissions.
5323         * decl.cs (DeclSpace.ResolveType): Move logic to
5324         Expression.ResolveAsTypeTerminal.
5325         (DeclSpace.ResolveTypeExpr): Thin layer over
5326         Expression.ResolveAsTypeTerminal.
5327         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5328         Refactor code into NestedAccess.  Use it.
5329         (DeclSpace.NestedAccess): New.
5330         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5331         argument to silence errors.  Check access permissions.
5332         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5333         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5334         (Cast.DoResolve): Likewise.
5335         (New.DoResolve): Likewise.
5336         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5337         (TypeOf.DoResolve): Likewise.
5338
5339         * expression.cs (Invocation.BetterConversion): Return the Type of
5340         the better conversion.  Implement section 14.4.2.3 more faithfully.
5341         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5342         section 14.4.2.2 explicit.
5343         (Invocation.OverloadResolve): Update.
5344         (Invocation): Remove is_base field.
5345         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5346         (Invocation.Emit): Likewise.
5347
5348 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5349
5350         * README: Update to changes.
5351
5352 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5353
5354         * cs-parser.jay: Reverted 642 warning fix.
5355
5356 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5357
5358         Fix bug #66615
5359         * decl.cs (FindMemberWithSameName): Indexer can have more than
5360         1 argument.
5361
5362 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5363
5364         * expression.cs (LocalVariableReference.DoResolveLValue):
5365         Do not report warning 219 for out values.
5366         (EmptyExpression.Null): New member to avoid extra allocations.
5367
5368 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5369
5370         * cs-parser.jay: Fix wrong warning 642 report.
5371
5372         * cs-tokenizer.cs (CheckNextToken): New helper;
5373         Inspect next character if is same as expected.
5374
5375 2004-09-23  Martin Baulig  <martin@ximian.com>
5376
5377         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5378         (Convert.ImplicitReferenceConversionExists): Likewise.
5379
5380 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5381
5382         * class.cs (Operator.Define): Add error 448 and 559 report.
5383
5384 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5385
5386         * class.cs (MemberBase.IsTypePermitted): New protected
5387         method for checking error CS0610.
5388
5389 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5390
5391         * class.cs (TypeContainer.HasExplicitLayout): New property
5392         Returns whether container has StructLayout attribute set Explicit.
5393         (FieldMember): New abstract class for consts and fields.
5394         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5395         (Field): Reuse FieldMember.
5396
5397         * const.cs (Const): Reuse FieldMember.
5398
5399         * rootcontext.cs: EmitConstants call moved to class.
5400
5401 2004-09-22  Martin Baulig  <martin@ximian.com>
5402
5403         Thanks to Peter Sestoft for this bug report.
5404
5405         * expression.cs (Conditional): If both the `trueExpr' and the
5406         `falseExpr' is a NullLiteral, return a NullLiteral.
5407
5408 2004-09-22  Martin Baulig  <martin@ximian.com>
5409
5410         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5411         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5412         for the "get_Current" call.
5413
5414 2004-09-22  Martin Baulig  <martin@ximian.com>
5415
5416         Marek and me just fixed one of our oldest bugs: #28562 :-)
5417
5418         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5419
5420         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5421         we're an EnumConstant, just return that.
5422         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5423         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5424         to get the value which'll actually be written into the attribute.
5425         However, we have to use GetValue() to access the attribute's value
5426         in the compiler.        
5427
5428 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5429
5430         * constant.cs (Constant.IsNegative): New abstract property
5431         IsNegative.
5432
5433         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5434         (StackAlloc.DoResolve): Reused IsNegative.
5435
5436 2004-09-21  Martin Baulig  <martin@ximian.com>
5437
5438         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5439         if we're used in an iterator, we may be called from different
5440         methods.
5441
5442         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5443         we actually have an exception block.
5444
5445 2004-09-20  John Luke <jluke@cfl.rr.com>
5446
5447         * class.cs, cs-parser.jay: Improve the error report for 1520:
5448         report the actual line where the error happens, not where the
5449         class was declared.
5450
5451         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5452         Pass location information that was available elsewhere.
5453
5454 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5455
5456         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5457         runtime to delay sign assemblies.
5458
5459 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5460
5461         * cs-parser.jay: Do not report the stack trace, this is barely
5462         used nowadays.
5463
5464 2004-08-22  John Luke  <john.luke@gmail.com>
5465  
5466         * driver.cs : check that a resource id is not already used
5467         before adding it, report CS1508 if it is, bug #63637
5468
5469 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5470
5471         * ecore.cs: Removed dead code.
5472
5473 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5474
5475         * class.cs: Do not report warning CS0067 on the interfaces.
5476
5477 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5478
5479         * cs-parser.jay: Add error 504 report.
5480
5481 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5482
5483         * rootcontext.cs: WarningLevel is 4 by default now.
5484
5485         * statement.cs (Fixed.Resolve): Do not null
5486         VariableInfo.
5487
5488 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5489
5490         Fixed bug #55780
5491         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5492         deep search when property is not virtual.
5493         (PropertyExpr.ResolveAccessors): Make one call for both
5494         accessors.
5495
5496 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5497
5498         Fixed bug #65766
5499         * statement.cs: Error 152 report constains also location.
5500
5501 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5502
5503         Fixed bug #65766
5504         * const.cs: Explicitly set constant as static.
5505
5506 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5507
5508         Fixed bug #64226
5509         * cs-parser.jay: Add error 1017 report.
5510
5511 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5512
5513         Fixed bug #59980, #64224
5514         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5515
5516         * typemanager.cs (IsSpecialMethod): Simplified
5517
5518 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5519
5520         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5521         condition with better params.
5522
5523 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5524
5525         Fixed bug #65238
5526         * attribute.cs (Resolve): Property has to have both
5527         accessors.
5528
5529 2004-09-14  Martin Baulig  <martin@ximian.com>
5530
5531         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5532
5533 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5534
5535         Fixed bug #61902
5536         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5537         called and is obsolete then this member suppress message
5538         when call is inside next [Obsolete] method or type.
5539
5540         * expression.cs: Use TestObsoleteMethodUsage member.
5541
5542 2004-09-14  Martin Baulig  <martin@ximian.com>
5543
5544         * cs-parser.jay: Sync a bit with the GMCS version.
5545
5546 2004-09-14  Martin Baulig  <martin@ximian.com>
5547
5548         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5549         (CSharpParser.yacc_verbose_flag): New public field.
5550
5551         * genericparser.cs: Removed.
5552
5553 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5554
5555         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5556
5557 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5558
5559         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5560
5561 2004-09-10  Martin Baulig  <martin@ximian.com>
5562
5563         Backported my MemberName changes from GMCS into MCS.
5564
5565         - we are now using a special `MemberName' class instead of using
5566         strings; in GMCS, the `MemberName' also contains the type
5567         arguments.
5568
5569         - changed the grammar rules a bit:
5570           * the old `member_name' is now a `namespace_or_type_name':
5571             The rule is that we use `namespace_or_type_name' everywhere
5572             where we expect either a "member name" (GetEnumerator) or a
5573             "member name" with an explicit interface name
5574             (IEnumerable.GetEnumerator).
5575             In GMCS, the explicit interface name may include type arguments
5576             (IEnumerable<T>.GetEnumerator).
5577           * we use `member_name' instead of just `IDENTIFIER' for
5578             "member names":
5579             The rule is that we use `member_name' wherever a member may
5580             have type parameters in GMCS.       
5581
5582         * decl.cs (MemberName): New public class.
5583         (MemberCore.MemberName): New public readonly field.
5584         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5585         (DeclSpace): Likewise.
5586
5587         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5588         * enum.cs (Enum.ctor): Likewise.
5589
5590         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5591         MemberName.     
5592         (AliasEntry.ctor): Take a MemberName, not an Expression.
5593         (AliasEntry.UsingAlias): Likewise.
5594
5595         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5596         (IMethodData.MemberName): Changed type from string to MemberName.
5597         (MemberBase.ExplicitInterfaceName): Likewise.
5598         (AbstractPropertyEventMethod.SetupName): Make this private.
5599         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5600         argument; compute the member name here.
5601         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5602         on the `member.MemberName' and the `prefix'.
5603
5604         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5605         not `type_name'.
5606         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5607         thus, we get a `MemberName' instead of a `string'.  These
5608         declarations may have type parameters in GMCS.
5609         (interface_method_declaration, delegate_declaration): Likewise.
5610         (class_declaration, interface_declaration): Likewise.
5611         (method_header): Use `namespace_or_type_name' instead of
5612         `member_name'.  We may be an explicit interface implementation.
5613         (property_declaration, event_declaration): Likewise.
5614         (member_name): This is now just an `IDENTIFIER', not a
5615         `namespace_or_type_name'.
5616         (type_name, interface_type): Removed.
5617         (namespace_or_type_name): Return a MemberName, not an Expression.
5618         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5619         call GetTypeExpression() on the MemberName to get an expression.
5620         (IndexerDeclaration.interface_type): Changed type from string to
5621         MemberName.
5622         (MakeName): Operate on MemberName's instead of string's.
5623
5624 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5625
5626         Fix bug #55770.
5627         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5628         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5629         lookup to avoid symbols introduced by 'using'.
5630         * rootcontext.cs (NamespaceLookup): Update.
5631
5632 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5633
5634         * class.cs (TypeContainer.DoDefineMembers): Do not call
5635         DefineDefaultConstructor for static classes.
5636
5637 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5638
5639         * attribute.cs (Attribute.Resolve): Add error 653 report.
5640
5641         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5642         report.
5643         (Method.ApplyAttributeBuilder): Add error 685 report.
5644         (Operator.Define): Add error 564 report.
5645
5646         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5647
5648         * expression.cs (Invocation.DoResolve): Add error
5649         245 and 250 report.
5650
5651         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5652         error 674 report.
5653
5654 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5655
5656         * class.cs (ConstructorInitializer.Resolve):
5657         Wrong error number (515->516).
5658
5659 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5660
5661         * class.cs (Indexer.Define): Add error 631 report.
5662
5663 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5664
5665         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5666
5667 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5668
5669         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5670
5671 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5672
5673         * cs-parser.jay: Added error CS0241 report.
5674
5675 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5676
5677         * cs-parser.jay (fixed_statement): Introduce a scope for the
5678         declaration in the 'fixed' statement.
5679
5680 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5681
5682         * cs-parser.jay: Added CS0230 error report.
5683
5684 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5685
5686         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5687
5688 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5689
5690         * expression.cs (Argument.Resolve): Added error CS0192 and
5691         CS0199 report.
5692
5693 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5694
5695         C# 2.0 #pragma warning feature
5696
5697         * cs-tokenizer.cs (PreProcessPragma): New method; 
5698         Handles #pragma directive.
5699
5700         * report.cs (WarningRegions): New class; Support
5701         class for #pragma warning directive. It tests whether
5702         warning is enabled for a given line.
5703
5704 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5705
5706         * const.cs: Add more descriptive error report, tahnks to
5707         Sebastien. 
5708
5709 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5710
5711         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5712
5713 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5714
5715         * expression.cs: Apply patch from Ben: Remove dead code from
5716         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5717         as that code just threw an exception anwyays.
5718
5719         * const.cs: Remove the call to the turnintoconstant, for details
5720         see bug: #63144
5721         
5722         * literal.cs: The type of the null-literal is the null type;  So
5723         we use a placeholder type (literal.cs:System.Null, defined here)
5724         for it.
5725
5726         * expression.cs (Conditional.DoResolve): Remove some old code that
5727         is no longer needed, conversions have been fixed.
5728
5729         (ArrayCreationExpression.DoResolve): Return false if we fail to
5730         resolve the inner expression.
5731
5732 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5733
5734         Fix test-290.cs.
5735         * cs-parser.jay (delegate_declaration): Record a delegate
5736         declaration as a type declaration.
5737         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5738
5739 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5740
5741         * parameter.cs: Do not crash if the type can not be resolved. 
5742
5743         * expression.cs: Report errors with unsafe pointers, fixes #64896
5744
5745 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5746
5747         * expression.cs: Pointer arith always needs to do a conv.i
5748         if the operand is a long. fix 65320
5749
5750 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5751
5752         Fixed cs0619-37.cs, cs0619-38.cs
5753
5754         * enum.cs (GetObsoleteAttribute): Removed.
5755
5756         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5757         on Enum member is double staged. The first is tested member
5758         and then enum.
5759
5760 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5761
5762         Fixed #56986, #63631, #65231
5763
5764         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5765         adds member to name container.
5766         (TypeContainer.AddToTypeContainer): New method, adds type to
5767         name container.
5768         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5769         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5770         AddOperator): Simplified by reusing AddToMemberContainer.
5771         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5772         instead of field.
5773         (Method.CheckForDuplications): Fixed implementation to test all
5774         possibilities.
5775         (MemberBase): Detection whether member is explicit interface
5776         implementation is now in constructor.
5777         (MemberBase.UpdateMemberName): Handles IndexerName.
5778         (Accessor): Changed to keep also location information.
5779         (AbstractPropertyEventMethod): Is derived from MemberCore.
5780         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5781         will be emited or not.
5782         (PropertyBase.AreAccessorsDuplicateImplementation):
5783         Tests whether accessors are not in collision with some method.
5784         (Operator): Is derived from MethodCore to simplify common
5785         operations.
5786
5787         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5788         must be performed.
5789         (DeclSpace.AddToContainer): Adds the member to defined_names
5790         table. It tests for duplications and enclosing name conflicts.
5791
5792         * enum.cs (EnumMember): Clean up to reuse the base structures
5793
5794 2004-09-03  Martin Baulig  <martin@ximian.com>
5795
5796         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5797         into TypeContainer, to make partial classes work again.
5798
5799 2004-09-03  Martin Baulig  <martin@ximian.com>
5800
5801         * rootcontext.cs (RootContext.V2): Removed.
5802
5803 2004-03-23  Martin Baulig  <martin@ximian.com>
5804
5805         * expression.cs (Invocation.OverloadResolve): Added `bool
5806         may_fail' argument and use it instead of the Location.IsNull() hack.
5807
5808 2004-09-03  Martin Baulig  <martin@ximian.com>
5809
5810         Merged latest changes into gmcs.  Please keep this comment in
5811         here, it makes it easier for me to see what changed in MCS since
5812         the last time I merged.
5813
5814 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5815
5816         Fix #61128.
5817         * expression.cs (BetterConversion): Don't allow either conversion 
5818         to be null.  Remove redundant implicit conversion test when 'q ==
5819         null' -- when this function is invoked, we already know that the
5820         implicit conversion exists.
5821         (BetterFunction): Assume that 'best' is non-null.  Remove
5822         redundant reimplementation of IsApplicable when 'best' is null.
5823         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5824         number of arguments.
5825         (IsAncestralType): Extract from OverloadResolve.
5826         (OverloadResolve): Make robust to the MethodGroupExpr being
5827         unsorted.  Implement all the logic of Section 14.5.5.1, and
5828         support overloading of methods from multiple applicable types.
5829         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5830
5831         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5832         (RealError, Warning): Append type of report to related symbol.
5833
5834 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5835
5836         * enum.cs: Fixed CLS-Compliance checks for enum members.
5837         Error tests cs3008-8.cs, cs3014-8.cs
5838
5839 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5840
5841         Fixed bug #62342, #63102
5842         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5843         like ImplementMethod.
5844
5845 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5846
5847         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5848         Fixed bug #65170.
5849
5850 2004-09-02  Martin Baulig  <martin@ximian.com>
5851
5852         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5853         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5854         on the MethodBase.
5855
5856 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5857
5858         C# 2.0 Static classes implemented
5859
5860         * class.cs (TypeContainer): instance_constructors,
5861         initialized_fields, initialized_static_fields,
5862         default_constructor, base_inteface_types are protected to be
5863         accessible from StaticClass.
5864         (TypeContainer.DefineDefaultConstructor): New virtual method
5865         for custom default constructor generating
5866         (StaticClass): New class to handle "Static classes" feature.
5867
5868         * cs-parser.jay: Handle static keyword on class like instance
5869         of StaticClass.
5870
5871         * driver.cs: Added "/langversion" command line switch with two
5872         options (iso-1, default).
5873
5874 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5875
5876         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5877
5878 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5879
5880         * delegate.cs: Style.
5881
5882 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5883
5884         * delegate.cs: Add seperate instance expr field for miguel.
5885
5886 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5887
5888         * PointerArithmetic (Resolve): make sure we are not doing
5889         pointer arith on void*. Also, make sure we are resolved
5890         by not setting eclass until resolve.
5891
5892         All callers: Make sure that PointerArithmetic gets resolved.
5893
5894 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5895
5896         * ArrayCreation (LookupType): If the type does not resolve 
5897         to an array, give an error.
5898
5899 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5900
5901         * statement.cs (Try.Resolve): Fixed bug #64222
5902
5903 2004-08-27  Martin Baulig  <martin@ximian.com>
5904
5905         * class.cs
5906         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5907         crash here.     
5908
5909 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5910
5911         * ecore.cs (Constantify): Get underlying type via
5912         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5913         Windows in special cases.
5914
5915 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5916
5917         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5918         for obtaining also private methods.
5919         (GetRemoveMethod): Used GetRemoveMethod (true)
5920         for obtaining also private methods.
5921
5922 2004-08-24  Martin Baulig  <martin@ximian.com>
5923
5924         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5925         MethodAttributes.HideBySig for operators.
5926
5927 2004-08-23  Martin Baulig  <martin@ximian.com>
5928
5929         Back to the old error reporting system :-)
5930
5931         * report.cs (Message): Removed.
5932         (Report.MessageData, ErrorData, WarningData): Removed.
5933         (Report.Error, Warning): Back to the old system.
5934
5935 2004-08-23  Martin Baulig  <martin@ximian.com>
5936
5937         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5938
5939         * class.cs (TypeContainer.ParentContainer): New public virtual
5940         method; replaces the explicit interface implementation.
5941         (ClassPart.ParentContainer): Override.
5942
5943 2004-08-23  Martin Baulig  <martin@ximian.com>
5944
5945         * statement.cs (Switch): Added support for constant switches; see
5946         #59428 or test-285.cs.
5947
5948 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5949
5950         Fixed bug #62740.
5951         * statement.cs (GetEnumeratorFilter): Removed useless
5952         logic because C# specs is strict. GetEnumerator must be
5953         public.
5954
5955 2004-08-22  Martin Baulig  <martin@ximian.com>
5956
5957         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5958         a switch and may break, reset the barrier.  Fixes #59867.
5959
5960 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5961
5962         CLS-Compliance speed up (~5% for corlib)
5963
5964         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5965         New method. Tests container for CLS-Compliant names
5966
5967         * class.cs (TypeContainer.VerifyClsName): New method.
5968         Checks whether container name is CLS Compliant.
5969         (Constructor): Implements IMethodData.
5970
5971         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5972         low-case table for CLS Compliance test.
5973         (MemberCache.VerifyClsParameterConflict): New method.
5974         Checks method parameters for CS3006 error.
5975
5976         * enum.cs (EnumMember): Is derived from MemberCore.
5977         (Enum.VerifyClsName): Optimized for better performance.
5978
5979 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5980
5981         * report.cs: Renamed Error_T to Error and changed all
5982         references.
5983
5984 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5985
5986         * class.cs (TypeContainer.IndexerArrayList): New inner class
5987         container for indexers.
5988         (TypeContainer.DefaultIndexerName): New constant for default
5989         indexer name. Replaced all "Item" with this constant.
5990         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5991
5992         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5993         DefaultMemberAttribute constructor.
5994
5995 2004-08-05  Martin Baulig  <martin@ximian.com>
5996
5997         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5998         Fix bug #59429.
5999
6000 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6001
6002         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6003         multi platforms problem.
6004
6005         * compiler.csproj: Included shared files.
6006
6007 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6008
6009         Fix bug 60333, 55971 in the more general way
6010         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6011         Added arg_type argument for constant conversion.
6012         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6013
6014 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6015
6016         Fix bug #59760
6017         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6018         OperatorArrayList, MethodCoreArrayList for typecontainer
6019         containers. Changed class member types to these new types.
6020         (MethodArrayList.DefineMembers): Added test for CS0659.
6021
6022 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6023
6024         * cfold.cs: Synchronize the folding with the code in expression.cs
6025         Binary.DoNumericPromotions for uint operands.
6026
6027         * attribute.cs: Revert patch from Raja, it introduced a regression
6028         while building Blam-1.2.1 (hard to isolate a test case).
6029
6030 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6031
6032         Fix for #55382
6033         * class.cs:
6034         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6035         name collision.
6036         (MethodCore.parent_method): New member. The method we're overriding
6037         if this is an override method.
6038         (MethodCore.CheckBase): Moved from Method class and made common.
6039         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6040         private.
6041         (MethodCore.CheckForDuplications): New abstract method. For custom
6042         member duplication search in a container
6043         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6044         method and its return type.
6045         (Event.conflict_symbol): New member. Symbol with same name in the
6046         parent class.
6047
6048         * decl.cs:
6049         (MemberCache.FindMemberWithSameName): New method. The method
6050         is looking for conflict with inherited symbols.
6051
6052 2004-08-04  Martin Baulig  <martin@ximian.com>
6053
6054         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6055
6056         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6057
6058 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6059
6060         * report.cs (Message): New enum for better error, warning reference in
6061         the code.
6062         (MessageData): New inner abstract class. It generally handles printing of
6063         error and warning messages.
6064         Removed unused Error, Warning, Message methods.
6065
6066 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6067
6068         Fix for cs0592-8.cs test
6069         * attribute.cs
6070         (Attributable.ValidAttributeTargets): Made public.
6071         (Attribute.ExplicitTarget): New member for explicit target value.
6072         (Attribute.CheckTargets): Now we translate explicit attribute
6073         target to Target here.
6074
6075 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6076
6077         * ecore.cs (MethodGroupExpr): new IsBase property.
6078
6079         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6080
6081         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6082         rather than an instance expr.
6083
6084         (DelegateCreation.Emit): Use the method group rather than
6085         the instance expression. Also, if you have base.Foo as the
6086         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6087
6088         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6089
6090         (NewDelegate.DoResolve): Only check for the existance of Invoke
6091         if the method is going to be needed. Use MethodGroupExpr.
6092
6093         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6094
6095         * expression.cs: For pointer arith., make sure to use
6096         the size of the type, not the size of the pointer to
6097         the type.
6098
6099 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6100
6101         Fix for #60722
6102         * class.cs (Class): Added error CS0502 test.
6103
6104 2004-08-03  John Luke  <jluke@cfl.rr.com>
6105             Raja R Harinath  <rharinath@novell.com>
6106
6107         Fix for #60997.
6108         * attribute.cs (Attribute.complained_before): New flag.
6109         (Attribute.ResolveType, Attribute.Resolve),
6110         (Attribute.DefinePInvokeMethod): Set it.
6111         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6112         
6113 2004-08-03  Martin Baulig  <martin@ximian.com>
6114
6115         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6116         use a user-defined operator; we still need to do numeric
6117         promotions in case one argument is a builtin type and the other
6118         one has an implicit conversion to that type.  Fixes #62322.
6119
6120 2004-08-02  Martin Baulig  <martin@ximian.com>
6121
6122         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6123         (LocalInfo.IsThis): New public property.
6124         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6125
6126 2004-08-01  Martin Baulig  <martin@ximian.com>
6127
6128         * class.cs (TypeContainer.GetClassBases): Don't set the default
6129         here since we may get called from GetPartialBases().
6130         (TypeContainer.DefineType): If GetClassBases() didn't return a
6131         parent, use the default one.
6132
6133 2004-07-30  Duncan Mak  <duncan@ximian.com>
6134
6135         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
6136
6137 2004-07-30  Martin Baulig  <martin@ximian.com>
6138
6139         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6140
6141         * class.cs (SourceMethod): New public class, derive from the
6142         symbol writer's ISourceMethod.
6143         (Method): Use the new symbol writer API.
6144
6145         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6146         as argument and use the new symbol writer.
6147
6148         * location.cs
6149         (SourceFile): Implement the symbol writer's ISourceFile.
6150         (Location.SymbolDocument): Removed.
6151         (Location.SourceFile): New public property.
6152
6153         * symbolwriter.cs: Use the new symbol writer API.
6154
6155 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6156
6157         * Makefile (install-local): Remove.  Functionality moved to
6158         executable.make.
6159
6160 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6161
6162         * Makefile: Install mcs.exe.config file together with mcs.exe.
6163         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6164         correct runtime version.
6165         
6166 2004-07-25  Martin Baulig  <martin@ximian.com>
6167
6168         * class.cs
6169         (TypeContainer.RegisterOrder): Removed, this was unused.
6170         (TypeContainer, interface_order): Removed.
6171         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6172         TypeContainer as argument since we can also be called with a
6173         `PartialContainer' for a partial class/struct/interface.
6174         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6175         of checking whether we're an `Interface' - we could be a
6176         `PartialContainer'.
6177         (PartialContainer.Register): Override; call
6178         AddClass()/AddStruct()/AddInterface() on our parent.
6179
6180         * cs-parser.jay (interface_member_declaration): Add things to the
6181         `current_container', not the `current_class'.
6182
6183         * rootcontext.cs (RegisterOrder): The overloaded version which
6184         takes an `Interface' was unused, removed.
6185
6186         * typemanager.cs (TypeManager.LookupInterface): Return a
6187         `TypeContainer', not an `Interface'.
6188         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6189         contain a `PartialContainer' for an interface, so check it's
6190         `Kind' to figure out what it is.
6191
6192 2004-07-25  Martin Baulig  <martin@ximian.com>
6193
6194         * class.cs (Class.DefaultTypeAttributes): New public constant.
6195         (Struct.DefaultTypeAttributes): Likewise.
6196         (Interface.DefaultTypeAttributes): Likewise.
6197         (PartialContainer.TypeAttr): Override this and add the
6198         DefaultTypeAttributes.
6199
6200 2004-07-25  Martin Baulig  <martin@ximian.com>
6201
6202         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6203         we can just use the `Parent' field instead.
6204
6205 2004-07-25  Martin Baulig  <martin@ximian.com>
6206
6207         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6208
6209 2004-07-25  Martin Baulig  <martin@ximian.com>
6210
6211         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6212         our parts before defining any methods.
6213         (TypeContainer.VerifyImplements): Make this virtual.
6214         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6215         on our PartialContainer.
6216
6217 2004-07-25  Martin Baulig  <martin@ximian.com>
6218
6219         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6220
6221         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6222         argument, we can just use the `Parent' field instead.
6223
6224         * class.cs
6225         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6226         (MemberBase.DoDefine): Likewise.
6227
6228 2004-07-24  Martin Baulig  <martin@ximian.com>
6229
6230         * decl.cs (MemberCore.Parent): New public field.
6231         (DeclSpace.Parent): Moved to MemberCore.
6232
6233         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6234         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6235         parent's .ctor.
6236         (FieldBase, Field, Operator): Likewise.
6237         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6238         (EventField, Event): Likewise.
6239
6240 2004-07-23  Martin Baulig  <martin@ximian.com>
6241
6242         * class.cs (PartialContainer): New public class.
6243         (ClassPart): New public class.
6244         (TypeContainer): Added support for partial classes.
6245         (TypeContainer.GetClassBases): Splitted some of the functionality
6246         out into GetNormalBases() and GetPartialBases().
6247
6248         * cs-tokenizer.cs (Token.PARTIAL): New token.
6249         (Tokenizer.consume_identifier): Added some hacks to recognize
6250         `partial', but only if it's immediately followed by `class',
6251         `struct' or `interface'.
6252
6253         * cs-parser.jay: Added support for partial clases.
6254
6255 2004-07-23  Martin Baulig  <martin@ximian.com>
6256
6257         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6258         a `DeclSpace' and also made it readonly.
6259         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6260         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6261         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6262
6263         * cs-parser.jay: Pass the `current_class', not the
6264         `current_container' (at the moment, this is still the same thing)
6265         to a new Method, Property, Event, Indexer or Constructor.
6266
6267 2004-07-23  Martin Baulig  <martin@ximian.com>
6268
6269         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6270         and removed the `current_interface' one.
6271         (struct_declaration, class_declaration, interface_declaration):
6272         Set `current_class' to the newly created class/struct/interface;
6273         set their `Bases' and call Register() before parsing their body.
6274
6275 2004-07-23  Martin Baulig  <martin@ximian.com>
6276
6277         * class.cs (Kind): New public enum.
6278         (TypeContainer): Made this class abstract.
6279         (TypeContainer.Kind): New public readonly field.
6280         (TypeContainer.CheckDef): New public method; moved here from
6281         cs-parser.jay.
6282         (TypeContainer.Register): New public abstract method.
6283         (TypeContainer.GetPendingImplementations): New public abstract
6284         method.
6285         (TypeContainer.GetClassBases): Removed the `is_class' and
6286         `is_iface' parameters.
6287         (TypeContainer.DefineNestedTypes): Formerly known as
6288         DoDefineType().
6289         (ClassOrStruct): Made this class abstract.
6290
6291         * tree.cs (RootTypes): New public type. 
6292
6293 2004-07-20  Martin Baulig  <martin@ximian.com>
6294
6295         * tree.cs (Tree.RecordNamespace): Removed.
6296         (Tree.Namespaces): Removed.
6297
6298         * rootcontext.cs (RootContext.IsNamespace): Removed.
6299
6300         * cs-parser.jay (namespace_declaration): Just create a new
6301         NamespaceEntry here.
6302
6303 2004-07-20  Martin Baulig  <martin@ximian.com>
6304
6305         * statement.cs (ExceptionStatement): New abstract class.  This is
6306         now used as a base class for everyone who's using `finally'.
6307         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6308         our local variables before using them.
6309
6310         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6311         virtual method.  This is used by Yield.Resolve() to "steal" an
6312         outer block's `finally' clauses.
6313         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6314         argument.
6315
6316         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6317         version which takes an ExceptionStatement.  This version must be
6318         used to create exception branchings.
6319
6320         * iterator.cs
6321         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6322         (Iterator.EmitMoveNext): Added exception support; protect the
6323         block with a `fault' clause, properly handle 'finally' clauses.
6324         (Iterator.EmitDispose): Run all the `finally' clauses here.
6325
6326 2004-07-20  Martin Baulig  <martin@ximian.com>
6327
6328         * iterator.cs: This is the first of a set of changes in the
6329         iterator code.  Match the spec more closely: if we're an
6330         IEnumerable, then GetEnumerator() must be called.  The first time
6331         GetEnumerator() is called, it returns the current instance; all
6332         subsequent invocations (if any) must create a copy.
6333
6334 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6335
6336         * expression.cs: Resolve the constant expression before returning
6337         it. 
6338
6339 2004-07-19  Martin Baulig  <martin@ximian.com>
6340
6341         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6342         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6343         the return type of the new EmitContext.
6344
6345 2004-07-18  Martin Baulig  <martin@ximian.com>
6346
6347         * class.cs (Property.Define): Fix iterators.
6348
6349         * iterators.cs (Iterator.Define): Moved the
6350         `container.AddInterator (this)' call here from the .ctor; only do
6351         it if we resolved successfully.
6352
6353 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6354
6355         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6356         `true' for preprocessing directives that we parse.  The return
6357         value indicates whether we should return to regular tokenizing or
6358         not, not whether it was parsed successfully.
6359
6360         In the past if we were in: #if false ... #line #endif, we would
6361         resume parsing after `#line'.  See bug 61604.
6362
6363         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6364         building: IsEnumType should return true only for enums, not for
6365         enums or System.Enum itself.  This fixes #61593.
6366
6367         Likely what happened is that corlib was wrong: mcs depended on
6368         this bug in some places.  The bug got fixed, we had to add the
6369         hack, which caused bug 61593.
6370
6371         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6372         that was a workaround for the older conditions.
6373
6374 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6375
6376         * assign.cs: IAssignMethod has a new interface, as documented
6377         inline. All assignment code now uses this new api.
6378
6379         * ecore.cs, expression.cs: All classes which implement
6380         IAssignMethod now use the new interface.
6381
6382         * expression.cs (Invocation): add a hack to EmitCall so that
6383         IndexerAccess can be the target of a compound assignment without
6384         evaluating its arguments twice.
6385
6386         * statement.cs: Handle changes in Invocation api.
6387
6388 2004-07-16  Martin Baulig  <martin@ximian.com>
6389
6390         * iterators.cs: Rewrote this.  We're now using one single Proxy
6391         class for both the IEnumerable and the IEnumerator interface and
6392         `Iterator' derives from Class so we can use the high-level API.
6393
6394         * class.cs (TypeContainer.AddIterator): New method.
6395         (TypeContainer.DoDefineType): New protected virtual method, which
6396         is called from DefineType().
6397         (TypeContainer.DoDefineMembers): Call DefineType() and
6398         DefineMembers() on all our iterators.
6399         (TypeContainer.Emit): Call Emit() on all our iterators.
6400         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6401
6402         * codegen.cs (EmitContext.CurrentIterator): New public field.
6403
6404 2004-07-15  Martin Baulig  <martin@ximian.com>
6405
6406         * typemanager.cs
6407         (TypeManager.not_supported_exception_type): New type.   
6408
6409 2004-07-14  Martin Baulig  <martin@ximian.com>
6410
6411         * iterators.cs: Use real error numbers.
6412
6413 2004-07-14  Martin Baulig  <martin@ximian.com>
6414
6415         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6416         requires this to be a System.Collection.IEnumerable and not a
6417         class implementing that interface.
6418         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6419
6420 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6421
6422         * class.cs: Fixed previous fix, it broke some error tests.
6423
6424 2004-07-12  Martin Baulig  <martin@ximian.com>
6425
6426         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6427         Fixes #61293.
6428
6429 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6430
6431         * assign.cs (LocalTemporary): Add new argument: is_address,If
6432         `is_address' is true, then the value that we store is the address
6433         to the real value, and not the value itself.
6434         
6435         * ecore.cs (PropertyExpr): use the new local temporary
6436         stuff to allow us to handle X.Y += z (where X is a struct)
6437
6438 2004-07-08  Martin Baulig  <martin@ximian.com>
6439
6440         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6441         not always return, just like we're doing in Using.Resolve().
6442
6443 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6444
6445         * cs-parser.jay (fixed_statement): flag this as Pinned.
6446
6447 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6448
6449         * typemanager.cs (TypeManager): Removed MakePinned method, this
6450         mechanism is replaced with the .NET 2.x compatible mechanism of
6451         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6452
6453         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6454         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6455         `IsFixed' property which has a different meaning.
6456
6457 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6458
6459         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6460         visible from inside a nested class, not just the names of the
6461         immediately enclosing class.
6462         Fix for bug #60730.
6463
6464 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6465
6466         * expression.cs (BetterConversion): Remove buggy special-case
6467         handling of "implicit constant expression conversions".  At this
6468         point, we already know that the conversion is possible -- we're
6469         only checking to see which is better.
6470
6471 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6472
6473         * cs-parser.jay: Added error CS0210 test.
6474
6475 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6476
6477         * cs-parser.jay: Added error CS0134 test.
6478
6479 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6480
6481         Fix bug #52507
6482         * cs-parser.jay: Added error CS0145 test.
6483
6484 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6485
6486         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6487
6488 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6489         
6490         * expression.cs (StackAlloc.Resolve): The argument may not
6491         be a constant; deal with this case.
6492         
6493 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6494
6495         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6496         GetIndexerAttributeValue.
6497         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6498
6499         * class.cs (Indexer.Define): Added error tests for CS0415,
6500         CS0609.
6501
6502 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6503
6504         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6505         property code.
6506
6507 2004-06-23  Martin Baulig  <martin@ximian.com>
6508
6509         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6510         neither return nor throw, reset the barrier as well.  Fixes #60457.
6511
6512 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6513
6514         * class.cs : EventAttributes is now set to None by default.
6515           This fixes bug #60459.
6516
6517 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6518
6519         Fix bug #60219
6520         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6521         Don't throw exception but return null (it's sufficient now).
6522
6523 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6524
6525         * typemanager.cs (GetArgumentTypes): Faster implementation.
6526
6527 2004-06-18  Martin Baulig  <martin@ximian.com>
6528
6529         * attribute.cs (Attribute.Resolve): Check whether we're an
6530         EmptyCast which a Constant child.  Fixes #60333.
6531
6532 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6533
6534         * statement.cs (EmitCollectionForeach): Account for the fact that
6535         not all valuetypes are in areas which we can take the address of.
6536         For these variables, we store to a temporary variable. Also, make
6537         sure that we dont emit a `callvirt' on a valuetype method.
6538
6539 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6540
6541         * expression.cs (StackAlloc.DoReSolve): Added test for
6542         negative parameter (CS0247).
6543
6544 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6545
6546         Fix bug #59792
6547         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6548
6549 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6550
6551         Fix bug #59781
6552         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6553         ulong.
6554
6555 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6556
6557         Fix bug #58254 & cs1555.cs, cs1556.cs
6558         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6559
6560 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6561
6562         * cs-parser.jay: Added error CS1669 test for indexers.
6563
6564 2004-06-11  Martin Baulig  <martin@ximian.com>
6565
6566         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6567         call this twice: for params and varargs methods.
6568
6569 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6570
6571         * class.cs:
6572         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6573
6574 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6575
6576         * attribute.cs (Attribute.GetValidTargets): Made public.
6577
6578         * class.cs: 
6579         (AbstractPropertyEventMethod): New class for better code sharing.
6580         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6581         CS1667 report.
6582         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6583
6584 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6585
6586         Fix bug #59477.
6587         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6588         that the call to Resolve is part of a MemberAccess.
6589         (Expression.Resolve): Use it for SimpleName resolution.
6590         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6591         Add 'intermediate' boolean argument.
6592         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6593         error message when the SimpleName can be resolved ambiguously
6594         between an expression and a type.
6595         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6596         public.
6597         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6598         call on the left-side.
6599
6600 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6601
6602         * class.cs:
6603         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6604
6605 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6606
6607         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6608
6609 2004-06-11  Martin Baulig  <martin@ximian.com>
6610
6611         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6612         varargs methods if applicable.
6613
6614 2004-06-11  Martin Baulig  <martin@ximian.com>
6615
6616         * expression.cs (Invocation.EmitCall): Don't use
6617         `method.CallingConvention == CallingConventions.VarArgs' since the
6618         method could also have `CallingConventions.HasThis'.
6619
6620 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6621
6622         * class.cs (Event.GetSignatureForError): Implemented.
6623         Fixed crash in error test cs3010.cs
6624
6625 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6626
6627         * cs-tokenizer.cs: Change the way we track __arglist to be
6628         consistent with the other keywords.
6629
6630 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6631
6632         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6633         tomorrow.
6634
6635 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6636
6637         * codegen.cs: Check that all referenced assemblies have a strongname
6638         before strongnaming the compiled assembly. If not report error CS1577.
6639         Fix bug #56563. Patch by Jackson Harper.
6640         * typemanager.cs: Added a method to return all referenced assemblies.
6641         Fix bug #56563. Patch by Jackson Harper.
6642
6643 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6644
6645         * class.cs:
6646         (Method.ApplyAttributeBuilder): Moved and added conditional
6647         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6648
6649         * delegate.cs:
6650         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6651
6652 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6653
6654         Fixed #59640
6655         * class.cs: (EventField.attribute_targets): Changed default target.
6656
6657 2004-06-08  Martin Baulig  <martin@ximian.com>
6658
6659         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6660
6661 2004-06-08  Martin Baulig  <martin@ximian.com>
6662
6663         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6664
6665 2004-06-07  Martin Baulig  <martin@ximian.com>
6666
6667         Added support for varargs methods.
6668
6669         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6670         keyword.
6671
6672         * cs-parser.jay: Added support for `__arglist'.
6673
6674         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6675
6676         * expression.cs (Argument.AType): Added `ArgList'.
6677         (Invocation): Added support for varargs methods.
6678         (ArglistAccess): New public class.
6679         (Arglist): New public class.
6680
6681         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6682
6683         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6684         a method's top-level block if the method has varargs.
6685
6686         * support.cs (ReflectionParameters, InternalParameters): Added
6687         support for varargs methods.    
6688
6689 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6690
6691         * class.cs: Provide location in indexer error report.
6692
6693         * driver.cs: Use standard names.
6694
6695         * namespace.cs: Catch the use of using after a namespace has been
6696         declared also on using aliases.
6697
6698 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6699
6700         Bug #50820.
6701         * typemanager.cs (closure_private_ok, closure_invocation_type)
6702         (closure_qualifier_type, closure_invocation_assembly)
6703         (FilterWithClosure): Move to ...
6704         (Closure): New internal nested class.
6705         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6706         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6707         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6708         (MemberLookup, MemberLookupFailed): Use it.
6709         * expression.cs (New.DoResolve): Treat the lookup for the
6710         constructor as being qualified by the 'new'ed type.
6711         (Indexers.GetIndexersForTypeOrInterface): Update.
6712
6713 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6714
6715         * attribute.cs
6716         (GetConditionalAttributeValue): New method. Returns
6717         condition of ConditionalAttribute.
6718         (SearchMulti): New method.  Returns all attributes of type 't'.
6719         Use it when attribute is AllowMultiple = true.
6720         (IsConditionalMethodExcluded): New method.
6721
6722         * class.cs
6723         (Method.IsExcluded): Implemented. Returns true if method has conditional
6724         attribute and the conditions is not defined (method is excluded).
6725         (IMethodData): Extended interface for ConditionalAttribute support.
6726         (PropertyMethod.IsExcluded): Implemented.
6727
6728         * decl.cs
6729         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6730
6731         * expression.cs
6732         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6733         on the method.
6734
6735 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6736
6737         * expression.cs (ArrayCreationExpression): Make this just an
6738         `expression'. It can't be a statement, so the code here was
6739         dead.
6740
6741 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6742
6743         Fixed #59072
6744         * typemanager.cs (GetFullNameSignature): New method for
6745         MethodBase types.
6746
6747 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6748
6749         Fixed #56452
6750         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6751         Use this method when MethodBuilder is null.
6752         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6753         Added test for error CS0626 (MONO reports error for this situation).
6754         (IMethodData.GetSignatureForError): Extended interface.
6755
6756 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6757
6758         * attribute.cs
6759         (AttributeTester.GetObsoleteAttribute): Returns instance of
6760         ObsoleteAttribute when type is obsolete.
6761
6762         * class.cs
6763         (TypeContainer.VerifyObsoleteAttribute): Override.
6764         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6765         (MethodCode.VerifyObsoleteAttribute): Override.
6766         (MemberBase.VerifyObsoleteAttribute): Override.
6767
6768         * decl.cs
6769         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6770         and report proper error.
6771
6772         *delegate.cs
6773         Delegate.VerifyObsoleteAttribute): Override.
6774
6775         * ecore.cs
6776         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6777         and report proper error.
6778         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6779
6780         * enum.cs
6781         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6782         and enum member.
6783
6784         * expression.cs
6785         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6786         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6787         Added test for ObsoleteAttribute.
6788
6789         * statement.cs
6790         (Catch): Derived from Statement.
6791
6792 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6793  
6794         Fixed bug #59071 & cs0160.cs
6795  
6796         * statement.cs (Try.Resolve): Check here whether order of catch
6797         clauses matches their dependencies.
6798
6799 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6800
6801         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6802         caused a regression: #59343.  Referencing nested classes from an
6803         assembly stopped working.
6804
6805 2004-05-31  Martin Baulig  <martin@ximian.com>
6806
6807         MCS is now frozen for beta 2.
6808
6809 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6810
6811         * convert.cs: add a trivial cache for overload operator resolution.
6812
6813 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6814
6815         * decl.cs: If possible, use lookuptypedirect here. We can only do
6816         this if there is no `.' after the namespace. Avoids using
6817         LookupType, which does lots of slow processing.
6818         (FindNestedType) New method, does what it says :-).
6819         * namespace.cs: use LookupTypeDirect.
6820         * rootcontext.cs: use membercache, if possible.
6821         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6822
6823 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6824
6825         * expression.cs:
6826         According to the spec, 
6827
6828         In a member access of the form E.I, if E is a single identifier,
6829         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6830         field, property, localvariable, or parameter with the same type as
6831         the meaning of E as a type-name (§3.8), then both possible
6832         meanings of E are permitted.
6833
6834         We did not check that E as a simple-name had the same type as E as
6835         a type name.
6836
6837         This trivial check gives us 5-7% on bootstrap time.
6838
6839 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6840
6841         * expression.cs (Invocation.OverloadResolve): Avoid the
6842         use of hashtables and boxing here by allocating on demand.
6843
6844 2004-05-30  Martin Baulig  <martin@ximian.com>
6845
6846         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6847         we're doing a silent lookup.  Don't try to lookup nested types in
6848         TypeManager.object_type (thanks to Ben Maurer).
6849
6850 2004-05-30  Martin Baulig  <martin@ximian.com>
6851
6852         Committing a patch from Ben Maurer.
6853
6854         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6855
6856 2004-05-29  Martin Baulig  <martin@ximian.com>
6857
6858         * class.cs (IMethodData.ShouldIgnore): New method.
6859
6860         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6861         `Location' argument, we don't need it anywhere.  Use
6862         `IMethodData.ShouldIgnore ()' instead of
6863         `MethodData.GetMethodFlags ()'.
6864         (TypeManager.AddMethod): Removed.
6865         (TypeManager.AddMethod2): Renamed to AddMethod.
6866
6867 2004-05-29  Martin Baulig  <martin@ximian.com>
6868
6869         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6870
6871         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6872         converting from a class type S to an interface type and we already
6873         have an object on the stack, don't box it again.  Fixes #52578.
6874
6875 2004-05-29  Martin Baulig  <martin@ximian.com>
6876
6877         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6878         Added support for `params' parameters.  Fixes #59267.
6879
6880 2004-05-29  Martin Baulig  <martin@ximian.com>
6881
6882         * literal.cs (NullPointer): Provide a private .ctor which sets
6883         `type' to TypeManager.object_type.  Fixes #59048.
6884
6885 2004-05-29  Martin Baulig  <martin@ximian.com>
6886
6887         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6888         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6889
6890         * ecore.cs (EventExpr.instance_expr): Make the field private.
6891
6892 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6893
6894         Fixed bug #50080 & cs0214-2.cs
6895         * expression.cs (Cast.DoResolve): Check unsafe context here.
6896         
6897         * statement.cs (Resolve.DoResolve): Likewise.
6898
6899 2004-05-26  Martin Baulig  <martin@ximian.com>
6900
6901         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6902
6903         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6904         (RootContext.LookupType): Pass down the `silent' flag.
6905
6906 2004-05-25  Martin Baulig  <martin@ximian.com>
6907
6908         * expression.cs
6909         (MethodGroupExpr.IdenticalTypeName): New public property.
6910         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6911         expression actually refers to a type.
6912
6913 2004-05-25  Martin Baulig  <martin@ximian.com>
6914
6915         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6916         for #56176 and made it actually work.
6917
6918 2004-05-25  Martin Baulig  <martin@ximian.com>
6919
6920         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6921         (FieldExpr, PropertyExpr): Override and implement
6922         CacheTemporaries.  Fixes #52279.
6923
6924 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6925
6926         * location.cs: In the new compiler listing a file twice is a
6927         warning, not an error.
6928
6929 2004-05-24  Martin Baulig  <martin@ximian.com>
6930
6931         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6932         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6933
6934 2004-05-24  Martin Baulig  <martin@ximian.com>
6935
6936         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6937         walking the `using' list.  Fixes #53921.
6938
6939 2004-05-24  Martin Baulig  <martin@ximian.com>
6940
6941         * const.cs (Const.LookupConstantValue): Added support for
6942         EmptyCast's; fixes #55251.
6943
6944 2004-05-24  Martin Baulig  <martin@ximian.com>
6945
6946         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6947         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6948         which does the CS0135 check.  The reason is that we first need to
6949         check whether the variable actually exists.
6950
6951 2004-05-24  Martin Baulig  <martin@ximian.com>
6952
6953         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6954         than RootContext.LookupType() to find the explicit interface
6955         type.  Fixes #58584.
6956
6957 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6958
6959         * Makefile: Simplify.  Use executable.make.
6960         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6961
6962 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6963
6964         * decl.cs:
6965         * enum.cs:
6966         Use the invariant culture when doing String.Compare for CLS case
6967         sensitivity.
6968         
6969 2004-05-23  Martin Baulig  <martin@ximian.com>
6970
6971         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6972         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6973
6974         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6975         
6976 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6977
6978         * class.cs (MemberBase.Define): Reuse MemberType member for 
6979         resolved type. Other methods can use it too.
6980
6981 2004-05-23  Martin Baulig  <martin@ximian.com>
6982
6983         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6984         the variable also exists in the current block (otherwise, we need
6985         to report a CS0103).  Fixes #58670.
6986
6987 2004-05-23  Martin Baulig  <martin@ximian.com>
6988
6989         * flowanalysis.cs (Reachability.Reachable): Compute this
6990         on-the-fly rather than storing it as a field.
6991
6992 2004-05-23  Martin Baulig  <martin@ximian.com>
6993
6994         * flowanalysis.cs (Reachability.And): Manually compute the
6995         resulting `barrier' from the reachability.      
6996        
6997 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6998
6999         Fix bug #57835
7000         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7001         instance of ObsoleteAttribute when symbol is obsolete.
7002
7003         * class.cs
7004         (IMethodData): Extended interface for ObsoleteAttribute support.
7005
7006 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7007
7008         * attribute.cs: Fix bug #55970
7009
7010 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7011
7012         Fix bug #52705
7013         * attribute.cs
7014         (GetObsoleteAttribute): New method. Creates the instance of
7015         ObsoleteAttribute.
7016         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7017         ObsoleteAttribute when member is obsolete.
7018         (AttributeTester.Report_ObsoleteMessage): Common method for
7019         Obsolete error/warning reporting.
7020
7021         * class.cs
7022         (TypeContainer.base_classs_type): New member for storing parent type.
7023
7024         * decl.cs
7025         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7026         for this MemberCore.
7027
7028 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7029
7030         * attribute.cs, const.cs: Fix bug #58590
7031
7032 2004-05-21  Martin Baulig  <martin@ximian.com>
7033
7034         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7035         out parameters if the end of the method is unreachable.  Fixes
7036         #58098. 
7037
7038 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7039
7040         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7041         Hari was right, why extra method.
7042
7043 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7044
7045         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7046
7047 2004-05-20  Martin Baulig  <martin@ximian.com>
7048
7049         Merged this back from gmcs to keep the differences to a minumum.
7050
7051         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
7052         instead of a Declspace.
7053         (Attribute.ResolveType): Likewise.
7054         (Attributes.Search): Likewise.
7055         (Attributes.Contains): Likewise.
7056         (Attributes.GetClsCompliantAttribute): Likewise.
7057
7058         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
7059         argument.
7060         (MethodData.ApplyAttributes): Take an EmitContext instead of a
7061         DeclSpace.
7062
7063 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7064
7065         Fix bug #58688 (MCS does not report error when the same attribute
7066         is assigned twice)
7067
7068         * attribute.cs (Attribute.Emit): Distinction between null and default.
7069
7070 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7071
7072         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7073         of a top-level attribute without an attribute target.
7074         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7075         Make non-static.
7076         (Attribute.Conditional_GetConditionName), 
7077         (Attribute.Obsolete_GetObsoleteMessage): Update.
7078         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7079         part of ScanForIndexerName.
7080         (Attribute.CanIgnoreInvalidAttribute): New function.
7081         (Attribute.ScanForIndexerName): Move to ...
7082         (Attributes.ScanForIndexerName): ... here.
7083         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7084         (Attributes.Search): New internal variant that can choose not to
7085         complain if types aren't resolved.  The original signature now
7086         complains.
7087         (Attributes.GetClsCompliantAttribute): Use internal variant, with
7088         complaints suppressed.
7089         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7090         only if it not useful.
7091         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7092         top-level for attributes that are shared between the assembly
7093         and a top-level class.
7094         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7095         * class.cs: Update to reflect changes.
7096         (DefineIndexers): Fuse loops.
7097         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7098         a couple more variants of attribute names.
7099
7100 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7101
7102         Fix bug #52585 (Implemented explicit attribute declaration)
7103
7104         * attribute.cs:
7105         (Attributable.ValidAttributeTargets): New abstract method. It gets
7106         list of valid attribute targets for explicit target declaration.
7107         (Attribute.Target): It holds target itself.
7108         (AttributeSection): Removed.
7109         (Attribute.CheckTargets): New method. It checks whether attribute
7110         target is valid for the current element.
7111
7112         * class.cs:
7113         (EventProperty): New class. For events that are declared like
7114         property (with add and remove accessors).
7115         (EventField): New class. For events that are declared like field.
7116         class.cs
7117
7118         * cs-parser.jay: Implemented explicit attribute target declaration.
7119
7120         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7121         Override ValidAttributeTargets.
7122
7123         * parameter.cs:
7124         (ReturnParameter): Class for applying custom attributes on 
7125         the return type.
7126         (ParameterAtribute): New class. Class for applying custom
7127         attributes on the parameter type.
7128
7129 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7130
7131         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7132         definitions. 
7133
7134         (Method): Allow UNSAFE here.
7135
7136         * modifiers.cs: Support unsafe reporting.
7137
7138 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7139
7140         * decl.cs: Fix bug #58478.
7141
7142 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7143
7144         * statement.cs: When checking for unreachable code on an EmptyStatement,
7145         set the location. Fixes bug #58488.
7146
7147 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7148
7149         * driver.cs: Add -pkg handling.
7150
7151         From Gonzalo: UseShelLExecute=false
7152
7153 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7154
7155         * attribute.cs:
7156         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7157         for attribute.
7158         (Attribute.IsClsCompliaceRequired): Moved to base for better
7159         accesibility.
7160         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7161         when attribute is AttributeUsageAttribute.
7162         (Attribute.GetValidTargets): Simplified.
7163         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7164         attribute for this type.
7165         (Attribute.ApplyAttributes): Method renamed to Emit and make
7166         non-static.
7167         (GlobalAttributeSection): New class for special handling of global
7168         attributes (assembly, module).
7169         (AttributeSection.Emit): New method.
7170
7171         * class.cs: Implemented Attributable abstract methods.
7172         (MethodCore.LabelParameters): Moved to Parameter class.
7173         (Accessor): Is back simple class.
7174         (PropertyMethod): Implemented Attributable abstract class.
7175         (DelegateMethod): Implemented Attributable abstract class.
7176         (Event): New constructor for disctintion between normal Event
7177         and Event with accessors.
7178
7179         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7180
7181         * codegen.cs, const.cs, decl.cs, delegate.cs:
7182         (CommonAssemblyModulClass): Implemented Attributable abstract class
7183         and simplified.
7184
7185         * enum.cs: Implement IAttributeSupport interface.
7186         (EnumMember): New class for emum members. Implemented Attributable
7187         abstract class
7188
7189         * parameter.cs:
7190         (ParameterBase): Is abstract.
7191         (ReturnParameter): New class for easier [return:] attribute handling.
7192
7193         * typemanager.cs: Removed builder_to_attr.
7194
7195 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7196
7197         Fix bug #57151.
7198         * attribute.cs (Attribute.GetPositionalValue): New function.
7199         * class.cs (TypeContainer.VerifyMembers): New function.
7200         (TypeContainer.Emit): Use it.
7201         (ClassOrStruct): New base class for Class and Struct.
7202         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7203         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7204         class.
7205         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7206         then each non-static field should have a FieldOffset attribute.
7207         Otherwise, none of the fields should have a FieldOffset attribute.
7208         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7209         and FieldOffset attributes.
7210         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7211         (TypeManager.field_offset_attribute_type): New core types.
7212         (TypeManager.InitCoreTypes): Initialize them.
7213
7214 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7215
7216         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7217         Return correct type.
7218         From bug #58270.
7219
7220 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7221
7222         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7223         be implicitly converted to ulong.
7224         
7225         * expression.cs: The logic for allowing operator &, | and ^ worked
7226         was wrong, it worked before because we did not report an error in
7227         an else branch.  Fixes 57895.
7228
7229         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7230         allow volatile fields to be reference types.
7231
7232 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7233
7234         * driver.cs: Add support for /debug-
7235
7236 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7237
7238         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7239         Add a 'complain' parameter to silence errors.
7240         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7241         silently overlooked type-resolutions.
7242         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7243         to reflect changes.
7244         (Attributes.Search): New function.
7245         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7246         (Attributes.GetAttributeFullName): Remove hack.
7247         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7248         Update to reflect changes.
7249         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7250         Use Attributes.Search instead of nested loops.
7251
7252 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7253
7254         * decl.cs:
7255         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7256         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7257         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7258
7259         * report.cs: (Report.Warning): Renamed to Warning_T because of
7260         parameter collision.
7261
7262 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7263
7264         * expression.cs (MemberAccess.ResolveMemberAccess):
7265         Exit with non-zero status after Report.Error.
7266         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7267         Likewise.
7268         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7269
7270 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7271
7272         * support.cs: Don't hang when the file is empty.
7273
7274 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7275
7276         * support.cs: In SeekableStreamReader, compute the preamble size of the
7277           underlying stream. Position changes should take into account that initial
7278           count of bytes.
7279
7280 2004-05-03  Todd Berman  <tberman@sevenl.net>
7281
7282         * driver.cs: remove unused GetSysVersion function.
7283
7284 2004-05-03  Todd Berman  <tberman@sevenl.net>
7285
7286         * driver.cs: Remove the hack from saturday, as well as the hack
7287         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7288         link_paths to get that bit proper.
7289
7290 2004-05-01  Todd Berman  <tberman@sevenl.net>
7291
7292         * driver.cs: Try a LoadFrom before a Load, this checks the current
7293         path. This is currently a bug in mono that is be fixed, however, this
7294         provides a workaround for now. This will be removed when the bug
7295         is fixed.
7296
7297 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7298
7299         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7300         incomplete key pairs (#57941).
7301
7302 2004-05-01  Todd Berman  <tberman@sevenl.net>
7303
7304         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7305         from the GAC
7306
7307 2004-04-30  Jackson Harper  <jackson@ximian.com>
7308
7309         * codegen.cs: Open keys readonly.
7310         
7311 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7312
7313         * typemanager.cs: don't report cyclic struct layout when a struct
7314         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7315         which has 2 Pango.Rectangle fields.
7316
7317 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7318
7319         * expression.cs: Handle IntPtr comparisons with IL code
7320         rather than a method call.
7321
7322 2004-04-29  Martin Baulig  <martin@ximian.com>
7323
7324         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7325         the list of PropertyInfo's in class hierarchy and find the
7326         accessor.  Fixes #56013.
7327
7328 2004-04-29  Martin Baulig  <martin@ximian.com>
7329
7330         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7331
7332 2004-04-29  Martin Baulig  <martin@ximian.com>
7333
7334         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7335
7336         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7337
7338 2004-04-29  Martin Baulig  <martin@ximian.com>
7339
7340         * class.cs (ConstructorInitializer.Resolve): Check whether the
7341         parent .ctor is accessible.  Fixes #52146.
7342
7343 2004-04-29  Martin Baulig  <martin@ximian.com>
7344
7345         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7346
7347         * statement.cs (Using.EmitLocalVariableDecls): Use
7348         TypeManager.idisposable_type, not typeof (IDisposable).
7349         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7350
7351 2004-04-29  Martin Baulig  <martin@ximian.com>
7352
7353         * class.cs (Event.Define): Don't emit the field and don't set
7354         RTSpecialName and SpecialName for events on interfaces.  Fixes
7355         #57703. 
7356
7357 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7358
7359         Refactor Attribute.ApplyAttributes.
7360         * attribute.cs (Attributable): New base class for objects that can
7361         have Attributes applied on them.
7362         (Attribute): Make AttributeUsage fields public.
7363         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7364         (Attribute.IsInternalCall): New property.
7365         (Attribute.UsageAttr): Convert to a public read-only property.
7366         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7367         (Attribute.ResolveType, Attribute.Resolve)
7368         (Attribute.ScanForIndexerName): Update to reflect changes.
7369         (Attribute.CheckAttributeTarget): Re-format.
7370         (Attribute.ApplyAttributes): Refactor, to various
7371         Attributable.ApplyAttributeBuilder methods.
7372         * decl.cs (MemberCore): Make Attributable.
7373         * class.cs (Accessor): Make Attributable.
7374         (MethodData.ApplyAttributes): Use proper attribute types, not
7375         attribute names.
7376         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7377         (TypeContainer.ApplyAttributeBuilder)
7378         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7379         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7380         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7381         (Operator.ApplyAttributeBuilder): New factored-out methods.
7382         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7383         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7384         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7385         * parameter.cs (ParameterBase): New Attributable base class
7386         that can also represent Return types.
7387         (Parameter): Update to the changes.
7388
7389 2004-04-29  Jackson Harper  <jackson@ximian.com>
7390
7391         * driver.cs: Prefer the corlib system version when looking for
7392         assemblies in the GAC. This is still a hack, but its a better hack
7393         now.
7394         
7395 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7396
7397         * decl.cs, enum.cs: Improved error 3005 reporting.
7398   
7399         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7400         (related_symbols): New private member for list of symbols
7401         related to reported error/warning.
7402         
7403         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7404
7405 2004-04-29  Martin Baulig  <martin@ximian.com>
7406
7407         * ecore.cs (Expression.Constantify): If we're an enum and
7408         TypeManager.TypeToCoreType() doesn't give us another type, use
7409         t.UnderlyingSystemType.  Fixes #56178.  
7410
7411 2004-04-29  Martin Baulig  <martin@ximian.com>
7412
7413         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7414         interfaces and for each interface, only add members directly
7415         declared in that interface.  Fixes #53255.
7416
7417 2004-04-28  Martin Baulig  <martin@ximian.com>
7418
7419         * expression.cs (ConditionalLogicalOperator): Use a temporary
7420         variable for `left' to avoid that we evaluate it more than once;
7421         bug #52588.
7422
7423 2004-04-28  Martin Baulig  <martin@ximian.com>
7424
7425         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7426         `void[]' (CS1547).
7427
7428 2004-04-28  Martin Baulig  <martin@ximian.com>
7429
7430         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7431         void (CS1547).
7432
7433         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7434         whether the type is not void (CS1547).
7435
7436 2004-04-28  Martin Baulig  <martin@ximian.com>
7437
7438         * expression.cs (Unary.DoResolveLValue): Override this and report
7439         CS0131 for anything but Operator.Indirection.
7440
7441 2004-04-28  Martin Baulig  <martin@ximian.com>
7442
7443         Committing a patch from Ben Maurer; see bug #50820.
7444
7445         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7446         check for classes.
7447
7448         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7449         classes.        
7450
7451 2004-04-28  Martin Baulig  <martin@ximian.com>
7452
7453         Committing a patch from Ben Maurer; see bug #50820.
7454
7455         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7456         check for classes.
7457
7458         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7459         classes.        
7460
7461 2004-04-28  Martin Baulig  <martin@ximian.com>
7462
7463         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7464         (Block.AddLabel): Call DoLookupLabel() to only search in the
7465         current block.
7466
7467 2004-04-28  Martin Baulig  <martin@ximian.com>
7468
7469         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7470         comparing StringConstants and NullLiterals in Equality and Inequality.
7471
7472 2004-04-28  Jackson Harper  <jackson@ximian.com>
7473
7474         * driver.cs: Attempt to load referenced assemblies from the
7475         GAC. This is the quick and dirty version of this method that
7476         doesnt take into account versions and just takes the first
7477         canidate found. Will be good enough for now as we will not have more
7478         then one version installed into the GAC until I update this method.
7479
7480 2004-04-28  Martin Baulig  <martin@ximian.com>
7481
7482         * typemanager.cs (TypeManager.CheckStructCycles): New public
7483         static method to check for cycles in the struct layout.
7484
7485         * rootcontext.cs (RootContext.PopulateTypes): Call
7486         TypeManager.CheckStructCycles() for each TypeContainer.
7487         [Note: We only need to visit each type once.]
7488
7489 2004-04-28  Martin Baulig  <martin@ximian.com>
7490
7491         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7492
7493         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7494         success and added `out object value'.  Use a `bool resolved' field
7495         to check whether we've already been called rather than
7496         `ConstantValue != null' since this breaks for NullLiterals.
7497
7498 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7499
7500         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7501         setting of this flag, since the 'set' method may be non-public.
7502
7503 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7504
7505         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7506         check on current_vector.Block.
7507
7508 2004-04-27  Martin Baulig  <martin@ximian.com>
7509
7510         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7511         a field initializer.  Fixes #56459.
7512
7513 2004-04-27  Martin Baulig  <martin@ximian.com>
7514
7515         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7516         we're not attempting to use an indexer.  Fixes #52154.
7517
7518 2004-04-27  Martin Baulig  <martin@ximian.com>
7519
7520         * statement.cs (Return): Don't create a return label if we don't
7521         need it; reverts my change from January 20th.  Thanks to Ben
7522         Maurer for this.
7523
7524 2004-04-27  Martin Baulig  <martin@ximian.com>
7525
7526         According to the spec, `goto' can only leave a nested scope, but
7527         never enter it.
7528
7529         * statement.cs (Block.LookupLabel): Only lookup in the current
7530         block, don't recurse into parent or child blocks.
7531         (Block.AddLabel): Check in parent and child blocks, report
7532         CS0140/CS0158 if we find a duplicate.
7533         (Block): Removed this indexer for label lookups.
7534         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7535         this already does the error reporting for us.
7536
7537         * flowanalysis.cs
7538         (FlowBranching.UsageVector.Block): New public variable; may be null.
7539         (FlowBranching.CreateSibling): Added `Block' argument.
7540         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7541         label for the target of a `goto' and check whether we're not
7542         leaving a `finally'.
7543
7544 2004-04-27  Martin Baulig  <martin@ximian.com>
7545
7546         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7547         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7548         just for returns).
7549
7550 2004-04-27  Martin Baulig  <martin@ximian.com>
7551
7552         * statement.cs (Block.AddLabel): Also check for implicit blocks
7553         and added a CS0158 check.
7554
7555 2004-04-27  Martin Baulig  <martin@ximian.com>
7556
7557         * flowanalysis.cs (FlowBranchingLoop): New class.
7558         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7559         UsageVector's instead of an ArrayList.
7560         (FlowBranching.Label): Likewise.
7561         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7562         (FlowBranching.AddBreakVector): New method.
7563
7564 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7565
7566         * attribute.cs: Small regression fix: only convert the type if we
7567         the type is different, fixes System.Drawing build.
7568
7569 2004-04-27  Martin Baulig  <martin@ximian.com>
7570
7571         * attribute.cs (Attribute.Resolve): If we have a constant value
7572         for a named field or property, implicity convert it to the correct
7573         type.
7574
7575 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7576
7577         * statement.cs (Block.Block): Implicit blocks share
7578         'child_variable_names' fields with parent blocks.
7579         (Block.AddChildVariableNames): Remove.
7580         (Block.AddVariable): Mark variable as "used by a child block" in
7581         every surrounding block.
7582         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7583         been used in a child block, complain about violation of "Invariant
7584         meaning in blocks" rule.
7585         * cs-parser.jay (declare_local_variables): Don't use
7586         AddChildVariableNames.
7587         (foreach_statement): Don't create an implicit block: 'foreach'
7588         introduces a scope.
7589
7590 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7591
7592         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7593         converting from 0L to ulong.  Fixes 57522.
7594
7595 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7596
7597         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7598         derived class hides via 'new' keyword field from base class (test-242.cs).
7599         TODO: Handle this in the more general way.
7600         
7601         * class.cs (CheckBase): Ditto.
7602
7603 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7604
7605         * decl.cs (caching_flags): New member for storing cached values
7606         as bit flags.
7607         (MemberCore.Flags): New enum where bit flags for caching_flags
7608         are defined.
7609         (MemberCore.cls_compliance): Moved to caching_flags.
7610         (DeclSpace.Created): Moved to caching_flags.
7611
7612         * class.cs: Use caching_flags instead of DeclSpace.Created
7613         
7614 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7615
7616         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7617         if we are only a derived class, not a nested class.
7618
7619         * typemanager.cs: Same as above, but do this at the MemberLookup
7620         level (used by field and methods, properties are handled in
7621         PropertyExpr).   Allow for the qualified access if we are a nested
7622         method. 
7623
7624 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7625
7626         * class.cs: Refactoring.
7627         (IMethodData): New inteface; Holds links to parent members
7628         to avoid member duplication (reduced memory allocation).
7629         (Method): Implemented IMethodData interface.
7630         (PropertyBase): New inner classes for get/set methods.
7631         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7632         (Event): New inner classes for add/remove methods.
7633         (Event.DelegateMethod): Implemented IMethodData interface.
7634
7635         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7636         EmitContext (related to class.cs refactoring).
7637
7638 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7639
7640         * delegate.cs (Delegate.VerifyApplicability): If the number of
7641         arguments are the same as the number of parameters, first try to
7642         verify applicability ignoring  any 'params' modifier on the last
7643         parameter.
7644         Fixes #56442.
7645
7646 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7647
7648         * class.cs (TypeContainer.AddIndexer): Use
7649         'ExplicitInterfaceName' to determine if interface name was
7650         explicitly specified.  'InterfaceType' is not initialized at this time.
7651         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7652         Indexers array is already in the required order.  Initialize
7653         'IndexerName' only if there are normal indexers.
7654         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7655         (TypeContainer.Emit): Emit DefaultMember attribute only if
7656         IndexerName is initialized.
7657         Fixes #56300.
7658
7659 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7660
7661         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7662         Fixes #57007
7663
7664 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7665
7666         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7667         attributes.
7668         Fix for #56456.
7669
7670         * attribute.cs (Attribute.Resolve): Check for duplicate named
7671         attributes.
7672         Fix for #56463.
7673
7674 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7675
7676         * iterators.cs (MarkYield): track whether we are in an exception,
7677         and generate code accordingly.  Use a temporary value to store the
7678         result for our state.
7679
7680         I had ignored a bit the interaction of try/catch with iterators
7681         since their behavior was not entirely obvious, but now it is
7682         possible to verify that our behavior is the same as MS .NET 2.0
7683
7684         Fixes 54814
7685
7686 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7687
7688         * iterators.cs: Avoid creating temporaries if there is no work to
7689         do. 
7690
7691         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7692         Enumerations, use TypeManager.EnumToUnderlying and call
7693         recursively. 
7694
7695         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7696         bug #57013
7697
7698         (This.Emit): Use EmitContext.EmitThis to emit our
7699         instance variable.
7700
7701         (This.EmitAssign): Ditto.
7702
7703         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7704         codepaths, we will move all the functionality into
7705         Mono.CSharp.This 
7706
7707         (FieldExpr.EmitAssign): Ditto.
7708
7709         This fixes several hidden bugs that I uncovered while doing a code
7710         review of this today.
7711
7712         * codegen.cs (EmitThis): reworked so the semantics are more clear
7713         and also support value types "this" instances.
7714
7715         * iterators.cs: Changed so that for iterators in value types, we
7716         do not pass the value type as a parameter.  
7717
7718         Initialization of the enumerator helpers is now done in the caller
7719         instead of passing the parameters to the constructors and having
7720         the constructor set the fields.
7721
7722         The fields have now `assembly' visibility instead of private.
7723
7724 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7725
7726         * expression.cs (Argument.Resolve): Check if fields passed as ref
7727         or out are contained in a MarshalByRefObject.
7728
7729         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7730         another compiler type.
7731
7732 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7733
7734         * class.cs (Indexer.Define): use the new name checking method.
7735         Also, return false on an error.
7736         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7737         (is_identifier_[start/part]_character): make static.
7738
7739 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7740
7741         * expression.cs (Binary.ResolveOperator): Do no append strings
7742         twice: since we can be invoked more than once (array evaluation)
7743         on the same concatenation, take care of this here.  Based on a fix
7744         from Ben (bug #56454)
7745
7746 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7747
7748         * codegen.cs: Fix another case where CS1548 must be reported (when 
7749         delay-sign isn't specified and no private is available #56564). Fix
7750         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7751         error when MCS is used on the MS runtime and we need to delay-sign 
7752         (which seems unsupported by AssemblyBuilder - see #56621).
7753
7754 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7755
7756         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7757         (TypeManager.ComputeNamespaces): Faster implementation for
7758         Microsoft runtime.
7759
7760         * compiler.csproj: Updated AssemblyName to mcs.
7761
7762 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7763
7764         * rootcontext.cs: Add new types to the boot resolution.
7765
7766         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7767         MulticastDelegate is not allowed.
7768
7769         * typemanager.cs: Add new types to lookup: System.TypedReference
7770         and ArgIterator.
7771
7772         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7773         check for TypedReference or ArgIterator, they are not allowed. 
7774
7775         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7776         makes us properly catch 1510 in some conditions (see bug 56016 for
7777         details). 
7778
7779 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7780
7781         * CryptoConvert.cs: update from corlib version
7782         with endian fixes.
7783
7784 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7785
7786         * class.cs (Indexer.Define): Check indexername declaration
7787
7788 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7789
7790         * attribute.cs (IsClsCompliant): Fixed problem with handling
7791         all three states (compliant, not-compliant, undetected).
7792
7793 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7794
7795         * attribute.cs (Attribute): Location is now public.
7796         (Resolve): Store resolved arguments (pos_values) in attribute class.
7797         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7798         (GetClsCompliantAttributeValue): New method that gets
7799         CLSCompliantAttribute value.
7800         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7801         if exists else null.
7802         (AttributeTester): New class for CLS-Compliant verification routines.
7803
7804         * class.cs (Emit): Add CLS-Compliant verification.
7805         (Method.GetSignatureForError): Implemented.
7806         (Constructor.GetSignatureForError): Implemented
7807         (Constructor.HasCompliantArgs): Returns if constructor has
7808         CLS-Compliant arguments.
7809         (Constructor.Emit): Override.
7810         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7811         is needed to test only parameters.
7812         (FieldBase.GetSignatureForError): Implemented.
7813         (TypeContainer): New member for storing base interfaces.
7814         (TypeContainer.FindMembers): Search in base interfaces too.
7815
7816         * codegen.cs (GetClsComplianceAttribute): New method that gets
7817         assembly or module CLSCompliantAttribute value.
7818         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7819         for assembly.
7820         (ModuleClass.Emit): Add error 3012 test.
7821
7822         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7823
7824         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7825         state for all decl types.
7826         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7827         if CLS-Compliant tests are required.
7828         (IsClsCompliaceRequired): New method. Analyze whether code
7829         must be CLS-Compliant.
7830         (IsExposedFromAssembly): New method. Returns true when MemberCore
7831         is exposed from assembly.
7832         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7833         value or gets cached value.
7834         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7835         is explicitly marked with CLSCompliantAttribute.
7836         (IsIdentifierClsCompliant): New abstract method. This method is
7837         used to testing error 3005.
7838         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7839         for identifier and parameters CLS-Compliant testing.
7840         (VerifyClsCompliance): New method. The main virtual method for
7841         CLS-Compliant verifications.
7842         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7843         null. I don't know why is null (too many public members !).
7844         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7845         and get value of first CLSCompliantAttribute that found.
7846
7847         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7848         (VerifyClsCompliance): Override and add extra tests.
7849
7850         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7851         clscheck- disable CLS-Compliant verification event if assembly is has
7852         CLSCompliantAttribute(true).
7853
7854         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7855         ApllyAttribute is now called in emit section as in the other cases.
7856         Possible future Emit integration.
7857         (IsIdentifierClsCompliant): New override.
7858         (VerifyClsCompliance): New override.
7859         (GetEnumeratorName): Returns full enum name.
7860
7861         * parameter.cs (GetSignatureForError): Implemented.
7862
7863         * report.cs (WarningData): New struct for Warning message information.
7864         (LocationOfPreviousError): New method.
7865         (Warning): New method. Reports warning based on the warning table.
7866         (Error_T): New method. Reports error based on the error table.
7867
7868         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7869         verifications are done here.
7870
7871         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7872
7873         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7874         CLSCompliantAttribute.
7875         (all_imported_types): New member holds all imported types from other
7876         assemblies.
7877         (LoadAllImportedTypes): New method fills static table with exported types
7878         from all referenced assemblies.
7879         (Modules): New property returns all assembly modules.
7880
7881 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7882
7883         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7884         throwing a parser error.
7885
7886         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7887         which removes the hardcoded get_/set_ prefixes for properties, as
7888         IL allows for the properties to be named something else.  
7889
7890         Bug #56013
7891
7892         * expression.cs: Do not override operand before we know if it is
7893         non-null.  Fix 56207
7894
7895 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7896
7897         * typemanager.cs: support for pinned variables.
7898
7899 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7900
7901         * decl.cs, typemanager.cs: Avoid using an arraylist
7902         as a buffer if there is only one result set.
7903
7904 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7905
7906         * expression.cs: Make sure you cant call a static method
7907         with an instance expression, bug #56174.
7908
7909 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7910
7911         * class.cs (IsDuplicateImplementation): Improve error reporting to
7912         flag 663 (method only differs in parameter modifier).
7913
7914         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7915         in preprocessor directives.
7916
7917         * location.cs (LookupFile): Allow for the empty path.
7918
7919         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7920         better approach for some of that patch, but its failing with the
7921         CharSet enumeration.  For now try/catch will do.
7922
7923         * typemanager.cs: Do not crash if a struct does not have fields.
7924         Fixes 56150.
7925
7926 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7927
7928         * expression.cs: cs0213, cant fix a fixed expression.
7929         fixes 50231.
7930
7931 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7932
7933         * cs-parser.jay: detect invalid embeded statements gracefully.
7934         bug #51113.
7935
7936 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7937
7938         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7939         As a regex:
7940         s/
7941         the invocation type may not be a subclass of the tye of the item/
7942         The type of the item must be a subclass of the invocation item.
7943         /g
7944
7945         Fixes bug #50820.
7946
7947 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7948
7949         * attribute.cs: Added methods to get a string and a bool from an
7950         attribute. Required to information from AssemblyKeyFileAttribute,
7951         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7952         * codegen.cs: Modified AssemblyName creation to include support for
7953         strongnames. Catch additional exceptions to report them as CS1548.
7954         * compiler.csproj: Updated include CryptoConvert.cs.
7955         * compiler.csproj.user: Removed file - user specific configuration.
7956         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7957         Mono.Security assembly. The original class is maintained and tested in
7958         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7959         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7960         like CSC 8.0 (C# v2) supports.
7961         * Makefile: Added CryptoConvert.cs to mcs sources.
7962         * rootcontext.cs: Added new options for strongnames.
7963
7964 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7965
7966         * driver.cs: For --expect-error, report error code `2'
7967         if the program compiled with no errors, error code `1' if
7968         it compiled with an error other than the one expected.
7969
7970 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7971
7972         * compiler.csproj: Updated for Visual Studio .NET 2003.
7973         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7974         * compiler.sln: Updated for Visual Studio .NET 2003.
7975
7976 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7977
7978         * expression.cs: Fix bug #47234. We basically need to apply the
7979         rule that we prefer the conversion of null to a reference type
7980         when faced with a conversion to 'object' (csc behaviour).
7981
7982 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7983
7984         * statement.cs: Shorter form for foreach, eliminates
7985         a local variable. r=Martin.
7986
7987 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7988
7989         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7990         checks if we can use brtrue/brfalse to test for 0.
7991         * expression.cs: use the above in the test for using brtrue/brfalse.
7992         cleanup code a bit.
7993
7994 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7995
7996         * expression.cs: Rewrite string concat stuff. Benefits:
7997
7998         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7999         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8000         rather than a concat chain.
8001
8002         * typemanager.cs: Add lookups for more concat overloads.
8003
8004 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8005
8006         * expression.cs: Emit shorter il code for array init.
8007
8008         newarr
8009         dup
8010         // set 1
8011
8012         // set 2
8013
8014         newarr
8015         stloc.x
8016
8017         ldloc.x
8018         // set 1
8019
8020         ldloc.x
8021         // set 2
8022
8023 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8024
8025         * statement.cs: Before, two switch blocks would be merged if the
8026         total size of the blocks (end_item - begin_item + 1) was less than
8027         two times the combined sizes of the blocks.
8028
8029         Now, it will only merge if after the merge at least half of the
8030         slots are filled.
8031
8032         fixes 55885.
8033
8034 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8035
8036         * class.cs : csc build fix for GetMethods(). See bug #52503.
8037
8038 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8039
8040         * expression.cs: Make sure fp comparisons work with NaN.
8041         This fixes bug #54303. Mig approved this patch a long
8042         time ago, but we were not able to test b/c the runtime
8043         had a related bug.
8044
8045 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8046
8047         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8048
8049 2004-03-19  Martin Baulig  <martin@ximian.com>
8050
8051         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8052         error here and not in our caller.
8053
8054 2004-03-19  Martin Baulig  <martin@ximian.com>
8055
8056         * interface.cs: Completely killed this file.
8057         (Interface): We're now a TypeContainer and live in class.cs.
8058
8059         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8060         argument; we're now also called for interfaces.
8061         (TypeContainer.DefineMembers): Allow this method being called
8062         multiple times.
8063         (TypeContainer.GetMethods): New public method; formerly known as
8064         Interface.GetMethod().  This is used by PendingImplementation.
8065         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8066         it's now private and non-static.
8067         (Interface): Moved this here; it's now implemented similar to
8068         Class and Struct.
8069         (Method, Property, Event, Indexer): Added `bool is_interface'
8070         argument to their .ctor's.
8071         (MemberBase.IsInterface): New public field.
8072
8073         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8074         instances instead of InterfaceMethod, InterfaceProperty, etc.
8075         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8076         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8077
8078 2004-03-19  Martin Baulig  <martin@ximian.com>
8079
8080         * class.cs (MethodCore.IsDuplicateImplementation): New private
8081         method which does the CS0111 checking.
8082         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8083         Use IsDuplicateImplementation().
8084
8085 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8086
8087         * decl.cs (FindMemberToOverride): New method to find the correct
8088         method or property to override in the base class.
8089         * class.cs
8090             - Make Method/Property use the above method to find the
8091               version in the base class.
8092             - Remove the InheritableMemberSignatureCompare as it is now
8093               dead code.
8094
8095         This patch makes large code bases much faster to compile, as it is
8096         O(n) rather than O(n^2) to do this validation.
8097
8098         Also, it fixes bug 52458 which is that nested classes are not
8099         taken into account when finding the base class member.
8100
8101         Reviewed/Approved by Martin.
8102
8103 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8104
8105         * interface.cs: In all interface classes removed redundant
8106         member initialization.
8107
8108 2004-03-16  Martin Baulig  <martin@ximian.com>
8109
8110         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8111
8112 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8113
8114         * decl.cs (DefineTypeAndParents): New helper method to define a
8115         type's containers before the type itself is defined;  This is a
8116         bug exposed by the recent changes to Windows.Forms when an
8117         implemented interface was defined inside a class that had not been
8118         built yet.   
8119
8120         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8121
8122         (Check): Loop correctly to report errors modifiers
8123         (UNSAFE was not in the loop, since it was the same as TOP).
8124
8125         * interface.cs: Every interface member now takes a ModFlags,
8126         instead of a "is_new" bool, which we set on the base MemberCore. 
8127
8128         Every place where we called "UnsafeOk" in the interface, now we
8129         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8130         the unsafe settings from the member declaration instead of the
8131         container interface. 
8132
8133         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8134
8135         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8136         `set_indexer_name' to the pending bits (one per type).
8137
8138         We fixed a bug today that was picking the wrong method to
8139         override, since for properties the existing InterfaceMethod code
8140         basically ignored the method name.  Now we make sure that the
8141         method name is one of the valid indexer names.
8142
8143 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8144  
8145         * support.cs (SeekableStreamReader): Keep track of stream byte
8146         positions and don't mix them with character offsets to the buffer.
8147
8148         Patch from Gustavo Giráldez
8149
8150 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8151
8152         * interface.cs (InterfaceSetGetBase): Removed double member
8153         initialization, base class does it as well.
8154
8155 2004-03-13  Martin Baulig  <martin@ximian.com>
8156
8157         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8158         when compiling corlib.
8159
8160 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8161
8162         * convert.cs (ExplicitConversion): We were reporting an error on
8163         certain conversions (object_type source to a value type, when the
8164         expression was `null') before we had a chance to pass it through
8165         the user defined conversions.
8166
8167         * driver.cs: Replace / and \ in resource specifications to dots.
8168         Fixes 50752
8169
8170         * class.cs: Add check for duplicate operators.  Fixes 52477
8171
8172 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8173
8174         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8175         that are in the middle of the statements, not only at the end.
8176         Fixes #54987
8177
8178         * class.cs (TypeContainer.AddField): No longer set the
8179         `HaveStaticConstructor' flag, now we call it
8180         `UserDefineStaticConstructor' to diferentiate the slightly
8181         semantic difference.
8182
8183         The situation is that we were not adding BeforeFieldInit (from
8184         Modifiers.TypeAttr) to classes that could have it.
8185         BeforeFieldInit should be set to classes that have no static
8186         constructor. 
8187
8188         See:
8189
8190         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8191
8192         And most importantly Zoltan's comment:
8193
8194         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8195
8196         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8197          before its static fields are used', i.e. initialization does not need
8198          to be triggered by the first access to the type. Setting this flag
8199          helps the JIT to compile better code, since it can run the static
8200          constructor at JIT time, and does not need to generate code to call it
8201          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8202          this flag for lots of classes like String. 
8203          
8204          csc sets this flag if the type does not have an explicit static 
8205          constructor. The reasoning seems to be that if there are only static
8206          initalizers for a type, and no static constructor, then the programmer
8207          does not care when this initialization happens, so beforefieldinit
8208          can be used.
8209          
8210          This bug prevents the AOT compiler from being usable, since it 
8211          generates so many calls to mono_runtime_class_init that the AOT code
8212          is much slower than the JITted code. The JITted code is faster, 
8213          because it does not generate these calls if the vtable is type is
8214          already initialized, which is true in the majority of cases. But the
8215          AOT compiler can't do this."
8216
8217 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8218
8219         * class.cs (MethodData.Emit): Refactor the code so symbolic
8220         information is generated for destructors;  For some reasons we
8221         were taking a code path that did not generate symbolic information
8222         before. 
8223
8224 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8225
8226         * class.cs: Create a Constructor.CheckBase method that
8227         takes care of all validation type code. The method
8228         contains some code that was moved from Define.
8229
8230         It also includes new code that checks for duplicate ctors.
8231         This fixes bug #55148.
8232
8233 2004-03-09  Joshua Tauberer <tauberer@for.net>
8234
8235         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8236         a { ... }-style array creation invokes EmitStaticInitializers
8237         which is not good for reference-type arrays.  String, decimal
8238         and now null constants (NullCast) are not counted toward
8239         static initializers.
8240
8241 2004-03-05  Martin Baulig  <martin@ximian.com>
8242
8243         * location.cs (SourceFile.HasLineDirective): New public field;
8244         specifies whether the file contains or is referenced by a "#line"
8245         directive.
8246         (Location.DefineSymbolDocuments): Ignore source files which
8247         either contain or are referenced by a "#line" directive.        
8248
8249 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8250
8251         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8252         direct access to our parent, so check the method inline there.
8253
8254 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8255
8256         * expression.cs (Invocation.EmitCall): Miguel's last commit
8257         caused a regression. If you had:
8258
8259             T t = null;
8260             t.Foo ();
8261
8262         In Foo the implict this would be null.
8263
8264 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8265
8266         * expression.cs (Invocation.EmitCall): If the method is not
8267         virtual, do not emit a CallVirt to it, use Call.
8268
8269         * typemanager.cs (GetFullNameSignature): Improve the method to
8270         cope with ".ctor" and replace it with the type name.
8271
8272         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8273         as an argument the ConstructorBuilder where it is being defined,
8274         to catch the recursive constructor invocations.
8275
8276 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8277
8278         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8279         routines to check if a type is an enumerable/enumerator allow
8280         classes that implement the IEnumerable or IEnumerator interfaces.
8281
8282         * class.cs (Property, Operator): Implement IIteratorContainer, and
8283         implement SetYields.
8284
8285         (Property.Define): Do the block swapping for get_methods in the
8286         context of iterators.   We need to check if Properties also
8287         include indexers or not.
8288
8289         (Operator): Assign the Block before invoking the
8290         OperatorMethod.Define, so we can trigger the Iterator code
8291         replacement. 
8292
8293         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8294         Property and Operator classes are not created when we parse the
8295         declarator but until we have the block completed, so we use a
8296         singleton SimpleIteratorContainer.Simple to flag whether the
8297         SetYields has been invoked.
8298
8299         We propagate this setting then to the Property or the Operator to
8300         allow the `yield' to function.
8301
8302 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8303
8304         * codegen.cs: Implemented attribute support for modules.
8305         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8306         Assembly/Module functionality.
8307
8308         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8309         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8310         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8311
8312 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8313
8314         * interface.cs (FindMembers): The operation is performed on all base
8315         interfaces and not only on the first. It is required for future CLS Compliance patch.
8316
8317 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8318
8319         * statement.cs, codegen.cs:
8320         This patch deals with patterns such as:
8321
8322         public class List : IEnumerable {
8323
8324                 public MyEnumerator GetEnumerator () {
8325                         return new MyEnumerator(this);
8326                 }
8327
8328                 IEnumerator IEnumerable.GetEnumerator () {
8329                         ...
8330                 }
8331                 
8332                 public struct MyEnumerator : IEnumerator {
8333                         ...
8334                 }
8335         }
8336
8337         Before, there were a few things we did wrong:
8338         1) we would emit callvirt on a struct, which is illegal
8339         2) we emited ldarg when we needed to emit ldarga
8340         3) we would mistakenly call the interface methods on an enumerator
8341         type that derived from IEnumerator and was in another assembly. For example:
8342
8343         public class MyEnumerator : IEnumerator
8344
8345         Would have the interface methods called, even if there were public impls of the
8346         method. In a struct, this lead to invalid IL code.
8347
8348 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8349
8350         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8351           renamed to Emit.
8352
8353         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8354
8355 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * cs-parser.jay: Fix small regression: we were not testing V2
8358         compiler features correctly.
8359
8360         * interface.cs: If the emit context is null, then create one
8361
8362 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8363
8364         * decl.cs (GetSignatureForError): New virtual method to get full name
8365           for error messages.
8366
8367         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8368           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8369
8370         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8371           Duplicated members and code in these classes has been removed.
8372           Better encapsulation in these classes.
8373
8374 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8375
8376         * assign.cs (Assign.DoResolve): When dealing with compound
8377         assignments, there is a new rule in ECMA C# 2.4 (might have been
8378         there before, but it is documented here) that states that in:
8379
8380         a op= b;
8381
8382         If b is of type int, and the `op' is a shift-operator, then the
8383         above is evaluated as:
8384
8385         a = (int) a op b 
8386
8387         * expression.cs (Binary.ResolveOperator): Instead of testing for
8388         int/uint/long/ulong, try to implicitly convert to any of those
8389         types and use that in pointer arithmetic.
8390
8391         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8392         method to print information for from the type, not from the
8393         null-method we were given.
8394
8395 2004-02-01  Duncan Mak  <duncan@ximian.com>
8396
8397         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8398         parsing for cmd, fixes bug #53694.
8399
8400 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8401
8402         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8403         in the member name duplication tests. Property and operator name duplication
8404         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8405
8406 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8407
8408         * interface.cs (PopulateMethod): Fixed crash when interface method
8409         returns not existing type (error test cs0246-3.cs).
8410
8411 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8412
8413         * cs-parser.jay (interface_accessors): Re-write actions to also
8414         store attributes attached to get and set methods. Fix spelling
8415         while at it.
8416
8417         (inteface_property_declaration): Modify accordingly.
8418
8419         (InterfaceAccessorInfo): New helper class to store information to pass
8420         around between rules that use interface_accessors.
8421
8422         * interface.cs (Emit): Apply attributes on the get and set
8423         accessors of properties and indexers too.
8424
8425         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8426         right MethodBuilder when applying attributes to the get and set accessors.
8427
8428 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8429
8430         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8431
8432 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8433
8434         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8435
8436 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8437
8438         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8439         changes that treat `yield' specially when present before `break'
8440         or `return' tokens.
8441
8442         * cs-tokenizer.cs: yield is no longer a keyword.
8443
8444 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8445
8446         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8447         setting for default constructors.
8448         For default constructors are almost every time set wrong Modifier. The
8449         generated IL code has been alright. But inside mcs this values was
8450         wrong and this was reason why several of my CLS Compliance tests
8451         failed.
8452
8453 2004-01-22  Martin Baulig  <martin@ximian.com>
8454
8455         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8456         not a QualifiedIdentifier.  This is what `type_name_expression'
8457         was previously doing.
8458         (type_name_expression): Removed; the code is now in
8459         `namespace_or_type_name'.
8460         (qualified_identifier): Removed, use `namespace_or_type_name'
8461         instead.
8462         (QualifiedIdentifier): Removed this class.      
8463
8464 2004-01-22  Martin Baulig  <martin@ximian.com>
8465
8466         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8467         not a string as alias name.
8468
8469 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8472         #52730 bug, and instead compute correctly the need to use a
8473         temporary variable when requesting an address based on the
8474         static/instace modified of the field and the constructor.
8475  
8476 2004-01-21  Martin Baulig  <martin@ximian.com>
8477
8478         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8479         class and namespace before looking up aliases.  Fixes #52517.
8480
8481 2004-01-21  Martin Baulig  <martin@ximian.com>
8482
8483         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8484         assinged in a 'try'; fixes exception4.cs.
8485
8486 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8487         * class.cs : Implemented parameter-less constructor for TypeContainer
8488
8489         * decl.cs: Attributes are now stored here. New property OptAttributes
8490
8491         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8492
8493         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8494
8495 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8496
8497         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8498           (CSharpSignature): New method for indexer and property signature.
8499
8500 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8501
8502         * pending.cs (IsVirtualFilter): Faster implementation.
8503
8504 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8505
8506         * typemanager.cs: Avoid inclusion of same assembly more than once.
8507
8508 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8509
8510         * cs-parser.jay: Fixed problem where the last assembly attribute
8511           has been applied also to following declaration (class, struct, etc.)
8512           
8513 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8514
8515         * class.cs: Added error CS0538, CS0539 reporting.
8516         Fixed crash on Microsoft runtime when field type is void.
8517
8518         * cs-parser.jay: Added error CS0537 reporting.
8519
8520         * pending.cs: Added error CS0535 reporting.
8521         Improved error report for errors CS0536, CS0534.
8522
8523 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8524
8525         Merge a few bits from the Anonymous Method MCS tree.
8526
8527         * statement.cs (ToplevelBlock): New class for toplevel methods,
8528         will hold anonymous methods, lifted variables.
8529
8530         * cs-parser.jay: Create toplevel blocks for delegates and for
8531         regular blocks of code. 
8532
8533 2004-01-20  Martin Baulig  <martin@ximian.com>
8534
8535         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8536         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8537         and `NeedExplicitReturn'; added `IsLastStatement'.
8538         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8539         have a `ReturnLabel' or we're not unreachable.
8540
8541         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8542         child's reachability; don't just override ours with it.  Fixes
8543         #58058 (lluis's example).
8544         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8545         InFinally(), InLoop(), InSwitch() and
8546         BreakCrossesTryCatchBoundary() methods.
8547
8548         * statement.cs (Return): Do all error checking in Resolve().
8549         Unless we are the last statement in a top-level block, always
8550         create a return label and jump to it.
8551         (Break, Continue): Do all error checking in Resolve(); also make
8552         sure we aren't leaving a `finally'.
8553         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8554         statement in a top-level block.
8555         (Block.Flags): Added `IsDestructor'.
8556         (Block.IsDestructor): New public property.
8557
8558 2004-01-20  Martin Baulig  <martin@ximian.com>
8559
8560         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8561
8562 2004-01-20  Martin Baulig  <martin@ximian.com>
8563
8564         * statement.cs (Statement.ResolveUnreachable): New public method.
8565         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8566         (Block.Resolve): Resolve unreachable statements.
8567
8568 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8569
8570         * expression.cs: We need to fix the case where we do
8571         not have a temp variable here.
8572
8573         * assign.cs: Only expression compound assignments need
8574         temporary variables.
8575
8576 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8577
8578         * flowanalysis.cs: Reduce memory allocation in a few ways:
8579           - A block with no variables should not allocate a bit
8580             vector for itself.
8581           - A method with no out parameters does not need any tracking
8582             for assignment of the parameters, so we need not allocate
8583             any data for it.
8584           - The arrays:
8585                 public readonly Type[] VariableTypes;
8586                 public readonly string[] VariableNames;
8587             Are redundant. The data is already stored in the variable
8588             map, so we need not allocate another array for it.
8589           - We need to add alot of checks for if (params | locals) == null
8590             due to the first two changes.
8591
8592 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8593
8594         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8595         implement IMemoryLocation, we store a copy on a local variable and
8596         take the address of it.  Patch from Benjamin Jemlich
8597
8598         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8599         to use a special "type_name_expression" rule which reduces the
8600         number of "QualifiedIdentifier" classes created, and instead
8601         directly creates MemberAccess expressions.
8602
8603 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8604
8605         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8606         that fixes #52853.  Null literal assignment to ValueType
8607
8608         * class.cs (MethodData.Emit): Instead of checking the name of the
8609         method to determine if its a destructor, create a new derived
8610         class from Method called Destructor, and test for that.  
8611
8612         * cs-parser.jay: Create a Destructor object instead of a Method.  
8613
8614         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8615
8616         Fixes: 52933
8617
8618 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8619
8620         * expression.cs (Binary.ResolveOperator): Perform an implicit
8621         conversion from MethodGroups to their delegate types on the
8622         Addition operation.
8623
8624         * delegate.cs: Introduce a new class DelegateCreation that is the
8625         base class for `NewDelegate' and `ImplicitDelegateCreation',
8626         factor some code in here.
8627
8628         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8629         conversion from MethodGroups to compatible delegate types. 
8630
8631         * ecore.cs (Expression.Resolve): Do not flag error 654
8632         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8633         we allow conversions from MethodGroups to delegate types now.
8634
8635         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8636         assignments in v2 either.
8637
8638 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8639
8640         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8641         static read-only fields in ctors.
8642
8643         Applied patch from Benjamin Jemlich 
8644
8645         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8646
8647 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8648
8649         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8650         here to return true, as they can be used like this:
8651
8652                 (XXX) int.MEMBER ()
8653
8654         Fixed 49836 and all the other dups
8655
8656 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8657
8658         * driver.cs: Implement /win32res and /win32icon.
8659
8660 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8661
8662         * cs-parser.jay: Add a rule to improve error handling for the
8663         common mistake of placing modifiers after the type.
8664
8665 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8666
8667         * cs-parser.jay (interface_event_declaration): Catch
8668         initialization of events on interfaces, and report cs0068
8669
8670         * cs-parser.jay (interface_event_declaration): Catch
8671         initialization of events. 
8672
8673         * ecore.cs: Better report missing constructors.
8674
8675         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8676         the error reporting done in the wrong place.  Fix.
8677
8678         * expression.cs (Binary.ResolveOperator): Catch the 
8679         operator + (E x, E y) error earlier, and later allow for implicit
8680         conversions in operator +/- (E e, U x) from U to the underlying
8681         type of E.
8682
8683         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8684         52596, if the container class is abstract, the default constructor
8685         is protected otherwise its public (before, we were always public).
8686
8687         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8688         fixed statement.
8689
8690         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8691         Jemlich that fixes bug #52597, MCS was generating invalid code for
8692         idisposable structs.   Thanks to Ben for following up with this
8693         bug as well.
8694
8695 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8696
8697         * driver.cs: Allow assemblies without code to be generated, fixes
8698         52230.
8699
8700 2004-01-07  Nick Drochak <ndrochak@gol.com>
8701
8702         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8703
8704 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8705
8706         * cs-parser.jay: Add rules to improve error reporting if fields or
8707         methods are declared at the namespace level (error 116)
8708
8709         * Add rules to catch event add/remove
8710
8711 2004-01-04  David Sheldon <dave-mono@earth.li>
8712
8713   * expression.cs: Added matching ")" to error message for 
8714   CS0077
8715
8716 2004-01-03 Todd Berman <tberman@gentoo.org>
8717
8718         * ecore.cs, attribute.cs:
8719         Applying fix from #52429.
8720
8721 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8722
8723         * ecore.cs, expression.cs, statement.cs:
8724         Total rewrite of how we handle branching. We
8725         now handle complex boolean expressions with fewer
8726         jumps. As well if (x == 0) no longer emits a ceq.
8727
8728         if (x is Foo) is much faster now, because we generate
8729         better code.
8730
8731         Overall, we get a pretty big improvement on our benchmark
8732         tests. The code we generate is smaller and more readable.
8733
8734         I did a full two-stage bootstrap. The patch was reviewed
8735         by Martin and Miguel.
8736
8737 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8738
8739         * cs-parser.jay: Make primary_expression not take a QI.
8740         we dont need this because the member_access rule covers
8741         us here. So we replace the rule with just IDENTIFIER.
8742
8743         This has two good effects. First, we remove a s/r conflict.
8744         Second, we allocate many fewer QualifiedIdentifier objects.
8745
8746 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8747
8748         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8749         set the correct information via SRE. This prevents
8750         hanging on the MS runtime. Fixes #29374.
8751
8752 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8753
8754         * convert.cs: correctly handle conversions to value types
8755         from Enum and ValueType as unboxing conversions.
8756
8757         Fixes bug #52569. Patch by Benjamin Jemlich.
8758
8759 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8760
8761         * expression.cs (BetterConversion): Prefer int -> uint
8762         over int -> ulong (csc's behaviour). This fixed bug #52046.
8763
8764 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8765
8766         * decl.cs (MemberCache.FindMembers): now returns a
8767         MemberInfo [].
8768
8769         * typemanager.cs: In general, go with with ^^.
8770         (CopyNewMethods): take an IList.
8771         (RealMemberLookup): Only allocate an arraylist
8772         if we copy from two sets of methods.
8773
8774         This change basically does two things:
8775         1) Fewer array lists allocated due to CopyNewMethods.
8776         2) the explicit cast in MemberList costed ALOT.
8777
8778 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8779
8780         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8781         a hashtable to avoid needless string allocations when an identifier is
8782         used more than once (the common case).
8783
8784 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8785
8786         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8787         is broken, it will not return anything. So, we
8788         have to use the information we have in mcs to
8789         do the task.
8790
8791         * typemanager.cs: Add a cache for GetInterfaces,
8792         since this will now be used more often (due to ^^)
8793
8794         (GetExplicitInterfaces) New method that gets the
8795         declared, not effective, interfaces on a type
8796         builder (eg, if you have interface IFoo, interface
8797         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8798         { IBar }.
8799
8800         This patch makes MCS able to bootstrap itself on
8801         Windows again.
8802
8803 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8804
8805         * expression.cs: Remove the Nop's that Miguel put
8806         in by mistake.
8807
8808 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8809
8810         * report.cs, codegen.cs: Give the real stack trace to
8811         the error when an exception is thrown.
8812
8813 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8814
8815         * decl.cs: only allocate hashtables for ifaces if 
8816         it is an iface!
8817
8818 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8819
8820         * expression.cs: fix the error from cs0121-2.cs
8821         (a parent interface has two child interfaces that
8822         have a function with the same name and 0 params
8823         and the function is called through the parent).
8824
8825 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8826
8827         * class.cs, rootcontext.cs, typmanager.cs: do not
8828         leak pointers.
8829
8830 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8831
8832         * codegen.cs: remove stack for the ec flow branching.
8833         It is already a linked list, so no need.
8834
8835 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8836
8837         * Makefile: Allow custom profiler here.
8838
8839 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8840
8841         * typemanager.cs (LookupType):
8842           - Use a static char [], because split takes
8843             a param array for args, so it was allocating
8844             every time.
8845           - Do not store true in a hashtable, it boxes.
8846
8847 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8848
8849         * flowanalysis.cs: bytify common enums.
8850
8851 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8852
8853         * modifiers.cs: Add a new set of flags for the
8854         flags allowed on explicit interface impls.
8855         * cs-parser.jay: catch the use of modifiers in
8856         interfaces correctly.
8857         * class.cs: catch private void IFoo.Blah ().
8858
8859         All related to bug #50572.
8860
8861 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8862
8863         * decl.cs: Rewrite the consistant accessability checking.
8864         Accessability is not linear, it must be implemented in
8865         a tableish way. Fixes #49704.
8866
8867 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8868
8869         * expression.cs: Handle negation in a checked context.
8870         We must use subtraction from zero. Fixes #38674.
8871
8872 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8873
8874         * class.cs: Ignore static void main in DLLs.
8875         * rootcontext.cs: Handle the target type here,
8876         since we are have to access it from class.cs
8877         * driver.cs: account for the above.
8878
8879 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8880
8881         * report.cs: Give line numbers and files if available.
8882
8883 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8884
8885         * driver.cs: Implement /addmodule.
8886
8887         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8888         ModuleBuilders.
8889
8890 2003-12-20  Martin Baulig  <martin@ximian.com>
8891
8892         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8893         (FieldBase.IsAssigned): Removed this field.
8894         (FieldBase.SetAssigned): New public method.
8895         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8896
8897 2003-12-20  Martin Baulig  <martin@ximian.com>
8898
8899         * expression.cs (LocalVariableReference.DoResolve): Don't set
8900         `vi.Used' if we're called from DoResolveLValue().
8901
8902         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8903         returns the usage vector it just merged into the current one -
8904         pass this one to UsageWarning().
8905         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8906         of the `EmitContext', don't call this recursively on our children.
8907
8908 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8909
8910         * driver.cs: Implement /target:module.
8911
8912 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8913
8914         * support.cs (CharArrayHashtable): New helper class.
8915
8916         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8917         char arrays, not strings, so we can avoid creating a string in
8918         consume_identifier if the identifier is a keyword.
8919
8920 2003-12-16  Martin Baulig  <martin@ximian.com>
8921
8922         * statement.cs (LocalInfo.Assigned): Removed this property.
8923         (LocalInfo.Flags): Removed `Assigned'.
8924         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8925         and uses flow analysis.
8926         (Block.UsageWarning): Made this method private.
8927         (Block.Resolve): Call UsageWarning() if appropriate.
8928
8929         * expression.cs (LocalVariableReference.DoResolve): Always set
8930         LocalInfo.Used here.
8931
8932 2003-12-13  Martin Baulig  <martin@ximian.com>
8933
8934         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8935         any value here; we're now using flow analysis to figure out
8936         whether a statement/block returns a value.
8937
8938 2003-12-13  Martin Baulig  <martin@ximian.com>
8939
8940         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8941         working again.
8942         (FlowBranching.MergeFinally): Don't call
8943         `branching.CheckOutParameters()' here, this is called in
8944         MergeTopBlock().
8945         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8946         when adding the `finally' vector.       
8947
8948 2003-12-13  Martin Baulig  <martin@ximian.com>
8949
8950         * flowanalysis.cs
8951         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8952         actually work and also fix #48962.
8953
8954 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8955
8956         * decl.cs: Do not check System.Object for nested types,
8957         since we know it does not have any. Big bang for buck:
8958
8959         BEFORE:
8960            Run 1:   8.35 seconds
8961            Run 2:   8.32 seconds
8962            corlib:  17.99 seconds
8963         AFTER:
8964            Run 1:   8.17 seconds
8965            Run 2:   8.17 seconds
8966            corlib:  17.39 seconds
8967
8968 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8969
8970         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8971         time we are returning 0 members, so we save alot here.
8972
8973 2003-12-11  Martin Baulig  <martin@ximian.com>
8974
8975         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8976         `MergeChild()', also just take the `FlowBranching' as argument;
8977         call Merge() on it and return the result.
8978         (FlowBranching.Merge): We don't need to do anything if we just
8979         have one sibling.
8980
8981 2003-12-11  Martin Baulig  <martin@ximian.com>
8982
8983         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8984         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8985         Maurer for this idea.
8986
8987 2003-12-11  Martin Baulig  <martin@ximian.com>
8988
8989         * flowanalysis.cs (MergeResult): This class is now gone; we now
8990         use the `UsageVector' for this.  The reason for this is that if a
8991         branching just has one sibling, we don't need to "merge" them at
8992         all - that's the next step to do.
8993         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8994         `MergeResult'.
8995
8996 2003-12-11  Martin Baulig  <martin@ximian.com>
8997
8998         Reworked flow analyis and made it more precise and bug-free.  The
8999         most important change is that we're now using a special `Reachability'
9000         class instead of having "magic" meanings of `FlowReturns'.  I'll
9001         do some more cleanups and optimizations and also add some more
9002         documentation this week.
9003
9004         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9005         largely reworked this class.
9006         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9007         the new `Reachability' class instead of having "magic" values here.
9008         (FlowBranching): We're now using an instance of `Reachability'
9009         instead of having separate `Returns', `Breaks' etc. fields.
9010
9011         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9012         based on flow analysis; ignore the return value of block.Emit ().
9013
9014 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9015
9016         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9017         if they are private.
9018
9019 2003-12-09  Martin Baulig  <martin@ximian.com>
9020
9021         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9022         call them directly on the UsageVector.
9023
9024 2003-12-09  Martin Baulig  <martin@ximian.com>
9025
9026         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9027         Changed return type from `FlowReturns' to `Reachability'.
9028
9029 2003-12-09  Martin Baulig  <martin@ximian.com>
9030
9031         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9032         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9033         `Reachable' fields with a single `Reachability' one.
9034
9035 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9036
9037         * class.cs (FindMembers): Remove foreach's.
9038
9039         Bootstrap times:
9040
9041         BEFORE
9042                 Run 1:   8.74 seconds
9043                 Run 2:   8.71 seconds
9044
9045         AFTER
9046                 Run 1:   8.64 seconds
9047                 Run 2:   8.58 seconds
9048
9049
9050 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9051
9052         * cs-parser.jay:
9053         * gen-treedump.cs:
9054         * statement.cs:
9055         This patch does a few things:
9056                 1. EmptyStatement is now a singleton, so it is never reallocated.
9057                 2. All blah is EmptyStatement constructs have been changed to
9058                    blah == EmptyStatement.Value, which is much faster and valid
9059                    now that EmptyStatement is a singleton.
9060                 3. When resolving a block, rather than allocating a new array for
9061                    the non-empty statements, empty statements are replaced with
9062                    EmptyStatement.Value
9063                 4. Some recursive functions have been made non-recursive.
9064         Mainly the performance impact is from (3), however (1) and (2) are needed for
9065         this to work. (4) does not make a big difference in normal situations, however
9066         it makes the profile look saner.
9067
9068         Bootstrap times:
9069
9070         BEFORE
9071         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9072         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9073         Total memory allocated: 56397 KB
9074
9075         AFTER
9076         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9077         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9078         Total memory allocated: 55666 KB
9079
9080 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9081
9082         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9083         than the hashtable in a hashtable version
9084
9085         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9086         we always end up concating a string. This results in a huge perf
9087         loss, because many strings have to be tracked by the GC. In this
9088         patch, we first use a hashtable that works with two keys, so that
9089         the strings do not need to be concat'ed.
9090
9091         Bootstrap times:
9092         BEFORE
9093                 Run 1:   8.74 seconds
9094                 Run 2:   8.71 seconds
9095
9096         AFTER
9097                 Run 1:   8.65 seconds
9098                 Run 2:   8.56 seconds
9099
9100 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9101
9102         * Makefile: Add a new target `do-time' that does a quick and simple
9103         profile, leaving easy to parse output.
9104
9105 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9106
9107         * codegen.cs (Init): Create the dynamic assembly with 
9108         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9109
9110 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9111
9112         * support.cs: Make the PtrHashtable use only one
9113         instance of its comparer.
9114
9115 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9116
9117         * typemanager.cs: Fix lookup of GetNamespaces.
9118
9119 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9120
9121         * expression.cs: Removed redundant line.
9122
9123         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9124         ArrayLists, use for loops with bounds.  
9125
9126         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9127         arraylist.
9128
9129         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9130         arraylists, use for loop with bounds.
9131
9132         The above three changes give us a 0.071 second performance
9133         improvement out of 3.294 seconds down to 3.223.  On my machine
9134         the above changes reduced the memory usage by 1,387 KB during
9135         compiler bootstrap.
9136
9137         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9138         QualifiedIdentifiers.  Before we created a new string through
9139         concatenation, and mostly later on, the result would be
9140         manipulated by DecomposeQI through string manipulation.
9141
9142         This reduced the compiler memory usage for bootstrapping from
9143         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9144         compile times in 0.05 seconds.
9145
9146 2003-11-28  Dick Porter  <dick@ximian.com>
9147
9148         * support.cs: Do string compares with the Invariant culture.
9149
9150         * rootcontext.cs: 
9151         * gen-treedump.cs: 
9152         * expression.cs: 
9153         * driver.cs: 
9154         * decl.cs: 
9155         * codegen.cs: 
9156         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9157         the comparison is done with the Invariant culture.
9158
9159 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9160
9161         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9162         GetEnumerator method.
9163
9164         (ProbeCollectionType): Iterate starting at the most specific type
9165         upwards looking for a GetEnumerator
9166
9167         * expression.cs: Shift count can be up to 31 for int/uint and 63
9168         for long/ulong.
9169
9170 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9171
9172         * statement.cs (Block.LookupLabel): Also look for the label on the
9173         children blocks.  Use a hash table to keep track of visited
9174         nodes. 
9175
9176         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9177         we actually did transform the other operand, otherwise fall back
9178         to the common codepath that casts to long.
9179
9180         * cs-tokenizer.cs: Use the same code pattern as the int case.
9181         Maybe I should do the parsing myself, and avoid depending on the
9182         Parse routines to get this done.
9183
9184 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9185
9186         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9187         which fixes bug 51347.  This time test it.
9188
9189         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9190         attributes for example can not tell the difference between these.
9191         The difference was only a syntax feature of the language. 
9192
9193         * attribute.cs: Apply attributes to delegates.
9194
9195         * delegate.cs: Call the apply attributes method.
9196
9197 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9198
9199         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9200         comparing 0 vs Byte.MinValue, not the value
9201
9202         (ImplicitConversionRequired): When reporting a conversion error,
9203         use error 31 to print out the constant error instead of the
9204         simpler 29.
9205
9206         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9207         which fixes bug 51347.
9208
9209 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9210
9211         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9212         which fixes the -warnaserror command line option.
9213
9214 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9215
9216         * cfold.cs (DoNumericPromotions): During constant folding of
9217         additions on UIntConstant, special case intconstants with
9218         IntConstants like we do on the expression binary operator. 
9219
9220 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9221
9222         * convert.cs (ImplicitReferenceConversion): We were missing a case
9223         (System.Enum are not value types or class types, so we need to
9224         classify them separatedly).
9225
9226         * driver.cs: We do not support error 2007.
9227
9228 2003-11-12 Jackson Harper <jackson@ximian.com>
9229
9230         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9231         system directory. Also use the full file name so users can
9232         libraries names mscorlib-o-tron.dll in a non system dir.
9233
9234 2003-11-10  Martin Baulig  <martin@ximian.com>
9235
9236         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9237         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9238         calling `ResolveType()' on them, directly assign their `Type'.
9239
9240 2003-11-08  Martin Baulig  <martin@ximian.com>
9241
9242         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9243         return value and the `out parent' parameter.
9244         (TypeContainer.DefineType): Moved the CS0644 check into
9245         GetClassBases().  Don't pass the interface types to the
9246         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9247         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9248
9249         * ecore.cs (TypeExpr.IsAttribute): New property.
9250         (TypeExpr.GetInterfaces): New method.
9251
9252         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9253         TypeExpr instead of a Type.
9254         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9255         (Interface.DefineType): Don't pass the interface types to the
9256         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9257         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9258
9259         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9260         instead of a `Type[]'.
9261         (TypeManager.RegisterBuilder): Likewise.
9262         (TypeManager.AddUserInterface): Likewise.
9263         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9264         `Type[]' and also return a `TypeExpr[]'.
9265         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9266
9267 2003-11-08  Martin Baulig  <martin@ximian.com>
9268
9269         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9270         Expression.     
9271
9272 2003-11-08  Martin Baulig  <martin@ximian.com>
9273
9274         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9275         TypeManager.ResolveExpressionTypes().
9276
9277         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9278         instead of an Expression.
9279         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9280         (TypeExpression): New public class; formerly known as `TypeExpr'.
9281
9282         * expression.cs (ComposedCast): Derive from TypeExpr.
9283
9284         * typemanager.cs (TypeManager.system_*_expr): These are now
9285         TypExpr's instead of Expression's.
9286         (TypeManager.ResolveExpressionTypes): New public static function;
9287         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9288         of them.        
9289
9290 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9291
9292         * expression.cs (New.DoResolve): Do not dereference value that
9293         might be a null return.
9294
9295         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9296         sure that the constant value has the right type.  Fixes an
9297         unreported bug, similar to 50425.
9298
9299         * const.cs (Const.LookupConstantValue): Call
9300         ImplicitStandardConversionExists before doing a conversion to
9301         avoid havng the TypeManager.ChangeType do conversions.
9302
9303         Reduced the number of casts used
9304
9305         (Const.ChangeType): New routine to enable reuse of the constant
9306         type changing code from statement.
9307
9308         * typemanager.cs (ChangeType): Move common initialization to
9309         static global variables.
9310
9311         Fixes #50425.
9312
9313         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9314         every value type to go through, even if it was void.  Fix that. 
9315
9316         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9317         character of the define, and the is_identifier_part_character for
9318         the rest of the string.
9319
9320 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9321
9322         * expression.cs (UnaryMutator.EmitCode): When I updated
9323         LocalVariableReference.DoResolve, I overdid it, and dropped an
9324         optimization done on local variable references.
9325
9326 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * ecore.cs: Convert the return from Ldlen into an int.
9329
9330 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9331
9332         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9333         the accessibility, this is a special case for toplevel non-public
9334         classes (internal for instance).
9335
9336 2003-10-20  Nick Drochak <ndrochak@gol.com>
9337
9338         * ecore.cs: Fix typo and build.  Needed another right paren.
9339
9340 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9341
9342         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9343         `internal' case regular and protected, but not allowing protected
9344         to be evaluated later.  Bug 49840
9345
9346 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9349         to kb.Nlast, and not the kb.nFirst to isolate the switch
9350         statement.
9351
9352         Extract the underlying type, so enumerations of long/ulong are
9353         treated like long/ulong.
9354
9355 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9356
9357         * expression.cs (New): Overload the meaning of RequestedType to
9358         track the possible creation of the NewDelegate type, since
9359         DoResolve is invoked more than once for new constructors on field
9360         initialization.
9361
9362         See bugs: #48800 and #37014
9363
9364         * cs-parser.jay (declare_local_constants): Take an arraylist
9365         instead of a single constant.
9366
9367         (local_constant_declaration): It should take a
9368         constant_declarators, not a constant_declarator.  Fixes 49487
9369
9370         * convert.cs: Fix error report.
9371
9372 2003-10-13 Jackson Harper <jackson@ximian.com>
9373
9374         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9375         bug #49611
9376
9377 2003-10-09  Martin Baulig  <martin@ximian.com>
9378
9379         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9380         to the .ctor.
9381         (MethodCore.DoDefineParameters): Removed the TypeContainer
9382         argument; use the DeclSpace which was passed to the .ctor instead.
9383         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9384         TypeContainer; we only need a DeclSpace here.
9385
9386 2003-10-09  Martin Baulig  <martin@ximian.com>
9387
9388         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9389         to the .ctor.
9390         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9391         EmitContext's .ctor.    
9392
9393 2003-10-09  Martin Baulig  <martin@ximian.com>
9394
9395         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9396         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9397         AsAccessible(), moved them as well.
9398
9399         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9400
9401 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9402
9403         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9404
9405 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9406
9407         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9408         generation for >=, as spotted by Paolo, bug 48679.  
9409         Patch from David Waite.
9410
9411         * cs-tokenizer.cs: Add handling for #pragma.
9412
9413         * cs-parser.jay: Allow for both yield and yield return in the
9414         syntax.  The anti-cobolization of C# fight will go on!
9415
9416         * class.cs (TypeBuilder.DefineType): Catch error condition here
9417         (Parent.DefineType erroring out and returning null).
9418
9419         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9420         coping with enumerations variables, we were mistakenly processing
9421         them as a regular value type instead of built-in types.  Fixes the
9422         bug #48063
9423
9424         * typemanager.cs (IsBuiltinOrEnum): New method.
9425
9426 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9427
9428         * cs-parser.jay: Upgrade: yield now needs the return clause.
9429
9430 2003-09-19  Martin Baulig  <martin@ximian.com>
9431
9432         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9433         `MemberCache parent' argument.  Normally, an interface doesn't
9434         have a parent type except System.Object, but we use this in gmcs
9435         for generic type parameters.
9436
9437 2003-09-18  Martin Baulig  <martin@ximian.com>
9438
9439         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9440         on `type.IsInterface'; don't check whether the type has a parent
9441         to determine whether it's an interface.
9442
9443 2003-09-15  Martin Baulig  <martin@ximian.com>
9444
9445         * class.cs (TypeContainer.DefineType): Added an error flag to
9446         avoid reporting duplicate CS0146's ("class definition is
9447         circular.").
9448
9449         * driver.cs (Driver.MainDriver): Abort if
9450         RootContext.ResolveTree() reported any errors.
9451
9452 2003-09-07  Martin Baulig  <martin@ximian.com>
9453
9454         * report.cs (Error, Warning): Added overloaded versions which take
9455         a `params object[] args' and call String.Format().
9456
9457 2003-09-07  Martin Baulig  <martin@ximian.com>
9458
9459         * decl.cs (DeclSpace..ctor): Don't call
9460         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9461         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9462         (DeclSpace.RecordDecl): New method.
9463
9464         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9465
9466 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9467
9468         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9469         value attributes to be applied to ParameterBuilders.
9470
9471         * class.cs (MethodCore.LabelParameters): Make static and more
9472         generic so that it can be used from other places - like interface
9473         methods, for instance.
9474
9475         * interface.cs (Interface.Emit): Call LabelParameters before
9476         emitting attributes on the InterfaceMethod.
9477
9478 2003-08-26  Martin Baulig  <martin@ximian.com>
9479
9480         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9481         resolving aliases; fixes #47927.
9482
9483 2003-08-26  Martin Baulig  <martin@ximian.com>
9484
9485         * statement.cs (Using.DoResolve): This is internally emitting a
9486         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9487         do not always return.  Fixes #47681.
9488
9489 2003-08-26  Martin Baulig  <martin@ximian.com>
9490
9491         * decl.cs (MemberCore): Moved WarningNotHiding(),
9492         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9493         into MemberBase.
9494         (AdditionResult): Make this nested in DeclSpace.
9495         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9496         argument; call NamespaceEntry.Define() unless we're nested in a
9497         class or struct.
9498
9499         * namespace.cs (Namespace.DefineName): New public function.  This
9500         is called from DeclSpace's .ctor to add 
9501         (Namespace.Lookup): Include DeclSpaces in the lookup.
9502
9503         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9504
9505         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9506
9507 2003-08-25  Martin Baulig  <martin@ximian.com>
9508
9509         * convert.cs (Convert.ExplicitReferenceConversion): When
9510         converting from an interface type to a class, unbox if the target
9511         type is a struct type.  Fixes #47822.
9512
9513 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9514
9515         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9516         #47854.
9517
9518 2003-08-22  Martin Baulig  <martin@ximian.com>
9519
9520         * class.cs (TypeManager.DefineType): When defining a nested type,
9521         call DefineType() on our parent; fixes #47801.
9522
9523 2003-08-22  Martin Baulig  <martin@ximian.com>
9524
9525         * class.cs (MethodData.Define): While checking if a method is an
9526         interface implementation, improve the test a bit more to fix #47654.
9527
9528 2003-08-22  Martin Baulig  <martin@ximian.com>
9529
9530         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9531         correctly; fixes #47722.
9532
9533 2003-08-22  Martin Baulig  <martin@ximian.com>
9534
9535         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9536         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9537
9538         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9539
9540 2003-08-22  Martin Baulig  <martin@ximian.com>
9541
9542         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9543         can only be assigned in static constructors.  Fixes #47161.
9544
9545 2003-08-22  Martin Baulig  <martin@ximian.com>
9546
9547         Rewrote and improved the flow analysis code.
9548
9549         * flowbranching.cs (FlowBranching): Make this class abstract.
9550         (FlowBranching.CreateBranching): New static function to create a
9551         new flow branching.
9552         (FlowBranchingBlock, FlowBranchingException): New classes.
9553         (FlowBranching.UsageVector.Type): New public readonly field.
9554         (FlowBranching.UsageVector.Breaks): Removed the setter.
9555         (FlowBranching.UsageVector.Returns): Removed the setter.
9556         (FlowBranching.UsageVector): Added Break(), Return(),
9557         NeverReachable() and Throw() methods to modify the reachability.
9558         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9559         done by FlowBranching.Merge().
9560         (FlowBranching.UsageVector.MergeChild): New method; merges the
9561         merge result into the current vector.
9562         (FlowBranching.Merge): New abstract method to merge a branching.
9563
9564 2003-08-12  Martin Baulig  <martin@ximian.com>
9565
9566         * expression.cs (Indirection.CacheTemporaries): Create the
9567         LocalTemporary with the pointer type, not its element type.
9568
9569 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9570
9571         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9572         token was a keyword or not.
9573
9574         Add `error' options where an IDENTIFIER was expected;  Provide
9575         CheckToken and CheckIdentifierToken convenience error reporting
9576         functions. 
9577
9578         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9579
9580         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9581         NameSpaceEntry NameSpaceEntry.
9582
9583         (LookupInterfaceOrClass): Avoid creating a full qualified name
9584         from namespace and name: avoid doing lookups when we know the
9585         namespace is non-existant.   Use new Tree.LookupByNamespace which
9586         looks up DeclSpaces based on their namespace, name pair.
9587
9588         * driver.cs: Provide a new `parser verbose' to display the
9589         exception thrown during parsing.  This is turned off by default
9590         now, so the output of a failure from mcs is more graceful.
9591
9592         * namespace.cs: Track all the namespaces defined in a hashtable
9593         for quick lookup.
9594
9595         (IsNamespace): New method
9596
9597 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9600         we know that we need to concatenate (full typename can never be
9601         null). 
9602
9603         * class.cs: ditto.
9604
9605         * statement.cs: Use a bitfield;  Do not initialize to null things
9606         which are done by the constructor by default.
9607
9608         * cs-parser.jay: bug fix, parameter was 4, not 3.
9609
9610         * expression.cs: Just use the property;
9611
9612         * statement.cs: No need for GetVariableInfo method.
9613
9614 2003-08-08  Martin Baulig  <martin@ximian.com>
9615
9616         * flowanalysis.cs (FlowReturns): This is now nested in the
9617         `FlowBranching' class.
9618         (MyBitVector): Moved this here from statement.cs.
9619         (FlowBranching.SiblingType): New enum type.
9620         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9621
9622 2003-08-07  Martin Baulig  <martin@ximian.com>
9623
9624         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9625         `FlowBranching' class and called `BranchingType'.
9626
9627 2003-08-07  Martin Baulig  <martin@ximian.com>
9628
9629         * flowanalysis.cs: Moved all the control flow analysis code into
9630         its own file.
9631
9632 2003-08-07  Martin Baulig  <martin@ximian.com>
9633
9634         * assign.cs (Assign.DoResolve): `target' must either be an
9635         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9636         #37319.
9637
9638 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9639
9640         * expression.cs (BinaryMethod): This kind of expression is created by the
9641         Binary class if it determines that the operator has to be handled
9642         by a method.
9643
9644         (BinaryDelegate): This kind of expression is created if we are
9645         dealing with a + or - operator on delegates.
9646
9647         (Binary): remove method, argumetns, and DelegateOperator: when
9648         dealing with methods, 
9649
9650         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9651
9652         * statement.cs (Block): use bitfields for the three extra booleans
9653         we had in use.   Remove unused topblock parameter.
9654
9655         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9656
9657         * assign.cs: Drop extra unneeded tests.
9658
9659 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9660
9661         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9662
9663         * statement.cs (Foreach): Use VariableStorage instead of
9664         LocalBuilders.   
9665
9666         * codegen.cs (VariableStorage): New class used by clients that
9667         require a variable stored: locals or fields for variables that
9668         need to live across yield.
9669
9670         Maybe provide a convenience api for EmitThis+EmitLoad?
9671
9672         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9673         these bad boys.
9674
9675 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9676
9677         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9678         RemapParameterLValue): New methods that are used to turn a
9679         precomputed FieldInfo into an expression like this:
9680
9681                 instance.FieldInfo
9682
9683         The idea is to use this instead of making LocalVariableReference
9684         have more than one meaning.
9685
9686         * cs-parser.jay: Add error production to BASE.
9687
9688         * ecore.cs: Deal with TypeManager.GetField returning null, which
9689         is now a valid return value.
9690
9691         (FieldExprNoAddress): New expression for Fields whose address can
9692         not be taken.
9693
9694         * expression.cs (LocalVariableReference): During the resolve
9695         phases, create new expressions if we are in a remapping context.
9696         Remove code that dealt with remapping here.
9697
9698         (ParameterReference): same.
9699
9700         (ProxyInstance): New expression, like the `This' expression, but
9701         it is born fully resolved.  We know what we are doing, so remove
9702         the errors that are targeted to user-provided uses of `this'.
9703
9704         * statement.cs (Foreach): our variable is now stored as an
9705         Expression;  During resolution, follow the protocol, dont just
9706         assume it will return this.
9707
9708 2003-08-06  Martin Baulig  <martin@ximian.com>
9709
9710         * support.cs (SeekableStreamReader.cs): New public class.
9711
9712         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9713         SeekableStreamReader instead of the normal StreamReader.
9714
9715 2003-08-04  Martin Baulig  <martin@ximian.com>
9716
9717         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9718         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9719         deambiguate casts and delegate invocations.
9720         (parenthesized_expression): Use the new tokens to ensure this is
9721         not a cast of method invocation.
9722
9723         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9724         when reading a `)' and Deambiguate_CloseParens () was previously
9725         called.
9726
9727         * expression.cs (ParenthesizedExpression): New class.  This is
9728         just used for the CS0075 test.
9729         (Binary.DoResolve): Check for CS0075.   
9730
9731 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9732
9733         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9734         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9735         reference comparison.
9736
9737         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9738         examine the ReturnType for equality - this is necessary in the
9739         cases of implicit and explicit operators whose signature also
9740         includes the return type.
9741
9742 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9743
9744         * namespace.cs: Cache the result of the namespace computation,
9745         instead of computing it every time.
9746
9747 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9748
9749         * decl.cs: Use a global arraylist that we reuse over invocations
9750         to avoid excesive memory consumption.  Reduces memory usage on an
9751         mcs compile by one meg (45 average).
9752
9753         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9754         private, work around that.
9755
9756 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9757
9758         * literal.cs (IntLiteral): Define Zero and One static literals. 
9759
9760         * cs-parser.jay (integer_literal): use static literals to reduce
9761         memory usage for the most used literals (0, 1 and -1).  211kb
9762         reduced in memory usage.
9763
9764         Replace all calls to `new ArrayList' with `new
9765         ArrayList(4)' which is a good average number for most allocations,
9766         and also requires only 16 bytes of memory for its buffer by
9767         default. 
9768
9769         This reduced MCS memory usage in seven megabytes for the RSS after
9770         bootstrapping.
9771
9772 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9773
9774         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9775         handle params methods the correct way by forming only one
9776         applicable set with params and normal methods in them. Earlier we
9777         were looking at params methods only if we found no normal methods
9778         which was not the correct thing to do.
9779
9780         (Invocation.BetterFunction): Take separate arguments indicating
9781         when candidate and the best method are params methods in their
9782         expanded form.
9783
9784         This fixes bugs #43367 and #46199.
9785
9786         * attribute.cs: Documentation updates.
9787
9788         (CheckAttribute): Rename to CheckAttributeTarget.
9789         (GetValidPlaces): Rename to GetValidTargets.
9790
9791         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9792         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9793
9794         Fixes bug #44468.
9795
9796 2003-07-28  Martin Baulig  <martin@ximian.com>
9797
9798         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9799         name when looking up the base class of a nested class.  Fixes #46977.
9800
9801 2003-07-26  Martin Baulig  <martin@ximian.com>
9802
9803         * expression.cs (Indexers.Indexer): New nested struct; contains
9804         getter, setter and the indexer's type.
9805         (Indexers.Properties): This is now an ArrayList of
9806         Indexers.Indexer's.
9807         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9808         indexer doesn't have any getters.
9809
9810         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9811         for embedded property and indexer assignments.
9812
9813 2003-07-26  Martin Baulig  <martin@ximian.com>
9814
9815         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9816         preprocessor directive is not the first non-whitespace character
9817         on a line.
9818
9819 2003-07-26  Martin Baulig  <martin@ximian.com>
9820
9821         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9822         namespace parsing, follow the spec more closely.
9823
9824         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9825         NamespaceEntry.Lookup().
9826
9827 2003-07-25  Martin Baulig  <martin@ximian.com>
9828
9829         * MethodCore.cs (OverridesSomething): New public field; it's set
9830         from TypeContainer.DefineMembers if this method overrides
9831         something (which doesn't need to be a method).  Fix #39462.
9832
9833 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9834
9835         * typemanager.cs (GetMembers): Ensure that the list of members is
9836         reversed. This keeps things in sync.
9837
9838         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9839         find an AttributeUsage attribute.
9840
9841         * expression.cs (Invocation.OverloadResolve): Perform the check
9842         which disallows Invoke to be directly called on a Delegate.
9843
9844         (Error_InvokeOnDelegate): Report error cs1533.
9845
9846 2003-07-25  Martin Baulig  <martin@ximian.com>
9847
9848         * expression.cs (Indexers.GetIndexersForType): Only look in the
9849         interface hierarchy if the requested type is already an
9850         interface.  Fixes #46788 while keeping #46502 fixed.
9851
9852 2003-07-25  Martin Baulig  <martin@ximian.com>
9853
9854         * class.cs (TypeContainer.DefineMembers): Check whether all
9855         readonly fields have been assigned and report warning CS0649 if
9856         not.
9857
9858         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9859         a valuetype.
9860
9861 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9862
9863         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9864         returned from GetMethods to make things consistent with the
9865         assumptions MCS makes about ordering of methods.
9866
9867         This should comprehensively fix bug #45127 and it does :-)
9868
9869         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9870         ordering is actually reverse.
9871
9872         * Clean up some debug messages I left lying around.
9873
9874         * interface.cs (Populate*): Get rid of code which emits attributes
9875         since the stage in which we emit attributes is the 'Emit' stage,
9876         not the define stage.
9877
9878         (Emit): Move attribute emission for interface members here.
9879
9880 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9881
9882         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9883         closely: we eliminate methods in base types when we have an
9884         applicable method in a top-level type.
9885
9886         Please see section 14.5.5.1 for an exact description of what goes
9887         on. 
9888
9889         This fixes bug #45127 and a host of other related to corlib compilation.
9890
9891         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9892         array is the method corresponding to the top-level type (this is
9893         because of the changes made to icall.c) so we change this
9894         accordingly.
9895
9896         (MethodGroupExpr.Name): This too.
9897
9898         * typemanager.cs (GetElementType): New method which does the right
9899         thing when compiling corlib. 
9900
9901         * everywhere: Make use of the above in the relevant places.
9902
9903 2003-07-22  Martin Baulig  <martin@ximian.com>
9904
9905         * cs-parser.jay (invocation_expression): Moved
9906         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9907         `cast_expression', but create a InvocationOrCast which later
9908         resolves to either an Invocation or a Cast.
9909
9910         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9911         method; call this before EmitStatement() to make sure that this
9912         expression can be used as a statement.
9913
9914         * expression.cs (InvocationOrCast): New class; resolves to either
9915         an Invocation or a Cast.
9916
9917         * statement.cs (StatementExpression): Call ResolveStatement() on
9918         the ExpressionStatement before emitting it.
9919
9920 2003-07-21  Martin Baulig  <martin@ximian.com>
9921
9922         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9923         `ref' and `out' attributes match; fixes #46220.
9924         (MemberAccess.ResolveMemberAccess): You can't reference a type
9925         through an expression; fixes #33180.
9926         (Indexers.GetIndexersForType): Don't return the indexers from
9927         interfaces the class implements; fixes #46502.
9928
9929 2003-07-21  Martin Baulig  <martin@ximian.com>
9930
9931         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9932         CS0661 checks; fixes bug #30442.
9933
9934 2003-07-21  Martin Baulig  <martin@ximian.com>
9935
9936         * decl.cs (AdditionResult): Added `Error'.
9937
9938         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9939
9940         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9941         makes cs0031.cs actually work.
9942
9943 2003-07-20  Martin Baulig  <martin@ximian.com>
9944
9945         * namespace.cs: Fixed that bug which caused a crash when compiling
9946         the debugger's GUI.
9947
9948 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9949
9950         * typemanager.cs (LookupTypeReflection): Never expose types which
9951         are NotPublic, NestedPrivate, NestedAssembly, or
9952         NestedFamANDAssem.  We used to return these, and later do a check
9953         that would report a meaningful error, but the problem is that we
9954         would not get the real match, if there was a name override.
9955
9956 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9957
9958         * namespace.cs (Namespace, Name): Do not compute the namespace
9959         name dynamically, compute it in the constructor.  This reduced
9960         memory usage by 1697 KB.
9961
9962         * driver.cs: Use --pause to pause at the end.
9963
9964 2003-07-17  Peter Williams  <peter@newton.cx>
9965
9966         * Makefile: Change the name of the test target so that it doesn't
9967         conflict with the recursive test target.
9968
9969 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9970
9971         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9972         AddressOf): Do not use EmitThis, that was wrong, use the actual
9973         this pointer.
9974
9975 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9976
9977         * class.cs (MethodData.Define): While checking if a method is an
9978         interface implementation, improve the test: If we are not public
9979         (use new test here: use the computed MethodAttributes directly,
9980         instead of the parsed modifier flags) check if the `implementing'
9981         method comes from an interface or not.
9982
9983         * pending.cs (VerifyPendingMethods): Slightly better error
9984         message.
9985
9986         * makefile: add test target that does the mcs bootstrap.
9987
9988 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9989
9990         * interface.cs (Define): Do nothing here since there are no
9991         members to populate etc. Move the attribute emission out of here
9992         since this was just totally the wrong place to put it. Attribute
9993         application happens during the 'Emit' phase, not in the 'Define'
9994         phase.
9995
9996         (Emit): Add this method and move the attribute emission here
9997
9998         * rootcontext.cs (EmitCode): Call the Emit method on interface
9999         types too.
10000
10001 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10002
10003         * expression.cs (OverloadResolve): Report error only if Location
10004         is not 'Null' which means that there was a probe going on.
10005
10006 2003-07-14  Martin Baulig  <martin@ximian.com>
10007
10008         * expression.cs (ConditionalLogicalOperator): New public class to
10009         implement user defined conditional logical operators.
10010         This is section 14.11.2 in the spec and bug #40505.
10011
10012 2003-07-14  Martin Baulig  <martin@ximian.com>
10013
10014         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10015
10016 2003-07-14  Martin Baulig  <martin@ximian.com>
10017
10018         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10019
10020         * ecore.cs (IVariable.VerifyFixed): New interface method.
10021
10022         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10023         operator, check whether the variable is actually fixed.  Fixes bug
10024         #36055.  Set a variable definitely assigned when taking its
10025         address as required by the spec.
10026
10027         * statement.cs (LocalInfo.IsFixed): New field.
10028         (LocalInfo.MakePinned): Set `IsFixed' to true.
10029
10030 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10031
10032         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10033         for .ctors, ensure that we only ask for members declared in the
10034         attribute type (BindingFlags.DeclaredOnly).
10035
10036         Fixes bug #43632.
10037
10038         * expression.cs (Error_WrongNumArguments): Report error 1501
10039         correctly the way CSC does.
10040
10041 2003-07-13  Martin Baulig  <martin@ximian.com>
10042
10043         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10044         lookup on the fully qualified name, to make things like "X.X" work
10045         where "X.X" is a fully qualified type name, but we also have a
10046         namespace "X" in the using list.  Fixes #41975.
10047
10048 2003-07-13  Martin Baulig  <martin@ximian.com>
10049
10050         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10051         function. If we're a CompoundAssign, we need to create an embedded
10052         CompoundAssign, not an embedded Assign.
10053         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10054         Fixes #45854.
10055
10056 2003-07-13  Martin Baulig  <martin@ximian.com>
10057
10058         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10059         work to fix bug #46088.
10060
10061 2003-07-13  Ravi Pratap <ravi@ximian.com>
10062
10063         * class.cs (Operator.Emit): Do not emit attributes here - it is
10064         taken care of by the Method class that we delegate too. This takes
10065         care of bug #45876.
10066
10067 2003-07-10  Martin Baulig  <martin@ximian.com>
10068
10069         * expression.cs (TypeOfVoid): New class.
10070         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10071
10072 2003-07-10  Martin Baulig  <martin@ximian.com>
10073
10074         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10075         bug #35957.
10076
10077 2003-07-10  Martin Baulig  <martin@ximian.com>
10078
10079         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10080         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10081
10082         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10083
10084         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10085
10086 2003-07-10  Martin Baulig  <martin@ximian.com>
10087
10088         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10089         of decimal.  Fixes #42850.
10090
10091         NOTE: I also fixed the created byte blob, but this doesn't work on
10092         the MS runtime and csc never produces any byte blobs for decimal
10093         arrays.
10094
10095 2003-07-10  Martin Baulig  <martin@ximian.com>
10096
10097         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10098         structs; fixes #32068.
10099         (Block.AddChildVariableNames): Fixed #44302.
10100
10101 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10102
10103         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10104
10105 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10106
10107         * attribute.cs: And this test is onger needed.
10108
10109 2003-07-08  Martin Baulig  <martin@ximian.com>
10110
10111         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10112         inaccessible types.  Fixes #36313.
10113
10114         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10115
10116         * namespace.cs (NamespaceEntry): Create implicit entries for all
10117         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10118         implicit entries for N1.N2 and N1.
10119
10120 2003-07-08  Martin Baulig  <martin@ximian.com>
10121
10122         Rewrote the handling of namespaces to fix a lot of the issues
10123         wrt. `using' aliases etc.
10124
10125         * namespace.cs (Namespace): Splitted this class into a
10126         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10127
10128         * typemanager.cs (TypeManager.IsNamespace): Removed.
10129         (TypeManager.ComputeNamespaces): Only compute namespaces from
10130         loaded assemblies here, not the namespaces from the assembly we're
10131         currently compiling.
10132
10133 2003-07-08  Martin Baulig  <martin@ximian.com>
10134
10135         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10136
10137 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10138
10139         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10140         already fixed it.  
10141
10142         I thought about the memory savings here, but LookupTypeReflection
10143         is used under already very constrained scenarios.  Compiling
10144         corlib or mcs only exposes one hit, so it would not really reduce
10145         any memory consumption.
10146
10147 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10148
10149         * typemanager.cs: fixes bug #45889 by only adding public types from
10150         other assemblies to the list of known types.
10151
10152 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10153
10154         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10155         on the type we resolved.
10156
10157 2003-07-05  Martin Baulig  <martin@ximian.com>
10158
10159         * pending.cs (PendingImplementation.ParentImplements): Don't
10160         create the proxy if the parent is abstract.
10161
10162         * class.cs (TypeContainer.DefineIndexers): Process explicit
10163         interface implementations first.  Fixes #37714.
10164
10165 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10166
10167         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10168         defined recursively;  but since we modify the input parameters
10169         (left is set to `this' temporarily), we reset this value if the
10170         left_is_explicit is false, which gives the original semantics to
10171         the code.  
10172
10173         * literal.cs (NullPointer): new class used to represent a null
10174         literal in a pointer context.
10175
10176         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10177         type is a pointer, use a NullPointer object instead of a
10178         NullLiteral.   Closes 43687
10179
10180         (ExplicitConversion): Convert pointer values using
10181         the conv opcode to the proper type.
10182
10183         * ecore.cs (New): change ValueTypeVariable property into a method,
10184         that returns whether the valuetype is suitable for being used.
10185
10186         * expression.cs (Binary.DoNumericPromotions): Only return if we
10187         the int constant was a valid uint, and we can return both left and
10188         right as uints.  If not, we continue processing, to trigger the
10189         type conversion.  This fixes 39018.
10190
10191         * statement.cs (Block.EmitMeta): During constant resolution, set
10192         the CurrentBlock property on the emitcontext, so that we resolve
10193         constants propertly.
10194
10195 2003-07-02  Martin Baulig  <martin@ximian.com>
10196
10197         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10198         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10199
10200         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10201         than emitting it here.
10202
10203         * statement.cs: Fixed some more flow analysis bugs.
10204
10205 2003-07-02  Martin Baulig  <martin@ximian.com>
10206
10207         * class.cs (MethodData.Define): When implementing interface
10208         methods, set Final unless we're Virtual.
10209
10210         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10211         check work for interface methods.
10212
10213 2003-07-01  Martin Baulig  <martin@ximian.com>
10214
10215         * ecore.cs (EmitContext.This): Replaced this property with a
10216         GetThis() method which takes a Location argument.  This ensures
10217         that we get the correct error location for a CS0188.
10218
10219 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10220
10221         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10222         ImplicitStandardConversion.
10223
10224         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10225
10226 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10227
10228         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10229         optimization.
10230
10231 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10232
10233         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10234         constructors.
10235
10236         (MethodData.Define): Turn off initlocals for unsafe methods.
10237
10238 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10239
10240         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10241         complete;  Fixes #37521.
10242
10243         * delegate.cs: Use Modifiers.TypeAttr to compute the
10244         TypeAttributes, instead of rolling our own.  This makes the flags
10245         correct for the delegates.
10246
10247 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10248
10249         * class.cs (Constructor.Define): Set the private flag for static
10250         constructors as well.
10251
10252         * cs-parser.jay (statement_expression): Set the return value to
10253         null, to avoid a crash when we catch an error.
10254
10255 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10256
10257         * cs-parser.jay: Applied patch from Jackson that adds support for
10258         extern and unsafe modifiers to destructor declarations.
10259
10260         * expression.cs: Report error 21 if the user is trying to index a
10261         System.Array.
10262
10263         * driver.cs: Add an error message, suggested by the bug report.
10264
10265         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10266         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10267
10268 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10269
10270         * namespace.cs: Add some information to reduce FAQs.
10271
10272 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10273
10274         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10275         underlying enumeration types.  Fixes #43915.
10276
10277         * expression.cs: Treat ushort/short as legal values to be used in
10278         bitwise operations.
10279
10280 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10281
10282         * delegate.cs: transfer custom attributes for paramenters from
10283         the delegate declaration to Invoke and BeginInvoke.
10284
10285 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10286
10287         * attribute.cs: handle custom marshalers and emit marshal info
10288         for fields, too.
10289
10290 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10291
10292         * makefile.gnu: Added anonymous.cs to the compiler sources.
10293
10294 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10295
10296         * iterators.cs: Change the name of the proxy class to include two
10297         underscores.
10298
10299         * cs-parser.jay: Update grammar to include anonymous methods.
10300
10301         * anonymous.cs: new file.
10302
10303 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10304
10305         * class.cs (Field.Define): Add missing test for pointers and
10306         safety. 
10307
10308 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10309
10310         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10311         we use the stobj opcode.
10312
10313         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10314         since it wasn't the correct fix. 
10315
10316         It still is puzzling that we are required to use stobj for IntPtr
10317         which seems to be a ValueType.
10318
10319 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10320
10321         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10322         during regular simple name resolution.   Now, the trick is that
10323         instead of returning for processing the simplename, we do a
10324         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10325         contextual lookup type).   If a match is found, return that, if
10326         not, return for further composition.
10327
10328         This fixes long-standing 30485.
10329
10330         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10331         using the address to initialize an object, do an Stobj instead of
10332         using the regular Stelem.
10333
10334         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10335         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10336         Because if we are a BaseIndexerAccess that value will be true.
10337         Fixes 43643.
10338
10339         * statement.cs (GotoCase.Resolve): Return after reporting an
10340         error, do not attempt to continue. 
10341
10342         * expression.cs (PointerArithmetic.Emit): If our operand is a
10343         long, convert our constants to match the operand before
10344         multiplying.  Convert to I type before adding.   Fixes 43670.
10345
10346 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10347
10348         * enum.cs (ImplicitConversionExists) : Rename to
10349         ImplicitEnumConversionExists to remove ambiguity. 
10350
10351         * ecore.cs (NullCast): New type of cast expression class which
10352         basically is very similar to EmptyCast with the difference being
10353         it still is a constant since it is used only to cast a null to
10354         something else
10355         (eg. (string) null)
10356
10357         * convert.cs (ImplicitReferenceConversion): When casting a null
10358         literal, we return a NullCast.
10359
10360         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10361         should be around anymore.
10362
10363         The renaming (reported was slightly wrong). Corrections:
10364
10365         ConvertImplicitStandard -> ImplicitConversionStandard
10366         ConvertExplicitStandard -> ExplicitConversionStandard
10367
10368         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10369         before passing them in !
10370
10371         * convert.cs (ImplicitConversionStandard): When comparing for
10372         equal expr and target types, ensure that expr is not a
10373         NullLiteral.
10374
10375         In general, we must not be checking (expr_type ==
10376         target_type) in the top level conversion methods
10377         (ImplicitConversion, ExplicitConversion etc). This checking is
10378         done in the methods that they delegate to.
10379
10380 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10381
10382         * convert.cs: Move Error_CannotConvertType,
10383         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10384         ImplicitNumericConversion, ImplicitConversionExists,
10385         ImplicitUserConversionExists, StandardConversionExists,
10386         FindMostEncompassedType, FindMostSpecificSource,
10387         FindMostSpecificTarget, ImplicitUserConversion,
10388         ExplicitUserConversion, GetConversionOperators,
10389         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10390         TryImplicitIntConversion, Error_CannotConvertImplicit,
10391         ConvertImplicitRequired, ConvertNumericExplicit,
10392         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10393         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10394         its own file.
10395
10396         Perform the following renames:
10397
10398         StandardConversionExists -> ImplicitStandardConversionExists
10399         ConvertImplicit -> ImplicitConversion
10400         ConvertImplicitStandard -> ImplicitStandardConversion
10401         TryImplicitIntConversion -> ImplicitIntConversion
10402         ConvertImplicitRequired -> ImplicitConversionRequired
10403         ConvertNumericExplicit -> ExplicitNumericConversion
10404         ConvertReferenceExplicit -> ExplicitReferenceConversion
10405         ConvertExplicit -> ExplicitConversion
10406         ConvertExplicitStandard -> ExplicitStandardConversion
10407
10408 2003-05-19  Martin Baulig  <martin@ximian.com>
10409
10410         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10411         (TypeInfo): Added support for structs having structs as fields.
10412
10413         * ecore.cs (FieldExpr): Implement IVariable.
10414         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10415         VariableInfo for the field.
10416
10417 2003-05-18  Martin Baulig  <martin@ximian.com>
10418
10419         * expression.cs (This.DoResolve): Report a CS0027 if we're
10420         emitting a field initializer.
10421
10422 2003-05-18  Martin Baulig  <martin@ximian.com>
10423
10424         * expression.cs (This.ResolveBase): New public function.
10425         (This.DoResolve): Check for CS0188.
10426
10427         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10428         This.Resolve().
10429
10430         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10431         `instance_expression' to null if we don't have any non-static
10432         methods.
10433
10434 2003-05-18  Martin Baulig  <martin@ximian.com>
10435
10436         Reworked the way how local variables and parameters are handled by
10437         the flow analysis code.
10438
10439         * statement.cs (TypeInfo, VariableMap): New public classes.
10440         (VariableInfo): New public class.  This is now responsible for
10441         checking whether a variable has been assigned.  It is used for
10442         parameters and local variables.
10443         (Block.EmitMeta): Take the InternalParameters as argument; compute
10444         the layout of the flow vectors here.
10445         (Block.LocalMap, Block.ParameterMap): New public properties.
10446         (FlowBranching): The .ctor doesn't get the InternalParameters
10447         anymore since Block.EmitMeta() now computes the layout of the flow
10448         vector.
10449         (MyStructInfo): This class is now known as `StructInfo' and nested
10450         in `TypeInfo'; we don't access this directly anymore.
10451
10452         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10453         property and removed IsAssigned(), IsFieldAssigned(),
10454         SetAssigned() and SetFieldAssigned(); we now call them on the
10455         VariableInfo so we don't need to duplicate this code everywhere.
10456
10457         * expression.cs (ParameterReference): Added `Block block' argument
10458         to the .ctor.
10459         (LocalVariableReference, ParameterReference, This): The new
10460         VariableInfo class is now responsible for all the definite
10461         assignment stuff.
10462
10463         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10464         IsParameterAssigned, SetParameterAssigned): Removed.
10465
10466 2003-05-18  Martin Baulig  <martin@ximian.com>
10467
10468         * typemanager.cs (InitCoreTypes): Try calling
10469         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10470         the 3-args-version.  Corlib now also needs our `void_type'.
10471         (GetMethod): Added overloaded version which takes an optional
10472         `bool report_errors' to allow lookups of optional methods.
10473
10474 2003-05-12  Martin Baulig  <martin@ximian.com>
10475
10476         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10477         only used for locals and not for parameters.
10478
10479 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10480
10481         * support.cs (InternalParameters.ParameterType): Return the
10482         ExternalType of the parameter.
10483
10484         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10485         they were unused.
10486
10487 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * class.cs (MethodData.Define): Do not set the `newslot' on
10490         interface members, if they are also flagged as "override".
10491
10492         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10493         better code for ++i and i++.  This only works for static fields
10494         and local variables.
10495
10496         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10497         want to pull the DeclSpace out of the builder_to_declspace instead
10498         of the TypeBuilder (like in TypeContainer.FindMembers).
10499
10500         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10501         instead of LookupTypeContainer.  Fixes the crash on .NET for
10502         looking up interface members.
10503
10504         * const.cs: Create our own emit context during the Definition
10505         stage, so that constants are evaluated in the proper context, when
10506         a recursive definition happens.
10507
10508 2003-05-11  Martin Baulig  <martin@ximian.com>
10509
10510         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10511         new block for a switch section.
10512         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10513         the adding/lookup in the switch block.  Fixes #39828.
10514
10515 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10516
10517         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10518         functionality: I needed to convert the data after I had performed
10519         the add/sub operation into the operands type size.
10520
10521         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10522         pass the type for the box operation, otherwise the resulting
10523         object would have been of type object.
10524
10525         (BoxedCast): Add constructor to specify the type to box as.
10526
10527 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * iterators.cs: I was reusing the `count' variable inadvertently,
10530         take steps to not allow this to happen.
10531
10532 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10533
10534         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10535         by creating an array at the point where the params starts and
10536         putting all those arguments there, then adjusting the size of the
10537         array.
10538
10539 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10540
10541         * expression.cs (New.AddressOf): Implement interface
10542         IMemoryLocation.  This is used when the `new' operator is used in
10543         the context of an invocation to a method on a value type.
10544
10545         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10546         example. 
10547
10548         * namespace.cs: Also check the using aliases here.
10549
10550         * driver.cs: Move the test for using validity after the types have
10551         been entered, so we do a single pass that also includes the using
10552         aliases. 
10553
10554         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10555         in the regular case.   CreateSiblingForFinally is doing extra
10556         error checking.
10557
10558         * attribute.cs (GetAttributeArgumentExpression): Store the result
10559         on an out value, and use the return value to indicate failure
10560         instead of using null (which is a valid return for Constant.GetValue).
10561
10562         * statement.cs: Perform the analysis flow for the increment
10563         portion after the statement, because this will be the real flow of
10564         execution.  Fixes #42385
10565
10566         * codegen.cs (EmitContext.EmitArgument,
10567         EmitContext.EmitStoreArgument): New helper functions when the
10568         RemapToProxy flag is set.
10569
10570         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10571         function.
10572
10573         Add support for remapping parameters. 
10574
10575         * iterators.cs: Propagate parameter values;  Store parameter
10576         values in the proxy classes.
10577
10578 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10579
10580         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10581         need a proxy reference;  I do not know what I was thinking
10582
10583         * cs-parser.jay (constructor_initializer): catch another error,
10584         and display nice message.
10585
10586         (field_declaration): catch void field declaration
10587         to flag a better error. 
10588
10589         * class.cs (MemberBase.CheckBase): Report an error instead of a
10590         warning if a new protected member is declared in a struct. 
10591         (Field.Define): catch the error of readonly/volatile.
10592
10593         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10594
10595         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10596         volatile variable is taken
10597
10598 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10599
10600         * statement.cs (Fixed.Resolve): Report an error if we are not in
10601         an unsafe context.
10602
10603 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10604
10605         * typemanager.cs: reuse the code that handles type clashes for
10606         delegates and enumerations.
10607
10608         * class.cs (Report28): Always report.
10609
10610         * expression.cs (EncodeAsAttribute): Allow nulls here.
10611
10612 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10613
10614         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10615         the functionality for testing whether an expression is valid for
10616         an attribute here.  Also handle the case of arrays of elements
10617         being stored. 
10618
10619         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10620         encoding a linear array into an array of objects that are suitable
10621         to be passed to an CustomAttributeBuilder.
10622
10623         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10624
10625         * ecore.cs: (FieldExpr): Handle field remapping here.
10626
10627         * iteratators.cs: Pass the instance variable (if the method is an
10628         instance method) to the constructors, so we can access the field
10629         variables on the class.
10630
10631         TODO: Test this with structs.  I think the THIS variable on
10632         structs might have to be a pointer, and not a refenrece
10633
10634 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10635
10636         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10637         local variables to fields in a proxy class.
10638
10639         * iterators.cs (PopulateProxy): Rename our internal fields to
10640         <XXX>.  
10641         Create a <THIS> field if we are an instance method, so we can
10642         reference our parent container variables.
10643         (MapVariable): Called back from the EmitContext code to enter a
10644         new variable to field mapping into the proxy class (we just create
10645         a FieldBuilder).
10646
10647         * expression.cs
10648         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10649         for using the remapped locals to fields.
10650
10651         I placed the code here, because that gives the same semantics to
10652         local variables, and only changes the Emit code.
10653
10654         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10655         statements inside iterators.
10656         (VariableInfo): Add a FieldBuilder for the cases when we are
10657         remapping local variables to fields in a proxy class
10658
10659         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10660         current_block != null.
10661
10662         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10663         not cope with strings, as it has been moved to the
10664         TableSwitchEmit.  Fixed bug in switch generation.
10665
10666         * expression.cs (New.DoResolve): Provide more context for the user
10667         when reporting an error.
10668
10669         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10670         pointers. 
10671
10672         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10673         check the permissions for it.  Note than in a type-resolution
10674         context the check was already present in DeclSpace.ResolveType,
10675         but was missing from the MemberAccess.
10676
10677         (ArrayCreation.CheckIndices): warn if the user has
10678         more nested levels of expressions, but there are no more
10679         dimensions specified.  Avoids crash on bug 41906.
10680
10681 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10682
10683         * statement.cs (Block): replace Implicit bool, for a generic
10684         flags.   
10685         New flag: `Unchecked'.  This is used during the EmitMeta phase
10686         (which is out-of-line with the regular Resolve/Emit process for a
10687         statement, as this is done ahead of time, but still gets a chance
10688         to call constant resolve).
10689
10690         (Block.Flags): new enum for adding a new flag.
10691
10692         (Block.EmitMeta): track the state of unchecked.
10693
10694         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10695         to enable constant resolution to work there as well.
10696
10697 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10698
10699         * typemanager.cs (ienumerable_type): Also look up
10700         System.Collections.IEnumerable. 
10701
10702 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10703
10704         TODO: Test more than one conditional per method.
10705
10706         * class.cs (Indexer.Define): Report the location where the user is
10707         referencing the unsupported feature.
10708
10709         (MethodData): Overload the use of `conditionals' to
10710         minimize the creation of needless ArrayLists.   This saves roughly
10711         212kb on my machine.
10712
10713         (Method): Implement the new IIteratorContainer interface.
10714         (Method.SetYields): Implement the method by setting the ModFlags
10715         to contain METHOD_YIELDS.
10716
10717         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10718         which just got set to null.
10719
10720         * iterators.cs: New file.
10721
10722         (Yield, YieldBreak): New statements.
10723
10724         * statement.cs (Return.Resolve): Flag an error if we are used in
10725         an iterator method.
10726
10727         * codegen.cs (InIterator): New flag set if the code is being
10728         compiled in an iterator method.
10729
10730         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10731         internal modifier, and we just use it to avoid adding extra
10732         fields, as this is seldom used.  
10733
10734         * cs-parser.jay: Add yield_statement (yield and yield break).
10735
10736         * driver.cs: New flag -v2 to turn on version 2 features. 
10737
10738         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10739         hashtable when v2 is enabled.
10740
10741 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10742
10743         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10744         there is already a namespace defined with this name.
10745
10746         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10747         people upgraded their corlibs.
10748
10749         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10750         always use fully qualified types, no need to use the compiler
10751         front end.
10752
10753         (TypeManager.IsNamespace): Use binarysearch.
10754
10755         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10756         AddDelegate): I did not quite use the new IsValid API properly: I
10757         have to pass the short-name and the fullname.  I was passing only
10758         the basename instead of the fullname sometimes. 
10759
10760         (TypeContainer.DefineType): call NamespaceClash.
10761
10762         * interface.cs (Interface.DefineType): use NamespaceClash before
10763         defining the type.
10764
10765         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10766         defining the type.
10767
10768         * enum.cs: (Enum.DefineType): use NamespaceClash before
10769         defining the type.
10770
10771         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10772         speed increase.  First, use the negative_hits cache when we get a
10773         negative.  Second, add the type with its full original name
10774         instead of the new . and + encoded name (reflection uses + to
10775         separate type from a nested type).  Use LookupTypeReflection
10776         directly which bypasses the type->name hashtable (that we already
10777         know does not contain the type.
10778
10779         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10780         location/container type. 
10781
10782         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10783
10784 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10785
10786         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10787
10788         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10789         method is being referenced in the method group from a static
10790         context, and report error 120 if so.
10791
10792         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10793         Error118. 
10794
10795         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10796         is created, we create the A namespace).
10797
10798         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10799         Fixes #41591
10800
10801 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10802
10803         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10804         invocation to ModuleBuilder.GetType with the same values will
10805         return a new type instance, so we need to cache its return
10806         values. 
10807
10808         * expression.cs (Binary.ResolveOperator): Only allow the compare
10809         operators on enums if they are of the same type.
10810
10811         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10812         types of ValueType on their own case.  Before we were giving them
10813         the same treatment as objects.
10814
10815         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10816         fullname.  Short name is used to compare against container name.
10817         Fullname is used to check against defined namespace names.
10818
10819         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10820         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10821
10822         (Method.CheckBase): Call parent.
10823         (MemberBase.CheckBase): Check for protected members on sealed
10824         classes.
10825         (PropertyBase.CheckBase): Call parent.
10826         (Field.Define): Call parent.
10827
10828         * report.cs: Negative error codes are now mapped to 8000 - code,
10829         so that the display is render more nicely.
10830
10831         * typemanager.cs: Do not use try/catch, instead report a regular
10832         error. 
10833
10834         (GetPointerType, GetReferenceType): These methods provide
10835         mechanisms to obtain the T* and T& from a T.  We had the code
10836         previously scattered around the code base, and it also used
10837         TypeManager.LookupType that would go through plenty of caches.
10838         This one goes directly to the type source.
10839
10840         In some places we did the Type.GetType followed by
10841         ModuleBuilder.GetType, but not in others, so this unifies the
10842         processing as well.
10843
10844         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10845         statements now that we have namespace information.
10846
10847         * typemanager.cs (IsNamespace): New method, returns whether the
10848         string presented is a namespace or not.
10849
10850         (ComputeNamespaces): New public entry point, computes the list of
10851         available namespaces, using the GetNamespaces API call in Mono, or
10852         the slower version in MS.NET.   
10853
10854         Now before we start the semantic analysis phase, we have a
10855         complete list of namespaces including everything that the user has
10856         provided.
10857
10858         Deleted old code to cache namespaces in .nsc files.
10859
10860 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10861
10862         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10863         class/struct location definition Location for the implicit
10864         constructor location.
10865
10866         (Operator.Define): Use the location of the operator for the
10867         implicit Method definition.
10868
10869         (Constructor.Emit): use the constructor location for the implicit
10870         base initializer constructor.
10871
10872         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10873         and the Expression class now contains two new methods:
10874
10875         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10876         isolate type lookup from the rest of the resolution process.
10877
10878         Since we use Expressions to hold type definitions due to the way
10879         we parse the input we have historically overloaded Resolve to
10880         perform the Type lookups if a special flag is passed.  Now this is
10881         eliminated and two methods take their place. 
10882
10883         The differences in the two methods between xStep and xTerminal is
10884         that xStep is involved in our current lookup system that uses
10885         SimpleNames to compose a name, while xTerminal is used just to
10886         catch the case where the simplename lookup failed.
10887
10888 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10889
10890         * expression.cs (ResolveMemberAccess): Remove redundant code.
10891         TypeExpr expressions are always born fully resolved.
10892
10893         * interface.cs (PopulateMethod): Do not lookup the types twice.
10894         We were doing it once during SemanticAnalysis and once during
10895         PopulateMethod.
10896
10897         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10898         in local variable type definitions, were being returned as a
10899         SimpleName (we decomposed everything into a string), that is
10900         because primary_expression was being used instead of a type in the
10901         grammar (reduce/reduce conflicts).
10902
10903         The part that was wrong is that we converted the expression into a
10904         string (an oversimplification in one hand, compounded with primary
10905         expressions doing string concatenation).
10906
10907         So things like:
10908
10909         A.B.C [] x;
10910
10911         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10912         using clauses from working on this particular context.  And a type
10913         was being matched directly against "A.B.C[]".
10914
10915         We now use the correct approach, and allow for ComposedCast to be
10916         part of the unary expression.  So the "A.B.C []" become a composed
10917         cast of "A.B.C" (as a nested group of MemberAccess with a
10918         SimpleName at the end) plus the rank composition "[]". 
10919
10920         Also fixes 35567
10921
10922 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10923
10924         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10925         for the access level checking.
10926
10927         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10928         `TypeContainer container', because I kept getting confused when I
10929         was debugging this code.
10930
10931         * expression.cs (Indexers): Instead of tracking getters/setters,
10932         we now track them in parallel.  We create one arraylist less, but
10933         most importantly it is possible now for the LValue code to find a
10934         matching get for a set.
10935
10936         (IndexerAccess.DoResolveLValue): Update the code.
10937         GetIndexersForType has been modified already to extract all the
10938         indexers from a type.  The code assumed it did not.
10939
10940         Also make the code set the correct return type for the indexer.
10941         This was fixed a long time ago for properties, but was missing for
10942         indexers.  It used to be void_type.
10943
10944         (Binary.Emit): Test first for doubles instead of
10945         floats, as they are more common.
10946
10947         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10948         when dealing with floats and the <=, >= operators.  This fixes bug
10949         #39314 
10950
10951         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10952         to load the array value by emitting a load on the foreach variable
10953         type.  This was incorrect.  
10954
10955         We now emit the code to load an element using the the array
10956         variable type, and then we emit the conversion operator.
10957
10958         Fixed #40176
10959
10960 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10961
10962         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10963
10964 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10965
10966         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10967         test for protection before we test for signatures. 
10968
10969         (MethodSignature.ToString): implement.
10970
10971         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10972         to the case where we reduced into a LongConstant.
10973
10974         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10975         depend on whether the information is acurrate, because the
10976         Microsoft runtime will always claim that the array type is public,
10977         regardless of the real state.
10978
10979         If the type is a pointer, another problem happens: the type is
10980         reported as non-public in Microsoft.  
10981
10982         In both cases we have to call CheckAccessLevel recursively with
10983         the underlying type as the argument to be tested.
10984
10985 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10986
10987         * assign.cs (Assign.Emit): If we are dealing with a compound
10988         assignment expression, we should use the code path that stores the
10989         intermediate result in a temporary value.  This fixes #40903.
10990
10991         *expression.cs (Indirection.ToString): Provide ToString method for
10992         debugging. 
10993
10994 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10995
10996         * class.cs: Null out fields holding references to Block objects so
10997         they can be garbage collected.
10998
10999         * expression.cs (OverloadResolve): Remove unused local.
11000
11001 2003-04-07  Martin Baulig  <martin@ximian.com>
11002
11003         * codegen.cs (EmitContext.CurrentFile): New public field.
11004         (EmitContext.Mark): Use the CurrentFile to check whether the
11005         location is in the correct file.
11006         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11007
11008 2003-04-07  Martin Baulig  <martin@ximian.com>
11009
11010         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11011
11012         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11013         location.  [FIXME: The location argument which gets passed to this
11014         method is sometimes wrong!]
11015
11016 2003-04-07  Nick Drochak <ndrochak@gol.com>
11017
11018         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11019
11020 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11021
11022         * expression.cs (Indirection.EmitAssign): We were using the
11023         temporary, but returning immediately instead of continuing the
11024         EmitAssing flow.
11025
11026 2003-04-06  Martin Baulig  <martin@ximian.com>
11027
11028         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11029         if it's a nested child, but also deriving from the outer class.
11030         See test 190.cs.
11031
11032         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11033         nested child, but also deriving from the outer class.  See
11034         test-190.cs.
11035         (FilterWithClosure): We may access private members of the outer
11036         class if we're a nested child and deriving from the outer class.
11037         (RealMemberLookup): Only set `closure_private_ok' if the
11038         `original_bf' contained BindingFlags.NonPublic.
11039
11040 2003-04-05  Martin Baulig  <martin@ximian.com>
11041
11042         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
11043
11044 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * class.cs (Event.Define): Do not allow abstract events to have
11047         initializers. 
11048
11049 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11050
11051         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11052         block in event declarations.
11053
11054         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11055         value type, get its address.
11056
11057         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11058         leaving a class on the stack instead of a boolean value (int
11059         0/1).  Change the code so we compare against null, and then the
11060         result against zero.
11061
11062         * class.cs (TypeContainer.GetClassBases): We were checking for the
11063         parent class being sealed too late.
11064
11065         * expression.cs (Binary.Emit): For <= and >= when dealing with
11066         floating point values, use cgt.un and clt.un instead of cgt and
11067         clt alone.
11068
11069 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11070
11071         * statement.cs: Apply the same optimization as MS: skip the 
11072         GetEnumerator returning an IEnumerator, and use the one returning a 
11073         CharEnumerator instead. This allows us to avoid the try-finally block 
11074         and the boxing.
11075
11076 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11077
11078         * cs-parser.jay: Attributes cannot be applied to
11079                          namespaces. Fixes #40473
11080
11081 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11082
11083         * class.cs:
11084         (Add*): check if the name is valid using the full name for constants,
11085         fields, properties and events.
11086
11087 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11088
11089         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11090         char constants to be part of the enumeration.
11091
11092         * expression.cs (Conditional.DoResolve): Add support for operator
11093         true. Implements the missing functionality from 14.12
11094
11095         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11096         operator true/false as required by the spec.
11097
11098         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11099         implicit conversion to boolean.
11100
11101         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11102         also one where the type implements `operator true'. 
11103
11104         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11105         get an expression that will invoke operator true based on an
11106         expression.  
11107
11108         (GetConversionOperators): Removed the hack that called op_True
11109         here.  
11110
11111         (Expression.ResolveBoolean): Move this from Statement.
11112
11113 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11114
11115         * ecore.cs (FieldExpr): do not allow initialization of initonly
11116         fields on derived classes
11117
11118 2003-03-13  Martin Baulig  <martin@ximian.com>
11119
11120         * statement.cs (Block.Emit): Call ig.BeginScope() and
11121         ig.EndScope() when compiling with debugging info; call
11122         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11123
11124 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11125
11126         * expression.cs (Indexers): Do not construct immediately, allow
11127         for new members to be appended as we go.  Fixes 38143
11128
11129 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11130
11131         * expression.cs: save/restore context when resolving an unchecked
11132         expression.
11133
11134 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11135
11136         * cfold.cs: Catch division by zero in modulus operator during
11137         constant folding.
11138
11139 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11140
11141         * interface.cs (Interface.DefineMembers): Avoid defining members
11142         twice. 
11143
11144 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11145
11146         * driver.cs: handle the +/- options for -noconfig
11147
11148         * statement.cs (Unckeched.Resolve): Also track the state of
11149         unchecked in the Resolve phase.
11150
11151 2003-02-27  Martin Baulig  <martin@ximian.com>
11152
11153         * ecore.cs (Expression.MemberLookup): Don't create a
11154         MethodGroupExpr for something which is not a method.  Fixes #38291.
11155
11156 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11157
11158         * class.cs (MemberBase.CheckParameters): Also check that the type
11159         is unmanaged if it is a pointer.
11160
11161         * expression.cs (SizeOf.Resolve): Add location information.
11162
11163         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11164         a managed type is declared.
11165
11166         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11167         parameter modifiers as well.  Fixes bug 38606
11168
11169         * class.cs: Very sad.  Am backing out the speed up changes
11170         introduced by the ArrayList -> Array in the TypeContainer, as they
11171         were not actually that much faster, and introduced a bug (no error
11172         reports on duplicated methods).
11173
11174         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11175         source first, this will guarantee that we have a valid expression
11176         before calling in lower levels functions that will require a
11177         resolved object.  Then use this original_source in the
11178         target.ResolveLValue instead of the original source that was
11179         passed to us.
11180
11181         Another change.  Use target.Resolve instead of LValueResolve.
11182         Although we are resolving for LValues, we will let the Assign code
11183         take care of that (it will be called again from Resolve).  This
11184         basically allows code like this:
11185
11186         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11187         class Y { void A (X x) { x [0] += o; }
11188
11189         The problem was that the indexer was trying to resolve for
11190         set_Item (idx, object o) and never finding one.  The real set_Item
11191         was set_Item (idx, X).  By delaying the process we get the right
11192         semantics. 
11193
11194         Fixes bug 36505
11195
11196 2003-02-23  Martin Baulig  <martin@ximian.com>
11197
11198         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11199         while calling DoEmit ().
11200
11201         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11202         source files; if you use the #line directive inside a method, the
11203         compiler stops emitting line numbers for the debugger until it
11204         reaches the end of the method or another #line directive which
11205         restores the original file.
11206
11207 2003-02-23  Martin Baulig  <martin@ximian.com>
11208
11209         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11210
11211 2003-02-23  Martin Baulig  <martin@ximian.com>
11212
11213         * statement.cs (Block.AddChildVariableNames): We need to call this
11214         recursively, not just for our immediate children.
11215
11216 2003-02-23  Martin Baulig  <martin@ximian.com>
11217
11218         * class.cs (Event.Define): Always make the field private, like csc does.
11219
11220         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11221         actually work, fixes bug #37521.
11222
11223 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11224
11225         * delegate.cs: When creating the various temporary "Parameters"
11226         classes, make sure that we call the ComputeAndDefineParameterTypes
11227         on those new parameters (just like we do with the formal ones), to
11228         allow them to be resolved in the context of the DeclSpace.
11229
11230         This fixes the bug that Dick observed in Bugzilla #38530.
11231
11232 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11233
11234         * expression.cs (ResolveMemberAccess): When resolving a constant,
11235         do not attempt to pull a constant if the value was not able to
11236         generate a valid constant.
11237
11238         * const.cs (LookupConstantValue): Do not report more errors than required.
11239
11240 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11241
11242         * expression.cs: fixes bug #38328.
11243
11244 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11245
11246         * class.cs: Changed all the various members that can be part of a
11247         class from being an ArrayList to be an Array of the right type.
11248         During the DefineType type_list, interface_list, delegate_list and
11249         enum_list are turned into types, interfaces, delegates and enums
11250         arrays.  
11251
11252         And during the member population, indexer_list, event_list,
11253         constant_list, field_list, instance_constructor_list, method_list,
11254         operator_list and property_list are turned into their real arrays.
11255
11256         Although we could probably perform this operation earlier, for
11257         good error reporting we need to keep the lists and remove the
11258         lists for longer than required.
11259
11260         This optimization was triggered by Paolo profiling the compiler
11261         speed on the output of `gen-sample-program.pl' perl script. 
11262
11263         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11264         not crash in methods like MemberLookupFailed that use this field.  
11265
11266         This problem arises when the compiler fails to resolve a type
11267         during interface type definition for example.
11268
11269 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11270
11271         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11272         inherit from System.Object, so we have to stop at null, not only
11273         when reaching System.Object.
11274
11275 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11276
11277         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11278         DeclaredOnly because the parent indexer might have had a different
11279         name, but did not loop until the top of the hierarchy was reached.
11280
11281         The problem this one fixes is 35492: when a class implemented an
11282         indexer from an interface, we were getting the interface method
11283         (which was abstract) and we were flagging an error (can not invoke
11284         abstract method).
11285
11286         This also keeps bug 33089 functioning, and test-148 functioning.
11287
11288         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11289         out if a method is special is to see if it is declared in a
11290         property or event, or whether it is one of the predefined operator
11291         names.   This should fix correctly #36804.
11292
11293 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11294
11295         The goal here is to remove the dependency on EmptyCast.Peel ().
11296         Killing it completely.
11297
11298         The problem is that currently in a number of places where
11299         constants are expected, we have to "probe" for an EmptyCast, and
11300         Peel, which is not the correct thing to do, as this will be
11301         repetitive and will likely lead to errors. 
11302
11303         The idea is to remove any EmptyCasts that are used in casts that
11304         can be reduced to constants, so we only have to cope with
11305         constants. 
11306
11307         This bug hunt was triggered by Bug 37363 and the desire to remove
11308         the duplicate pattern where we were "peeling" emptycasts to check
11309         whether they were constants.  Now constants will always be
11310         constants.
11311
11312         * ecore.cs: Use an enumconstant here instead of wrapping with
11313         EmptyCast.  
11314
11315         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11316         throwing me off.  By handling this we can get rid of a few hacks.
11317
11318         * statement.cs (Switch): Removed Peel() code.
11319
11320 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11321
11322         * class.cs: Location information for error 508
11323
11324         * expression.cs (New.DoResolve): Add a guard against double
11325         resolution of an expression.  
11326
11327         The New DoResolve might be called twice when initializing field
11328         expressions (see EmitFieldInitializers, the call to
11329         GetInitializerExpression will perform a resolve on the expression,
11330         and later the assign will trigger another resolution
11331
11332         This leads to bugs (#37014)
11333
11334         * delegate.cs: The signature for EndInvoke should contain any ref
11335         or out parameters as well.  We were not doing this in the past. 
11336
11337         * class.cs (Field.Define): Do not overwrite the type definition
11338         inside the `volatile' group.  Turns out that volatile enumerations
11339         were changing the type here to perform a validity test, which
11340         broke conversions. 
11341
11342 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11343
11344         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11345         and structs, we do not want to load the instance variable
11346
11347         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11348         enum_type has to be handled like an object reference (implicit
11349         conversions exists from this to object), but the regular IsClass
11350         and IsValueType tests will never return true for this one.
11351
11352         Also we use TypeManager.IsValueType instead of type.IsValueType,
11353         just for consistency with the rest of the code (this is only
11354         needed if we ever use the construct exposed by test-180.cs inside
11355         corlib, which we dont today).
11356
11357 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11358
11359         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11360         just InternalCall.
11361
11362 2003-02-09  Martin Baulig  <martin@ximian.com>
11363
11364         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11365         (Namespace.DefineNamespaces): New static public method; this is
11366         called when we're compiling with debugging to add all namespaces
11367         to the symbol file.
11368
11369         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11370         pass it to the Namespace's .ctor.
11371
11372         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11373         and MethodBase arguments; pass the namespace ID to the symwriter;
11374         pass the MethodBase instead of the token to the symwriter.
11375         (SymbolWriter.DefineNamespace): New method to add a namespace to
11376         the symbol file.
11377
11378 2003-02-09  Martin Baulig  <martin@ximian.com>
11379
11380         * symbolwriter.cs: New file.  This is a wrapper around
11381         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11382         methods here in near future.
11383
11384 2003-02-09  Martin Baulig  <martin@ximian.com>
11385
11386         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11387         ILGenerator.MarkSequencePoint() which are actually used by the
11388         symbol writer.
11389
11390 2003-02-09  Martin Baulig  <martin@ximian.com>
11391
11392         * location.cs (SourceFile): New public sealed class.  This
11393         contains the name and an index which is used in the location's token.
11394         (Location): Reserve an appropriate number of bits in the token for
11395         the source file instead of walking over that list, this gives us a
11396         really huge performance improvement when compiling with debugging.
11397
11398         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11399         `SourceFile' argument instead of a string.
11400         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11401         but don't parse/tokenize here, we need to generate the list of all
11402         source files before we do that.
11403         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11404         the files.
11405
11406         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11407         instead of a string.
11408
11409         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11410         of a string.
11411
11412 2003-02-09  Martin Baulig  <martin@ximian.com>
11413
11414         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11415         filename on `#line default'.
11416
11417 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11418
11419         * statement.cs: don't clear the pinned var when the fixed statement
11420         returns from the method (fixes bug#37752).
11421
11422 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11423
11424         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11425         to IsValueType.
11426
11427 2003-02-07  Martin Baulig  <martin@ximian.com>
11428
11429         * driver.cs: Removed the `--debug-args' command line argument.
11430
11431         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11432         automatically by the AsssemblyBuilder.
11433         (CodeGen.InitializeSymbolWriter): We don't need to call any
11434         initialization function on the symbol writer anymore.  This method
11435         doesn't take any arguments.
11436
11437 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11438
11439         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11440         from referenced assemblies as well.
11441
11442 2003-02-02  Martin Baulig  <martin@ximian.com>
11443
11444         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11445
11446 2003-02-02  Martin Baulig  <martin@ximian.com>
11447
11448         * class.cs (Constructor.Emit): Open the symbol writer before
11449         emitting the constructor initializer.
11450         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11451         single-stepping through constructor initializers.
11452
11453 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11454
11455         * class.cs: Handle error 549: do not allow virtual methods in
11456         sealed classes. 
11457
11458 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11459
11460         * decl.cs: Check access levels when resolving types
11461
11462 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11463
11464         * statement.cs: Add parameters and locals set in catch blocks that might 
11465         return to set vector
11466
11467 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11468
11469         * class.cs (Operator): Set the SpecialName flags for operators.
11470
11471         * expression.cs (Invocation.DoResolve): Only block calls to
11472         accessors and operators on SpecialName methods.
11473
11474         (Cast.TryReduce): Handle conversions from char constants.
11475
11476
11477 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11478
11479         * statement.cs: small memory and time optimization in FlowBranching.
11480
11481 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11482
11483         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11484         problem that the last fix but in the other sid (Set).
11485
11486         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11487         access when there is no indexer in the hierarchy.
11488
11489 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11490
11491         * class.cs: Combine some if statements.
11492
11493 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11494
11495         * driver.cs: fixed bug #37187.
11496
11497 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11498
11499         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11500         any indexer, it's needed to build a list with all the indexers in the
11501         hierarchy (AllGetters), else we have problems. Fixes #35653.
11502
11503 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11504
11505         * class.cs (MethodData.Define): It is wrong for an interface
11506         implementation to be static in both cases: explicit and implicit.
11507         We were only handling this in one case.
11508
11509         Improve the if situation there to not have negations.
11510
11511         * class.cs (Field.Define): Turns out that we do not need to check
11512         the unsafe bit on field definition, only on usage.  Remove the test.
11513
11514 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11515
11516         * driver.cs: use assembly.Location instead of Codebase (the latest
11517         patch made mcs fail when using MS assemblies).
11518
11519 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11520
11521         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11522         get the path to *corlib.dll.
11523
11524 2003-01-21  Nick Drochak <ndrochak@gol.com>
11525
11526         * cs-tokenizer.cs:
11527         * pending.cs:
11528         * typemanager.cs: Remove compiler warnings
11529
11530 2003-01-20  Duncan Mak  <duncan@ximian.com>
11531
11532         * AssemblyInfo.cs: Bump the version number to 0.19.
11533
11534 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11535
11536         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11537
11538 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11539
11540         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11541
11542 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11543
11544         * cs-parser.jay: Small fix: we were not comparing the constructor
11545         name correctly.   Thanks to Zoltan for the initial pointer.
11546
11547 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11548
11549         * cs-tokenizer.cs: Set file name when specified with #line
11550
11551 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11552
11553         * cs-parser.jay: Only perform the constructor checks here if we
11554         are named like the class;  This will help provider a better
11555         error.  The constructor path is taken when a type definition is
11556         not found, but most likely the user forgot to add the type, so
11557         report that rather than the constructor error.
11558
11559 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11560
11561         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11562         allocations.
11563
11564 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11565
11566         * cs-parser.jay: Add cleanup call.
11567
11568 2003-01-13  Duncan Mak  <duncan@ximian.com>
11569
11570         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11571         consistent with other methods.
11572
11573 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11574
11575         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11576
11577 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11578
11579         * attribute.cs: only set GuidAttr to true when we have a
11580         GuidAttribute.
11581
11582 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11583
11584         * ecore.cs:
11585         * expression.cs:
11586         * typemanager.cs: fixes to allow mcs compile corlib with the new
11587         Type.IsSubclassOf fix.
11588
11589 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11590
11591         * expression.cs (LocalVariableReference.DoResolve): Classify a
11592         constant as a value, not as a variable.   Also, set the type for
11593         the variable.
11594
11595         * cs-parser.jay (fixed_statement): take a type instead of a
11596         pointer_type, so we can produce a better error message later.
11597
11598         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11599         as an error.  
11600
11601         (For.DoEmit): Make inifinite loops have a
11602         non-conditional branch back.
11603
11604         (Fixed.DoEmit): First populate the pinned variables, then emit the
11605         statement, then clear the variables.  Before I was emitting the
11606         code once for each fixed piece.
11607
11608
11609 2003-01-08  Martin Baulig  <martin@ximian.com>
11610
11611         * statement.cs (FlowBranching.MergeChild): A break in a
11612         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11613
11614 2003-01-08  Martin Baulig  <martin@ximian.com>
11615
11616         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11617         lives in the same number space than `param_map'.  Fixes #36154.
11618
11619 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11620
11621         * cs-parser.jay (constructor_declaration): Set the
11622         Constructor.ModFlags before probing for it.  This makes the
11623         compiler report 514, 515 and 132 (the code was there, but got
11624         broken). 
11625
11626         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11627         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11628         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11629
11630 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11631
11632         * enum.cs: create the enum static fields using the enum type.
11633
11634 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11635
11636         * class.cs: don't try to create the ParamBuilder for the return
11637         type if it's not needed (and handle it breaking for the ms runtime
11638         anyway).
11639
11640 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11641
11642         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11643
11644 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11647         the command.   This showed up while compiling the JANET source
11648         code, which used \r as its only newline separator.
11649
11650 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11651
11652         * class.cs (Method.Define): If we are an operator (because it
11653         reuses our code), then set the SpecialName and HideBySig.  #36128
11654
11655 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11656
11657         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11658         exception, report error 120 `object reference required'.
11659
11660         * driver.cs: Add --pause option, used during to measure the size
11661         of the process as it goes with --timestamp.
11662
11663         * expression.cs (Invocation.DoResolve): Do not allow methods with
11664         SpecialName to be invoked.
11665
11666 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11667
11668         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11669         number before adding it.
11670
11671 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11672
11673         * ecore.cs (StandardImplicitConversion): When in an unsafe
11674         context, we allow conversion between void * to any other pointer
11675         type. This fixes bug #35973.
11676
11677 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11678
11679         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11680         is not thrown when extensionless outputs are used 
11681
11682 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11683
11684         * rootcontext.cs: fixed compilation of corlib.
11685
11686 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11687
11688         * attribute.cs (Attributes.Contains): Add new method.
11689
11690         * class.cs (MethodCore.LabelParameters): if the parameter is an
11691         `out' parameter, check that no attribute `[In]' has been passed.
11692
11693         * enum.cs: Handle the `value__' name in an enumeration.
11694
11695 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11696
11697         * decl.cs: Added special case to allow overrides on "protected
11698         internal" methods
11699
11700 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11701
11702         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11703         since it makes much more sense.
11704
11705         (Attributes.ctor): Don't require a Location parameter.
11706
11707         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11708
11709         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11710         since we already have that information per attribute.
11711
11712         * everywhere : make appropriate changes.
11713
11714         * class.cs (LabelParameters): Write the code which actually
11715         applies attributes to the return type. We can't do this on the MS
11716         .NET runtime so we flag a warning in the case an exception is
11717         thrown.
11718
11719 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * const.cs: Handle implicit null conversions here too.
11722
11723 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11724
11725         * class.cs (MethodCore.LabelParameters): Remove the extra
11726         Type [] parameter since it is completely unnecessary. Instead
11727         pass in the method's attributes so that we can extract
11728         the "return" attribute.
11729
11730 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11731
11732         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11733         of ignoring it and letting the compile continue.
11734
11735         * typemanager.cs (ChangeType): use an extra argument to return an
11736         error condition instead of throwing an exception.
11737
11738 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11739
11740         * expression.cs (Unary.TryReduce): mimic the code for the regular
11741         code path.  Perform an implicit cast in the cases where we can
11742         implicitly convert to one of the integral types, and then reduce
11743         based on that constant.   This fixes bug #35483.
11744
11745 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11746
11747         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11748
11749 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11750
11751         * namespace.cs: fixed bug #35489.
11752
11753 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * class.cs: Remove some dead code.
11756
11757         * cs-parser.jay: Estimate the number of methods needed
11758         (RootContext.MethodCount);
11759
11760         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11761         numbers instead of StringBuilders.
11762
11763         * support.cs (PtrHashtable): Add constructor with initial size;
11764         We can now reduce reallocations of the method table.
11765
11766 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11767
11768         * attribute.cs (ApplyAttributes): Keep track of the emitted
11769         attributes on a per-target basis. This fixes bug #35413.
11770
11771 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11772
11773         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11774         default to the Windows 1252 encoding.
11775
11776         (UnixParseOption): Support version, thanks to Alp for the missing
11777         pointer. 
11778
11779         * AssemblyInfo.cs: Add nice assembly information.
11780
11781         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11782         (bug 35169).
11783
11784         * cs-parser.jay: Allow a trailing comma before the close bracked
11785         in the attribute_section production.
11786
11787         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11788         address of the instance was being taken, I will take this out,
11789         because we take the address of the object immediately here.
11790
11791 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11792
11793         * typemanager.cs (AreMultipleAllowed): Take care of the most
11794         obvious case where attribute type is not in the current assembly -
11795         stupid me ;-)
11796
11797 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11798
11799         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11800         definitions, instead of doing that afterwards.  
11801
11802         Also we use a nice little hack, depending on the constructor, we
11803         know if we are a "composed" name or a simple name.  Hence, we
11804         avoid the IndexOf test, and we avoid 
11805
11806         * codegen.cs: Add code to assist in a bug reporter to track down
11807         the source of a compiler crash. 
11808
11809 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11810
11811         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11812         types have been emitted for a given element and flag an error
11813         if something which does not have AllowMultiple set is used more
11814         than once.
11815
11816         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11817         attribute types and their corresponding AllowMultiple properties
11818
11819         (AreMultipleAllowed): Check the property for a given type.
11820
11821         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11822         property in the case we have a TypeContainer.
11823
11824         (Attributes.AddAttribute): Detect duplicates and just skip on
11825         adding them. This trivial fix catches a pretty gross error in our
11826         attribute emission - global attributes were being emitted twice!
11827
11828         Bugzilla bug #33187 is now fixed.
11829
11830 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11831
11832         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11833         instead of pp_and).
11834
11835         * expression.cs (Binary.ResolveOperator): I can only use the
11836         Concat (string, string, string) and Concat (string, string,
11837         string, string) if the child is actually a concatenation of
11838         strings. 
11839
11840 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11841
11842         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11843         context where we need a 2-character lookahead.
11844
11845         * pending.cs (PendingImplementation): Rework so we can keep track
11846         of interface types all the time, and flag those which were
11847         implemented by parents as optional.
11848
11849 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11850
11851         * expression.cs (Binary.ResolveOperator): Use
11852         String.Concat(string,string,string) or
11853         String.Concat(string,string,string,string) when possible. 
11854
11855         * typemanager: More helper methods.
11856
11857
11858 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11859
11860         * pending.cs: remove the bogus return from GetMissingInterfaces()
11861         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11862
11863 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11864
11865         * namespace.cs: avoid duplicated 'using xxx' being added to
11866         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11867         when we get more than one 'using' statement for the same namespace.
11868         Report a CS0105 warning for it.
11869
11870 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11871
11872         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11873         of calling getChar/putback, uses internal knowledge of it.    
11874
11875         (xtoken): Reorder tokenizer so most common patterns are checked
11876         first.  This reduces the compilation time in another 5% (from 8.11s
11877         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11878
11879         The parsing time is 22% of the compilation in mcs, and from that
11880         64% is spent on the tokenization process.  
11881
11882         I tried using a binary search for keywords, but this is slower
11883         than the hashtable.  Another option would be to do a couple of
11884         things:
11885
11886                 * Not use a StringBuilder, instead use an array of chars,
11887                   with a set value.  Notice that this way we could catch
11888                   the 645 error without having to do it *afterwards*.
11889
11890                 * We could write a hand-parser to avoid the hashtable
11891                   compares altogether.
11892
11893         The identifier consumption process takes 37% of the tokenization
11894         time.  Another 15% is spent on is_number.  56% of the time spent
11895         on is_number is spent on Int64.Parse:
11896
11897                 * We could probably choose based on the string length to
11898                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11899                   computations. 
11900
11901         Another 3% is spend on wrapping `xtoken' in the `token' function.
11902
11903         Handle 0xa0 as whitespace (#34752)
11904
11905 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11906
11907         * typemanager.cs (IsCLRType): New routine to tell whether a type
11908         is one of the builtin types.  
11909
11910         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11911         typecode in more places instead of doing pointer comparissions.
11912         We could leverage some knowledge about the way the typecodes are
11913         laid out.
11914
11915         New code to cache namespaces in assemblies, it is currently not
11916         invoked, to be used soon.
11917
11918         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11919
11920         * expression.cs (Binary.ResolveOperator): specially handle
11921         strings, and do not perform user-defined operator overloading for
11922         built-in types.
11923
11924 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11925
11926         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11927         internalcall as it is a pretty simple operation;  Avoid whenever
11928         possible to call Char.IsLetter.
11929
11930         (consume_identifier): Cut by half the number of
11931         hashtable calls by merging the is_keyword and GetKeyword behavior.
11932
11933         Do not short-circuit, because if we do, we
11934         report errors (ie, #if false && true would produce an invalid
11935         directive error);
11936
11937
11938 2002-11-24  Martin Baulig  <martin@ximian.com>
11939
11940         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11941         check constant ranges and report a CS0221.  Fixes #33186.
11942
11943 2002-11-24  Martin Baulig  <martin@ximian.com>
11944
11945         * cs-parser.jay: Make this work for uninitialized variable
11946         declarations in the `for' initializer.  Fixes #32416.
11947
11948 2002-11-24  Martin Baulig  <martin@ximian.com>
11949
11950         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11951         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11952
11953 2002-11-24  Martin Baulig  <martin@ximian.com>
11954
11955         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11956         argument; if true, we also check for user-defined conversions.
11957         This is only needed if both arguments are of a user-defined type.
11958         Fixes #30443, added test-175.cs.
11959         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11960
11961         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11962
11963 2002-11-24  Martin Baulig  <martin@ximian.com>
11964
11965         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11966         function to get the store opcode.
11967         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11968         only emit the Ldelema if the store opcode is Stobj.  You must run
11969         both test-34 and test-167 to test this.  Fixes #34529.
11970
11971 2002-11-23  Martin Baulig  <martin@ximian.com>
11972
11973         * ecore.cs (Expression.MemberLookup): Added additional
11974         `qualifier_type' argument which is used when we're being called
11975         from MemberAccess.DoResolve() and null if we're called from a
11976         SimpleName lookup.
11977         (Expression.MemberLookupFailed): New method to report errors; this
11978         does the CS1540 check and reports the correct error message.
11979
11980         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11981         argument for the CS1540 check and redone the way how we're dealing
11982         with private members.  See the comment in the source code for details.
11983         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11984         `closure_start_type' to `closure_qualifier_type' and check whether
11985         it's not null.  It was not this filter being broken, it was just
11986         being called with the wrong arguments.
11987
11988         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11989         and pass it the correct `qualifier_type'; this also does the error
11990         handling for us.
11991
11992 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11993
11994         * expression.cs (Invocation.EmitParams): If the we are dealing
11995         with a non-built-in value type, load its address as well.
11996
11997         (ArrayCreation): Use a a pretty constant instead
11998         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11999         static initializers.  
12000
12001         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12002         because they are not really value types, just glorified integers. 
12003
12004         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12005
12006         * ecore.cs: Remove redundant code for enumerations, make them use
12007         the same code path as everything else, fixes the casting issue
12008         with enumerations in Windows.Forms.
12009
12010         * attribute.cs: Do only cast to string if it is a string, the
12011         validation happens later.
12012
12013         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12014         people upgrade their corlibs.
12015
12016         * ecore.cs: Oops, enumerations were not following the entire code path
12017
12018 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * typemanager.cs (FilterWithClosure): Commented out the test for
12021         1540 in typemanager.cs, as it has problems when accessing
12022         protected methods from a parent class (see test-174.cs). 
12023
12024         * attribute.cs (Attribute.ValidateGuid): new method.
12025         (Attribute.Resolve): Use above.
12026
12027 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12028
12029         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12030
12031         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12032         handling for enumerations, as we only needed the TypeContainer
12033         functionality to begin with (this is required for the fix below to
12034         work for enums that reference constants in a container class for
12035         example). 
12036
12037         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12038
12039         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12040         a valid TypeBuilder to perform lookups on.o
12041
12042         * class.cs (InheritableMemberSignatureCompare): Use true in the
12043         call to GetGetMethod and GetSetMethod, because we are comparing
12044         the signature, and we need to get the methods *even* if they are
12045         private. 
12046
12047         (PropertyBase.CheckBase): ditto.
12048
12049         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12050         GotoCase.Resolve): Use Peel on EmpytCasts.
12051
12052         * ecore.cs (EmptyCast): drop child, add Peel method.
12053
12054 2002-11-17  Martin Baulig  <martin@ximian.com>
12055
12056         * ecore.cs (EmptyCast.Child): New public property.
12057
12058         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12059         label resolved to an EmptyCast.  Fixes #34162.
12060         (GotoCase.Resolve): Likewise.
12061         (Block.EmitMeta): Likewise.
12062
12063 2002-11-17  Martin Baulig  <martin@ximian.com>
12064
12065         * expression.cs (Invocation.BetterConversion): Prefer int over
12066         uint; short over ushort; long over ulong for integer literals.
12067         Use ImplicitConversionExists instead of StandardConversionExists
12068         since we also need to check for user-defined implicit conversions.
12069         Fixes #34165.  Added test-173.cs.
12070
12071 2002-11-16  Martin Baulig  <martin@ximian.com>
12072
12073         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12074         with the `true' and `false' literals.  Fixes #33151.
12075
12076 2002-11-16  Martin Baulig  <martin@ximian.com>
12077
12078         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12079         October 22nd; don't do the cs1540 check for static members.
12080
12081         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12082         now using our own filter here and doing the cs1540 check again.
12083
12084 2002-11-16  Martin Baulig  <martin@ximian.com>
12085
12086         * support.cs (InternalParameters): Don't crash if we don't have
12087         any fixed parameters.  Fixes #33532.
12088
12089 2002-11-16  Martin Baulig  <martin@ximian.com>
12090
12091         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12092         when looking up static methods to make this work on Windows.
12093         Fixes #33773.
12094
12095 2002-11-16  Martin Baulig  <martin@ximian.com>
12096
12097         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12098         a setter rather than using PropertyInfo.CanWrite.
12099
12100 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12101
12102         * class.cs: Allow acces to block member by subclasses. Fixes build
12103         breaker.
12104
12105 2002-11-14  Martin Baulig  <martin@ximian.com>
12106
12107         * class.cs (Constructor.Emit): Added the extern/block check.
12108         Fixes bug #33678.
12109
12110 2002-11-14  Martin Baulig  <martin@ximian.com>
12111
12112         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12113         iteration while looking for indexers, this is needed because the
12114         indexer may have a different name in our base classes.  Fixed the
12115         error reporting (no indexers at all, not get accessor, no
12116         overloaded match).  Fixes bug #33089.
12117         (IndexerAccess.DoResolveLValue): Likewise.
12118
12119 2002-11-14  Martin Baulig  <martin@ximian.com>
12120
12121         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12122         indexers.  Fixes the first part of bug #33089.
12123         (MethodSignature.InheritableMemberSignatureCompare): Added support
12124         for properties.
12125
12126 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12127
12128         * attribute.cs (Attribute.Resolve): Catch the
12129         NullReferenceException and report it since it isn't supposed to
12130         happen. 
12131
12132 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12135         LogicalOr and LogicalAnd that can benefit from recursively
12136         handling EmitBranchable.  The code now should be nice for Paolo.
12137
12138 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12139
12140         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12141         the Type lookups, as we perform quite a number of lookups on
12142         non-Types.  This can be removed once we can deterministically tell
12143         whether we have a type or a namespace in advance.
12144
12145         But this might require special hacks from our corlib.
12146
12147         * TODO: updated.
12148
12149         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12150         and double which avoids a conversion from an integer to a double.
12151
12152         * expression.cs: tiny optimization, avoid calling IsConstant,
12153         because it effectively performs the lookup twice.
12154
12155 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12156
12157         But a bogus return here to keep the semantics of the old code
12158         until the Mono runtime is fixed.
12159
12160         * pending.cs (GetMissingInterfaces): New method used to remove all
12161         the interfaces that are already implemented by our parent
12162         classes from the list of pending methods. 
12163
12164         * interface.cs: Add checks for calls after ResolveTypeExpr.
12165
12166 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * class.cs (Class.Emit): Report warning 67: event not used if the
12169         warning level is beyond 3.
12170
12171         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12172         being a NullLiteral.
12173
12174         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12175         specifiers. 
12176
12177         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12178         path that might fail if a type can not be resolved.
12179
12180         * expression.cs (Binary.Emit): Emit unsigned versions of the
12181         operators. 
12182
12183         * driver.cs: use error 5.
12184
12185 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12186
12187         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12188
12189 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12190
12191         * cs-parser.jay (switch_section): A beautiful patch from Martin
12192         Baulig that fixed 33094.
12193
12194 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12195
12196         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12197         Check whether the base is abstract and report an error if so.
12198
12199         * expression.cs (IndexerAccess.DoResolveLValue,
12200         IndexerAccess.DoResolve): ditto. 
12201
12202         (Invocation.DoResolve): ditto.
12203
12204         (Invocation.FullMethodDesc): Improve the report string.
12205
12206         * statement.cs (Block): Eliminate IsVariableDefined as it is
12207         basically just a wrapper for GetVariableInfo.
12208
12209         * ecore.cs (SimpleName): Use new 
12210
12211         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12212         type, as we return the actual parameter ref/unref state on a
12213         different call.
12214
12215 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * support.cs: Return proper flags REF/OUT fixing the previous
12218         commit.  
12219
12220         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12221         not used to mean `ref' but `ref or out' in ParameterReference
12222
12223         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12224         full type signature instead of calling TypeManger.CSharpName
12225         ourselves. 
12226
12227         * support.cs (InternalParameters.ParameterDesc): Do not compare
12228         directly to the modflags, because REF/OUT will actually be bitsets
12229         if set. 
12230
12231         * delegate.cs (VerifyMethod): Check also the modifiers.
12232
12233         * cs-tokenizer.cs: Fix bug where floating point values with an
12234         exponent where a sign was missing was ignored.
12235
12236         * driver.cs: Allow multiple assemblies to be specified in a single
12237         /r: argument
12238
12239 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12242         because identifiers after a parenthesis would end up in this kind
12243         of production, and we needed to desamiguate it for having casts
12244         like:
12245
12246                 (UserDefinedType *) xxx
12247
12248 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12249
12250         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12251         we should set on the Bindingflags.NonPublic, but not turn on
12252         private_ok.  private_ok controls whether a Private member is
12253         returned (this is chekced on the filter routine), while the
12254         BindingFlags.NonPublic just controls whether private/protected
12255         will be allowed.   This fixes the problem part of the problem of
12256         private properties being allowed to be used in derived classes.
12257
12258         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12259         so we can call the children DoResolveLValue method (this will
12260         properly signal errors on lvalue assignments to base properties)
12261
12262         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12263         getter are null, and we have a property info, we know that this
12264         happened because the lookup failed, so we report an error 122 for
12265         protection level violation.
12266
12267         We also silently return if setter and getter are null in the
12268         resolve functions, this condition only happens if we have flagged
12269         the error before.  This is the other half of the problem. 
12270
12271         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12272         not have accessibility information, that is why we were returning
12273         true in the filter function in typemanager.cs.
12274
12275         To properly report 122 (property is inaccessible because of its
12276         protection level) correctly, we report this error in ResolveAccess
12277         by failing if both the setter and the getter are lacking (ie, the
12278         lookup failed). 
12279
12280         DoResolve and DoLResolve have been modified to check for both
12281         setter/getter being null and returning silently, the reason being
12282         that I did not want to put the knowledge about this error in upper
12283         layers, like:
12284
12285         int old = Report.Errors;
12286         x = new PropertyExpr (...);
12287         if (old != Report.Errors)
12288                 return null;
12289         else
12290                 return x;
12291
12292         So the property expr is returned, but it is invalid, so the error
12293         will be flagged during the resolve process. 
12294
12295         * class.cs: Remove InheritablePropertySignatureCompare from the
12296         class, as we no longer depend on the property signature to compute
12297         whether it is possible to implement a method or not.
12298
12299         The reason is that calling PropertyInfo.GetGetMethod will return
12300         null (in .NET, in Mono it works, and we should change this), in
12301         cases where the Get Method does not exist in that particular
12302         class.
12303
12304         So this code:
12305
12306         class X { public virtual int A { get { return 1; } } }
12307         class Y : X { }
12308         class Z : Y { public override int A { get { return 2; } } }
12309
12310         Would fail in Z because the parent (Y) would not have the property
12311         defined.  So we avoid this completely now (because the alternative
12312         fix was ugly and slow), and we now depend exclusively on the
12313         method names.
12314
12315         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12316         reference method, instead of using the property.
12317
12318         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12319         routines are gone now.
12320
12321         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12322         names, they were incorrectly named.
12323
12324         * cs-tokenizer.cs: Return are more gentle token on failure. 
12325
12326         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12327         had an out-of-sync index variable, which caused it to remove from
12328         the list of pending methods the wrong method sometimes.
12329
12330 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12331
12332         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12333         CanWrite, because those refer to this particular instance of the
12334         property, and do not take into account the fact that we can
12335         override single members of a property.
12336
12337         Constructor requires an EmitContext.  The resolution process does
12338         not happen here, but we need to compute the accessors before,
12339         because the resolution does not always happen for properties.
12340
12341         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12342         subclass, before we did not update this flag, but we did update
12343         bindingflags. 
12344
12345         (GetAccessors): Drop this routine, as it did not work in the
12346         presence of partially overwritten set/get methods. 
12347
12348         Notice that this broke the cs1540 detection, but that will require
12349         more thinking. 
12350
12351 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12352
12353         * class.cs:
12354         * codegen.cs:
12355         * driver.cs: issue a warning instead of an error if we don't support
12356         debugging for the platform. Also ignore a couple of errors that may
12357         arise when trying to write the symbols. Undo my previous patch.
12358
12359 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12360
12361         * driver.cs: ignore /debug switch except for Unix platforms.
12362
12363 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12364
12365         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12366
12367 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12368
12369         * driver.cs: Do not make mcs-debug conditional, so we do not break
12370         builds that use it.
12371
12372         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12373         review this patch.  But basically after all the children variables
12374         have been merged, the value of "Breaks" was not being set to
12375         new_breaks for Switch blocks.  I think that it should be set after
12376         it has executed.  Currently I set this to the value of new_breaks,
12377         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12378         conservative, but I do not understand this code very well.
12379
12380         I did not break anything in the build, so that is good ;-)
12381
12382         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12383
12384 2002-10-20  Mark Crichton  <crichton@gimp.org>
12385
12386         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12387
12388 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12389
12390         * cfold.cs: Fixed compile blocker.
12391
12392 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12393
12394         * driver.cs: I was chekcing the key, not the file.
12395
12396 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12397
12398         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12399         message that we were generating - we just need to silently return
12400         a null.
12401
12402 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12403
12404         * class.cs (Event.Define): Change my previous commit, as this
12405         breaks the debugger.  This is a temporary hack, as it seems like
12406         the compiler is generating events incorrectly to begin with.
12407
12408         * expression.cs (Binary.ResolveOperator): Added support for 
12409         "U operator - (E x, E y)"
12410
12411         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12412         y)".
12413
12414         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12415         init-only variables, but this path did not take into account that
12416         there might be also instance readonly variables.  Correct this
12417         problem. 
12418
12419         This fixes bug 32253
12420
12421         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12422         delegates as well.
12423
12424         * driver.cs: Change the extension for modules to `netmodule'
12425
12426         * cs-parser.jay: Improved slightly the location tracking for
12427         the debugger symbols.
12428
12429         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12430         modifiers that were specified instead of the hardcoded value
12431         (FamAndAssem).  This was basically ignoring the static modifier,
12432         and others.  Fixes 32429.
12433
12434         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12435         fixed a bug in the process (32476)
12436
12437         * expression.cs (ArrayAccess.EmitAssign): Patch from
12438         hwang_rob@yahoo.ca that fixes bug 31834.3
12439
12440 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12441
12442         * driver.cs: Make the module extension .netmodule.
12443
12444 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12445
12446         * driver.cs: Report an error if the resource file is not found
12447         instead of crashing.
12448
12449         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12450         false, like Emit does.
12451
12452 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12453
12454         * typemanager.cs: Remove unused private member.  Also reported mcs
12455         bug to report this as a warning like csc.
12456
12457 2002-10-15  Martin Baulig  <martin@gnome.org>
12458
12459         * statement.cs (Statement.Emit): Made this a virtual method; emits
12460         the line number info and calls DoEmit().
12461         (Statement.DoEmit): New protected abstract method, formerly knows
12462         as Statement.Emit().
12463
12464         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12465
12466 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12467
12468         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12469         have fixed a remaining problem: not every AddXXXX was adding a
12470         fully qualified name.  
12471
12472         Now everyone registers a fully qualified name in the DeclSpace as
12473         being defined instead of the partial name.  
12474
12475         Downsides: we are slower than we need to be due to the excess
12476         copies and the names being registered this way.  
12477
12478         The reason for this is that we currently depend (on the corlib
12479         bootstrap for instance) that types are fully qualified, because
12480         we dump all the types in the namespace, and we should really have
12481         types inserted into the proper namespace, so we can only store the
12482         basenames in the defined_names array.
12483
12484 2002-10-10  Martin Baulig  <martin@gnome.org>
12485
12486         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12487         from bug #31834, see the bug report for a testcase which is
12488         miscompiled.
12489
12490 2002-10-10  Martin Baulig  <martin@gnome.org>
12491
12492         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12493         flow analysis code for this.
12494
12495         * statement.cs (Do, While, For): Tell the flow analysis code about
12496         infinite loops.
12497         (FlowBranching.UsageVector): Added support for infinite loops.
12498         (Block.Resolve): Moved the dead code elimination here and use flow
12499         analysis to do it.
12500
12501 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12502
12503         * class.cs (Field.Define): Catch cycles on struct type
12504         definitions. 
12505
12506         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12507         fields if the fields are static.  We only need to check instance
12508         fields. 
12509
12510         * expression.cs (As.DoResolve): Test for reference type.
12511
12512         * statement.cs (Using.ResolveExpression): Use
12513         ConvertImplicitRequired, not ConvertImplicit which reports an
12514         error on failture
12515         (Using.ResolveLocalVariableDecls): ditto.
12516
12517         * expression.cs (Binary.ResolveOperator): Report errors in a few
12518         places where we had to.
12519
12520         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12521
12522 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12523
12524         * expression.cs: Use StoreFromPtr instead of extracting the type
12525         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12526
12527         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12528         an enumeration value to a System.Enum, but System.Enum is not a
12529         value type, but an class type, so we need to box.
12530
12531         (Expression.ConvertExplicit): One codepath could return
12532         errors but not flag them.  Fix this.  Fixes #31853
12533
12534         * parameter.cs (Resolve): Do not allow void as a parameter type.
12535
12536 2002-10-06  Martin Baulig  <martin@gnome.org>
12537
12538         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12539         if it's a class type and not a struct.  Fixes #31815.
12540
12541 2002-10-06  Martin Baulig  <martin@gnome.org>
12542
12543         * statement.cs: Reworked the flow analysis code a bit to make it
12544         usable for dead code elimination.
12545
12546 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12547
12548         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12549
12550 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12551
12552         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12553         to fix the test 165, will investigate deeper.
12554
12555 2002-10-04  Martin Baulig  <martin@gnome.org>
12556
12557         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12558         finally blocks actually work.
12559         (Try.Resolve): We don't need to create a sibling for `finally' if
12560         there is no finally block.
12561
12562 2002-10-04  Martin Baulig  <martin@gnome.org>
12563
12564         * class.cs (Constructor.Define): The default accessibility for a
12565         non-default constructor is private, not public.
12566
12567 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12568
12569         * class.cs (Constructor): Make AllowedModifiers public, add
12570         EXTERN.
12571
12572         * cs-parser.jay: Perform the modifiers test here, as the
12573         constructor for the Constructor class usually receives a zero
12574         because of the way we create it (first we create, later we
12575         customize, and we were never checking the modifiers).
12576
12577         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12578         is a version of LookupTypeReflection that includes the type-name
12579         cache.  This can be used as a fast path for functions that know
12580         the fully qualified name and are only calling into *.GetType() to
12581         obtain a composed type.
12582
12583         This is also used by TypeManager.LookupType during its type
12584         composition.
12585
12586         (LookupType): We now also track the real type name, as sometimes
12587         we can get a quey for the real type name from things like
12588         ComposedCast.  This fixes bug 31422.
12589
12590         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12591         complete type fullname, it does not have to go through the type
12592         resolution system to obtain the composed version of the type (for
12593         obtaining arrays or pointers).
12594
12595         (Conditional.Emit): Use the EmitBoolExpression to
12596         generate nicer code, as requested by Paolo.
12597
12598         (ArrayCreation.CheckIndices): Use the patch from
12599         hwang_rob@yahoo.ca to validate the array initializers. 
12600
12601 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12602
12603         * class.cs (ConstructorInitializer.Emit): simplify code by using
12604         Invocation.EmitCall, and at the same time, fix the bugs in calling
12605         parent constructors that took variable arguments. 
12606
12607         * ecore.cs (Expression.ConvertNumericExplicit,
12608         Expression.ImplicitNumericConversion): Remove the code that
12609         manually wrapped decimal (InternalTypeConstructor call is now gone
12610         as well).
12611
12612         * expression.cs (Cast.TryReduce): Also handle decimal types when
12613         trying to perform a constant fold on the type.
12614
12615         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12616
12617         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12618         that only turned off an error report, and did nothing else. 
12619
12620 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * driver.cs: Handle and ignore /fullpaths
12623
12624 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12625
12626         * expression.cs (Binary.ResolveOperator): Catch the case where
12627         DoNumericPromotions returns true, 
12628
12629         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12630
12631 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12634         report error 70.
12635
12636 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12639         conversion exists, but it is also required that the conversion be
12640         performed.  This manifested in "(Type64Enum) 2".  
12641
12642         * class.cs (TypeManager.AddMethod): The fix is not to change
12643         AddEnum, because that one was using a fully qualified name (every
12644         DeclSpace derivative does), but to change the AddMethod routine
12645         that was using an un-namespaced name.  This now correctly reports
12646         the duplicated name.
12647
12648         Revert patch until I can properly fix it.  The issue
12649         is that we have a shared Type space across all namespaces
12650         currently, which is wrong.
12651
12652         Options include making the Namespace a DeclSpace, and merge
12653         current_namespace/current_container in the parser.
12654
12655 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12656
12657         * cs-parser.jay: Improve error reporting when we get a different
12658         kind of expression in local_variable_type and
12659         local_variable_pointer_type. 
12660
12661         Propagate this to avoid missleading errors being reported.
12662
12663         * ecore.cs (ImplicitReferenceConversion): treat
12664         TypeManager.value_type as a target just like object_type.   As
12665         code like this:
12666
12667         ValueType v = 1;
12668
12669         Is valid, and needs to result in the int 1 being boxed before it
12670         is assigned to the value type v.
12671
12672         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12673         to validate the enumeration name.
12674
12675         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12676         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12677         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12678
12679         * ecore.cs (TryImplicitIntConversion): When doing an
12680         implicit-enumeration-conversion, check if the type is 64-bits and
12681         perform a conversion before passing to EnumConstant.
12682
12683 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12684
12685         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12686         report ambiguous type references.  Unlike the MS version, we
12687         report what the ambiguity is.   Innovation at work ;-)
12688
12689         (DeclSpace.FindType): Require a location argument to
12690         display when we display an ambiguous error.
12691
12692         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12693
12694         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12695
12696         * expression.cs (EmitDynamicInitializers): Apply patch from
12697         hwang_rob@yahoo.ca that fixes the order in which we emit our
12698         initializers. 
12699
12700 2002-09-21  Martin Baulig  <martin@gnome.org>
12701
12702         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12703         delegate takes no arguments.
12704
12705 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12706
12707         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12708         from integers.
12709
12710         * expression.cs: Extract the underlying type.
12711
12712         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12713
12714         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12715
12716 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12717
12718         * class.cs (TypeContainer.DefineType): We can not use the nice
12719         PackingSize with the size set to 1 DefineType method, because it
12720         will not allow us to define the interfaces that the struct
12721         implements.
12722
12723         This completes the fixing of bug 27287
12724
12725         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12726         means also structs.  This fixes part of the problem. 
12727         (Expresion.ImplicitReferenceConversionExists): ditto.
12728
12729         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12730         error if there were no errors reported during the type lookup
12731         process, to avoid duplicates or redundant errors.  Without this
12732         you would get an ambiguous errors plus a type not found.  We have
12733         beaten the user enough with the first error.  
12734
12735         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12736         reference. 
12737
12738         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12739         during the resolution process, stop the lookup, this avoids
12740         repeated error reports (same error twice).
12741
12742         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12743
12744         * typemanager.cs (LookupType): Redo the type lookup code to match
12745         the needs of System.Reflection.  
12746
12747         The issue is that System.Reflection requires references to nested
12748         types to begin with a "+" sign instead of a dot.  So toplevel
12749         types look like: "NameSpace.TopLevelClass", and nested ones look
12750         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12751         levels. 
12752
12753 2002-09-19  Martin Baulig  <martin@gnome.org>
12754
12755         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12756         says that a method always returns or always throws an exception,
12757         don't report the CS0161.
12758
12759         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12760         set `Returns = new_returns'.
12761
12762 2002-09-19  Martin Baulig  <martin@gnome.org>
12763
12764         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12765         to an enum constant, check for a CS0176.
12766
12767 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12768
12769         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12770         for operators that must be in pairs and report errors.
12771
12772         * ecore.cs (SimpleName.DoResolveType): During the initial type
12773         resolution process, when we define types recursively, we must
12774         check first for types in our current scope before we perform
12775         lookups in the enclosing scopes.
12776
12777         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12778
12779         (Invocation.VerifyArgumentsCompat): Call
12780         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12781         I thought we were supposed to always call this, but there are a
12782         few places in the code where we dont do it.
12783
12784 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12785
12786         * driver.cs: Add support in -linkres and -resource to specify the
12787         name of the identifier.
12788
12789 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12790
12791         * ecore.cs (StandardConversionExists): Sync with the conversion
12792         code: allow anything-* to void* conversions.
12793
12794         (FindMostSpecificSource): Use an Expression argument
12795         instead of a Type, because we might be handed over a Literal which
12796         gets a few more implicit conversions that plain types do not.  So
12797         this information was being lost.
12798
12799         Also, we drop the temporary type-holder expression when not
12800         required.
12801
12802 2002-09-17  Martin Baulig  <martin@gnome.org>
12803
12804         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12805         this is an explicit interface implementation.
12806
12807 2002-09-17  Martin Baulig  <martin@gnome.org>
12808
12809         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12810         different `IndexerName' attributes.
12811
12812         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12813         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12814         virtual CommonResolve().
12815
12816 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12817
12818         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12819         and convert that to the UnderlyingType.
12820
12821         * statement.cs (Foreach.Resolve): Indexers are just like variables
12822         or PropertyAccesses.
12823
12824         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12825         inside quoted strings, we were not doing this before.
12826
12827 2002-09-16  Martin Baulig  <martin@gnome.org>
12828
12829         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12830         resolve it.  This is needed for the definite assignment check of the
12831         instance expression, fixes bug #29846.
12832         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12833
12834 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12835
12836         * parameter.cs: Fix compile error.  Cannot reference static member
12837         from an instance object.  Is this an mcs bug?
12838
12839 2002-09-14  Martin Baulig  <martin@gnome.org>
12840
12841         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12842         multiple times.  Fixes bug #30295, added test-166.cs.
12843
12844 2002-09-14  Martin Baulig  <martin@gnome.org>
12845
12846         * statement.cs (Block.Emit): Don't emit unreachable code.
12847         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12848         `break' statements.
12849         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12850
12851 2002-09-14  Martin Baulig  <martin@gnome.org>
12852
12853         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12854         is set.
12855
12856 2002-09-14  Martin Baulig  <martin@gnome.org>
12857
12858         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12859         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12860         be false on the ms runtime.
12861
12862 2002-09-13  Martin Baulig  <martin@gnome.org>
12863
12864         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12865         the CS0038 error message.
12866
12867 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12868
12869         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12870         constant inside, return it.
12871
12872 2002-09-12  Martin Baulig  <martin@gnome.org>
12873
12874         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12875         implicit conversion can be done between enum types.
12876
12877         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12878         check whether an implicit conversion to the current enum's UnderlyingType
12879         exists and report an error if not.
12880
12881         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12882         without debugging support.
12883
12884         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12885         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12886
12887 2002-09-12  Martin Baulig  <martin@gnome.org>
12888
12889         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12890
12891         * ecore.cs (IMemberExpr.DeclaringType): New property.
12892         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12893         nonstatic member of an outer type (CS0038).
12894
12895 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * driver.cs: Activate the using-error detector at warning level
12898         4 (at least for MS-compatible APIs).
12899
12900         * namespace.cs (VerifyUsing): Small buglett fix.
12901
12902         * pending.cs (PendingImplementation): pass the container pointer. 
12903
12904         * interface.cs (GetMethods): Allow for recursive definition.  Long
12905         term, I would like to move every type to support recursive
12906         definitions, not the current ordering mechanism that we have right
12907         now.
12908
12909         The situation is this: Attributes are handled before interfaces,
12910         so we can apply attributes to interfaces.  But some attributes
12911         implement interfaces, we will now handle the simple cases
12912         (recursive definitions will just get an error).  
12913
12914         * parameter.cs: Only invalidate types at the end if we fail to
12915         lookup all types.  
12916
12917 2002-09-09  Martin Baulig  <martin@gnome.org>
12918
12919         * ecore.cs (PropertyExpr.Emit): Also check for
12920         TypeManager.system_int_array_get_length so this'll also work when
12921         compiling corlib.  Fixes #30003.
12922
12923 2002-09-09  Martin Baulig  <martin@gnome.org>
12924
12925         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12926         and throw an exception if we can't get the type's size.  Fixed #30040,
12927         added test-165.cs.
12928
12929 2002-09-09  Martin Baulig  <martin@gnome.org>
12930
12931         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12932
12933         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12934         context.  Fixes bug #30027.
12935
12936         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12937         virtual functions.  Fixes bug #30043, added test-164.cs.
12938
12939 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12940
12941         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12942
12943 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12944
12945         * driver.cs: Use an object to get the windows codepage since it's not a
12946         static property.
12947
12948 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12949
12950         * statement.cs (For.Emit): for infinite loops (test == null)
12951         return whether there is a break inside, not always "true".
12952
12953         * namespace.cs (UsingEntry): New struct to hold the name of the
12954         using definition, the location where it is defined, and whether it
12955         has been used in a successful type lookup.
12956
12957         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12958         strings.
12959
12960         * decl.cs: ditto.
12961
12962 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12963
12964         * attribute.cs : Fix incorrect code which relied on catching
12965         a NullReferenceException to detect a null being passed in
12966         where an object was expected.
12967
12968 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12969
12970         * statement.cs (Try): flag the catch variable as assigned
12971
12972         * expression.cs (Cast): Simplified by using ResolveType instead of
12973         manually resolving.
12974
12975         * statement.cs (Catch): Fix bug by using ResolveType.
12976
12977 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12978
12979         * expression.cs (BetterConversion): Special case for when we have
12980         a NullLiteral as the argument and we have to choose between string
12981         and object types - we choose string the way csc does.
12982
12983         * attribute.cs (Attribute.Resolve): Catch the
12984         NullReferenceException and report error #182 since the Mono
12985         runtime no more has the bug and having this exception raised means
12986         we tried to select a constructor which takes an object and is
12987         passed a null.
12988
12989 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12990
12991         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12992         message (1502, 1503) when we can't locate a method after overload
12993         resolution. This is much more informative and closes the bug
12994         Miguel reported.
12995
12996         * interface.cs (PopulateMethod): Return if there are no argument
12997         types. Fixes a NullReferenceException bug.
12998
12999         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13000         expressions too. Previously we were checking only in one place for
13001         positional arguments leaving out named arguments.
13002
13003         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13004         type to the enum type is not allowed. Remove code corresponding to
13005         that.
13006
13007         (ConvertNumericExplicit): Allow explicit conversions from
13008         the underlying type to enum type. This precisely follows the spec
13009         and closes a bug filed by Gonzalo.
13010
13011 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13012
13013         * compiler.csproj:
13014         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13015
13016 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13017
13018         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13019         it was important that we stored the right value after the
13020         reduction in `converted'.
13021
13022 2002-09-04  Martin Baulig  <martin@gnome.org>
13023
13024         * location.cs (Location.SymbolDocument): Use full pathnames for the
13025         source files.
13026
13027 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13028
13029         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13030         of the expression resolve mechanism, because that will catch the
13031         SimpleName error failures.
13032
13033         (Conditional): If we can not resolve the
13034         expression, return, do not crash.
13035
13036 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13037
13038         * cs-tokenizer.cs:
13039         (location): display token name instead of its number.
13040
13041 2002-08-28  Martin Baulig  <martin@gnome.org>
13042
13043         * expression.cs (Binary.ResolveOperator): Don't silently return
13044         but return an error if an operator cannot be applied between two
13045         enum types.
13046
13047 2002-08-28  Martin Baulig  <martin@gnome.org>
13048
13049         * class.cs (Constructor.Define): Set the permission attributes
13050         correctly instead of making all constructors public.
13051
13052 2002-08-28  Martin Baulig  <martin@gnome.org>
13053
13054         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13055         for private members before reporting a CS0103; if we find anything,
13056         it's a CS0122.
13057
13058 2002-08-28  Martin Baulig  <martin@gnome.org>
13059
13060         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13061         to check whether `closure_start_type == closure_invocation_type',
13062         we also need to check whether `m.DeclaringType == closure_invocation_type'
13063         before bypassing the permission checks.  We might be accessing
13064         protected/private members from the base class.
13065         (TypeManager.RealMemberLookup): Only set private_ok if private
13066         members were requested via BindingFlags.NonPublic.
13067
13068         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13069
13070         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13071         MethodGroupExpr.IsExplicitImpl if appropriate.
13072         (Invocation.DoResolve): Don't report the CS0120 for explicit
13073         interface implementations.
13074
13075 2002-08-27  Martin Baulig  <martin@gnome.org>
13076
13077         * expression.cs (Invocation.DoResolve): If this is a static
13078         method and we don't have an InstanceExpression, we must report
13079         a CS0120.
13080
13081 2002-08-25  Martin Baulig  <martin@gnome.org>
13082
13083         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13084         `==' between a valuetype and an object.
13085
13086 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13087
13088         * ecore.cs (TypeExpr): Provide a ToString method.
13089
13090 2002-08-24  Martin Baulig  <martin@gnome.org>
13091
13092         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13093         now called proggie.dbg and it's a binary file.
13094
13095 2002-08-23  Martin Baulig  <martin@gnome.org>
13096
13097         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13098
13099 2002-08-23  Martin Baulig  <martin@gnome.org>
13100
13101         * struct.cs (MyStructInfo.ctor): Make this work with empty
13102         structs; it's not allowed to use foreach() on null.
13103
13104 2002-08-23  Martin Baulig  <martin@gnome.org>
13105
13106         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13107         writer the full pathname of the generated assembly.
13108
13109 2002-08-23  Martin Baulig  <martin@gnome.org>
13110
13111         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13112         A `finally' block never returns or breaks; improved handling of
13113         unreachable code.
13114
13115 2002-08-23  Martin Baulig  <martin@gnome.org>
13116
13117         * statement.cs (Throw.Resolve): Allow `throw null'.
13118
13119 2002-08-23  Martin Baulig  <martin@gnome.org>
13120
13121         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13122         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13123         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13124         MemberLookup would return a wrong event if this is an explicit
13125         interface implementation and the class has an event with the same
13126         name.
13127
13128 2002-08-23  Martin Baulig  <martin@gnome.org>
13129
13130         * statement.cs (Block.AddChildVariableNames): New public method.
13131         (Block.AddChildVariableName): Likewise.
13132         (Block.IsVariableNameUsedInChildBlock): Likewise.
13133         (Block.AddVariable): Check whether a variable name has already
13134         been used in a child block.
13135
13136         * cs-parser.jay (declare_local_variables): Mark all variable names
13137         from the current block as being used in a child block in the
13138         implicit block.
13139
13140 2002-08-23  Martin Baulig  <martin@gnome.org>
13141
13142         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13143         find the symbol writer.
13144
13145         * driver.cs: csc also allows the arguments to /define being
13146         separated by commas, not only by semicolons.
13147
13148 2002-08-23  Martin Baulig  <martin@gnome.org>
13149
13150         * interface.cs (Interface.GetMembers): Added static check for events.
13151
13152 2002-08-15  Martin Baulig  <martin@gnome.org>
13153
13154         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13155         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13156
13157         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13158         why the MethodData.EmitDestructor() change was necessary.
13159
13160 2002-08-20  Martin Baulig  <martin@gnome.org>
13161
13162         * class.cs (TypeContainer.FindMembers): Added static check for events.
13163
13164         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13165
13166         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13167         use Type.GetEvents(), not Type.FindMembers().
13168
13169 2002-08-20  Martin Baulig  <martin@gnome.org>
13170
13171         * decl.cs (MemberCache): Added a special method cache which will
13172         be used for method-only searched.  This ensures that a method
13173         search will return a MethodInfo with the correct ReflectedType for
13174         inherited methods.      
13175
13176 2002-08-20  Martin Baulig  <martin@gnome.org>
13177
13178         * decl.cs (DeclSpace.FindMembers): Made this public.
13179
13180 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13181
13182         * delegate.cs: fixed build on windows.
13183         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13184
13185 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13186
13187         * ecore.cs (StandardConversionExists): Return a false
13188         if we are trying to convert the void type to anything else
13189         since that is not allowed.
13190
13191         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13192         we flag error 70 in the event an event is trying to be accessed
13193         directly from outside the declaring type.
13194
13195 2002-08-20  Martin Baulig  <martin@gnome.org>
13196
13197         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13198         MemberCache from typemanager.cs to decl.cs.
13199
13200 2002-08-19  Martin Baulig  <martin@gnome.org>
13201
13202         * class.cs (TypeContainer): Implement IMemberContainer.
13203         (TypeContainer.DefineMembers): Create the MemberCache.
13204         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13205         return public members if BindingFlags.Public was given, check
13206         whether members are static.
13207
13208 2002-08-16  Martin Baulig  <martin@gnome.org>
13209
13210         * decl.cs (DeclSpace.Define): Splitted this in Define and
13211         DefineMembers.  DefineMembers is called first and initializes the
13212         MemberCache.
13213
13214         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13215         DefineMembers() on all our DeclSpaces.
13216
13217         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13218         but call DefineMembers() on all nested interfaces.  We call their
13219         Define() in our new Define() function.
13220
13221         * interface.cs (Interface): Implement IMemberContainer.
13222         (Interface.Define): Moved all code except the attribute stuf to
13223         DefineMembers().
13224         (Interface.DefineMembers): Initialize the member cache.
13225
13226         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13227         need this anymore since we can use MemberCache.FindMembers directly.
13228
13229 2002-08-19  Martin Baulig  <martin@gnome.org>
13230
13231         * typemanager.cs (MemberCache): When creating the cache for an
13232         interface type, add all inherited members.
13233         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13234         to `out bool used_cache' and documented it.
13235         (TypeManager.MemberLookup): If we already used the cache in the first
13236         iteration, we don't need to do the interfaces check.
13237
13238 2002-08-19  Martin Baulig  <martin@gnome.org>
13239
13240         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13241         here from IMemberFinder and don't implement this interface anymore.
13242         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13243
13244         * typemanager.cs (IMemberFinder): This interface is now only used by
13245         classes which actually support the member cache.
13246         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13247         since we only put DeclSpaces into this Hashtable.
13248         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13249         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13250
13251 2002-08-16  Martin Baulig  <martin@gnome.org>
13252
13253         * typemanager.cs (ICachingMemberFinder): Removed.
13254         (IMemberFinder.MemberCache): New property.
13255         (TypeManager.FindMembers): Merged this with RealFindMembers().
13256         This function will never be called from TypeManager.MemberLookup()
13257         so we can't use the cache here, just the IMemberFinder.
13258         (TypeManager.MemberLookup_FindMembers): Check whether the
13259         IMemberFinder has a MemberCache and call the cache's FindMembers
13260         function.
13261         (MemberCache): Rewrote larger parts of this yet another time and
13262         cleaned it up a bit.
13263
13264 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13265
13266         * driver.cs (LoadArgs): Support quoting.
13267
13268         (Usage): Show the CSC-like command line arguments.
13269
13270         Improved a few error messages.
13271
13272 2002-08-15  Martin Baulig  <martin@gnome.org>
13273
13274         * typemanager.cs (IMemberContainer.Type): New property.
13275         (IMemberContainer.IsInterface): New property.
13276
13277         The following changes are conditional to BROKEN_RUNTIME, which is
13278         defined at the top of the file.
13279
13280         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13281         class'es members, but add all members from TypeHandle.ObjectType
13282         if we're an interface.
13283         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13284         is the current type.
13285         (MemberCache.CacheEntry.Container): Removed this field.
13286         (TypeHandle.GetMembers): Include inherited members.
13287
13288 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13289
13290         * typemanager.cs: fixed compilation and added a comment on a field that
13291         is never used.
13292
13293 2002-08-15  Martin Baulig  <martin@gnome.org>
13294
13295         * class.cs (ConstructorInitializer.Resolve): In the
13296         Expression.MemberLookup call, use the queried_type as
13297         invocation_type.
13298
13299         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13300         declared' attribute, it's always true.
13301         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13302         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13303         temporary wrapper for FindMembers which tells MemberLookup whether
13304         members from the base classes are included in the return value.
13305         This will go away soon.
13306         (TypeManager.MemberLookup): Use this temporary hack here; once the
13307         new MemberCache is completed, we don't need to do the DeclaredOnly
13308         looping here anymore since the MemberCache will take care of this.
13309         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13310         (MemberCache): When creating the MemberCache for a class, get
13311         members from the current class and all its base classes.
13312         (MemberCache.CacheEntry.Container): New field.  This is a
13313         temporary hack until the Mono runtime is fixed to distinguish
13314         between ReflectedType and DeclaringType.  It allows us to use MCS
13315         with both the MS runtime and the unfixed Mono runtime without
13316         problems and without accecting performance.
13317         (MemberCache.SearchMembers): The DeclaredOnly looping from
13318         TypeManager.MemberLookup is now done here.      
13319
13320 2002-08-14  Martin Baulig  <martin@gnome.org>
13321
13322         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13323         Type.GetFields on dynamic types but get the fields from the
13324         corresponding TypeContainer.
13325         (MyStructInfo.GetStructInfo): Added check for enum types.
13326
13327         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13328         (MemberList.SyncRoot): Implemented.
13329         (TypeManager.FilterWithClosure): No need to check permissions if
13330         closure_start_type == closure_invocation_type, don't crash if
13331         closure_invocation_type is null.
13332
13333 2002-08-13  Martin Baulig  <martin@gnome.org>
13334
13335         Rewrote TypeContainer.FindMembers to use a member cache.  This
13336         gives us a speed increase of about 35% for the self-hosting MCS
13337         build and of about 15-20% for the class libs (both on GNU/Linux).
13338
13339         * report.cs (Timer): New class to get enhanced profiling.  This
13340         whole class is "TIMER" conditional since it remarkably slows down
13341         compilation speed.
13342
13343         * class.cs (MemberList): New class.  This is an IList wrapper
13344         which we're now using instead of passing MemberInfo[]'s around to
13345         avoid copying this array unnecessarily.
13346         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13347         (ICachingMemberFinder, IMemberContainer): New interface.
13348         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13349         has already been checked, otherwise use it for the name comparision.
13350         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13351         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13352         if possible.  Returns a MemberList, not a MemberInfo [].
13353         (TypeHandle): New class, implements IMemberContainer.  We create
13354         one instance of this class per type, it contains a MemberCache
13355         which is used to do the member lookups.
13356         (MemberCache): New class.  Each instance of this class contains
13357         all members of a type and a name-based hash table.
13358         (MemberCache.FindMembers): This is our new member lookup
13359         function.  First, it looks up all members of the requested name in
13360         the hash table.  Then, it walks this list and sorts out all
13361         applicable members and returns them.
13362
13363 2002-08-13  Martin Baulig  <martin@gnome.org>
13364
13365         In addition to a nice code cleanup, this gives us a performance
13366         increase of about 1.4% on GNU/Linux - not much, but it's already
13367         half a second for the self-hosting MCS compilation.
13368
13369         * typemanager.cs (IMemberFinder): New interface.  It is used by
13370         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13371         Enum, Delegate or Interface.
13372         (TypeManager.finder_to_member_finder): New PtrHashtable.
13373         (TypeManager.finder_to_container): Removed.
13374         (TypeManager.finder_to_delegate): Removed.
13375         (TypeManager.finder_to_interface): Removed.
13376         (TypeManager.finder_to_enum): Removed.
13377
13378         * interface.cs (Interface): Implement IMemberFinder.
13379
13380         * delegate.cs (Delegate): Implement IMemberFinder.
13381
13382         * enum.cs (Enum): Implement IMemberFinder.
13383
13384         * class.cs (TypeContainer): Implement IMemberFinder.
13385
13386 2002-08-12  Martin Baulig  <martin@gnome.org>
13387
13388         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13389
13390 2002-08-12  Martin Baulig  <martin@gnome.org>
13391
13392         * ecore.cs (ITypeExpression): New interface for expressions which
13393         resolve to a type.
13394         (TypeExpression): Renamed to TypeLookupExpression.
13395         (Expression.DoResolve): If we're doing a types-only lookup, the
13396         expression must implement the ITypeExpression interface and we
13397         call DoResolveType() on it.
13398         (SimpleName): Implement the new ITypeExpression interface.
13399         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13400         hack, the situation that we're only looking up types can't happen
13401         anymore when this method is called.  Moved the type lookup code to
13402         DoResolveType() and call it.
13403         (SimpleName.DoResolveType): This ITypeExpression interface method
13404         is now doing the types-only lookup.
13405         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13406         (ResolveFlags): Added MaskExprClass.
13407
13408         * expression.cs (MemberAccess): Implement the ITypeExpression
13409         interface.
13410         (MemberAccess.DoResolve): Added support for a types-only lookup
13411         when we're called via ITypeExpression.DoResolveType().
13412         (ComposedCast): Implement the ITypeExpression interface.
13413
13414         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13415         Expression.Resolve() with ResolveFlags.Type instead.
13416
13417 2002-08-12  Martin Baulig  <martin@gnome.org>
13418
13419         * interface.cs (Interface.Define): Apply attributes.
13420
13421         * attribute.cs (Attribute.ApplyAttributes): Added support for
13422         interface attributes.
13423
13424 2002-08-11  Martin Baulig  <martin@gnome.org>
13425
13426         * statement.cs (Block.Emit): Only check the "this" variable if we
13427         do not always throw an exception.
13428
13429         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13430         whether the property has a set accessor.
13431
13432 2002-08-11  Martin Baulig  <martin@gnome.org>
13433
13434         Added control flow analysis support for structs.
13435
13436         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13437         with control flow analysis turned off.
13438         (IVariable): New interface.
13439         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13440         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13441         (FieldExpr.DoResolve): Resolve the instance expression with flow
13442         analysis turned off and do the definite assignment check after the
13443         resolving when we know what the expression will resolve to.
13444
13445         * expression.cs (LocalVariableReference, ParameterReference):
13446         Implement the new IVariable interface, only call the flow analysis
13447         code if ec.DoFlowAnalysis is true.
13448         (This): Added constructor which takes a Block argument.  Implement
13449         the new IVariable interface.
13450         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13451         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13452         This does the definite assignment checks for struct members.
13453
13454         * class.cs (Constructor.Emit): If this is a non-static `struct'
13455         constructor which doesn't have any initializer, call
13456         Block.AddThisVariable() to tell the flow analysis code that all
13457         struct elements must be initialized before control returns from
13458         the constructor.
13459
13460         * statement.cs (MyStructInfo): New public class.
13461         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13462         argument to this indexer.  If non-zero, check an individual struct
13463         member, not the whole struct.
13464         (FlowBranching.CheckOutParameters): Check struct members.
13465         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13466         overloaded versions of these methods which take an additional
13467         `int field_idx' argument to check struct members.
13468         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13469         overloaded versions of these methods which take an additional
13470         `string field_name' argument to check struct member.s
13471         (VariableInfo): Implement the IVariable interface.
13472         (VariableInfo.StructInfo): New public property.  Returns the
13473         MyStructInfo instance of the variable if it's a struct or null.
13474         (Block.AddThisVariable): New public method.  This is called from
13475         Constructor.Emit() for non-static `struct' constructor which do
13476         not have any initializer.  It creates a special variable for the
13477         "this" instance variable which will be checked by the flow
13478         analysis code to ensure that all of the struct's fields are
13479         initialized before control returns from the constructor.
13480         (UsageVector): Added support for struct members.  If a
13481         variable/parameter is a struct with N members, we reserve a slot
13482         in the usage vector for each member.  A struct is considered fully
13483         initialized if either the struct itself (slot 0) or all its
13484         members are initialized.
13485
13486 2002-08-08  Martin Baulig  <martin@gnome.org>
13487
13488         * driver.cs (Driver.MainDriver): Only report an error CS5001
13489         if there were no compilation errors.
13490
13491         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13492         `UnsafeContext' property to determine whether the parent is in
13493         unsafe context rather than checking the parent's ModFlags:
13494         classes nested in an unsafe class are unsafe as well.
13495
13496 2002-08-08  Martin Baulig  <martin@gnome.org>
13497
13498         * statement.cs (UsageVector.MergeChildren): Distinguish between
13499         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13500         we return.  Added test17() and test18() to test-154.cs.
13501
13502 2002-08-08  Martin Baulig  <martin@gnome.org>
13503
13504         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13505         Family access, make sure the invoking type isn't a subclass of the
13506         queried type (that'd be a CS1540).
13507
13508         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13509         this method which takes an additional `Type invocation_type'.
13510
13511         * expression.cs (BaseAccess.DoResolve): Use the base type as
13512         invocation and query type.
13513         (MemberAccess.DoResolve): If the lookup failed and we're about to
13514         report a CS0122, try a lookup with the ec.ContainerType - if this
13515         succeeds, we must report a CS1540.
13516
13517 2002-08-08  Martin Baulig  <martin@gnome.org>
13518
13519         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13520         (MethodGroupExpr): Implement the IMemberExpr interface.
13521
13522         * expression (MemberAccess.ResolveMemberAccess): No need to have
13523         any special code for MethodGroupExprs anymore, they're now
13524         IMemberExprs.   
13525
13526 2002-08-08  Martin Baulig  <martin@gnome.org>
13527
13528         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13529         Family, FamANDAssem and FamORAssem permissions.
13530         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13531
13532 2002-08-08  Martin Baulig  <martin@gnome.org>
13533
13534         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13535         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13536         or loop block.
13537
13538 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13539
13540         * driver.cs: implemented /resource option to embed managed resources.
13541
13542 2002-08-07  Martin Baulig  <martin@gnome.org>
13543
13544         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13545         (FieldBase.HasFieldInitializer): New public property.
13546         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13547         returns the field initializer and makes sure it is only resolved once.
13548         (TypeContainer.EmitFieldInitializers): Call
13549         FieldBase.GetInitializerExpression to get the initializer, this ensures
13550         that it isn't resolved multiple times.
13551
13552         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13553         the resolving process (SimpleName/MemberLookup) that we're currently
13554         emitting a field initializer (which must not access any instance members,
13555         this is an error CS0236).
13556
13557         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13558         argument, if the `IsFieldInitializer' flag is set, we must report and
13559         error CS0236 and not an error CS0120.   
13560
13561 2002-08-07  Martin Baulig  <martin@gnome.org>
13562
13563         * ecore.cs (IMemberExpr): New public interface.
13564         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13565         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13566         if the expression is an IMemberExpr.
13567
13568         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13569         to be null, implicitly default to `this' if we're non-static in
13570         this case.  Simplified the code a lot by using the new IMemberExpr
13571         interface.  Also fixed bug #28176 here.
13572
13573 2002-08-06  Martin Baulig  <martin@gnome.org>
13574
13575         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13576         ParameterReferences during semantic analysis so that we can do a
13577         type-only search when resolving Cast, TypeOf and SizeOf.
13578         (block): Pass the `current_local_parameters' to the Block's
13579         constructor.
13580
13581         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13582         argument to the constructor.
13583         (ConstructorInitializer.Resolve): Create a temporary implicit
13584         block with the parameters.
13585
13586         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13587         references here if we aren't doing a type-only search.
13588
13589         * statement.cs (Block): Added constructor which takes a
13590         `Parameters parameters' argument.
13591         (Block.Parameters): New public property.
13592
13593         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13594         to `Parameters' and made it public readonly.
13595
13596 2002-08-06  Martin Baulig  <martin@gnome.org>
13597
13598         * ecore.cs (Expression.Warning): Made this public as well.
13599
13600         * report.cs (Report.Debug): Print the contents of collections.
13601
13602 2002-08-06  Martin Baulig  <martin@gnome.org>
13603
13604         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13605         used to tell Resolve() which kinds of expressions it may return.
13606         (Expression.Resolve): Added overloaded version of this method which
13607         takes a `ResolveFlags flags' argument.  This can be used to tell
13608         Resolve() which kinds of expressions it may return.  Reports a
13609         CS0118 on error.
13610         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13611         ResolveFlags.SimpleName.
13612         (Expression.Error118): Added overloaded version of this method which
13613         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13614         which kinds of expressions are allowed.
13615
13616         * expression.cs (Argument.ResolveMethodGroup): New public method.
13617         Resolves an argument, but allows a MethodGroup to be returned.
13618         This is used when invoking a delegate.
13619
13620         * TODO: Updated a bit.
13621
13622 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13623
13624         Fixed compilation with csc.
13625
13626         * ecore.cs: Expression.Error made public. Is this correct? Should
13627         Warning be made public too?
13628
13629         * expression.cs: use ea.Location instead of ea.loc.
13630         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13631
13632 2002-08-06  Martin Baulig  <martin@gnome.org>
13633
13634         * ecore.cs (Expression.loc): Moved the location here instead of
13635         duplicating it in all derived classes.
13636         (Expression.Location): New public property.
13637         (Expression.Error, Expression.Warning): Made them non-static and
13638         removed the location argument.
13639         (Expression.Warning): Added overloaded version which takes an
13640         `int level' argument.
13641         (Expression.Error118): Make this non-static and removed the
13642         expression and location arguments.
13643         (TypeExpr): Added location argument to the constructor.
13644
13645         * expression.cs (StaticCallExpr): Added location argument to
13646         the constructor.
13647         (Indirection, PointerArithmetic): Likewise.
13648         (CheckedExpr, UnCheckedExpr): Likewise.
13649         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13650         (StringPtr): Likewise.
13651
13652
13653 2002-08-05  Martin Baulig  <martin@gnome.org>
13654
13655         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13656
13657         * assign.cs (Assign.DoResolve): Check whether the source
13658         expression is a value or variable.
13659
13660         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13661         while resolving the corresponding blocks.
13662
13663         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13664         an error, don't silently return null.
13665
13666         * statement.cs (Block.AddVariable): Do the error reporting here
13667         and distinguish between CS0128 and CS0136.
13668         (Block.DoResolve): Report all unused labels (warning CS0164).
13669         (LabeledStatement): Pass the location to the constructor.
13670         (LabeledStatement.HasBeenReferenced): New property.
13671         (LabeledStatement.Resolve): Set it to true here.
13672
13673         * statement.cs (Return.Emit): Return success even after reporting
13674         a type mismatch error (CS0126 or CS0127), this is what csc does and
13675         it avoids confusing the users with any consecutive errors.
13676
13677 2002-08-05  Martin Baulig  <martin@gnome.org>
13678
13679         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13680
13681         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13682
13683         * expression.cs (MemberAccess.DoResolve): Silently return if an
13684         error has already been reported.
13685
13686         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13687         error has already been reported.
13688
13689 2002-08-05  Martin Baulig  <martin@gnome.org>
13690
13691         * statement.cs (UsageVector): Only initialize the `parameters'
13692         vector if we actually have any "out" parameters.
13693
13694 2002-08-05  Martin Baulig  <martin@gnome.org>
13695
13696         * expression.cs (Binary.ResolveOperator): When combining delegates,
13697         they must have the same type.
13698
13699 2002-08-05  Martin Baulig  <martin@gnome.org>
13700
13701         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13702         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13703         work with the ms runtime and we also don't need it: if we're a
13704         PropertyBuilder and not in the `indexer_arguments' hash, then we
13705         are a property and not an indexer.
13706
13707         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13708         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13709         since the latter one doesn't work with the ms runtime.
13710
13711 2002-08-03  Martin Baulig  <martin@gnome.org>
13712
13713         Fixed bugs #27998 and #22735.
13714
13715         * class.cs (Method.IsOperator): New public field.
13716         (Method.CheckBase): Report CS0111 if there's already a method
13717         with the same parameters in the current class.  Report CS0508 when
13718         attempting to change the return type of an inherited method.
13719         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13720         and it's not marked abstract or extern.
13721         (PropertyBase): New abstract base class for Property and Indexer.
13722         (PropertyBase.CheckBase): Moved here from Property and made it work
13723         for indexers.
13724         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13725         the same so we can reuse it there.
13726         (Property, Indexer): Derive from PropertyBase.
13727         (MethodSignature.inheritable_property_signature_filter): New delegate
13728         to find properties and indexers.
13729
13730         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13731         argument and improved error reporting.
13732
13733         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13734         EmptyReadOnlyParameters and made it a property.
13735
13736         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13737         version of this method which takes a `PropertyInfo indexer'.
13738         (TypeManager.RegisterIndexer): New method.
13739
13740         * class.cs: Added myself as author of this file :-)
13741
13742 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13743
13744         * class.cs: fixed compilation on windoze.
13745
13746 2002-08-03  Martin Baulig  <martin@gnome.org>
13747
13748         * interface.cs (Interface.GetInterfaceBases): Check whether all
13749         base interfaces are at least as accessible than the current one.
13750
13751         * class.cs (TypeContainer.GetClassBases): Check whether base types
13752         are at least as accessible than the current type.
13753         (TypeContainer.AsAccessible): Implemented and made non-static.
13754         (MemberBase.CheckParameters): Report errors if the accessibility
13755         checks fail.
13756
13757         * delegate.cs (Delegate.Delegate): The default visibility is
13758         internal for top-level types and private for nested types.
13759         (Delegate.Define): Report errors if the accessibility checks fail.
13760
13761         * enum.cs (Enum.Enum): The default visibility is internal for
13762         top-level types and private for nested types.
13763         (Enum.DefineType): Compute the correct visibility.
13764
13765         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13766         function which takes a `bool is_toplevel' instead of a TypeContainer.
13767
13768         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13769         builtin type.
13770
13771 2002-08-02  Martin Baulig  <martin@gnome.org>
13772
13773         * expression.cs (LocalVariableReferenc): Added constructor which
13774         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13775         (LocalVariableReference.IsReadOnly): New property.
13776         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13777         variable is readonly, use our own readonly flag to do this; you can
13778         use the new constructor to get a writable reference to a read-only
13779         variable.
13780
13781         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13782         reference to the local variable.
13783
13784 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * rootcontext.cs (ResolveCore): Also include System.Exception
13787
13788         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13789         we reach an EmptyStatement.
13790
13791         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13792         is also fine.
13793
13794         * expression.cs (Binary.ResolveOperator): Check error result in
13795         two places.
13796
13797         use brtrue/brfalse directly and avoid compares to null.
13798
13799 2002-08-02  Martin Baulig  <martin@gnome.org>
13800
13801         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13802         Fixes bug #28407, added test-155.cs.
13803
13804 2002-08-01  Martin Baulig  <martin@gnome.org>
13805
13806         * class.cs (Event.EmitDefaultMethod): Make this work with static
13807         events.  Fixes #28311, added verify-3.cs.
13808
13809 2002-08-01  Martin Baulig  <martin@gnome.org>
13810
13811         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13812         `is_disposable' fields.
13813         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13814         `hm.is_disposable' if we're using the collection pattern.
13815         (Foreach.EmitCollectionForeach): Use the correct type for the
13816         enumerator's local variable, only emit the try/finally block if
13817         necessary (fixes #27713).
13818
13819 2002-08-01  Martin Baulig  <martin@gnome.org>
13820
13821         * ecore.cs (Expression.report118): Renamed to Error118 and made
13822         it public static.
13823
13824         * statement.cs (Throw.Resolve): Check whether the expression is of
13825         the correct type (CS0118) and whether the type derives from
13826         System.Exception (CS0155).
13827         (Catch.Resolve): New method.  Do the type lookup here and check
13828         whether it derives from System.Exception (CS0155).
13829         (Catch.CatchType, Catch.IsGeneral): New public properties.
13830
13831         * typemanager.cs (TypeManager.exception_type): Added.
13832
13833 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13834
13835         * driver.cs: Updated About function.
13836
13837 2002-07-31  Martin Baulig  <martin@gnome.org>
13838
13839         Implemented Control Flow Analysis.
13840
13841         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13842         (EmitContext.CurrentBranching): Added.
13843         (EmitContext.StartFlowBranching): Added.
13844         (EmitContext.EndFlowBranching): Added.
13845         (EmitContext.KillFlowBranching): Added.
13846         (EmitContext.IsVariableAssigned): Added.
13847         (EmitContext.SetVariableAssigned): Added.
13848         (EmitContext.IsParameterAssigned): Added.
13849         (EmitContext.SetParameterAssigned): Added.
13850         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13851         Added control flow analysis stuff here.
13852
13853         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13854         resolve the expression as lvalue.
13855         (LocalVariableReference.DoResolve): Check whether the variable has
13856         already been assigned.
13857         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13858         the parameter as assigned here.
13859         (ParameterReference.DoResolve): Check whether the parameter has already
13860         been assigned.
13861         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13862         expression as lvalue.
13863
13864         * statement.cs (FlowBranching): New class for the flow analysis code.
13865         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13866         (LabeledStatement.IsDefined): New public property.
13867         (LabeledStatement.AddUsageVector): New public method to tell flow
13868         analyis that the label may be reached via a forward jump.
13869         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13870         flow analysis.
13871         (VariableInfo.Number): New public field.  This is used by flow analysis
13872         to number all locals of a block.
13873         (Block.CountVariables): New public property.  This is the number of
13874         local variables in this block (including the locals from all parent
13875         blocks).
13876         (Block.EmitMeta): Number all the variables.
13877
13878         * statement.cs: Added flow analysis support to all classes.
13879
13880 2002-07-31  Martin Baulig  <martin@gnome.org>
13881
13882         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13883         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13884         then use this argument.
13885
13886         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13887
13888         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13889         use this to specify /define options.
13890
13891 2002-07-29  Martin Baulig  <martin@gnome.org>
13892
13893         * statement.cs (Fixed): Moved all code that does variable lookups
13894         and resolvings from Emit to Resolve.
13895
13896         * statement.cs (For): Moved all code that does variable lookups
13897         and resolvings from Emit to Resolve.
13898
13899         * statement.cs (Using): Moved all code that does variable lookups
13900         and resolvings from Emit to Resolve.
13901
13902 2002-07-29  Martin Baulig  <martin@gnome.org>
13903
13904         * attribute.cs (Attribute.Resolve): Explicitly catch a
13905         System.NullReferenceException when creating the
13906         CustromAttributeBuilder and report a different warning message.
13907
13908 2002-07-29  Martin Baulig  <martin@gnome.org>
13909
13910         * support.cs (ParameterData.ParameterName): Added method to
13911         get the name of a parameter.
13912
13913         * typemanager.cs (TypeManager.IsValueType): New public method.
13914
13915 2002-07-29  Martin Baulig  <martin@gnome.org>
13916
13917         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13918         is a flag which specifies that it's either ref or out.
13919         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13920         the out parameter to `out Parameter.Modifier mod', also set the
13921         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13922
13923         * support.cs (InternalParameters.ParameterModifier): Distinguish
13924         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13925         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13926
13927         * expression.cs (Argument.GetParameterModifier): Distinguish
13928         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13929         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13930
13931 2002-07-29  Martin Baulig  <martin@gnome.org>
13932
13933         * expression.cs (ParameterReference.ParameterReference): Added
13934         `Location loc' argument to the constructor.
13935
13936         * cs-parser.jay: Pass location to ParameterReference.
13937
13938 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13939
13940         * statement.cs (Try): Initialize the location.
13941
13942         * cs-parser.jay: pass location to Try.
13943
13944         * expression.cs (Unary.Reduce): Change the prototype to return
13945         whether a constant fold could be performed or not.  The result is
13946         returned in an out parameters.  In the case of Indirection and
13947         AddressOf, we want to perform the full tests.
13948
13949 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13950
13951         * statement.cs (Statement.Emit): Flag dead code.
13952
13953 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13954
13955         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13956
13957 2002-07-27  Martin Baulig  <martin@gnome.org>
13958
13959         * class.cs (MethodData.Define): Put back call to
13960         TypeManager.AddMethod(), accidentally commented this out.
13961
13962         * report.cs (Debug): New public method to print debugging information,
13963         this is `[Conditional ("DEBUG")]'.
13964
13965 2002-07-26  Martin Baulig  <martin@gnome.org>
13966
13967         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13968         (switch_statement): Push the current_block to the switch_stack and
13969         pop it again when we're done with the switch.
13970         (switch_section): The new block is a child of the current_block.
13971         Fixes bug #24007, added test-152.cs.
13972
13973 2002-07-27  Martin Baulig  <martin@gnome.org>
13974
13975         * expression.cs (Invocation.EmitArguments): When calling a varargs
13976         function with only its fixed arguments, we need to pass an empty
13977         array.
13978
13979 2002-07-27  Martin Baulig  <martin@gnome.org>
13980
13981         Mono 0.13 has been released.
13982
13983 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13984
13985         * driver.cs: Rename --resource to --linkres, because that is what
13986         we do currently, we dont support --resource yet.
13987
13988         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13989
13990 2002-07-25  Martin Baulig  <martin@gnome.org>
13991
13992         * class.cs (MethodData): New public class.  This is a `method builder'
13993         class for a method or one accessor of a Property/Indexer/Event.
13994         (MethodData.GetMethodFlags): Moved here from MemberBase.
13995         (MethodData.ApplyAttributes): Likewise.
13996         (MethodData.ApplyObsoleteAttribute): Likewise.
13997         (MethodData.ApplyConditionalAttribute): Likewise.
13998         (MethodData.ApplyDllImportAttribute): Likewise.
13999         (MethodData.CheckAbstractAndExternal): Likewise.
14000         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14001         (MethodData.Emit): Formerly known as Method.Emit().
14002         (MemberBase): Moved everything which was specific to a single
14003         accessor/method to MethodData.
14004         (Method): Create a new MethodData and call Define() and Emit() on it.
14005         (Property, Indexer, Event): Create a new MethodData objects for each
14006         accessor and call Define() and Emit() on them.
14007
14008 2002-07-25  Martin Baulig  <martin@gnome.org>
14009
14010         Made MethodCore derive from MemberBase to reuse the code from there.
14011         MemberBase now also checks for attributes.
14012
14013         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14014         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14015         as virtual.
14016         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14017         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14018         (MemberBase.ApplyAttributes): New virtual method; applies the
14019         attributes to a method or accessor.
14020         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14021         (MemberBase.ApplyConditionalAttribute): Likewise.
14022         (MemberBase.ApplyDllImportAttribute): Likewise.
14023         (MemberBase.CheckAbstractAndExternal): Likewise.
14024         (MethodCore.ParameterTypes): This is now a property instead of a
14025         method, it's initialized from DoDefineParameters().
14026         (MethodCore.ParameterInfo): Removed the set accessor.
14027         (MethodCore.DoDefineParameters): New protected virtual method to
14028         initialize ParameterTypes and ParameterInfo.
14029         (Method.GetReturnType): We can now simply return the MemberType.
14030         (Method.GetMethodFlags): Override the MemberBase version and add
14031         the conditional flags.
14032         (Method.CheckBase): Moved some code from Define() here, call
14033         DoDefineParameters() here.
14034         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14035         here to avoid some larger code duplication.
14036         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14037         ensure that abstract and external accessors don't declare a body.
14038
14039         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14040         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14041         lookup in the attribute's parent classes, so we need to abort as soon
14042         as we found the first match.
14043         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14044         the attribute has no arguments.
14045
14046         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14047         of a Method.
14048
14049 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14050
14051         * cs-parser.jay: reverted previous patch.
14052
14053 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14054
14055         * cs-parser.jay: fixed bug #22119.
14056
14057 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14058
14059         * attribute.cs: fixed compilation. The error was:
14060         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14061         be assigned to before control leaves the current method."
14062         [FIXME:  Filed as bug #28186: MCS must report this error.]
14063
14064 2002-07-25  Martin Baulig  <martin@gnome.org>
14065
14066         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14067         method to pull the condition name ouf of a Conditional attribute.
14068         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14069         the obsolete message and error flag out of an Obsolete attribute.
14070
14071         * class.cs (Method.GetMethodFlags): New public method to get the
14072         TypeManager.MethodFlags for this method.
14073         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14074         private methods.
14075         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14076         if we're overriding a virtual function, set the new private variable
14077         `parent_method'; call the new TypeManager.AddMethod().
14078
14079         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14080         the MethodBuilder and the Method in a PtrHashtable.
14081         (TypeManager.builder_to_method): Added for this purpose.
14082         (TypeManager.MethodFlags): Added IsObsoleteError.
14083         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14084         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14085         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14086         the message from the attribute.
14087
14088 2002-07-24  Martin Baulig  <martin@gnome.org>
14089
14090         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14091         preprocessor directives, ensure that the argument to #define/#undef is
14092         exactly one identifier and that it's actually an identifier.
14093
14094         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14095         did not work ....
14096
14097 2002-07-24  Martin Baulig  <martin@gnome.org>
14098
14099         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14100         initialize it to TypeManager.object_type in the constructor.
14101         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14102         of the `hm.get_current' method if we're using the collection pattern.
14103         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14104         for the explicit conversion to make it work when we're using the collection
14105         pattern and the `Current' property has a different return type than `object'.
14106         Fixes #27713.
14107
14108 2002-07-24  Martin Baulig  <martin@gnome.org>
14109
14110         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14111         does not match, but don't report any errors.  This method is called in
14112         order for all methods in a MethodGroupExpr until a matching method is
14113         found, so we don't want to bail out if the first method doesn't match.
14114         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14115         matches, report the 123.  Fixes #28070.
14116
14117 2002-07-24  Martin Baulig  <martin@gnome.org>
14118
14119         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14120         TypeManager.TypeToCoreType() to the top of the method so the
14121         following equality checks will work.  Fixes #28107.
14122
14123 2002-07-24  Martin Baulig  <martin@gnome.org>
14124
14125         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14126         operand is of type uint, and the other operand is of type sbyte,
14127         short or int, the operands are converted to type long." -
14128         Actually do what this comment already told us.  Fixes bug #28106,
14129         added test-150.cs.
14130
14131 2002-07-24  Martin Baulig  <martin@gnome.org>
14132
14133         * class.cs (MethodBase): New abstract class.  This is now a base
14134         class for Property, Indexer and Event to avoid some code duplication
14135         in their Define() and DefineMethods() methods.
14136         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14137         generic methods for Define() and DefineMethods().
14138         (FieldBase): Derive from MemberBase, not MemberCore.
14139         (Property): Derive from MemberBase, not MemberCore.
14140         (Property.DefineMethod): Moved all the code from this method to the
14141         new MethodBase.DefineAccessor(), just call it with appropriate
14142         argumetnts.
14143         (Property.Define): Call the new Property.DoDefine(), this does some
14144         sanity checks and we don't need to duplicate the code everywhere.
14145         (Event): Derive from MemberBase, not MemberCore.
14146         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14147         accessors, this will also make them work with interface events.
14148         (Indexer): Derive from MemberBase, not MemberCore.
14149         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14150         (Indexer.Define): Use the new MethodBase functions.
14151
14152         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14153         argument to the constructor.
14154         (Interface.FindMembers): Added support for interface events.
14155         (Interface.PopluateEvent): Implemented.
14156
14157         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14158
14159 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14162         but this is required to check for a method name being the same as
14163         the containing class.  
14164
14165         Handle this now.
14166
14167 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14168
14169         * interface.cs: initialize variable.
14170
14171 2002-07-23  Martin Baulig  <martin@gnome.org>
14172
14173         Implemented the IndexerName attribute in interfaces.
14174
14175         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14176         name if this is an explicit interface implementation.
14177         (Indexer.InterfaceIndexerName): New public variable.  If we're
14178         implementing an interface indexer, this is the IndexerName in that
14179         interface.  Otherwise, it's the IndexerName.
14180         (Indexer.DefineMethod): If we're implementing interface indexer,
14181         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14182         and Pending.ImplementIndexer methods.
14183         (Indexer.Define): Also define the PropertyBuilder if we're
14184         implementing an interface indexer and this is neither an explicit
14185         interface implementation nor do the IndexerName match the one in
14186         the interface.
14187
14188         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14189         If a method is defined here, then we always need to create a proxy
14190         for it.  This is used when implementing interface indexers.
14191         (Pending.IsInterfaceIndexer): New public method.
14192         (Pending.ImplementIndexer): New public method.
14193         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14194         This is used when implementing interface indexers to define a proxy
14195         if necessary.
14196         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14197         define a proxy if necessary.
14198
14199         * interface.cs (Interface.IndexerName): New public variable.
14200         (Interface.PopulateIndexer): Set the IndexerName.
14201         (Interface.DefineIndexers): New private method.  Populate all the
14202         indexers and make sure their IndexerNames match.
14203
14204         * typemanager.cs (IndexerPropertyName): Added support for interface
14205         indexers.
14206
14207 2002-07-22  Martin Baulig  <martin@gnome.org>
14208
14209         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14210         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14211         ret if HasReturnLabel.
14212         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14213         variables.
14214
14215         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14216         and set the ec.LoopBeginTryCatchLevel.
14217         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14218         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14219         the current ec.TryCatchLevel, the branch goes out of an exception
14220         block.  In this case, we need to use Leave and not Br.
14221
14222 2002-07-22  Martin Baulig  <martin@gnome.org>
14223
14224         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14225         block unless the block does not always return or it is contained in
14226         another try { ... } catch { ... } block.  Fixes bug #26506.
14227         Added verify-1.cs to the test suite.
14228
14229 2002-07-22  Martin Baulig  <martin@gnome.org>
14230
14231         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14232         then we do not always return.  Fixes bug #24985.
14233
14234 2002-07-22  Martin Baulig  <martin@gnome.org>
14235
14236         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14237         lookup on a per-class level; ie. walk up the class hierarchy until we
14238         found at least one applicable method, then choose the best among them.
14239         Fixes bug #24463 and test-29.cs.
14240
14241 2002-07-22  Martin Baulig  <martin@gnome.org>
14242
14243         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14244         return types of the methods.  The return type is not part of the
14245         signature and we must not check it to make the `new' modifier work.
14246         Fixes bug #27999, also added test-147.cs.
14247         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14248
14249         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14250         on the method's return type.
14251
14252 2002-07-21  Martin Baulig  <martin@gnome.org>
14253
14254         * assign.cs: Make this work if the rightmost source is a constant and
14255         we need to do an implicit type conversion.  Also adding a few more tests
14256         to test-38.cs which should have caught this.
14257
14258         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14259         target in the makefile for this.  The makefile.gnu is primarily intended
14260         for end-users who don't want to debug the compiler.
14261
14262 2002-07-21  Martin Baulig  <martin@gnome.org>
14263
14264         * assign.cs: Improved the Assign class so it can now handle embedded
14265         assignments (X = Y = Z = something).  As a side-effect this'll now also
14266         consume less local variables.  test-38.cs now passes with MCS, added
14267         a few new test cases to that test.
14268
14269 2002-07-20  Martin Baulig  <martin@gnome.org>
14270
14271         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14272         instructions.  Fixes bug #27977, also added test-146.cs.
14273
14274 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14275
14276         * cs-tokenizer.cs: fixed getHex ().
14277
14278 2002-07-19  Martin Baulig  <martin@gnome.org>
14279
14280         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14281         not Type.GetType() to lookup the array type.  This is needed when
14282         we're constructing an array of a user-defined type.
14283         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14284         single-dimensional arrays, but also for single-dimensial arrays of
14285         type decimal.
14286
14287 2002-07-19  Martin Baulig  <martin@gnome.org>
14288
14289         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14290         this function is called, it's not allowed to share LocalBuilders
14291         among ILGenerators.
14292
14293 2002-07-19  Martin Baulig  <martin@gnome.org>
14294
14295         * expression.cs (Argument.Resolve): Report an error 118 when trying
14296         to pass a type as argument.
14297
14298 2002-07-18  Martin Baulig  <martin@gnome.org>
14299
14300         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14301         Conv_R_Un for the signed `long' type.
14302
14303 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14304
14305         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14306         `expr' for the temporary result, as that will fail if we do
14307         multiple resolves on the same expression.
14308
14309 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14312         ec.TypeContainer for looking up aliases. 
14313
14314         * class.cs (TypeContainer): Remove LookupAlias from here.
14315
14316         * decl.cs (DeclSpace); Move here.
14317
14318 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * class.cs (FindMembers): Only call filter if the constructor
14321         bulider is not null.
14322
14323         Also handle delegates in `NestedTypes' now.  Now we will perform
14324         type lookups using the standard resolution process.  This also
14325         fixes a bug.
14326
14327         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14328         This uses Expressions (the limited kind that can be parsed by the
14329         tree) instead of strings.
14330
14331         * expression.cs (ComposedCast.ToString): Implement, used to flag
14332         errors since now we have to render expressions.
14333
14334         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14335         FormArrayType. 
14336
14337         * ecore.cs (SimpleName.ToString): ditto.
14338
14339         * cs-parser.jay: Instead of using strings to assemble types, use
14340         Expressions to assemble the type (using SimpleName, ComposedCast,
14341         MemberAccess).  This should fix the type lookups in declarations,
14342         because we were using a different code path for this.
14343
14344         * statement.cs (Block.Resolve): Continue processing statements
14345         even when there is an error.
14346
14347 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * class.cs (Event.Define): Also remove the `remove' method from
14350         the list of pending items.
14351
14352         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14353         generate more compact code. 
14354
14355 2002-07-17  Martin Baulig  <martin@gnome.org>
14356
14357         * const.cs (Const.LookupConstantValue): Add support for constant
14358         `unchecked' and `checked' expressions.
14359         Also adding test case test-140.cs for this.
14360
14361 2002-07-17  Martin Baulig  <martin@gnome.org>
14362
14363         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14364         check whether mi.ReturnType implements the IEnumerator interface; the
14365         `==' and the IsAssignableFrom() will fail in this situation.
14366
14367 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14368
14369         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14370         here too.
14371
14372 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14373
14374         * expression.cs: fixed bug #27811.
14375
14376 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14377
14378         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14379         Molaro: when we are a ref, the value already contains a pointer
14380         value, do not take the address of it.
14381
14382 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14383         * removed mb-parser.jay and mb-tokenizer.cs
14384
14385 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14386
14387         * expression.cs: check against the building corlib void type.
14388
14389 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14390
14391         * ecore.cs: fix for valuetype static readonly fields: when 
14392         initializing them, we need their address, not the address of a copy.
14393
14394 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14395
14396         * typemanager.cs: register also enum_type in corlib.
14397
14398 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14399
14400         * class.cs: allow calling this (but not base) initializers in structs.
14401
14402 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14403
14404         * ecore.cs: make sure we compare against the building base types
14405         in GetTypeSize ().
14406
14407 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14408
14409         * typemanager.cs: fix TypeToCoreType() to handle void and object
14410         (corlib gets no more typerefs after this change).
14411
14412 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14413
14414         * expression.cs (ArrayCreation.EmitArrayArguments): use
14415         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14416
14417         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14418         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14419         array indexes, the runtime actually forbids them.
14420
14421         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14422         for array arguments here.
14423
14424         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14425         instead of the default for ValueTypes.
14426
14427         (New.DoEmit): Use IsValueType instead of
14428         IsSubclassOf (value_type)
14429         (New.DoResolve): ditto.
14430         (Invocation.EmitCall): ditto.
14431
14432         * assign.cs (Assign): ditto.
14433
14434         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14435         Statements *are* currently doing part of their resolution during
14436         Emit.  
14437
14438         Expressions do always resolve during resolve, but statements are
14439         only required to propagate resolution to their children.
14440
14441 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14442
14443         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14444
14445         (LoadAssembly): Do not add the dll if it is already specified
14446
14447         (MainDriver): Add the System directory to the link path at the end,
14448         after all the other -L arguments. 
14449
14450         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14451         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14452         ldelem.u1) and using the opposite for sbytes.
14453
14454         This fixes Digger, and we can finally run it.
14455
14456         * driver.cs (UnixParseOption): Move the option parsing here.  
14457         (CSCParseOption): Implement CSC-like parsing of options.
14458
14459         We now support both modes of operation, the old Unix way, and the
14460         new CSC-like way.  This should help those who wanted to make cross
14461         platform makefiles.
14462
14463         The only thing broken is that /r:, /reference: and /lib: are not
14464         implemented, because I want to make those have the same semantics
14465         as the CSC compiler has, and kill once and for all the confussion
14466         around this.   Will be doing this tomorrow.
14467
14468         * statement.cs (Unsafe.Resolve): The state is checked during
14469         resolve, not emit, so we have to set the flags for IsUnsfe here.
14470
14471 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14472
14473         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14474         not catch the Error_ObjectRefRequired in SimpleName (as it is
14475         possible to have a class/instance variable name that later gets
14476         deambiguated), we have to check this here.      
14477
14478 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14479
14480         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14481         make static and put into Expression.
14482
14483         (Event.Define): Register the private field of the event with the 
14484         TypeManager so that GetFieldFromEvent can get at it.
14485
14486         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14487         keep track of the private field associated with an event which
14488         has no accessors.
14489
14490         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14491         private field.
14492
14493         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14494
14495 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14496
14497         * expression.cs (Binary.EmitBranchable): this routine emits the
14498         Binary expression in a branchable context.  This basically means:
14499         we need to branch somewhere, not just get the value on the stack.
14500
14501         This works together with Statement.EmitBoolExpression.
14502
14503         * statement.cs (Statement.EmitBoolExpression): Use
14504         EmitBranchable. 
14505
14506 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14507
14508         * statement.cs (For): Reduce the number of jumps in loops.
14509
14510         (For): Implement loop inversion for the For statement.
14511
14512         (Break): We can be breaking out of a Try/Catch controlled section
14513         (foreach might have an implicit try/catch clause), so we need to
14514         use Leave instead of Br.
14515
14516         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14517         now).  If the instace expression supports IMemoryLocation, we use
14518         the AddressOf method from the IMemoryLocation to extract the
14519         address instead of emitting the instance.
14520
14521         This showed up with `This', as we were emitting the instance
14522         always (Emit) instead of the Address of This.  Particularly
14523         interesting when This is a value type, as we dont want the Emit
14524         effect (which was to load the object).
14525
14526 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14529
14530         * statement.cs (Checked): Set the CheckedState during the resolve
14531         process too, as the ConvCast operations track the checked state on
14532         the resolve process, and not emit.
14533
14534         * cs-parser.jay (namespace_member_declaration): Flag that we have
14535         found a declaration when we do.  This is used to flag error 1529
14536
14537         * driver.cs: Report ok when we display the help only.
14538
14539 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14540
14541         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14542
14543 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14544
14545         * cs-tokenizer.cs (define): We also have to track locally the
14546         defines.  AllDefines is just used for the Conditional Attribute,
14547         but we also need the local defines for the current source code. 
14548
14549 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * statement.cs (While, For, Do): These loops can exit through a
14552         Break statement, use this information to tell whether the
14553         statement is the last piece of code.
14554
14555         (Break): Flag that we break.
14556
14557         * codegen.cs (EmitContexts): New `Breaks' state variable.
14558
14559 2002-07-03  Martin Baulig  <martin@gnome.org>
14560
14561         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14562         modifiers in method declarations in structs.  Otherwise, you won't
14563         be able to override things like Object.Equals().
14564
14565 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14566
14567         * class.cs (Method, Property, Indexer): Do not allow the public
14568         modifier to be used in explicit interface implementations.
14569
14570         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14571         override modifiers in method declarations in structs
14572
14573 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14574
14575         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14576         integer or real overflow, report an error
14577
14578 2002-07-02  Martin Baulig  <martin@gnome.org>
14579
14580         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14581         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14582         to tell the runtime about our newly created System.Object and
14583         System.ValueType types.
14584
14585 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14586
14587         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14588         struct instead of Ldarg/Starg.
14589
14590 2002-07-02  Martin Baulig  <martin@gnome.org>
14591
14592         * expression.cs (Indirection.Indirection): Call
14593         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14594
14595 2002-07-02  Martin Baulig  <martin@gnome.org>
14596
14597         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14598         ValueType, call TypeManager.TypeToCoreType() on it.
14599         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14600         the OpCodes.Newarr argument.
14601
14602 2002-07-02  Martin Baulig  <martin@gnome.org>
14603
14604         * expression.cs (Invocation.EmitCall): When compiling corlib,
14605         replace all calls to the system's System.Array type to calls to
14606         the newly created one.
14607
14608         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14609         System.Array methods.
14610         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14611         from the system's System.Array type which must be replaced.
14612
14613 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14614
14615         * typemanager.cs: load unverifiable_code_ctor so we can build
14616         corlib using the correct type. Avoid using GetTypeCode() with
14617         TypeBuilders.
14618         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14619         TypeManager.object_type to allow building corlib.
14620
14621 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14622
14623         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14624
14625 2002-07-01  Martin Baulig  <martin@gnome.org>
14626
14627         * class.cs: Make the last change actually work, we need to check
14628         whether `ifaces != null' to avoid a crash.
14629
14630 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14631
14632         * class.cs: when we build structs without fields that implement
14633         interfaces, we need to add the interfaces separately, since there is
14634         no API to both set the size and add the interfaces at type creation
14635         time.
14636
14637 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14638
14639         * expression.cs: the dimension arguments to the array constructors
14640         need to be converted if they are a long.
14641
14642 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14643
14644         * class.cs: don't emit ldarg.0 if there is no parent constructor
14645         (fixes showstopper for corlib).
14646
14647 2002-06-29  Martin Baulig  <martin@gnome.org>
14648
14649         MCS now compiles corlib on GNU/Linux :-)
14650
14651         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14652         ie. check for MethodImplOptions.InternalCall.
14653
14654         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14655         and TypeManager.attribute_type are null, so we must explicitly check
14656         whether parent is not null to find out whether it's an attribute type.
14657         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14658         and SetBuilder, not only if the property is neither abstract nor external.
14659         This is necessary to set the MethodImplOptions on the accessor methods.
14660         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14661         SetBuilder, see Property.Emit().
14662
14663         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14664         populate "System.Object", "System.ValueType" and "System.Attribute" since
14665         they've already been populated from BootCorlib_PopulateCoreTypes().
14666
14667 2002-06-29  Martin Baulig  <martin@gnome.org>
14668
14669         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14670         is the NullLiteral, we also need to make sure that target_type is not
14671         an enum type.   
14672
14673 2002-06-29  Martin Baulig  <martin@gnome.org>
14674
14675         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14676         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14677         before calling BootstrapCorlib_ResolveDelegate ().
14678
14679 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14680
14681         * statement.cs: fixed build-breaker. All tests passed ok.
14682
14683 2002-06-27  Martin Baulig  <martin@gnome.org>
14684
14685         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14686         for System.Decimal when compiling corlib.
14687
14688 2002-06-27  Martin Baulig  <martin@gnome.org>
14689
14690         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14691         switch blocks which contain nothing but a default clause.
14692
14693 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14694
14695        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14696
14697 2002-06-27  Martin Baulig  <martin@gnome.org>
14698
14699         * ecore.cs (PropertyExpr.PropertyExpr): Call
14700         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14701
14702         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14703         is already a TypeBuilder.
14704
14705 2002-06-27  Martin Baulig  <martin@gnome.org>
14706
14707         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14708         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14709         the "from an array-type to System.Array" case.  This makes it work
14710         when compiling corlib.
14711
14712 2002-06-27  Martin Baulig  <martin@gnome.org>
14713
14714         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14715         non-static PropertyExpr, set its InstanceExpression.  This makes
14716         the `ICollection.Count' property work in System/Array.cs.
14717
14718 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14719
14720         * driver.cs: Made error handling more consistent.  Errors now
14721         tracked by Report class, so many methods which used to return int
14722         now return void.  Main() now prints success/failure and 
14723         errors/warnings message.
14724
14725         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14726         the magic number return values (123 and 124).  Now, if the
14727         expected error occurs, the compiler exits with success (exit value
14728         0).  If the compilation completes without seeing that particular
14729         error, the compiler exits with failure (exit value 1).  The
14730         makefile in mcs/errors has been changed to handle the new behaviour.
14731
14732         * report.cs: Made 'expected error' number a property and renamed
14733         it from 'Probe' to 'ExpectedError'.
14734
14735         * genericparser.cs: Removed error handling support, since it is
14736         now all done by Report class.
14737
14738         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14739         class, so parse() no longer returns an int.
14740
14741         * namespace.cs: Use Report.Error instead of GenericParser.error
14742
14743 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14744
14745         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14746         TypeContainer.AddOperator): At the front of the list put the
14747         explicit implementations, so they get resolved/defined first. 
14748
14749 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14750
14751         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14752         interface type is implemented by this TypeContainer.  Used during
14753         explicit interface implementation.
14754
14755         (Property.Define, Indexer.Define, Method.Define): Validate that
14756         the given interface in the explicit implementation is one of the
14757         base classes for the containing type.
14758
14759         Also if we are explicitly implementing an interface, but there is
14760         no match in the pending implementation table, report an error.
14761
14762         (Property.Define): Only define the property if we are
14763         not explicitly implementing a property from an interface.  Use the
14764         correct name also for those properties (the same CSC uses,
14765         although that is really not needed).
14766
14767         (Property.Emit): Do not emit attributes for explicitly implemented
14768         properties, as there is no TypeBuilder.
14769
14770         (Indexer.Emit): ditto.
14771
14772         Hiding then means that we do not really *implement* a pending
14773         implementation, which makes code fail.
14774
14775 2002-06-22  Martin Baulig  <martin@gnome.org>
14776
14777         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14778         the return value of Object.GetType().  [FIXME: we need to do this whenever
14779         we get a type back from the reflection library].
14780
14781 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14782
14783         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14784
14785 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14786
14787         * attribute.cs: Return null if we can not look up the type.
14788
14789         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14790         the interface types found.
14791
14792         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14793         interface types found.
14794
14795         * typemanager.cs (GetInterfaces): Make this routine returns alll
14796         the interfaces and work around the lame differences between
14797         System.Type and System.Reflection.Emit.TypeBuilder in the results
14798         result for GetInterfaces.
14799
14800         (ExpandInterfaces): Given an array of interface types, expand and
14801         eliminate repeated ocurrences of an interface.  This expands in
14802         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14803         be IA, IB, IC.
14804
14805 2002-06-21  Martin Baulig  <martin@gnome.org>
14806
14807         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14808         on System.Enum.
14809
14810 2002-06-21  Martin Baulig  <martin@gnome.org>
14811
14812         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14813         and called with one of the core types, return the corresponding typebuilder for
14814         that type.
14815
14816         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14817         element type.
14818
14819 2002-06-21  Martin Baulig  <martin@gnome.org>
14820
14821         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14822         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14823         (Expression.ConvertReferenceExplicit): Likewise.
14824
14825         * expression.cs (ElementAccess.DoResolve): Likewise.
14826         (ElementAccess.DoResolveLValue): Likewise.
14827
14828 2002-06-10  Martin Baulig  <martin@gnome.org>
14829
14830         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14831         add the "value" parameter to the parameter list.
14832
14833         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14834         to our caller.
14835
14836 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14837
14838         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14839         the argument to an int, uint, long or ulong, per the spec.  Also
14840         catch negative constants in array creation.
14841
14842 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14843
14844         * class.cs: do not allow the same interface to appear twice in
14845         the definition list.
14846
14847 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14848
14849         * ecore.cs: don't use ldlen with System.Array.
14850
14851 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14852
14853         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14854
14855 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14856
14857         * modifiers.cs: produce correct field attributes for protected
14858         internal. Easy fix so miguel can work on ther harder stuff:-)
14859
14860 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14861
14862         * pending.cs: New file.  Move the code from class.cs here.
14863         Support clearning the pending flag for all methods (when not doing
14864         explicit interface implementation).
14865
14866 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14867
14868         * rootcontext.cs: added a couple more types needed to bootstrap.
14869
14870 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14871
14872         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14873         constructor in the type, instead of any constructor in the type
14874         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14875         a bug in the Mono runtime when applying the params attribute). 
14876
14877 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14878         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14879
14880 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14881
14882         * expression.cs (Unary.ResolveOperator): Use TypeManager
14883         to resolve the type.
14884
14885 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14886
14887         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14888         attached.
14889
14890         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14891         with each member too.
14892
14893         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14894         field builders too - this takes care of the enum member case.
14895
14896 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14897
14898         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14899         address-of operator on both value types and pointers.
14900
14901 2002-06-10  Martin Baulig  <martin@gnome.org>
14902
14903         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14904         PropertyBuilder to the `property_builders' list.
14905
14906         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14907         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14908         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14909         find any indexers which are inherited from an interface.
14910
14911 2002-06-09  Martin Baulig  <martin@gnome.org>
14912
14913         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14914         the same type as the constant if necessary.  There's also a test-130.cs
14915         for this.
14916
14917         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14918
14919         * typemanager.cs (TypeManager.ChangeType): Previously known as
14920         Enum.ChangeEnumType().
14921
14922 2002-06-09  Martin Baulig  <martin@gnome.org>
14923
14924         * expression.cs (Cast.TryReduce): Added support for consts.
14925
14926 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14927
14928         * class.cs (Accessor): Hold attributes information so we can pass
14929         it along.
14930
14931         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14932         Modify to pass in attributes attached to the methods.
14933
14934         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14935
14936         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14937         to handle the Accessor kind :-)
14938
14939         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14940
14941 2002-06-08  Martin Baulig  <martin@gnome.org>
14942
14943         * expression.cs (Unary.TryReduceNegative): Added support for
14944         ULongConstants.
14945
14946 2002-06-08  Martin Baulig  <martin@gnome.org>
14947
14948         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14949         name can't be found in the `defined_names' - the caller will do a
14950         MemberLookup in this case and thus find methods in System.Enum
14951         such as Enum.IsDefined().
14952
14953 2002-06-08  Martin Baulig  <martin@gnome.org>
14954
14955         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14956         Convert.ChangeType() which works with TypeBuilder created types.
14957         (Enum.LookupEnumValue, Enum.Define): Use it here.
14958
14959         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14960         `TypeBuilder.BaseType != null' check.
14961         (TypeContainer.FindMembers): Only lookup parent members if we
14962         actually have a parent.
14963         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14964         (ConstructorInitializer.Resolve): Likewise.
14965
14966         * interface.cs (Interface.FindMembers): Added
14967         `TypeBuilder.BaseType != null' check.
14968
14969         * rootcontext.cs (RootContext.ResolveCore): Added
14970         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14971         classes_second_stage.
14972
14973         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14974         debug_type and trace_type when compiling with --nostdlib.       
14975
14976 2002-06-07  Martin Baulig  <martin@gnome.org>
14977
14978         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14979         (AddField): Set it to true when adding a non-static field.
14980         (DefineType): Use `have_nonstatic_fields' to find out whether we
14981         have non-static fields, not `Fields != null'.
14982
14983 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14986         dereferencing a null on the static-field code path)
14987
14988 2002-05-30  Martin Baulig  <martin@gnome.org>
14989
14990         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14991         to take command line arguments.  Use reflection to call the new
14992         custom `Initialize' function on the symbol writer and pass it the
14993         command line arguments.
14994
14995         * driver.cs (--debug-args): New command line argument to pass command
14996         line arguments to the symbol writer.
14997
14998 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14999
15000         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15001         the target type for indexers and properties.  Thanks to Joe for
15002         catching this.
15003
15004 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15005
15006         * typemanager.cs (MethodFlags): returns the method flags
15007         (Obsolete/ShouldIgnore) that control warning emission and whether
15008         the invocation should be made, or ignored. 
15009
15010         * expression.cs (Invocation.Emit): Remove previous hack, we should
15011         not do this on matching a base type, we should do this based on an attribute
15012
15013         Only emit calls to System.Diagnostics.Debug and
15014         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15015         on the command line.
15016
15017         * rootcontext.cs: Global settings for tracing and debugging.
15018
15019         * cs-tokenizer.cs (define): New utility function to track
15020         defines.   Set the global settings for TRACE and DEBUG if found.
15021
15022 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15023
15024         * interface.cs (Populate*): Pass in the TypeContainer as well as
15025         the DeclSpace as parameters so that we can create EmitContexts and
15026         then use that to apply attributes etc.
15027
15028         (PopulateMethod, PopulateEvent, PopulateProperty)
15029         (PopulateIndexer): Apply attributes everywhere.
15030
15031         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15032         etc.
15033
15034         (ApplyAttributes): Update accordingly.
15035
15036         We now apply interface attributes for all members too.
15037
15038 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * class.cs (Indexer.Define); Correctly check if we are explicit
15041         implementation (instead of checking the Name for a ".", we
15042         directly look up if the InterfaceType was specified).
15043
15044         Delay the creation of the PropertyBuilder.
15045
15046         Only create the PropertyBuilder if we are not an explicit
15047         interface implementation.   This means that explicit interface
15048         implementation members do not participate in regular function
15049         lookups, and hence fixes another major ambiguity problem in
15050         overload resolution (that was the visible effect).
15051
15052         (DefineMethod): Return whether we are doing an interface
15053         implementation. 
15054
15055         * typemanager.cs: Temporary hack until we get attributes in
15056         interfaces (Ravi is working on that) and we get IndexerName
15057         support in interfaces.
15058
15059         * interface.cs: Register the indexers as properties.
15060
15061         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15062         warning, I have verified that this is a bug in the .NET runtime
15063         (JavaScript suffers of the same problem).
15064
15065         * typemanager.cs (MemberLookup): When looking up members for
15066         interfaces, the parent of an interface is the implicit
15067         System.Object (so we succeed in searches of Object methods in an
15068         interface method invocation.  Example:  IEnumerable x;  x.ToString
15069         ()) 
15070
15071 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * class.cs (Event): Events should also register if they do
15074         implement the methods that an interface requires.
15075
15076         * typemanager.cs (MemberLookup); use the new GetInterfaces
15077         method. 
15078
15079         (GetInterfaces): The code used to lookup interfaces for a type is
15080         used in more than one place, factor it here. 
15081
15082         * driver.cs: Track the errors at the bottom of the file, we kept
15083         on going.
15084
15085         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15086         instance if the method we are calling is static!
15087
15088 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15089
15090         * attribute.cs (ApplyAttributes): Make this function filter out
15091         the IndexerName attribute (as that attribute in reality is never
15092         applied) and return the string constant for the IndexerName
15093         attribute. 
15094
15095         * class.cs (TypeContainer.Emit): Validate that all the indexers
15096         have the same IndexerName attribute, and if so, set the
15097         DefaultName attribute on the class. 
15098
15099         * typemanager.cs: The return value might contain other stuff (not
15100         only methods).  For instance, consider a method with an "Item"
15101         property and an Item method.
15102
15103         * class.cs: If there is a problem with the parameter types,
15104         return. 
15105
15106 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15107
15108         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15109         looks at user defined conversion after making a call to 
15110         StandardConversionExists - we need this for overload resolution.
15111
15112         * expression.cs : Update accordingly the various method calls.
15113
15114         This fixes 2 bugs filed against implicit user defined conversions 
15115
15116 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * statement.cs: Track the result of the assignment.
15119
15120 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * expression.cs (MemberAccess): Improved error reporting for
15123         inaccessible members.
15124
15125 2002-05-22  Martin Baulig  <martin@gnome.org>
15126
15127         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15128         itself with debugging support.
15129
15130 2002-05-22  Martin Baulig  <martin@gnome.org>
15131
15132         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15133         Removed, this isn't needed anymore.
15134
15135 2002-05-20  Martin Baulig  <martin@gnome.org>
15136
15137         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15138         be underlying type for an enum.
15139
15140 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15141
15142         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15143         that splits out the loading of just the core types.
15144
15145         * rootcontext.cs (ResolveCore): Split the struct resolution in
15146         two, so we can load the enumeration underlying types before any
15147         enums are used.
15148
15149         * expression.cs (Is): Bandaid until we fix properly Switch (see
15150         bug #24985 for details).
15151
15152         * typemanager.cs (ImplementsInterface): The hashtable will contain
15153         a null if there are no interfaces implemented.
15154
15155 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * cs-parser.jay (indexer_declarator): It is fine to have array
15158         parameters
15159
15160 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * typemanager.cs: (RegisterBuilder): New function used to register
15163         TypeBuilders that implement interfaces.  Since
15164         TypeBuilder.GetInterfaces (as usual) does not work with lame
15165         Reflection.Emit. 
15166         (AddUserType): register interfaces.
15167
15168         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15169         dealing with TypeBuilder.  Also, arrays are showing up as
15170         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15171         methods can not be invoked on them!
15172
15173         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15174         (ImplicitReferenceConversionExists): Split out from
15175         StandardConversionExists. 
15176
15177         * expression.cs (As): We were only implementing one of the three
15178         cases for the as operator.  We now implement them all.
15179         (Is): Implement the various other cases for Is as well.
15180
15181         * typemanager.cs (CACHE): New define used to control if we want or
15182         not the FindMembers cache.  Seems to have a negative impact on
15183         performance currently
15184
15185         (MemberLookup): Nested types have full acess to
15186         enclosing type members
15187
15188         Remove code that coped with instance/static returns for events, we
15189         now catch this in RealFindMembers.
15190
15191         (RealFindMembers): only perform static lookup if the instance
15192         lookup did not return a type or an event.  
15193
15194 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * assign.cs (CompoundAssign): We pass more semantic information
15197         now to Compound Assignments than we did before: now we have all
15198         the information at hand, and now we resolve the target *before* we
15199         do the expression expansion, which allows the "CacheValue" method
15200         to have the effect we intended (before, a [x] += 1 would generate
15201         two differen ArrayAccess expressions from the ElementAccess,
15202         during the resolution process).
15203
15204         (CompoundAssign.DoResolve): Resolve target and original_source here.
15205
15206 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15207
15208         * expression.cs (ArrayAccess): dropped debugging information. 
15209
15210         * typemanager.cs: Small bug fix: I was always returning i_members,
15211         instead of one of i_members or s_members (depending on which had
15212         the content).
15213
15214         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15215         method is invoked before any code generation takes place, and it
15216         is a mechanism to inform that the expression will be invoked more
15217         than once, and that the method should use temporary values to
15218         avoid having side effects
15219
15220         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15221
15222         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15223         implementation.
15224
15225         * expression.cs (Indirection, ArrayAccess): Add support for
15226         CacheTemporaries in these two bad boys. 
15227
15228         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15229         ldobj or ldind_ref.  
15230         (StoreFromPtr): Handle stobj as well.
15231
15232         * expression.cs (UnaryMutator): Share more code.
15233
15234         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15235         down: I was not tracking the Filter function as well, which
15236         was affecting the results of the cache.
15237
15238 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15239
15240         * attribute.cs: Remove the hack to handle the CharSet property on
15241         StructLayouts. 
15242
15243 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15244
15245         * attribute.cs (DoResolve): More uglyness, we now only try to
15246         resolve the attribute partially, to extract the CharSet
15247         information (only if we are a StructLayout attribute).  Otherwise 
15248
15249         (GetExtraTypeInfo): Add some code to conditionally kill in the
15250         future this.   I am more and more convinced that the .NET
15251         framework has special code to handle the attribute setting on
15252         certain elements.
15253
15254         * expression.cs (IsParamsMethodApplicable): Revert my previous
15255         foreach change here, it was wrong.
15256
15257 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15258
15259         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15260         (pp_expr): do not abort on unknown input, just return.
15261         (eval): abort if there are pending chars.
15262
15263         * attribute.cs (Attribute.Resolve): Positional parameters are
15264         optional.  Deal with that case.
15265
15266         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15267         the Ansi/Unicode/Auto information for the type.
15268
15269         (TypeContainer.DefineType): instantiate the EmitContext here, as
15270         we will be using it during the type definition (to resolve
15271         attributes) and during the emit phase.
15272
15273         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15274         to pull type information out of the attributes
15275
15276         (Attribute.Resolve): track the constructor builder, and allow for
15277         multiple invocations (structs and classes will use this).
15278
15279         * ecore.cs (MemberLookupFinal): new version with all the
15280         parameters customizable.
15281
15282         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15283         constructors.  Return if the result value is null (as the error
15284         would have been flagged already by MemberLookupFinal)
15285
15286         Do not allow instances of abstract classes or interfaces to be
15287         created.
15288
15289         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15290         We have to compare the assembly property here when dealing with
15291         FamANDAssem and Assembly access modifiers, because we might be
15292         creating an assembly from *modules* (that means that we are not
15293         getting TypeBuilders for types defined in other modules that are
15294         part of this assembly).
15295
15296         (Method.Emit): If the method is marked abstract and has a body,
15297         emit an error. 
15298
15299         (TypeContainer.DefineMembers): If both the defined member and the
15300         parent name match are methods, then do not emit any warnings: let
15301         the Method.Define routine take care of flagging warnings.  But if
15302         there is a mismatch (method overrides something else, or method is
15303         overriwritten by something, then emit warning).
15304
15305         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15306         set to null, this means `do not check for the return type on the
15307         signature'. 
15308
15309         (Method.Define): set the return type for the method signature to
15310         null, so that we get methods with the same name and parameters and
15311         different return types.  This is used to flag warning 114 (you are
15312         hiding a method, and you probably want to use the new/override
15313         keywords instead).
15314
15315         * typemanager.cs (MemberLookup): Implemented proper access
15316         control, closing a long standing set of bug reports.  The problem
15317         was that the Framework only has two bits: Public and NonPublic,
15318         and NonPublic includes private and protected methods, but we need
15319         to enforce the FamANDAssem, FamOrAssem and Family. 
15320
15321 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15322
15323         * statement.cs (GotoCase): Return true: Ammounts to giving up
15324         knowledge on whether we return or not, and letting the other case
15325         be responsible for it.
15326
15327 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15328
15329         * driver.cs: Do not load directories for each file processed, only
15330         do it if there is a pattern.
15331
15332         * ecore.cs: Report readonly assigns here as well, as we might have
15333         been resolved only by MemberAccess.
15334
15335         (SimpleName.SimpleNameResolve): Also be useful for LValue
15336         resolution.   We need this to propagate assign to local readonly variables
15337
15338         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15339         do not want to reuse potential criteria memory.
15340
15341         * class.cs (MyEventBuilder): Set reflected_type;
15342
15343         * ecore.cs (Constantify): Added support for constifying bools.
15344
15345         (RootContext.LookupType): Added a cache for values looked up in
15346         the declaration space.
15347
15348         * typemanager.cs (FindMembers): Now is a front-end to
15349         RealFindMembers, and provides a two-level hashtable-based cache to
15350         the request.  
15351
15352         15% performance improvement: from 22.5 to 19.2 seconds.
15353
15354         * expression.cs (IsParamsMethodApplicable): use foreach.
15355         (Invocation.DoResolve): ditto.
15356         (New.DoResolve): ditto.
15357         (ArrayCreation.DoResolve): ditto.
15358
15359         * ecore.cs (FindMostEncompassingType): use foreach.
15360
15361         * delegate.cs (NewDelegate.DoResolve): Use foreach
15362
15363         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15364         (RemoveMethods): use foreach.
15365
15366         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15367         nested foreach statements instead of for, and also break out of
15368         the inner loop once a match is found.
15369
15370         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15371
15372 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15375         we actually unwrap the expression to allow for extra information
15376         to be extracted. 
15377
15378         * expression.cs: Use Shr_Un on unsigned operations. 
15379
15380 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15381
15382         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15383         applicable operators was not being considered correctly. This closes
15384         the bug Miguel reported.
15385
15386 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15387
15388         * attribute.cs: check that the type derives from System.Attribute
15389         and report the correct error in that case (moved the duplicate code to
15390         its own method, too).
15391
15392 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15393
15394         * attribute.cs: lookup attribute type name as the spec says: first the
15395         bare attribute name and then name + "Attribute" (nant compiles with
15396         mcs after this fix).
15397
15398 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15401         Because of the way we parse things, we should try to see if a
15402         UIntConstant can fit in an integer.
15403
15404 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15405
15406         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15407         when we are in an explicit context.
15408
15409         (ConvertReferenceExplicit): When converting from Iface type S to Class
15410         T make sure the rules are implemented as an OR.
15411
15412         * parameter.cs (ParameterType): Make it a property for now although the
15413         purpose really isn't anything immediate.
15414
15415         * expression.cs (Is*Applicable): Do better checking on the parameter type
15416         of a ref/out parameter. The ones from the system assemblies are already 
15417         marked with the correct type so we don't need to do any correction.
15418
15419         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15420         the object type is standard too so include that.
15421
15422 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15423
15424         * ecore.cs (StandardConversionExists): Augment with missing code:
15425         deal with IntConstant, LongConstants and Enumerations.
15426
15427         * assign.cs: Report the error, instead of failing silently
15428
15429         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15430         typecontainer that they are declared, because the
15431         typecontainer/namespace will have the list of using clauses that
15432         need to be applied.
15433
15434         Assembly Attributes were escaping the normal registration
15435         mechanism. 
15436
15437         (EmitCode): Apply attributes within an EmitContext that represents
15438         the container they were declared on.
15439
15440         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15441
15442 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15443
15444         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15445         Revamp completely - make much cleaner as we now operate only
15446         on a set of Types.
15447
15448         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15449         to implement the logic detailed in the spec more correctly.
15450
15451         (UserDefinedConversion): Update accordingly.
15452
15453 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * statement.cs: Return flow analysis information up.
15456
15457         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15458         and the default.
15459
15460         (token): Do not consume an extra character before calling
15461         decimal_digits.
15462
15463 2002-05-06  Piers Haken <piersh@friskit.com>
15464
15465         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15466
15467 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15470         EmitContext during the instance constructor initializer
15471         resolution, to stop access to instance variables.
15472
15473         This is mandated by the spec, last paragraph of the `constructor
15474         initializers' section. 
15475
15476 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15477
15478         * cs-parser.jay, class.cs (Accessor): new class used to represent
15479         an accessor (get or set).  In the past we used `null' to represent
15480         a missing accessor.  But this is ambiguous because there was no
15481         way to tell in abstract indexers/properties if one of them was
15482         specified.
15483
15484         Now there is a way of addressing that.
15485
15486         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15487         instead of FindMembers.
15488
15489         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15490         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15491
15492         * attribute.cs: Treat indexers and properties as the same in terms
15493         of applying attributes
15494
15495         * ecore.cs (FindMostEncompassedType): Use statically initialized
15496         EmptyExpressions()s like we do elsewhere to avoid creating useless
15497         objects (and we take this out of the tight loop).
15498
15499         (GetConversionOperators): Move the code to extract the actual
15500         operators to a separate routine to clean things up.
15501
15502 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15503
15504         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15505         events are always registered FieldBuilders.
15506
15507         * class.cs (FieldBase): New class shared by Fields 
15508
15509         * delegate.cs: If we are a toplevel delegate, use our full name.
15510         If we are a nested delegate, then only use our tail name.
15511
15512 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15513
15514         * expression.cs (IsApplicable): Ensure that we add the "&" to
15515         ref/out types before comparing it with the type of the argument.
15516
15517         (IsParamsMethodApplicable): Ditto.
15518
15519         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15520         silly me ;-)
15521
15522         * delegate.cs : Handle the case when we have more than one applicable
15523         method. Flag an error only when we finish checking all.
15524
15525 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15526
15527         * expression.cs: Add support for boolean static initializers.
15528
15529 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15532
15533         * parameter.cs (ComputeParameterTypes,
15534         ComputeAndDefineParameterTypes): Better error handling: now we
15535         clear the `types' cache if we fail during any of the type lookups.
15536         We also return the status code correctly to our caller
15537
15538         * delegate.cs: If we fail to define a delegate, abort the extra
15539         steps. 
15540
15541         * expression.cs (Binary.ResolveOperator): for
15542         operator==(object,object) and operator !=(object, object) we also
15543         have to verify that there is an implicit conversion from one to
15544         the other.
15545
15546         (ArrayAccess.DoResolve): Array Access can operate on
15547         non-variables. 
15548
15549 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15550
15551         * assign.cs (CompoundAssign): A new class used as a "flag" that
15552         the assignment actually is happening as part of a compound
15553         assignment operator.
15554
15555         During compound assignment, a few new rules exist to enable things
15556         like:
15557
15558         byte b |= 1 + 2
15559
15560         From the spec:
15561
15562         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15563         to the type of x) if y is implicitly convertible to the type of x,
15564         and the operator is a builtin operator and the return type of the
15565         operator is explicitly convertible to the type of x. 
15566
15567         * rootcontext.cs: Reset warning level to 2.  4 catches various
15568         "interesting" features in mcs, we must clean this up at some
15569         point, but currently am trying to kill other bugs ;-)
15570
15571         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15572         in container classes as well.  
15573
15574         * expression.cs (Binary.ResolveOperator): Handle string case
15575         before anything else (as operator overloading does emit an error
15576         before doing anything else).
15577
15578         This code could go away when we move to a table driven model, but
15579         i could not come up with a good plan last night.
15580
15581 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15582
15583         * typemanager.cs (CSharpName): reimplementation using regex.
15584         * class.cs: added null check for fields in Emit
15585         * rootcontext.cs: set warninglevel to 4
15586
15587 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15588
15589         * typemanager.cs (CSharpName): reimplemented with Lupus
15590         suggestion.
15591
15592 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15593
15594         * statement.cs (If): correclty implement Resolve, because we were
15595         not catching sem errors in there.  The same process is needed
15596         everywhere else. 
15597         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15598
15599
15600         (Statement.Warning_DeadCodeFound): Factorize code.
15601         (While): Report dead code here too.
15602
15603         (Statement): Added Resolve virtual method to allow
15604         for resolution split from the emit code.
15605
15606 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * statement.cs (EmitBoolExpression): No longer try to resolve the
15609         expression here.    
15610         (MakeBoolean): New utility function that resolve, implicitly
15611         converts to boolean and tags the expression. 
15612
15613
15614         (If, Do): Implement dead code elimination.
15615         (While): Implement loop inversion
15616
15617         (Do, While, For, If): Resolve the expression prior to calling our
15618         code generation.
15619
15620 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15621
15622         * class.cs:
15623           - added method Report28 (warning: program has more than one entry point)
15624           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15625           - modified method Method.Define, the part at the end of the method
15626
15627         * rootcontext.cs: added static public Location EntryPointLocation;
15628           
15629         * ../errors/cs0028.cs : Add test case for the above warning.              
15630
15631         * typemanager.cs:
15632           - modified method CSharpName to allow arrays of primitive type to
15633             be printed nicely (e.g. instead of System.Int32[][] it now prints
15634             int[][])
15635           - added method CSharpSignature: returns the signature of a method
15636             in string format to be used in reporting errors, warnings, etc.
15637
15638         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15639         with String.Empty.
15640
15641 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15642
15643         * delegate.cs (Define): Fix extremely silly bug where I was
15644         setting the type of the 'object' parameter of the BeginInvoke
15645         method to System.IAsyncResult instead of System.Object ;-)
15646
15647 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15648
15649         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15650         here. 
15651
15652         (Constructor.Emit): return if we fail to initialize the
15653         constructor.  Another door closed!  
15654
15655         * expression.cs (New.DoResolve): Improve error message (from -6 to
15656         1501).  Use DeclaredOnly lookup to find the exact constructor.
15657
15658         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15659         loop.  This is useful.
15660
15661         * cs-parser.jay: Adjust the default parameters so that destructors
15662         have the proper signature.
15663
15664 2002-04-26  Martin Baulig  <martin@gnome.org>
15665
15666         * driver.cs (LoadAssembly): If `assembly' contains any characters
15667         which are only valid in path names and not in assembly names
15668         (currently slash, backslash and point), use Assembly.LoadFrom ()
15669         instead of Assembly.Load () on the `assembly' (before iteration
15670         over the link_paths).
15671
15672 2002-04-26  Martin Baulig  <martin@gnome.org>
15673
15674         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15675
15676 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15677
15678         * class.cs (Property): use the new typemanager.MemberLookup
15679
15680         (TypeContainer.MemberLookup): Implement using the
15681         TypeManager.MemberLookup now. 
15682
15683         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15684         and return MemberInfos, so that these can be used without an
15685         EmitContext (what we had before).
15686
15687 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * expression.cs: Fix the case where the argument to params if the
15690         type of the params.  I omitted handling this before.   Fixed
15691
15692 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15693
15694         * driver.cs: Call BootCorlib_PopulateCoreType
15695
15696         * class.cs (Property.CheckBase): Check for properties only, not
15697         for all members. 
15698
15699         * interface.cs: Temporary hack: try/catch around the
15700         CustomAttributeBuilder, because I am getting an exception that I
15701         do not understand.
15702
15703         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15704         types whose definitions are required to be there (attributes are
15705         defined before standard types).
15706
15707         Compute definitions as we boot the various types, as they are used
15708         immediately (value_type class will need object_type, but if we do
15709         not initialize object_type, we will pass a null, which will let
15710         the runtime pick the System.Object from the existing corlib, which
15711         is not what we want).
15712
15713 2002-04-22  Patrik Torstensson <totte@labs2.com>
15714
15715         * cs-tokenizer.cs: fixed a number of trim() issues.
15716
15717 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15718
15719         * expression.cs (Argument.Type): Ensure that we return the correct
15720         type when we have out or ref parameters [in which case we 
15721         append a "&"].
15722
15723 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15724
15725         * class.cs (Property, Indexer): Allow extern modifier in there. 
15726
15727         * typemanager.cs (InitBaseTypes): Initializes object_type and
15728         value_type, since those will be used early on during the bootstrap
15729         process to compile corlib.
15730
15731         (InitCoreTypes): Move code from here to InitBaseTypes.
15732
15733 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15736         single-dimension arrays as using the ldlen opcode.  
15737
15738         Daniel Lewis discovered this optimization.  
15739
15740         * typemanager.cs: Add signature for System.Array::get_Length
15741
15742 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15743
15744         * statement.cs: report the error when the foreach does not apply to an
15745         array nor a collection.
15746
15747 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15748
15749         * expression.cs: Add implicit conversions to the operator ~.
15750
15751         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15752
15753         * typemanager.cs: Locate the decimal constructor.
15754
15755 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15756
15757         * attribute.cs: use the new property of TypeOf.
15758         * expression.cs: added 'get' property around typearg.
15759
15760         These changes fix a build breaker reported by NickD. Is this the
15761         correct way to fix?  If not, please, revert my changes and make it
15762         work :-).
15763
15764 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15765
15766         * attribute.cs: Add support for typeof in attribute invocations.
15767         I am not sure that this is right though.
15768
15769 2002-04-14  Duncan Mak  <duncan@ximian.com>
15770
15771         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15772         Binary.Operator.Division case.
15773
15774 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15775
15776         * class.cs (DefineType): Ensure that we do a proper check on
15777         attribute types and also register it with the TypeManager.
15778
15779         (TypeContainer.Targets): The default for attribute types is
15780         AttributeTargets.All.
15781
15782         * attribute.cs (ApplyAttributes): Registering the attribute type
15783         is done elsewhere, not when we discover we have a Usage attribute.
15784
15785 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15786
15787         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15788         and get rid of is_delegate parameter.
15789
15790         * everywhere : update.
15791
15792 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15793
15794         * cs-parser.jay (compilation_unit): Revamp completely to use
15795         some new ideas that I got from Rhys' grammar to solve the problems
15796         with assembly level attributes.
15797
15798         (outer_declaration): New grammar production.
15799
15800         (attribute_sections): Add.
15801
15802         (opt_attributes): Base on attribute_sections
15803
15804         (namespace_declaration): Allow opt_attributes to tackle the case
15805         when we have assembly level attributes - we are clever in this
15806         regard now ;-)
15807
15808         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15809         attributes in the non-global context.
15810
15811         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15812         instead of SetGlobalAttributes.
15813
15814         * class.cs, rootcontext.cs : Ensure we define and generate 
15815         attribute types before anything else.
15816
15817         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15818         and flag the new error -20 for the case when the attribute type
15819         does not have valid targets specified. csc does not catch this.
15820
15821         * ../errors/errors.txt : update for error # -20
15822
15823 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15824
15825         * support.cs (InternalParameters.ParameterModifier): Do some null
15826         checking and return sane values.
15827
15828         * class.cs (Method.Define): If we are a PInvoke method, ensure
15829         that we are static and extern. Report error # 601
15830
15831         * ../errors/cs0601.cs : Add test case for the above error.
15832
15833 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15834
15835         * rootcontext.cs (attribute_types): We need to keep type of
15836         all attribute types separately and emit code for them first.
15837
15838         (RegisterAttribute) : Implement.
15839
15840         * class.cs (DefineType): Check if the current Type is a custom
15841         attribute type and register it accordingly.
15842
15843         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15844         adding the first attribute twice and rename to
15845
15846         (SetGlobalAttributes): this.
15847
15848         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15849         lookups.
15850
15851         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15852         if we are processing global arguments. Hmm, I am unsure of this.
15853
15854 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15855
15856         * expression.cs: added static array of strings to avoid calling
15857         Enum.ToString () for Operator in Binary. Significant recover of
15858         performance.
15859
15860 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * class.cs (FindMembers): Allow the Builders of the various
15863         members to be null.  If they are skip them.  This only happens
15864         during the PInvoke declaration.
15865
15866 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15867
15868         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15869         failure, so we do not keep going afterwards.
15870
15871         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15872         wanted to pass `false' as the `is_delegate' argument.  If this is
15873         the case, why not use delegate_type == null to mean `is_delegate =
15874         false' and anything else as is_delegate = true.
15875
15876 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15877
15878         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15879         code for the section, not the beginning of the tests.
15880
15881 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15882
15883         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15884
15885         * expression.cs (Binary): same.  Warn about errors where we have
15886         Enum/Enum in operator + as well.
15887
15888 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15889
15890         * statement.cs:
15891                 - added support for switch(bool)
15892                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15893                 - add TableSwitchEmit() to handle table-based switch statements
15894
15895 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15896
15897         * expression.cs (Invocation.OverloadResolve): Factor out code which
15898         does parameter compatibility checking with arguments so that we can 
15899         re-use the code even from Delegate.VerifyApplicability
15900
15901         (VerifyArgumentsCompat): Move above code here.
15902
15903         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15904         and instead make a call to the above method.
15905
15906 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15907
15908         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15909         We use it to keep track of classes which are attribute types.
15910
15911 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * delegate.cs (Delegate.Define): Correctly define the types in the
15914         presence of fixed and array parameters.
15915
15916         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15917         doing FindMembers.
15918
15919         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15920         include NonPublic after the first iteration.
15921
15922         * class.cs (Indexer.CheckBase): Only check if both parents are
15923         non-null. 
15924
15925         * cs-parser.jay (accessor_body): If empty, set to null.
15926
15927         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15928         same code path here to resolve constants names that we did have in
15929         MemberAccess.DoResolve.  There is too much code duplicated here.
15930
15931 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15934
15935         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15936         to MakeUnionSet.
15937
15938         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15939         tokens, numbers and strings.
15940
15941         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15942         parenthesis.
15943
15944         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15945         asyncronous parameters and the regular parameters.  
15946
15947         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15948         specify the target directory.
15949
15950         * expression.cs: (This.DoResolve): Simplify
15951         (As.Emit): Optimize, do not generate IsInst if the expression is
15952         always of the given type.
15953
15954         (Is.DoResolve): Bug fix, we were reporting both always/never for
15955         the is expression.
15956
15957         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15958         creating too many unnecessary arrays.
15959
15960 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15961
15962         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15963         fields instead of rolling our own initializer.   Takes care of all
15964         implicit conversions, and drops unnecessary static checks/argument.
15965
15966 2002-03-31  Dick Porter  <dick@ximian.com>
15967
15968         * driver.cs: use the GetDirectories() return values properly, and
15969         use "/" as path separator.
15970
15971 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15972
15973         * expression.cs (Unary): Optimize - - expr into expr.
15974         (Binary): Optimize a + (-b) into a -b.
15975
15976         * codegen.cs (CodeGen): Made all methods static.
15977
15978 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15979
15980         * rootcontext.cs: 
15981
15982         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15983         TypeBuilder property.
15984
15985         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15986         instead. 
15987
15988         * tree.cs: Removed the various RecordXXXX, and replaced with a
15989         single RecordDecl.  Removed all the accessor methods, and just
15990         left a single access point Type 
15991
15992         * enum.cs: Rename DefineEnum to DefineType.
15993
15994         * decl.cs: New abstract method `DefineType' used to unify the
15995         Defines for Enumerations, Interfaces, TypeContainers and
15996         Delegates.
15997
15998         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15999         LookupBaseClasses method that used to live in class.cs and
16000         interface.cs here, and renamed to FindType.
16001
16002         * delegate.cs: Implement DefineType.  Take advantage of the
16003         refactored pattern for locating the parent builder without taking
16004         the parent_builder argument (which we know does not work if we are
16005         nested, and triggering a toplevel definition).
16006
16007 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16008
16009         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16010         accessibility of a member has changed during override and report
16011         an error if so.
16012
16013         * class.cs (Method.Define, Property.Define): Only complain on
16014         overrides if the method is private, any other accessibility is
16015         fine (and since we just checked the permission is the same, we are
16016         good to go).
16017
16018         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16019         and elif are processed always.  The other pre-processing
16020         directives are only processed if we are "taking" the path
16021
16022 2002-03-29  Martin Baulig  <martin@gnome.org>
16023
16024         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16025         current location is not Null.
16026
16027         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16028         a separate method so we can profile it.
16029
16030         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16031         `span.Seconds' are just seconds, but no minutes or hours.
16032         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16033
16034 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16035
16036         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16037         Remove the gratuitous set of Final:
16038
16039                                 // If an interface implementation, then we can set Final.
16040                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16041                                     implementing.DeclaringType.IsInterface)
16042                                         flags |= MethodAttributes.Final;
16043
16044         I do not know what I was smoking when I used that.
16045
16046
16047         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16048         step into fixing the name resolution issues for delegates and
16049         unifying the toplevel name resolution.
16050
16051 2002-03-28  Martin Baulig  <martin@gnome.org>
16052
16053         * class.cs (Method.Emit): If we have a symbol writer, call its
16054         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16055         tell it about the current method.
16056
16057         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16058         writer that we're going to emit the first byte of IL code for a new
16059         statement (a new source line).
16060         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16061         EmitContext.Mark() before emitting any code.
16062
16063         * location.cs (SymbolDocument): Return null when we're Null.
16064
16065         * statement.cs (Statement): Moved the `Location loc' variable here.
16066         (Statement.EmitBoolExpression): If we have a symbol writer, call
16067         ec.Mark() before emitting any code to tell it that we're at the
16068         beginning of a new statement.
16069         (StatementExpression): Added `Location' argument to the constructor.
16070         (Block): Added public readonly variable `StartLocation' and public
16071         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16072         (Block): Added constructor which takes a start and end location.
16073         (Block.SetEndLocation): New method. This sets the end location.
16074         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16075         local variables we create.
16076         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16077         each statement and do also mark the begin and end of the block.
16078
16079         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16080         tell it the current lexer.Location, use Location.Null for the end of the
16081         block.
16082         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16083         current block, set its end location using SetEndLocation().
16084         (statement_expression): StatementExpression constructor now takes the
16085         lexer.Location as additional argument.
16086         (for_statement, declare_local_variables): Likewise.
16087         (declare_local_variables): When creating a new implicit block, use the
16088         new Block constructor and pass it the lexer.Location.
16089
16090 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16091
16092         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16093         members also on the parent interfaces recursively.
16094
16095 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16096
16097         * report.cs: Use new formats, since Gonzalo finished the missing
16098         bits. 
16099
16100         * expression.cs (Binary.ResolveOperator): added missing operator|
16101         operator& and operator^ for bool/bool.
16102
16103         * cs-parser.jay: CheckDef now takes a Location argument that is
16104         used to report errors more precisly (instead of reporting the end
16105         of a definition, we try to track something which is a lot closer
16106         to the source of the problem).
16107
16108         * cs-tokenizer.cs: Track global token use, so we can properly flag
16109         the use of #define/#undef after the first token has been seen.
16110
16111         Also, rename the reportXXXX to Error_DescriptiveName
16112
16113         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16114         TypeContainer, so that Enum and Interface can use this too.
16115
16116         * class.cs (TypeContainer.LookupInterfaceOrClass,
16117         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16118         `builder' argument.  Typically this was used to pass the parent
16119         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16120         the definition).  
16121
16122         The problem is that a nested class could trigger the definition of
16123         a toplevel class, and the builder would be obviously wrong in that
16124         case. 
16125
16126         So we drop this argument, and we compute dynamically the
16127         TypeBuilder/ModuleBuilder (the correct information was available
16128         to us anyways from DeclSpace.Parent)
16129
16130         * interface.cs (Interface.DefineInterface): Drop builder
16131         parameter cleanup like class.cs
16132
16133         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16134         like class.cs
16135
16136         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16137         values. 
16138
16139         (Try.Emit): Propagate the returns value from the statement.
16140
16141         (Return.Emit): Even if we are leavning 
16142
16143         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16144
16145         * modifiers.cs: Fix the computation of MethodAttributes flags.
16146
16147 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16148
16149         * driver.cs: allow compilation of files that start with '/'.
16150         Add a default case when checking the argument of --target.
16151
16152 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16153
16154         * interface.cs: Implement the same search algorithm for types in
16155         the interface code.
16156
16157         * delegate.cs: Do not allow multiple definition.
16158
16159         * Recovered ChangeLog that got accidentally amputated
16160
16161         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16162
16163         * rootcontext.cs: Load manually enum to allow core classes to
16164         contain enumerations.
16165
16166         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16167         Update to new static methods in TypeManager.
16168
16169         * typemanager.cs (GetMethod, GetConstructor): Use our
16170         implementation of FindMembers to find the members, since during
16171         corlib compilation, the types are TypeBuilders and GetMethod and
16172         GetConstructor do not work.
16173
16174         Make all methods in TypeManager static.
16175
16176         (InitCodeHelpers): Split the functionality from
16177         the InitCodeTypes function.
16178
16179         * driver.cs: Call InitCodeHelpers after we have populated the
16180         types. 
16181
16182         * cs-parser.jay (delegate_declaration): we did not used to compute
16183         the delegate name correctly for void delegates.
16184
16185 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16186
16187         * rootcontext.cs (RootContext): Init the interface_resolve_order
16188         and type_container_resolve_order always.
16189
16190         (ResolveCore, BootstrapCorlib_ResolveClass,
16191         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16192         compiler when compiling with --nostdlib
16193
16194         * class.cs (TypeContainer.DefineType): Check that our parent is
16195         not null.  This test is most important when we are bootstraping
16196         the core types.
16197
16198         * codegen.cs: Split out the symbol writing code.
16199
16200 2002-03-25  Martin Baulig  <martin@gnome.org>
16201
16202         * driver.cs (-g): Made -g an alias for --debug.
16203
16204 2002-03-24  Martin Baulig  <martin@gnome.org>
16205
16206         * codegen.cs (SymbolWriter): New public variable. Returns the
16207         current symbol writer.
16208         (CodeGen): Added `bool want_debugging_support' argument to the
16209          constructor. If true, tell the ModuleBuild that we want debugging
16210         support and ask it for the ISymbolWriter.
16211         (Save): If we have a symbol writer, call it's Close() method after
16212         saving the assembly.
16213
16214         * driver.c (--debug): New command line argument to create a
16215         debugger information file.
16216
16217         * location.cs (SymbolDocument): New public property. Returns an
16218         ISymbolDocumentWriter object for the current source file or null
16219         if we don't have a symbol writer.
16220
16221 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16222
16223         * driver.cs (LoadAssembly): Correctly return when all the paths
16224         have been tried and not before.
16225
16226         * statement.cs (Switch.Emit): return the actual coverage for this
16227         statement (returns/not-returns)
16228
16229         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16230         switch of the statement if we are the last switch section.  That
16231         kills two problems: try/catch problems (we used to emit an empty
16232         nop at the end) and switch statements where all branches would
16233         return. 
16234
16235 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16236
16237         * driver.cs: Add default assemblies (the equivalent to the
16238         Microsoft CSC.RSP file)
16239
16240         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16241         also update tokens_seen and set it to false.
16242
16243         * driver.cs: Implement --recurse for Mike.
16244
16245         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16246         correctly splitting out the paths.
16247
16248 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16249
16250         * interface.cs (Interface.PopulateProperty): Instead of using
16251         `parent' as the declaration space for the set parameters, use
16252         `this' 
16253
16254         * support.cs (InternalParameters): InternalParameters constructor
16255         takes a DeclSpace instead of a TypeContainer.
16256
16257         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16258         types are being initialized, load the address of it before calling
16259         the function.  
16260
16261         (New): Provide a mechanism to disable the generation of local
16262         value type temporaries when the caller will be providing us with
16263         an address to store it.
16264
16265         (ArrayCreation.EmitDynamicInitializers): Use it.
16266
16267 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16268
16269         * expression.cs (Invocation.EmitArguments): Only probe for array
16270         property if there is more than one argument.  Sorry about that.
16271
16272         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16273         empty param arrays.
16274
16275         * class.cs (Method.LabelParameters): Fix incorrect code path that
16276         prevented the `ParamArrayAttribute' from being applied to the
16277         params attribute.
16278
16279 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16280
16281         * support.cs (ReflectionParameters): Correctly compute whether the
16282         last argument is a params array.  Fixes the problem with
16283         string.Split ('a')
16284
16285         * typemanager.cs: Make the assemblies array always be non-null
16286         (empty, but non-null)
16287
16288         * tree.cs (RecordDecl): New function that abstracts the recording
16289         of names.  This reports error 101, and provides a pointer to the
16290         previous declaration.  Fixes a crash in the compiler.
16291
16292         * cs-parser.jay (constructor_declaration): Update to new grammar,
16293         and provide a constructor_body that can be empty.
16294
16295 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * driver.cs: Add support for --resources.
16298
16299         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16300         Make all types for the various array helper methods be integer.
16301
16302         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16303         CheckState to ConvCast.
16304
16305         (ConvCast): Now it takes a `checked' state argument, to avoid
16306         depending on the emit context for the conversion, and just using
16307         the resolve time setting.
16308
16309         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16310         instead of Invocation.EmitArguments.  We do not emit the original
16311         arguments, instead we emit those which have been converted to
16312         unsigned int expressions.
16313
16314         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16315
16316         * codegen.cs: ditto.
16317
16318         * expression.cs (LocalVariableReference): Drop the use of the
16319         Store function that depended on the variable index.
16320
16321         * statement.cs (VariableInfo): Drop the `Idx' property from this
16322         class, as this is not taking into account the indexes for
16323         temporaries tat we generate during the execution, getting the
16324         indexes wrong.
16325
16326         * class.cs: First emit class initializers, then call the parent
16327         constructor. 
16328
16329         * expression.cs (Binary): Fix opcode emision.
16330         (UnaryMutator.EmitCode): Support checked code generation
16331
16332         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16333         matches for events for both the Static and Instance scans,
16334         pointing to the same element.   Fix that.
16335
16336 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16337
16338         * rootcontext.cs (ResolveTree): Always set the
16339         interface_resolve_order, because nested interfaces will be calling
16340         into us.
16341
16342         * class.cs (GetInterfaceOrClass): Track the same resolution
16343         process used by TypeManager.LookupType.  This fixes the nested
16344         type lookups in class declarations (separate path from
16345         LookupType). 
16346
16347         (TypeContainer.DefineType): Also define nested interfaces.
16348         (TypeContainer.RegisterOrder): New public function used to
16349         register the order in which child interfaces need to be closed.
16350
16351         Nested interfaces need to be closed after their parents have been
16352         created. 
16353
16354         * interface.cs (InterfaceAttr): Put all the logic for computing
16355         the interface attribute here. 
16356
16357         (DefineInterface): Register our interface order with the
16358         RootContext or with the TypeContainer depending on the case.
16359
16360 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * cs-parser.jay: rework foreach statement to work with the new
16363         changes to the policy on SimpleNames.
16364
16365         * report.cs: support Stacktrace on warnings as well.
16366
16367         * makefile: drop --unsafe and /unsafe from the compile.
16368
16369 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16370
16371         * ecore.cs (StandardConversionExists): Modify to take an Expression
16372         as the first parameter. Ensure we do null -> reference type conversion
16373         checking.
16374
16375         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16376         temporary Expression objects.
16377
16378 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16379
16380         * interface.cs: workaround bug in method overloading resolution
16381         (there is already a bugzilla bug for it).
16382
16383 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16384
16385         We could also solve this problem by having a separate path for
16386         performing type lookups, instead of DoResolve, we could have a
16387         ResolveType entry point, and only participating pieces of the
16388         production (simplename, deref, array) would implement this. 
16389
16390         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16391         signal SimpleName to only resolve type names and not attempt to
16392         resolve anything else.
16393
16394         * expression.cs (Cast): Set the flag.
16395
16396         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16397
16398         * class.cs: Only report 108 if there is no `new' modifier.
16399
16400         * cs-parser.jay: rework foreach statement to work with the new
16401         changes to the policy on SimpleNames.
16402
16403         * report.cs: support Stacktrace on warnings as well.
16404
16405         * makefile: drop --unsafe and /unsafe from the compile.
16406
16407 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16410         lookups here, instead of doing that at parse time.  This means
16411         that our grammar will not introduce `LocalVariableReferences' as
16412         expressions at this point.  That solves the problem of code like
16413         this:
16414
16415         class X {
16416            static void Main ()
16417            { int X = 1;
16418             { X x = null }}}
16419
16420         This is only half the fix.  The full fix requires parameters to
16421         also be handled in this way.
16422
16423         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16424         makes the use more obvious of the DeclSpace.  The
16425         ec.TypeContainer.TypeBuilder is now only used to pull the
16426         TypeBuilder for it.
16427
16428         My theory is that I can get rid of the TypeBuilder completely from
16429         the EmitContext, and have typecasts where it is used (from
16430         DeclSpace to where it matters).  
16431
16432         The only pending problem is that the code that implements Aliases
16433         is on TypeContainer, and probably should go in DeclSpace.
16434
16435         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16436         lookups here, instead of doing that at parse time.  This means
16437         that our grammar will not introduce `LocalVariableReferences' as
16438         expressions at this point.  That solves the problem of code like
16439         this:
16440
16441         class X {
16442            static void Main ()
16443            { int X = 1;
16444             { X x = null }}}
16445
16446         This is only half the fix.  The full fix requires parameters to
16447         also be handled in this way.
16448
16449         * class.cs (Property.DefineMethod): When implementing an interface
16450         method, set newslot, when implementing an abstract method, do not
16451         set the flag (before we tried never setting it, or always setting
16452         it, which is the difference).
16453         (Indexer.DefineMethod): same.
16454         (Method.DefineMethod): same.
16455
16456         * ecore.cs: Only set the status used flag if we get back a Field.
16457
16458         * attribute.cs: Temporary hack, so Paolo can keep working.
16459
16460 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16461
16462         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16463         the unmanaged type in the case we have a MarshalAs attribute.
16464
16465         (Resolve): Handle the case when we are parsing the special MarshalAs
16466         attribute [we need to store the unmanaged type to use later]
16467
16468         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16469         MarshalAs Attribute.
16470
16471         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16472         on parameters and accordingly set the marshalling info.
16473
16474 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * class.cs: Optimizing slightly by removing redundant code after
16477         we switched to the `NoTypes' return value.
16478         (Property.DefineMethod): use NoTypes here too.
16479
16480         This fixes the bug I introduced in my last batch of changes.
16481
16482 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16483
16484         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16485
16486         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16487         Enums since those are types too. 
16488
16489         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16490
16491         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16492         thanks to a call during the lookup process.
16493
16494 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16495
16496         * statement.cs (Foreach): Lots of work to accomodate a particular
16497         kind of foreach statement that I had not kept in mind.  It is
16498         possible to have foreachs on classes that provide a GetEnumerator
16499         method that return objects that implement the "pattern" for using
16500         a foreach, there is no need to support GetEnumerator
16501         specifically. 
16502
16503         This is needed to compile nant.
16504
16505         * decl.cs: Only report 114 if the member is not `Finalize' and if
16506         the warning level is at least 2.
16507
16508         * class.cs: Moved the compare function from Method to
16509         MethodSignature. 
16510
16511         (MethodSignature.InheritableMemberSignatureCompare): Add new
16512         filter function that is used to extract inheritable methods from a
16513         class. 
16514
16515         (Method.Define): Use the new `inheritable_method_signature_filter'
16516         delegate
16517
16518         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16519         command. 
16520
16521 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16522
16523         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16524
16525         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16526
16527         * expression.cs: Pass location information to
16528         ConvertImplicitStandard. 
16529
16530         * class.cs: Added debugging code to track return values from
16531         interfaces. 
16532
16533 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16534
16535         * expression.cs (Is.DoResolve): If either side of the `is' is an
16536         interface, do not flag the warning.
16537
16538         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16539         for interfaces
16540
16541         * report.cs: Allow for --fatal to be used with --probe.
16542
16543         * typemanager.cs (NoTypes): Move the definition for the empty Type
16544         array here. 
16545
16546         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16547         properties. 
16548         (TypeContainer.DefineProxy): New function used to proxy to parent
16549         implementations when implementing interfaces.
16550         (TypeContainer.ParentImplements): used to lookup if our parent
16551         implements a public function that is required by an interface.
16552         (TypeContainer.VerifyPendingMethods): Hook this up.
16553
16554         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16555         `modules' and `assemblies' arraylists into arrays.  We only grow
16556         these are the very early start up of the program, so this improves
16557         the speedof LookupType (nicely measured).
16558
16559         * expression.cs (MakeByteBlob): Replaced unsafe code with
16560         BitConverter, as suggested by Paolo.
16561
16562         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16563         folding of string concatenation, but if either side is a string,
16564         and the other is not, then return null, and let the runtime use
16565         the concatenation on the string plus the object (using
16566         `Object.ToString'). 
16567
16568 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16569
16570         Constant Folding has been implemented now.
16571
16572         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16573         the error instead on types that are not supported in one's
16574         complement. 
16575
16576         * constant.cs (Constant and all children): New set of functions to
16577         perform implict and explicit conversions.
16578
16579         * ecore.cs (EnumConstant): Implement the new functions to perform
16580         conversion by proxying to the child expression.
16581
16582         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16583         own separate setting that can not be turned off from the command
16584         line using --unchecked or --checked and is only controlled using
16585         the checked/unchecked statements and expressions.  This setting is
16586         used by the constant folder to flag errors.
16587
16588         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16589         ConstantCheckState as well.   
16590
16591         During Resolve, they also have to flag the state, because the
16592         constant folder runs completely in the Resolve phase.
16593
16594         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16595         well.
16596
16597 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16598
16599         * cfold.cs: New file, this file contains the constant folder.
16600
16601         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16602         argument to track whether we are using the resulting address to
16603         load or store a value and provide better error messages. 
16604
16605         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16606         new AddressOf arguments.
16607
16608         * statement.cs (Foreach.EmitCollectionForeach): Update
16609
16610         * expression.cs (Argument.Emit): Call AddressOf with proper
16611         arguments to track usage.
16612
16613         (New.DoEmit): Call AddressOf with new arguments.
16614
16615         (Unary.Emit): Adjust AddressOf call.
16616
16617 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16618
16619         * cs-parser.jay (member_access): Change the case for pre-defined types
16620         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16621         this suggestion.
16622
16623         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16624         a method body.
16625
16626         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16627         essentially like methods and apply attributes like MethodImplOptions to them too.
16628
16629         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16630         not being null.
16631
16632         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16633         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16634         is the DeclSpace.
16635
16636         * Update code everywhere accordingly.
16637
16638         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16639
16640         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16641
16642 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16643
16644         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16645         try performing lookups against those instead of jumping straight into using
16646         the 'using' clauses.
16647
16648         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16649
16650         (LookupType): Perform lookups in implicit parents too.
16651
16652         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16653         sequence as RootContext.LookupType. 
16654
16655         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16656         the various cases of namespace lookups into this method.
16657
16658 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16659
16660         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16661         in positional arguments)
16662
16663         * class.cs (Operator): Update the AllowedModifiers to contain
16664         extern. 
16665
16666         * cs-parser.jay: Update operator declaration to allow for the
16667         operator body to be empty.
16668
16669         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16670         values. 
16671
16672 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16673
16674         * class.cs (Method.Emit): Label parameters.
16675
16676         * driver.cs: Return 1 or 0 as the program exit code.
16677
16678 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * expression.cs: Special case the `null' object when trying to
16681         auto-compute the type, as anything can be explicitly converted to
16682         that. 
16683
16684         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16685         spotting this Paolo.
16686
16687         (Expression.ImplicitNumericConversion): Perform comparissions of
16688         the type using the underlying type in the case of an enumeration
16689         rather than using the enumeration type for the compare.
16690
16691         Cope with the underlying == type case, which is not possible to
16692         catch before. 
16693
16694         (Expression.ConvertNumericExplicit): Perform comparissions of
16695         the type using the underlying type in the case of an enumeration
16696         rather than using the enumeration type for the compare.
16697
16698         * driver.cs: If the user does not supply an extension, assume .exe
16699
16700         * cs-parser.jay (if_statement): Rewrote so that we can track the
16701         location for the if statement.
16702
16703         * expression.cs (Binary.ConstantFold): Only concat strings when
16704         the operation is "+", not everything ;-)
16705
16706         * statement.cs (Statement.EmitBoolExpression): Take a location
16707         argument. 
16708         (If, While, Do): Track location.
16709
16710         * expression.cs (Binary.ResolveOperator): In the object + string
16711         case, I was missing a call to ConvertImplicit
16712
16713 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16714
16715         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16716         Location arguments. Ensure we use RootContext.LookupType to do our work
16717         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16718
16719         * interface.cs (PopulateMethod): Handle the type of the parameter being
16720         null gracefully.
16721
16722         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16723         have a params method with no fixed arguments and a call is made with no
16724         arguments.
16725
16726 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16727
16728         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16729         the verbatim-string-literal
16730
16731         * support.cs (InternalParameters.ParameterModifier): handle null
16732         fixed parameters.
16733         (InternalParameters.ParameterType): ditto.
16734
16735         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16736         duplicating the name of the variable parameter.
16737         (GetParameterByName): Fix bug where we were not looking up array
16738         paramters if they were the only present (thanks Paolo!).
16739         (GetParameterInfo): We only have an empty set of types if both
16740         fixed and array are set to null.
16741         (GetParameterInfo-idx): Handle FixedParameter == null
16742
16743         * cs-parser.jay: Handle the case where there is no catch
16744         statements (missing null test).
16745
16746 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16747
16748         * driver.cs (MainDriver): Be conservative on our command line
16749         handling.
16750
16751         Catch DirectoryNotFoundException when calling GetFiles.
16752
16753         (SplitPathAndPattern): Used to split the input specification into
16754         a path and a pattern that we can feed to Directory.GetFiles.
16755
16756 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16757
16758         * statement.cs (Fixed): Implement the last case of the Fixed
16759         statement (string handling).
16760
16761         * expression.cs (StringPtr): New class used to return a char * to
16762         a string;  Used by the Fixed statement.
16763
16764         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16765
16766         * expression.cs (Binary.ResolveOperator): Remove redundant
16767         MemberLookup pn parent type.
16768         Optimize union call, we do not need a union if the types are the same.
16769         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16770         type.
16771
16772         Specialize the use of MemberLookup everywhere, instead of using
16773         the default settings. 
16774
16775         (StackAlloc): Implement stackalloc keyword.
16776
16777         * cs-parser.jay: Add rule to parse stackalloc.
16778
16779         * driver.cs: Handle /h, /help, /?
16780
16781         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16782         before we supported unsafe code.
16783
16784         * makefile: add --unsafe to the self compilation of mcs.
16785
16786 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * expression.cs (PointerArithmetic): New class that is used to
16789         perform pointer arithmetic.
16790         (Binary.Resolve): Handle pointer arithmetic
16791         Handle pointer comparission.
16792         (ArrayPtr): Utility expression class that is used to take the
16793         address of an array.
16794
16795         (ElementAccess): Implement array access for pointers
16796
16797         * statement.cs (Fixed): Implement fixed statement for arrays, we
16798         are missing one more case before we are done.
16799
16800         * expression.cs (Indirection): Implement EmitAssign and set the
16801         ExprClass to Variable.  This allows pointer dereferences to be
16802         treated as variables, and to have values assigned to them.
16803
16804         * ecore.cs (Expression.StoreFromPtr): New utility function to
16805         store values dereferencing.
16806
16807 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16808
16809         * expression.cs (Binary.ResolveOperator): Ensure that we are
16810         not trying to operate on a void type - this fixes the reported
16811         bug.
16812
16813         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16814         the parent implementation is sealed.
16815
16816         * ../errors/cs0239.cs : Add.
16817
16818         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16819
16820         * typemanager.cs (unverifiable_code_type): Corresponds to 
16821         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16822         which have unsafe code in them.
16823
16824         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16825         unsafe context.
16826
16827 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16828
16829         * cs-tokenizer.cs: Add support for @"litreal strings"
16830
16831         Make tokenizer accept pre-processor directives
16832         on any column (remove the old C-like limitation). 
16833
16834         * rootcontext.cs (EmitCode): Emit any global attributes.
16835         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16836
16837         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16838
16839         * cs-parser.jay: Add support for global attributes.  
16840
16841 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16842
16843         * expression.cs (Indirection): New helper class.  Unary will
16844         create Indirection classes to be able to implement the
16845         IMemoryLocation interface on it.
16846
16847 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16848
16849         * cs-parser.jay (fixed_statement): reference the right statement.
16850
16851         * statement.cs (Fixed.Emit): Finish implementing the fixed
16852         statement for the &x case.
16853
16854 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16855
16856         * class.cs (Property.Define, Method.Define): Remove newslot when
16857         `implementing'.  
16858
16859         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16860         wrong.  NewSlot should only be used if the `new' keyword is present.
16861
16862         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16863         locating our system dir.  Sorry about this.
16864
16865 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16866
16867         * driver.cs (GetSystemDir): Compute correctly the location of our
16868         system assemblies.  I was using the compiler directory instead of
16869         the library directory.
16870
16871 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16872
16873         * expression.cs (BetterFunction): Put back in what Miguel commented out
16874         since it is the correct fix. The problem is elsewhere ;-)
16875
16876         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16877         parameters of the parms method are themselves compatible or not !
16878
16879         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16880         to check that a class implements an interface before saying that an implicit
16881         conversion was allowed. Use ImplementsInterface to do the checking.
16882
16883 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16884
16885         * class.cs (Method.Define): Track whether we are an explicit
16886         implementation or not.  And only call DefineMethodOverride if we
16887         are an explicit implementation.
16888
16889         (Property.DefineMethod): Ditto.
16890
16891 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16892
16893         * expression.cs (BetterFunction): Catch hideous bug which was
16894          preventing us from detecting ambiguous calls due to implicit casts i.e
16895         cs0121.
16896
16897 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16898
16899         * support.cs (Pair): Remove un-needed method.  I figured why I was
16900         getting the error in cs-parser.jay, the variable in a foreach loop
16901         is readonly, and the compiler does not really treat this as a variable.
16902
16903         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16904         instead of EQUALS in grammar.  
16905
16906         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16907
16908         * expression.cs (Unary.DoResolve): Check whether the argument is
16909         managed or not.
16910
16911 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * support.cs: Api for Pair to set a value.  Despite the fact that
16914         the variables are public the MS C# compiler refuses to compile
16915         code that accesses the field if the variable is part of a foreach
16916         statement. 
16917
16918         * statement.cs (Fixed): Begin implementation of the fixed
16919         statement.
16920
16921         (Block.AddVariable): Return the VariableInfo on success and null
16922         on failure instead of true/false. 
16923
16924         * cs-parser.jay (foreach): Catch errors on variables already
16925         defined (we were ignoring this value before) and properly unwind
16926         the block hierarchy
16927
16928         (fixed_statement): grammar for the fixed statement.
16929
16930 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16931
16932         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16933         pointer types to be incretemented.
16934
16935         (SizeOf): Implement.
16936
16937         * cs-parser.jay (pointer_member_access): Implement
16938         expr->IDENTIFIER production.
16939
16940         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16941         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16942         on safe contexts.
16943
16944         (Unary): Implement indirection.
16945
16946         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16947         use in non-unsafe context).
16948
16949         (SimpleName.DoResolve): Check for pointers in field access on safe
16950         contexts. 
16951
16952         (Expression.LoadFromPtr): Factor the load-indirect code in this
16953         function.  This was duplicated in UnboxCast and ParameterReference
16954
16955 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16956
16957         * expression.cs (ComposedCast): report an error if a pointer cast
16958         is used in a safe region.
16959
16960         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16961         pointer type casts in unsafe context.
16962
16963         * codegen.cs (EmitContext): Set up IsUnsafe.
16964
16965         * cs-parser.jay (non_expression_type): Add productions for pointer
16966         casts. 
16967
16968         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16969         code.  We should not use force into static mode if the method is
16970         not virtual.  Fixes bug in MIS
16971
16972         * statement.cs (Do.Emit, While.Emit, For.Emit,
16973         Statement.EmitBoolExpression): Add support to Do and While to
16974         propagate infinite loop as `I do return' semantics.
16975
16976         Improve the For case to also test for boolean constants.
16977
16978         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16979         to the list of attributes we can add.
16980
16981         Remove `EmitContext' argument.
16982
16983         * class.cs (Method.Define): Apply parameter attributes.
16984         (Constructor.Define): Apply parameter attributes.
16985         (MethodCore.LabelParameters): Move here the core of labeling
16986         parameters. 
16987
16988         * support.cs (ReflectionParameters.ParameterModifier,
16989         InternalParameters.ParameterModifier): Use IsByRef on the type and
16990         only return the OUT bit for these parameters instead of in/out/ref
16991         flags.
16992
16993         This is because I miss-understood things.  The ParameterInfo.IsIn
16994         and IsOut represent whether the parameter has the [In] and [Out]
16995         attributes set.  
16996
16997 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * ecore.cs (FieldExpr.Emit): Release temporaries.
17000
17001         * assign.cs (LocalTemporary.Release): new function.
17002
17003         * codegen.cs (EmitContext.GetTemporaryStorage,
17004         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17005         temporary storage.  Now we can "put back" localbuilders when we
17006         are done with them
17007
17008 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17011         need to make a copy of the variable to generate verifiable code.
17012
17013 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * driver.cs: Compute dynamically the system directory.
17016
17017         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17018         Slower, but more generally useful.  Used by the abstract
17019         registering implementation. 
17020
17021         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17022         the rules for the special rule on Type/instances.  First check if
17023         we have the same name, and if so, try that special static path
17024         rather than the instance path.
17025
17026 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17027
17028         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17029         for, while and if.
17030
17031         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17032         Enum, ValueType, Delegate or Array for non-corlib compiles.
17033
17034         * cs-tokenizer.cs: Catch long identifiers (645)
17035
17036         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17037         piece of code.
17038
17039         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17040         fix, we were returning too early, so we were not registering
17041         pending methods from abstract classes.
17042
17043         Do not register pending methods if the class is abstract.
17044
17045         * expression.cs (Conditional.DoResolve): Report circular implicit
17046         conversions when we neecd to compute it for conditional
17047         expressions. 
17048
17049         (Is.DoResolve): If the expression is always of the provided type,
17050         flag warning 183.  If the expression can not ever be of the
17051         provided type flag warning 184.
17052
17053         * class.cs: Catch 169 as well.
17054
17055         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17056         read. 
17057
17058 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17059
17060         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17061
17062 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17063
17064         * interface.cs: (PopulateMethod): Check for pointers being defined
17065         only if the unsafe context is active.
17066         (PopulateProperty): ditto.
17067         (PopulateIndexer): ditto.
17068
17069         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17070         specified.  If pointers are present, make sure that they are
17071         present in an unsafe context.
17072         (Constructor, Constructor.Define): ditto.
17073         (Field, Field.Define): ditto.
17074         (Property, Property.Define): ditto.
17075         (Event, Event.Define): ditto.
17076
17077         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17078         hashtable if there are classes or structs defined.
17079
17080         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17081         code, as the constant resolution moved.
17082
17083         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17084         the metadata, so we can flag error 133. 
17085
17086         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17087         pointer is being declared in an unsafe context.
17088
17089 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17090
17091         * modifiers.cs (Modifiers.Check): Require a Location argument.
17092         Report error 227 for Unsafe use.
17093
17094         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17095
17096         * statement.cs (For.Emit): If the test is null, then report that
17097         we do `return', as we wont reach anything afterwards.
17098
17099         (Switch.SwitchGoverningType): Track the expression that matched
17100         the conversion.
17101
17102         * driver.cs: Allow negative numbers as an error code to flag.
17103
17104         * cs-parser.jay: Handle 1551.
17105
17106         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17107
17108 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17109
17110         * cs-parser.jay: Report 1518 (type declaration can only contain
17111         class, struct, interface, enum or delegate)
17112
17113         (switch_label): Report 1523 (keywords `case' or `default' must
17114         preced code)
17115
17116         (opt_switch_sections): Report 1522 (empty switch)
17117
17118         * driver.cs: Report 1515 (response file specified multiple times)
17119         Report 1516 (Source file specified multiple times).
17120
17121         * expression.cs (Argument.Resolve): Signal 1510
17122
17123         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17124         access not allowed in static code)
17125
17126 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17127
17128         * typemanager.cs (IsPointerType): Utility method which we are going
17129         to need a lot.
17130
17131         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17132         the object type, so we take care of that.
17133
17134         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17135
17136         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17137         added to non-params parameters :-)
17138
17139         * typemanager.cs (CSharpName): Include 'void' type too. 
17140
17141         (void_ptr_type): Include in the set of core types.
17142
17143         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17144         duplicating code.
17145
17146         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17147         an unsafe context.
17148
17149         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17150         completely forgotten about it.
17151
17152 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17153
17154         * cs-parser.jay (pointer_type): Add. This begins our implementation
17155         of parsing rules for unsafe code.
17156
17157         (unsafe_statement): Implement.
17158
17159         (embedded_statement): Modify to include the above.
17160
17161         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17162
17163         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17164         if the current context is an unsafe one.
17165
17166         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17167         are handled differently, we need separate rules for them.
17168
17169         (local_variable_declaration): Update to use local_variable_pointer_type
17170         to allow variable declarations of unmanaged pointer types.
17171
17172         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17173         in unsafe contexts.
17174
17175         * ../errors/cs0214.cs : Add.
17176
17177 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17178
17179         * makefile: remove 'response' file when cleaning.
17180
17181 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * cs-parser.jay: Report 1524.
17184
17185 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17186
17187         * typemanager.cs (RegisterMethod): drop checking if we have
17188         registered this from here
17189
17190 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17191
17192         * class.cs (Method.EmitDestructor): Implement calling our base
17193         destructor. 
17194
17195         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17196         value of InFinally.
17197
17198         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17199         this routine and will wrap the call in a try/catch block.  Deal
17200         with the case.
17201
17202 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17203
17204         * ecore.cs (Expression.MemberLookup): instead of taking a
17205         parameter `same_type' that was used to tell whether we could
17206         access private members we compute our containing type from the
17207         EmitContext.
17208
17209         (FieldExpr): Added partial support for volatile fields.  This does
17210         not work for volatile fields exposed from assemblies, as I can not
17211         figure out how to extract the modreq from it.
17212
17213         Updated all the source files to use this.
17214
17215         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17216         because it is referenced by MemberLookup very often. 
17217
17218 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17219
17220         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17221         TypeBuilder.GetCustomAttributes to retrieve what we need.
17222
17223         Get rid of redundant default_member_attr_type as this is the same as
17224         default_member_type which already exists.
17225
17226         * interface.cs, attribute.cs : Update accordingly.
17227
17228 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17231         work for TYpeBuilders though.  Ravi, can you please fix this?
17232
17233         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17234
17235         * expression.cs (Argument.Emit): Handle the case of ref objects
17236         being passed to ref functions;  
17237
17238         (ParameterReference.EmitLoad): Loads the content of the pointer
17239         without dereferencing.
17240
17241 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17242
17243         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17244
17245 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17246
17247         * class.cs (Indexer.DefineMethod): Incorporate the interface
17248         type in the name of the method if we are doing explicit interface
17249         implementation.
17250
17251         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17252
17253         (BetterConversion): Fix extremely trivial bug where we were referring to
17254         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17255         again !
17256
17257         * ../errors/bug16.cs : Add although we have fixed it.
17258
17259 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17260
17261         * expression.cs (BaseIndexer): Begin implementation.
17262
17263         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17264
17265         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17266         production directly to remove a shift/reduce, and implement
17267         explicit interface implementation.
17268
17269         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17270         after a floating point suffix.
17271
17272         * expression.cs (DoNumericPromotions): Improved the conversion for
17273         uint/uint.  If we have a constant, we avoid doing a typecast to a
17274         larger type.
17275
17276         * class.cs (Indexer): Implement explicit interface implementation
17277         for indexers.
17278
17279 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17280
17281         * class.cs: make the default instance constructor public and hidebysig.
17282
17283 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17284
17285         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17286         so we can call it from elsewhere.
17287
17288         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17289         we emit it internally if the class has a defined indexer; otherwise the user
17290         emits it by decorating the class definition with the DefaultMemberAttribute.
17291
17292         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17293         attribute is not used on a type which defines an indexer.
17294
17295         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17296         character when we skip whitespace.
17297
17298         * ../errors/cs0646.cs : Add.
17299
17300 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17301
17302         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17303         again. 
17304
17305         * makefile: Add practical target `mcs3.exe' which builds the third
17306         generation compiler. 
17307
17308         * expression.cs (New): Fix structures constructor calling.
17309
17310         * class.cs (Property, Method, Indexer): Emit Final flag on the
17311         method if we are an interface implementation and we are not
17312         abstract. 
17313
17314         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17315         whether this property is referencing a `base' method.
17316
17317         * expression.cs (Invocation.EmitCall): take an extra argument:
17318         is_base, this is used to determine whether the `call' or
17319         `callvirt' opcode should be used.
17320
17321
17322         * delegate.cs: update EmitCall.
17323
17324         * class.cs (Method.Define): Set NewSlot for the cases where we are
17325         not implementing an interface method.
17326
17327         (Property.Define): ditto.
17328
17329 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17330
17331         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17332         'r'.  Allows mcs to parse itself fully.
17333
17334 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17335
17336         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17337         of the number of initializers that require the InitializeArray method.
17338
17339         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17340         update the above field where necessary.
17341
17342         (MakeByteBlob): Update accordingly.
17343
17344         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17345         greater than 2.
17346
17347         (EmitDynamicInitializers): Update in accordance with the new optimization.
17348
17349         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17350         same OpCode applies.
17351
17352         * cs-parser.jay : Fix some glaring errors I introduced.
17353
17354 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17355
17356         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17357         so that we can check for name clashes there too.
17358
17359         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17360         for interface indexers.
17361
17362         * interfaces.cs (Define): Emit the default member attribute.
17363
17364         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17365         variable was being referred to while setting the value ;-)
17366
17367 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17370         byte-by-byte information when we know the data is zero.
17371
17372         Make the block always a multiple of 4, because
17373         DefineInitializedData has a bug.
17374
17375         * assign.cs: Fix, we should assign from the temporary, not from
17376         the source. 
17377
17378         * expression.cs (MakeByteBlob): Fix my incorrect code.
17379
17380 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17381
17382         * typemanager.cs (EnumToUnderlying): This function is used to get
17383         the underlying type from an enumeration, because it does not
17384         always work. 
17385
17386         * constant.cs: Use the I4_S form for values between -128 and 127.
17387
17388         * statement.cs (Block.LookupLabel): Looks up a label.
17389         (Block): Drop support for labeled blocks.
17390
17391         (LabeledStatement): New kind of statement that represents a label
17392         only.
17393
17394         (Goto): Finally implement this bad boy.
17395
17396         * cs-parser.jay: Update to reflect new mechanism to implement
17397         labels.
17398
17399 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17400
17401         * codegen.cs (EmitContext.This): a codegen property that keeps the
17402         a single instance of this instead of creating many different this
17403         instances. 
17404
17405         * delegate.cs (Delegate.DoResolve): Update to use the property;
17406
17407         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17408
17409         * expression.cs (BaseAccess.DoResolve): Ditto.
17410
17411 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17412
17413         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17414         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17415
17416         (InitCoreTypes): Update accordingly.
17417
17418         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17419         so we can quickly store the state.
17420
17421         (ApplyAttributes): Set the correct implementation flags
17422         for InternalCall methods.
17423
17424 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17425
17426         * expression.cs (EmitCall): if a method is not virtual, then do
17427         not use callvirt on it.
17428
17429         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17430         user defined stuff) requires the use of stobj, which takes an
17431         address on the stack instead of an array and an index.  So emit
17432         the Ldelema operation for it.
17433
17434         (EmitStoreOpcode): Use stobj for valuetypes.
17435
17436         (UnaryMutator.EmitCode): Use the right 1 value depending on
17437         whether we are dealing with int64/uint64, float or doubles.
17438
17439         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17440         constructors that I implemented last night.
17441
17442         (Constructor.IsDefault): Fix to work properly for static
17443         constructors.
17444
17445         * cs-parser.jay (CheckDef): report method signature errors.
17446         Update error number 103 to be 132.
17447
17448         * decl.cs: New AdditionResult enumeration value: MethodExists.
17449         Although we do this check for methods later on in the semantic
17450         analysis, catching repeated default constructors is so easy that
17451         we catch these here. 
17452
17453         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17454         promotions code.
17455
17456         (ParameterReference.EmitAssign, Emit): handle
17457         bools as bytes.
17458
17459         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17460         (ArrayAccess.EmitStoreOpcode): ditto.
17461
17462         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17463
17464         * expression.cs (MakeByteBlob): Complete all the missing types
17465         (uint, short, ushort, byte, sbyte)
17466
17467         * class.cs: Only init instance field initializers on instance
17468         constructors. 
17469
17470         Rename `constructors' to instance_constructors. 
17471
17472         (TypeContainer.AddConstructor): Only add constructors to the list
17473         if it is not static.
17474
17475         Make sure that we handle default_static_constructor independently
17476         everywhere where we handle instance_constructors
17477
17478 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * class.cs: Do not lookup or create a base initializer for a
17481         static constructor.
17482
17483         (ConstructorInitializer.Resolve): use the proper type to lookup
17484         for constructors.
17485
17486         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17487
17488         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17489         in DeclSpace. 
17490
17491         * decl.cs: CloseType is now an virtual method, the default
17492         implementation just closes this type.
17493
17494 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17495
17496         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17497         to PreserveSig by default. Also emit HideBySig on such methods.
17498
17499         Basically, set the defaults to standard values.
17500
17501         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17502         argument, if candidate is better, it can't be worse than the best !
17503
17504         (Invocation): Re-write bits to differentiate between methods being
17505         applicable in their expanded form and their normal form - for params
17506         methods of course.
17507
17508         Get rid of use_standard everywhere as only standard conversions are allowed
17509         in overload resolution. 
17510
17511         More spec conformance.
17512
17513 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17514
17515         * driver.cs: Add --timestamp, to see where the compiler spends
17516         most of its time.
17517
17518         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17519         `this' in static code.
17520
17521         (SimpleName.DoResolve): Implement in terms of a helper function
17522         that allows static-references to be passed upstream to
17523         MemberAccess.
17524
17525         (Expression.ResolveWithSimpleName): Resolve specially simple
17526         names when called by MemberAccess to implement the special
17527         semantics. 
17528
17529         (Expression.ImplicitReferenceConversion): Handle conversions from
17530         Null to reference types before others, as Null's type is
17531         System.Object. 
17532
17533         * expression.cs (Invocation.EmitCall): Handle the special case of
17534         calling methods declared on a reference type from a ValueType
17535         (Base classes System.Object and System.Enum)
17536
17537         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17538         the left hand side is a TypeExpr, not on every enumeration. 
17539
17540         (Binary.Resolve): If types are reference types, then do a cast to
17541         object on operators != and == of both arguments.
17542
17543         * typemanager.cs (FindMembers): Extract instance and static
17544         members if requested.
17545
17546         * interface.cs (PopulateProperty): Use void_type instead of null
17547         as the return type for the setter method.
17548
17549         (PopulateIndexer): ditto.
17550
17551 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17552
17553         * support.cs (ReflectionParameters): Fix minor bug where we
17554         were examining the wrong parameter for the ParamArray attribute.
17555
17556         Cope with requests for the type of the parameter at position
17557         greater than the params parameter's. We now return the element
17558         type of the params array as that makes more sense.
17559
17560         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17561         accordingly as we no longer have to extract the element type
17562         ourselves.
17563
17564         (Invocation.OverloadResolve): Update.
17565
17566 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17567
17568         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17569         against IEnumerator, test whether the return value is a descendant
17570         of the IEnumerator interface.
17571
17572         * class.cs (Indexer.Define): Use an auxiliary method to implement
17573         the other bits of the method definition.  Begin support for
17574         explicit interface implementation.
17575
17576         (Property.DefineMethod): Use TypeManager.void_type instead of null
17577         for an empty return value.
17578
17579 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17580
17581         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17582         dealing with a FieldExpr which is composed of a FieldBuilder, in
17583         the code path we did extract the constant, but we should have
17584         obtained the underlying value to be able to cast it (otherwise we
17585         end up in an infinite loop, this is what Ravi was running into).
17586
17587         (ArrayCreation.UpdateIndices): Arrays might be empty.
17588
17589         (MemberAccess.ResolveMemberAccess): Add support for section
17590         14.5.4.1 that deals with the special case of E.I when E is a type
17591         and something else, that I can be a reference to a static member.
17592
17593         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17594         handle a particular array type to create byte blobs, it is just
17595         something we dont generate byteblobs for.
17596
17597         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17598         arguments. 
17599
17600         * location.cs (Push): remove the key from the hashtable that we
17601         are about to add.   This happens for empty files.
17602
17603         * driver.cs: Dispose files after we have parsed them.
17604
17605         (tokenize): new function that only runs the tokenizer on its
17606         input, for speed testing.
17607
17608 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17609
17610         * class.cs (Event.Define): Define the private field only if there
17611         are no accessors defined.
17612
17613         * expression.cs (ResolveMemberAccess): If there is no associated
17614         field with the event, that means we have an event defined with its
17615         own accessors and we should flag error cs0070 since transforming
17616         ourselves into a field is not valid in that case.
17617
17618         * ecore.cs (SimpleName.DoResolve): Same as above.
17619
17620         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17621         and charset to sane values.
17622
17623 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17624
17625         * assign.cs (DoResolve): Perform check on events only if they 
17626         are being accessed outside the declaring type.
17627
17628         * cs-parser.jay (event_declarations): Update rules to correctly
17629         set the type of the implicit parameter etc.
17630
17631         (add_accessor, remove_accessor): Set current local parameters.
17632
17633         * expression.cs (Binary): For delegate addition and subtraction,
17634         cast the return value from the method into the appropriate delegate
17635         type.
17636
17637 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17638
17639         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17640         of these as the workaround is unnecessary.
17641
17642         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17643         delegate data - none of that is needed at all.
17644
17645         Re-write bits to extract the instance expression and the delegate method
17646         correctly.
17647
17648         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17649         on delegates too.
17650
17651         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17652         of attaching attributes instead of duplicating code everywhere.
17653
17654         * everywhere : Update code to do attribute emission using the above method.
17655
17656 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17657
17658         * expression.cs (IsParamsMethodApplicable): if there are not
17659         parameters, return immediately.
17660
17661         * ecore.cs: The 0 literal can be implicity converted to an enum
17662         type. 
17663
17664         (SimpleName.DoResolve): First lookup the type, then lookup the
17665         members. 
17666
17667         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17668         want to get its address.  If the InstanceExpression is not
17669         addressable, store the result in a temporary variable, then get
17670         the address of it.
17671
17672         * codegen.cs: Only display 219 errors on warning level or above. 
17673
17674         * expression.cs (ArrayAccess): Make it implement the
17675         IMemoryLocation interface.
17676
17677         (Binary.DoResolve): handle the operator == (object a, object b)
17678         and operator != (object a, object b) without incurring into a
17679         BoxedCast (because 5 != o should never be performed).
17680
17681         Handle binary enumerator operators.
17682
17683         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17684         value type, otherwise use Ldelem_ref.
17685
17686         Use precomputed names;
17687
17688         (AddressOf): Implement address of
17689
17690         * cs-parser.jay (labeled_statement): Fix recursive block
17691         addition by reworking the production.
17692
17693         * expression.cs (New.DoEmit): New has a special case:
17694                 
17695                  If we are dealing with a ValueType, we have a few
17696                  situations to deal with:
17697                 
17698                     * The target of New is a ValueType variable, that is
17699                       easy, we just pass this as the variable reference
17700                 
17701                     * The target of New is being passed as an argument,
17702                       to a boxing operation or a function that takes a
17703                       ValueType.
17704                 
17705                       In this case, we need to create a temporary variable
17706                       that is the argument of New.
17707
17708
17709 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17710
17711         * rootcontext.cs (LookupType): Check that current_type is not null before
17712         going about looking at nested types.
17713
17714         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17715         not implement the IAssignMethod interface any more.
17716
17717         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17718         where we tranform them into FieldExprs if they are being resolved from within
17719         the declaring type.
17720
17721         * ecore.cs (SimpleName.DoResolve): Do the same here.
17722
17723         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17724
17725         * ../errors/bug10.cs : Add.
17726
17727         * ../errors/cs0070.cs : Add.
17728
17729         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17730
17731         * assign.cs : Get rid of EventIsLocal everywhere.
17732
17733 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17734
17735         * ecore.cs (ConvertIntLiteral): finished the implementation.
17736
17737         * statement.cs (SwitchLabel): Convert the value we are using as a
17738         key before looking up the table.
17739
17740 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17741
17742         * codegen.cs (EmitTopBlock): Require a Location argument now.
17743
17744         * cs-parser.jay (constructor_declarator): We need to setup
17745         current_local_parameters before we parse the
17746         opt_constructor_initializer, to allow the variables to be bound
17747         to the constructor arguments.
17748
17749         * rootcontext.cs (LookupType): First lookup nested classes in our
17750         class and our parents before we go looking outside our class.
17751
17752         * expression.cs (ConstantFold): Extract/debox the values at the
17753         beginnning. 
17754
17755         * rootcontext.cs (EmitCode): Resolve the constants first before we
17756         resolve the types.  This is not really needed, but it helps debugging.
17757
17758         * statement.cs: report location.
17759
17760         * cs-parser.jay: pass location to throw statement.
17761
17762         * driver.cs: Small bug fix.
17763
17764         * report.cs: Updated format to be 4-zero filled digits.
17765
17766 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17767
17768         * expression.cs (CheckIndices): Fix minor bug where the wrong
17769         variable was being referred to ;-)
17770
17771         (DoEmit): Do not call EmitStaticInitializers when the 
17772         underlying type is System.Object.
17773
17774 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17775
17776         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17777         and do the usual workaround for SRE.
17778
17779         * class.cs (MyEventBuilder.EventType): New member to get at the type
17780         of the event, quickly.
17781
17782         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17783
17784         * assign.cs (Assign.DoResolve): Handle the case when the target
17785         is an EventExpr and perform the necessary checks.
17786
17787         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17788         interface.
17789
17790         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17791
17792         (EventExpr): Set the type in the constructor itself since we 
17793         are meant to be born fully resolved.
17794
17795         (EventExpr.Define): Revert code I wrote earlier.
17796                 
17797         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17798         instance expression is null. The instance expression is a This in that case
17799         or a null, depending on whether it is a static method or not.
17800
17801         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17802         refers to more than one method.
17803
17804         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17805         and accordingly flag errors.
17806
17807 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17808
17809         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17810
17811 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17812
17813         * location.cs (ToString): Provide useful rutine.
17814
17815 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17816
17817         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17818         objects, return the actual integral boxed.
17819
17820         * statement.cs (SwitchLabel): define an ILLabel for each
17821         SwitchLabel. 
17822
17823         (Switch.CheckSwitch): If the value is a Literal, extract
17824         the underlying literal.
17825
17826         Also in the unused hashtable we had, add the SwitchLabel so we can
17827         quickly look this value up.
17828
17829         * constant.cs: Implement a bunch of new constants.  Rewrite
17830         Literal based on this.  Made changes everywhere to adapt to this.
17831
17832         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17833         dereferencing array only once, and also copes with enumrations.
17834
17835         bytes are two bytes wide, not one.
17836
17837         (Cast): Perform constant conversions.
17838
17839         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17840         wrappers to the literals here.
17841
17842         * expression.cs (DoNumericPromotions): long literals can converted
17843         to ulong implicity (this is taken care of elsewhere, but I was
17844         missing this spot).
17845
17846         * ecore.cs (Expression.Literalize): Make the return type Literal,
17847         to improve type checking.
17848
17849         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17850
17851 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17852
17853         * literal.cs: Revert code from ravi that checked the bounds.  The
17854         bounds are sane by the definition of the type itself. 
17855
17856         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17857         need to actually look up in our parent hierarchy for interfaces
17858         implemented. 
17859
17860         * const.cs: Use the underlying type for enumerations
17861
17862         * delegate.cs: Compute the basename for the delegate creation,
17863         that should fix the delegate test case, and restore the correct
17864         Type Lookup semantics in rootcontext
17865
17866         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17867         referencing a nested type with the Reflection API is using the "+"
17868         sign. 
17869
17870         * cs-parser.jay: Do not require EOF token at the end.
17871
17872 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17873
17874         * rootcontext.cs (LookupType): Concatenate type names with
17875         a '.' instead of a '+' The test suite passes again.
17876
17877         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17878         field of the enumeration.
17879
17880         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17881         the case when the member is an EventExpr.
17882
17883         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17884         static has an associated instance expression.
17885
17886         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17887
17888         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17889
17890         * class.cs (Event.Define): Register event and perform appropriate checks
17891         for error #111.
17892
17893         We define the Add and Remove methods even if the use provides none because
17894         in that case, we provide default implementations ourselves.
17895
17896         Define a private field of the type of the event. This is done by the CSC compiler
17897         and we should be doing it too ;-)
17898
17899         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17900         More methods we use in code we generate.
17901
17902         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17903         is important.
17904
17905         (InitCoreTypes): Update accordingly for the above.
17906
17907         * class.cs (Event.Emit): Generate code for default accessors that we provide
17908
17909         (EmitDefaultMethod): Do the job in the above.
17910
17911         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17912         appropriate place.
17913
17914 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17915
17916         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17917         builders even if we were missing one.
17918
17919         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17920         pass the Basename as our class name instead of the Name.  The
17921         basename will be correctly composed for us.
17922
17923         * parameter.cs (Paramters): Now takes a Location argument.
17924
17925         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17926         make all the code call directly LookupType in RootContext and take
17927         this chance to pass the Location information everywhere.
17928
17929         * Everywhere: pass Location information.
17930
17931 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * class.cs (Constructor.Define): Updated way of detecting the
17934         length of the parameters.
17935
17936         (TypeContainer.DefineType): Use basename as the type name for
17937         nested types.
17938
17939         (TypeContainer.Define): Do not recursively define types here, as
17940         definition is taken care in order by the RootContext.
17941
17942         * tree.cs: Keep track of namespaces in a per-file basis.
17943
17944         * parameter.cs (Parameter.ComputeSignature): Update to use
17945         DeclSpace. 
17946
17947         (Parameters.GetSignature): ditto.
17948
17949         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17950         instead of a TypeContainer.
17951
17952         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17953         resolve names.  Because we need to be resolve in our context, not
17954         our parents.
17955
17956         * driver.cs: Implement response files.
17957
17958         * class.cs (TypeContainer.DefineType): If we are defined, do not
17959         redefine ourselves.
17960
17961         (Event.Emit): Emit the code for add/remove handlers.
17962         (Event.Define): Save the MethodBuilders for add/remove.
17963
17964         * typemanager.cs: Use pair here too.
17965
17966         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17967         DictionaryEntry requires the first argument to be non-null.  
17968
17969         (enum_declaration): Compute full name for registering the
17970         enumeration.
17971
17972         (delegate_declaration): Instead of using
17973         formal_parameter_list, use opt_formal_parameter_list as the list
17974         can be empty.
17975
17976         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17977         (EventParsing): New property that controls whether `add' and
17978         `remove' are returned as tokens or identifiers (for events);
17979
17980 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17981
17982         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17983         use MyEventBuilder only and let it wrap the real builder for us.
17984
17985         (MyEventBuilder): Revamp constructor etc.
17986
17987         Implement all operations that we perform on EventBuilder in precisely the same
17988         way here too.
17989
17990         (FindMembers): Update to use the EventBuilder member.
17991
17992         (Event.Emit): Update accordingly.
17993
17994 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17995
17996         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17997         by calling the appropriate methods.
17998
17999         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18000         useful.
18001
18002         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18003
18004 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18005
18006         * delegate.cs (Delegate.Populate): Check that the return type
18007         and various parameters types are indeed accessible.
18008
18009         * class.cs (Constructor.Define): Same here.
18010
18011         (Field.Define): Ditto.
18012
18013         (Event.Define): Ditto.
18014
18015         (Operator.Define): Check that the underlying Method defined itself
18016         correctly - so it's MethodBuilder should not be null.
18017
18018         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18019         expression happens to be null.
18020
18021         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18022         members but as of now we don't seem to be able to do anything really useful with it.
18023
18024         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18025         not the EventBuilder.
18026
18027 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18028
18029         * cs-tokenizer.cs: Add support for defines.
18030         Add support for #if, #elif, #else, #endif
18031
18032         (eval_var): evaluates a variable.
18033         (eval): stubbed for evaluating functions.
18034
18035         * cs-parser.jay: Pass the defines information
18036
18037         * driver.cs: Add --define command line option.
18038
18039         * decl.cs: Move MemberCore here.
18040
18041         Make it the base class for DeclSpace.  This allows us to catch and
18042         report 108 and 109 for everything now.
18043
18044         * class.cs (TypeContainer.Define): Extract all the members
18045         before populating and emit the warning 108 (new keyword required
18046         to override) instead of having each member implement this.
18047
18048         (MemberCore.Define): New abstract method, we will be using this in
18049         the warning reporting engine in Populate.
18050
18051         (Operator.Define): Adjust to new MemberCore protocol. 
18052
18053         * const.cs (Const): This does not derive from Expression, it is a
18054         temporary object we use to create fields, it is a MemberCore. 
18055
18056         * class.cs (Method.Define): Allow the entry point to be in a
18057         specific class.
18058
18059         * driver.cs: Rewrite the argument handler to clean it up a bit.
18060
18061         * rootcontext.cs: Made it just an auxiliary namespace feature by
18062         making everything static.
18063
18064         * driver.cs: Adapt code to use RootContext type name instead of
18065         instance variable.
18066
18067         * delegate.cs: Remove RootContext argument.
18068
18069         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18070         argument. 
18071
18072         * class.cs (Event.Define): The lookup can fail.
18073
18074         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18075
18076         * expression.cs: Resolve the this instance before invoking the code.
18077
18078 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18079
18080         * cs-parser.jay: Add a production in element_access that allows
18081         the thing to become a "type" reference.  This way we can parse
18082         things like "(string [])" as a type.
18083
18084         Note that this still does not handle the more complex rules of
18085         casts. 
18086
18087
18088         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18089
18090         * ecore.cs: (CopyNewMethods): new utility function used to
18091         assemble the list of methods from running FindMembers.
18092
18093         (MemberLookup): Rework FindMembers so that 
18094
18095 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18096
18097         * class.cs (TypeContainer): Remove Delegates who fail to be
18098         defined.
18099
18100         * delegate.cs (Populate): Verify that we dont get null return
18101         values.   TODO: Check for AsAccessible.
18102
18103         * cs-parser.jay: Use basename to emit error 574 (destructor should
18104         have the same name as container class), not the full name.
18105
18106         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18107         possible representation.  
18108
18109         Also implements integer type suffixes U and L.
18110
18111 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18112
18113         * expression.cs (ArrayCreation.DoResolve): We need to do the
18114         argument resolution *always*.
18115
18116         * decl.cs: Make this hold the namespace.  Hold the root context as
18117         well.
18118         (LookupType): Move here.
18119
18120         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18121
18122         * location.cs (Row, Name): Fixed the code, it was always returning
18123         references to the first file.
18124
18125         * interface.cs: Register properties defined through interfaces.
18126
18127         * driver.cs: Add support for globbing on the command line
18128
18129         * class.cs (Field): Make it derive from MemberCore as well.
18130         (Event): ditto.
18131
18132 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18133
18134         * class.cs (Event::Define): Check that the type of the event is a delegate
18135         type else flag error #66.
18136
18137         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18138         same.
18139
18140         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18141         values of EntryPoint, CharSet etc etc.
18142
18143         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18144
18145         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18146         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18147         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18148         which needs this to do its work.
18149
18150         * ../errors/cs0066.cs : Add.
18151
18152 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18153
18154         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18155         helper functions.
18156
18157         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18158         clears out the parameters field.
18159         (MemberSignatureCompare): Cleanup
18160
18161         (MemberCore): New base class used to share code between MethodCore
18162         and Property.
18163
18164         (RegisterRequiredImplementations) BindingFlags.Public requires
18165         either BindingFlags.Instace or Static.  Use instance here.
18166
18167         (Property): Refactored code to cope better with the full spec.
18168
18169         * parameter.cs (GetParameterInfo): Return an empty array instead
18170         of null on error.
18171
18172         * class.cs (Property): Abstract or extern properties have no bodies.
18173
18174         * parameter.cs (GetParameterInfo): return a zero-sized array.
18175
18176         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18177         method modifier validation to the typecontainer so we can reuse
18178         this on properties.
18179
18180         (MethodCore.ParameterTypes): return an empty sized array of types.
18181
18182         (Property.Define): Test property modifier validity.
18183
18184         Add tests for sealed/override too.
18185
18186         (Method.Emit): abstract or extern methods have no bodies.
18187
18188 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18189
18190         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18191         thing.
18192
18193         (Method::Define, ::Emit): Modify accordingly.
18194
18195         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18196
18197         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18198
18199         * makefile: Pass in /unsafe.
18200
18201 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18202
18203         * class.cs (MakeKey): Kill routine.
18204
18205         * class.cs (TypeContainer.Define): Correctly define explicit
18206         method implementations (they require the full interface name plus
18207         the method name).
18208
18209         * typemanager.cs: Deply the PtrHashtable here and stop using the
18210         lame keys.  Things work so much better.
18211
18212         This of course broke everyone who depended on `RegisterMethod' to
18213         do the `test for existance' test.  This has to be done elsewhere.
18214
18215         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18216         the object stupid Equals method (because, that like fails all over
18217         the place).  We still do not use it.
18218
18219         * class.cs (TypeContainer.SetRequiredInterface,
18220         TypeContainer.RequireMethods): Killed these two routines and moved
18221         all the functionality to RegisterRequiredImplementations.
18222
18223         (TypeContainer.RegisterRequiredImplementations): This routine now
18224         registers all the implementations required in an array for the
18225         interfaces and abstract methods.  We use an array of structures
18226         which can be computed ahead of time to reduce memory usage and we
18227         also assume that lookups are cheap as most classes will not
18228         implement too many interfaces.
18229
18230         We also avoid creating too many MethodSignatures.
18231
18232         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18233         clear the "pending" bit if we find that there are problems with
18234         the declaration.
18235
18236         (TypeContainer.VerifyPendingMethods): Update to report errors of
18237         methods that look like implementations but are not.
18238
18239         (TypeContainer.Define): Add support for explicit interface method
18240         implementation. 
18241
18242 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18243
18244         * typemanager.cs: Keep track of the parameters here instead of
18245         being a feature of the TypeContainer.
18246
18247         * class.cs: Drop the registration of parameters here, as
18248         InterfaceMethods are also interface declarations.
18249
18250         * delegate.cs: Register methods with the TypeManager not only with
18251         the TypeContainer.  This code was buggy.
18252
18253         * interface.cs: Full registation here.
18254
18255 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18256
18257         * expression.cs: Remove reducer for binary expressions, it can not
18258         be done this way.
18259
18260         * const.cs: Put here the code that used to go into constant.cs
18261
18262         * constant.cs: Put here the code for constants, this is a new base
18263         class for Literals.
18264
18265         * literal.cs: Make Literal derive from Constant.
18266
18267 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18268
18269         * statement.cs (Return.Emit): Report error 157 if the user
18270         attempts to return from a finally block.
18271
18272         (Return.Emit): Instead of emitting a return, jump to the end of
18273         the function.
18274
18275         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18276         LocalBuilder to store the result of the function.  ReturnLabel is
18277         the target where we jump.
18278
18279
18280 2001-12-09  Radek Doulik  <rodo@ximian.com>
18281
18282         * cs-parser.jay: remember alias in current namespace
18283
18284         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18285         namespaces
18286
18287         * class.cs (LookupAlias): lookup alias in my_namespace
18288
18289         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18290         aliases hashtable
18291         (LookupAlias): lookup alias in this and if needed in parent
18292         namespaces
18293
18294 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18295
18296         * support.cs: 
18297
18298         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18299         making things static.  I need this to avoid passing the
18300         TypeContainer when calling ParameterType.
18301
18302         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18303         that did string manipulation to compute the type and then call
18304         GetType.  Use Parameter.ParameterType instead.
18305
18306         * cs-tokenizer.cs: Consume the suffix for floating values.
18307
18308         * expression.cs (ParameterReference): figure out whether this is a
18309         reference parameter or not.  Kill an extra variable by computing
18310         the arg_idx during emission.
18311
18312         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18313         function that returns whether a parameter is an out/ref value or not.
18314
18315         (Parameter.ParameterType): The type of the parameter (base,
18316         without ref/out applied).
18317
18318         (Parameter.Resolve): Perform resolution here.
18319         (Parameter.ExternalType): The full type (with ref/out applied).
18320
18321         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18322         support for expressions on the using statement.
18323
18324 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18325
18326         * statement.cs (Using.EmitLocalVariableDecls): Split the
18327         localvariable handling of the using statement.
18328
18329         (Block.EmitMeta): Keep track of variable count across blocks.  We
18330         were reusing slots on separate branches of blocks.
18331
18332         (Try.Emit): Emit the general code block, we were not emitting it. 
18333
18334         Check the type of the declaration to be an IDisposable or
18335         something that can be implicity converted to it. 
18336
18337         Emit conversions if required.
18338
18339         * ecore.cs (EmptyExpression): New utility class.
18340         (Expression.ImplicitConversionExists): New utility function.
18341
18342 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18343
18344         * statement.cs (Using): Implement.
18345
18346         * expression.cs (LocalVariableReference): Support read only variables.
18347
18348         * statement.cs: Remove the explicit emit for the Leave opcode.
18349         (VariableInfo): Add a readonly field.
18350
18351 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18352
18353         * ecore.cs (ConvCast): new class used to encapsulate the various
18354         explicit integer conversions that works in both checked and
18355         unchecked contexts.
18356
18357         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18358         properly generate the overflow opcodes.
18359
18360 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * statement.cs: The correct type for the EmptyExpression is the
18363         element_type, not the variable type.  Ravi pointed this out.
18364
18365 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18366
18367         * class.cs (Method::Define): Handle PInvoke methods specially
18368         by using DefinePInvokeMethod instead of the usual one.
18369
18370         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18371         above to do the task of extracting information and defining the method.
18372
18373 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18374
18375         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18376         of the condition for string type.
18377
18378         (Emit): Move that here. 
18379
18380         (ArrayCreation::CheckIndices): Keep string literals in their expression
18381         form.
18382
18383         (EmitDynamicInitializers): Handle strings appropriately.
18384
18385 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18386
18387         * codegen.cs (EmitContext): Replace multiple variables with a
18388         single pointer to the current Switch statement.
18389
18390         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18391         EmitContext.
18392
18393 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18394
18395         * statement.cs 
18396
18397         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18398         default'.
18399
18400         (Foreach.Emit): Foreach on arrays was not setting
18401         up the loop variables (for break/continue).
18402
18403         (GotoCase): Semi-implented.
18404
18405 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18406
18407         * attribute.cs (CheckAttribute): Handle system attributes by using
18408         Attribute.GetAttributes to examine information we need.
18409
18410         (GetValidPlaces): Same here.
18411
18412         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18413
18414         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18415
18416         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18417
18418         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18419
18420         (Method::Emit): Handle the case when we are a PInvoke method.
18421
18422 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18423
18424         * expression.cs: Use ResolveWithSimpleName on compound names.
18425
18426 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18427
18428         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18429         before trying to reduce it.
18430
18431         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18432
18433         * constant.cs (LookupConstantValue): Implement.
18434
18435         (EmitConstant): Use the above in emitting the constant.
18436
18437         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18438         that are user-defined by doing a LookupConstantValue on them.
18439
18440         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18441         too, like above.
18442
18443 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18446
18447         (BaseAccess.DoResolve): Implement.
18448
18449         (MemberAccess.DoResolve): Split this routine into a
18450         ResolveMemberAccess routine that can be used independently
18451
18452 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18453
18454         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18455         As that share bits of the implementation.  Is returns a boolean,
18456         while As returns the Type that is being probed.
18457
18458 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18459
18460         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18461         instead of a Literal - much easier.
18462
18463         (EnumInTransit): Remove - utterly useless :-)
18464
18465         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18466
18467         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18468
18469         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18470         chain when we have no associated expression.
18471
18472 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18473
18474         * constant.cs (Define): Use Location while reporting the errror.
18475
18476         Also emit a warning when 'new' is used and there is no inherited
18477         member to hide.
18478
18479         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18480         populated.
18481
18482         (LookupEnumValue): Implement to lookup an enum member's value and define it
18483         if necessary.
18484
18485         (Populate): Re-write accordingly to use the above routine.
18486
18487 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18488
18489         * expression.cs (This): Fix prototype for DoResolveLValue to
18490         override the base class DoResolveLValue.
18491
18492         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18493         declarations) 
18494
18495         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18496         (we need to load the address of the field here).  This fixes
18497         test-22. 
18498
18499         (FieldExpr.DoResolveLValue): Call the DoResolve
18500         function to initialize the Instance expression.
18501
18502         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18503         correctly the GetEnumerator operation on a value type.
18504
18505         * cs-parser.jay: Add more simple parsing error catches.
18506
18507         * statement.cs (Switch): Add support for string switches.
18508         Handle null specially.
18509
18510         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18511
18512 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18513
18514         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18515
18516         (declare_local_constant): New helper function.
18517
18518         * statement.cs (AddConstant): Keep a separate record of constants
18519
18520         (IsConstant): Implement to determine if a variable is a constant.
18521
18522         (GetConstantExpression): Implement.
18523
18524         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18525
18526         * statement.cs (IsVariableDefined): Re-write.
18527
18528 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18529
18530         * class.cs (TypeContainer::FindMembers): Look for constants
18531         in the case when we are looking for MemberTypes.Field
18532
18533         * expression.cs (MemberAccess::DoResolve): Check that in the
18534         case we are a FieldExpr and a Literal, we are not being accessed
18535         by an instance reference.
18536
18537         * cs-parser.jay (local_constant_declaration): Implement.
18538
18539         (declaration_statement): Implement for constant declarations.
18540
18541 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18542
18543         * statement.cs (Switch): Catch double defaults.
18544
18545         (Switch): More work on the switch() statement
18546         implementation.  It works for integral values now, need to finish
18547         string support.
18548
18549
18550 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18551
18552         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18553         integer literals into other integer literals.  To be used by
18554         switch. 
18555
18556 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18557
18558         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18559         some memory.
18560
18561         (EmitDynamicInitializers): Cope with the above since we extract data
18562         directly from ArrayData now.
18563
18564         (ExpectInitializers): Keep track of whether initializers are mandatory
18565         or not.
18566
18567         (Bounds): Make it a hashtable to prevent the same dimension being 
18568         recorded for every element in that dimension.
18569
18570         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18571         from being found.
18572
18573         Also fix bug which was causing the indices to be emitted in the reverse
18574         order.
18575
18576 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18577
18578         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18579         unfinished.  They do not work, because the underlying code is
18580         sloppy.
18581
18582 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18583
18584         * cs-parser.jay: Remove bogus fixme.
18585
18586         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18587         on Switch statement.
18588
18589 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18590
18591         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18592         the same. 
18593
18594         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18595         parameter. Apparently, any expression is allowed. 
18596
18597         (ValidateInitializers): Update accordingly.
18598
18599         (CheckIndices): Fix some tricky bugs thanks to recursion.
18600
18601         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18602         I was being completely brain-dead.
18603
18604         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18605         and re-write acordingly.
18606
18607         (DelegateInvocation): Re-write accordingly.
18608
18609         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18610
18611         (MakeByteBlob): Handle types more correctly.
18612
18613         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18614         initialization from expressions but it is incomplete because I am a complete
18615         Dodo :-|
18616
18617 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18618
18619         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18620         on If.  Basically, we have to return `true' (ie, we do return to
18621         our caller) only if both branches of the if return.
18622
18623         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18624         short-circuit operators, handle them as short circuit operators. 
18625
18626         (Cast.DoResolve): Resolve type.
18627         (Cast.Cast): Take an expression as the target type.
18628
18629         * cs-parser.jay (cast_expression): Remove old hack that only
18630         allowed a limited set of types to be handled.  Now we take a
18631         unary_expression and we resolve to a type during semantic
18632         analysis.
18633
18634         Use the grammar productions from Rhys to handle casts (this is
18635         not complete like Rhys syntax yet, we fail to handle that corner
18636         case that C# has regarding (-x), but we will get there.
18637
18638 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18639
18640         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18641         field which is an array type.
18642
18643         * cs-parser.jay (declare_local_variables): Support array initialization too.
18644
18645         * typemanager.cs (MakeKey): Implement.
18646
18647         (everywhere): Use the above appropriately.
18648
18649         * cs-parser.jay (for_statement): Update for array initialization while
18650         declaring variables.
18651
18652         * ecore.cs : The error message was correct, it's the variable's names that
18653         were misleading ;-) Make the code more readable.
18654
18655         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18656         the correct type etc.
18657
18658         (ConvertExplicit): Handle Enum types by examining the underlying type.
18659
18660 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18661
18662         * parameter.cs (GetCallingConvention): Always return
18663         CallingConventions.Standard for now.
18664
18665 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18666
18667         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18668         and `r' after calling DoNumericPromotions.
18669
18670         * ecore.cs: Fix error message (the types were in the wrong order).
18671
18672         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18673         BindingFlags.Instance as well 
18674
18675         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18676         implicit int literal conversion in an empty cast so that we
18677         propagate the right type upstream.
18678
18679         (UnboxCast): new class used to unbox value types.
18680         (Expression.ConvertExplicit): Add explicit type conversions done
18681         by unboxing.
18682
18683         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18684         the target type before applying the implicit LongLiterals to ULong
18685         literal cast.
18686
18687 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * cs-parser.jay (for_statement): Reworked the way For works: now
18690         we declare manually any variables that are introduced in
18691         for_initializer to solve the problem of having out-of-band code
18692         emition (that is what got for broken).
18693
18694         (declaration_statement): Perform the actual variable declaration
18695         that used to be done in local_variable_declaration here.
18696
18697         (local_variable_declaration): Do not declare anything, just pass
18698         the information on a DictionaryEntry
18699
18700 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18701
18702         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18703         re-write of the logic to now make it recursive.
18704
18705         (UpdateIndices): Re-write accordingly.
18706
18707         Store element data in a separate ArrayData list in the above methods.
18708
18709         (MakeByteBlob): Implement to dump the array data into a byte array.
18710
18711 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18712
18713         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18714         into CheckIndices.
18715
18716         * constant.cs (Define): Implement.
18717
18718         (EmitConstant): Re-write fully.
18719
18720         Pass in location info.
18721
18722         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18723         respectively.
18724
18725         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18726         DictionaryEntry since we need location info too.
18727
18728         (constant_declaration): Update accordingly.
18729
18730         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18731         code into another method : UpdateIndices.
18732
18733 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18734
18735         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18736         some type checking etc.
18737
18738 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18739
18740         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18741         bits to provide dimension info if the user skips doing that.
18742
18743         Update second constructor to store the rank correctly.
18744
18745 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18746
18747         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18748         and try to implement.
18749
18750         * ../errors/cs0150.cs : Add.
18751
18752         * ../errors/cs0178.cs : Add.
18753
18754 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18755
18756         * statement.cs: Implement foreach on multi-dimensional arrays. 
18757
18758         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18759         name of the params argument.
18760
18761         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18762         initializing the array.
18763
18764         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18765         we can use this elsewhere.
18766
18767         * statement.cs: Finish implementation of foreach for single
18768         dimension arrays.
18769
18770         * cs-parser.jay: Use an out-of-band stack to pass information
18771         around, I wonder why I need this.
18772
18773         foreach_block: Make the new foreach_block the current_block.
18774
18775         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18776         function used to return a static Parameters structure.  Used for
18777         empty parameters, as those are created very frequently.
18778
18779         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18780
18781 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18782
18783         * interface.cs : Default modifier is private, not public. The
18784         make verify test passes again.
18785
18786 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18787
18788         * support.cs (ReflectionParameters): Fix logic to determine
18789         whether the last parameter is a params one. Test 9 passes again.
18790
18791         * delegate.cs (Populate): Register the builders we define with
18792         RegisterParameterForBuilder. Test 19 passes again.
18793
18794         * cs-parser.jay (property_declaration): Reference $6 instead
18795         of $$ to get at the location.
18796
18797         (indexer_declaration): Similar stuff.
18798
18799         (attribute): Ditto.
18800
18801         * class.cs (Property): Register parameters for the Get and Set methods
18802         if they exist. Test 23 passes again.
18803
18804         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18805         call to EmitArguments as we are sure there aren't any params arguments. 
18806         Test 32 passes again.
18807
18808         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18809         IndexOutOfRangeException. 
18810
18811         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18812         Test 33 now passes again.
18813
18814 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18817         broke a bunch of things.  Will have to come up with a better way
18818         of tracking locations.
18819
18820         * statement.cs: Implemented foreach for single dimension arrays.
18821
18822 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18823
18824         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18825         an error.  This removes the lookup from the critical path.
18826
18827         * cs-parser.jay: Removed use of temporary_loc, which is completely
18828         broken. 
18829
18830 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * support.cs (ReflectionParameters.ParameterModifier): Report
18833         whether the argument is a PARAMS argument or not.
18834
18835         * class.cs: Set the attribute `ParamArrayAttribute' on the
18836         parameter argument.
18837
18838         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18839         and cons_param_array_attribute (ConstructorInfo for
18840         ParamArrayAttribute)., 
18841
18842         * codegen.cs: Emit the return using the `Return' statement, that
18843         way we can report the error correctly for missing return values. 
18844
18845         * class.cs (Method.Emit): Clean up.
18846
18847         * expression.cs (Argument.Resolve): Take another argument: the
18848         location where this argument is used.  Notice that this is not
18849         part of the "Argument" class as to reduce the size of the
18850         structure (we know the approximate location anyways).
18851
18852         Test if the argument is a variable-reference, if not, then
18853         complain with a 206.
18854
18855         (Argument.Emit): Emit addresses of variables.
18856
18857         (Argument.FullDesc): Simplify.
18858
18859         (Invocation.DoResolve): Update for Argument.Resolve.
18860
18861         (ElementAccess.DoResolve): ditto.
18862
18863         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18864         method should be virtual, as this method is always virtual.
18865
18866         (NewDelegate.DoResolve): Update for Argument.Resolve.
18867
18868         * class.cs (ConstructorInitializer.DoResolve): ditto.
18869
18870         * attribute.cs (Attribute.Resolve): ditto.
18871
18872 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18873
18874         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18875
18876         * expression.cs (ParameterReference): Drop IStackStorage and implement
18877         IAssignMethod instead. 
18878
18879         (LocalVariableReference): ditto.
18880
18881         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18882         IAssignMethod instead. 
18883
18884 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18885
18886         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18887         enumerations that are used in heavily used structures derive from
18888         byte in a laughable and pathetic attempt to reduce memory usage.
18889         This is the kind of pre-optimzations that you should not do at
18890         home without adult supervision.
18891
18892         * expression.cs (UnaryMutator): New class, used to handle ++ and
18893         -- separatedly from the other unary operators.  Cleans up the
18894         code, and kills the ExpressionStatement dependency in Unary.
18895
18896         (Unary): Removed `method' and `Arguments' from this class, making
18897         it smaller, and moving it all to SimpleCall, so I can reuse this
18898         code in other locations and avoid creating a lot of transient data
18899         strucutres when not required.
18900
18901         * cs-parser.jay: Adjust for new changes.
18902
18903 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * enum.cs (Enum.Populate): If there is a failure during
18906         definition, return
18907
18908         * cs-parser.jay (opt_enum_base): we used to catch type errors
18909         here, but this is really incorrect.  The type error should be
18910         catched during semantic analysis.
18911
18912 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18913
18914         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18915         current_local_parameters as expected since I, in my stupidity, had forgotten
18916         to do this :-)
18917
18918         * attribute.cs (GetValidPlaces): Fix stupid bug.
18919
18920         * class.cs (Method::Emit): Perform check on applicability of attributes.
18921
18922         (Constructor::Emit): Ditto.
18923
18924         (Field::Emit): Ditto.
18925
18926         (Field.Location): Store location information.
18927
18928         (Property, Event, Indexer, Operator): Ditto.
18929
18930         * cs-parser.jay (field_declaration): Pass in location for each field.
18931
18932         * ../errors/cs0592.cs : Add.
18933
18934 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18935
18936         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18937
18938         (InitCoreTypes): Update accordingly.
18939
18940         (RegisterAttrType, LookupAttr): Implement.
18941
18942         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18943         info about the same.
18944
18945         (Resolve): Update to populate the above as necessary.
18946
18947         (Error592): Helper.
18948
18949         (GetValidPlaces): Helper to the above.
18950
18951         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18952
18953         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18954
18955 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18956
18957         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18958
18959         * ../errors/cs0617.cs : Add.
18960
18961 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18962
18963         * enum.cs (Emit): Rename to Populate to be more consistent with what
18964         we expect it to do and when exactly it is called.
18965
18966         * class.cs, rootcontext.cs : Update accordingly.
18967
18968         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18969         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18970
18971         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18972
18973         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18974         of a fieldinfo using the above, when dealing with a FieldBuilder.
18975
18976 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18977
18978         * ../errors/cs0031.cs : Add.
18979
18980         * ../errors/cs1008.cs : Add.
18981
18982         * ../errrors/cs0543.cs : Add.
18983
18984         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18985         enum type.
18986
18987         (FindMembers): Implement.
18988
18989         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18990         enums and delegates too.
18991
18992         (enum_types): Rename to builder_to_enum.
18993
18994         (delegate_types): Rename to builder_to_delegate.
18995
18996         * delegate.cs (FindMembers): Implement.
18997
18998 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18999
19000         * typemanager.cs (IsEnumType): Implement.
19001
19002         * enum.cs (Emit): Re-write parts to account for the underlying type
19003         better and perform checking etc.
19004
19005         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19006         of the underlying type.
19007
19008         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19009         value
19010
19011         * enum.cs (error31): Helper to report error #31.
19012
19013         * cs-parser.jay (enum_declaration): Store location of each member too.
19014
19015         * enum.cs (member_to_location): New hashtable. 
19016
19017         (AddEnumMember): Update location hashtable.
19018
19019         (Emit): Use the location of each member while reporting errors.
19020
19021 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19022
19023         * cs-parser.jay: A for_initializer if is a
19024         local_variable_declaration really ammount to have an implicit
19025         block with the variable declaration and no initializer for for.
19026
19027         * statement.cs (For.Emit): Cope with null initializers.
19028
19029         This fixes the infinite loop on for initializers.
19030
19031 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19032
19033         * enum.cs: More cleanup.
19034
19035         * ecore.cs: Remove dead code.
19036
19037         * class.cs (Property.Emit): More simplification.
19038         (Event.Emit): ditto.
19039
19040         Reworked to have less levels of indentation.
19041
19042 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19043
19044         * class.cs (Property): Emit attributes.
19045
19046         (Field): Ditto.
19047
19048         (Event): Ditto.
19049
19050         (Indexer): Ditto.
19051
19052         (Operator): Ditto.
19053
19054         * enum.cs (Emit): Ditto.
19055
19056         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19057         Enums too.
19058
19059         * class.cs (Field, Event, etc.): Move attribute generation into the
19060         Emit method everywhere.
19061
19062         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19063         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19064         as we had no way of defining nested enums !
19065
19066         * rootcontext.cs : Adjust code accordingly.
19067
19068         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19069
19070 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19071
19072         * expression.cs (EvalConstantExpression): Move into ecore.cs
19073
19074         * enum.cs (Enum): Rename some members and make them public and readonly
19075         according to our convention.
19076
19077         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19078         nothing else.
19079
19080         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19081
19082         (Enum::Emit): Write a simple version for now which doesn't try to compute
19083         expressions. I shall modify this to be more robust in just a while.
19084
19085         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19086
19087         (TypeContainer::CloseType): Create the Enum types too.
19088
19089         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19090
19091         * expression.cs (EvalConstantExpression): Get rid of completely.
19092
19093         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19094         user-defined values and other cases.
19095
19096         (IsValidEnumLiteral): Helper function.
19097
19098         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19099         out there in the case we had a literal FieldExpr.
19100
19101         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19102
19103         (Literalize): Revamp a bit to take two arguments.
19104
19105         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19106
19107 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19108
19109         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19110
19111         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19112
19113         (Resolve): Use the above to ensure we have proper initializers.
19114
19115 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19116
19117         * expression.cs (Expression::EvalConstantExpression): New method to 
19118         evaluate constant expressions.
19119
19120         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19121
19122 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19123
19124         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19125         in an array.
19126
19127         (Binary.ResolveOperator): Handle operator != (object a, object b)
19128         and operator == (object a, object b);
19129
19130         (Binary.DoNumericPromotions): Indicate whether the numeric
19131         promotion was possible.
19132
19133         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19134         Implement.  
19135
19136         Made the ArrayAccess implement interface IAssignMethod instead of
19137         IStackStore as the order in which arguments are passed reflects
19138         this.
19139
19140         * assign.cs: Instead of using expr.ExprClass to select the way of
19141         assinging, probe for the IStackStore/IAssignMethod interfaces.
19142
19143         * typemanager.cs: Load InitializeArray definition.
19144
19145         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19146         static data that can be used to initialize arrays. 
19147
19148 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * expression.cs: Handle operator== and operator!= for booleans.
19151
19152         (Conditioal.Reduce): Implement reducer for the ?: operator.
19153
19154         (Conditional.Resolve): Implement dead code elimination.
19155
19156         (Binary.Resolve): Catch string literals and return a new
19157         concatenated string.
19158
19159         (Unary.Reduce): Implement reduction of unary expressions.
19160
19161         * ecore.cs: Split out the expression core handling here.
19162
19163         (Expression.Reduce): New method used to perform constant folding
19164         and CSE.  This is needed to support constant-expressions. 
19165
19166         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19167         targets, and optimize for !x.
19168
19169 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19170
19171         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19172         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19173         set custom atttributes.
19174
19175         * literal.cs (Literal::GetValue): New abstract method to return the actual
19176         value of the literal, cast as an object.
19177
19178         (*Literal): Implement GetValue method.
19179
19180         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19181         expressions to the arraylist but objects of type Argument.
19182
19183         * class.cs (TypeContainer::Emit): Emit our attributes too.
19184
19185         (Method::Emit, Constructor::Emit): Ditto.
19186
19187         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19188         to be ignoring earlier.
19189
19190 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19191
19192         * attribute.cs (AttributeSection::Define): Implement to do the business
19193         of constructing a CustomAttributeBuilder.
19194
19195         (Attribute): New trivial class. Increases readability of code.  
19196
19197         * cs-parser.jay : Update accordingly.
19198
19199         (positional_argument_list, named_argument_list, named_argument): New rules
19200
19201         (attribute_arguments): Use the above so that we are more correct.
19202
19203 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19204
19205         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19206         to perform all checks for a method with a params parameter.
19207
19208         (Invocation::OverloadResolve): Update to use the above method and therefore
19209         cope correctly with params method invocations.
19210
19211         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19212         params too.
19213
19214         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19215         constructors in our parent too because we can't afford to miss out on 
19216         protected ones ;-)
19217
19218         * attribute.cs (AttributeSection): New name for the class Attribute
19219
19220         Other trivial changes to improve readability.
19221
19222         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19223         use the new class names.
19224
19225 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19226
19227         * class.cs (Method::Define): Complete definition for params types too
19228
19229         (Indexer::Define): Ditto.
19230
19231         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19232         Cope everywhere with a request for info about the array parameter.
19233
19234 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19235
19236         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19237
19238         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19239         local_variable_type to extract the string corresponding to the type.
19240
19241         (local_variable_type): Fixup the action to use the new helper method.
19242
19243         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19244         go.
19245
19246         * expression.cs : Clean out code which uses the above.
19247
19248 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19249
19250         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19251         and bale out if necessary by returning a false.
19252
19253         (RegisterProperty): Ditto.
19254
19255         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19256         and print out appropriate error messages.
19257
19258         * interface.cs (everywhere): Ditto.
19259
19260         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19261         location to constructor.
19262
19263         * class.cs (Property, Event, Indexer): Update accordingly.
19264
19265         * ../errors/cs111.cs : Added.
19266
19267         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19268         of a method, as laid down by the spec.
19269
19270         (Invocation::OverloadResolve): Use the above method.
19271
19272 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19273
19274         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19275         now take a TypeContainer and a Parameters object.
19276
19277         (ParameterData): Modify return type of ParameterModifier method to be 
19278         Parameter.Modifier and not a string.
19279
19280         (ReflectionParameters, InternalParameters): Update accordingly.
19281
19282         * expression.cs (Argument::GetParameterModifier): Same here.
19283
19284         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19285         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19286         symbol in it at all so maybe this is only for now.
19287
19288 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19289
19290         * support.cs (InternalParameters): Constructor now takes an extra argument 
19291         which is the actual Parameters class.
19292
19293         (ParameterDesc): Update to provide info on ref/out modifiers.
19294
19295         * class.cs (everywhere): Update call to InternalParameters to pass in
19296         the second argument too.
19297
19298         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19299         to return the modifier info [ref/out etc]
19300
19301         (InternalParameters, ReflectionParameters): Implement the above.
19302
19303         * expression.cs (Argument::ParameterModifier): Similar function to return
19304         info about the argument's modifiers.
19305
19306         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19307         too.
19308
19309         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19310         a new SetFormalParameters object which we pass to InternalParameters.
19311
19312 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19313
19314         * expression.cs (NewArray): Merge into the ArrayCreation class.
19315
19316 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19317
19318         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19319         NewUserdefinedArray into one as there wasn't much of a use in having
19320         two separate ones.
19321
19322         * expression.cs (Argument): Change field's name to ArgType from Type.
19323
19324         (Type): New readonly property which returns the proper type, taking into 
19325         account ref/out modifiers.
19326
19327         (everywhere): Adjust code accordingly for the above.
19328
19329         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19330         whether we are emitting for a ref or out parameter.
19331
19332         * expression.cs (Argument::Emit): Use the above field to set the state.
19333
19334         (LocalVariableReference::Emit): Update to honour the flag and emit the
19335         right stuff.
19336
19337         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19338
19339         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19340
19341         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19342
19343         (ReflectionParameters, InternalParameters): Implement the above method.
19344
19345         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19346         reporting errors.
19347
19348         (Invocation::FullMethodDesc): Ditto. 
19349
19350 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19351
19352         * cs-parser.jay: Add extra production for the second form of array
19353         creation. 
19354
19355         * expression.cs (ArrayCreation): Update to reflect the above
19356         change. 
19357
19358         * Small changes to prepare for Array initialization.
19359
19360 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * typemanager.cs (ImplementsInterface): interface might be null;
19363         Deal with this problem;
19364
19365         Also, we do store negative hits on the cache (null values), so use
19366         this instead of calling t.GetInterfaces on the type everytime.
19367
19368 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19369
19370         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19371
19372         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19373         split functionality out into different classes.
19374
19375         (New::FormArrayType): Move into NewBuiltinArray.
19376
19377         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19378         quite useless.
19379
19380         (NewBuiltinArray): New class to handle creation of built-in arrays.
19381
19382         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19383         account creation of one-dimensional arrays.
19384
19385         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19386
19387         (NewUserdefinedArray::DoResolve): Implement.
19388
19389         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19390
19391         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19392         we maintain inside the TypeManager. This is necessary to perform lookups on the
19393         module builder.
19394
19395         (LookupType): Update to perform GetType on the module builders too.     
19396
19397         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19398
19399         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19400
19401 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19402
19403         * expression.cs (New::DoResolve): Implement guts of array creation.
19404
19405         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19406
19407 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * expression.cs: Fix bug I introduced lsat night that broke
19410         Delegates. 
19411
19412         (Expression.Resolve): Report a 246 error (can not resolve name)
19413         if we find a SimpleName in the stream.
19414
19415         (Expression.ResolveLValue): Ditto.
19416
19417         (Expression.ResolveWithSimpleName): This function is a variant of
19418         ResolveName, this one allows SimpleNames to be returned without a
19419         warning.  The only consumer of SimpleNames is MemberAccess
19420
19421 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19422
19423         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19424         might arrive here.  I have my doubts that this is correct.
19425
19426         * statement.cs (Lock): Implement lock statement.
19427
19428         * cs-parser.jay: Small fixes to support `lock' and `using'
19429
19430         * cs-tokenizer.cs: Remove extra space
19431
19432         * driver.cs: New flag --checked, allows to turn on integer math
19433         checking. 
19434
19435         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19436         Threading.Monitor.Exit 
19437
19438 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19439
19440         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19441         Expression Class to be IndexerAccess.
19442
19443         Notice that Indexer::DoResolve sets the eclass to Value.
19444
19445 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19446
19447         * class.cs (TypeContainer::Emit): Emit code for indexers.
19448
19449         * assign.cs (IAssignMethod): New interface implemented by Indexers
19450         and Properties for handling assignment.
19451
19452         (Assign::Emit): Simplify and reuse code. 
19453
19454         * expression.cs (IndexerAccess, PropertyExpr): Implement
19455         IAssignMethod, clean up old code. 
19456
19457 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19458
19459         * typemanager.cs (ImplementsInterface): New method to determine if a type
19460         implements a given interface. Provides a nice cache too.
19461
19462         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19463         method.
19464
19465         (ConvertReferenceExplicit): Ditto.
19466
19467         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19468         various methods, with correct names etc.
19469
19470         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19471         Operator.UnaryNegation.
19472
19473         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19474         we have a unary plus or minus operator.
19475
19476         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19477         UnaryMinus.
19478
19479         * everywhere : update accordingly.
19480
19481         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19482         respectively.
19483
19484         * class.cs (Method::Define): For the case where we are implementing a method
19485         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19486         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19487
19488 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19489
19490         * interface.cs (FindMembers): Implement to work around S.R.E
19491         lameness.
19492
19493         * typemanager.cs (IsInterfaceType): Implement.
19494
19495         (FindMembers): Update to handle interface types too.
19496
19497         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19498         use IsAssignableFrom as that is not correct - it doesn't work.
19499
19500         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19501         and accordingly override EmitStatement.
19502
19503         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19504         using the correct logic :-)
19505
19506 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19507
19508         * ../errors/cs-11.cs : Add to demonstrate error -11 
19509
19510 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19513         then pass this as a hint to ResolveLValue.
19514
19515         * expression.cs (FieldExpr): Add Location information
19516
19517         (FieldExpr::LValueResolve): Report assignment to readonly
19518         variable. 
19519
19520         (Expression::ExprClassFromMemberInfo): Pass location information.
19521
19522         (Expression::ResolveLValue): Add new method that resolves an
19523         LValue. 
19524
19525         (Expression::DoResolveLValue): Default invocation calls
19526         DoResolve. 
19527
19528         (Indexers): New class used to keep track of indexers in a given
19529         Type. 
19530
19531         (IStackStore): Renamed from LValue, as it did not really describe
19532         what this did.  Also ResolveLValue is gone from this interface and
19533         now is part of Expression.
19534
19535         (ElementAccess): Depending on the element access type
19536
19537         * typemanager.cs: Add `indexer_name_type' as a Core type
19538         (System.Runtime.CompilerServices.IndexerNameAttribute)
19539
19540         * statement.cs (Goto): Take a location.
19541
19542 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19543
19544         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19545         if two delegates are compatible.
19546
19547         (NewDelegate::DoResolve): Update to take care of the case when
19548         we instantiate a delegate from another delegate.
19549
19550         * typemanager.cs (FindMembers): Don't even try to look up members
19551         of Delegate types for now.
19552
19553 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19554
19555         * delegate.cs (NewDelegate): New class to take care of delegate
19556         instantiation.
19557
19558         * expression.cs (New): Split the delegate related code out into 
19559         the NewDelegate class.
19560
19561         * delegate.cs (DelegateInvocation): New class to handle delegate 
19562         invocation.
19563
19564         * expression.cs (Invocation): Split out delegate related code into
19565         the DelegateInvocation class.
19566
19567 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19568
19569         * expression.cs (New::DoResolve): Implement delegate creation fully
19570         and according to the spec.
19571
19572         (New::DoEmit): Update to handle delegates differently.
19573
19574         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19575         because of which we were printing out arguments in reverse order !
19576
19577         * delegate.cs (VerifyMethod): Implement to check if the given method
19578         matches the delegate.
19579
19580         (FullDelegateDesc): Implement.
19581
19582         (VerifyApplicability): Implement.
19583
19584         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19585         delegate invocations too.
19586
19587         (Invocation::Emit): Ditto.
19588
19589         * ../errors/cs1593.cs : Added.
19590
19591         * ../errors/cs1594.cs : Added.
19592
19593         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19594
19595 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19596
19597         * typemanager.cs (intptr_type): Core type for System.IntPtr
19598
19599         (InitCoreTypes): Update for the same.
19600
19601         (iasyncresult_type, asynccallback_type): Ditto.
19602
19603         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19604         correct.
19605
19606         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19607         too.
19608
19609         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19610         the builders for the 4 members of a delegate type :-)
19611
19612         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19613         type.
19614
19615         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19616
19617         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19618
19619 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19620
19621         * statement.cs (Break::Emit): Implement.   
19622         (Continue::Emit): Implement.
19623
19624         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19625         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19626         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19627         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19628         end loop
19629
19630         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19631         properties that track the label for the current loop (begin of the
19632         loop and end of the loop).
19633
19634 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19635
19636         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19637         use of emitting anything at all.
19638
19639         * class.cs, rootcontext.cs : Get rid of calls to the same.
19640
19641         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19642
19643         (Populate): Define the constructor correctly and set the implementation
19644         attributes.
19645
19646         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19647         have been defined.
19648
19649         (AddDelegateType): Implement.
19650
19651         (IsDelegateType): Implement helper method.
19652
19653         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19654
19655         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19656         and accordingly handle it.
19657
19658         * delegate.cs (Populate): Take TypeContainer argument.
19659         Implement bits to define the Invoke method. However, I still haven't figured out
19660         how to take care of the native int bit :-(
19661
19662         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19663         Qualify the name of the delegate, not its return type !
19664
19665         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19666         conversion.
19667
19668         (StandardConversionExists): Checking for array types turns out to be recursive.
19669
19670         (ConvertReferenceExplicit): Implement array conversion.
19671
19672         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19673
19674 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19675
19676         * cs-parser.jay (delegate_declaration): Store the fully qualified
19677         name as it is a type declaration.
19678
19679         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19680         readonly.
19681
19682         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19683         as TypeContainer::DefineType.
19684
19685         (Populate): Method in which all the definition of the various methods (Invoke)
19686         etc is done.
19687
19688         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19689         see.
19690
19691         (CloseDelegate): Finally creates the delegate.
19692
19693         * class.cs (TypeContainer::DefineType): Update to define delegates.
19694         (Populate, Emit and CloseType): Do the same thing here too.
19695
19696         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19697         delegates in all these operations.
19698
19699 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19700
19701         * expression.cs: LocalTemporary: a new expression used to
19702         reference a temporary that has been created.
19703
19704         * assign.cs: Handle PropertyAccess back here, so that we can
19705         provide the proper semantic access to properties.
19706
19707         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19708         a few more explicit conversions. 
19709
19710         * modifiers.cs: `NEW' modifier maps to HideBySig.
19711
19712         * expression.cs (PropertyExpr): Make this into an
19713         ExpressionStatement, and support the EmitStatement code path. 
19714
19715         Perform get/set error checking, clean up the interface.
19716
19717         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19718         them into toplevel access objects.
19719
19720 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19721
19722         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19723         SRE.
19724
19725         * typemanager.cs: Keep track here of our PropertyBuilders again to
19726         work around lameness in SRE.
19727
19728 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19729
19730         * expression.cs (LValue::LValueResolve): New method in the
19731         interface, used to perform a second resolution pass for LValues. 
19732
19733         (This::DoResolve): Catch the use of this in static methods.
19734
19735         (This::LValueResolve): Implement.
19736
19737         (This::Store): Remove warning, assigning to `this' in structures
19738         is 
19739
19740         (Invocation::Emit): Deal with invocation of
19741         methods on value types.  We need to pass the address to structure
19742         methods rather than the object itself.  (The equivalent code to
19743         emit "this" for structures leaves the entire structure on the
19744         stack instead of a pointer to it). 
19745
19746         (ParameterReference::DoResolve): Compute the real index for the
19747         argument based on whether the method takes or not a `this' pointer
19748         (ie, the method is static).
19749
19750         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19751         value types returned from functions when we need to invoke a
19752         method on the sturcture.
19753
19754
19755 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19756
19757         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19758         defining the type in the Modulebuilder or Typebuilder. This is to take
19759         care of nested types which need to be defined on the TypeBuilder using
19760         DefineNestedMethod.
19761
19762         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19763         methods in RootContext, only ported to be part of TypeContainer.
19764
19765         (TypeContainer::GetInterfaceOrClass): Ditto.
19766
19767         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19768
19769         * interface.cs (Interface::DefineInterface): New method. Does exactly
19770         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19771         too.
19772
19773         (Interface::GetInterfaces): Move from RootContext here and port.
19774
19775         (Interface::GetInterfaceByName): Same here.
19776
19777         * rootcontext.cs (ResolveTree): Re-write.
19778
19779         (PopulateTypes): Re-write.
19780
19781         * class.cs (TypeContainer::Populate): Populate nested types too.
19782         (TypeContainer::Emit): Emit nested members too.
19783
19784         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19785         instead just use the name argument passed in as it is already fully
19786         qualified.
19787
19788         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19789         to TypeContainer mapping to see if a type is user-defined.
19790
19791         * class.cs (TypeContainer::CloseType): Implement. 
19792
19793         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19794         the default constructor.
19795
19796         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19797         twice.
19798
19799         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19800
19801         * interface.cs (CloseType): Create the type here.
19802
19803         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19804         the hierarchy.
19805
19806         Remove all the methods which are now in TypeContainer.
19807
19808 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19809
19810         * delegate.cs (Define): Re-write bits to define the delegate
19811         correctly.
19812
19813 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19814
19815         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19816
19817         * expression.cs (ImplicitReferenceConversion): handle null as well
19818         as a source to convert to any reference type.
19819
19820         * statement.cs (Return): Perform any implicit conversions to
19821         expected return type.  
19822
19823         Validate use of return statement.  
19824
19825         * codegen.cs (EmitContext): Pass the expected return type here.
19826
19827         * class.cs (Method, Constructor, Property): Pass expected return
19828         type to EmitContext.
19829
19830 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19831
19832         * expression.cs: Make DoResolve take an EmitContext instead of a
19833         TypeContainer.
19834
19835         Replaced `l' and `location' for `loc', for consistency.
19836
19837         (Error, Warning): Remove unneeded Tc argument.
19838
19839         * assign.cs, literal.cs, constant.cs: Update to new calling
19840         convention. 
19841
19842         * codegen.cs: EmitContext now contains a flag indicating whether
19843         code is being generated in a static method or not.
19844
19845         * cs-parser.jay: DecomposeQI, new function that replaces the old
19846         QualifiedIdentifier.  Now we always decompose the assembled
19847         strings from qualified_identifier productions into a group of
19848         memberaccesses.
19849
19850 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * rootcontext.cs: Deal with field-less struct types correctly now
19853         by passing the size option to Define Type.
19854
19855         * class.cs: Removed hack that created one static field. 
19856
19857 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * statement.cs: Moved most of the code generation here. 
19860
19861 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19862
19863         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19864         seem very right.
19865
19866         (ElementAccess): Remove useless bits for now - keep checks as the spec
19867         says.
19868
19869 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19870
19871         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19872         and start performing checks according to the spec.
19873
19874 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19875
19876         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19877         rank_specifiers instead.
19878
19879         (rank_specifiers): Change the order in which the rank specifiers are stored
19880
19881         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19882
19883         * expression.cs (ElementAccess): Implement the LValue interface too.
19884
19885 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19886
19887         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19888         except that user defined conversions are not included.
19889
19890         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19891         perform the conversion of the return type, if necessary.
19892
19893         (New::DoResolve): Check whether we are creating an array or an object
19894         and accordingly do the needful.
19895
19896         (New::Emit): Same here.
19897
19898         (New::DoResolve): Implement guts of array creation.
19899
19900         (New::FormLookupType): Helper function.
19901
19902 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * codegen.cs: Removed most of the code generation here, and move the
19905         corresponding code generation bits to the statement classes. 
19906
19907         Added support for try/catch/finalize and throw.
19908
19909         * cs-parser.jay: Added support for try/catch/finalize.
19910
19911         * class.cs: Catch static methods having the flags override,
19912         virtual or abstract.
19913
19914         * expression.cs (UserCast): This user cast was not really doing
19915         what it was supposed to do.  Which is to be born in fully resolved
19916         state.  Parts of the resolution were being performed at Emit time! 
19917
19918         Fixed this code.
19919
19920 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * expression.cs: Implicity convert the result from UserCast.
19923
19924 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19925
19926         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19927         prevented it from working correctly. 
19928
19929         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19930         merely ConvertImplicit.
19931
19932 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19933
19934         * typemanager.cs: Make the LookupTypeContainer function static,
19935         and not per-instance.  
19936
19937         * class.cs: Make static FindMembers (the one that takes a Type
19938         argument). 
19939
19940         * codegen.cs: Add EmitForeach here.
19941
19942         * cs-parser.jay: Make foreach a toplevel object instead of the
19943         inline expansion, as we need to perform semantic analysis on it. 
19944
19945 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19946
19947         * expression.cs (Expression::ImplicitUserConversion): Rename to
19948         UserDefinedConversion.
19949
19950         (Expression::UserDefinedConversion): Take an extra argument specifying 
19951         whether we look for explicit user conversions too.
19952
19953         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19954
19955         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19956
19957         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19958         with the appropriate arguments.
19959
19960         * cs-parser.jay (cast_expression): Record location too.
19961
19962         * expression.cs (Cast): Record location info.
19963
19964         (Expression::ConvertExplicit): Take location argument.
19965
19966         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19967         to determine if we are doing explicit conversions.
19968
19969         (UserCast::Emit): Update accordingly.
19970
19971         (Expression::ConvertExplicit): Report an error if everything fails.
19972
19973         * ../errors/cs0030.cs : Add.
19974
19975 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19976
19977         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19978         virtual and newslot bits. 
19979
19980         * class.cs (TypeContainer::RegisterRequiredImplementations):
19981         Record methods we need.
19982
19983         (TypeContainer::MakeKey): Helper function to make keys for
19984         MethodBases, since the Methodbase key is useless.
19985
19986         (TypeContainer::Populate): Call RegisterRequiredImplementations
19987         before defining the methods.   
19988
19989         Create a mapping for method_builders_to_methods ahead of time
19990         instead of inside a tight loop.
19991
19992         (::RequireMethods):  Accept an object as the data to set into the
19993         hashtable so we can report interface vs abstract method mismatch.
19994
19995 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19996
19997         * report.cs: Make all of it static.
19998
19999         * rootcontext.cs: Drop object_type and value_type computations, as
20000         we have those in the TypeManager anyways.
20001
20002         Drop report instance variable too, now it is a global.
20003
20004         * driver.cs: Use try/catch on command line handling.
20005
20006         Add --probe option to debug the error reporting system with a test
20007         suite. 
20008
20009         * report.cs: Add support for exiting program when a probe
20010         condition is reached.
20011
20012 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20013
20014         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20015         we do a forcible conversion regardless of type, to check if 
20016         ForceConversion returns a null.
20017
20018         (Binary::error19): Use location to report error.
20019
20020         (Unary::error23): Use location here too.
20021
20022         * ../errors/cs0019.cs : Check in.
20023
20024         * ../errors/cs0023.cs : Check in.
20025
20026         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20027         case of a non-null MethodInfo object with a length of 0 !
20028
20029         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20030         an applicable member - according to the spec :-)
20031         Also fix logic to find members in base types.
20032
20033         (Unary::ResolveOperator): Same here.
20034
20035         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20036         as I was getting thoroughly confused between this and error19 :-)
20037
20038         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20039         (::FindMostEncompassedType): Implement.
20040         (::FindMostEncompassingType): Implement.
20041         (::StandardConversionExists): Implement.
20042
20043         (UserImplicitCast): Re-vamp. We now need info about most specific
20044         source and target types so that we can do the necessary conversions.
20045
20046         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20047         mathematical union with no duplicates.
20048
20049 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20050
20051         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20052         in order from base classes to child classes, so that we can in
20053         child classes look up in our parent for method names and
20054         attributes (required for handling abstract, virtual, new, override
20055         constructs: we need to instrospect our base class, and if we dont
20056         populate the classes in order, the introspection might be
20057         incorrect.  For example, a method could query its parent before
20058         the parent has any methods and would determine that the parent has
20059         no abstract methods (while it could have had them)).
20060
20061         (RootContext::CreateType): Record the order in which we define the
20062         classes.
20063
20064 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20065
20066         * class.cs (TypeContainer::Populate): Also method definitions can
20067         fail now, keep track of this.
20068
20069         (TypeContainer::FindMembers): Implement support for
20070         DeclaredOnly/noDeclaredOnly flag.
20071
20072         (Constructor::Emit) Return the ConstructorBuilder.
20073
20074         (Method::Emit) Return the MethodBuilder. 
20075         Check for abstract or virtual methods to be public.
20076
20077         * rootcontext.cs (RootContext::CreateType): Register all the
20078         abstract methods required for the class to be complete and the
20079         interface methods that must be implemented. 
20080
20081         * cs-parser.jay: Report error 501 (method requires body if it is
20082         not marked abstract or extern).
20083
20084         * expression.cs (TypeOf::Emit): Implement.
20085
20086         * typemanager.cs: runtime_handle_type, new global type.
20087
20088         * class.cs (Property::Emit): Generate code for properties.
20089
20090 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20091
20092         * expression.cs (Unary::ResolveOperator): Find operators on base type
20093         too - we now conform exactly to the spec.
20094
20095         (Binary::ResolveOperator): Same here.
20096
20097         * class.cs (Operator::Define): Fix minor quirk in the tests.
20098
20099         * ../errors/cs0215.cs : Added.
20100
20101         * ../errors/cs0556.cs : Added.
20102
20103         * ../errors/cs0555.cs : Added.
20104
20105 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20106
20107         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20108         single integer which is really efficient
20109
20110 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20111
20112         *  expression.cs (Expression::ImplicitUserConversion): Use location
20113         even in the case when we are examining True operators.
20114  
20115         * class.cs (Operator::Define): Perform extensive checks to conform
20116         with the rules for operator overloading in the spec.
20117
20118         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20119         some of the other conversions mentioned in the spec.
20120
20121         * typemanager.cs (array_type): New static member for the System.Array built-in
20122         type.
20123
20124         (cloneable_interface): For System.ICloneable interface.
20125
20126         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20127         we start resolving the tree and populating types.
20128
20129         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20130  
20131 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * expression.cs (Expression::ExprClassFromMemberInfo,
20134         Expression::Literalize): Create literal expressions from
20135         FieldInfos which are literals.
20136
20137         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20138         type casts, because they were wrong.  The test suite in tests
20139         caught these ones.
20140
20141         (ImplicitNumericConversion): ushort to ulong requires a widening
20142         cast. 
20143
20144         Int32 constant to long requires widening cast as well.
20145
20146         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20147         for integers because the type on the stack is not i4.
20148
20149 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * expression.cs (report118): require location argument. 
20152
20153         * parameter.cs: Do not dereference potential null value.
20154
20155         * class.cs: Catch methods that lack the `new' keyword when
20156         overriding a name.  Report warnings when `new' is used without
20157         anything being there to override.
20158
20159         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20160
20161         * class.cs: Only add constructor to hashtable if it is non-null
20162         (as now constructors can fail on define).
20163
20164         (TypeManager, Class, Struct): Take location arguments.
20165
20166         Catch field instance initialization in structs as errors.
20167
20168         accepting_filter: a new filter for FindMembers that is static so
20169         that we dont create an instance per invocation.
20170
20171         (Constructor::Define): Catch errors where a struct constructor is
20172         parameterless 
20173
20174         * cs-parser.jay: Pass location information for various new
20175         constructs. 
20176
20177         * delegate.cs (Delegate): take a location argument.
20178
20179         * driver.cs: Do not call EmitCode if there were problesm in the
20180         Definition of the types, as many Builders wont be there. 
20181
20182         * decl.cs (Decl::Decl): Require a location argument.
20183
20184         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20185         into integers, and find the most appropiate integer for it.
20186
20187         * literal.cs: Implement ULongLiteral.
20188
20189         * rootcontext.cs: Provide better information about the location of
20190         failure when CreateType fails.
20191
20192 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20195         as well.
20196
20197         * expression.cs (Binary::CheckShiftArguments): Add missing type
20198         computation.
20199         (Binary::ResolveOperator): Add type to the logical and and logical
20200         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20201         before.
20202
20203         (Binary::DoNumericPromotions): In the case where either argument
20204         is ulong (and most signed types combined with ulong cause an
20205         error) perform implicit integer constant conversions as well.
20206
20207 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20208
20209         * expression.cs (UserImplicitCast): Method should always be
20210         non-null. 
20211         (Invocation::BetterConversion): Simplified test for IntLiteral.
20212
20213         (Expression::ImplicitNumericConversion): Split this routine out.
20214         Put the code that performs implicit constant integer conversions
20215         here. 
20216
20217         (Expression::Resolve): Become a wrapper around DoResolve so we can
20218         check eclass and type being set after resolve.
20219
20220         (Invocation::Badness): Remove this dead function
20221
20222         (Binary::ResolveOperator): Do not compute the expensive argumnets
20223         unless we have a union for it.
20224
20225         (Probe::Emit): Is needs to do an isinst and then
20226         compare against null.
20227
20228         (::CanConvert): Added Location argument.  If the Location argument
20229         is null (Location.Null), then we do not report errors.  This is
20230         used by the `probe' mechanism of the Explicit conversion.  We do
20231         not want to generate an error for something that the user
20232         explicitly requested to be casted.  But the pipeline for an
20233         explicit cast first tests for potential implicit casts.
20234
20235         So for now, if the Location is null, it means `Probe only' to
20236         avoid adding another argument.   Might have to revise this
20237         strategy later.
20238
20239         (ClassCast): New class used to type cast objects into arbitrary
20240         classes (used in Explicit Reference Conversions).
20241
20242         Implement `as' as well.
20243
20244         Reverted all the patches from Ravi below: they were broken:
20245
20246                 * The use of `level' as a mechanism to stop recursive
20247                   invocations is wrong.  That was there just to catch the
20248                   bug with a strack trace but not as a way of addressing
20249                   the problem.
20250
20251                   To fix the problem we have to *understand* what is going
20252                   on and the interactions and come up with a plan, not
20253                   just get things going.
20254
20255                 * The use of the type conversion cache that I proposed
20256                   last night had an open topic: How does this work across
20257                   protection domains.  A user defined conversion might not
20258                   be public in the location where we are applying the
20259                   conversion, a different conversion might be selected
20260                   (ie, private A->B (better) but public B->A (worse),
20261                   inside A, A->B applies, but outside it, B->A will
20262                   apply).
20263
20264                 * On top of that (ie, even if the above is solved),
20265                   conversions in a cache need to be abstract.  Ie, `To
20266                   convert from an Int to a Short use an OpcodeCast', not
20267                   `To convert from an Int to a Short use the OpcodeCast on
20268                   the variable 5' (which is what this patch was doing).
20269
20270 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20271
20272         * expression.cs (Invocation::ConversionExists): Re-write to use
20273         the conversion cache
20274
20275         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20276         cache all conversions done, not just user-defined ones.
20277
20278         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20279         to determine if a conversion exists instead of acutually trying to 
20280         perform the conversion. It's faster too.
20281
20282         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20283         and only then attempt the implicit conversion.
20284
20285 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20286
20287         * expression.cs (ConvertImplicit): Use a cache for conversions
20288         already found. Check level of recursion and bail out if necessary.
20289
20290 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20291
20292         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20293         Export standard methods that we expect for string operations.
20294
20295         * statement.cs (Block::UsageWarning): Track usage of variables and
20296         report the errors for not used variables.
20297
20298         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20299         operator. 
20300
20301 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20302
20303         * codegen.cs: remove unnneded code 
20304
20305         * expression.cs: Removed BuiltinTypeAccess class
20306
20307         Fix the order in which implicit conversions are
20308         done.  
20309
20310         The previous fixed dropped support for boxed conversions (adding a
20311         test to the test suite now)
20312
20313         (UserImplicitCast::CanConvert): Remove test for source being null,
20314         that code is broken.  We should not feed a null to begin with, if
20315         we do, then we should track the bug where the problem originates
20316         and not try to cover it up here.
20317
20318         Return a resolved expression of type UserImplicitCast on success
20319         rather than true/false.  Ravi: this is what I was talking about,
20320         the pattern is to use a static method as a "constructor" for
20321         objects. 
20322
20323         Also, do not create arguments until the very last minute,
20324         otherwise we always create the arguments even for lookups that
20325         will never be performed. 
20326
20327         (UserImplicitCast::Resolve): Eliminate, objects of type
20328         UserImplicitCast are born in a fully resolved state. 
20329
20330         * typemanager.cs (InitCoreTypes): Init also value_type
20331         (System.ValueType). 
20332
20333         * expression.cs (Cast::Resolve): First resolve the child expression.
20334
20335         (LValue): Add new method AddressOf to be used by
20336         the `&' operator.  
20337
20338         Change the argument of Store to take an EmitContext instead of an
20339         ILGenerator, because things like FieldExpr need to be able to call
20340         their children expression to generate the instance code. 
20341
20342         (Expression::Error, Expression::Warning): Sugar functions for
20343         reporting errors.
20344
20345         (Expression::MemberLookup): Accept a TypeContainer instead of a
20346         Report as the first argument.
20347
20348         (Expression::ResolvePrimary): Killed.  I still want to improve
20349         this as currently the code is just not right.
20350
20351         (Expression::ResolveMemberAccess): Simplify, but it is still
20352         wrong. 
20353
20354         (Unary::Resolve): Catch errors in AddressOf operators.
20355
20356         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20357         index to a byte for the short-version, or the compiler will choose
20358         the wrong Emit call, which generates the wrong data.
20359
20360         (ParameterReference::Emit, ::Store): same.
20361
20362         (FieldExpr::AddressOf): Implement.
20363
20364         * typemanager.cs: TypeManager: made public variable instead of
20365         property.
20366
20367         * driver.cs: document --fatal.
20368
20369         * report.cs (ErrorMessage, WarningMessage): new names for the old
20370         Error and Warning classes.
20371
20372         * cs-parser.jay (member_access): Turn built-in access to types
20373         into a normal simplename
20374
20375 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20376
20377         * expression.cs (Invocation::BetterConversion): Fix to cope
20378         with q being null, since this was introducing a bug.
20379
20380         * expression.cs (ConvertImplicit): Do built-in conversions first.
20381
20382 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20383
20384         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20385
20386 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20387
20388         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20389         I had introduced long ago (what's new ?).
20390
20391         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20392         the work of all the checking. 
20393         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20394         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20395
20396         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20397         that is the right way. 
20398
20399         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20400         overloading resolution. Use everywhere instead of cutting and pasting code.
20401
20402         (Binary::ResolveOperator): Use MakeUnionSet.
20403
20404         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20405         we have to convert to bool types. Not complete yet.
20406
20407 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * typemanager.cs (TypeManager::CSharpName): support ushort.
20410
20411         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20412         to provide an expression that performsn an implicit constant int
20413         conversion (section 6.1.6).
20414         (Expression::ConvertImplicitRequired): Reworked to include
20415         implicit constant expression conversions.
20416
20417         (Expression::ConvertNumericExplicit): Finished.
20418
20419         (Invocation::Emit): If InstanceExpression is null, then it means
20420         that we perform a call on this.
20421
20422 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20423
20424         * expression.cs (Unary::Emit): Remove some dead code.
20425         (Probe): Implement Resolve and Emit for `is'.
20426         (Expression::ConvertImplicitRequired): Attempt to do constant
20427         expression conversions here.  Maybe should be moved to
20428         ConvertImplicit, but I am not sure.
20429         (Expression::ImplicitLongConstantConversionPossible,
20430         Expression::ImplicitIntConstantConversionPossible): New functions
20431         that tell whether is it possible to apply an implicit constant
20432         expression conversion.
20433
20434         (ConvertNumericExplicit): Started work on explicit numeric
20435         conversions.
20436
20437         * cs-parser.jay: Update operator constants.
20438
20439         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20440         (Parameters::GetSignature): Hook up VerifyArgs here.
20441         (Parameters::VerifyArgs): Verifies that no two arguments have the
20442         same name. 
20443
20444         * class.cs (Operator): Update the operator names to reflect the
20445         ones that the spec expects (as we are just stringizing the
20446         operator names).
20447
20448         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20449         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20450         previous usage did only work for our methods.
20451         (Expression::ConvertImplicit): Handle decimal implicit numeric
20452         conversions as well.
20453         (Expression::InternalTypeConstructor): Used to invoke constructors
20454         on internal types for default promotions.
20455
20456         (Unary::Emit): Implement special handling for the pre/post
20457         increment/decrement for overloaded operators, as they need to have
20458         the same semantics as the other operators.
20459
20460         (Binary::ResolveOperator): ditto.
20461         (Invocation::ConversionExists): ditto.
20462         (UserImplicitCast::Resolve): ditto.
20463
20464 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20465
20466         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20467         operator, return after emitting body. Regression tests pass again !
20468
20469         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20470         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20471         (Invocation::OverloadResolve): Ditto.
20472         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20473
20474         * everywhere : update calls to the above methods accordingly.
20475
20476 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20477
20478         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20479
20480         * expression.cs (ExpressionStatement): New base class used for
20481         expressions that can appear in statements, so that we can provide
20482         an alternate path to generate expression that do not leave a value
20483         on the stack.
20484
20485         (Expression::Emit, and all the derivatives): We no longer return
20486         whether a value is left on the stack or not.  Every expression
20487         after being emitted leaves a single value on the stack.
20488
20489         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20490         facilties of ExpressionStatement if possible.
20491
20492         * cs-parser.jay: Update statement_expression.
20493
20494 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20495
20496         * driver.cs: Change the wording of message
20497
20498 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20499
20500         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20501         the type of the expression to the return type of the method if
20502         we have an overloaded operator match ! The regression tests pass again !
20503         (Unary::ResolveOperator): Ditto.
20504
20505         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20506         to find "op_Implicit", not "implicit" ;-)
20507         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20508         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20509
20510         * everywhere : Correct calls to the above accordingly.
20511
20512         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20513         (ConvertImplicit): Do user-defined conversion if it exists.
20514
20515 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20516
20517         * assign.cs: track location.
20518         (Resolve): Use implicit conversions on assignment.
20519
20520         * literal.cs: Oops.  Not good, Emit of short access values should
20521         pass (Bytes) or the wrong argument will be selected.
20522
20523         * expression.cs (Unary::Emit): Emit code for -expr.
20524
20525         (Unary::ResolveOperator): Handle `Substract' for non-constants
20526         (substract from zero from the non-constants).
20527         Deal with Doubles as well. 
20528
20529         (Expression::ConvertImplicitRequired): New routine that reports an
20530         error if no implicit conversion exists. 
20531
20532         (Invocation::OverloadResolve): Store the converted implicit
20533         expressions if we make them
20534
20535 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20536
20537         * class.cs (ConstructorInitializer): Take a Location argument.
20538         (ConstructorBaseInitializer): Same here.
20539         (ConstructorThisInitializer): Same here.
20540
20541         * cs-parser.jay : Update all calls accordingly.
20542
20543         * expression.cs (Unary, Binary, New): Take location argument.
20544         Update accordingly everywhere.
20545
20546         * cs-parser.jay : Update all calls to the above to take a location
20547         argument.
20548
20549         * class.cs : Ditto.
20550
20551 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20552
20553         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20554         (Invocation::BetterConversion): Same here
20555         (Invocation::ConversionExists): Ditto.
20556
20557         (Invocation::ConversionExists): Implement.
20558
20559 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20560
20561         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20562         Also take an additional TypeContainer argument.
20563
20564         * All over : Pass in TypeContainer as argument to OverloadResolve.
20565
20566         * typemanager.cs (CSharpName): Update to check for the string type and return
20567         that too.
20568
20569         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20570         a given method.
20571
20572 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20573
20574         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20575         (Invocation::BetterFunction): Implement.
20576         (Invocation::BetterConversion): Implement.
20577         (Invocation::ConversionExists): Skeleton, no implementation yet.
20578
20579         Okay, things work fine !
20580
20581 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20582
20583         * typemanager.cs: declare and load enum_type, delegate_type and
20584         void_type. 
20585
20586         * expression.cs (Expression::Emit): Now emit returns a value that
20587         tells whether a value is left on the stack or not.  This strategy
20588         might be reveted tomorrow with a mechanism that would address
20589         multiple assignments.
20590         (Expression::report118): Utility routine to report mismatches on
20591         the ExprClass.
20592
20593         (Unary::Report23): Report impossible type/operator combination
20594         utility function.
20595
20596         (Unary::IsIncrementableNumber): Whether the type can be
20597         incremented or decremented with add.
20598         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20599         complemented. 
20600         (Unary::ResolveOperator): Implement ++, !, ~,
20601
20602         (Invocation::Emit): Deal with new Emit convetion.
20603
20604         * All Expression derivatives: Updated their Emit method to return
20605         whether they leave values on the stack or not.
20606
20607         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20608         stack for expressions that are statements. 
20609
20610 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20611
20612         * expression.cs (LValue): New interface.  Must be implemented by
20613         LValue objects.
20614         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20615         LValue interface.
20616
20617         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20618         interface for generating code, simplifies the code.
20619
20620 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20621
20622         * expression.cs (everywhere): Comment out return statements in ::Resolve
20623         methods to avoid the warnings.
20624
20625 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20626
20627         * driver.cs (parse): Report error 2001 if we can not open the
20628         source file.
20629
20630         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20631         not resolve it.
20632
20633         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20634         object. 
20635
20636         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20637         otherwise nested blocks end up with the same index.
20638
20639         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20640
20641         * expression.cs:  Instead of having FIXMEs in the Resolve
20642         functions, throw exceptions so it is obvious that we are facing a
20643         bug. 
20644
20645         * cs-parser.jay (invocation_expression): Pass Location information.
20646
20647         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20648         Use a basename for those routines because .NET does not like paths
20649         on them. 
20650
20651         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20652         already defined.
20653
20654 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20655
20656         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20657         are loading the correct data types (throws an exception if not).
20658         (TypeManager::InitCoreTypes): Use CoreLookupType
20659
20660         * expression.cs (Unary::ResolveOperator): return the child
20661         expression for expressions which are just +expr.
20662         (Unary::ResolveOperator): Return negative literals for -LITERAL
20663         expressions (otherwise they are Unary {Literal}).
20664         (Invocation::Badness): Take into account `Implicit constant
20665         expression conversions'.
20666
20667         * literal.cs (LongLiteral): Implement long literal class.
20668         (IntLiteral): export the `Value' of the intliteral. 
20669
20670 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20671
20672         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20673
20674         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20675         instead of 'Operator'
20676
20677         * expression.cs (Binary::ResolveOperator): Update accordingly.
20678         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20679         and 'Minus'
20680
20681         * cs-parser.jay (unary_expression): Update to use the new names.
20682
20683         * gen-treedump.cs (GetUnary): Same here.
20684
20685         * expression.cs (Unary::Resolve): Implement.
20686         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20687         operators are found instead of making noise ;-)
20688         (Unary::ResolveOperator): New method to do precisely the same thing which
20689         Binary::ResolveOperator does for Binary expressions.
20690         (Unary.method, .Arguments): Add.
20691         (Unary::OperName): Implement.   
20692         (Unary::ForceConversion): Copy and Paste !
20693
20694         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20695         a unary operator.
20696
20697         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20698         for the inbuilt operators. Only overloading works for now ;-)
20699
20700 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20701
20702         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20703         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20704
20705         * expression.cs (This::Emit): Implement. 
20706         (This::Resolve): Implement.
20707         (TypeOf:Resolve): Implement.
20708         (Expression::ResolveSimpleName): Add an implicit this to instance
20709         field references. 
20710         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20711         Bind instance variable to Field expressions.
20712         (FieldExpr::Instance): New field used to track the expression that
20713         represents the object instance.
20714         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20715         binding 
20716         (FieldExpr::Emit): Implement.
20717
20718         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20719         the last instruction contains a return opcode to avoid generating
20720         the last `ret' instruction (this generates correct code, and it is
20721         nice to pass the peverify output).
20722
20723         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20724         initializer for static and instance variables.
20725         (Constructor::Emit): Allow initializer to be null in the case of
20726         static constructors.  Only emit initializer for instance
20727         constructors. 
20728
20729         (TypeContainer::FindMembers): Return a null array if there are no
20730         matches.
20731
20732         Also fix the code for the MemberTypes.Method branch, as it was not
20733         scanning that for operators (or tried to access null variables before).
20734
20735         * assign.cs (Assign::Emit): Handle instance and static fields. 
20736
20737         * TODO: Updated.
20738
20739         * driver.cs: Stop compilation if there are parse errors.
20740
20741         * cs-parser.jay (constructor_declaration): Provide default base
20742         initializer for non-static constructors.
20743         (constructor_declarator): Do not provide a default base
20744         initializers if none was specified.
20745         Catch the fact that constructors should not have parameters.
20746
20747         * class.cs: Do not emit parent class initializers for static
20748         constructors, that should be flagged as an error.
20749
20750 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20751
20752         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20753         Move back code into TypeContainer::Populate.
20754
20755 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20756
20757         * class.cs (TypeContainer::AddConstructor): Fix the check to
20758         compare against Name, not Basename. 
20759         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20760
20761         * cs-parser.jay : Update accordingly.
20762
20763         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20764         for methods, don't forget to look into the operators too.
20765         (RegisterMethodBuilder): Helper method to take care of this for
20766         methods, constructors and operators.
20767         (Operator::Define): Completely revamp.
20768         (Operator.OperatorMethod, MethodName): New fields.
20769         (TypeContainer::Populate): Move the registering of builders into
20770         RegisterMethodBuilder.
20771         (Operator::Emit): Re-write.
20772
20773         * expression.cs (Binary::Emit): Comment out code path to emit method
20774         invocation stuff for the case when we have a user defined operator. I am
20775         just not able to get it right !
20776
20777 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20780         argument. 
20781
20782         (Expression::MemberLookup): Provide a version that allows to
20783         specify the MemberTypes and BindingFlags. 
20784
20785         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20786         so it was not fetching variable information from outer blocks.
20787
20788         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20789         Beforefieldinit as it was buggy.
20790
20791         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20792         that Ravi put here.  
20793
20794         * class.cs (Constructor::Emit): Only emit if block is not null.
20795         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20796         deal with this by semantically definining it as if the user had
20797         done it.
20798
20799         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20800         constructors as we now "emit" them at a higher level.
20801
20802         (TypeContainer::DefineDefaultConstructor): Used to define the
20803         default constructors if none was provided.
20804
20805         (ConstructorInitializer): Add methods Resolve and Emit. 
20806
20807         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20808
20809 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20810
20811         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20812         the default constructor builder with our hashtable for methodbuilders
20813         to methodcores.
20814
20815         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20816         and argument_count is 0 in which case we have a match.
20817         (Binary::ResolveOperator): More null checking and miscellaneous coding
20818         style cleanup.
20819
20820 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20821
20822         * rootcontext.cs (IsNameSpace): Compare against null.
20823
20824         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20825
20826         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20827         and Unary::Operator.
20828
20829         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20830         accordingly.
20831
20832         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20833         we have overloaded operators.
20834         (Binary::ResolveOperator): Implement the part which does the operator overload
20835         resolution.
20836
20837         * class.cs (Operator::Emit): Implement.
20838         (TypeContainer::Emit): Emit the operators we have too.
20839
20840         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20841         the case when we have a user-defined operator.
20842
20843 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20844
20845         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20846
20847 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20848
20849         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20850         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20851         (Constructor::Emit): Implement.
20852         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20853         if we have no work to do. 
20854         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20855         Emit method.
20856
20857         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20858         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20859
20860         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20861         of parent.parent.
20862
20863 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20864
20865         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20866         in the source.
20867         (Tree::RecordNamespace): Method to do what the name says ;-)
20868         (Tree::Namespaces): Property to get at the namespaces hashtable.
20869
20870         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20871         keep track.
20872
20873         * rootcontext.cs (IsNamespace): Fixed it :-)
20874
20875 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20876
20877         * class.cs (TypeContainer::FindMembers): Add support for
20878         constructors. 
20879         (MethodCore): New class that encapsulates both the shared aspects
20880         of a Constructor and a Method.  
20881         (Method, Constructor): Factored pieces into MethodCore.
20882
20883         * driver.cs: Added --fatal which makes errors throw exceptions.
20884         Load System assembly as well as part of the standard library.
20885
20886         * report.cs: Allow throwing exceptions on errors for debugging.
20887
20888         * modifiers.cs: Do not use `parent', instead use the real type
20889         container to evaluate permission settings.
20890
20891         * class.cs: Put Ravi's patch back in.  He is right, and we will
20892         have to cope with the
20893
20894 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20895
20896         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20897         FamORAssem, not FamANDAssem.
20898
20899 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20900
20901         * driver.cs: Added --parse option that only parses its input files
20902         and terminates.
20903
20904         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20905         incorrect.  IsTopLevel is not used to tell whether an object is
20906         root_types or not (that can be achieved by testing this ==
20907         root_types).  But to see if this is a top-level *class* (not
20908         necessarly our "toplevel" container). 
20909
20910 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20911
20912         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20913         parent instead of a direct call to GetType.
20914
20915 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20916
20917         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20918         Modifiers.TypeAttr. This should just be a call to that method.
20919
20920         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20921         object so that we can determine if we are top-level or not.
20922
20923         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20924         TypeContainer too.
20925
20926         * enum.cs (Enum::Define): Ditto.
20927
20928         * modifiers.cs (FieldAttr): Re-write.
20929
20930         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20931         (TypeContainer::HaveStaticConstructor): New property to provide access
20932         to precisely that info.
20933
20934         * modifiers.cs (MethodAttr): Re-write.
20935         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20936
20937         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20938         of top-level types as claimed.
20939
20940 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20941
20942         * expression.cs (MemberLookup): Fruitless attempt to lookup
20943         constructors.  Maybe I need to emit default constructors?  That
20944         might be it (currently .NET emits this for me automatically).
20945         (Invocation::OverloadResolve): Cope with Arguments == null.
20946         (Invocation::EmitArguments): new function, shared by the new
20947         constructor and us.
20948         (Invocation::Emit): Handle static and instance methods.  Emit
20949         proper call instruction for virtual or non-virtual invocations.
20950         (New::Emit): Implement.
20951         (New::Resolve): Implement.
20952         (MemberAccess:Resolve): Implement.
20953         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20954         to track instances.
20955         (FieldExpr::Resolve): Set type.
20956
20957         * support.cs: Handle empty arguments.
20958                 
20959         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20960         SimpleLookup): Auxiliary routines to help parse a qualifier
20961         identifier.  
20962
20963         Update qualifier_identifier rule.
20964
20965         * codegen.cs: Removed debugging messages.
20966
20967         * class.cs: Make this a global thing, this acts just as a "key" to
20968         objects that we might have around.
20969
20970         (Populate): Only initialize method_builders_to_methods once.
20971
20972         * expression.cs (PropertyExpr): Initialize type from the
20973         PropertyType. 
20974
20975         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20976         Resolve pattern.  Attempt to implicitly convert value to boolean.
20977         Emit code.
20978
20979         * expression.cs: Set the type for the int32/int32 argument case.
20980         (Binary::ResolveOperator): Set the return type to boolean for
20981         comparission operators
20982
20983         * typemanager.cs: Remove debugging print code.
20984
20985         (Invocation::Resolve): resolve type.
20986
20987         * class.cs: Allocate a MemberInfo of the correct size, as the code
20988         elsewhere depends on the test to reflect the correct contents.
20989
20990         (Method::) Keep track of parameters, due to System.Reflection holes
20991
20992         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20993         mapping here.
20994
20995         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20996         of the exact size and return that.
20997
20998         (Class::LookupMethodByBuilder): New function that maps
20999         MethodBuilders to its methods.  Required to locate the information
21000         on methods because System.Reflection bit us again.
21001
21002         * support.cs: New file, contains an interface ParameterData and
21003         two implementations: ReflectionParameters and InternalParameters
21004         used to access Parameter information.  We will need to grow this
21005         as required.
21006
21007         * expression.cs (Invocation::GetParameterData): implement a cache
21008         and a wrapper around the ParameterData creation for methods. 
21009         (Invocation::OverloadResolve): Use new code.
21010
21011 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21012
21013         * class.cs (TypeContainer::EmitField): Remove and move into 
21014         (Field::Define): here and modify accordingly.
21015         (Field.FieldBuilder): New member.
21016         (TypeContainer::Populate): Update accordingly.
21017         (TypeContainer::FindMembers): Implement.
21018
21019 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * statement.cs: (VariableInfo::VariableType): New field to be
21022         initialized with the full type once it is resolved. 
21023
21024 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21025
21026         * parameter.cs (GetParameterInfo): Use a type cache to compute
21027         things only once, and to reuse this information
21028
21029         * expression.cs (LocalVariableReference::Emit): Implement.
21030         (OpcodeCast::Emit): fix.
21031
21032         (ParameterReference::Resolve): Implement.
21033         (ParameterReference::Emit): Implement.
21034
21035         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21036         that are expressions need to stay as Expressions.
21037
21038         * typemanager.cs (CSharpName): Returns the C# name of a type if
21039         possible. 
21040
21041         * expression.cs (Expression::ConvertImplicit): New function that
21042         implements implicit type conversions.
21043
21044         (Expression::ImplicitReferenceConversion): Implements implicit
21045         reference conversions.
21046
21047         (EmptyCast): New type for transparent casts.
21048
21049         (OpcodeCast): New type for casts of types that are performed with
21050         a sequence of bytecodes.
21051
21052         (BoxedCast): New type used for casting value types into reference
21053         types.  Emits a box opcode.
21054
21055         (Binary::DoNumericPromotions): Implements numeric promotions of
21056         and computation of the Binary::Type.
21057
21058         (Binary::EmitBranchable): Optimization.
21059
21060         (Binary::Emit): Implement code emission for expressions.
21061
21062         * typemanager.cs (TypeManager): Added two new core types: sbyte
21063         and byte.
21064
21065 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21066
21067         * class.cs (TypeContainer::FindMembers): Method which does exactly
21068         what Type.FindMembers does, only we don't have to use reflection. No
21069         implementation yet.
21070
21071         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21072         typecontainer objects as we need to get at them.
21073         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21074
21075         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21076         typecontainer object.
21077
21078         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21079         of just a Report object.
21080
21081 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21082
21083         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21084         "remove_"
21085         (TypeContainer::Populate): Now define the delegates of the type too.
21086         (TypeContainer.Delegates): Property to access the list of delegates defined
21087         in the type.
21088
21089         * delegates.cs (Delegate::Define): Implement partially.
21090
21091         * modifiers.cs (TypeAttr): Handle more flags.
21092
21093 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21094
21095         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21096         and not <=
21097         (Operator::Define): Re-write logic to get types by using the LookupType method
21098         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21099         (Indexer::Define): Ditto.
21100         (Event::Define): Ditto.
21101         (Property::Define): Ditto.
21102
21103 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21104
21105         * class.cs (TypeContainer::Populate): Now define operators too. 
21106         (TypeContainer.Operators): New property to access the list of operators
21107         in a type.
21108         (Operator.OperatorMethodBuilder): New member to hold the method builder
21109         for the operator we are defining.
21110         (Operator::Define): Implement.
21111
21112 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21113
21114         * class.cs (Event::Define): Make the prefixes of the accessor methods
21115         addOn_ and removeOn_ 
21116
21117         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21118         of the location being passed in too. Ideally, this should go later since all
21119         error reporting should be done through the Report object.
21120
21121         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21122         (Populate): Iterate thru the indexers we have and define them too.
21123         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21124         for the get and set accessors.
21125         (Indexer::Define): Implement.
21126
21127 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21128
21129         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21130         my previous implementation, did not work.
21131
21132         * typemanager.cs: Add a couple of missing types (the longs).
21133
21134         * literal.cs: Use TypeManager.bool_type instead of getting it.
21135
21136         * expression.cs (EventExpr): New kind of expressions.
21137         (Expressio::ExprClassFromMemberInfo): finish
21138
21139 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21140
21141         * assign.cs: Emit stores to static fields differently.
21142
21143 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21144
21145         * Merge in changes and adjust code to tackle conflicts. Backed out my
21146         code in Assign::Resolve ;-) 
21147
21148 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21149
21150         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21151         instead Report.Error and also pass in the location.
21152         (CSharpParser::Lexer): New readonly property to return the reference
21153         to the Tokenizer object.
21154         (declare_local_variables): Use Report.Error with location instead of plain 
21155         old error.
21156         (CheckDef): Ditto.
21157
21158         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21159         (Operator.CheckBinaryOperator): Ditto.
21160
21161         * cs-parser.jay (operator_declarator): Update accordingly.
21162
21163         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21164         (CheckBinaryOperator): Same here.
21165
21166         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21167         on the name without any prefixes of namespace names etc. This is because we
21168         already might have something already fully qualified like 
21169         'System.Console.WriteLine'
21170
21171         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21172
21173 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21174
21175         * cs-tokenizer.cs (location): Return a string which also contains
21176         the file name.
21177
21178         * expression.cs (ElementAccess): New class for expressions of the
21179         type 'element access.'
21180         (BaseAccess): New class for expressions of the type 'base access.'
21181         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21182         respectively.
21183
21184         * cs-parser.jay (element_access): Implement action.
21185         (base_access): Implement actions.
21186         (checked_expression, unchecked_expression): Implement.
21187
21188         * cs-parser.jay (local_variable_type): Correct and implement.
21189         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21190
21191         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21192
21193         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21194         name and the specifiers.
21195
21196         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21197
21198         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21199         making them all public ;-)
21200
21201         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21202         class anyways.
21203
21204 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21205
21206         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21207         PropertyExprs.
21208         (FieldExpr, PropertyExprs): New resolved expressions.
21209         (SimpleName::MemberStaticCheck): Perform static checks for access
21210         to non-static fields on static methods. Maybe this should be
21211         generalized for MemberAccesses. 
21212         (SimpleName::ResolveSimpleName): More work on simple name
21213         resolution. 
21214
21215         * cs-parser.jay (primary_expression/qualified_identifier): track
21216         the parameter index.
21217
21218         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21219         (EmitContext::EmitBoolExpression): Chain to expression generation
21220         instead of temporary hack.
21221         (::EmitStatementExpression): Put generic expression code generation.
21222
21223         * assign.cs (Assign::Emit): Implement variable assignments to
21224         local variables, parameters and fields.
21225
21226 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21227
21228         * statement.cs (Block::GetVariableInfo): New method, returns the
21229         VariableInfo for a variable name in a block.
21230         (Block::GetVariableType): Implement in terms of GetVariableInfo
21231
21232         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21233         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21234
21235 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21236
21237         * cs-parser.jay (operator_declaration): Continue on my quest : update
21238         to take attributes argument.
21239         (event_declaration): Ditto.
21240         (enum_declaration): Ditto.
21241         (indexer_declaration): Ditto.
21242
21243         * class.cs (Operator::Operator): Update constructor accordingly.
21244         (Event::Event): Ditto.
21245
21246         * delegate.cs (Delegate::Delegate): Same here.
21247
21248         * enum.cs (Enum::Enum): Same here.
21249
21250 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21251
21252         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21253
21254         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21255
21256         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21257         being passed around as an arraylist.
21258         (Attributes::AddAttribute): Method to add attribute sections.
21259
21260         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21261         (struct_declaration): Update accordingly.
21262         (constant_declaration): Update.
21263         (field_declaration): Update.
21264         (method_header): Update.
21265         (fixed_parameter): Update.
21266         (parameter_array): Ditto.
21267         (property_declaration): Ditto.
21268         (destructor_declaration): Ditto.
21269
21270         * class.cs (Struct::Struct): Update constructors accordingly.
21271         (Class::Class): Ditto.
21272         (Field::Field): Ditto.
21273         (Method::Method): Ditto.
21274         (Property::Property): Ditto.
21275         (TypeContainer::OptAttribute): update property's return type.
21276
21277         * interface.cs (Interface.opt_attributes): New member.
21278         (Interface::Interface): Update to take the extra Attributes argument.
21279
21280         * parameter.cs (Parameter::Parameter): Ditto.
21281
21282         * constant.cs (Constant::Constant): Ditto.
21283
21284         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21285         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21286         the attributes as a parameter.
21287         (InterfaceProperty): Update constructor call.
21288         (InterfaceEvent): Ditto.
21289         (InterfaceMethod): Ditto.
21290         (InterfaceIndexer): Ditto.
21291
21292         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21293         pass the attributes too.
21294         (interface_event_declaration): Ditto.
21295         (interface_property_declaration): Ditto.
21296         (interface_method_declaration): Ditto.
21297         (interface_declaration): Ditto.
21298
21299 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21300
21301         * class.cs (Method::Define): Track the "static Main" definition to
21302         create an entry point. 
21303
21304         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21305         EntryPoint if we find it. 
21306
21307         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21308         (EmitContext::ig): Make this variable public.
21309
21310         * driver.cs: Make the default output file be the first file name
21311         with the .exe extension.  
21312
21313         Detect empty compilations
21314
21315         Handle various kinds of output targets.  Handle --target and
21316         rename -t to --dumper.
21317
21318         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21319         methods inherited from Expression return now an Expression.  This
21320         will is used during the tree rewriting as we resolve them during
21321         semantic analysis.
21322
21323         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21324         the spec.  Missing entirely is the information about
21325         accessability of elements of it.
21326
21327         (Expression::ExprClassFromMemberInfo): New constructor for
21328         Expressions that creates a fully initialized Expression based on
21329         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21330         a Type.
21331
21332         (Invocation::Resolve): Begin implementing resolution of invocations.
21333
21334         * literal.cs (StringLiteral):  Implement Emit.
21335
21336 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21337
21338         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21339         member.
21340
21341 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21342
21343         * cs-parser.jay (attribute_arguments): Implement actions.
21344         (attribute): Fix bug in production. Implement action.
21345         (attribute_list): Implement.
21346         (attribute_target): Implement.
21347         (attribute_target_specifier, opt_target_specifier): Implement
21348         (CheckAttributeTarget): New method to check if the attribute target
21349         is valid.
21350         (attribute_section): Implement.
21351         (opt_attributes): Implement.
21352
21353         * attribute.cs : New file to handle attributes.
21354         (Attribute): Class to hold attribute info.
21355
21356         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21357         (attribute_section): Modify production to use 2 different rules to 
21358         achieve the same thing. 1 s/r conflict down !
21359         Clean out commented, useless, non-reducing dimension_separator rules.
21360
21361         * class.cs (TypeContainer.attributes): New member to hold list
21362         of attributes for a type.
21363         (Struct::Struct): Modify to take one more argument, the attribute list.
21364         (Class::Class): Ditto.
21365         (Field::Field): Ditto.
21366         (Method::Method): Ditto.
21367         (Property::Property): Ditto.
21368
21369         * cs-parser.jay (struct_declaration): Update constructor call to
21370         pass in the attributes too.
21371         (class_declaration): Ditto.
21372         (constant_declaration): Ditto.
21373         (field_declaration): Ditto.
21374         (method_header): Ditto.
21375         (fixed_parameter): Ditto.
21376         (parameter_array): Ditto.
21377         (property_declaration): Ditto.
21378
21379         * constant.cs (Constant::Constant): Update constructor similarly.
21380         Use System.Collections.
21381
21382         * parameter.cs (Parameter::Parameter): Update as above.
21383
21384 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21385
21386         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21387         (TypeContainer.delegates): New member to hold list of delegates.
21388
21389         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21390         this time as I seem to be on crack ;-)
21391
21392 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21393
21394         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21395         tell whether an identifier represents a namespace.
21396
21397         * expression.cs (NamespaceExpr): A namespace expression, used only
21398         temporarly during expression resolution.
21399         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21400         utility functions to resolve names on expressions.
21401
21402 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21403
21404         * codegen.cs: Add hook for StatementExpressions. 
21405
21406         * class.cs: Fix inverted test for static flag in methods.
21407
21408 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21409
21410         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21411         to make it coincide with MS' number.
21412         (Operator::CheckBinaryOperator): Ditto.
21413
21414         * ../errors/errors.txt : Remove error numbers added earlier.
21415
21416         * ../errors/cs1019.cs : Test case for error # 1019
21417
21418         * ../errros/cs1020.cs : Test case for error # 1020
21419
21420         * cs-parser.jay : Clean out commented cruft.
21421         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21422         used anywhere - non-reducing rule.
21423         (namespace_declarations): Non-reducing rule - comment out.
21424
21425         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21426         with TypeContainer::AddEnum.
21427
21428         * delegate.cs : New file for delegate handling classes.
21429         (Delegate): Class for declaring delegates.
21430
21431         * makefile : Update.
21432
21433         * cs-parser.jay (delegate_declaration): Implement.
21434
21435 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21436
21437         * class.cs (Event::Define): Implement.
21438         (Event.EventBuilder): New member.
21439
21440         * class.cs (TypeContainer::Populate): Update to define all enums and events
21441         we have.
21442         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21443         readonly fields for all these cases ?
21444
21445 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21446
21447         * class.cs (Property): Revamp to use the convention of making fields readonly.
21448         Accordingly modify code elsewhere.
21449
21450         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21451         the Define method of the Property class.
21452
21453         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21454         trivial bug.
21455         (TypeContainer::Populate): Update to define all the properties we have. Also
21456         define all enumerations.
21457
21458         * enum.cs (Define): Implement.
21459
21460 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21461
21462         * cs-parser.jay (overloadable_operator): The semantic value is an
21463         enum of the Operator class.
21464         (operator_declarator): Implement actions.
21465         (operator_declaration): Implement.
21466
21467         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21468         validity of definitions.
21469         (Operator::CheckBinaryOperator): Static method to check for binary operators
21470         (TypeContainer::AddOperator): New method to add an operator to a type.
21471
21472         * cs-parser.jay (indexer_declaration): Added line to actually call the
21473         AddIndexer method so it gets added ;-)
21474
21475         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21476         already taken care of by the MS compiler ?  
21477
21478 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21479
21480         * class.cs (Operator): New class for operator declarations.
21481         (Operator::OpType): Enum for the various operators.
21482
21483 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21484
21485         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21486         ostensibly handle this in semantic analysis.
21487
21488         * cs-parser.jay (general_catch_clause): Comment out
21489         (specific_catch_clauses, specific_catch_clause): Ditto.
21490         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21491         (catch_args, opt_catch_args): New productions.
21492         (catch_clause): Rewrite to use the new productions above
21493         (catch_clauses): Modify accordingly.
21494         (opt_catch_clauses): New production to use in try_statement
21495         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21496         and re-write the code in the actions to extract the specific and
21497         general catch clauses by being a little smart ;-)
21498
21499         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21500         Hooray, try and catch statements parse fine !
21501
21502 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21503
21504         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21505         string from the hashtable of variables.
21506
21507         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21508         I end up making that mistake ;-)
21509         (catch_clauses): Fixed gross error which made Key and Value of the 
21510         DictionaryEntry the same : $1 !!
21511
21512 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21513
21514         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21515
21516         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21517         when the add and remove accessors are specified. 
21518
21519 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21520
21521         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21522         information about indexer_declarator.
21523         (indexer_declarator): Implement actions.
21524         (parsing_indexer): New local boolean used to keep track of whether
21525         we are parsing indexers or properties. This is necessary because 
21526         implicit_parameters come into picture even for the get accessor in the 
21527         case of an indexer.
21528         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21529
21530         * class.cs (Indexer): New class for indexer declarations.
21531         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21532         (TypeContainer::indexers): New member to hold list of indexers for the
21533         type.
21534
21535 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21536
21537         * cs-parser.jay (add_accessor_declaration): Implement action.
21538         (remove_accessor_declaration): Implement action.
21539         (event_accessors_declaration): Implement
21540         (variable_declarators): swap statements for first rule - trivial.
21541
21542         * class.cs (Event): New class to hold information about event
21543         declarations.
21544         (TypeContainer::AddEvent): New method to add an event to a type
21545         (TypeContainer::events): New member to hold list of events.
21546
21547         * cs-parser.jay (event_declaration): Implement actions.
21548
21549 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21550
21551         * cs-parser.jay (dim_separators): Implement. Make it a string
21552         concatenating all the commas together, just as they appear.
21553         (opt_dim_separators): Modify accordingly
21554         (rank_specifiers): Update accordingly. Basically do the same
21555         thing - instead, collect the brackets here.
21556         (opt_rank_sepcifiers): Modify accordingly.
21557         (array_type): Modify to actually return the complete type string
21558         instead of ignoring the rank_specifiers.
21559         (expression_list): Implement to collect the expressions
21560         (variable_initializer): Implement. We make it a list of expressions
21561         essentially so that we can handle the array_initializer case neatly too.
21562         (variable_initializer_list): Implement.
21563         (array_initializer): Make it a list of variable_initializers
21564         (opt_array_initializer): Modify accordingly.
21565
21566         * expression.cs (New::NType): Add enumeration to help us
21567         keep track of whether we have an object/delegate creation
21568         or an array creation.
21569         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21570         members to hold data about array creation.
21571         (New:New): Modify to update NewType
21572         (New:New): New Overloaded contructor for the array creation
21573         case.
21574
21575         * cs-parser.jay (array_creation_expression): Implement to call
21576         the overloaded New constructor.
21577
21578 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21579
21580         * class.cs (TypeContainer::Constructors): Return member
21581         constructors instead of returning null.
21582
21583 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21584
21585         * typemanager.cs (InitCoreTypes): Initialize the various core
21586         types after we have populated the type manager with the user
21587         defined types (this distinction will be important later while
21588         compiling corlib.dll)
21589
21590         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21591         on Expression Classification.  Now all expressions have a method
21592         `Resolve' and a method `Emit'.
21593
21594         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21595         generation from working.     Also add some temporary debugging
21596         code. 
21597
21598 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21599
21600         * codegen.cs: Lots of code generation pieces.  This is only the
21601         beginning, will continue tomorrow with more touches of polish.  We
21602         handle the fundamentals of if, while, do, for, return.  Others are
21603         trickier and I need to start working on invocations soon.
21604
21605         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21606         s.InitStatement. 
21607
21608         * codegen.cs (EmitContext): New struct, used during code
21609         emission to keep a context.   Most of the code generation will be
21610         here. 
21611
21612         * cs-parser.jay: Add embedded blocks to the list of statements of
21613         this block.  So code generation proceeds in a top down fashion.
21614
21615 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21616
21617         * statement.cs: Add support for multiple child blocks.
21618
21619 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21620
21621         * codegen.cs (EmitCode): New function, will emit the code for a
21622         Block of code given a TypeContainer and its ILGenerator. 
21623
21624         * statement.cs (Block): Standard public readonly optimization.
21625         (Block::Block constructors): Link children. 
21626         (Block::Child): Child Linker.
21627         (Block::EmitVariables): Emits IL variable declarations.
21628
21629         * class.cs: Drop support for MethodGroups here, delay until
21630         Semantic Analysis.
21631         (Method::): Applied the same simplification that I did before, and
21632         move from Properties to public readonly fields.
21633         (Method::ParameterTypes): Returns the parameter types for the
21634         function, and implements a cache that will be useful later when I
21635         do error checking and the semantic analysis on the methods is
21636         performed.
21637         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21638         and made a method, optional argument tells whether this is a class
21639         or a structure to apply the `has-this' bit.
21640         (Method::GetCallingConvention): Implement, returns the calling
21641         convention. 
21642         (Method::Define): Defines the type, a second pass is performed
21643         later to populate the methods.
21644
21645         (Constructor::ParameterTypes): implement a cache similar to the
21646         one on Method::ParameterTypes, useful later when we do semantic
21647         analysis. 
21648
21649         (TypeContainer::EmitMethod):  New method.  Emits methods.
21650
21651         * expression.cs: Removed MethodGroup class from here.
21652
21653         * parameter.cs (Parameters::GetCallingConvention): new method.
21654
21655 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21656
21657         * class.cs (TypeContainer::Populate): Drop RootContext from the
21658         argument. 
21659
21660         (Constructor::CallingConvention): Returns the calling convention.
21661         (Constructor::ParameterTypes): Returns the constructor parameter
21662         types. 
21663
21664         (TypeContainer::AddConstructor): Keep track of default constructor
21665         and the default static constructor.
21666
21667         (Constructor::) Another class that starts using `public readonly'
21668         instead of properties. 
21669
21670         (Constructor::IsDefault): Whether this is a default constructor. 
21671
21672         (Field::) use readonly public fields instead of properties also.
21673
21674         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21675         track of static constructors;  If none is used, turn on
21676         BeforeFieldInit in the TypeAttributes. 
21677
21678         * cs-parser.jay (opt_argument_list): now the return can be null
21679         for the cases where there are no arguments. 
21680
21681         (constructor_declarator): If there is no implicit `base' or
21682         `this', then invoke the default parent constructor. 
21683
21684         * modifiers.cs (MethodAttr): New static function maps a set of
21685         modifiers flags into a MethodAttributes enum
21686         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21687         MethodAttr, TypeAttr to represent the various mappings where the
21688         modifiers are used.
21689         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21690
21691 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21692
21693         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21694         method arguments.
21695
21696         * interface.cs (PopulateIndexer): Implemented the code generator
21697         for interface indexers.
21698
21699 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21700
21701         * interface.cs (InterfaceMemberBase): Now we track the new status
21702         here.  
21703
21704         (PopulateProperty): Implement property population.  Woohoo!  Got
21705         Methods and Properties going today. 
21706
21707         Removed all the properties for interfaces, and replaced them with
21708         `public readonly' fields. 
21709
21710 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21711
21712         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21713         initialize their hashtables/arraylists only when they are needed
21714         instead of doing this always.
21715
21716         * parameter.cs: Handle refs and out parameters.
21717
21718         * cs-parser.jay: Use an ArrayList to construct the arguments
21719         instead of the ParameterCollection, and then cast that to a
21720         Parameter[] array.
21721
21722         * parameter.cs: Drop the use of ParameterCollection and use
21723         instead arrays of Parameters.
21724
21725         (GetParameterInfo): Use the Type, not the Name when resolving
21726         types. 
21727
21728 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21729
21730         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21731         and instead use public readonly fields.
21732
21733         * class.cs: Put back walking code for type containers.
21734
21735 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21736
21737         * class.cs (MakeConstant): Code to define constants.
21738
21739         * rootcontext.cs (LookupType): New function.  Used to locate types 
21740
21741
21742 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21743
21744         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21745         this System.Reflection code is.  Kudos to Microsoft
21746
21747         * typemanager.cs: Implement a type cache and avoid loading all
21748         types at boot time.  Wrap in LookupType the internals.  This made
21749         the compiler so much faster.  Wow.  I rule!
21750
21751         * driver.cs: Make sure we always load mscorlib first (for
21752         debugging purposes, nothing really important).
21753
21754         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21755         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21756
21757         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21758         on namespaces that have been imported using the `using' keyword.
21759
21760         * class.cs (TypeContainer::TypeAttr): Virtualize.
21761         (Class::TypeAttr): Return attributes suitable for this bad boy.
21762         (Struct::TypeAttr): ditto.
21763         Handle nested classes.
21764         (TypeContainer::) Remove all the type visiting code, it is now
21765         replaced with the rootcontext.cs code
21766
21767         * rootcontext.cs (GetClassBases): Added support for structs. 
21768
21769 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21770
21771         * interface.cs, statement.cs, class.cs, parameter.cs,
21772         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21773         Drop use of TypeRefs, and use strings instead.
21774
21775 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21776
21777         * rootcontext.cs: 
21778
21779         * class.cs (Struct::Struct): set the SEALED flags after
21780         checking the modifiers.
21781         (TypeContainer::TypeAttr): new property, returns the
21782         TypeAttributes for a class.  
21783
21784         * cs-parser.jay (type_list): Oops, list production was creating a
21785         new list of base types.
21786
21787         * rootcontext.cs (StdLib): New property.
21788         (GetInterfaceTypeByName): returns an interface by type name, and
21789         encapsulates error handling here.
21790         (GetInterfaces): simplified.
21791         (ResolveTree): Encapsulated all the tree resolution here.
21792         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21793         types. 
21794
21795         * driver.cs: Add support for --nostdlib, to avoid loading the
21796         default assemblies.
21797         (Main): Do not put tree resolution here. 
21798
21799         * rootcontext.cs: Beginning of the class resolution.
21800
21801 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21802
21803         * rootcontext.cs: Provide better error reporting. 
21804
21805         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21806
21807         * rootcontext.cs (CreateInterface): Handle the case where there
21808         are no parent interfaces.
21809
21810         (CloseTypes): Routine to flush types at the end.
21811         (CreateInterface): Track types.
21812         (GetInterfaces): Returns an array of Types from the list of
21813         defined interfaces.
21814
21815         * typemanager.c (AddUserType): Mechanism to track user types (puts
21816         the type on the global type hash, and allows us to close it at the
21817         end). 
21818
21819 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21820
21821         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21822         RecordInterface instead.
21823
21824         * cs-parser.jay: Updated to reflect changes above.
21825
21826         * decl.cs (Definition): Keep track of the TypeBuilder type that
21827         represents this type here.  Not sure we will use it in the long
21828         run, but wont hurt for now.
21829
21830         * driver.cs: Smaller changes to accomodate the new code.
21831
21832         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21833         when done. 
21834
21835         * rootcontext.cs (CreateInterface):  New method, used to create
21836         the System.TypeBuilder type for interfaces.
21837         (ResolveInterfaces): new entry point to resolve the interface
21838         hierarchy. 
21839         (CodeGen): Property, used to keep track of the code generator.
21840
21841 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21842
21843         * cs-parser.jay: Add a second production for delegate_declaration
21844         with `VOID'.
21845
21846         (enum_body): Put an opt_comma here instead of putting it on
21847         enum_body or enum_member_declarations so we can handle trailing
21848         commas on enumeration members.  Gets rid of a shift/reduce.
21849
21850         (type_list): Need a COMMA in the middle.
21851
21852         (indexer_declaration): Tell tokenizer to recognize get/set
21853
21854         * Remove old targets.
21855
21856         * Re-add the parser target.
21857
21858 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21859
21860         * cs-parser.jay: Add precendence rules for a number of operators
21861         ot reduce the number of shift/reduce conflicts in the grammar.
21862
21863 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21866         and put it here.
21867
21868         Get rid of old crufty code.
21869
21870         * rootcontext.cs: Use this to keep track of the parsed
21871         representation and the defined types available to the program. 
21872
21873         * gen-treedump.cs: adjust for new convention.
21874
21875         * type.cs: Split out the type manager, and the assembly builder
21876         from here. 
21877
21878         * typemanager.cs: the type manager will live here now.
21879
21880         * cil-codegen.cs: And the code generator here. 
21881
21882 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21883
21884         * makefile: Fixed up for easy making.
21885
21886 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21887
21888         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21889         the 
21890
21891         (unary_expression): Expand pre_increment_expression and
21892         post_decrement_expression to reduce a shift/reduce.
21893
21894 2001-07-11  Simon Cozens
21895
21896         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21897
21898         Improve allow_keyword_as_indent name.
21899
21900 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21901
21902         * Adjustments for Beta2. 
21903
21904 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21905
21906         * decl.cs: Added `Define' abstract method.
21907         (InTransit): new property, used to catch recursive definitions. 
21908
21909         * interface.cs: Implement `Define'. 
21910
21911         * modifiers.cs: Map Modifiers.constants to
21912         System.Reflection.TypeAttribute flags.
21913
21914         * class.cs: Keep track of types and user-defined types.
21915         (BuilderInit): New method for creating an assembly
21916         (ResolveType): New function to launch the resolution process, only
21917         used by interfaces for now.
21918
21919         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21920         that are inserted into the name space. 
21921
21922 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21923
21924         * ARGH.  I have screwed up my tree so many times due to the use of
21925         rsync rather than using CVS.  Going to fix this at once. 
21926
21927         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21928         load types.
21929
21930 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * Experiment successful: Use System.Type rather that our own
21933         version of Type.  
21934
21935 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21936
21937         * cs-parser.jay: Removed nsAliases from here.
21938
21939         Use new namespaces, handle `using XXX;' 
21940
21941         * namespace.cs: Reimplemented namespace handling, use a recursive
21942         definition of the class.  Now we can keep track of using clauses
21943         and catch invalid using clauses.
21944
21945 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21946
21947         * gen-treedump.cs: Adapted for all the renaming.
21948
21949         * expression.cs (Expression): this class now has a Type property
21950         which returns an expression Type.
21951
21952         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21953         `Type', as this has a different meaning now in the base
21954
21955 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21956
21957         * interface.cs, class.cs: Removed from all the sources the
21958         references to signature computation, as we can not do method
21959         signature computation during the parsing time, as we are not
21960         trying to solve at that point distinguishing:
21961
21962         class X {
21963                 void a (Blah x) {}
21964                 void a (NS.Blah x) {}
21965         }
21966
21967         Which depending on the context might be valid or not, as we do not
21968         know if Blah is the same thing as NS.Blah at that point.
21969
21970         * Redid everything so the code uses TypeRefs now instead of
21971         Types.  TypeRefs are just temporary type placeholders, that need
21972         to be resolved.  They initially have a pointer to a string and the
21973         current scope in which they are used.  This is used later by the
21974         compiler to resolve the reference to an actual Type. 
21975
21976         * DeclSpace is no longer a CIR.Type, and neither are
21977         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21978         are all DeclSpaces, but no Types. 
21979
21980         * type.cs (TypeRefManager): This implements the TypeRef manager,
21981         which keeps track of all the types that need to be resolved after
21982         the parsing has finished. 
21983
21984 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21985
21986         * ARGH.  We are going to have to store `foreach' as a class rather
21987         than resolving it, as we need to verify error 1579 after name
21988         resolution.   *OR* we could keep a flag that says `This request to
21989         IEnumerator comes from a foreach statement' which we can then use
21990         to generate the error.
21991
21992 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21993
21994         * class.cs (TypeContainer.AddMethod): we now add methods to the
21995         MethodGroup instead of the method hashtable.  
21996
21997         * expression.cs: Add MethodGroup abstraction, which gets us one
21998         step closer to the specification in the way we handle method
21999         declarations.  
22000
22001         * cs-parser.jay (primary_expression): qualified_identifier now
22002         tried to match up an identifier to a local variable reference or
22003         to a parameter reference.
22004
22005         current_local_parameters is now a parser global variable that
22006         points to the current parameters for the block, used during name
22007         lookup.
22008
22009         (property_declaration): Now creates an implicit `value' argument to
22010         the set accessor.
22011
22012 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * parameter.cs: Do not use `param' arguments as part of the
22015         signature, per the spec.
22016
22017 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22018
22019         * decl.cs: Base class for classes, structs and interfaces.  This
22020         is the "Declaration Space" 
22021
22022         * cs-parser.jay: Use CheckDef for checking declaration errors
22023         instead of having one on each function.
22024
22025         * class.cs: Factor out some code for handling error handling in
22026         accordance to the "Declarations" section in the "Basic Concepts"
22027         chapter in the ECMA C# spec.
22028
22029         * interface.cs: Make all interface member classes derive from
22030         InterfaceMemberBase.
22031
22032 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * Many things: all interfaces are parsed and generated in
22035         gen-treedump.  Support for member variables, constructors,
22036         destructors, properties, constants is there.
22037
22038         Beginning of the IL backend, but very little done, just there for
22039         testing purposes. 
22040
22041 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22042
22043         * cs-parser.jay: Fix labeled statement.
22044
22045         * cs-tokenizer.cs (escape): Escape " and ' always.
22046         ref_line, ref_name: keep track of the line/filename as instructed
22047         by #line by the compiler.
22048         Parse #line.
22049
22050 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22051
22052         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22053         to match the values in System.CodeDOM.
22054
22055         Divid renamed to Divide.
22056
22057         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22058         statements. 
22059         (Statements.set): remove.
22060
22061         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22062         statements. 
22063
22064         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22065         falseStatements always have valid values. 
22066
22067         * cs-parser.jay: Use System.CodeDOM now.
22068