2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * doc.cs : documented member might be from DeclaringType for nested
4           types. Fixed bug #76782.
5
6 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
7
8         * anonymous.cs: Have the param code handle leaving copies on the
9         stack etc. Allows anonymous params to take part in the assignment
10         code (++, +=, etc). Fixes bug #76550
11
12         * expression.cs: Handle the prepare_for_load/leave_copy by passing
13         it down to the anon code.
14
15         * iterators.cs: Use dummy var here
16
17         * codegen.cs: Handle new vars
18
19 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
20
21         Fix #76849.
22         * class.cs (MethodData.Define): Set proper Obsolete context.
23
24         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
25         obsolete context.
26         (FieldExpr.DoResolve): Ditto.
27
28 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
29
30         Fix #76849.
31         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
32         parent is not obsolete.
33
34 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
35
36         * doc.cs : (FindDocumentedMember) find parameterless members first
37           and get CS0419 in the early stage. Fixed first case of bug #76727.
38
39 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
40
41         Fix #76859.
42         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
43         no error was reported.
44
45         *expression.cs (Binary.DoResolve): left can be null.
46
47 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
48
49         Fix #76783.
50         * class.cs (MethodData.Emit): Parameters should be labeled first.
51
52 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
53
54         Fix #76761.
55         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
56
57 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
58
59         * attribute.cs (AreParametersCompliant): Moved to Parameter.
60
61         * class.cs (MethodCore): Parameter clean up.
62         (IMethodData): Added ParameterInfo.
63         (MethodData): Parameter clean up.
64         (Indexer.Define): Parameter clean up.
65
66         * anonymous.cs,
67         * codegen.cs,
68         * cs-parser.jay,
69         * decl.cs,
70         * doc.cs,
71         * ecore.cs,
72         * flowanalysis.cs,
73         * iterators.cs,
74         * pending.cs,
75         * statement.cs,
76         * typemanager.cs: Parameter clean up.
77
78         * delegate.cs (Define): Get rid of duplicated code.
79
80         * expression.cs (ParameterReference): Removed useless parameters
81         and simplified.
82         (Invocation): Ditto.
83
84         * parameter.cs (ParamsParameter): New class, params specialization.
85         (ArglistParameter): Attemp to separate arglist.
86         (Parameter): Refactored to be reusable and faster.
87         (Parameter.Modifier): Made understandable.
88         (Parameters): Changed to be used as a class for `this' assembly
89         parameters. Refactored to use new specialized classes.
90
91         * support.cs (ParameterData): Added Types property.
92         (InternalParameters): Deleted.
93
94 2005-08-20  Martin Baulig  <martin@ximian.com>
95
96         Merging this patch from GMCS to fix #75867.
97
98         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
99         scope if we don't already have it.
100
101 2005-11-17  Martin Baulig  <martin@ximian.com>
102
103         * anonymous.cs
104         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
105         inherit the scope from our parent.  Fixes #76653.
106
107 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
108
109         * doc.cs : the previous patch does not actually fix the bug.
110           PropertyInfo override check is now implemented and really fixed it.
111         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
112
113 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
114
115         * doc.cs : apply "override filter" also to properties.
116           Fixed bug #76730.
117
118 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
119
120         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
121           no need to check overrides. For classes, omit those results from 
122           interfaces since they must exist in the class. Fixed bug #76726.
123
124 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
125
126         * typemanager.cs : (GetFullNameSignature) differentiate indexers
127           with different parameters. Fixed the second problem in #76685.
128
129 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
130
131         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
132           get expected 'protected' access in CheckValidFamilyAccess()).
133           Fixed bug #76692.
134
135 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
136
137         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
138           Fixed bug #76705.  CS1569 was incorrectly commented out.
139
140 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
141
142         * doc.cs : use Invocation.IsOverride() to do real override check.
143         * expression.cs : made Invocation.IsOverride() internal.
144
145 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
146
147         * doc.cs : use TypeManager.FindMembers() instead of (possible)
148           TypeBuilder.FindMembers() and filter overriden base members out.
149           Fixed bug #76990.
150
151 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
152
153         * doc.cs : ref/out parameters are represented as '@' (instead of
154           '&' in type FullName). Fixed bug #76630 (additionally crefs).
155
156 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
157
158         * doc.cs : when there was no '.' in cref to methods in doc comment,
159           then parameters were missing in the output. Fixed bug #76691.
160
161 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
162
163         * driver.cs : don't output docs when there is an error.
164           Fixed bug #76693.
165
166 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
167
168         * doc.cs :
169           Now it should detect indexers. Fixed primary concern in bug #76685.
170           Fixed CS0419 message to not show the identical member signature in
171           the message.
172
173 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
174
175         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
176           instead of Type.FindMembers() since it does not handle events.
177           Fixed bug #71604.
178
179 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
180
181         * codegen.cs: Fixed typo (speficied -> specified).
182
183 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
184
185         Fix #76369.
186         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
187
188 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
189
190         * attribute.cs: Changed error message.
191
192         * cs-tokenizer.cs: One more check.
193
194 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
195
196         * statement.cs (Block.Resolve): Ignore empty statement.
197
198 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
199
200         * report.cs: Made error/warning methods more strict to avoid
201         their misuse.
202
203         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
204         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
205         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
206         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
207
208 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
209
210         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
211         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
212
213         * class.cs (TypeContainer.IsComImport): New property.
214         (Constructor.Define): Create proper ctor for ComImport types.
215
216         * expression.cs (New.CheckComImport): Fixed.
217
218 2005-11-07  Miguel de Icaza  <miguel@novell.com>
219
220         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
221         that a parameter has been captured does not mean that we do not
222         have to do the rest of the processing.  This fixes the second part
223         of #76592.  If there was another anonymous method capturing
224         values in the past, the Scope would never be set for the second
225         method that captured the same parameter.
226
227         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
228         properly manipulate the stack.   Second part of fix for #76592.
229
230         * expression.cs (New): Add support for invoking "new" on
231         interfaces that have been flagged with the ComImport attribute and
232         the CoClass.  Fixes #76637 
233
234         * statement.cs (Try.DoEmit): When a variable is captured, do not
235         try to emit the vi.LocalBuilder variable as it has been captured.
236         Create a temporary variable and store the results on the
237         FieldBuilder.  Fixes #76642
238
239 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
240
241         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
242
243         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
244
245         * expression.cs (Binary.DoResolve): Added && optimalization.
246     
247         * typemanager.cs (AddUserType): Removed useless argument.
248
249 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
250
251         * statement.cs (Block.variables): Uses ListDictionary.
252
253 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
254
255         Fix #75969.
256         * class.cs (PartialContainer.EmitType): Customized to emit
257         security attributes.
258         (ClassPart.ApplyAttributeBuilder): Transform security attribute
259         for partial classes.
260
261 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
262
263         Fix #76599.
264         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
265         access has to be fixed.
266         
267         * typemanager.cs (IsUnmanagedType): Wrong common field type.
268
269 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
270
271         Fix #76590.
272         * ecore.cs (NullCast.Reduce): Implemented.
273
274         * expression.cs (ArrayCreation.CheckIndices): Correcly check
275         constant type.
276         
277         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
278         properly.
279         (Foreach.Resolve): Catch null properly.
280
281 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
282  
283         * cs-tokenizer.cs: Warning text fix.
284
285         * driver.cs: AllWarningNumbers exposed on public interface.
286
287         * report.cs (): Reviewed warning numbers.
288         (IsValidWarning): Use binary search.
289
290 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
291  
292         * driver.cs: Implemeted resource visibility.
293         (Resources): New class for code sharing between /res: and
294         /linkres:
295  
296 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
297
298         Fix #76568.
299         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
300         folding.
301         
302         * convert (Convert.ImplicitReferenceConversion): NullCast holds
303         contants only.
304         
305         * ecore.cs (NullCast): Child is contant only.
306         
307         * literal.cs (NullLiteral.Reduce): null can be converted to any
308         reference type.
309
310 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
311
312         * driver.cs: Use Encoding.Default as default code page instead
313           of ISO-28591.
314
315 2005-10-27  Raja R Harinath  <rharinath@novell.com>
316
317         Fix #76085.
318         * expression.cs (Invocation.Error_InvalidArguments): Handle
319         __arglist parameters.
320         (Invocation.VerifyArgumentsCompat): Likewise.
321         * support.cs (ReflectionParameters.GetSignatureForError): Print
322         __arglist parameters.
323         (InternalParamters.GetSignatureForError): Likewise.
324         * parameter.cs (Parameters.GetSignatureForError): Likewise.
325
326 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
327
328         * attribute.cs (GetPropertyValue): Made public.
329
330         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
331         Resolve.
332         Add new property WrapNonExceptionThrows to handle 2.0 assembly
333         attribute.
334         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
335         is not defined.
336         
337         * driver.cs: Reflect method name change.
338         
339         * statement.cs (Try.Resolve): Warn when try has both general
340         exception handlers.
341         
342         * typemanager.cs: runtime_compatibility_attr_type new predefined
343         type.
344
345 2005-10-26  Raja R Harinath  <harinath@gmail.com>
346
347         Fix #76419.
348         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
349         treat it as an empty parameter list.
350
351 2005-10-26  Raja R Harinath  <rharinath@novell.com>
352
353         Fix #76271.     
354         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
355         ResolveAsTypeStep silent.
356         * statement.cs (Block.AddConstant): Mark block as used.
357         (Block.ResolveMeta): Avoid piling on error messages
358         if a constant initializer resolution fails.
359
360 2005-10-25  Raja R Harinath  <rharinath@novell.com>
361
362         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
363         Remove.
364         (NamespaceEntry.VerifyAllUsing): New.
365         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
366         behaviour.  Delegates actual resolution of alias to ...
367         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
368         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
369         Update.
370         * driver.cs (Driver.MainDriver): Update.
371         
372         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
373         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
374         property.
375         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
376         Remove.
377         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
378         RootNamespace.DefineNamespacesForAll.
379
380 2005-10-24  Raja R Harinath  <harinath@gmail.com>
381
382         * typemanager.cs (assemblies, external_aliases, modules)
383         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
384         (ComputeNamespaces, GetRootNamespace): Remove extra staging
385         overhead.  Move resposibility ...
386         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
387         * driver.cs, attribute.cs, codegen.cs: Update to changes.
388
389 2005-10-23  Raja R Harinath  <harinath@gmail.com>
390
391         * namespace.cs (RootNamespace.all_namespaces): Renamed from
392         cached_namespaces.  Improve usage.
393         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
394         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
395         Move from GlobalRootNamespace and simplify.
396         (RootNamespace.Global): Make instance variable.
397         (RootNamespace.RootNamespace): Add "alias name" parameter.
398         (GlobalRootNamespace): Simplify drastically.
399         (Namespace.Lookup): Don't use GetNamespace.
400         * typemanager.cs (GetRootNamespace): Rename from
401         ComputeNamespaceForAlias.
402         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
403
404 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
405
406         * anonymous.cs (AnonymousContainer): Don't crash when container
407         doesn't exist.
408
409 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
410
411         * expression.cs (Binary.DoResolve): Warn when comparing same
412         values.
413
414 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
415
416         Fix #76486.
417         * expression.cs (Binary.DoResolve): It looks like there are no
418         convetsion rules in enum context.
419
420 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
421
422         Add support for extern alias qualifiers.
423         * typemanager.cs: Move some LookupTypeReflection code
424         to namespace.cs, to have cleaner code. Added some methods
425         to help us keep track of the extern aliased references.
426         * driver.cs: Add suport for extern alias assemblies on command
427         line and check for their warnings/errors. Also keep track of the
428         extern aliased assemblies.
429         * namespace.cs: Move the global functionality of Namespace
430         to GlobalRootNamespace/RootNamespace. Now the global namespace
431         is GlobalRootNamespace.Globa. Also the code moved from 
432         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
433         Finally added LocalAliasEntry (AliasEntry before) and
434         ExternAliasEntry, to handle alias statements.
435         * cs-parser.jay: Add support in the grammar for extern alias
436         statement.
437         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
438         Update callings to Namespace (now in GlobalRootNamespace).
439
440 2005-10-18  Raja R Harinath  <rharinath@novell.com>
441
442         Fix #76371.
443         * class.cs (TypeContainer.DefineType): Move updating of
444         topological sort earlier in the code.
445         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
446
447 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
448
449         Fix #76273.
450         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
451         
452         * constant.cs (Constant.TryReduce): Moved from Cast class.
453         (Reduce): Made little bit more OO and fixed missing conversions.
454         
455         * ecore.cs (Reduce): Implemented.
456         (Binary.EnumLiftUp): New method to upgrade values to enum values.
457         
458         * literal.cs (Reduce): Implemented.
459         
460         * class.cs: Reverted Miguel's wrong commit.
461
462 2005-10-14  Miguel de Icaza  <miguel@novell.com>
463
464         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
465
466 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
467
468         * cs-parser.jay, expression.cs : CS0214 was missing error location
469           for constants. Fixed bug #76404.
470
471 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
472
473         Fix #76370.
474         * convert.cs (ExplicitConversionCore): Fixed object->enum
475         conversion.
476
477 2005-10-10  Raja R Harinath  <rharinath@novell.com>
478
479         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
480         InstanceExpression.
481         (PropertyExpr.EmitCall): Likewise.
482         * expression.cs (Invocation.EmitArguments): Handle case where
483         arguments == null.
484         (Invocation.EmitCall): Avoid allocating temporary variable if
485         there are no arguments.
486
487 2005-10-07  Raja R Harinath  <rharinath@novell.com>
488
489         Fix #76323.
490         * convert.cs (ImplicitConversionStandard): Move conversion of
491         void* to arbitrary pointer types ...
492         (ExplicitConversionStandard): .. here.
493         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
494         error to always print typenames.
495
496 2005-10-07  Raja R Harinath  <rharinath@novell.com>
497
498         * convert.cs (GetConversionOperator): Rename from
499         GetConversionOperators.  Move operator selection code from ...
500         (UserDefinedConversion): ... here.
501
502 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
503
504         * convert.cs (ExplicitConversionCore): Removed duplicate enum
505         conversion.
506
507 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
508
509         * assign.cs (Assign.DoResolve): Error method changed.
510
511         * cfold.cs (DoConstantNumericPromotions): Error method changed.
512         
513         * const.cs (ResolveValue): Reset in_transit immediately.
514         
515         * constant.cs: Error method changed.
516         
517         * convert.cs: Removed useless location parameter.
518         (ExplicitNumericConversion): Don't do double enum check.
519         (ExplicitConversionCore): Renamed from ExplicitConversion.
520         (ExplicitUnsafe): Extracted from ExplicitConversion.
521         (ExplicitConversion): Uses for error reporting.
522         
523         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
524         error messages.
525         (ResolveBoolean): Uses common error method.
526         (CastToDecimal): Get rid of ec.
527         (CastFromDecimal): Optimized.
528         (ConvCast): Get rid of ec.
529         
530         * enum.cs (ResolveValue): Reset in_transit immediately.
531         (Emit): Return after first error.
532         
533         * expression.cs: Convert changes.
534         
535         * literal.cs: Error method changed.
536         
537         * statement.cs: Error method changed.
538
539 2005-10-03  Raja R Harinath  <rharinath@novell.com>
540
541         * support.cs (SeekableStreamReader.Position): Don't error out when
542         the requested position is just beyond the end of the current
543         buffered data.
544
545 2005-09-28  Raja R Harinath  <rharinath@novell.com>
546
547         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
548         try to keep in sync with the byte count of the underlying Stream.
549         However, this limits us to a window size of 2048 characters: i.e.,
550         the maximum lookahead of our lexer/parser can be 2048 characters.
551
552 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
553
554         Fix #76255.
555         * driver.cs: Fix compilation files with full root path.
556
557 2005-09-25  Miguel de Icaza  <miguel@novell.com>
558
559         * report.cs (SymbolRelatedToPreviousError): Format the output so
560         it does not use an open parenthesis that is never closed. 
561
562         * driver.cs: Follow coding guidelines
563
564 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
565
566         Fix #72930.
567         * const.cs (Const.ResolveValue): Check for assigning non-null
568         value to reference type.
569
570 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
571
572         * anonymous.cs: Implemented ExprClassName.
573         
574         * assign.cs (Assign.DoResolve): Don't chrash when type is not
575         delegate.
576         
577         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
578         check.
579         
580         * class.cs (StaticClass.DefineContainerMembers): Report protected
581         members as error.
582         
583         * codegen.cs: if(ed) PRODUCTION.
584         
585         * convert.cs (Error_CannotImplicitConversion): Better error
586         distinction.
587         
588         * cs-parser.jay: More error checks.
589         
590         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
591         
592         * driver.cs (CSCParseOption): Enabled wrong option check.
593         
594         * ecore.cs (Expression.ExprClassName): Turned to property.
595         (MemberExpr.CheckIntermediateModification): For checking boxed
596         value types     modification.
597         
598         * statement.cs (Fixed.Resolve): Expression type must be
599         convertible to fixed type.
600         (CollectionForeach.GetEnumeratorFilter,TryType):
601         Small refactoring for easier error checking.
602
603 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
604
605         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
606         attributes.
607         
608         * class.cs (GeneratedBaseInitializer): New class for customization
609         compiler generated initializers.
610         (MemberBase.DoDefine): Check Obsolete attribute here.
611         (FieldMember.DoDefine): Ditto.
612         
613         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
614         constants.
615         
616         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
617         (MemberCore.GetObsoleteAttribute): Removed argument.
618         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
619         (MemberCore.CheckObsoleteType): New helper.
620         
621         * delegate.cs,
622         * enum.cs,
623         * statement.cs: Updates after MemberCore changes.
624         
625         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
626         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
627         
628         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
629         obsolete attribute for compiler construct.
630         (As.DoResolve): Cache result.
631         
632         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
633
634 2005-09-26  Raja R Harinath  <rharinath@novell.com>
635
636         Fix #76133.
637         * expression.cs (This.VerifyFixed): In a value type T, the type of
638         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
639         value type R, 'this' is treated as a value parameter.
640
641 2005-09-22  Miguel de Icaza  <miguel@novell.com>
642
643         * statement.cs (Lock): Use the TemporaryVariable class instead of
644         manually using local variables as those do not work when variables
645         are captured.
646
647         * ecore.cs: Moved the TemporaryVariable class from being a nested
648         class inside Foreach to be a public class that can be employed in
649         other places. 
650
651 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
652
653         * cs-parser.jay: interface_accessors replaced by
654         accessor_declarations.
655
656         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
657         location.
658         
659         * statement.cs (GotoCase.Resolve): Convert null constant to
660         null case.
661         (SwitchLabel.ResolveAndReduce): Ditto.
662         (SwitchLabel.NullStringCase): Custom null stamp.
663         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
664         
665         typemanager.cs (CSharpSignature): Don't skip first argument
666         for full names.
667
668 2005-09-18  Miguel de Icaza  <miguel@novell.com>
669
670         * driver.cs: Set InEmacs based on the environment variable EMACS. 
671
672         * location.cs (InEmacs): in this mode, do not report column
673         location as it confuses Emacs.
674
675 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
676
677         * cfold.cs, constant.cs, convert.cs, ecore.cs,
678         expression.cs, iterators.cs, literal.cs: Store constants and
679         literals location.
680         
681         * class.cs (MemberBase.ShortName): Pass location.
682         
683         * cs-parser.jay: Some location fixes.
684         
685         * ecore.cs (Expression.Location): Made virtual.
686
687 2005-09-05  Miguel de Icaza  <miguel@novell.com>
688
689         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
690         if the underlying types are the same, otherwise we need to produce
691         code that will do the proper cast.
692
693         This was exposed by Marek's constant rewrite which produced
694         invalid code for the call site:
695
696         enum X : long { a }
697         void Method (X v) {}
698
699         Method ((X) 5)
700
701         This fixes test-49.cs
702
703 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
704
705         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
706           Type/Object should be allowed as well. Fixed bug #75968.
707
708 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
709
710         * expression.cs : (Binary.DoResolve): when one is enum constant and
711           another is constant 0, then return enum one *as enum type*.
712           Fixed bug 74846.
713
714 2005-09-02  Raja R Harinath  <rharinath@novell.com>
715
716         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
717         internal.
718
719         Fix #75941.
720         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
721         flow-branching for LocalVariableReferences in case we were invoked
722         from a MemberAccess.
723         * expression.cs (LocalVariableReference.VerifyAssigned): New.
724         Carved out of ...
725         (LocalVariableReference.DoResolveBase): ... this.
726         (MemberAccess.Resolve): Do the check that was disabled during
727         SimpleNameResolve.
728
729 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
730
731         * class.cs :
732           (PartialContainer.Create): check abstract/sealed/static strictly
733           but abstract/sealed can exist only at one side. Fixed bug #75883.
734
735 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
736
737         Fix #75945.
738         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
739         specified, don't default to UnmanagedType.I4.
740
741 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
742
743         * expression.cs : conditional operator should check possibly
744           incorrect assign expression. Fixed bug #75946.
745
746 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
747
748         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
749           Reverting the change. gmcs is much complex than mcs on this matter.
750
751 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
752
753         * cs-tokenizer.cs : To read another token ahead of the actual 
754           consumption, use new SavedToken and cache token instead of moving
755           back the stream with SeekableStreamReader (it seemed problematic).
756         * cs-parser.jay,
757           driver.cs : Thus use StreamReader directly.
758         * support.cs : Thus removed SeekableStreamReader.
759
760 2005-08-30  Raja R Harinath  <rharinath@novell.com>
761
762         Fix #75934.
763         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
764         (ScopeInfo.EmitScopeType): Use it to construct field names from
765         names of captured locals.
766
767         Fix #75929.
768         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
769         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
770         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
771         (ExplicitConversion): Remove enum cases already handled by
772         implicit conversion.  Move implicit conversion check to the beginning.
773         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
774         * expression.cs (ArrayCreation.EmitDynamicInitializers):
775         Don't treat System.Enum as a struct.
776
777 2005-08-30  Jb Evain  <jbevain@gmail.com>
778
779         * attribute.cs: handles as expression in parameters.
780
781 2005-08-30  Raja R Harinath  <rharinath@novell.com>
782
783         Fix #75802.
784         * class.cs (TypeContainer.VerifyClsName): Don't use a
785         PartialContainer when verifying CLS compliance.
786         (AbstractPropertyEventMethod): Set Parent here, ...
787         (PropertyMethod): ... not here.
788
789 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
790
791         * attribute.cs : escaped attribute name should not be allowed to be
792           resolved (e.g. @class as classAttribute). Fixed bug #75930.
793
794 2005-08-29  Raja R Harinath  <rharinath@novell.com>
795
796         Fix #75927.
797         * convert.cs (ImplicitStandardConversionExists): Allow zero also
798         when converting a long constant to unsigned long.
799         * expression.cs (Invocation.OverloadResolve): Add sanity check to
800         detect where IsApplicable and VerifyArgumentsCompat disagree.
801
802 2005-08-29  Raja R Harinath  <rharinath@novell.com>
803         and Carlos Alberto Cortez  <carlos@unixmexico.org>
804
805         Fix #75848.
806         * class.cs (TypeContainer.CanElideInitializer): New helper.
807         (TypeContainer.EmitFieldInitializers): Use it to determine if we
808         can safely emitting the initializer of a field.
809
810 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
811
812         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
813           allowed inside a switch (without loop). Fixed bug #75433.
814
815 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
816
817         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
818         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
819
820 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
821
822         * driver.cs : kinda reverting the default encoding changes (not exact 
823           revert since I noticed that "codepage:reset" might not work fine).
824
825 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
826
827         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
828           Location. Now getter and setter store location correctly.
829           (errors/cs0111-12.cs now reports the expected location.)
830
831 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
832
833         * driver.cs : Use default encoding on the environment.
834           Removed (now that) extra parameter for SeekableStreamReader.
835         * support.cs : (SeekableStreamReader) third .ctor() argument for
836           StreamReader is not required (always true). preamble size could
837           be acquired in simpler and safe way.
838
839 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
840
841         * cs-parser.jay: report CS0642 at warning level 3
842           and report CS0642 for an if else statement also
843           fixes bug #74745. Patch by John Luke (and a bit
844           modified by me).
845           Removed extra CS0642 warning check for "while",
846           "for" and "fixed".
847         * statement.cs: In Block.Resolve(), CS0642 check
848           is reimplemented to check a sequence of an empty
849           statement and a block.
850
851           Both fix bug #66777.
852
853 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
854
855         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
856         detection until I fix it.
857         
858         * cs-tokenizer.cs: Changed error message.
859         
860         * cs-parser.jay: Fixed 2 error locations.
861         
862         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
863         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
864         properties.
865         
866         * enum.cs (GetSignatureForError): Fixed.
867         
868         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
869         method detection.
870         
871         * class.cs,
872         * typemanager.cs (RegisterProperty): Removed.
873         
874         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
875
876 2005-08-24  Raja R Harinath  <rharinath@novell.com>
877
878         Fix #75874.
879         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
880         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
881
882 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
883
884         * expression.cs : tiny fix is required for not warning positive ulong.
885           See test-441.cs.
886
887 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
888
889         * expression.cs : add CS0652 check for constant and integral
890           expression. Fixed bug #53974.
891
892 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
893
894         * expression.cs : in DoNumericPromotions(), check if there is implicit
895           conversion overload for string (to check CS0034). Fixed bug #52492.
896
897 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
898
899         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
900
901 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
902
903         * ecore.cs : report location when it is *not* Null.
904
905 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
906
907         * codegen.cs,
908           ecore.cs,
909           flowanalysis.cs,
910           expression.cs:
911           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
912           correctly. Fixed bug #75721.
913
914 2005-08-23  Raja R Harinath  <rharinath@novell.com>
915
916         * support.cs (SeekableStreamReader.Position): Avoid an expensive
917         loop that performs 'min (pos, char_count)'.
918
919         Fix #75862.
920         * expression.cs (Unary.ResolveOperator): Don't discard implicit
921         converted value in Operator.OnesComplement.
922
923 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
924
925         * anonymous.cs: If the anon method is pulled into a helper class,
926         it needs to be `internal' not `private'. Fixes runtime behavior on
927         msft. bug #75704
928
929 2005-08-20  Martin Baulig  <martin@ximian.com>
930
931         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
932         scope if we don't already have it.
933
934         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
935         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
936         fixes #75867.
937
938 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
939
940         Fix #75803
941         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
942         is a partial class.
943
944 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
945
946         The big constants rewrite
947         Fix #75746, #75685 and more
948         As a side effect saved 1MB for MWF ;-)
949         
950         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
951         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
952         enum based for corlib compilation.
953         
954         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
955         subtractions.
956         
957         * class.cs (FixedField.Define): Use ResolveAsConstant.
958         
959         * const.cs (IConstant): Interface constants and enums.
960         (Const.ResolveValue): New method for constant resolvning.
961         (ExternalConstant): Constants from imported assemblies.
962         
963         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
964         conversion; like enums.
965         (Constant.ToType): Converts this constant to different type.
966         (Constant.Increment): Adds 1.
967         
968         * convert.cs (ImplicitConversionRequired): Simplified.
969         
970         * cs-parser.jay: Create EnumMember directly.
971         
972         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
973         
974         * doc.cs (GenerateEnumDocComment): Removed.
975         
976         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
977         (ConvertIntLiteral): Removed.
978         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
979         
980         * enum.cs (EnumMember): Implement IConstant.
981         (Enum.IsValidEnumConstant): Removed.
982         (Enum.GetNextDefaultValue): Removed.
983         (Enum.FindMembers): Updated.
984         (Enum.GenerateDocComment): Iterate enum members.
985         
986         * expression.cs (Cast.TryReduce): Handle enums correctly.
987         (New.Constantify): Made public.
988         (MemberAccess.DoResolve): Removed contant specific if(s).
989         
990         * literal.cs (NullLiteral): Implement new abstract methods.
991         
992         * statement.cs (GotoCase.Resolve): Use new constant methods.
993         (SwitchLabel.ResolveAndReduce): Use new constant methods.
994         
995         * typemanager.cs (LookupEnum): Removed.
996         (IsEnumType): Fixed to work with corlib.
997         (RegisterConstant): Removed.
998         (LookupConstant): Removed.
999         (GetConstant): Changed to work with IConstant.
1000
1001 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1002
1003         * location.cs : Fixed overflown (>255) column number.
1004
1005 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1006
1007         First cut of the qualified-alias-member feature.
1008         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1009         token.
1010         * cs-parser.jay (DOUBLE_COLON): New token.
1011         (namespace_or_type_name): Add rule for recognizing
1012         qualified-alias-members.
1013         (primary_expression): Likewise.
1014         (element_access): Allow QualifiedAliasMember as a possible
1015         type-bearing expression.
1016         (local_variable_type, local_variable_pointer_type): Likewise.
1017         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1018         aliases in the current and enclosing namespace declarations.
1019         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1020         * decl.cs (MemberName.is_double_colon): New.
1021         (MemberName.MemberName): Add new constructor for alias-member.
1022         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1023         * expression.cs (QualifiedAliasMember): New expression type.
1024
1025 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1026
1027         * location.cs : it borked when no argument was specified.
1028
1029 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1030
1031         * location.cs : tiny ToString() format fix.
1032
1033 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1034
1035         * statement.cs : oops, it was missing.
1036
1037 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1038
1039         A set of fixes for precise line/column location.
1040
1041         * location.cs :
1042           "token" field now holds a file/line "delta", a line number offset 
1043           from the segment, and a column number. See also:
1044           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1045           December/009508.html
1046           Removed static IsNull. Use instance IsNull property instead.
1047         * cs-tokenizer.cs :
1048           For some tokens it stores Location. For Identifier it stores
1049           LocatedToken which is a pair of string name and location.
1050           Column numbers are adjusted only at getChar().
1051         * report.cs :
1052           Use Location.ToString() for reporting (it now contains column).
1053         * cs-parser.jay :
1054           Largely modified to use LocatedToken instead of
1055           string (IDENTIFIER), and to acquire Location from some tokens.
1056         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1057           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1058           codegen.cs :
1059           Now MemberName holds Location. DeclSpace.ctor() receives Location
1060           as a parameter. Removed extra parameters to all derived classes.
1061           Replaced Location.IsNull() with instance property.
1062         * assign.cs, expression.cs :
1063           Added .ctor() overload that omits Location.
1064         * attribute.cs :
1065           Added "nameEscaped" flag that indicates the identifier was escaped
1066           in the source file. This fixes bug #57047.
1067
1068 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1069
1070         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1071         New method, looking for lo-case imported cls type.
1072
1073         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1074         here.
1075
1076         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1077
1078         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1079
1080         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1081         all_imported_types.
1082         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1083
1084         Optimized to save 3.5 MB for SWF compilation.
1085
1086 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1087
1088         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1089         (PartialContainer.Create): Moved logic AddToContainer.
1090         (PartialContainer.MarkForDuplicationCheck): Shares name.
1091         
1092         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1093         place.
1094         
1095         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1096         initialization.
1097         (Namespace.GetSignatureForError): New method.
1098         
1099         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1100         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1101
1102 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1103
1104         Fix #75669.
1105         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1106         member lookup rather than qualifier_type, since qualifier_type can
1107         be null.
1108
1109 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1110
1111         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1112         enum member.
1113
1114 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1115
1116         * statement.cs: Copy the local exception into the exception
1117         captured local.  Fixes 75674
1118
1119 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1120
1121         Fix #75658.
1122         * expression.cs (Invocation.OverloadResolve): Don't report error
1123         CS1501 if error CS1502 has been reported.
1124         (New.DoResolve): Delegate CS1501 reporting to
1125         Invocation.OverloadResolve.
1126
1127         Fix #75656.
1128         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1129         invariant-meaning-in-block property in an enclosing block if
1130         necessary.
1131
1132 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1133
1134         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1135         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1136         (Switch.CheckSwitch): Just save 50kb for SWF.
1137
1138 2005-07-27  Martin Baulig  <martin@ximian.com>
1139
1140         * anonymous.cs (CaptureContext.AddField): Added
1141         `AnonymousContainer am' argument; compute its toplevel scope if
1142         it's not already computed.  Fixes #75649.
1143
1144 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1145
1146         Fix #75628.
1147         * class.cs (Constructor.Emit): Reset block to null if the block
1148         resolve fails.
1149
1150 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1151
1152         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1153
1154 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1155
1156         * class.cs (MethodData.Define): Check whether accessor implementing
1157         interface is public.
1158
1159         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1160
1161 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1162
1163         Fix #57245
1164         * namespace.cs (LookupType): Moved same type check to...
1165         
1166         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1167         with the same name.
1168
1169 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1170
1171         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1172         already found a typebuilder.
1173         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1174         MemberNames, not strings.
1175
1176         * const.cs (Error_ExpressionMustBeConst): 
1177         Rename from Error_EpressionMustBeConst.
1178         * const.cs, class.cs, statement.cd: Update.
1179
1180 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1181
1182         Fix #65573
1183
1184         * const.cs (Const.LookupConstantValue): Report missing contant expression
1185         everytime.
1186         (Error_EpressionMustBeConstant): Only one error method.
1187
1188         * class.cs, statement.c: Updated.
1189
1190 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1191
1192         * statement.cs (Block.Flags): Add back HasVarargs.
1193         (Block.flags): Make protected.
1194         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1195
1196         * typemanager.cs (types, typecontainers, user_types): Remove.
1197         (UserTypes, TypeContainers): Likewise.
1198         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1199         (CleanUp, Reset): Update.
1200         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1201         (GetNestedType): Use Type.GetNestedType.
1202         (CoreLookupType): Take two arguments, the namespace and the
1203         basename of the type.  Update to use the Namespace.Lookup
1204         mechanism.
1205         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1206         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1207         string concatenation and substring matches.
1208         * class.cs, enum.cs, delegate.cs: Update to changes.
1209
1210 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1211
1212         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1213         Expression and made virtual.
1214
1215         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1216         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1217
1218         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1219
1220         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1221         error message.
1222
1223         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1224         change.
1225
1226 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1227
1228         Fix #57707
1229         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1230         AssemblyCultureAttribute is not used on executable.
1231
1232         * rootcontext.cs,
1233         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1234
1235 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1236
1237         Fix #60638.
1238         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1239         New.  Reports CS0252/CS0253.
1240         Mostly taken from preliminary patch by Duncak Mak.
1241         (Binary.DoResolveOperator): Store results of operator lookup.
1242         Use them to detect if we need to warn about unintended reference
1243         comparisons.
1244
1245 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1246
1247         Fix #72969.
1248         * namespace.cs (Namespace.Lookup): Add back location parameter.
1249         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1250         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1251
1252         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1253         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1254         (Namespace.LookupType): ... this.
1255         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1256         of namespaces.
1257         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1258         purported to handle pointers.
1259         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1260         CoreLookupType.
1261
1262 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1263
1264         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1265         type as namespace.
1266
1267 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1268
1269         * namespace.cs (Namespace.Lookup): Drop location parameter.
1270         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1271         (NamespaceEntry.Lookup): ... this.
1272         (NamespaceEntry.Error_AmbiguousTypeReference):
1273         Move here from DeclSpace.
1274         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1275         names ...
1276         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1277         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1278         Move to NamespaceEntry.
1279         * delegate.cs, expression.cs: Update to changes.
1280
1281 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1282
1283         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1284         CheckAttributeType and refactored.
1285         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1286         ResolveAsTypeTerminal error handling.
1287         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1288         handling.
1289         (GetSignatureForError): Print errors in same way.
1290
1291         * class.cs,
1292         * codegen.cs: Reflect attribute GetSignatureForError change.
1293
1294         * ecore.cs,
1295         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1296
1297         * namespace.cs (UsingEntry): Refactored to make fields private.
1298
1299         * assign.cs,
1300         statement.cs: Error_UnexpectedKind has extra parameter.
1301
1302 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1303
1304         * ecore.cs (IAlias): Remove.
1305         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1306         that implement the interface.
1307         * namespace.cs (Namespace): Likewise.
1308         (Namespace.declspaces): Renamed from 'defined_names'.
1309         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1310         DeclSpace instead of an IAlias.
1311         * tree.cs (Tree.AddDecl): Update.
1312
1313 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1314
1315         * statement.cs (Block.Flags); Remove HasVarargs.
1316         (Block.HasVarargs): Move to ToplevelBlock.
1317         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1318         (Block.Variables): Make protected.  Initialize variable hashtable
1319         if necessary.
1320         (Block.AddVariable): Update.
1321         (Block.Resolve): Update to changes.
1322         (ToplevelBlock.HasVarargs): New boolean.
1323         (ToplevelBlock.ThisVariable): Move here from Block.
1324         (ToplevelBlock.AddThisVariable): Likewise.
1325         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1326         * expression.cs (This.ResolveBase): Update to changes.
1327         (ArglistAccess.DoResolve): Likewise.
1328
1329 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1330
1331         Fix #75321
1332         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1333
1334         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1335         not used and not used & assigned.
1336         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1337
1338 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1339
1340         Fix #75053
1341         * expression.cs (Is.DoResolve): null is never provided type.
1342
1343 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1344
1345         Fix #52496
1346         * cs-parser.jay: Less strict event error rule to catch more errors.
1347
1348 2005-07-08  Martin Baulig  <martin@ximian.com>
1349
1350         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1351         gettter (allowed) or setter (not allowed).
1352
1353         * class.cs (Accessor): Implement IIteratorContainer.
1354         (Accessor.Yields): New public field.
1355         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1356         per-accessor basis.
1357
1358         * cs-parser.jay
1359         (get_accessor_declaration, set_accessor_declaration): Set the
1360         `yields' flag on the accessor, not the property.
1361         (property_declaration): Do the iterators check on a per-accessor
1362         basis and not for the whole property.
1363
1364 2005-07-08  Martin Baulig  <martin@ximian.com>
1365
1366         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1367         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1368
1369 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1370
1371         Fix #74975
1372         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1373         (ExtractSecurityPermissionSet): Cope with self referencing security
1374         attributes properly.
1375
1376         * driver.cs (SetOutputFile): Made public property OutputFile.
1377
1378 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1379
1380         Fix #75486.
1381         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1382         has_nonstatic_fields.  Make into a FieldBase pointer.
1383         (TypeContainer.AddField): Add CS0282 check.
1384         (TypeContainer.EmitType): Update.
1385
1386 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1387
1388         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1389         compare if they start with __.
1390
1391 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1392
1393         * statement.cs (Switch.SwitchGoverningType): Only look at
1394         UserCasts that don't need implicit standard conversions to one of
1395         the allowed switch types (Fixes test-322.cs).
1396         (LocalInfo.Resolve): Re-enable sanity-test.
1397
1398 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1399
1400         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1401         
1402         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1403         
1404         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1405
1406 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1407
1408         Fix #75472.
1409         * ecore.cs (SimpleName.GetSignatureForError): Add.
1410         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1411         (MemberAccess.GetSignatureForError): Add.
1412
1413 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1414  
1415         The big error and warning messages review.
1416         
1417         * anonymous.cs,
1418         * assign.cs,
1419         * attribute.cs,
1420         * class.cs,
1421         * codegen.cs,
1422         * convert.cs,
1423         * cs-parser.jay,
1424         * cs-tokenizer.cs,
1425         * decl.cs,
1426         * delegate.cs,
1427         * doc.cs,
1428         * driver.cs,
1429         * ecore.cs,
1430         * enum.cs,
1431         * expression.cs,
1432         * flowanalysis.cs,
1433         * iterators.cs,
1434         * literal.cs,
1435         * location.cs,
1436         * modifiers.cs,
1437         * namespace.cs,
1438         * parameter.cs,
1439         * pending.cs,
1440         * report.cs,
1441         * rootcontext.cs,
1442         * statement.cs,
1443         * support.cs,
1444         * tree.cs,
1445         * typemanager.cs: Updated.
1446         
1447         * class.cs: (MethodCore.SetYields): Moved here to share.
1448         (PropertyMethod.Define): Moved iterator setup here.
1449         
1450         * iterators.cs: Add orig_method to have full access to parent
1451         container.
1452
1453 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1454
1455         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1456         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1457         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1458         variable of struct type.
1459         * expression.cs (Unary.ResolveOperator): Update to change.
1460         (Indirection.VerifyFixed): Likewise.
1461         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1462         (ParameterReference.VerifyFixed): Value parameters are fixed.
1463         (This.VerifyFixed): Treat 'this' as a value parameter.
1464         * statement.cs (LocalInfo.IsFixed): Remove.
1465
1466 2005-07-01  Martin Baulig  <martin@ximian.com>
1467
1468         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1469         `ec.EmitThis ()' to get the correct scope.
1470
1471 2005-07-01  Martin Baulig  <martin@ximian.com>
1472
1473         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1474         instance is a ParameterReference; fixes #75299.
1475
1476 2005-07-01  Martin Baulig  <martin@ximian.com>
1477
1478         Reverted Marek's latest patch (r46725):
1479         - it contains structural changes which are neither mentioned in
1480           the ChangeLog nor explained anywhere; for example the additional
1481           argument of EmitContext's and Iterator's .ctor's and the
1482           TypeContainer.DefineMembers() change.
1483         - structural changes like this should go in in seperate patches
1484           and not be hidden in a huge patch which just seems to affect
1485           warnings and errors.
1486           a big and hard to understand patch.
1487         - it breaks iterators and causes regressions, for instance in
1488           test-iter-03.cs.      
1489
1490 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1491
1492         Fix #75412.
1493         * expression.cs (Indexers.map): Remove.
1494         (Indexers.Append): Filter out inaccessible setters and getters.
1495         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1496
1497         Fix #75283.
1498         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1499         Refactored from ...
1500         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1501         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1502         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1503         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1504
1505 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1506
1507         Fix #75322
1508         * class.cs (FieldBase.GetInitializerExpression): One more field
1509         for backup.
1510
1511 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1512
1513         * pending.cs: Do not define a proxy if the base method is virtual,
1514         it will be picked up by the runtime (bug 75270).
1515
1516 2005-06-08  Martin Baulig  <martin@ximian.com>
1517
1518         The big Iterators rewrite :-)
1519
1520         * iterators.cs: Rewrite this to use the anonymous methods framework.
1521
1522         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1523         before the TypeContainers; see 2test-21.cs.
1524
1525         * class.cs
1526         (TypeContainer.DefineType): Don't create a new EmitContext if we
1527         already have one (this only happens if we're an Iterator).
1528         (TypeContainer.Define): Also call Define() on all our iterators.
1529         (Method.CreateEmitContext): Added support for iterators.
1530
1531         * anonymous.cs
1532         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1533         (AnonymousContainer.CreateMethodHost): Moved here from
1534         AnonymousMethod and made abstract.
1535         (AnonymousContainer.CreateScopeType): New abstract method.
1536         (AnonymousContainer.IsIterator): New public property.
1537         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1538         get the ScopeTypeBuilder rather than manually defining it here. 
1539         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1540         iterators here.
1541
1542         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1543         before RootContext.DefineTypes().
1544
1545         * codegen.cs (EmitContext.RemapToProxy): Removed.
1546         (EmitContext.CurrentAnonymousMethod): Changed type from
1547         AnonymousMethod -> AnonymousContainer.
1548         (EmitContext.ResolveTopBlock): Protect from being called twice.
1549         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1550         (EmitContext.EmitThis): Removed the iterators hacks; use the
1551         anonymous methods framework for that.
1552
1553         * statement.cs
1554         (ToplevelBlock.Container): Make this a property, not a field.
1555         (ToplevelBlock.ReParent): New public method; move the
1556         ToplevelBlock into a new container.
1557         (Foreach.TemporaryVariable): Simplify.
1558
1559 2005-06-05  Martin Baulig  <martin@ximian.com>
1560
1561         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1562         (Block.AddTemporaryVariable): New public method; creates a new
1563         `LocalInfo' for a temporary variable.
1564         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1565         variables here.
1566         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1567         non-iterator variables.
1568
1569 2005-06-05  Martin Baulig  <martin@ximian.com>
1570
1571         * statement.cs (Foreach.TemporaryVariable): Create the
1572         LocalBuilder in the Emit phase and not in Resolve since in some
1573         situations, we don't have an ILGenerator during Resolve; see
1574         2test-19.cs for an example.
1575
1576 2005-06-04  Martin Baulig  <martin@ximian.com>
1577
1578         **** Merged r45395 from GCS ****
1579
1580         The big Foreach rewrite - Part II.
1581
1582         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1583         with `PropertyInfo ienumerator_getcurrent'.
1584
1585         * codegen.cs (VariableStorage): Removed.
1586
1587         * statement.cs
1588         (Foreach): Derive from Statement, not ExceptionStatement.
1589         (Foreach.CollectionForeach): New nested class.  Moved all the code
1590         dealing with collection foreach here.
1591         (Foreach.ForeachHelperMethods): Removed.
1592         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1593
1594 2005-05-23  Martin Baulig  <martin@ximian.com>
1595
1596         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1597         don't need to.  Fix #75014.
1598
1599 2005-05-20  Martin Baulig  <martin@ximian.com>
1600
1601         Merged r44808 from GMCS.
1602
1603         * class.cs (TypeContainer.CircularDepException): Removed.
1604         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1605         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1606         (CS0146) and interface (CS0529) dependencies here.
1607
1608 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1609
1610         * expression.cs (Invocation.EmitCall): Fix initialization
1611         'this_call' to reflect current behaviour.  Fix indentation.
1612
1613         * convert.cs (FindMostEncompassedType): Add two trivial special
1614         cases (number_of_types == 0 || number_of_types == 1).
1615         (FindMostEncompasingType): Likewise.
1616
1617 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1618
1619         Some cleanups preparing for the fix of #75283.
1620         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1621         error testing.
1622         (EventExpr.InstanceResolve): Likewise.
1623         (EventExpr.DoResolve): Remove redundant checks.
1624
1625 2005-06-10  Duncan Mak  <duncan@novell.com>
1626
1627         * cs-tokenizer.cs (process_directives): New flag for controlling
1628         the processing of preprocessor directives.
1629         (x_token): After seeing a '#', return Token.NONE instead of going
1630         to handle_preprocessing_directive() when not processing
1631         directives. This avoids unnecessary processing during the token peek in
1632         is_punct().
1633
1634         This fixes #74939.
1635
1636         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1637         the existing error reporting methods instead of Report.Error.
1638
1639         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1640         after Raja's rewrite.
1641
1642 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1643
1644         * class.cs: Small fix.
1645
1646 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1647
1648         Fix #75160.
1649         * class.cs (GetPartialBases): Fix return value check of
1650         part.GetClassBases.
1651
1652 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1653
1654         Ensure that partial classes are registered in their enclosing
1655         namespace.  Initial part of fix of #75160.
1656         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1657         Register declspace with namespace here, not in
1658         DeclSpace.RecordDecl.
1659         * cs-parser.jay: Pass namespace to RecordDecl.
1660         * class.cs (PartialContainer.Create): Likewise.
1661         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1662         called.
1663         * decl.cs (Declspace.RecordDecl): Remove.
1664         * namespace.cs (NamespaceEntry.DefineName): Remove.
1665
1666 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1667
1668         * rootcontext.cs: Reset TargetExt as well.
1669
1670 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1671
1672         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1673         -langversion:ISO-1.
1674
1675 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1676
1677         Fix #75080, cs0119.cs.
1678         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1679         of ...
1680         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1681         allowing ExprClass.Type and ExprClass.Namespace for
1682         ResolveFlags.VariableOrValue.
1683         (Expression.Resolve) [1-argument variant]: Change default resolve
1684         flags based on language version.
1685         (Expression.Error_UnexpectedKind): Use a simple string array
1686         rather than an ArrayList.
1687         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1688         not ExprClass.Type.
1689         (TypeOfVoid.DoResolve): Likewise.
1690         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1691         flags argument -- it always has the same value.
1692
1693 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1694
1695         Fix #75081.
1696         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1697         Use it in the error message.
1698         * assign.cs, expression.cs, statement.cs: Update.
1699
1700 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1701
1702         Fix #75088.
1703         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1704         the "almostMatchedMember" case too.
1705         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1706         that failed the accessibility checks to 'almost_match'.
1707
1708 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1709
1710         * attribute.cs: Use internal MethodBuilder methods to set
1711         ExactSpelling and SetLastError on PInvoke methods, instead
1712         of passing them via charset.  Fixes #75060.
1713
1714 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1715
1716         * parameter.cs (Parameter): Remove TODO comment.
1717         (Parameter.DefineParameter): Remove Location parameter.
1718         (Parameters.LabelParameters): Likewise.
1719         * class.cs (Constructor.Emit): Update to change.
1720         (MethodData.Emit): Likewise.
1721         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1722         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1723
1724 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1725
1726         * parameter.cs,
1727           Removed Parameters.Location and added Parameter.Location instead.
1728           Removed Location parameter from Emit() and GetSignature().
1729         * anonymous.cs,
1730           class.cs,
1731           cs-parser.jay,
1732           delegate.cs,
1733           iterators.cs,
1734           statement.cs :
1735           Modified all related calls.
1736
1737 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1738
1739         Improve user-defined conversion handling.
1740         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1741         applicable operators.
1742         (AddConversionOperators): New.  Helper for GetConversionOperators.
1743         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1744         there is only one most encompassed/encompassing type.
1745         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1746         "applicable operator" handling.
1747         (UserConversion): Move cache here from GetConversionOperators.
1748         Directly cache the chosen operator, rather than the whole
1749         MethodGroup.
1750         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1751         case.  Allow conversion of decimal to sbyte and byte too.
1752         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1753         New static methods.  Used to avoid allocating EmptyExpressions in
1754         convert.cs.
1755
1756 2005-05-24  Duncan Mak  <duncan@novell.com>
1757
1758         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1759         another class, used in Convert.ExplicitNumericConversion.
1760         (CastToDecimal): New class, similar to above, but casts to
1761         System.Decimal, used in Convert.ImplicitNumericConversion and also
1762         in explicit convesion from double/float to decimal.
1763
1764         * convert.cs (ImplicitNumericConversion): Handle implicit
1765         conversions to System.Decimal.
1766         (ExplicitNumericConversion): handle explicit conversions to
1767         System.Decimal.
1768
1769         This fixes #68711.
1770         
1771 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1772
1773         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1774         know the type at this stage, just break through.   Fixes #75008 
1775
1776 2005-05-19  Martin Baulig  <martin@ximian.com>
1777
1778         * delegate.cs
1779         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1780         to disable error reporting.
1781
1782         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1783         here since we don't want to report an error; see the new test-336.cs.
1784
1785 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1786
1787         * statement.cs (ToplevelBlock.GetParameterReference)
1788         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1789         Move here from class Block.
1790         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1791         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1792
1793 2005-05-18  Martin Baulig  <martin@ximian.com>
1794
1795         Fix #74978.
1796
1797         * flowanalysis.cs
1798         (FlowBranching.Reachability): Add non-static public And() and Or()
1799         methods.
1800         (FlowBranchingSwitch): New class; do the `break_origins' thing
1801         like in FlowBranchingLoop.
1802         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1803         reachability, not just locals and parameters.
1804         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1805         switch; MergeBreakOrigins() now takes care of that.
1806
1807 2005-05-18  Martin Baulig  <martin@ximian.com>
1808
1809         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1810         a loop and may leave it, reset the barrier; fixes #74974.
1811
1812 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1813         
1814         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1815         is back.
1816         
1817         * cs-parser.jay: Catch more lexical errors.
1818         
1819         * report.cs: Add one more Error method.
1820         
1821         * rootcontext.cs,
1822         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1823
1824 2005-05-17  Martin Baulig  <martin@ximian.com>
1825
1826         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1827         #70970. 
1828
1829 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1830
1831         Fix test-382.cs.  Emit values of decimal constants.
1832         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1833         Carved out of ...
1834         (TypeContainer.AddField): ... this.
1835         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1836         with initializers to include 'Const's.
1837         (ClassPart.RegisterFieldForInitialization): Forward to
1838         PartialContainer.
1839         * const.cs (Const.Const): Pass initializer to base class.
1840         (Const.Define): In case of decimal constants, register them for
1841         initialization in a static constructor.
1842
1843 2005-05-14  Martin Baulig  <martin@ximian.com>
1844
1845         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1846         do not call ResolveUnreachable() on unreachable statements in
1847         here, see the comment in the source code.
1848
1849 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1850
1851         Fix #74934.
1852         * expression.cs (BinaryResolveOperator): If one of the operands of
1853         an equality comparison is 'null' and the other is a pointer type,
1854         convert the null to a NullPointer.
1855         * convert.cs (ImplicitReferenceConversion): If the expression is a
1856         NullLiteral and the target type is a pointer type, return a
1857         NullPointer instead.
1858         (ImplicitConversionStandard): Likewise.
1859
1860 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1861         
1862         * cs-parser.jay: Set readonly context based on special constructs.
1863         
1864         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1865         readonly variable error handling.
1866         
1867         * rootcontext.cs (EmitCode): Don't verify members when error
1868         occurred.
1869         
1870         * statement.cs (LocalInfo): Add reaodnly context information.
1871         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1872
1873 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1874
1875         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1876         for #74041 to initialize 'resolved' to false only for explicit
1877         blocks.  Fixes #74873.
1878
1879 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1880
1881         Fix #74920.
1882         * typemanager.cs (unmanaged_enclosing_types): New.
1883         (IsUnmanagedType): Avoid infloops by using
1884         'unmanaged_enclosing_types' to talk with recursive invocations.
1885
1886 2005-05-13  Martin Baulig  <martin@ximian.com>
1887
1888         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1889         instance variable, not a local.  Fix #74873.
1890         (Block.ResolveUnreachable): Set it to true here.
1891
1892 2005-05-11  Duncan Mak  <duncan@novell.com>
1893
1894         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1895         continuing to process for 'arg'.
1896         (handle_preprocessing_directive): Check the argument of the #endif
1897         directive and report error CS1025 if there are any trailing
1898         characters.
1899
1900         According to the C# spec, having even whitespace after the #endif
1901         directive is illegal; however, because we call arg.TrimEnd ()
1902         beforehand, we have the same behavior as csc, allowing whitespace
1903         after the directive.
1904
1905         Fixes #74892.
1906
1907 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1908
1909         Fix #74863.
1910         
1911         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1912         (Constructor.GetObsoleteAttribute): Implemented correctly.
1913
1914 2005-05-10  Martin Baulig  <martin@ximian.com>
1915
1916         * support.cs (ReflectionParameters.ParameterModifier): Use
1917         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1918         and `ParameterAttributes.In'.  Fixes #74884.
1919
1920 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1921
1922         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1923         
1924         * expression.cs (Argument.GetParameterModifier): Turned to property.
1925         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1926         
1927         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1928         its C# equivalent.
1929         
1930 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1931
1932         Fix #74852.
1933         * decl.cs (MemberCache.AddMethods): Register override methods,
1934         rather than non-override methods.
1935         * typemanager.cs (RegisterOverride): New.
1936         (IsOverride): Update.
1937
1938 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1939
1940         Fix #73105.
1941         
1942         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1943         recursive declaration.
1944         
1945         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1946         
1947 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1948
1949         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1950         
1951         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1952
1953 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1954
1955         Fix #74797.
1956         * decl.cs (DeclSpace.FamilyAccessible): 
1957         Use TypeManager.IsNestedFamilyAccessible.
1958
1959         Fix reopened #64812.
1960         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1961         internal'.
1962
1963 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1964             Abin Thomas  <projectmonokochi@rediffmail.com>
1965             Anoob V E  <projectmonokochi@rediffmail.com>
1966             Harilal P R  <projectmonokochi@rediffmail.com>
1967
1968         Fix #64812.
1969         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1970         allow access to all static members.
1971
1972 2005-05-04  Martin Baulig  <martin@ximian.com>
1973
1974         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1975
1976 2005-05-04  Martin Baulig  <martin@ximian.com>
1977
1978         Fix #74655.
1979
1980         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1981         section at the end; make things work if `default' is not the last
1982         section.        
1983
1984 2005-05-04  Martin Baulig  <martin@ximian.com>
1985
1986         Fix #70400.
1987
1988         * statement.cs (Switch): Replaced the `got_default' field with a
1989         `default_section' one.
1990         (Switch.CheckSwitch): Set `default_section' here.
1991         (Switch.Resolve): If we're a constant switch and the constant is
1992         not found, use the default section.
1993
1994 2005-05-03  Martin Baulig  <martin@ximian.com>
1995
1996         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1997
1998         * statement.cs (Foreach.ArrayForeach): New nested class.
1999         (Foreach.TemporaryVariable): New nested class.
2000         (Foreach.EmitArrayForeach): Removed; this is now in the new
2001         ArrayForeach class.
2002
2003 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2004
2005         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2006         more conservative.
2007         (VerifyPendingMethods): Revert change below.
2008
2009         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2010         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2011         that used to trigger warning -28.  Remove warning -28.
2012         * expression.cs (Invocation.OverloadResolve): Use
2013         TypeManager.IsOverride to distinguish override methods.
2014
2015         Fix #74773.
2016         * pending.cs (VerifyPendingMethods): If a base type implements the
2017         requested interface, don't bother checking individual methods of
2018         the base type.  As a side-effect, this prevents the creation of
2019         unnecessary proxies.
2020
2021 2005-05-02  Martin Baulig  <martin@ximian.com>
2022
2023         Fix #70182.
2024
2025         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2026         Also `And' the locals if the old vector is null.
2027         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2028         null; in this case we basically reset all the variables.        
2029
2030 2005-05-02  Martin Baulig  <martin@ximian.com>
2031
2032         Fix #74529.
2033
2034         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2035         Added `FlowBranching branching' argument; always `and' the
2036         variables instead of `or'ing them unless we're an infinite loop.
2037
2038         * statement.cs (While.Resolve): Create a new sibling unless we're
2039         infinite.       
2040
2041 2005-05-02  Martin Baulig  <martin@ximian.com>
2042
2043         Fix #70140.
2044
2045         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2046         arguments; use it instead of creating a new TopLevelBlock.
2047         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2048         our ConstructorInitializer.
2049
2050         * statement.cs
2051         (TopLevelBlock.TopLevelBranching): New public property.
2052         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2053         and create our `TopLevelBranching'.
2054
2055         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2056         anonymous method host, use `block.TopLevelBranching' rather than
2057         creating a new branching.
2058
2059 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2060
2061         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2062         a ScopeInfo, if any of the current children is a child of the new
2063         entry, move those children there.
2064
2065 2005-04-30  Martin Baulig  <martin@ximian.com>
2066
2067         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2068         at the beginning of a SwitchSection.  Fix #73335.
2069
2070 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2071
2072         Fix #74378
2073         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2074         
2075         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2076         (FieldExpr.DoResolve): Obsolete members are ignored for field
2077         initializers.
2078         
2079 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2080
2081         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2082         of arrays detection.
2083
2084         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2085         verification.
2086         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2087
2088         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2089         arrays report.
2090
2091 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2092
2093         * cs-parser.jay: Use the prefered version of -unsafe in error
2094         message.
2095
2096 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2097
2098         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2099         circumstances.
2100
2101 2005-04-20  John Luke  <john.luke@gmail.com>
2102
2103         * driver.cs: fix typo in error message, --outout to --output
2104
2105 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2106
2107         * codegen.cs (InRefOutArgumentResolving): New field.
2108         
2109         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2110         fields outside contructor.
2111         
2112         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2113         
2114 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2115
2116         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2117         parameter code was not completed ever, so it was not as up-to-date
2118         as local variables.  Must finish it.
2119
2120         The bug fix was to compare the Toplevel of the block, not the
2121         current block.  Thanks for Ben for pointing this out. 
2122
2123 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2124
2125         * decl.cs (AddMethods): Use the declaring type of the problem
2126         method to determine if we want to squash a warning.
2127
2128 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2129
2130         * attribute.cs: Removed debug output.
2131
2132         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2133         
2134         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2135         Report.Stderr.
2136         
2137 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2138
2139         Fix #74481.
2140         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2141         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2142         all null comparisons against reference types.
2143
2144 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2145
2146         Fix# 74565
2147         * class.cs (TypeContainer.CircularDepException) New nested
2148         exception class.
2149         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2150         (TypeContainer.DefineType): Removed error, reset InTransit before
2151         exit.
2152         (Class.DefineType): Throw exception when is in Transit.
2153         Catch exception and report error.
2154         (Struct.DefineType): Throw exception when is in Transit.
2155         Catch exception and report error.
2156         (Interface.DefineType): Throw exception when is in Transit.
2157         Catch exception and report error.
2158
2159         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2160         handle nested exception handlers.
2161
2162         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2163         a catch.
2164
2165         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2166         InFinally and InCatch storage.
2167
2168         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2169         (Catch.Resolve): Set and Restore ec.InCatch.
2170         (Try.Resolve): Set and Restore ec.InFinally.
2171         (Try.HasCatch): True when try has catch.
2172
2173 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2174
2175         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2176           for the same event member, so exclude such cases from warning 419.
2177           Fixed bug #74633.
2178
2179 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2180
2181         * expression.cs (Binary.ResolveOperator): Apply patch from John
2182         Luke to fix bug 59864: operators &, | and ^ on enumerations
2183         require that the same enum type on both sides.
2184
2185         * driver.cs: Add warnings to old flag usage, this is to assist
2186         people who produce Makefiles and hope that the Makefiles will be
2187         used on Windows.
2188
2189         * class.cs (TypeContainer.EmitType): Moved the definition of the
2190         special $PRIVATE$ field from the resolve phase to the Emit phase.
2191         During resolve we do not know if we are a struct with
2192         HasExplicitLayout, we know this only after the attributes for the
2193         type are emitted.
2194
2195         Set the FieldOffset to zero on the dummy field that we create for
2196         the class.   Fixes 74590.
2197
2198 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2199
2200         Fix #73834.
2201         * ecore.cs (PropertyExpr.resolved): New.
2202         (DoResolve): Use it to handle a case of double resolution here.
2203         Handle a case of identical-name-and-type-name.
2204         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2205         resolution by storing the results of expression resolution back
2206         into the "probes" array.
2207
2208 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2209
2210         Fix cs0208-7.cs and cs0208-8.cs.
2211         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2212         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2213         error reporting to point out the reason a struct is not unmanaged.
2214
2215 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2216
2217         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2218           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2219
2220 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2221
2222         Fix #74528.
2223         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2224         IdenticalNameAndTypeName here.
2225         (EventExpr.InstanceResolve): Likewise.
2226
2227 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2228
2229         C# 2.0 DefaultCharSetAttribute implementation
2230         
2231         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2232         which allows us to set GlobalNamespace for every resolve.
2233         (Attribute.ResolveArguments): Cut from Resolve.
2234         (Attribute.GetCharSetValue): Returns CharSet named argument.
2235         (Attribute.DefinePInvokeMethod): Gets default charset from
2236         module settings.
2237         (GlobalAttribute.ResolveAsTypeStep): Override.
2238         (GlobalAttribute.ResolveArguments): Override.
2239         
2240         * class.cs (TypeAttr): Is protected.
2241         
2242         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2243         (ModuleClass.DefaultCharSetType): New memeber.
2244         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2245         
2246         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2247         charset from module.
2248         
2249         * delegate.cs (TypeAttr): Override.
2250         (Delegate.DefineType): Use this TypeAttr.
2251         
2252         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2253         at very early stage (before types are defined) to resolve model
2254         module attributes. It will probably not work with corlib but it
2255         should be ok.
2256         
2257         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2258         charset from module.
2259         
2260         * typemanager.cs (default_charset_type): New type.
2261
2262 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2263
2264         * decl.cs (MemberCache.AddMethods): Don't warn if
2265         System.Object.Finalize has buggy MethodAttributes.
2266
2267         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2268         removed below.
2269
2270 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2271
2272         * doc.cs : detect ambiguous reference to overloaded members.
2273           Fixed bug #71603. MS 1.1 csc does not detect it.
2274
2275 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2276
2277         * doc.cs : delegates must not be referenced with parameters.
2278           Fixed bug #71605.
2279
2280 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2281
2282         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2283
2284 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2285
2286         * driver.cs (MainDriver): Stop processing if the CLS stage found
2287         errors. 
2288
2289         (CompilerCallableEntryPoint.InvokeCompiler): Always
2290         reset after execution;   Take a TextWriter argument for the
2291         output.
2292
2293         * report.cs: Use the error stream instead of hardcoding stderr. 
2294
2295 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2296
2297         * class.cs: Reduce code paths to test, too small of an
2298         optimization to make it worth the extra testing.  Always perform
2299         it. 
2300
2301 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2302
2303         Fix #74510.
2304         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2305         operators that had errors reported on them.
2306
2307 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2308
2309         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2310         argument types.
2311         (Attribute.Resolve): Add named argument type checking.
2312         
2313         * class.cs (FixedField.Define): Use IsPrimitiveType
2314         
2315         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2316         
2317         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2318         unsafe parameter types.
2319         
2320         * statement.cs (Using.ResolveExpression): Add better error description.
2321         
2322         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2323         
2324 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2325
2326         Fix #74484.
2327         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2328         AttributeUsageAttribute in the emitcontext of the attribute class,
2329         not in the emitcontext of the attributable entity it was attached to.
2330         * cs-parser.jay: Use 'current_class', not 'current_container',
2331         when creating a GlobalAttribute.
2332
2333 2005-04-08  Alp Toker  <alp@atoker.com>
2334
2335         * pending.cs: The fix to #58413 failed to compile methods implementing
2336         interfaces with/without params modifiers and vice versa, even though
2337         params modifiers aren't part of the signature. Make the modifier check
2338         less strict as in csc.
2339
2340 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2341             Anoob V E  <projectmonokochi@rediffmail.com>
2342             Harilal P R  <projectmonokochi@rediffmail.com>
2343
2344         Fix #58413.
2345         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2346         modifiers of pending methods.
2347         (PendingImplementation.PendingImplementation): Initialize it.
2348         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2349         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2350         with ParameterData.  Add check for modifiers.
2351         * class.cs (MethodData.Define): Update to changes.
2352
2353 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2354
2355         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2356
2357 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2358
2359         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2360         property.
2361         
2362         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2363         
2364         * rootcontext.cs,
2365         * typemanager.cs: Registered RequiredAttributeAttribute.
2366         
2367 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2368
2369         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2370         Warning CS0169 is back at level 3.
2371         (IMethodData.SetMemberIsUsed): New method.
2372         
2373         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2374         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2375         
2376         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2377
2378         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2379         contants.
2380         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2381         is used.
2382         
2383         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2384         is used.
2385         
2386         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2387         to avoid the problems with nested types.
2388
2389 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2390             Anoob V.E  <projectmonokochi@rediffmail.com>
2391             Harilal P.R  <projectmonokochi@rediffmail.com>
2392             Raja R Harinath  <rharinath@novell.com>
2393
2394         Fix #73820.
2395         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2396         attribute.
2397         * typemanager (GetConstructor): Make public.
2398
2399 2005-04-05  John Luke  <john.luke@gmail.com>
2400             Raja R Harinath  <rharinath@novell.com>
2401
2402         Fix #62232.
2403         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2404         struct too.  Return false quicker in a few cases.
2405         (VerifyUnManaged): Use it.
2406
2407 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2408
2409         Fix #74041.
2410         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2411         not 'unreachable_seen'.
2412
2413 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2414
2415         * attribute.cs (Attribute.GetValue): Removed unused.
2416         
2417         * codegen.cs (CodeGen.TrimExt): Removed unused.
2418         
2419         * cs-parser.jay (output): Removed unused.
2420         
2421         * cs-tokenizer.cs (hex_digits): Removed unused.
2422         
2423         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2424         
2425         * expression.cs (Indirection.LoadExprValue): Removed unused.
2426         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2427         
2428         * iterators.cs (Iterator.param_types): Removed unused.
2429         
2430         * statement.cs (Goto.block): Removed unused.
2431         (ToplevelBlock.did): Removed unused.
2432         (Switch.ResolveConstantSwitch): Removed unused.
2433
2434 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2435
2436         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2437         resetting thingy.
2438
2439 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2440
2441         Fix #74232 and cs0208-3.cs.
2442         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2443         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2444         unmanaged type.  Don't use FieldBuilders when 't' is a
2445         TypeBuilder.  Use ModFlags and MemberType fields.
2446         * class.cs (MemberBase.member_type): Rename from MemberType.
2447         (MemberBase.MemberType): New property.  Determines member_type on
2448         demand.
2449         (MemberBase.DoDefine): Don't initialize MemberType here.
2450         (FieldMember.Define): Likewise.
2451
2452 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2453
2454         Fix #74241
2455         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2456         Attributes are emitted there.
2457         
2458 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2459
2460         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2461         keyword in 'partial enum' too.
2462         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2463         is not allowed).
2464         Report from Kamil Skalski <nazgul@omega.pl>.
2465
2466         Fix #74309.
2467         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2468         have partial containers too.
2469
2470         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2471         in block' checks to Block.CheckInvariantMeaningInBlock.
2472         * statement.cs (Block.GetKnownVariableInfo): Make private.
2473         (Block.IsVariableUsedInChildBlock): Remove.
2474         (Block.IsVariableUsedInBlock): Likewise.
2475         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2476         conflicting declaration.
2477         (Block.AddVariable): Make error messages less long-winded and more
2478         specific.  Show location of conflicting declaration.
2479         * parameter.cs (Parameters.Location): New readonly property.
2480
2481 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2482
2483         Clean up semantics of invoking ResolveMemberAccess.
2484         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2485         can have an instance, ensure that we pass in a non-TypeExpression
2486         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2487         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2488         argument.  Update to changes and simplify.
2489         (FieldExpr.Emitinstance): Remove CS0120 check.
2490         (PropertyExpr.EmitInstance): Likewise.
2491         * expression.cs (Argument.Resolve): Likewise.
2492         (Invocation.DoResolve): Update to changes in semantics of
2493         InstanceExpression.
2494
2495 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2496
2497         Fix #74241
2498         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2499         customization.
2500         
2501         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2502
2503 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2504
2505         Fix difference in behaviour with commandline invocation.
2506         * driver.cs (Driver.Reset): New.
2507         (CompilerCallableEntryPoint): Call it.
2508
2509         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2510         variable" warnings if the boolean expression failed to resolve.
2511
2512 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2513
2514         * attribute.cs: Fix the union of several permissions when some of them
2515         are unrestricted (so the result isn't an unrestricted permission set).
2516         Fix #74036.
2517
2518 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2519
2520         * ecore.cs (MemberExpr): New class.  Convert from interface
2521         IMemberExpr.
2522         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2523         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2524         error checks.
2525         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2526         (MethodGroupExpr.IsExplicitImpl): Remove.
2527         (Expression.GetFieldFromEvent): Remove.
2528         (SimpleName.MemberStaticCheck): Remove.
2529         (SimpleName.DoSimpleNameResolve): Update to changes.
2530         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2531         (MemberAccess.IdenticalNameAndTypeName): Remove.
2532         (MemberAccess.error176): Move to MemberExpr.
2533         (MemberAccess.DoResolve): Update to changes.
2534         (BaseAccess.DoResolve): Likewise.
2535
2536 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2537
2538         C# 2.0 Conditional attribute class implementation
2539         
2540         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2541         Analyzes class whether it has attribute which has ConditionalAttribute
2542         and its condition is not defined.
2543         
2544         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2545         (Class.IsExcluded): New method. Search for at least one defined
2546         condition in ConditionalAttribute of attribute class.
2547
2548 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2549
2550         * ecore.cs (PropertyExpr): Derive from Expression, not
2551         ExpressionStatement.
2552         (PropertyExpr.EmitStatement): Remove.
2553
2554 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2555
2556         Fix #74060.
2557         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2558         internal field "value__" of an enum be private.  The examples for
2559         "value__" that I found on MSDN all used FieldAttributes.Private.
2560
2561         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2562         Don't mention IL method attribute names.
2563
2564         Fix #47991.  Remove a TODO.
2565         * statement.cs (Block.Toplevel): Make into a field.
2566         (Block.Parameters): Move into ToplevelBlock.
2567         (Block.known_variables): Rename from child_variable_names.
2568         (Block.Block): Remove variants that take Parameters.  Initialize
2569         'Toplevel' with the immediately surrounding toplevel block.
2570         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2571         LocalInfo parameter.
2572         (Block.GetKnownVariableInfo): New.
2573         (Block.IsVariableNameUsedInChildBlock): Update.
2574         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2575         the block, even though it may not be in scope.
2576         (Block.AddVariable): Remove Parameters parameter.  Use
2577         Toplevel.Parameters instead.
2578         (Block.AddConstant): Remove Parameters parameter.
2579         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2580         (Block.IsParamaterReference): Likewise.
2581         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2582         (ToplevelBlock.Parameters): New.  Moved from Block.
2583         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2584         initialize Parameters to a non-null value.
2585         * cs-parser.jay: Update to changes.
2586         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2587         simple names that mean different things in the same block.  Use
2588         Block.IsVariableNameUsedInBlock.
2589
2590 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2591
2592         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2593         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2594         GetTypeHandle.  It is possible for a reflected type to derive from
2595         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2596         System.Array during mscorlib compilation).
2597         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2598         contain a method_hash, don't create one either.  Don't create a
2599         deep copy of the base cache's method_hash.
2600         (MemberCache.SetupCache): Rename back from DeepCopy.
2601         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2602         already initialized.  If we see an override function, add its
2603         underlying base virtual function to the member_hash too.
2604
2605         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2606
2607 2005-03-26  Raja R Harinath  <harinath@acm.org>
2608
2609         Fix #73038.
2610         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2611         fails to resolve, ensure that the LHS is still resolved as an
2612         lvalue.
2613
2614 2005-03-25  Raja R Harinath  <harinath@acm.org>
2615
2616         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2617         ec.ContainerType.
2618         (Enum.current_ec): Remove.
2619         (Enum.LookupEnumValue): Remove EmitContext argument.
2620         Just uses the one created during DefineType.
2621         (Enum.FindMembers): Update.
2622         * expression.cs (MemberAccess.DoResolve): Update.
2623
2624 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2625
2626         * assign.cs (Assign.DoResolve): Check for CS1717 when
2627         source and target are same (uses Equals).
2628
2629         * expression.cs (LocalVariableReference, ParameterReference,
2630         This): Implemented Equals, GetHashCode.
2631
2632         * statement.cs (Block.GetParameterReference): Removed useless
2633         local variable.
2634
2635 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2636
2637         Fix cs0128.cs
2638         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2639         blocks before deciding whether the error is cs0136 or cs0128.
2640
2641         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2642         (using_alias_directive, using_namespace_directive): Pass
2643         MemberName, not an expression to Namespace.UsingAlias and
2644         Namespace.Using.
2645         (MakeName): Use the MemberName of the namespace.
2646         * namespace.cs (Namespace.MemberName): New.
2647         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2648         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2649         Likewise.
2650         * decl.cs (MemberName.Name): Make readonly.
2651         (MemberName.FromDotted): New "constructor".
2652         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2653         (MemberCore.Name): Compute from MemberName on demand.
2654         (MemberCore.SetMemberName): Provide a way to change the
2655         MemberName.
2656         (MemberCore.AddToContainer): Don't take a fullname parameter.
2657         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2658         fully qualified name of the container to the member name.
2659         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2660         only if the type is a member of the root container.
2661         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2662         MemberName.Left rather than searching for an embedded ".".
2663         (PartialContainer.CreatePart): Update to changes in RootContext.
2664         (MemberBase.ShortName): Turn into a property.  Use
2665         MemberCore.SetMemberName.
2666         (MemberBase.ExplicitInterfaceName): Remove.
2667         (MemberBase.UpdateMemberName): Remove.
2668         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2669         (PropertyBase.SetMemberName): New override.
2670         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2671         (Tree.GetDecl): New.
2672         (Tree.AllDecls): Rename from Decls.
2673         * attribute.cs, enum.cs, report.cs: Update to changes.
2674         * driver.cs (MainDriver): Use MemberName.FromDotted on
2675         RootContext.MainClass.
2676
2677 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2678
2679         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2680         checks.
2681
2682         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2683
2684 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2685
2686         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2687         property accessor modifiers.
2688
2689         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2690         fixed buffer attribute (CS1716).
2691         (PropertyMethod.HasCustomAccessModifier): When property accessor
2692         has custom modifier.
2693
2694         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2695         modifiers.
2696         (PropertyExpr.DoResolveLValue): Add CS0272.
2697
2698 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2699
2700         * convert.cs: When converting to a pointer, use the proper Conv.U
2701         or Conv.I depending on the source data type.
2702
2703         * cs-tokenizer.cs: Make the size for large decimal constants,
2704         fixes #72957.
2705
2706 2005-03-17  Martin Baulig  <martin@ximian.com>
2707
2708         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2709         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2710
2711 2005-03-17  Martin Baulig  <martin@ximian.com>
2712
2713         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2714         to bool so we can return an error condition.
2715         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2716         returned an error.
2717
2718 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2719
2720         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2721         attributes.
2722
2723 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2724
2725         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2726         Refactor to avoid traversing the list of assemblies, and to avoid
2727         string concatenation.
2728         * typemanager.cs (guid_attr_type): Remove.
2729         (negative_hits, pointers, references): Remove hashes.
2730         (type_hash): New.
2731         (GetConstructedType): New.  Uses type_hash to handle constructed
2732         types (arrays, references, pointers).
2733         (GetReferenceType, GetPointerType): Use it.
2734         (GetNestedType): New.  Uses type_hash to handle nested types of
2735         reflected types.
2736         (LookupType, LookupTypeDirect): Remove.
2737         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2738         'types' hash and LookupTypeReflection directly.
2739         (params_string, params_object): Use GetConstructedType.
2740         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2741         top-level types.
2742         (Namespace.Lookup): Use cached_types.
2743         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2744         provided by old TypeManager.LookupType.
2745         * rootcontext.cs (MakeFQN): Remove.
2746         * decl.cs (DeclSpace.MakeFQN): Likewise.
2747         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2748         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2749         TypeManager.GetConstructedType.
2750         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2751
2752 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2753
2754         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2755         indexers.
2756
2757         * cs-parser.jay: Reports CS1527 for any namespace element.
2758
2759         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2760         Added CS0407.
2761
2762         * expression.cs (ParameterReference.IsAssigned): Changed error to
2763         CS0269.
2764         (Error_WrongNumArguments): Moved CS0245 detection here.
2765
2766         * statement.cs (Return.Resolve): Add CS1622 report.
2767
2768 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2769
2770         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2771
2772 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2773
2774         * attribute.cs expression.cs: Get rid of some allocations.
2775
2776 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2777
2778         * doc.cs : just eliminate the latest change.
2779
2780 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2781
2782         * doc.cs : commented out the latest change. It breaks xml-030.cs
2783
2784 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2785
2786         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2787           fail. So invoke CreateType() in FindDocumentedType().
2788
2789 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2790
2791         * cs-tokenizer.cs : added IsKeyword().
2792         * doc.cs : Detect keyword incorrectly used as identifier.
2793           Allow identifiers prefixed by @.
2794
2795 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2796
2797         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2798         It caused exception in namespace resolving (again!).
2799         
2800         * class.cs (Class.ctor): Removed exit.
2801         (PropertyMethod.ctor): ditto.
2802         
2803         * codegen.cs (Codegen.Reset): Reset static data.
2804         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2805         
2806         * cs-tokenizer.cs (Cleanup): Removed.
2807         
2808         * driver.cs (GetSystemDir): Rewrote to one line command.
2809         It caused problem with unloaded dynamic modules.
2810         (UnixParseOption): Removed Exit.
2811         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2812         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2813         Now can be mcs used as library.
2814         
2815         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2816         empty location.
2817         
2818         * location.cs (Reset): Reset static data.
2819         
2820         * namespace.cs (Reset): Reset static data.
2821         
2822         * report.cs (Report.Reset): Reset static data.
2823         
2824         * rootcontext.cs (RootContext.Reset): Reset static data.
2825         
2826         * tree.cs (RootTypes.ctor): Use Location.Null
2827         
2828         * typemanager.cs (TypeManager.Reset): Reset static data.
2829         (CoreLookupType): Removed Exit.
2830         (TypeHandle.Reset): Reset static data.
2831         
2832 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2833
2834         Fix #73516.
2835         * typemanager.cs (ComputeNamespaces): Import namespaces from
2836         referenced modules too.
2837
2838 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2839
2840         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2841         than '.'.
2842
2843 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2844
2845         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2846         enclosing DeclSpace.  This ensures that a name-lookup populates
2847         more caches and there are fewer 'TypeExpression's.  Carve out
2848         nested type lookup into ...
2849         (LookupNestedTypeInHierarchy): ... this.
2850
2851 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2852
2853         Clean up a few partial-class semantics.  
2854         Fixes test-357.cs and cs1618-2.cs.
2855         * cs-parser.jay (struct_declaration): Use 'current_class' as
2856         parent of newly-created struct.  Remove call to Register ().
2857         Use 'pop_current_class' to complete handing the current struct.
2858         (interface_declaration): Likewise.
2859         (class_declaration): Likewise.
2860         (enum_declaration): Use 'current_class' as parent of newly created
2861         enum.
2862         (delegate_declaration): Likewise.
2863         (pop_current_class): New function.  This is used to handle closing
2864         up the 'current_class' and 'current_container', and pointing them
2865         to the enclosing class/container.
2866         (CSharpParser): Initialize 'current_class' too.
2867         * decl.cs (MemberCore): Add check for invariant: a partial
2868         container is not a parsed entity, and thus does not enclose any
2869         parsed members.
2870         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2871         (DeclSpace.BaseTypeExpr): Use it.
2872         (DeclSpace.LookupType): Add check for invariant.
2873         * class.cs (TypeContainer): Add check for invariant: a nested
2874         class should have the same NamespaceEntry as its enclosing class.
2875         (TypeContainer.EmitFieldInitializers): Make virtual.
2876         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2877         MemberCore.
2878         (TypeContainer.Register): Remove.
2879         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2880         null.  Use TypeResolveEmitContext for resolving base types and
2881         interfaces.  Move initialization of Parts.TypeBuilder here from
2882         ...
2883         (TypeContainer.DefineNestedTypes): ... here.
2884         (PartialContainer): Take a Namespace not a NamespaceEntry.
2885         (PartialContainer.Create): Don't use Register.  Call the
2886         appropriate Add... function directly.
2887         (ClassPart): Take both the PartialContainer and the enclosing
2888         class as constructor arguments.
2889         (ClassPart.EmitFieldInitializers): Override.
2890         (ClassPart.PartFindNestedTypes): Remove.
2891         (FieldBase.GetInitializerExpression): Resolve the initializer
2892         expression in the emit context of the enclosing class.
2893         * tree.cs (RootTypes): Remove Register ().
2894         
2895 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2896
2897         * cs-parser.jay: Removed CS0134.
2898         
2899         * driver.cs: Removed CS1901.
2900         
2901         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2902         for predefined types.
2903
2904 2005-03-07  Duncan Mak  <duncan@novell.com>
2905
2906         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2907         well. Fixes bug #73454.
2908
2909 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2910
2911         * cs-tokenizer.cs (xtoken): Add CS1035.
2912         
2913         * class.cs (MethodData.Define): Add CS0683.
2914         (FieldMember.ctor): Add CS0681.
2915
2916 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2917
2918         * ecore.cs (SimpleName.DoResolve): Rename from
2919         SimpleName.DoResolveAllowStatic.
2920         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2921         Pass 'intermediate' flag to MemberStaticCheck.
2922         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2923         of "intermediate" lookups via MemberAccess.
2924         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2925         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2926
2927 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2928
2929         Fix #73394.
2930         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2931         slipped in because of variable names that are identical to a
2932         builtin type's BCL equivalent ('string String;', 'int Int32;').
2933         (PropertyExpr.EmitInstance): Likewise.
2934
2935 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2936
2937         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2938         
2939         * report.cs (warning_ignore_table): Made public.
2940
2941 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2942
2943         Fix #73282.
2944         * class.cs (MethodData.Emit): Pass 'container' to
2945         container.GetObsoleteAttribute instead of 'container.Parent'.
2946
2947 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2948
2949         * cs-parser.jay: Add 1534 error test.
2950
2951         * iterators.cs (Yield.CheckContext): Add error 1629.
2952         (Iterator.ctor): Save unsafe modifier.
2953         (MoveNextMethod.DoEmit): Restore unsafe context.
2954
2955         * namespace.cs (UsingAlias): Better error message.
2956
2957 2005-03-03  Dan Winship  <danw@novell.com>
2958
2959         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2960         the warning message [#73219]
2961
2962 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2963
2964         Fix compile with MCS 1.0.0.0.
2965         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2966         w_restore to not depend on string constant folding.
2967
2968 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2969
2970         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2971         CS0246 check to users who passed 'silent = false'.
2972         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2973         check.
2974         (SimpleName.SimpleNameResolve): Update.
2975         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2976         (MemberAccess.IdenticalNameAndTypeName): Update.
2977         * doc.cs (FindDocumentedTypeNonArray): Update.
2978
2979 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2980
2981         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2982         * parameters.cs (ComputeAndDefineParameters): Remove.
2983         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2984         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2985         Use GetParameterInfo.
2986
2987 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2988
2989         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2990
2991 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2992
2993         Unify DeclSpace.LookupType and DeclSpace.FindType.
2994         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2995         is in charge of defining nested types on demand.
2996         (DeclSpace.LookupType): Use it when the current_type is a
2997         TypeBuilder.  Use LookupTypeDirect for reflected types.
2998         (DeclSpace.FindType): Remove.
2999         (DeclSpace.LookupInterfaceOrClass): Likewise.
3000         (DeclSpace.DefineTypeAndParents): Likewise.
3001         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3002         DeclSpace.LookupType.
3003         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3004         * typemanager.cs (LookupType): Simplify.
3005         (AddUserType): Remove type from negative_hits.
3006         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3007         * class.cs (TypeContainer.FindMembers): Move handling of nested
3008         types ...
3009         (TypeContainer.FindMembers_NestedTypes): ... here.
3010         (TypeContainer.FindNestedType): Implement override.
3011         (ClassPart.FindNestedType): Delegate to PartialContainer.
3012         (ClassPart.PartFindNestedType): Looks up the nested types of the
3013         part alone.
3014
3015 2005-03-02  Martin Baulig  <martin@ximian.com>
3016
3017         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3018         static constructor in static classes.
3019
3020 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3021
3022         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3023         sizeParamIndex is not specified.
3024
3025 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3026
3027         Fix #73117
3028         * report.cs (WarningMessage.IsEnabled): Missing null check.
3029
3030 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3031
3032         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3033         in the fields and not in the properties.
3034
3035 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3036
3037         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3038         fields as well.
3039
3040 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3041
3042         * attribute.cs: Small refactoring (improved robustness).
3043         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3044         (ValidateGuid): Removed.
3045         (Resolve): Removed referenced to above mentioned.
3046         (GetAttributeUsage): Made private and changed to work without
3047         class assistance.
3048         (GetIndexerAttributeValue): Don't crash.
3049         (GetConditionalAttributeValue): Ditto.
3050         (GetClsCompliantAttributeValue): Ditto.
3051         (ExtractSecurityPermissionSet): All attributes exceptions are
3052         error 648.
3053         (GetPropertyValue): New helper.
3054         (GetMethodImplOptions): New method.
3055         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3056         some missing properties.
3057         
3058         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3059         (Method.ApplyAttributeBuilder): Updated.
3060         
3061         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3062         exception.
3063
3064 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3065
3066         Fix #73052.
3067         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3068         non-simple types (array, pointer, reference).
3069
3070 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3071
3072         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3073
3074         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3075         for operators.
3076         (Method.CheckBase): Catch wrong destructor here.
3077         (MethodData.Define): Add errors 550, 668.
3078
3079         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3080
3081         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3082
3083         * pending.cs (VerifyPendingMethods): Add error 551.
3084
3085         * typemanager.cs (CSharpName): Next error report helper.
3086
3087 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3088
3089         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3090         attributes. Removed useless attribute double check.
3091         It saves almost 2MBs for corlib.
3092
3093 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3094
3095         Fix #72924.
3096         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3097         called twice in case of error.
3098
3099 2005-02-23  Chris Toshok  <toshok@ximian.com>
3100
3101         Fix compiler portions of #72827.
3102         * statement.cs (Block.Emit): call Begin/EndScope on the
3103         EmitContext instead of the ILGenerator.
3104
3105         * codegen.cs (EmitContext.BeginScope): new method, call
3106         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3107         we have one.)
3108         (EmitContext.BeginScope): same, but EndScope and CloseScope
3109
3110         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3111         offset and call the superclass's OpenScope(int) with it.
3112         (SymbolWriter.CloseScope): get the current il
3113         offset and call superclass's CloseScope(int) with it.
3114
3115 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3116
3117         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3118         CS1677 for out and ref as well.
3119
3120         * class.cs (Method.Define): Add error CS1599 detection.
3121         
3122         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3123         
3124         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3125         
3126         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3127         
3128         * support.cs.cs (ModifierDesc): New helper method.
3129
3130 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3131             Abin Thomas  <projectmonokochi@rediffmail.com>
3132             Anoob V E  <projectmonokochi@rediffmail.com>
3133             Harilal P R  <projectmonokochi@rediffmail.com>
3134
3135         Fix #57851, #72718.
3136         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3137         MemberLookup (used for error reporting) actually returns a result.
3138         Fix error report number (122, not 112).
3139
3140 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3141             Anoob V E  <projectmonokochi@rediffmail.com>
3142             Harilal P R  <projectmonokochi@rediffmail.com>
3143
3144         Fix #71134.
3145         * pending.cs (PendingImplementation.GetAbstractMethods):
3146         Find NonPublic members too.
3147
3148 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3149
3150         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3151         Fixed error 217.
3152         
3153         * class.cs (MethodCore.CheckMethodAgainstBase):
3154         Add error 239 report.
3155
3156 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3157
3158         Fix #68955.
3159         * expression.cs (Invocation.IsApplicable): Make public.
3160         (Invocation.IsParamsMethodApplicable): Likewise.
3161         * delegate.cs (Delegate.VerifyApplicability): Don't use
3162         Invocation.VerifyArgumentCompat for parameter applicability
3163         testing.  Use Invocation.IsApplicable and
3164         Invocation.IsParamsMethodApplicable.
3165
3166 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3167
3168         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3169         
3170         * class.cs (Operator.Define): Add error 217 report.
3171         
3172 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3173
3174         * namespace.cs (UsingEntry.Resolve): Undo change below.
3175
3176 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3177
3178         Fix #72756.
3179         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3180         disable the error message when the extended MemberLookup also
3181         fails.
3182         (Expression.MemberLookupFinal): Update.
3183         (SimpleName.DoSimpleNameResolve): Update.
3184         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3185         Don't use MemberLookupFinal.
3186         (New.DoResolve): Update.
3187         (BaseAccess.CommonResolve): Update.
3188
3189 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3190
3191         Fix #72732.
3192         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3193         occured previously, don't resolve again.
3194
3195 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3196
3197         Fix #69949
3198         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3199         argument. Call ResolveAttributeUsage for unresolved.
3200         when types doesn't match ctor arguments.
3201         
3202         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3203         for nested attribute classes.
3204         (Class.attribute_usage): Removed.
3205         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3206         for attribute class.
3207         
3208         * ecore.cs (IsAttribute): Removed.
3209         
3210         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3211         
3212         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3213         now normal types.
3214         (attribute_types): Removed.
3215         (EmitCode): Global attributes are emited as the latest.
3216
3217 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3218
3219         * class.cs (EmitFieldInitializers): Don't emit field initializer
3220         for default values when optimilization is on.
3221         
3222         * constant.cs (Constant.IsDefaultValue): New property.
3223         
3224         * driver.cs: Add /optimize handling.
3225         
3226         * constant.cs,
3227         * ecore.cs,
3228         * literal.cs: Implement new IsDefaultValue property.
3229         
3230         * rootcontext.cs (Optimize): New field, holds /optimize option.
3231
3232 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3233
3234         Fix crasher in re-opened #72347.
3235         * namespace.cs (Namespace.Lookup): Return null if
3236         DeclSpace.DefineType returns null.
3237
3238         Fix #72678.
3239         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3240
3241 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3242
3243         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3244         now returns null if it cannot resolve to an lvalue.
3245         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3246         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3247         returned null.  Remove check for SimpleName.
3248         (EventExpr.DoResolveLValue): New.
3249         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3250         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3251         error from ...
3252         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3253         avoid CS0131 error.
3254         (Unary.ResolveOperator): Move CS0211 check ...
3255         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3256         CS0131 error.
3257         (Unary.DoResolveLValue): Simplify.
3258         (AddressOf.DoResolveLValue): New.
3259         (ArrayAccess.DoResolveLValue): New.
3260
3261 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3262
3263         * attribute.cs (Attribute.Resolve): Add arguments casting for
3264         when types doesn't match ctor arguments.
3265
3266 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3267
3268         Fix parts of #63202.
3269         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3270         lookup of operator in base type.  Ensure that all checks happen
3271         when the operator resolves to an "op_..." method.
3272
3273 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3274
3275         Fix #71992.
3276         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3277         'ignore_cs0104' parameter.  Pass it to ...
3278         (NamespaceEntry.Lookup): ... this.
3279         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3280         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3281         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3282         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3283         Update.  Request that cs0104 errors be ignored.
3284         (ComposedCast.ResolveAsTypeStep): Update.
3285
3286 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3287
3288         Fix #59209.
3289         * expression.cs (Invocation.BetterFunction): Remove support for
3290         comparing virtual functions and their overrides.
3291         (Invocation.IsOverride): New.
3292         (Invocation.OverloadResolve): Don't consider 'override' functions
3293         during candidate selection.  Store them in a lookaside list.
3294         If the selected method is a 'virtual' function, use the list to
3295         find any overrides that are closer to the LHS type.
3296
3297 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3298
3299         * expression.cs (New.DoResolve): Add complex core type reduction.
3300         (New.Constantify): Converts complex core type syntax like 'new int ()'
3301         to simple constant.
3302         
3303 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3304
3305         * decl.cs (EntryType.EntryType): New constructor to create an
3306         updated copy of a cache entry.
3307         (MemberCache.AddMethods): Use it.
3308         (MemberCache.ClearDeclaredOnly): Remove.
3309         (MemberCache.MemberCache): Update.
3310
3311 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3312
3313         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3314         variable.  This one is represents the actual low-level declaration
3315         of the method, as opposed to the semantic level `IsStatic'.   
3316
3317         An anonymous method which is hosted into a static method might be
3318         actually an instance method.  IsStatic would reflect the
3319         container, while MethodIsStatic represents the actual code
3320         generated.
3321
3322         * expression.cs (ParameterReference): Use the new MethodIsStatic
3323         instead of IsStatic.
3324
3325         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3326         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3327         set on the current EmitContext. 
3328
3329         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3330         resolve our casted expression as an LValue.  This triggers the
3331         proper LValue processing that is later required by Assign.
3332
3333         This fixes 72347.
3334
3335         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3336
3337 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3338
3339         C# 2.0 Fixed buffer implementation
3340
3341         * anonymous.cs: Update after RegisterHelperClass renaming.
3342
3343         * attribute.cs (AttributeTester.fixed_buffer_cache):
3344         Cache of external fixed buffers.
3345         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3346         implementation if field is fixed buffer else null.
3347
3348         * class.cs
3349         (TypeContainer.AddField): Accept FieldMember instead of Field.
3350         (FieldBase.IsFieldClsCompliant): Extracted code from
3351         VerifyClsCompliance descendant customization.
3352         (FixedField): New class handles fixed buffer fields.
3353         (FixedFieldExternal): Keeps information about imported fixed
3354         buffer.
3355         (IFixedField): Make access to internal or external fixed buffer
3356         same.
3357
3358         * cs-parser.jay: Add fixed buffer parsing.
3359
3360         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3361         buffer.
3362
3363         * expression.cs (Indirection): Extended implementation to accept
3364         fixed buffer field.
3365         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3366         (ElementAccess.MakePointerAccess): Get type as parameter.
3367         (DoResolve): Add fixed buffer field expression conversion.
3368         (DoResolveLValue): Ditto.
3369         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3370         (ArrayPtr): Derives from FixedBufferPtr.
3371         (ArrayPtr.Emit): Add extra emit for array elements.
3372
3373         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3374
3375         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3376         for compiler generated types.
3377         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3378
3379         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3380         and consume less memory.
3381         (Fixed.Resolve): Add fixed buffer case.
3382
3383         * typemanager.cs (compiler_generated_attr_ctor,
3384         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3385         (HasElementType): Add our own implementation to work on every
3386         runtime.
3387
3388 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3389
3390         * anonymous.cs (CaptureContext): Track whether `this' has been
3391         referenced.   
3392
3393         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3394         only captured `this' if it was implicitly done (instance
3395         methods/variables were used). 
3396
3397         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3398         `this' must be captured.
3399
3400 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3401  
3402         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3403         is null it means that there has been no need to capture anything,
3404         so we just create a sibling.
3405
3406         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3407
3408         Just a partial fix.  The other half is fairly elusive.
3409         
3410 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3411
3412         Fix #52586, cs0121-4.cs.
3413         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3414         and return a hashtable.
3415         (MemberCache.ClearDeclaredOnly): New.
3416         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3417         the method_hash of a base type too.
3418         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3419         type methods.  Overwrite entries with the same MethodHandle so
3420         that the ReflectedType is correct.  The process leaves in base
3421         virtual functions and their overrides as distinct entries.
3422         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3423         matters since it was boxed in a ArrayList before.
3424         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3425         modifier.
3426         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3427         case of a virtual function and its override (choose the overload
3428         as better).
3429         (Invocation.OverloadResolve): Avoid 'override' members during
3430         'applicable_type' calculation.
3431
3432 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3433
3434         Combine two near-redundant caches.
3435         * typemanager.cs (method_params): Rename from method_internal_params.
3436         (TypeManager.GetParameterData): New.  Replace
3437         Invocation.GetParameterData.
3438         (TypeManager.LookupParametersByBuilder): Remove.
3439         * expression.cs (Invocation.method_parameter_cache): Remove.
3440         (Invocation.GetParameterData): Remove.
3441         Update to changes.
3442         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3443         Update to changes.
3444
3445 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3446
3447         Fix #72015.
3448         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3449         TypeManager.multicast_delegate_type is null, resolve it by looking
3450         up "System.MulticastDelegate".
3451         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3452
3453 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3454             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3455             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3456
3457         Fix cs0164.cs.
3458         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3459         (LabeledStatement.AddReference): New.  Set 'referenced'.
3460         (Goto.Resolve): Use it.
3461
3462 2005-02-05  John Luke  <john.luke@gmail.com>
3463
3464         * driver.cs: remove duplicate -doc line in Usage ()
3465
3466 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3467
3468         * location.cs (Location.AddFile): Fix CS2002 error report.
3469
3470 2005-02-02  Martin Baulig  <martin@ximian.com>
3471
3472         * delegate.cs (Delegate.DefineType): Report an internal error if
3473         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3474         details.        
3475
3476 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3477
3478         Fix a crasher in a variant of #31984.
3479         * const.cs (Constant.CheckBase): New override that defers the
3480         new-or-override check in case the base type hasn't been populated
3481         yet.
3482         (Constant.Define): Ensure the new-or-override check is performed.
3483
3484 2005-02-01  Duncan Mak  <duncan@ximian.com>
3485
3486         * const.cs (LookupConstantValue): Check that `ce' is not null
3487         before calling GetValue ().
3488
3489 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3490
3491         Fix test-334.cs (#69519).
3492         * cs-parser.jay (using_alias_directive): Pass in an expression to
3493         NamespaceEntry.UsingAlias.
3494         (using_namespace_directive): Pass in an expression to
3495         NamespaceEntry.Using.
3496         (namespace_name): Don't flatten to a string.
3497         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3498         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3499         ResolveAsTypeStep.
3500         (NamespaceEntry.UsingEntry): Likewise.
3501         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3502         changes.
3503         (NamespaceEntry.LookupForUsing): Remove.
3504         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3505         names.
3506         (NamespaceEntry.Lookup): Remove support for dotted names.
3507
3508 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3509
3510         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3511         split into two.
3512         (NamespaceEntry.ImplicitParent): Compute on demand.
3513         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3514         parallels the current.
3515         (NamespaceEntry.LookupForUsing): Use it.
3516         (NamespaceEntry.Lookup): If the current namespace-entry is
3517         implicit, don't search aliases and using tables.
3518
3519 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3520
3521         Fix #31984.
3522         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3523         BaseCache here.
3524         (TypeContainer.BaseCache): Compute on demand.
3525         (TypeContainer.FindMembers): Define constants and types if they're
3526         not already created.
3527         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3528         check.
3529         * const.cs (Constant.Define): Make idempotent.
3530
3531 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3532
3533         * pending.cs: Produce better code (no nops produced by using Ldarg
3534         + value).
3535         
3536         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3537         i - 1' it should be arg + 1.
3538
3539         Fixes bug #71819.
3540
3541 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3542
3543         * attribute.cs (Attribute.CheckAttributeType): Make private
3544         non-virtual.
3545         (Attribute.ResolveType): Make virtual.
3546         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3547         handling of RootContext.Tree.Types.
3548
3549 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3550
3551         Update attribute-handling to use the SimpleName/MemberAccess
3552         mechanisms.
3553         * cs-parser.jay (attribute): Pass in an expression to the
3554         constructors of Attribute and GlobalAttribute.
3555         * attribute.cs (Attribute): Take an expression for the name.
3556         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3557         passed in attribute name expression.
3558         (Attribute.CheckAttributeType): Use it.
3559         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3560         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3561         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3562         argument to prevent error messages if the lookup fails.
3563
3564 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3565
3566         * expression.cs (Indirection): Implemented IVariable interface
3567         to support indirection in AddressOf operator.
3568         (PointerArithmetic.Emit): Add optimalization for case where
3569         result can be precomputed.
3570
3571 2005-01-26  Martin Baulig  <martin@ximian.com>
3572
3573         * class.cs (TypeContainer.AttributeTargets): Return the correct
3574         AttributeTargets depending on our `Kind' instead of throwing an
3575         exception; fixes #71632.
3576
3577 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3578
3579         Fix #71257
3580         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3581         constant members.
3582
3583 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3584
3585         Fix #71602.
3586         * expression.cs (MemberAccess.DoResolve): Don't complain with
3587         cs0572 when the LHS of a member access has identical name and type
3588         name.
3589
3590 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3591
3592         Fix #71651, #71675
3593         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3594         CreatePermission.
3595         Create custom PermissionSet only for PermissionSetAttribute.
3596
3597 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3598
3599         Fix #71649
3600         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3601         delegates in static class.
3602
3603 2005-01-24  Martin Baulig  <martin@ximian.com>
3604
3605         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3606         merging an implicit block, just use its reachability.
3607
3608         * statement.cs (Block.Resolve): Make the unreachable code check
3609         work wrt. implicit blocks; see test-337 from #63842.
3610
3611 2005-01-21  Alp Toker  <alp@atoker.com>
3612  
3613         * cs-parser.jay: destructor_declaration's container is PartialContainer
3614         not Class when partial types are used, so use Kind prop instead of
3615         'is'.
3616         
3617 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3618
3619         * cs-parser.jay: Improve error reporting when an interface
3620         declares new types.
3621
3622 2005-01-20  Dick Porter  <dick@ximian.com>
3623
3624         * support.cs: SeekableStreamReader fix from Sandor Dobos
3625         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3626         chars are read.  Fixes bug 70369.
3627
3628 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3629
3630         * cs-parser.jay (catch_clause): Simplify current_block handling
3631         somewhat.
3632
3633 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3634
3635         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3636         code with ImplicitStandardConversion to handle the implicit
3637         conversion of method groups into valid delegate invocations. 
3638
3639         The problem is that in parameter handling we were using this code
3640         path.  Fixes bug #64698
3641
3642 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3643
3644         * cs-parser.jay: Fix several infelicities.
3645         - Avoid assigning to the parser value stack.  Code like 
3646           '$3 = null' is unclean.  Synthesize a value for the code block
3647           instead. 
3648         - Avoid using oob_stack for storing location information.  Use ...
3649         (_mark_): ... this.  New (empty) rule.  Saves the current location
3650         in $$.
3651         (foreach_statement): Avoid using oob_stack for current_block
3652         handling.  Use technique used in for_statement and
3653         using_statement.  Synthesize a value for the code block to store
3654         additional intermediate information.
3655
3656 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3657
3658         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3659         of a different type is only allowed to private fields of a
3660         containing type, not on fields of a base class.
3661
3662         See test-174.cs and error cs0122-9.cs
3663
3664 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3665
3666         Fix test-335.cs (bug #58126).
3667         * cs-parser.jay (argument): Split out non-expression parts of the
3668         rule into 'non_simple_argument'.
3669         (invocation_expression): Support parenthesized invocations with
3670         multiple arguments, and with single non-simple arguments.
3671
3672 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3673
3674         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3675         places.
3676
3677 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3678
3679         Fix cs0038-1.cs, cs1640-6.cs.
3680         * ecore.cs (Expression.Resolve): Remove special-case for
3681         SimpleName in error-handling.
3682         (Expression.almostMatchedMembers): Relax access permission to
3683         protected.
3684         (Expression.MemberLookupFailed): Handle duplicates in
3685         almostMatchedMembers list.
3686         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3687         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3688         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3689         overload if the passed in MemberInfo is a MethodBase.
3690
3691 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3692
3693         Fix #70749
3694         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3695         for non-CAS & merge permission sets properly.
3696
3697 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3698
3699         Improve standard-compliance of simple name and member access 
3700         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3701         * ecore.cs (FullNamedExpression): New abstract base class 
3702         for Namespaces and TypeExpressions.
3703         (ResolveFlags.SimpleName): Remove.
3704         (SimpleName): Remove support for dotted names.
3705         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3706         DeclSpace.FindType and DeclSpace.LookupType.
3707         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3708         (Expression.ExprClassName): Make member function.
3709         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3710         a namespace.  Remove creation of dotted "SimpleName"s.
3711         (MemberAccess.DoResolve): Likewise.
3712         * decl.cs (DeclSpace.Cache): Make private.
3713         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3714         (DeclSpace.FindType): Update.
3715         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3716         FullNamedExpression.
3717         * namespace.cs (Namespace): Derive from FullNamedExpression
3718         so that it can be part of expression resolution.
3719         (Namespace.Lookup): Return an FullNamedExpression.
3720         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3721         namespace.
3722         * rootcontext.cs (NamespaceLookup): Remove.
3723         (LookupType): Move to DeclSpace.
3724         * attribute.cs (CheckAttributeType): Update.
3725         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3726         (FindDocumentedTypeNonArray): Likewise.
3727
3728 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3729
3730         Fix cs0509.cs, cs1632.cs.
3731         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3732         is the same as IsInterface.
3733         (TypeContainer.GetClassBases): Likewise.
3734         * statement.cs (LabeledStatement.ig): New field.
3735         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3736         label.
3737         (LabeledStatement.DoEmit): Check that the label was created with
3738         the same ILGenerator.
3739
3740 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3741
3742         Fix #71058
3743         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3744         accessors to its properties.
3745
3746         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3747         from accessors to property.
3748         
3749 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3750
3751         Fix #70722
3752         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3753         only for overrides.
3754         
3755 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3756
3757         * attribute.cs: Check for null and empty strings.  
3758
3759         I have lost another battle to Paolo.
3760
3761 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3762
3763         Fix #70942
3764         * class.cs (PropertyMethod): Set Parent field in ctors.
3765         (SetMethod.InternalParameters): Add unsafe switch hack.
3766         Override MarkForDuplicationCheck where it is appropriate.
3767
3768         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3769         It says whether container allows members with the same name.
3770         Base default is no.
3771         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3772         Removed is_method parameter.
3773
3774 2005-01-06  Duncan Mak  <duncan@ximian.com>
3775
3776         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3777         because the previous change led to incorrect reporting of CS1032
3778         ("Cannot define/undefine preprocessor symbols after first token in
3779         file"). Instead of using `tokens_seen' as the only flag that
3780         triggers CS1040, introduce `comments_seen'. This new flag is used
3781         to signify having seen comments on the current line, so it is
3782         unset after a newline.
3783
3784 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3785
3786         * doc.cs : When searching for a type, find nested type too.
3787           This fixes bug #71040.
3788
3789 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3790
3791         * doc.cs :
3792           - Warn missing member comment on those classes which also does not
3793             have doc comments. Fixed bug #71041.
3794           - Don't warn missing doc comment on default constructor.
3795             Fixed bug #71042.
3796
3797 2005-01-06  Duncan Mak  <duncan@ximian.com>
3798
3799         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3800         comments, set `tokens_seen' to true. This allows us to detect
3801         misplaced preprocessor directives (i.e. not at the beginning of
3802         the a line, nor after whitespaces). In that case, report error
3803         CS1040. This fixes bug #56460.
3804
3805         * cs-parser.jay (interface_member_declaration): Add checks for
3806         IsExplicitImpl, and report CS0541 error if an interface member is
3807         defined as an explicit interface declaration.
3808
3809 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3810
3811         Fix #70817
3812         * class.cs (PropertyMethod): Set Parent field in ctors.
3813         (SetMethod.InternalParameters): Add unsafe switch hack.
3814         
3815         * decl.cs (MemberCore.Parent): Cannot be readonly.
3816
3817 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3818
3819         * decl.cs (DeclSpace.ResolveType): Remove.
3820         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3821         Merge in code from ...
3822         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3823         * class.cs, enum.cs: Update to changes.
3824
3825 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3826
3827         * anonymous.cs: Ensure that we init the scope of our parent if it
3828         has not been initialized yet.
3829
3830 2004-12-30  Duncan Mak  <duncan@ximian.com>
3831
3832         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3833         if field.FieldBuilder is null. Fixes #70758.
3834
3835         * convert.cs: Fixed some typos and updated some of the comments.
3836         (ImplicitStandardConversionExists):
3837         (TryImplicitIntConversion): If `target_type' is an interface and
3838         the type of `ic' implements this interface, return true or a new
3839         BoxedCast instead of null. This fixes #70468.
3840
3841 2004-12-29  Duncan Mak  <duncan@ximian.com>
3842
3843         * expression.cs (Argument.Emit): Check that Expr is
3844         IMemoryLocation before casting to it, and report CS1510 otherwise.
3845
3846         This fixes #70402.
3847
3848 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3849
3850         * statement.cs (Block.ThisVariable): remove the recursion here, to
3851         make the --profile more sane.
3852
3853 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3854
3855         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3856         assembly, by JB Evain.
3857
3858 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3859
3860         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3861           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3862         "parent" refers to enclosing type/class.  "base" refers to superclass.
3863
3864 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3865
3866         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3867         Ensure that we only have GlobalAttributes.
3868         * attribute.cs (Attribute.Emit): Make non-virtual.
3869         (GlobalAttribute.Emit): Remove.
3870         (Attribute.Resolve): Make virtual.
3871         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3872         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3873         the argument. Don't create one.
3874         (Attribute.GetObsoleteAttribute): Likewise.
3875         (Attribute.GetClsCompliantAttributeValue): Likewise.
3876         * class.cs, decl.cs: Update to changes.
3877
3878 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3879
3880         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3881         
3882         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3883         
3884         * statement.cs (Foreach.Resolve): Add error 186 report.
3885
3886 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3887
3888         * expression.cs (Conditional.DoResolve): Add warning 429.
3889         
3890         * statement.cs (If.Resolve): Add warning 665.
3891
3892 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3893
3894         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3895         except when in the parser, and in GlobalAttribute.
3896         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3897         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3898         RootContext.Tree.Types.NamespaceEntry once work is done.
3899         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3900         and resets RootContext.Tree.Types.NamespaceEntry.
3901
3902 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3903
3904         * cs-parser.jay: Don't create a block for every variable.
3905
3906 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3907
3908         * location.cs: Provide extra information.
3909
3910         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3911         variables from the captured environment, it is the ldarg_0.
3912
3913 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3914
3915         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3916         find a conclusion.
3917         
3918         * class.cs: Changed warning level for 169 to avoid developer
3919         displeasure from warning flooding. It will be changed back when they
3920         fix most of current BCL warnings.
3921         
3922         * RootContext.cs: Pushed default WarningLevel to 3.
3923         
3924         * statement.cs: Removed unused variable.
3925
3926 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3927
3928         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3929         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3930         Add error 502 report.
3931         (StaticClass.DefineType): Add error 441 report.
3932         (Class.AllowedModifiersProp): New virtual property as temporary
3933         extension to AllowedModifiers.
3934         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3935         to share implementation with StaticClass and don't call virtual
3936         methods from ctor.
3937         
3938         * driver.cs (MainDriver): Add error 1558 test.
3939
3940         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3941         report. Moved error 36 test here.
3942
3943         * statement.cs (Throw.Resolve): Add error 724 report.
3944
3945         * typemanager.cs: Add out_attribute_type core type.
3946         
3947 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3948
3949         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3950         3018 report.
3951         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3952
3953         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3954         3017 report.
3955         
3956         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3957
3958         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3959         Add error 3023 report.
3960         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3961
3962         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3963         implementation.
3964
3965 2004-12-12  John Luke  <john.luke@gmail.com>
3966
3967         * driver.cs (AddArgs): take -- into account when
3968         adding arguments, fixes bug 65710 
3969
3970 2004-12-12  Martin Baulig  <martin@ximian.com>
3971
3972         * expression.cs (Unary.TryReduceNegative): Added support for
3973         SByteConstant and ByteConstant.
3974         (Unary.Reduce): Check error values from TryReduceNegative().
3975
3976 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3977
3978         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3979         and report exception as error 182.
3980
3981 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3982
3983         * driver.cs (Main): Fix message when there are warnings.
3984
3985 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3986
3987         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3988
3989 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3990
3991         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3992         Reduced number of warnings.
3993         
3994         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3995
3996 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3997
3998         * driver.cs: Removed message.
3999
4000         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4001
4002 2004-12-08    <vargaz@freemail.hu>
4003
4004         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4005
4006 2004-12-08  Martin Baulig  <martin@ximian.com>
4007
4008         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4009         instead of a CS3002 for properties and indexer.
4010
4011 2004-12-08  Martin Baulig  <martin@ximian.com>
4012
4013         * decl.cs (MemberName.ToString): Make this work again.
4014
4015 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4016
4017         * attribute.cs (Resolve): Add error 591 detection.
4018
4019         * class.cs (FieldMember.Define): Add error 1547 detection.
4020         (Indexer.Define): Add error 620 detection.
4021         (Operator.Define): Add error 590 detection.
4022
4023         * ecore.cs: Missing argument for error 79.
4024
4025         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4026         detection.
4027
4028 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4029
4030         Fix #70106
4031         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4032         only.
4033
4034 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4035
4036         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4037           Some operator comments were suppressed.
4038         * doc.cs : Implicit/explicit operator name in doc comments are like
4039           "op_Explicit(type)~returnType", so added suffix handling.
4040
4041 2004-12-07  Martin Baulig  <martin@ximian.com>
4042
4043         * decl.cs
4044         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4045         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4046         (DeclSpace.ec): New protected field; store the EmitContext here.
4047         (DeclSpace.EmitContext): New public property; moved here from
4048         `TypeContainer'.
4049         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4050         EmitContext.
4051
4052         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4053         (Enum.Emit): Don't create a new EmitContext.
4054
4055         * delegate.cs (Delegate.DefineType): Always create the
4056         EmitContext.
4057
4058         * iterators.cs (Iterators.DefineIterator): Create a new
4059         EmitContext and store it in `ec'.
4060
4061 2004-08-24  Martin Baulig  <martin@ximian.com>
4062
4063         * typemanager.cs
4064         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4065         this for accessibility checks.
4066         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4067         IsNestedFamilyAccessible.
4068         (TypeManager.IsSubclassOf): New method, do what the name actually
4069         says.   
4070
4071 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4072
4073         Fix crash on cs0657-17.cs.
4074         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4075         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4076         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4077         the case where the NamespaceEntry gets overwritten.
4078
4079 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4080
4081         Fixed #69195, #56821
4082         * ecore.cs (ResolveBoolean): Tiny refactoring.
4083
4084         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4085         of right expression resolving when left is false constant and
4086         operator is LogicalAnd OR true constant and operator is LogicalOr.
4087
4088         * statement.cs (ResolveUnreachable): Always reports warning.
4089
4090 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4091
4092         * class.cs: Distinguish between 1721 and 1722 (just a little help
4093         for the programmer).
4094
4095 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4096
4097         * delegate.cs: Only allow this on new versions of the language. 
4098
4099 2004-12-02  Duncan Mak  <duncan@ximian.com>
4100
4101         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4102         Expression class.
4103         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4104         here as a static method. Take an additional bool out parameter
4105         `must_do_cs1540_check' for signaling to InstanceResolve.
4106         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4107         member field from PropertyExpr class and made it an argument of
4108         the method instead.
4109         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4110         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4111         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4112         and `remove_accessor' as well as InstanceResolve: report CS0122
4113         where applicable.
4114
4115         Fixes #70129.
4116
4117 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4118
4119         Fix test-327.cs, test-328.cs, and put in early infrastructure
4120         for eventually fixing #52697.
4121         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4122         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4123         from other methods.
4124         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4125         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4126         (VerifyUsing, error246): Update.
4127         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4128         'NamespaceEntry.LookupNamespaceOrType'.
4129
4130 2004-12-03  Martin Baulig  <martin@ximian.com>
4131
4132         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4133         method as our child, call AnonymousMethod.Compatible() on it.
4134
4135 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4136
4137         Disable XML documentation support in 'basic' profile.
4138         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4139         Redirect XmlElement to System.Object.
4140         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4141         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4142         * mcs.exe.sources: Add doc-bootstrap.cs.
4143         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4144         of doc.cs.
4145
4146 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4147
4148         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4149           comments are allowed.
4150
4151 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4152
4153         * delegate.cs: Add checks for subtypes in paramaters and return values
4154         in VerifyMethod () to add support for Covariance/Contravariance
4155         in delegates.
4156         
4157 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4158
4159         * report.cs: Remove extra closing parenthesis.
4160
4161         * convert.cs (Error_CannotImplicitConversion): If the name of the
4162         types are the same, provide some extra information.
4163
4164         * class.cs (FieldBase): Use an unused bit field from the field to
4165         encode the `has_offset' property from the FieldMember.  This saves
4166         a couple of Ks on bootstrap compilation.
4167
4168         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4169         method as our child, return the AnonymousMethod resolved
4170         expression.
4171
4172         * expression.cs (New.DoResolve): Allow return values from
4173         NewDelegate to also include AnonymousMethods.
4174
4175         Fixes #70150.
4176
4177 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4178
4179         Fix bug #70102
4180         * attribute.cs (Resolve): Improved implementation of params
4181         attribute arguments.
4182
4183         * support.cs (ParameterData): Add HasParams to be faster.
4184
4185 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4186
4187         all things are for /doc support:
4188
4189         * doc.cs: new file that supports XML documentation generation.
4190         * mcs.exe.sources: added doc.cs.
4191         * driver.cs:
4192           Handle /doc command line option.
4193           Report error 2006 instead of 5 for missing file name for /doc.
4194           Generate XML documentation when required, after type resolution.
4195         * cs-tokenizer.cs:
4196           Added support for picking up documentation (/// and /** ... */),
4197           including a new XmlCommentState enumeration.
4198         * cs-parser.jay:
4199           Added lines to fill Documentation element for field, constant,
4200           property, indexer, method, constructor, destructor, operator, event
4201           and class, struct, interface, delegate, enum.
4202           Added lines to warn incorrect comment.
4203         * rootcontext.cs :
4204           Added Documentation field (passed only when /doc was specified).
4205         * decl.cs:
4206           Added DocComment, DocCommentHeader, GenerateDocComment() and
4207           OnGenerateDocComment() and some supporting private members for
4208           /doc feature to MemberCore.
4209         * class.cs:
4210           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4211         * delegate.cs:
4212           Added overriden DocCommentHeader.
4213         * enum.cs:
4214           Added overriden DocCommentHeader and GenerateDocComment().
4215
4216 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4217
4218         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4219         unwrapping the enumeration values, chain to
4220         DoConstantNumericPromotions again, so we can promote things to the
4221         fundamental types (takes care of enums that are bytes, sbytes).
4222
4223         Fixes bug #62054.
4224
4225 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4226
4227         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4228         Fix long-standing bug in type-lookup.  Use FindType instead of
4229         LookupType when ec.ResolvingTypeTree.
4230         (Attribute.ResolveType, Attribute.Resolve)
4231         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4232         Update to changes.
4233         (Attributes.Search): Remove internal version.  Update.
4234         (Attributes.SearchMulti): Update.
4235         (Attributes.GetClsCompliantAttribute): Remove.
4236         (Attributes.GetIndexerNameAttribute): Remove.
4237         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4238         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4239         * class.cs (Indexer.Define): Likewise.
4240
4241 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4242
4243         Fix bug #68790
4244         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4245         MarshallByReference members access.
4246
4247         * expression.cs: Use CheckMarshallByRefAccess;
4248         Better error CS0197 message.
4249
4250         * report.cs: Print whole related error message.
4251
4252 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4253
4254         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4255         the current directory to help debugging.
4256
4257 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * class (GetClassBases): Better error 60 report.
4260         (EventProperty): Disabled warning 67 detection.
4261
4262 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4263
4264         Fix bug #60324
4265         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4266
4267         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4268         precise values.
4269
4270 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4271
4272         Fix bug #49488
4273         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4274
4275         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4276
4277 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4278
4279         * attribute.cs (Attribute.Resolve): Refine error reporting and
4280         report a cs0117 if the identifier does not exist, to distinguish
4281         from 0617 which is a miss-use of the actual identifier.
4282
4283         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4284         between cs0070 and cs0079.
4285
4286         * class.cs (MemberBase.DoDefine): When reporting a wrong
4287         accessibility level, we use MethodCore to compare instead of
4288         Method (this was a regression in some refactoring effort).
4289
4290         So now we correctly report cs0056 again.
4291
4292         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4293         testing the target_type (which was known to be object_type) and
4294         not the source type (which is anonymous_method).
4295
4296         Fixed reporting of error cs1660.
4297
4298         * expression.cs (UserCast.Source): Expose the underlying cast.
4299
4300         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4301         allowed types to find a match to int32 first (most common).
4302
4303         In addition, it ignores any ImplicitUserConversions that did an
4304         internal implicit conversion (as the switch statement allows only
4305         one integral conversion to exist).
4306
4307         * class.cs (PartialContainer.Create): rename `name' to
4308         `member_name' for clarity.  Then replace the string calls with a
4309         call to MemberName.GetPartialName, as now using
4310         MemberName.ToString is an error (this is due to the side effects
4311         it had, that were fixed in the past).
4312
4313         This will restore the error reporting on a number of partial class
4314         errors that were missusing this (and getting an exception as a
4315         results, which is now just a plain textual warning, because
4316         yyparse debug output would crash otherwise).
4317
4318 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4319
4320         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4321
4322 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4323
4324         * rootcontext.cs (LookupType): Make sure to cache lookups that
4325         don't give us a negative result. This saves about 5% of corlib
4326         compilation time.
4327
4328 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4329
4330         * report.cs (AbstractMessage.Print): messages are sent to stderr
4331
4332         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4333         non-interface in the list of interfaces (at this point, either
4334         parent was properly set, or a base class is being listed in the
4335         interfaces section).
4336
4337         This flags error 1722, and resolves the crash from bug 69259.
4338
4339 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4340
4341         * statement.cs (Using.EmitExpressionFinally): make this work right
4342         for valuetypes. Fixes 69926.
4343
4344 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4345
4346         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4347         converted to an enum" here, before we try to change the underlying
4348         type.  This code exists, but it is a different code path than the
4349         one used while encoding constants.
4350
4351         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4352         old bug: when converting from the null literal to a pointer,
4353         return an EmptyCast, not the NullLiteral.
4354
4355         This fixes #69921, the recent null_type changes probably made this
4356         bug more prominent.
4357
4358         (ImplicitReferenceConversionExists): In addition, resynchronized
4359         the code here, so it matches the same code in
4360         ImplicitReferenceConversionExists for the `from any class-type S
4361         to any interface-type T'.
4362         
4363
4364 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4365
4366         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4367
4368 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4369
4370         * cs-parser.jay: Use verbosity accordingly. 
4371
4372 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4373
4374         * expression.cs (Unary.ResolveOperator): Do not report warning;
4375         AddressOf reads from variable.
4376         
4377         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4378
4379 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4380
4381         Fix bug #69462
4382
4383         * attribute.cs (Attributable): Removed CheckTargets.
4384         (Attributes.Emit): Explicit attribute targets are tested here.
4385
4386         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4387         not enabled for interfaces.
4388
4389         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4390         (GetAssemblyName): Ouch next bug there.
4391
4392 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4393
4394         * expression.cs: Error 275 added.
4395         
4396 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4397
4398         Fix bug #69177 (Implemented decimal constant support)
4399
4400         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4401         (BinaryFold): Add DecimalConstant.
4402
4403         * const.cs (Define): Decimal constant 
4404         (is not constant.
4405         (ChangeType): Add decimal type handling.
4406         (LookupConstantValue): Don't set value for decimal type but
4407         emit DecimalConstantAttribute. Needed for constant optimization.
4408
4409         * constant.cs (ToDecimal): New method.
4410         (ConvertToDecimal): New method.
4411         (IntConstant): Implemented ConvertToDecimal.
4412         (DecimalConstant.Emit): Emit optimized version for decimals in
4413         int range.
4414
4415         * expression.cs (ResolveOperator): Changed order of constant
4416         reduction to work correctly with native types which have
4417         overloaded operators.
4418         (ResolveMemberAccess): Extract constant value from attribute
4419         for decimal type.
4420
4421         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4422
4423         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4424         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4425         (ChangeType): Decimal is special.
4426         (TypeToCoreType): Add decimal type.
4427
4428 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4429
4430         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4431         decimal types.
4432
4433 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4434
4435         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4436         test cs1667-5.cs.
4437
4438 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4439
4440         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4441
4442         * pending.cs (PendingImplementation): Grab only interfaces.
4443
4444 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4445
4446         * statement.cs (ForeachHelperMethods): Add location member and
4447         error 202 detection.
4448
4449 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4450
4451         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4452         automatically handled by executable.make.
4453         (PROGRAM): Make profile-specific.
4454
4455 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4456
4457         * expression.cs (DoResolveBase): Fixed wrong warning for out
4458         variables.
4459
4460 2004-11-18  Martin Baulig  <martin@ximian.com>
4461
4462         Merged latest changes into gmcs.  Please keep this comment in
4463         here, it makes it easier for me to see what changed in MCS since
4464         the last time I merged.
4465
4466 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4467
4468         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4469         (TypeHandle.GetMemberCache): New.
4470         (TypeHandle.TypeHandle): Update.
4471         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4472         (TypeManager.LookupParentInterfacesCache):
4473         Rename from LookupInterfaceCache.  Optimize slightly.
4474         (TypeManager.MemberLookup_FindMembers): Update.
4475         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4476         multi-type variant.
4477         (AddCacheContents): Rename from AddHashtable.
4478         * class.cs (TypeContainer.parent_container): Remove.
4479         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4480         (TypeContainer.DoDefineMembers): Don't initialize it.
4481         Update to name changes.
4482         
4483 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4484
4485         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4486         that factors the code to check access modifiers on override.  
4487
4488         (PropertyBase): Use the code here.
4489
4490         Patch from Lluis S'anchez, fixes bug #69361.
4491
4492 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4493
4494         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4495         routine that is used to report the use of a captured variable
4496         whose address has been taken.
4497
4498         There are two checks: one when variables are being captured and
4499         the other check is when the address of a variable is taken. 
4500         
4501         (because an anonymous methods might be resolved before *or* after
4502         the address has been taken) and 
4503
4504         * expression.cs (Conditional.DoResolve): Remove the special
4505         casing that Martin added to trueExpr and falseExpr being both
4506         NullLiteral.  We get the right behavior now just by introducing
4507         the null_type into the compiler. 
4508
4509         * convert.cs (ExplicitConversion): Change the code to use
4510         null_type instead of testing `expr is NullLiteral'.
4511         (ImplicitConversionStandard): use null_type too.
4512         (ImplicitReferenceConversionExists): use null_type too.
4513         (ImplicitReferenceConversion): use null_type too.
4514
4515         * literal.cs: The type of `NullLiteral' is now null_type instead
4516         of object_type. 
4517         (Resolve): Set the type here.
4518
4519         * typemanager.cs: Introduce null_type.
4520
4521 2004-11-17  Martin Baulig  <martin@ximian.com>
4522
4523         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4524         direction, like FindMembers() does.  Fixes #69546, testcase is in
4525         test-315.cs.    
4526
4527 2004-11-16  Martin Baulig  <martin@ximian.com>
4528
4529         This is based on a patch from Marek Safar, see bug #69082.
4530         Fixes bugs #63705 and #67130.
4531
4532         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4533         method; create a MemberCache for an interface type and cache the
4534         result.
4535
4536         * decl.cs (IMemberContainer.ParentContainer): Removed.
4537         (IMemberContainer.ParentCache): New property.
4538         (MemberCache.SetupCacheForInterface): Removed.
4539         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4540         to create a cache for an interface's "parent".
4541
4542         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4543         interfaces too.
4544
4545 2004-11-16  Martin Baulig  <martin@ximian.com>
4546
4547         Merged back from gmcs; these changes already went into gmcs a
4548         couple of weeks ago.
4549
4550         * typemanager.cs
4551         (TypeManager.AddUserType): Removed the `ifaces' argument.
4552         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4553         `TypeExpr []'.
4554         (TypeManager.AddUserInterface): Removed.
4555         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4556         `TypeExpr []'.
4557         (TypeManager.GetInterfaces): Likewise.
4558         (TypeManager.GetExplicitInterfaces): Likewise.
4559
4560         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4561
4562         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4563         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4564
4565 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4566
4567         * statement.cs: Avoid adding bools to a hashtable.
4568
4569 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4570
4571         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4572         calling an unsafe method from a safe location.
4573
4574 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4575
4576         Fix #69167
4577         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4578
4579 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4580
4581         * namespace.cs (VerifyUsing): use GetPartialName instead of
4582         ToString. 
4583
4584 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4585
4586         * statement.cs (Return.Resolve): Fix regression in typo: if
4587         `in_exc', we have to request a NeedReturnLabel, this was a typo
4588         introduced in the anonymous method check-in.  Fixes #69131.
4589
4590         * Indexers were using the ShortName when defining themselves,
4591         causing a regression in the compiler bootstrap when applying the
4592         patch from 2004-11-02 (first part), now they use their full name
4593         and the bug is gone.
4594
4595 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4596
4597         * driver.cs: Strip the path from the names of embedded resources. Fixes
4598         #68519.
4599
4600 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4601
4602         Fix error message regression: cs0104-2.cs.
4603         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4604         (AliasEntry.Resolve): Update.
4605         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4606         'silent' flag.
4607         (RootContext.LookupType): Update.
4608
4609 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4610
4611         * cs-parser.jay: Add support for handling accessor modifiers
4612         * class: Add support port accessor modifiers and error checking,
4613         define PropertyMethod.Define as virtual (not abstract anymore)
4614         * ecore.cs: Add checking for proeprties access with access modifiers
4615         * iterators.cs: Modify Accessor constructor call based in the modified
4616         constructor
4617 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4618
4619         * expression.cs (StringConcat): Handle being called twice,
4620         as when we have a concat in a field init with more than two
4621         ctors in the class
4622
4623 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4624
4625         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4626         special case explicit implementations, we should always produce
4627         the .property or .event declaration.
4628         
4629         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4630         since it will not return correct data if people use this
4631         unresolved in the presence of using statements (see test-313).
4632
4633         * class.cs (MethodData.Define): If we are an explicit interface
4634         implementation, set the method name to the full name of the
4635         interface plus the name of the method.  
4636
4637         Notice that using the method.MethodName.GetFullName() does not
4638         work, as it will only contain the name as declared on the source
4639         file (it can be a shorthand in the presence of using statements)
4640         and not the fully qualifed type name, for example:
4641
4642         using System;
4643
4644         class D : ICloneable {
4645                 object ICloneable.Clone ()  {
4646                 }
4647         }
4648
4649         Would produce a method called `ICloneable.Clone' instead of
4650         `System.ICloneable.Clone'.
4651
4652         * namespace.cs (Alias.Resolve): Use GetPartialName.
4653         
4654 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4655
4656         * cs-parser.jay: Add error 1055 report.
4657
4658 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4659
4660         * assign.cs (Assign.DoResolve): Only do the transform of
4661         assignment into a New if the types are compatible, if not, fall
4662         through and let the implicit code deal with the errors and with
4663         the necessary conversions. 
4664
4665 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4666
4667         * cs-parser.jay: Add error 1031 report.
4668
4669         * cs-tokenizer.cs: Add location for error 1038.
4670
4671 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4672
4673         * cs-parser.jay: Add error 1016 report.
4674
4675 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4676
4677         * cs-parser.jay: Add errors 1575,1611 report.
4678
4679 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4680
4681         * cs-parser.jay: Add error 1001 report.
4682
4683 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4684
4685         Fix #68850
4686         * attribute.cs (GetMarshal): Add method argument for
4687         caller identification.
4688
4689         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4690         agument for GetMarshal and RuntimeMissingSupport.
4691
4692 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4693
4694         * attribute.cs (ExtractSecurityPermissionSet): Removed
4695         TypeManager.code_access_permission_type.
4696
4697         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4698
4699 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4700
4701         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4702         for obsolete use of a variable here.   Fixes regression on errors
4703         cs0619-25 and cs0619-26.
4704
4705 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4706
4707         Fix #62358, implemented security attribute encoding.
4708
4709         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4710         Tests permitted SecurityAction for assembly or other types.
4711         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4712         data from SecurityPermissionAttribute to PermisionSet class.
4713
4714         * class.cs (ApplyAttributeBuilder): Added special handling
4715         for System.Security.Permissions.SecurityAttribute based types.
4716
4717         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4718         special handling for System.Security.Permissions.SecurityAttribute
4719         based types.
4720
4721         * enum.cs (ApplyAttributeBuilder): Added special handling
4722         for System.Security.Permissions.SecurityAttribute based types.
4723
4724         * parameter.cs (ApplyAttributeBuilder): Added special handling
4725         for System.Security.Permissions.SecurityAttribute based types.
4726
4727         * rootcontext.cs: Next 2 core types.
4728
4729         * typemanager.cs (TypeManager.security_permission_attr_type):
4730         Built in type for the SecurityPermission Attribute.
4731         (code_access_permission_type): Build in type.
4732
4733 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4734
4735         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4736         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4737         all of this information into
4738         EmitContext.EmitCapturedVariableInstance.
4739         
4740         * codegen.cs (EmitCapturedVariableInstance): move here the
4741         funcionality of emitting an ldarg.0 in the presence of a
4742         remapping.   This centralizes the instance emit code.
4743
4744         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4745         then emit a load of this: it means that we have reached the
4746         topmost ScopeInfo: the one that contains the pointer to the
4747         instance of the class hosting the anonymous method.
4748
4749         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4750         captures to the topmost CaptureContext.
4751
4752 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4753
4754         * expression.cs (LocalVariableReference): Move the knowledge about
4755         the iterators into codegen's EmitCapturedVariableInstance.
4756
4757 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4758
4759         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4760         all code paths return a value from an anonymous method (it is the
4761         same as the 161 error, but for anonymous methods).
4762
4763 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4764
4765         The introduction of anonymous methods in the compiler changed
4766         various ways of doing things in the compiler.  The most
4767         significant one is the hard split between the resolution phase
4768         and the emission phases of the compiler.
4769
4770         For instance, routines that referenced local variables no
4771         longer can safely create temporary variables during the
4772         resolution phase: they must do so from the emission phase,
4773         since the variable might have been "captured", hence access to
4774         it can not be done with the local-variable operations from the runtime.
4775         
4776         * statement.cs 
4777
4778         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4779         is a toplevel block.
4780
4781         (ToplevelBlock): A new kind of Block, these are the blocks that
4782         are created by the parser for all toplevel method bodies.  These
4783         include methods, accessors and anonymous methods.
4784
4785         These contain some extra information not found in regular blocks:
4786         A pointer to an optional CaptureContext (for tracking captured
4787         local variables and parameters).  A pointer to the parent
4788         ToplevelBlock.
4789         
4790         (Return.Resolve): Catch missmatches when returning a value from an
4791         anonymous method (error 1662).
4792         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4793         phase.
4794
4795         (Break.Resolve): ditto.
4796
4797         (SwitchLabel): instead of defining the labels during the
4798         resolution phase, we now turned the public ILLabel and ILLabelCode
4799         labels into methods called GetILLabelCode() and GetILLabel() that
4800         only define the label during the Emit phase.
4801
4802         (GotoCase): Track the SwitchLabel instead of the computed label
4803         (its contained therein).  Emit the code by using
4804         SwitchLabel.GetILLabelCode ().
4805
4806         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4807         whether the Local has been captured or not.
4808
4809         (LocalInfo.IsCaptured): New property, used to tell whether the
4810         local has been captured.
4811         
4812         * anonymous.cs: Vastly updated to contain the anonymous method
4813         support.
4814
4815         The main classes here are: CaptureContext which tracks any
4816         captured information for a toplevel block and ScopeInfo used to
4817         track the activation frames for various local variables.   
4818
4819         Each toplevel block has an optional capture context associated
4820         with it.  When a method contains an anonymous method both the
4821         toplevel method and the anonymous method will create a capture
4822         context.   When variables or parameters are captured, they are
4823         recorded on the CaptureContext that owns them, for example:
4824
4825         void Demo () {
4826              int a;
4827              MyDelegate d = delegate {
4828                  a = 1;
4829              }
4830         }
4831
4832         Here `a' will be recorded as captured on the toplevel
4833         CapturedContext, the inner captured context will not have anything
4834         (it will only have data if local variables or parameters from it
4835         are captured in a nested anonymous method.
4836
4837         The ScopeInfo is used to track the activation frames for local
4838         variables, for example:
4839
4840         for (int i = 0; i < 10; i++)
4841                 for (int j = 0; j < 10; j++){
4842                    MyDelegate d = delegate {
4843                         call (i, j);
4844                    }
4845                 }
4846
4847         At runtime this captures a single captured variable `i', but it
4848         captures 10 different versions of the variable `j'.  The variable
4849         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4850         recorded on a child.  
4851
4852         The toplevel ScopeInfo will also track information like the `this'
4853         pointer if instance variables were referenced (this is necessary
4854         as the anonymous method lives inside a nested class in the host
4855         type of the method). 
4856
4857         (AnonymousMethod): Expanded to track the Toplevel, implement
4858         `AnonymousMethod.Compatible' to tell whether an anonymous method
4859         can be converted to a target delegate type. 
4860
4861         The routine now also produces the anonymous method content
4862
4863         (AnonymousDelegate): A helper class that derives from
4864         DelegateCreation, this is used to generate the code necessary to
4865         produce the delegate for the anonymous method that was created. 
4866
4867         * assign.cs: API adjustments for new changes in
4868         Convert.ImplicitStandardConversionExists.
4869
4870         * class.cs: Adjustments to cope with the fact that now toplevel
4871         blocks are of type `ToplevelBlock'. 
4872
4873         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4874         insteda of standard blocks.
4875
4876         Flag errors if params arguments are passed to anonymous methods.
4877
4878         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4879         `CurrentAnonymousMethod' which points to the current Anonymous
4880         Method.  The variable points to the AnonymousMethod class that
4881         holds the code being compiled.  It is set in the new EmitContext
4882         created for the anonymous method.
4883
4884         (EmitContext.Phase): Introduce a variable and an enumeration to
4885         assist in enforcing some rules about when and where we are allowed
4886         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4887         only one that enfonces this right now).
4888
4889         (EmitContext.HaveCaptureInfo): new helper method that returns
4890         whether we have a CapturedContext initialized.
4891
4892         (EmitContext.CaptureVariable): New method used to register that a
4893         LocalInfo must be flagged for capturing. 
4894
4895         (EmitContext.CapturedParameter): New method used to register that a
4896         parameters must be flagged for capturing. 
4897         
4898         (EmitContext.CapturedField): New method used to register that a
4899         field must be flagged for capturing. 
4900
4901         (EmitContext.HaveCapturedVariables,
4902         EmitContext.HaveCapturedFields): Return whether there are captured
4903         variables or fields. 
4904
4905         (EmitContext.EmitMethodHostInstance): This is used to emit the
4906         instance for the anonymous method.  The instance might be null
4907         (static methods), this (for anonymous methods that capture nothing
4908         and happen to live side-by-side with the current method body) or a
4909         more complicated expression if the method has a CaptureContext.
4910
4911         (EmitContext.EmitTopBlock): Routine that drives the emission of
4912         code: it will first resolve the top block, then emit any metadata
4913         and then emit the code.  The split is done so that we can extract
4914         any anonymous methods and flag any captured variables/parameters.
4915         
4916         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4917         during this phase, the ILGenerator should not be used as labels
4918         and local variables declared here might not be accessible to any
4919         code that is part of an anonymous method.  
4920
4921         Exceptions to this include the temporary variables that are
4922         created by some statements internally for holding temporary
4923         variables. 
4924         
4925         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4926         metadata for a cb
4927
4928         (EmitContext.TemporaryReturn): This method is typically called
4929         from the Emit phase, and its the only place where we allow the
4930         ReturnLabel to be defined other than the EmitMeta.  The reason is
4931         that otherwise we would have to duplicate a lot of logic in the
4932         Resolve phases of various methods that today is on the Emit
4933         phase. 
4934
4935         (EmitContext.NeedReturnLabel): This no longer creates the label,
4936         as the ILGenerator is not valid during the resolve phase.
4937
4938         (EmitContext.EmitThis): Extended the knowledge in this class to
4939         work in anonymous methods in addition to iterators. 
4940
4941         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4942         code is necessary on the stack to access the instance to a local
4943         variable (the variable will be accessed as a field).
4944
4945         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4946         EmitContext.EmitAddressOfParameter): Routines to support
4947         parameters (not completed at this point). 
4948         
4949         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4950         will also remove the parameters.
4951
4952         * convert.cs (Convert): Define a `ConstantEC' which points to a
4953         null.  This is just to prefity some code that uses
4954         ImplicitStandardConversion code and do not have an EmitContext
4955         handy.
4956
4957         The idea is to flag explicitly that at that point in time, it is
4958         known that the conversion will not trigger the delegate checking
4959         code in implicit conversions (which requires a valid
4960         EmitContext). 
4961
4962         Everywhere: pass new EmitContext parameter since
4963         ImplicitStandardConversionExists now requires it to check for
4964         anonymous method conversions. 
4965
4966         (Convert.ImplicitStandardConversionExists): If the type of an
4967         expression is the anonymous_method_type, and the type is a
4968         delegate, we invoke the AnonymousMethod.Compatible method to check
4969         whether an implicit conversion is possible. 
4970
4971         (Convert.ImplicitConversionStandard): Only do implicit method
4972         group conversions if the language level is not ISO_1.
4973
4974         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4975         MethodInfo for the Invoke method.  used by Delegate and
4976         AnonymousDelegate.
4977
4978         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4979         method conversions if the target type is a delegate.
4980
4981         Removed extra debugging nops.
4982
4983         (LocalVariableReference): Turn the `local_info' into a public
4984         field. 
4985
4986         Add `prepared' field, the same hack used for FieldExprs to cope
4987         with composed assignments, as Local variables do not necessarily
4988         operate purely on the stack as they used to: they can be captured
4989         fields. 
4990
4991         Add `temp' for a temporary result, like fields.
4992
4993         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4994
4995         It now copes with Local variables that are captured and emits the
4996         proper instance variable to load it from a field in the captured
4997         case. 
4998
4999         (ParameterReference.DoResolveBase): During the resolve phase,
5000         capture parameters if we are in an anonymous method.
5001
5002         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5003         anonymous method, use the EmitContext helper routines to emit the
5004         parameter reference.
5005
5006         * iterators.cs: Set RemapToProxy to true/false during the
5007         EmitDispose class.
5008
5009         * parameters.cs (GetParameterByName): New helper method. 
5010
5011         * typemanager.cs (anonymous_method_type) a new type that
5012         represents an anonyous method.  This is always an internal type,
5013         used as a fencepost to test against the anonymous-methodness of an
5014         expression. 
5015         
5016 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5017
5018         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5019         561 report.
5020         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5021
5022 2004-10-18  Martin Baulig  <martin@ximian.com>
5023
5024         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5025         `Type' directly, but call ResolveType() on it.
5026         (Catch.Resolve): Likewise.
5027         (Foreach.Resolve): Likewise.
5028
5029 2004-10-18  Martin Baulig  <martin@ximian.com>
5030
5031         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5032         `Type' directly, but call ResolveType() on it.
5033         (Probe.DoResolve): Likewise.
5034         (ArrayCreation.LookupType): Likewise.
5035         (TypeOf.DoResolve): Likewise.
5036         (SizeOf.DoResolve): Likewise.
5037
5038 2004-10-18  Martin Baulig  <martin@ximian.com>
5039
5040         * expression.cs (Invocation.BetterFunction): Put back
5041         TypeManager.TypeToCoreType().
5042
5043 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5044
5045         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5046         the ResolveType.
5047
5048 2004-10-18  Martin Baulig  <martin@ximian.com>
5049
5050         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5051         `Type' directly, but call ResolveType() on it.
5052
5053 2004-10-18  Martin Baulig  <martin@ximian.com>
5054
5055         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5056         `Type' directly, but call ResolveType() on it.
5057         (MemberBase.DoDefine): Likewise.
5058
5059         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5060         `Type' directly, but call ResolveType() on it.
5061         (ComposedCast.DoResolveAsTypeStep): Likewise.
5062
5063         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5064         `Type' directly, but call ResolveType() on it.
5065
5066 2004-10-17  John Luke  <john.luke@gmail.com>
5067
5068         * class.cs (Operator.GetSignatureForError): use CSharpName
5069
5070         * parameter.cs (Parameter.GetSignatureForError): Returns
5071         correct name even if was not defined.
5072
5073 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5074
5075         Fix #65816.
5076         * class.cs (TypeContainer.EmitContext): New property.
5077         (DefineNestedTypes): Create an emitcontext for each part.
5078         (MethodCore.DoDefineParameters): Use container's emitcontext.
5079         Pass type array to InternalParameters.
5080         (MemberBase.DoDefine): Use container's emitcontext.
5081         (FieldMember.Define): Likewise.
5082         (Event.Define): Likewise.
5083         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5084         Pass type array to InternalParameters.
5085         (SetIndexerMethod.GetParameterInfo): Likewise.
5086         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5087         * delegate.cs (Define): Pass emitcontext to
5088         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5089         array to InternalParameters.
5090         * expression.cs (ParameterReference.DoResolveBase): Pass
5091         emitcontext to GetParameterInfo.
5092         (ComposedCast.DoResolveAsTypeStep): Remove check on
5093         ec.ResolvingTypeTree.
5094         * parameter.cs (Parameter.Resolve): Change argument to
5095         EmitContext.  Use ResolveAsTypeTerminal.
5096         (Parameter.GetSignature): Change argument to EmitContext.
5097         (Parameters.ComputeSignature): Likewise.
5098         (Parameters.ComputeParameterTypes): Likewise.
5099         (Parameters.GetParameterInfo): Likewise.
5100         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5101         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5102         * support.cs (InternalParameters..ctor): Remove variant that takes
5103         a DeclSpace.
5104         * typemanager.cs (system_intptr_expr): New.
5105         (InitExpressionTypes): Initialize it.
5106
5107 2004-10-12  Chris Toshok  <toshok@ximian.com>
5108
5109         * cs-parser.jay: fix location for try_statement and catch_clause.
5110
5111 2004-10-11  Martin Baulig  <martin@ximian.com>
5112
5113         * report.cs: Don't make --fatal abort on warnings, we have
5114         -warnaserror for that.
5115
5116 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5117
5118         More DeclSpace.ResolveType avoidance.
5119         * decl.cs (MemberCore.InUnsafe): New property.
5120         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5121         with newly created EmitContext.
5122         (FieldMember.Define): Likewise.
5123         * delegate.cs (Delegate.Define): Likewise.
5124         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5125         only if normal name-lookup fails.
5126         (TypeExpr.DoResolve): Enable error-checking.
5127         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5128         (SizeOf.DoResolve): Likewise.
5129         (ComposedCast.DoResolveAsTypeStep): Likewise.
5130         (StackAlloc.DoResolve): Likewise.
5131         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5132         (Block.Unsafe): New property.
5133         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5134         (Unsafe): Set 'unsafe' flag of contained block.
5135         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5136         (Fixed.Resolve): Likewise.
5137         (Catch.Resolve): Likewise.
5138         (Using.ResolveLocalVariableDecls): Likewise.
5139         (Foreach.Resolve): Likewise.
5140
5141 2004-10-05  John Luke <john.luke@gmail.com>
5142
5143         * cs-parser.jay: add location to error CS0175
5144
5145 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5146
5147         * ecore.cs (Expression.Constantity): Add support for turning null
5148         into a constant.
5149
5150         * const.cs (Const.Define): Allow constants to be reference types
5151         as long as the value is Null.
5152
5153 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5154
5155         * namespace.cs (NamespaceEntry.Using): No matter which warning
5156         level is set, check if this namespace name has already been added.
5157
5158 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5159
5160         * expression.cs: reftype [!=]= null should always use br[true,false].
5161         # 67410
5162
5163 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5164
5165         Fix #67108
5166         * attribute.cs: Enum conversion moved to 
5167         GetAttributeArgumentExpression to be applied to the all
5168         expressions.
5169
5170 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5171
5172         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5173         * class.c (TypeContainer.DefineType): Flag error if
5174         base types aren't accessible due to access permissions.
5175         * decl.cs (DeclSpace.ResolveType): Move logic to
5176         Expression.ResolveAsTypeTerminal.
5177         (DeclSpace.ResolveTypeExpr): Thin layer over
5178         Expression.ResolveAsTypeTerminal.
5179         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5180         Refactor code into NestedAccess.  Use it.
5181         (DeclSpace.NestedAccess): New.
5182         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5183         argument to silence errors.  Check access permissions.
5184         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5185         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5186         (Cast.DoResolve): Likewise.
5187         (New.DoResolve): Likewise.
5188         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5189         (TypeOf.DoResolve): Likewise.
5190
5191         * expression.cs (Invocation.BetterConversion): Return the Type of
5192         the better conversion.  Implement section 14.4.2.3 more faithfully.
5193         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5194         section 14.4.2.2 explicit.
5195         (Invocation.OverloadResolve): Update.
5196         (Invocation): Remove is_base field.
5197         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5198         (Invocation.Emit): Likewise.
5199
5200 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5201
5202         * README: Update to changes.
5203
5204 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5205
5206         * cs-parser.jay: Reverted 642 warning fix.
5207
5208 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5209
5210         Fix bug #66615
5211         * decl.cs (FindMemberWithSameName): Indexer can have more than
5212         1 argument.
5213
5214 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5215
5216         * expression.cs (LocalVariableReference.DoResolveLValue):
5217         Do not report warning 219 for out values.
5218         (EmptyExpression.Null): New member to avoid extra allocations.
5219
5220 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5221
5222         * cs-parser.jay: Fix wrong warning 642 report.
5223
5224         * cs-tokenizer.cs (CheckNextToken): New helper;
5225         Inspect next character if is same as expected.
5226
5227 2004-09-23  Martin Baulig  <martin@ximian.com>
5228
5229         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5230         (Convert.ImplicitReferenceConversionExists): Likewise.
5231
5232 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5233
5234         * class.cs (Operator.Define): Add error 448 and 559 report.
5235
5236 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5237
5238         * class.cs (MemberBase.IsTypePermitted): New protected
5239         method for checking error CS0610.
5240
5241 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5242
5243         * class.cs (TypeContainer.HasExplicitLayout): New property
5244         Returns whether container has StructLayout attribute set Explicit.
5245         (FieldMember): New abstract class for consts and fields.
5246         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5247         (Field): Reuse FieldMember.
5248
5249         * const.cs (Const): Reuse FieldMember.
5250
5251         * rootcontext.cs: EmitConstants call moved to class.
5252
5253 2004-09-22  Martin Baulig  <martin@ximian.com>
5254
5255         Thanks to Peter Sestoft for this bug report.
5256
5257         * expression.cs (Conditional): If both the `trueExpr' and the
5258         `falseExpr' is a NullLiteral, return a NullLiteral.
5259
5260 2004-09-22  Martin Baulig  <martin@ximian.com>
5261
5262         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5263         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5264         for the "get_Current" call.
5265
5266 2004-09-22  Martin Baulig  <martin@ximian.com>
5267
5268         Marek and me just fixed one of our oldest bugs: #28562 :-)
5269
5270         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5271
5272         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5273         we're an EnumConstant, just return that.
5274         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5275         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5276         to get the value which'll actually be written into the attribute.
5277         However, we have to use GetValue() to access the attribute's value
5278         in the compiler.        
5279
5280 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5281
5282         * constant.cs (Constant.IsNegative): New abstract property
5283         IsNegative.
5284
5285         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5286         (StackAlloc.DoResolve): Reused IsNegative.
5287
5288 2004-09-21  Martin Baulig  <martin@ximian.com>
5289
5290         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5291         if we're used in an iterator, we may be called from different
5292         methods.
5293
5294         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5295         we actually have an exception block.
5296
5297 2004-09-20  John Luke <jluke@cfl.rr.com>
5298
5299         * class.cs, cs-parser.jay: Improve the error report for 1520:
5300         report the actual line where the error happens, not where the
5301         class was declared.
5302
5303         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5304         Pass location information that was available elsewhere.
5305
5306 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5307
5308         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5309         runtime to delay sign assemblies.
5310
5311 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5312
5313         * cs-parser.jay: Do not report the stack trace, this is barely
5314         used nowadays.
5315
5316 2004-08-22  John Luke  <john.luke@gmail.com>
5317  
5318         * driver.cs : check that a resource id is not already used
5319         before adding it, report CS1508 if it is, bug #63637
5320
5321 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5322
5323         * ecore.cs: Removed dead code.
5324
5325 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5326
5327         * class.cs: Do not report warning CS0067 on the interfaces.
5328
5329 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5330
5331         * cs-parser.jay: Add error 504 report.
5332
5333 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5334
5335         * rootcontext.cs: WarningLevel is 4 by default now.
5336
5337         * statement.cs (Fixed.Resolve): Do not null
5338         VariableInfo.
5339
5340 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5341
5342         Fixed bug #55780
5343         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5344         deep search when property is not virtual.
5345         (PropertyExpr.ResolveAccessors): Make one call for both
5346         accessors.
5347
5348 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5349
5350         Fixed bug #65766
5351         * statement.cs: Error 152 report constains also location.
5352
5353 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5354
5355         Fixed bug #65766
5356         * const.cs: Explicitly set constant as static.
5357
5358 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5359
5360         Fixed bug #64226
5361         * cs-parser.jay: Add error 1017 report.
5362
5363 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5364
5365         Fixed bug #59980, #64224
5366         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5367
5368         * typemanager.cs (IsSpecialMethod): Simplified
5369
5370 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5371
5372         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5373         condition with better params.
5374
5375 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5376
5377         Fixed bug #65238
5378         * attribute.cs (Resolve): Property has to have both
5379         accessors.
5380
5381 2004-09-14  Martin Baulig  <martin@ximian.com>
5382
5383         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5384
5385 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5386
5387         Fixed bug #61902
5388         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5389         called and is obsolete then this member suppress message
5390         when call is inside next [Obsolete] method or type.
5391
5392         * expression.cs: Use TestObsoleteMethodUsage member.
5393
5394 2004-09-14  Martin Baulig  <martin@ximian.com>
5395
5396         * cs-parser.jay: Sync a bit with the GMCS version.
5397
5398 2004-09-14  Martin Baulig  <martin@ximian.com>
5399
5400         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5401         (CSharpParser.yacc_verbose_flag): New public field.
5402
5403         * genericparser.cs: Removed.
5404
5405 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5406
5407         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5408
5409 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5410
5411         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5412
5413 2004-09-10  Martin Baulig  <martin@ximian.com>
5414
5415         Backported my MemberName changes from GMCS into MCS.
5416
5417         - we are now using a special `MemberName' class instead of using
5418         strings; in GMCS, the `MemberName' also contains the type
5419         arguments.
5420
5421         - changed the grammar rules a bit:
5422           * the old `member_name' is now a `namespace_or_type_name':
5423             The rule is that we use `namespace_or_type_name' everywhere
5424             where we expect either a "member name" (GetEnumerator) or a
5425             "member name" with an explicit interface name
5426             (IEnumerable.GetEnumerator).
5427             In GMCS, the explicit interface name may include type arguments
5428             (IEnumerable<T>.GetEnumerator).
5429           * we use `member_name' instead of just `IDENTIFIER' for
5430             "member names":
5431             The rule is that we use `member_name' wherever a member may
5432             have type parameters in GMCS.       
5433
5434         * decl.cs (MemberName): New public class.
5435         (MemberCore.MemberName): New public readonly field.
5436         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5437         (DeclSpace): Likewise.
5438
5439         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5440         * enum.cs (Enum.ctor): Likewise.
5441
5442         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5443         MemberName.     
5444         (AliasEntry.ctor): Take a MemberName, not an Expression.
5445         (AliasEntry.UsingAlias): Likewise.
5446
5447         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5448         (IMethodData.MemberName): Changed type from string to MemberName.
5449         (MemberBase.ExplicitInterfaceName): Likewise.
5450         (AbstractPropertyEventMethod.SetupName): Make this private.
5451         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5452         argument; compute the member name here.
5453         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5454         on the `member.MemberName' and the `prefix'.
5455
5456         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5457         not `type_name'.
5458         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5459         thus, we get a `MemberName' instead of a `string'.  These
5460         declarations may have type parameters in GMCS.
5461         (interface_method_declaration, delegate_declaration): Likewise.
5462         (class_declaration, interface_declaration): Likewise.
5463         (method_header): Use `namespace_or_type_name' instead of
5464         `member_name'.  We may be an explicit interface implementation.
5465         (property_declaration, event_declaration): Likewise.
5466         (member_name): This is now just an `IDENTIFIER', not a
5467         `namespace_or_type_name'.
5468         (type_name, interface_type): Removed.
5469         (namespace_or_type_name): Return a MemberName, not an Expression.
5470         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5471         call GetTypeExpression() on the MemberName to get an expression.
5472         (IndexerDeclaration.interface_type): Changed type from string to
5473         MemberName.
5474         (MakeName): Operate on MemberName's instead of string's.
5475
5476 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5477
5478         Fix bug #55770.
5479         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5480         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5481         lookup to avoid symbols introduced by 'using'.
5482         * rootcontext.cs (NamespaceLookup): Update.
5483
5484 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5485
5486         * class.cs (TypeContainer.DoDefineMembers): Do not call
5487         DefineDefaultConstructor for static classes.
5488
5489 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5490
5491         * attribute.cs (Attribute.Resolve): Add error 653 report.
5492
5493         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5494         report.
5495         (Method.ApplyAttributeBuilder): Add error 685 report.
5496         (Operator.Define): Add error 564 report.
5497
5498         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5499
5500         * expression.cs (Invocation.DoResolve): Add error
5501         245 and 250 report.
5502
5503         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5504         error 674 report.
5505
5506 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5507
5508         * class.cs (ConstructorInitializer.Resolve):
5509         Wrong error number (515->516).
5510
5511 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5512
5513         * class.cs (Indexer.Define): Add error 631 report.
5514
5515 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5516
5517         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5518
5519 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5520
5521         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5522
5523 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5524
5525         * cs-parser.jay: Added error CS0241 report.
5526
5527 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5528
5529         * cs-parser.jay (fixed_statement): Introduce a scope for the
5530         declaration in the 'fixed' statement.
5531
5532 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5533
5534         * cs-parser.jay: Added CS0230 error report.
5535
5536 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5537
5538         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5539
5540 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5541
5542         * expression.cs (Argument.Resolve): Added error CS0192 and
5543         CS0199 report.
5544
5545 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5546
5547         C# 2.0 #pragma warning feature
5548
5549         * cs-tokenizer.cs (PreProcessPragma): New method; 
5550         Handles #pragma directive.
5551
5552         * report.cs (WarningRegions): New class; Support
5553         class for #pragma warning directive. It tests whether
5554         warning is enabled for a given line.
5555
5556 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5557
5558         * const.cs: Add more descriptive error report, tahnks to
5559         Sebastien. 
5560
5561 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5562
5563         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5564
5565 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5566
5567         * expression.cs: Apply patch from Ben: Remove dead code from
5568         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5569         as that code just threw an exception anwyays.
5570
5571         * const.cs: Remove the call to the turnintoconstant, for details
5572         see bug: #63144
5573         
5574         * literal.cs: The type of the null-literal is the null type;  So
5575         we use a placeholder type (literal.cs:System.Null, defined here)
5576         for it.
5577
5578         * expression.cs (Conditional.DoResolve): Remove some old code that
5579         is no longer needed, conversions have been fixed.
5580
5581         (ArrayCreationExpression.DoResolve): Return false if we fail to
5582         resolve the inner expression.
5583
5584 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5585
5586         Fix test-290.cs.
5587         * cs-parser.jay (delegate_declaration): Record a delegate
5588         declaration as a type declaration.
5589         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5590
5591 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5592
5593         * parameter.cs: Do not crash if the type can not be resolved. 
5594
5595         * expression.cs: Report errors with unsafe pointers, fixes #64896
5596
5597 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5598
5599         * expression.cs: Pointer arith always needs to do a conv.i
5600         if the operand is a long. fix 65320
5601
5602 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5603
5604         Fixed cs0619-37.cs, cs0619-38.cs
5605
5606         * enum.cs (GetObsoleteAttribute): Removed.
5607
5608         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5609         on Enum member is double staged. The first is tested member
5610         and then enum.
5611
5612 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5613
5614         Fixed #56986, #63631, #65231
5615
5616         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5617         adds member to name container.
5618         (TypeContainer.AddToTypeContainer): New method, adds type to
5619         name container.
5620         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5621         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5622         AddOperator): Simplified by reusing AddToMemberContainer.
5623         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5624         instead of field.
5625         (Method.CheckForDuplications): Fixed implementation to test all
5626         possibilities.
5627         (MemberBase): Detection whether member is explicit interface
5628         implementation is now in constructor.
5629         (MemberBase.UpdateMemberName): Handles IndexerName.
5630         (Accessor): Changed to keep also location information.
5631         (AbstractPropertyEventMethod): Is derived from MemberCore.
5632         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5633         will be emited or not.
5634         (PropertyBase.AreAccessorsDuplicateImplementation):
5635         Tests whether accessors are not in collision with some method.
5636         (Operator): Is derived from MethodCore to simplify common
5637         operations.
5638
5639         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5640         must be performed.
5641         (DeclSpace.AddToContainer): Adds the member to defined_names
5642         table. It tests for duplications and enclosing name conflicts.
5643
5644         * enum.cs (EnumMember): Clean up to reuse the base structures
5645
5646 2004-09-03  Martin Baulig  <martin@ximian.com>
5647
5648         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5649         into TypeContainer, to make partial classes work again.
5650
5651 2004-09-03  Martin Baulig  <martin@ximian.com>
5652
5653         * rootcontext.cs (RootContext.V2): Removed.
5654
5655 2004-03-23  Martin Baulig  <martin@ximian.com>
5656
5657         * expression.cs (Invocation.OverloadResolve): Added `bool
5658         may_fail' argument and use it instead of the Location.IsNull() hack.
5659
5660 2004-09-03  Martin Baulig  <martin@ximian.com>
5661
5662         Merged latest changes into gmcs.  Please keep this comment in
5663         here, it makes it easier for me to see what changed in MCS since
5664         the last time I merged.
5665
5666 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5667
5668         Fix #61128.
5669         * expression.cs (BetterConversion): Don't allow either conversion 
5670         to be null.  Remove redundant implicit conversion test when 'q ==
5671         null' -- when this function is invoked, we already know that the
5672         implicit conversion exists.
5673         (BetterFunction): Assume that 'best' is non-null.  Remove
5674         redundant reimplementation of IsApplicable when 'best' is null.
5675         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5676         number of arguments.
5677         (IsAncestralType): Extract from OverloadResolve.
5678         (OverloadResolve): Make robust to the MethodGroupExpr being
5679         unsorted.  Implement all the logic of Section 14.5.5.1, and
5680         support overloading of methods from multiple applicable types.
5681         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5682
5683         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5684         (RealError, Warning): Append type of report to related symbol.
5685
5686 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5687
5688         * enum.cs: Fixed CLS-Compliance checks for enum members.
5689         Error tests cs3008-8.cs, cs3014-8.cs
5690
5691 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5692
5693         Fixed bug #62342, #63102
5694         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5695         like ImplementMethod.
5696
5697 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5698
5699         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5700         Fixed bug #65170.
5701
5702 2004-09-02  Martin Baulig  <martin@ximian.com>
5703
5704         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5705         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5706         on the MethodBase.
5707
5708 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5709
5710         C# 2.0 Static classes implemented
5711
5712         * class.cs (TypeContainer): instance_constructors,
5713         initialized_fields, initialized_static_fields,
5714         default_constructor, base_inteface_types are protected to be
5715         accessible from StaticClass.
5716         (TypeContainer.DefineDefaultConstructor): New virtual method
5717         for custom default constructor generating
5718         (StaticClass): New class to handle "Static classes" feature.
5719
5720         * cs-parser.jay: Handle static keyword on class like instance
5721         of StaticClass.
5722
5723         * driver.cs: Added "/langversion" command line switch with two
5724         options (iso-1, default).
5725
5726 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5727
5728         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5729
5730 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5731
5732         * delegate.cs: Style.
5733
5734 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5735
5736         * delegate.cs: Add seperate instance expr field for miguel.
5737
5738 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5739
5740         * PointerArithmetic (Resolve): make sure we are not doing
5741         pointer arith on void*. Also, make sure we are resolved
5742         by not setting eclass until resolve.
5743
5744         All callers: Make sure that PointerArithmetic gets resolved.
5745
5746 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5747
5748         * ArrayCreation (LookupType): If the type does not resolve 
5749         to an array, give an error.
5750
5751 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5752
5753         * statement.cs (Try.Resolve): Fixed bug #64222
5754
5755 2004-08-27  Martin Baulig  <martin@ximian.com>
5756
5757         * class.cs
5758         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5759         crash here.     
5760
5761 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5762
5763         * ecore.cs (Constantify): Get underlying type via
5764         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5765         Windows in special cases.
5766
5767 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5768
5769         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5770         for obtaining also private methods.
5771         (GetRemoveMethod): Used GetRemoveMethod (true)
5772         for obtaining also private methods.
5773
5774 2004-08-24  Martin Baulig  <martin@ximian.com>
5775
5776         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5777         MethodAttributes.HideBySig for operators.
5778
5779 2004-08-23  Martin Baulig  <martin@ximian.com>
5780
5781         Back to the old error reporting system :-)
5782
5783         * report.cs (Message): Removed.
5784         (Report.MessageData, ErrorData, WarningData): Removed.
5785         (Report.Error, Warning): Back to the old system.
5786
5787 2004-08-23  Martin Baulig  <martin@ximian.com>
5788
5789         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5790
5791         * class.cs (TypeContainer.ParentContainer): New public virtual
5792         method; replaces the explicit interface implementation.
5793         (ClassPart.ParentContainer): Override.
5794
5795 2004-08-23  Martin Baulig  <martin@ximian.com>
5796
5797         * statement.cs (Switch): Added support for constant switches; see
5798         #59428 or test-285.cs.
5799
5800 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5801
5802         Fixed bug #62740.
5803         * statement.cs (GetEnumeratorFilter): Removed useless
5804         logic because C# specs is strict. GetEnumerator must be
5805         public.
5806
5807 2004-08-22  Martin Baulig  <martin@ximian.com>
5808
5809         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5810         a switch and may break, reset the barrier.  Fixes #59867.
5811
5812 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5813
5814         CLS-Compliance speed up (~5% for corlib)
5815
5816         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5817         New method. Tests container for CLS-Compliant names
5818
5819         * class.cs (TypeContainer.VerifyClsName): New method.
5820         Checks whether container name is CLS Compliant.
5821         (Constructor): Implements IMethodData.
5822
5823         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5824         low-case table for CLS Compliance test.
5825         (MemberCache.VerifyClsParameterConflict): New method.
5826         Checks method parameters for CS3006 error.
5827
5828         * enum.cs (EnumMember): Is derived from MemberCore.
5829         (Enum.VerifyClsName): Optimized for better performance.
5830
5831 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5832
5833         * report.cs: Renamed Error_T to Error and changed all
5834         references.
5835
5836 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5837
5838         * class.cs (TypeContainer.IndexerArrayList): New inner class
5839         container for indexers.
5840         (TypeContainer.DefaultIndexerName): New constant for default
5841         indexer name. Replaced all "Item" with this constant.
5842         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5843
5844         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5845         DefaultMemberAttribute constructor.
5846
5847 2004-08-05  Martin Baulig  <martin@ximian.com>
5848
5849         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5850         Fix bug #59429.
5851
5852 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5853
5854         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5855         multi platforms problem.
5856
5857         * compiler.csproj: Included shared files.
5858
5859 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5860
5861         Fix bug 60333, 55971 in the more general way
5862         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5863         Added arg_type argument for constant conversion.
5864         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5865
5866 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5867
5868         Fix bug #59760
5869         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5870         OperatorArrayList, MethodCoreArrayList for typecontainer
5871         containers. Changed class member types to these new types.
5872         (MethodArrayList.DefineMembers): Added test for CS0659.
5873
5874 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5875
5876         * cfold.cs: Synchronize the folding with the code in expression.cs
5877         Binary.DoNumericPromotions for uint operands.
5878
5879         * attribute.cs: Revert patch from Raja, it introduced a regression
5880         while building Blam-1.2.1 (hard to isolate a test case).
5881
5882 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5883
5884         Fix for #55382
5885         * class.cs:
5886         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5887         name collision.
5888         (MethodCore.parent_method): New member. The method we're overriding
5889         if this is an override method.
5890         (MethodCore.CheckBase): Moved from Method class and made common.
5891         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5892         private.
5893         (MethodCore.CheckForDuplications): New abstract method. For custom
5894         member duplication search in a container
5895         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5896         method and its return type.
5897         (Event.conflict_symbol): New member. Symbol with same name in the
5898         parent class.
5899
5900         * decl.cs:
5901         (MemberCache.FindMemberWithSameName): New method. The method
5902         is looking for conflict with inherited symbols.
5903
5904 2004-08-04  Martin Baulig  <martin@ximian.com>
5905
5906         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5907
5908         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5909
5910 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5911
5912         * report.cs (Message): New enum for better error, warning reference in
5913         the code.
5914         (MessageData): New inner abstract class. It generally handles printing of
5915         error and warning messages.
5916         Removed unused Error, Warning, Message methods.
5917
5918 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5919
5920         Fix for cs0592-8.cs test
5921         * attribute.cs
5922         (Attributable.ValidAttributeTargets): Made public.
5923         (Attribute.ExplicitTarget): New member for explicit target value.
5924         (Attribute.CheckTargets): Now we translate explicit attribute
5925         target to Target here.
5926
5927 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5928
5929         * ecore.cs (MethodGroupExpr): new IsBase property.
5930
5931         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5932
5933         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5934         rather than an instance expr.
5935
5936         (DelegateCreation.Emit): Use the method group rather than
5937         the instance expression. Also, if you have base.Foo as the
5938         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5939
5940         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5941
5942         (NewDelegate.DoResolve): Only check for the existance of Invoke
5943         if the method is going to be needed. Use MethodGroupExpr.
5944
5945         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5946
5947         * expression.cs: For pointer arith., make sure to use
5948         the size of the type, not the size of the pointer to
5949         the type.
5950
5951 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5952
5953         Fix for #60722
5954         * class.cs (Class): Added error CS0502 test.
5955
5956 2004-08-03  John Luke  <jluke@cfl.rr.com>
5957             Raja R Harinath  <rharinath@novell.com>
5958
5959         Fix for #60997.
5960         * attribute.cs (Attribute.complained_before): New flag.
5961         (Attribute.ResolveType, Attribute.Resolve),
5962         (Attribute.DefinePInvokeMethod): Set it.
5963         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5964         
5965 2004-08-03  Martin Baulig  <martin@ximian.com>
5966
5967         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5968         use a user-defined operator; we still need to do numeric
5969         promotions in case one argument is a builtin type and the other
5970         one has an implicit conversion to that type.  Fixes #62322.
5971
5972 2004-08-02  Martin Baulig  <martin@ximian.com>
5973
5974         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5975         (LocalInfo.IsThis): New public property.
5976         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5977
5978 2004-08-01  Martin Baulig  <martin@ximian.com>
5979
5980         * class.cs (TypeContainer.GetClassBases): Don't set the default
5981         here since we may get called from GetPartialBases().
5982         (TypeContainer.DefineType): If GetClassBases() didn't return a
5983         parent, use the default one.
5984
5985 2004-07-30  Duncan Mak  <duncan@ximian.com>
5986
5987         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5988
5989 2004-07-30  Martin Baulig  <martin@ximian.com>
5990
5991         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5992
5993         * class.cs (SourceMethod): New public class, derive from the
5994         symbol writer's ISourceMethod.
5995         (Method): Use the new symbol writer API.
5996
5997         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5998         as argument and use the new symbol writer.
5999
6000         * location.cs
6001         (SourceFile): Implement the symbol writer's ISourceFile.
6002         (Location.SymbolDocument): Removed.
6003         (Location.SourceFile): New public property.
6004
6005         * symbolwriter.cs: Use the new symbol writer API.
6006
6007 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6008
6009         * Makefile (install-local): Remove.  Functionality moved to
6010         executable.make.
6011
6012 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6013
6014         * Makefile: Install mcs.exe.config file together with mcs.exe.
6015         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6016         correct runtime version.
6017         
6018 2004-07-25  Martin Baulig  <martin@ximian.com>
6019
6020         * class.cs
6021         (TypeContainer.RegisterOrder): Removed, this was unused.
6022         (TypeContainer, interface_order): Removed.
6023         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6024         TypeContainer as argument since we can also be called with a
6025         `PartialContainer' for a partial class/struct/interface.
6026         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6027         of checking whether we're an `Interface' - we could be a
6028         `PartialContainer'.
6029         (PartialContainer.Register): Override; call
6030         AddClass()/AddStruct()/AddInterface() on our parent.
6031
6032         * cs-parser.jay (interface_member_declaration): Add things to the
6033         `current_container', not the `current_class'.
6034
6035         * rootcontext.cs (RegisterOrder): The overloaded version which
6036         takes an `Interface' was unused, removed.
6037
6038         * typemanager.cs (TypeManager.LookupInterface): Return a
6039         `TypeContainer', not an `Interface'.
6040         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6041         contain a `PartialContainer' for an interface, so check it's
6042         `Kind' to figure out what it is.
6043
6044 2004-07-25  Martin Baulig  <martin@ximian.com>
6045
6046         * class.cs (Class.DefaultTypeAttributes): New public constant.
6047         (Struct.DefaultTypeAttributes): Likewise.
6048         (Interface.DefaultTypeAttributes): Likewise.
6049         (PartialContainer.TypeAttr): Override this and add the
6050         DefaultTypeAttributes.
6051
6052 2004-07-25  Martin Baulig  <martin@ximian.com>
6053
6054         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6055         we can just use the `Parent' field instead.
6056
6057 2004-07-25  Martin Baulig  <martin@ximian.com>
6058
6059         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6060
6061 2004-07-25  Martin Baulig  <martin@ximian.com>
6062
6063         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6064         our parts before defining any methods.
6065         (TypeContainer.VerifyImplements): Make this virtual.
6066         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6067         on our PartialContainer.
6068
6069 2004-07-25  Martin Baulig  <martin@ximian.com>
6070
6071         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6072
6073         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6074         argument, we can just use the `Parent' field instead.
6075
6076         * class.cs
6077         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6078         (MemberBase.DoDefine): Likewise.
6079
6080 2004-07-24  Martin Baulig  <martin@ximian.com>
6081
6082         * decl.cs (MemberCore.Parent): New public field.
6083         (DeclSpace.Parent): Moved to MemberCore.
6084
6085         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6086         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6087         parent's .ctor.
6088         (FieldBase, Field, Operator): Likewise.
6089         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6090         (EventField, Event): Likewise.
6091
6092 2004-07-23  Martin Baulig  <martin@ximian.com>
6093
6094         * class.cs (PartialContainer): New public class.
6095         (ClassPart): New public class.
6096         (TypeContainer): Added support for partial classes.
6097         (TypeContainer.GetClassBases): Splitted some of the functionality
6098         out into GetNormalBases() and GetPartialBases().
6099
6100         * cs-tokenizer.cs (Token.PARTIAL): New token.
6101         (Tokenizer.consume_identifier): Added some hacks to recognize
6102         `partial', but only if it's immediately followed by `class',
6103         `struct' or `interface'.
6104
6105         * cs-parser.jay: Added support for partial clases.
6106
6107 2004-07-23  Martin Baulig  <martin@ximian.com>
6108
6109         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6110         a `DeclSpace' and also made it readonly.
6111         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6112         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6113         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6114
6115         * cs-parser.jay: Pass the `current_class', not the
6116         `current_container' (at the moment, this is still the same thing)
6117         to a new Method, Property, Event, Indexer or Constructor.
6118
6119 2004-07-23  Martin Baulig  <martin@ximian.com>
6120
6121         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6122         and removed the `current_interface' one.
6123         (struct_declaration, class_declaration, interface_declaration):
6124         Set `current_class' to the newly created class/struct/interface;
6125         set their `Bases' and call Register() before parsing their body.
6126
6127 2004-07-23  Martin Baulig  <martin@ximian.com>
6128
6129         * class.cs (Kind): New public enum.
6130         (TypeContainer): Made this class abstract.
6131         (TypeContainer.Kind): New public readonly field.
6132         (TypeContainer.CheckDef): New public method; moved here from
6133         cs-parser.jay.
6134         (TypeContainer.Register): New public abstract method.
6135         (TypeContainer.GetPendingImplementations): New public abstract
6136         method.
6137         (TypeContainer.GetClassBases): Removed the `is_class' and
6138         `is_iface' parameters.
6139         (TypeContainer.DefineNestedTypes): Formerly known as
6140         DoDefineType().
6141         (ClassOrStruct): Made this class abstract.
6142
6143         * tree.cs (RootTypes): New public type. 
6144
6145 2004-07-20  Martin Baulig  <martin@ximian.com>
6146
6147         * tree.cs (Tree.RecordNamespace): Removed.
6148         (Tree.Namespaces): Removed.
6149
6150         * rootcontext.cs (RootContext.IsNamespace): Removed.
6151
6152         * cs-parser.jay (namespace_declaration): Just create a new
6153         NamespaceEntry here.
6154
6155 2004-07-20  Martin Baulig  <martin@ximian.com>
6156
6157         * statement.cs (ExceptionStatement): New abstract class.  This is
6158         now used as a base class for everyone who's using `finally'.
6159         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6160         our local variables before using them.
6161
6162         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6163         virtual method.  This is used by Yield.Resolve() to "steal" an
6164         outer block's `finally' clauses.
6165         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6166         argument.
6167
6168         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6169         version which takes an ExceptionStatement.  This version must be
6170         used to create exception branchings.
6171
6172         * iterator.cs
6173         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6174         (Iterator.EmitMoveNext): Added exception support; protect the
6175         block with a `fault' clause, properly handle 'finally' clauses.
6176         (Iterator.EmitDispose): Run all the `finally' clauses here.
6177
6178 2004-07-20  Martin Baulig  <martin@ximian.com>
6179
6180         * iterator.cs: This is the first of a set of changes in the
6181         iterator code.  Match the spec more closely: if we're an
6182         IEnumerable, then GetEnumerator() must be called.  The first time
6183         GetEnumerator() is called, it returns the current instance; all
6184         subsequent invocations (if any) must create a copy.
6185
6186 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6187
6188         * expression.cs: Resolve the constant expression before returning
6189         it. 
6190
6191 2004-07-19  Martin Baulig  <martin@ximian.com>
6192
6193         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6194         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6195         the return type of the new EmitContext.
6196
6197 2004-07-18  Martin Baulig  <martin@ximian.com>
6198
6199         * class.cs (Property.Define): Fix iterators.
6200
6201         * iterators.cs (Iterator.Define): Moved the
6202         `container.AddInterator (this)' call here from the .ctor; only do
6203         it if we resolved successfully.
6204
6205 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6206
6207         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6208         `true' for preprocessing directives that we parse.  The return
6209         value indicates whether we should return to regular tokenizing or
6210         not, not whether it was parsed successfully.
6211
6212         In the past if we were in: #if false ... #line #endif, we would
6213         resume parsing after `#line'.  See bug 61604.
6214
6215         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6216         building: IsEnumType should return true only for enums, not for
6217         enums or System.Enum itself.  This fixes #61593.
6218
6219         Likely what happened is that corlib was wrong: mcs depended on
6220         this bug in some places.  The bug got fixed, we had to add the
6221         hack, which caused bug 61593.
6222
6223         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6224         that was a workaround for the older conditions.
6225
6226 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6227
6228         * assign.cs: IAssignMethod has a new interface, as documented
6229         inline. All assignment code now uses this new api.
6230
6231         * ecore.cs, expression.cs: All classes which implement
6232         IAssignMethod now use the new interface.
6233
6234         * expression.cs (Invocation): add a hack to EmitCall so that
6235         IndexerAccess can be the target of a compound assignment without
6236         evaluating its arguments twice.
6237
6238         * statement.cs: Handle changes in Invocation api.
6239
6240 2004-07-16  Martin Baulig  <martin@ximian.com>
6241
6242         * iterators.cs: Rewrote this.  We're now using one single Proxy
6243         class for both the IEnumerable and the IEnumerator interface and
6244         `Iterator' derives from Class so we can use the high-level API.
6245
6246         * class.cs (TypeContainer.AddIterator): New method.
6247         (TypeContainer.DoDefineType): New protected virtual method, which
6248         is called from DefineType().
6249         (TypeContainer.DoDefineMembers): Call DefineType() and
6250         DefineMembers() on all our iterators.
6251         (TypeContainer.Emit): Call Emit() on all our iterators.
6252         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6253
6254         * codegen.cs (EmitContext.CurrentIterator): New public field.
6255
6256 2004-07-15  Martin Baulig  <martin@ximian.com>
6257
6258         * typemanager.cs
6259         (TypeManager.not_supported_exception_type): New type.   
6260
6261 2004-07-14  Martin Baulig  <martin@ximian.com>
6262
6263         * iterators.cs: Use real error numbers.
6264
6265 2004-07-14  Martin Baulig  <martin@ximian.com>
6266
6267         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6268         requires this to be a System.Collection.IEnumerable and not a
6269         class implementing that interface.
6270         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6271
6272 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6273
6274         * class.cs: Fixed previous fix, it broke some error tests.
6275
6276 2004-07-12  Martin Baulig  <martin@ximian.com>
6277
6278         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6279         Fixes #61293.
6280
6281 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6282
6283         * assign.cs (LocalTemporary): Add new argument: is_address,If
6284         `is_address' is true, then the value that we store is the address
6285         to the real value, and not the value itself.
6286         
6287         * ecore.cs (PropertyExpr): use the new local temporary
6288         stuff to allow us to handle X.Y += z (where X is a struct)
6289
6290 2004-07-08  Martin Baulig  <martin@ximian.com>
6291
6292         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6293         not always return, just like we're doing in Using.Resolve().
6294
6295 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6296
6297         * cs-parser.jay (fixed_statement): flag this as Pinned.
6298
6299 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6300
6301         * typemanager.cs (TypeManager): Removed MakePinned method, this
6302         mechanism is replaced with the .NET 2.x compatible mechanism of
6303         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6304
6305         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6306         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6307         `IsFixed' property which has a different meaning.
6308
6309 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6310
6311         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6312         visible from inside a nested class, not just the names of the
6313         immediately enclosing class.
6314         Fix for bug #60730.
6315
6316 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6317
6318         * expression.cs (BetterConversion): Remove buggy special-case
6319         handling of "implicit constant expression conversions".  At this
6320         point, we already know that the conversion is possible -- we're
6321         only checking to see which is better.
6322
6323 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6324
6325         * cs-parser.jay: Added error CS0210 test.
6326
6327 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6328
6329         * cs-parser.jay: Added error CS0134 test.
6330
6331 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6332
6333         Fix bug #52507
6334         * cs-parser.jay: Added error CS0145 test.
6335
6336 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6337
6338         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6339
6340 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6341         
6342         * expression.cs (StackAlloc.Resolve): The argument may not
6343         be a constant; deal with this case.
6344         
6345 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6346
6347         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6348         GetIndexerAttributeValue.
6349         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6350
6351         * class.cs (Indexer.Define): Added error tests for CS0415,
6352         CS0609.
6353
6354 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6355
6356         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6357         property code.
6358
6359 2004-06-23  Martin Baulig  <martin@ximian.com>
6360
6361         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6362         neither return nor throw, reset the barrier as well.  Fixes #60457.
6363
6364 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6365
6366         * class.cs : EventAttributes is now set to None by default.
6367           This fixes bug #60459.
6368
6369 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6370
6371         Fix bug #60219
6372         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6373         Don't throw exception but return null (it's sufficient now).
6374
6375 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6376
6377         * typemanager.cs (GetArgumentTypes): Faster implementation.
6378
6379 2004-06-18  Martin Baulig  <martin@ximian.com>
6380
6381         * attribute.cs (Attribute.Resolve): Check whether we're an
6382         EmptyCast which a Constant child.  Fixes #60333.
6383
6384 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6385
6386         * statement.cs (EmitCollectionForeach): Account for the fact that
6387         not all valuetypes are in areas which we can take the address of.
6388         For these variables, we store to a temporary variable. Also, make
6389         sure that we dont emit a `callvirt' on a valuetype method.
6390
6391 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6392
6393         * expression.cs (StackAlloc.DoReSolve): Added test for
6394         negative parameter (CS0247).
6395
6396 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6397
6398         Fix bug #59792
6399         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6400
6401 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6402
6403         Fix bug #59781
6404         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6405         ulong.
6406
6407 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6408
6409         Fix bug #58254 & cs1555.cs, cs1556.cs
6410         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6411
6412 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6413
6414         * cs-parser.jay: Added error CS1669 test for indexers.
6415
6416 2004-06-11  Martin Baulig  <martin@ximian.com>
6417
6418         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6419         call this twice: for params and varargs methods.
6420
6421 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * class.cs:
6424         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6425
6426 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6427
6428         * attribute.cs (Attribute.GetValidTargets): Made public.
6429
6430         * class.cs: 
6431         (AbstractPropertyEventMethod): New class for better code sharing.
6432         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6433         CS1667 report.
6434         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6435
6436 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6437
6438         Fix bug #59477.
6439         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6440         that the call to Resolve is part of a MemberAccess.
6441         (Expression.Resolve): Use it for SimpleName resolution.
6442         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6443         Add 'intermediate' boolean argument.
6444         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6445         error message when the SimpleName can be resolved ambiguously
6446         between an expression and a type.
6447         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6448         public.
6449         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6450         call on the left-side.
6451
6452 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6453
6454         * class.cs:
6455         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6456
6457 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6458
6459         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6460
6461 2004-06-11  Martin Baulig  <martin@ximian.com>
6462
6463         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6464         varargs methods if applicable.
6465
6466 2004-06-11  Martin Baulig  <martin@ximian.com>
6467
6468         * expression.cs (Invocation.EmitCall): Don't use
6469         `method.CallingConvention == CallingConventions.VarArgs' since the
6470         method could also have `CallingConventions.HasThis'.
6471
6472 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6473
6474         * class.cs (Event.GetSignatureForError): Implemented.
6475         Fixed crash in error test cs3010.cs
6476
6477 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6478
6479         * cs-tokenizer.cs: Change the way we track __arglist to be
6480         consistent with the other keywords.
6481
6482 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6483
6484         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6485         tomorrow.
6486
6487 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6488
6489         * codegen.cs: Check that all referenced assemblies have a strongname
6490         before strongnaming the compiled assembly. If not report error CS1577.
6491         Fix bug #56563. Patch by Jackson Harper.
6492         * typemanager.cs: Added a method to return all referenced assemblies.
6493         Fix bug #56563. Patch by Jackson Harper.
6494
6495 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6496
6497         * class.cs:
6498         (Method.ApplyAttributeBuilder): Moved and added conditional
6499         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6500
6501         * delegate.cs:
6502         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6503
6504 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6505
6506         Fixed #59640
6507         * class.cs: (EventField.attribute_targets): Changed default target.
6508
6509 2004-06-08  Martin Baulig  <martin@ximian.com>
6510
6511         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6512
6513 2004-06-08  Martin Baulig  <martin@ximian.com>
6514
6515         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6516
6517 2004-06-07  Martin Baulig  <martin@ximian.com>
6518
6519         Added support for varargs methods.
6520
6521         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6522         keyword.
6523
6524         * cs-parser.jay: Added support for `__arglist'.
6525
6526         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6527
6528         * expression.cs (Argument.AType): Added `ArgList'.
6529         (Invocation): Added support for varargs methods.
6530         (ArglistAccess): New public class.
6531         (Arglist): New public class.
6532
6533         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6534
6535         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6536         a method's top-level block if the method has varargs.
6537
6538         * support.cs (ReflectionParameters, InternalParameters): Added
6539         support for varargs methods.    
6540
6541 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6542
6543         * class.cs: Provide location in indexer error report.
6544
6545         * driver.cs: Use standard names.
6546
6547         * namespace.cs: Catch the use of using after a namespace has been
6548         declared also on using aliases.
6549
6550 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6551
6552         Bug #50820.
6553         * typemanager.cs (closure_private_ok, closure_invocation_type)
6554         (closure_qualifier_type, closure_invocation_assembly)
6555         (FilterWithClosure): Move to ...
6556         (Closure): New internal nested class.
6557         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6558         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6559         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6560         (MemberLookup, MemberLookupFailed): Use it.
6561         * expression.cs (New.DoResolve): Treat the lookup for the
6562         constructor as being qualified by the 'new'ed type.
6563         (Indexers.GetIndexersForTypeOrInterface): Update.
6564
6565 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * attribute.cs
6568         (GetConditionalAttributeValue): New method. Returns
6569         condition of ConditionalAttribute.
6570         (SearchMulti): New method.  Returns all attributes of type 't'.
6571         Use it when attribute is AllowMultiple = true.
6572         (IsConditionalMethodExcluded): New method.
6573
6574         * class.cs
6575         (Method.IsExcluded): Implemented. Returns true if method has conditional
6576         attribute and the conditions is not defined (method is excluded).
6577         (IMethodData): Extended interface for ConditionalAttribute support.
6578         (PropertyMethod.IsExcluded): Implemented.
6579
6580         * decl.cs
6581         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6582
6583         * expression.cs
6584         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6585         on the method.
6586
6587 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6588
6589         * expression.cs (ArrayCreationExpression): Make this just an
6590         `expression'. It can't be a statement, so the code here was
6591         dead.
6592
6593 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6594
6595         Fixed #59072
6596         * typemanager.cs (GetFullNameSignature): New method for
6597         MethodBase types.
6598
6599 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6600
6601         Fixed #56452
6602         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6603         Use this method when MethodBuilder is null.
6604         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6605         Added test for error CS0626 (MONO reports error for this situation).
6606         (IMethodData.GetSignatureForError): Extended interface.
6607
6608 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6609
6610         * attribute.cs
6611         (AttributeTester.GetObsoleteAttribute): Returns instance of
6612         ObsoleteAttribute when type is obsolete.
6613
6614         * class.cs
6615         (TypeContainer.VerifyObsoleteAttribute): Override.
6616         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6617         (MethodCode.VerifyObsoleteAttribute): Override.
6618         (MemberBase.VerifyObsoleteAttribute): Override.
6619
6620         * decl.cs
6621         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6622         and report proper error.
6623
6624         *delegate.cs
6625         Delegate.VerifyObsoleteAttribute): Override.
6626
6627         * ecore.cs
6628         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6629         and report proper error.
6630         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6631
6632         * enum.cs
6633         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6634         and enum member.
6635
6636         * expression.cs
6637         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6638         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6639         Added test for ObsoleteAttribute.
6640
6641         * statement.cs
6642         (Catch): Derived from Statement.
6643
6644 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6645  
6646         Fixed bug #59071 & cs0160.cs
6647  
6648         * statement.cs (Try.Resolve): Check here whether order of catch
6649         clauses matches their dependencies.
6650
6651 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6652
6653         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6654         caused a regression: #59343.  Referencing nested classes from an
6655         assembly stopped working.
6656
6657 2004-05-31  Martin Baulig  <martin@ximian.com>
6658
6659         MCS is now frozen for beta 2.
6660
6661 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6662
6663         * convert.cs: add a trivial cache for overload operator resolution.
6664
6665 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6666
6667         * decl.cs: If possible, use lookuptypedirect here. We can only do
6668         this if there is no `.' after the namespace. Avoids using
6669         LookupType, which does lots of slow processing.
6670         (FindNestedType) New method, does what it says :-).
6671         * namespace.cs: use LookupTypeDirect.
6672         * rootcontext.cs: use membercache, if possible.
6673         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6674
6675 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6676
6677         * expression.cs:
6678         According to the spec, 
6679
6680         In a member access of the form E.I, if E is a single identifier,
6681         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6682         field, property, localvariable, or parameter with the same type as
6683         the meaning of E as a type-name (§3.8), then both possible
6684         meanings of E are permitted.
6685
6686         We did not check that E as a simple-name had the same type as E as
6687         a type name.
6688
6689         This trivial check gives us 5-7% on bootstrap time.
6690
6691 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6692
6693         * expression.cs (Invocation.OverloadResolve): Avoid the
6694         use of hashtables and boxing here by allocating on demand.
6695
6696 2004-05-30  Martin Baulig  <martin@ximian.com>
6697
6698         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6699         we're doing a silent lookup.  Don't try to lookup nested types in
6700         TypeManager.object_type (thanks to Ben Maurer).
6701
6702 2004-05-30  Martin Baulig  <martin@ximian.com>
6703
6704         Committing a patch from Ben Maurer.
6705
6706         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6707
6708 2004-05-29  Martin Baulig  <martin@ximian.com>
6709
6710         * class.cs (IMethodData.ShouldIgnore): New method.
6711
6712         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6713         `Location' argument, we don't need it anywhere.  Use
6714         `IMethodData.ShouldIgnore ()' instead of
6715         `MethodData.GetMethodFlags ()'.
6716         (TypeManager.AddMethod): Removed.
6717         (TypeManager.AddMethod2): Renamed to AddMethod.
6718
6719 2004-05-29  Martin Baulig  <martin@ximian.com>
6720
6721         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6722
6723         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6724         converting from a class type S to an interface type and we already
6725         have an object on the stack, don't box it again.  Fixes #52578.
6726
6727 2004-05-29  Martin Baulig  <martin@ximian.com>
6728
6729         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6730         Added support for `params' parameters.  Fixes #59267.
6731
6732 2004-05-29  Martin Baulig  <martin@ximian.com>
6733
6734         * literal.cs (NullPointer): Provide a private .ctor which sets
6735         `type' to TypeManager.object_type.  Fixes #59048.
6736
6737 2004-05-29  Martin Baulig  <martin@ximian.com>
6738
6739         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6740         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6741
6742         * ecore.cs (EventExpr.instance_expr): Make the field private.
6743
6744 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6745
6746         Fixed bug #50080 & cs0214-2.cs
6747         * expression.cs (Cast.DoResolve): Check unsafe context here.
6748         
6749         * statement.cs (Resolve.DoResolve): Likewise.
6750
6751 2004-05-26  Martin Baulig  <martin@ximian.com>
6752
6753         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6754
6755         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6756         (RootContext.LookupType): Pass down the `silent' flag.
6757
6758 2004-05-25  Martin Baulig  <martin@ximian.com>
6759
6760         * expression.cs
6761         (MethodGroupExpr.IdenticalTypeName): New public property.
6762         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6763         expression actually refers to a type.
6764
6765 2004-05-25  Martin Baulig  <martin@ximian.com>
6766
6767         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6768         for #56176 and made it actually work.
6769
6770 2004-05-25  Martin Baulig  <martin@ximian.com>
6771
6772         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6773         (FieldExpr, PropertyExpr): Override and implement
6774         CacheTemporaries.  Fixes #52279.
6775
6776 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6777
6778         * location.cs: In the new compiler listing a file twice is a
6779         warning, not an error.
6780
6781 2004-05-24  Martin Baulig  <martin@ximian.com>
6782
6783         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6784         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6785
6786 2004-05-24  Martin Baulig  <martin@ximian.com>
6787
6788         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6789         walking the `using' list.  Fixes #53921.
6790
6791 2004-05-24  Martin Baulig  <martin@ximian.com>
6792
6793         * const.cs (Const.LookupConstantValue): Added support for
6794         EmptyCast's; fixes #55251.
6795
6796 2004-05-24  Martin Baulig  <martin@ximian.com>
6797
6798         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6799         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6800         which does the CS0135 check.  The reason is that we first need to
6801         check whether the variable actually exists.
6802
6803 2004-05-24  Martin Baulig  <martin@ximian.com>
6804
6805         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6806         than RootContext.LookupType() to find the explicit interface
6807         type.  Fixes #58584.
6808
6809 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6810
6811         * Makefile: Simplify.  Use executable.make.
6812         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6813
6814 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6815
6816         * decl.cs:
6817         * enum.cs:
6818         Use the invariant culture when doing String.Compare for CLS case
6819         sensitivity.
6820         
6821 2004-05-23  Martin Baulig  <martin@ximian.com>
6822
6823         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6824         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6825
6826         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6827         
6828 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6829
6830         * class.cs (MemberBase.Define): Reuse MemberType member for 
6831         resolved type. Other methods can use it too.
6832
6833 2004-05-23  Martin Baulig  <martin@ximian.com>
6834
6835         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6836         the variable also exists in the current block (otherwise, we need
6837         to report a CS0103).  Fixes #58670.
6838
6839 2004-05-23  Martin Baulig  <martin@ximian.com>
6840
6841         * flowanalysis.cs (Reachability.Reachable): Compute this
6842         on-the-fly rather than storing it as a field.
6843
6844 2004-05-23  Martin Baulig  <martin@ximian.com>
6845
6846         * flowanalysis.cs (Reachability.And): Manually compute the
6847         resulting `barrier' from the reachability.      
6848        
6849 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6850
6851         Fix bug #57835
6852         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6853         instance of ObsoleteAttribute when symbol is obsolete.
6854
6855         * class.cs
6856         (IMethodData): Extended interface for ObsoleteAttribute support.
6857
6858 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6859
6860         * attribute.cs: Fix bug #55970
6861
6862 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6863
6864         Fix bug #52705
6865         * attribute.cs
6866         (GetObsoleteAttribute): New method. Creates the instance of
6867         ObsoleteAttribute.
6868         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6869         ObsoleteAttribute when member is obsolete.
6870         (AttributeTester.Report_ObsoleteMessage): Common method for
6871         Obsolete error/warning reporting.
6872
6873         * class.cs
6874         (TypeContainer.base_classs_type): New member for storing parent type.
6875
6876         * decl.cs
6877         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6878         for this MemberCore.
6879
6880 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6881
6882         * attribute.cs, const.cs: Fix bug #58590
6883
6884 2004-05-21  Martin Baulig  <martin@ximian.com>
6885
6886         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6887         out parameters if the end of the method is unreachable.  Fixes
6888         #58098. 
6889
6890 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6891
6892         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6893         Hari was right, why extra method.
6894
6895 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6896
6897         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6898
6899 2004-05-20  Martin Baulig  <martin@ximian.com>
6900
6901         Merged this back from gmcs to keep the differences to a minumum.
6902
6903         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6904         instead of a Declspace.
6905         (Attribute.ResolveType): Likewise.
6906         (Attributes.Search): Likewise.
6907         (Attributes.Contains): Likewise.
6908         (Attributes.GetClsCompliantAttribute): Likewise.
6909
6910         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6911         argument.
6912         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6913         DeclSpace.
6914
6915 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6916
6917         Fix bug #58688 (MCS does not report error when the same attribute
6918         is assigned twice)
6919
6920         * attribute.cs (Attribute.Emit): Distinction between null and default.
6921
6922 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6923
6924         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6925         of a top-level attribute without an attribute target.
6926         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6927         Make non-static.
6928         (Attribute.Conditional_GetConditionName), 
6929         (Attribute.Obsolete_GetObsoleteMessage): Update.
6930         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6931         part of ScanForIndexerName.
6932         (Attribute.CanIgnoreInvalidAttribute): New function.
6933         (Attribute.ScanForIndexerName): Move to ...
6934         (Attributes.ScanForIndexerName): ... here.
6935         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6936         (Attributes.Search): New internal variant that can choose not to
6937         complain if types aren't resolved.  The original signature now
6938         complains.
6939         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6940         complaints suppressed.
6941         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6942         only if it not useful.
6943         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6944         top-level for attributes that are shared between the assembly
6945         and a top-level class.
6946         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6947         * class.cs: Update to reflect changes.
6948         (DefineIndexers): Fuse loops.
6949         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6950         a couple more variants of attribute names.
6951
6952 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6953
6954         Fix bug #52585 (Implemented explicit attribute declaration)
6955
6956         * attribute.cs:
6957         (Attributable.ValidAttributeTargets): New abstract method. It gets
6958         list of valid attribute targets for explicit target declaration.
6959         (Attribute.Target): It holds target itself.
6960         (AttributeSection): Removed.
6961         (Attribute.CheckTargets): New method. It checks whether attribute
6962         target is valid for the current element.
6963
6964         * class.cs:
6965         (EventProperty): New class. For events that are declared like
6966         property (with add and remove accessors).
6967         (EventField): New class. For events that are declared like field.
6968         class.cs
6969
6970         * cs-parser.jay: Implemented explicit attribute target declaration.
6971
6972         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6973         Override ValidAttributeTargets.
6974
6975         * parameter.cs:
6976         (ReturnParameter): Class for applying custom attributes on 
6977         the return type.
6978         (ParameterAtribute): New class. Class for applying custom
6979         attributes on the parameter type.
6980
6981 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6982
6983         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6984         definitions. 
6985
6986         (Method): Allow UNSAFE here.
6987
6988         * modifiers.cs: Support unsafe reporting.
6989
6990 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6991
6992         * decl.cs: Fix bug #58478.
6993
6994 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6995
6996         * statement.cs: When checking for unreachable code on an EmptyStatement,
6997         set the location. Fixes bug #58488.
6998
6999 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7000
7001         * driver.cs: Add -pkg handling.
7002
7003         From Gonzalo: UseShelLExecute=false
7004
7005 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7006
7007         * attribute.cs:
7008         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7009         for attribute.
7010         (Attribute.IsClsCompliaceRequired): Moved to base for better
7011         accesibility.
7012         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7013         when attribute is AttributeUsageAttribute.
7014         (Attribute.GetValidTargets): Simplified.
7015         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7016         attribute for this type.
7017         (Attribute.ApplyAttributes): Method renamed to Emit and make
7018         non-static.
7019         (GlobalAttributeSection): New class for special handling of global
7020         attributes (assembly, module).
7021         (AttributeSection.Emit): New method.
7022
7023         * class.cs: Implemented Attributable abstract methods.
7024         (MethodCore.LabelParameters): Moved to Parameter class.
7025         (Accessor): Is back simple class.
7026         (PropertyMethod): Implemented Attributable abstract class.
7027         (DelegateMethod): Implemented Attributable abstract class.
7028         (Event): New constructor for disctintion between normal Event
7029         and Event with accessors.
7030
7031         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7032
7033         * codegen.cs, const.cs, decl.cs, delegate.cs:
7034         (CommonAssemblyModulClass): Implemented Attributable abstract class
7035         and simplified.
7036
7037         * enum.cs: Implement IAttributeSupport interface.
7038         (EnumMember): New class for emum members. Implemented Attributable
7039         abstract class
7040
7041         * parameter.cs:
7042         (ParameterBase): Is abstract.
7043         (ReturnParameter): New class for easier [return:] attribute handling.
7044
7045         * typemanager.cs: Removed builder_to_attr.
7046
7047 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7048
7049         Fix bug #57151.
7050         * attribute.cs (Attribute.GetPositionalValue): New function.
7051         * class.cs (TypeContainer.VerifyMembers): New function.
7052         (TypeContainer.Emit): Use it.
7053         (ClassOrStruct): New base class for Class and Struct.
7054         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7055         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7056         class.
7057         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7058         then each non-static field should have a FieldOffset attribute.
7059         Otherwise, none of the fields should have a FieldOffset attribute.
7060         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7061         and FieldOffset attributes.
7062         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7063         (TypeManager.field_offset_attribute_type): New core types.
7064         (TypeManager.InitCoreTypes): Initialize them.
7065
7066 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7067
7068         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7069         Return correct type.
7070         From bug #58270.
7071
7072 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7073
7074         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7075         be implicitly converted to ulong.
7076         
7077         * expression.cs: The logic for allowing operator &, | and ^ worked
7078         was wrong, it worked before because we did not report an error in
7079         an else branch.  Fixes 57895.
7080
7081         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7082         allow volatile fields to be reference types.
7083
7084 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7085
7086         * driver.cs: Add support for /debug-
7087
7088 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7089
7090         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7091         Add a 'complain' parameter to silence errors.
7092         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7093         silently overlooked type-resolutions.
7094         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7095         to reflect changes.
7096         (Attributes.Search): New function.
7097         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7098         (Attributes.GetAttributeFullName): Remove hack.
7099         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7100         Update to reflect changes.
7101         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7102         Use Attributes.Search instead of nested loops.
7103
7104 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7105
7106         * decl.cs:
7107         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7108         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7109         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7110
7111         * report.cs: (Report.Warning): Renamed to Warning_T because of
7112         parameter collision.
7113
7114 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7115
7116         * expression.cs (MemberAccess.ResolveMemberAccess):
7117         Exit with non-zero status after Report.Error.
7118         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7119         Likewise.
7120         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7121
7122 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7123
7124         * support.cs: Don't hang when the file is empty.
7125
7126 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7127
7128         * support.cs: In SeekableStreamReader, compute the preamble size of the
7129           underlying stream. Position changes should take into account that initial
7130           count of bytes.
7131
7132 2004-05-03  Todd Berman  <tberman@sevenl.net>
7133
7134         * driver.cs: remove unused GetSysVersion function.
7135
7136 2004-05-03  Todd Berman  <tberman@sevenl.net>
7137
7138         * driver.cs: Remove the hack from saturday, as well as the hack
7139         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7140         link_paths to get that bit proper.
7141
7142 2004-05-01  Todd Berman  <tberman@sevenl.net>
7143
7144         * driver.cs: Try a LoadFrom before a Load, this checks the current
7145         path. This is currently a bug in mono that is be fixed, however, this
7146         provides a workaround for now. This will be removed when the bug
7147         is fixed.
7148
7149 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7150
7151         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7152         incomplete key pairs (#57941).
7153
7154 2004-05-01  Todd Berman  <tberman@sevenl.net>
7155
7156         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7157         from the GAC
7158
7159 2004-04-30  Jackson Harper  <jackson@ximian.com>
7160
7161         * codegen.cs: Open keys readonly.
7162         
7163 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7164
7165         * typemanager.cs: don't report cyclic struct layout when a struct
7166         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7167         which has 2 Pango.Rectangle fields.
7168
7169 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7170
7171         * expression.cs: Handle IntPtr comparisons with IL code
7172         rather than a method call.
7173
7174 2004-04-29  Martin Baulig  <martin@ximian.com>
7175
7176         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7177         the list of PropertyInfo's in class hierarchy and find the
7178         accessor.  Fixes #56013.
7179
7180 2004-04-29  Martin Baulig  <martin@ximian.com>
7181
7182         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7183
7184 2004-04-29  Martin Baulig  <martin@ximian.com>
7185
7186         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7187
7188         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7189
7190 2004-04-29  Martin Baulig  <martin@ximian.com>
7191
7192         * class.cs (ConstructorInitializer.Resolve): Check whether the
7193         parent .ctor is accessible.  Fixes #52146.
7194
7195 2004-04-29  Martin Baulig  <martin@ximian.com>
7196
7197         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7198
7199         * statement.cs (Using.EmitLocalVariableDecls): Use
7200         TypeManager.idisposable_type, not typeof (IDisposable).
7201         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7202
7203 2004-04-29  Martin Baulig  <martin@ximian.com>
7204
7205         * class.cs (Event.Define): Don't emit the field and don't set
7206         RTSpecialName and SpecialName for events on interfaces.  Fixes
7207         #57703. 
7208
7209 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7210
7211         Refactor Attribute.ApplyAttributes.
7212         * attribute.cs (Attributable): New base class for objects that can
7213         have Attributes applied on them.
7214         (Attribute): Make AttributeUsage fields public.
7215         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7216         (Attribute.IsInternalCall): New property.
7217         (Attribute.UsageAttr): Convert to a public read-only property.
7218         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7219         (Attribute.ResolveType, Attribute.Resolve)
7220         (Attribute.ScanForIndexerName): Update to reflect changes.
7221         (Attribute.CheckAttributeTarget): Re-format.
7222         (Attribute.ApplyAttributes): Refactor, to various
7223         Attributable.ApplyAttributeBuilder methods.
7224         * decl.cs (MemberCore): Make Attributable.
7225         * class.cs (Accessor): Make Attributable.
7226         (MethodData.ApplyAttributes): Use proper attribute types, not
7227         attribute names.
7228         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7229         (TypeContainer.ApplyAttributeBuilder)
7230         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7231         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7232         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7233         (Operator.ApplyAttributeBuilder): New factored-out methods.
7234         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7235         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7236         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7237         * parameter.cs (ParameterBase): New Attributable base class
7238         that can also represent Return types.
7239         (Parameter): Update to the changes.
7240
7241 2004-04-29  Jackson Harper  <jackson@ximian.com>
7242
7243         * driver.cs: Prefer the corlib system version when looking for
7244         assemblies in the GAC. This is still a hack, but its a better hack
7245         now.
7246         
7247 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7248
7249         * decl.cs, enum.cs: Improved error 3005 reporting.
7250   
7251         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7252         (related_symbols): New private member for list of symbols
7253         related to reported error/warning.
7254         
7255         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7256
7257 2004-04-29  Martin Baulig  <martin@ximian.com>
7258
7259         * ecore.cs (Expression.Constantify): If we're an enum and
7260         TypeManager.TypeToCoreType() doesn't give us another type, use
7261         t.UnderlyingSystemType.  Fixes #56178.  
7262
7263 2004-04-29  Martin Baulig  <martin@ximian.com>
7264
7265         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7266         interfaces and for each interface, only add members directly
7267         declared in that interface.  Fixes #53255.
7268
7269 2004-04-28  Martin Baulig  <martin@ximian.com>
7270
7271         * expression.cs (ConditionalLogicalOperator): Use a temporary
7272         variable for `left' to avoid that we evaluate it more than once;
7273         bug #52588.
7274
7275 2004-04-28  Martin Baulig  <martin@ximian.com>
7276
7277         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7278         `void[]' (CS1547).
7279
7280 2004-04-28  Martin Baulig  <martin@ximian.com>
7281
7282         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7283         void (CS1547).
7284
7285         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7286         whether the type is not void (CS1547).
7287
7288 2004-04-28  Martin Baulig  <martin@ximian.com>
7289
7290         * expression.cs (Unary.DoResolveLValue): Override this and report
7291         CS0131 for anything but Operator.Indirection.
7292
7293 2004-04-28  Martin Baulig  <martin@ximian.com>
7294
7295         Committing a patch from Ben Maurer; see bug #50820.
7296
7297         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7298         check for classes.
7299
7300         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7301         classes.        
7302
7303 2004-04-28  Martin Baulig  <martin@ximian.com>
7304
7305         Committing a patch from Ben Maurer; see bug #50820.
7306
7307         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7308         check for classes.
7309
7310         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7311         classes.        
7312
7313 2004-04-28  Martin Baulig  <martin@ximian.com>
7314
7315         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7316         (Block.AddLabel): Call DoLookupLabel() to only search in the
7317         current block.
7318
7319 2004-04-28  Martin Baulig  <martin@ximian.com>
7320
7321         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7322         comparing StringConstants and NullLiterals in Equality and Inequality.
7323
7324 2004-04-28  Jackson Harper  <jackson@ximian.com>
7325
7326         * driver.cs: Attempt to load referenced assemblies from the
7327         GAC. This is the quick and dirty version of this method that
7328         doesnt take into account versions and just takes the first
7329         canidate found. Will be good enough for now as we will not have more
7330         then one version installed into the GAC until I update this method.
7331
7332 2004-04-28  Martin Baulig  <martin@ximian.com>
7333
7334         * typemanager.cs (TypeManager.CheckStructCycles): New public
7335         static method to check for cycles in the struct layout.
7336
7337         * rootcontext.cs (RootContext.PopulateTypes): Call
7338         TypeManager.CheckStructCycles() for each TypeContainer.
7339         [Note: We only need to visit each type once.]
7340
7341 2004-04-28  Martin Baulig  <martin@ximian.com>
7342
7343         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7344
7345         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7346         success and added `out object value'.  Use a `bool resolved' field
7347         to check whether we've already been called rather than
7348         `ConstantValue != null' since this breaks for NullLiterals.
7349
7350 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7351
7352         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7353         setting of this flag, since the 'set' method may be non-public.
7354
7355 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7356
7357         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7358         check on current_vector.Block.
7359
7360 2004-04-27  Martin Baulig  <martin@ximian.com>
7361
7362         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7363         a field initializer.  Fixes #56459.
7364
7365 2004-04-27  Martin Baulig  <martin@ximian.com>
7366
7367         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7368         we're not attempting to use an indexer.  Fixes #52154.
7369
7370 2004-04-27  Martin Baulig  <martin@ximian.com>
7371
7372         * statement.cs (Return): Don't create a return label if we don't
7373         need it; reverts my change from January 20th.  Thanks to Ben
7374         Maurer for this.
7375
7376 2004-04-27  Martin Baulig  <martin@ximian.com>
7377
7378         According to the spec, `goto' can only leave a nested scope, but
7379         never enter it.
7380
7381         * statement.cs (Block.LookupLabel): Only lookup in the current
7382         block, don't recurse into parent or child blocks.
7383         (Block.AddLabel): Check in parent and child blocks, report
7384         CS0140/CS0158 if we find a duplicate.
7385         (Block): Removed this indexer for label lookups.
7386         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7387         this already does the error reporting for us.
7388
7389         * flowanalysis.cs
7390         (FlowBranching.UsageVector.Block): New public variable; may be null.
7391         (FlowBranching.CreateSibling): Added `Block' argument.
7392         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7393         label for the target of a `goto' and check whether we're not
7394         leaving a `finally'.
7395
7396 2004-04-27  Martin Baulig  <martin@ximian.com>
7397
7398         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7399         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7400         just for returns).
7401
7402 2004-04-27  Martin Baulig  <martin@ximian.com>
7403
7404         * statement.cs (Block.AddLabel): Also check for implicit blocks
7405         and added a CS0158 check.
7406
7407 2004-04-27  Martin Baulig  <martin@ximian.com>
7408
7409         * flowanalysis.cs (FlowBranchingLoop): New class.
7410         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7411         UsageVector's instead of an ArrayList.
7412         (FlowBranching.Label): Likewise.
7413         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7414         (FlowBranching.AddBreakVector): New method.
7415
7416 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7417
7418         * attribute.cs: Small regression fix: only convert the type if we
7419         the type is different, fixes System.Drawing build.
7420
7421 2004-04-27  Martin Baulig  <martin@ximian.com>
7422
7423         * attribute.cs (Attribute.Resolve): If we have a constant value
7424         for a named field or property, implicity convert it to the correct
7425         type.
7426
7427 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7428
7429         * statement.cs (Block.Block): Implicit blocks share
7430         'child_variable_names' fields with parent blocks.
7431         (Block.AddChildVariableNames): Remove.
7432         (Block.AddVariable): Mark variable as "used by a child block" in
7433         every surrounding block.
7434         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7435         been used in a child block, complain about violation of "Invariant
7436         meaning in blocks" rule.
7437         * cs-parser.jay (declare_local_variables): Don't use
7438         AddChildVariableNames.
7439         (foreach_statement): Don't create an implicit block: 'foreach'
7440         introduces a scope.
7441
7442 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7443
7444         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7445         converting from 0L to ulong.  Fixes 57522.
7446
7447 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7448
7449         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7450         derived class hides via 'new' keyword field from base class (test-242.cs).
7451         TODO: Handle this in the more general way.
7452         
7453         * class.cs (CheckBase): Ditto.
7454
7455 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7456
7457         * decl.cs (caching_flags): New member for storing cached values
7458         as bit flags.
7459         (MemberCore.Flags): New enum where bit flags for caching_flags
7460         are defined.
7461         (MemberCore.cls_compliance): Moved to caching_flags.
7462         (DeclSpace.Created): Moved to caching_flags.
7463
7464         * class.cs: Use caching_flags instead of DeclSpace.Created
7465         
7466 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7467
7468         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7469         if we are only a derived class, not a nested class.
7470
7471         * typemanager.cs: Same as above, but do this at the MemberLookup
7472         level (used by field and methods, properties are handled in
7473         PropertyExpr).   Allow for the qualified access if we are a nested
7474         method. 
7475
7476 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7477
7478         * class.cs: Refactoring.
7479         (IMethodData): New inteface; Holds links to parent members
7480         to avoid member duplication (reduced memory allocation).
7481         (Method): Implemented IMethodData interface.
7482         (PropertyBase): New inner classes for get/set methods.
7483         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7484         (Event): New inner classes for add/remove methods.
7485         (Event.DelegateMethod): Implemented IMethodData interface.
7486
7487         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7488         EmitContext (related to class.cs refactoring).
7489
7490 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7491
7492         * delegate.cs (Delegate.VerifyApplicability): If the number of
7493         arguments are the same as the number of parameters, first try to
7494         verify applicability ignoring  any 'params' modifier on the last
7495         parameter.
7496         Fixes #56442.
7497
7498 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7499
7500         * class.cs (TypeContainer.AddIndexer): Use
7501         'ExplicitInterfaceName' to determine if interface name was
7502         explicitly specified.  'InterfaceType' is not initialized at this time.
7503         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7504         Indexers array is already in the required order.  Initialize
7505         'IndexerName' only if there are normal indexers.
7506         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7507         (TypeContainer.Emit): Emit DefaultMember attribute only if
7508         IndexerName is initialized.
7509         Fixes #56300.
7510
7511 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7512
7513         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7514         Fixes #57007
7515
7516 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7517
7518         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7519         attributes.
7520         Fix for #56456.
7521
7522         * attribute.cs (Attribute.Resolve): Check for duplicate named
7523         attributes.
7524         Fix for #56463.
7525
7526 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7527
7528         * iterators.cs (MarkYield): track whether we are in an exception,
7529         and generate code accordingly.  Use a temporary value to store the
7530         result for our state.
7531
7532         I had ignored a bit the interaction of try/catch with iterators
7533         since their behavior was not entirely obvious, but now it is
7534         possible to verify that our behavior is the same as MS .NET 2.0
7535
7536         Fixes 54814
7537
7538 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7539
7540         * iterators.cs: Avoid creating temporaries if there is no work to
7541         do. 
7542
7543         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7544         Enumerations, use TypeManager.EnumToUnderlying and call
7545         recursively. 
7546
7547         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7548         bug #57013
7549
7550         (This.Emit): Use EmitContext.EmitThis to emit our
7551         instance variable.
7552
7553         (This.EmitAssign): Ditto.
7554
7555         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7556         codepaths, we will move all the functionality into
7557         Mono.CSharp.This 
7558
7559         (FieldExpr.EmitAssign): Ditto.
7560
7561         This fixes several hidden bugs that I uncovered while doing a code
7562         review of this today.
7563
7564         * codegen.cs (EmitThis): reworked so the semantics are more clear
7565         and also support value types "this" instances.
7566
7567         * iterators.cs: Changed so that for iterators in value types, we
7568         do not pass the value type as a parameter.  
7569
7570         Initialization of the enumerator helpers is now done in the caller
7571         instead of passing the parameters to the constructors and having
7572         the constructor set the fields.
7573
7574         The fields have now `assembly' visibility instead of private.
7575
7576 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7577
7578         * expression.cs (Argument.Resolve): Check if fields passed as ref
7579         or out are contained in a MarshalByRefObject.
7580
7581         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7582         another compiler type.
7583
7584 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7585
7586         * class.cs (Indexer.Define): use the new name checking method.
7587         Also, return false on an error.
7588         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7589         (is_identifier_[start/part]_character): make static.
7590
7591 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7592
7593         * expression.cs (Binary.ResolveOperator): Do no append strings
7594         twice: since we can be invoked more than once (array evaluation)
7595         on the same concatenation, take care of this here.  Based on a fix
7596         from Ben (bug #56454)
7597
7598 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7599
7600         * codegen.cs: Fix another case where CS1548 must be reported (when 
7601         delay-sign isn't specified and no private is available #56564). Fix
7602         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7603         error when MCS is used on the MS runtime and we need to delay-sign 
7604         (which seems unsupported by AssemblyBuilder - see #56621).
7605
7606 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7607
7608         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7609         (TypeManager.ComputeNamespaces): Faster implementation for
7610         Microsoft runtime.
7611
7612         * compiler.csproj: Updated AssemblyName to mcs.
7613
7614 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7615
7616         * rootcontext.cs: Add new types to the boot resolution.
7617
7618         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7619         MulticastDelegate is not allowed.
7620
7621         * typemanager.cs: Add new types to lookup: System.TypedReference
7622         and ArgIterator.
7623
7624         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7625         check for TypedReference or ArgIterator, they are not allowed. 
7626
7627         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7628         makes us properly catch 1510 in some conditions (see bug 56016 for
7629         details). 
7630
7631 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7632
7633         * CryptoConvert.cs: update from corlib version
7634         with endian fixes.
7635
7636 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7637
7638         * class.cs (Indexer.Define): Check indexername declaration
7639
7640 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7641
7642         * attribute.cs (IsClsCompliant): Fixed problem with handling
7643         all three states (compliant, not-compliant, undetected).
7644
7645 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7646
7647         * attribute.cs (Attribute): Location is now public.
7648         (Resolve): Store resolved arguments (pos_values) in attribute class.
7649         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7650         (GetClsCompliantAttributeValue): New method that gets
7651         CLSCompliantAttribute value.
7652         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7653         if exists else null.
7654         (AttributeTester): New class for CLS-Compliant verification routines.
7655
7656         * class.cs (Emit): Add CLS-Compliant verification.
7657         (Method.GetSignatureForError): Implemented.
7658         (Constructor.GetSignatureForError): Implemented
7659         (Constructor.HasCompliantArgs): Returns if constructor has
7660         CLS-Compliant arguments.
7661         (Constructor.Emit): Override.
7662         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7663         is needed to test only parameters.
7664         (FieldBase.GetSignatureForError): Implemented.
7665         (TypeContainer): New member for storing base interfaces.
7666         (TypeContainer.FindMembers): Search in base interfaces too.
7667
7668         * codegen.cs (GetClsComplianceAttribute): New method that gets
7669         assembly or module CLSCompliantAttribute value.
7670         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7671         for assembly.
7672         (ModuleClass.Emit): Add error 3012 test.
7673
7674         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7675
7676         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7677         state for all decl types.
7678         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7679         if CLS-Compliant tests are required.
7680         (IsClsCompliaceRequired): New method. Analyze whether code
7681         must be CLS-Compliant.
7682         (IsExposedFromAssembly): New method. Returns true when MemberCore
7683         is exposed from assembly.
7684         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7685         value or gets cached value.
7686         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7687         is explicitly marked with CLSCompliantAttribute.
7688         (IsIdentifierClsCompliant): New abstract method. This method is
7689         used to testing error 3005.
7690         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7691         for identifier and parameters CLS-Compliant testing.
7692         (VerifyClsCompliance): New method. The main virtual method for
7693         CLS-Compliant verifications.
7694         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7695         null. I don't know why is null (too many public members !).
7696         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7697         and get value of first CLSCompliantAttribute that found.
7698
7699         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7700         (VerifyClsCompliance): Override and add extra tests.
7701
7702         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7703         clscheck- disable CLS-Compliant verification event if assembly is has
7704         CLSCompliantAttribute(true).
7705
7706         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7707         ApllyAttribute is now called in emit section as in the other cases.
7708         Possible future Emit integration.
7709         (IsIdentifierClsCompliant): New override.
7710         (VerifyClsCompliance): New override.
7711         (GetEnumeratorName): Returns full enum name.
7712
7713         * parameter.cs (GetSignatureForError): Implemented.
7714
7715         * report.cs (WarningData): New struct for Warning message information.
7716         (LocationOfPreviousError): New method.
7717         (Warning): New method. Reports warning based on the warning table.
7718         (Error_T): New method. Reports error based on the error table.
7719
7720         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7721         verifications are done here.
7722
7723         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7724
7725         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7726         CLSCompliantAttribute.
7727         (all_imported_types): New member holds all imported types from other
7728         assemblies.
7729         (LoadAllImportedTypes): New method fills static table with exported types
7730         from all referenced assemblies.
7731         (Modules): New property returns all assembly modules.
7732
7733 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7734
7735         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7736         throwing a parser error.
7737
7738         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7739         which removes the hardcoded get_/set_ prefixes for properties, as
7740         IL allows for the properties to be named something else.  
7741
7742         Bug #56013
7743
7744         * expression.cs: Do not override operand before we know if it is
7745         non-null.  Fix 56207
7746
7747 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7748
7749         * typemanager.cs: support for pinned variables.
7750
7751 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7752
7753         * decl.cs, typemanager.cs: Avoid using an arraylist
7754         as a buffer if there is only one result set.
7755
7756 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7757
7758         * expression.cs: Make sure you cant call a static method
7759         with an instance expression, bug #56174.
7760
7761 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7762
7763         * class.cs (IsDuplicateImplementation): Improve error reporting to
7764         flag 663 (method only differs in parameter modifier).
7765
7766         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7767         in preprocessor directives.
7768
7769         * location.cs (LookupFile): Allow for the empty path.
7770
7771         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7772         better approach for some of that patch, but its failing with the
7773         CharSet enumeration.  For now try/catch will do.
7774
7775         * typemanager.cs: Do not crash if a struct does not have fields.
7776         Fixes 56150.
7777
7778 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7779
7780         * expression.cs: cs0213, cant fix a fixed expression.
7781         fixes 50231.
7782
7783 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7784
7785         * cs-parser.jay: detect invalid embeded statements gracefully.
7786         bug #51113.
7787
7788 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7789
7790         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7791         As a regex:
7792         s/
7793         the invocation type may not be a subclass of the tye of the item/
7794         The type of the item must be a subclass of the invocation item.
7795         /g
7796
7797         Fixes bug #50820.
7798
7799 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7800
7801         * attribute.cs: Added methods to get a string and a bool from an
7802         attribute. Required to information from AssemblyKeyFileAttribute,
7803         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7804         * codegen.cs: Modified AssemblyName creation to include support for
7805         strongnames. Catch additional exceptions to report them as CS1548.
7806         * compiler.csproj: Updated include CryptoConvert.cs.
7807         * compiler.csproj.user: Removed file - user specific configuration.
7808         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7809         Mono.Security assembly. The original class is maintained and tested in
7810         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7811         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7812         like CSC 8.0 (C# v2) supports.
7813         * Makefile: Added CryptoConvert.cs to mcs sources.
7814         * rootcontext.cs: Added new options for strongnames.
7815
7816 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7817
7818         * driver.cs: For --expect-error, report error code `2'
7819         if the program compiled with no errors, error code `1' if
7820         it compiled with an error other than the one expected.
7821
7822 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7823
7824         * compiler.csproj: Updated for Visual Studio .NET 2003.
7825         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7826         * compiler.sln: Updated for Visual Studio .NET 2003.
7827
7828 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7829
7830         * expression.cs: Fix bug #47234. We basically need to apply the
7831         rule that we prefer the conversion of null to a reference type
7832         when faced with a conversion to 'object' (csc behaviour).
7833
7834 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7835
7836         * statement.cs: Shorter form for foreach, eliminates
7837         a local variable. r=Martin.
7838
7839 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7840
7841         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7842         checks if we can use brtrue/brfalse to test for 0.
7843         * expression.cs: use the above in the test for using brtrue/brfalse.
7844         cleanup code a bit.
7845
7846 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7847
7848         * expression.cs: Rewrite string concat stuff. Benefits:
7849
7850         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7851         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7852         rather than a concat chain.
7853
7854         * typemanager.cs: Add lookups for more concat overloads.
7855
7856 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7857
7858         * expression.cs: Emit shorter il code for array init.
7859
7860         newarr
7861         dup
7862         // set 1
7863
7864         // set 2
7865
7866         newarr
7867         stloc.x
7868
7869         ldloc.x
7870         // set 1
7871
7872         ldloc.x
7873         // set 2
7874
7875 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7876
7877         * statement.cs: Before, two switch blocks would be merged if the
7878         total size of the blocks (end_item - begin_item + 1) was less than
7879         two times the combined sizes of the blocks.
7880
7881         Now, it will only merge if after the merge at least half of the
7882         slots are filled.
7883
7884         fixes 55885.
7885
7886 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7887
7888         * class.cs : csc build fix for GetMethods(). See bug #52503.
7889
7890 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7891
7892         * expression.cs: Make sure fp comparisons work with NaN.
7893         This fixes bug #54303. Mig approved this patch a long
7894         time ago, but we were not able to test b/c the runtime
7895         had a related bug.
7896
7897 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7898
7899         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7900
7901 2004-03-19  Martin Baulig  <martin@ximian.com>
7902
7903         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7904         error here and not in our caller.
7905
7906 2004-03-19  Martin Baulig  <martin@ximian.com>
7907
7908         * interface.cs: Completely killed this file.
7909         (Interface): We're now a TypeContainer and live in class.cs.
7910
7911         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7912         argument; we're now also called for interfaces.
7913         (TypeContainer.DefineMembers): Allow this method being called
7914         multiple times.
7915         (TypeContainer.GetMethods): New public method; formerly known as
7916         Interface.GetMethod().  This is used by PendingImplementation.
7917         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7918         it's now private and non-static.
7919         (Interface): Moved this here; it's now implemented similar to
7920         Class and Struct.
7921         (Method, Property, Event, Indexer): Added `bool is_interface'
7922         argument to their .ctor's.
7923         (MemberBase.IsInterface): New public field.
7924
7925         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7926         instances instead of InterfaceMethod, InterfaceProperty, etc.
7927         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7928         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7929
7930 2004-03-19  Martin Baulig  <martin@ximian.com>
7931
7932         * class.cs (MethodCore.IsDuplicateImplementation): New private
7933         method which does the CS0111 checking.
7934         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7935         Use IsDuplicateImplementation().
7936
7937 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7938
7939         * decl.cs (FindMemberToOverride): New method to find the correct
7940         method or property to override in the base class.
7941         * class.cs
7942             - Make Method/Property use the above method to find the
7943               version in the base class.
7944             - Remove the InheritableMemberSignatureCompare as it is now
7945               dead code.
7946
7947         This patch makes large code bases much faster to compile, as it is
7948         O(n) rather than O(n^2) to do this validation.
7949
7950         Also, it fixes bug 52458 which is that nested classes are not
7951         taken into account when finding the base class member.
7952
7953         Reviewed/Approved by Martin.
7954
7955 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7956
7957         * interface.cs: In all interface classes removed redundant
7958         member initialization.
7959
7960 2004-03-16  Martin Baulig  <martin@ximian.com>
7961
7962         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7963
7964 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7965
7966         * decl.cs (DefineTypeAndParents): New helper method to define a
7967         type's containers before the type itself is defined;  This is a
7968         bug exposed by the recent changes to Windows.Forms when an
7969         implemented interface was defined inside a class that had not been
7970         built yet.   
7971
7972         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7973
7974         (Check): Loop correctly to report errors modifiers
7975         (UNSAFE was not in the loop, since it was the same as TOP).
7976
7977         * interface.cs: Every interface member now takes a ModFlags,
7978         instead of a "is_new" bool, which we set on the base MemberCore. 
7979
7980         Every place where we called "UnsafeOk" in the interface, now we
7981         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7982         the unsafe settings from the member declaration instead of the
7983         container interface. 
7984
7985         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7986
7987         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7988         `set_indexer_name' to the pending bits (one per type).
7989
7990         We fixed a bug today that was picking the wrong method to
7991         override, since for properties the existing InterfaceMethod code
7992         basically ignored the method name.  Now we make sure that the
7993         method name is one of the valid indexer names.
7994
7995 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7996  
7997         * support.cs (SeekableStreamReader): Keep track of stream byte
7998         positions and don't mix them with character offsets to the buffer.
7999
8000         Patch from Gustavo Giráldez
8001
8002 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8003
8004         * interface.cs (InterfaceSetGetBase): Removed double member
8005         initialization, base class does it as well.
8006
8007 2004-03-13  Martin Baulig  <martin@ximian.com>
8008
8009         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8010         when compiling corlib.
8011
8012 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8013
8014         * convert.cs (ExplicitConversion): We were reporting an error on
8015         certain conversions (object_type source to a value type, when the
8016         expression was `null') before we had a chance to pass it through
8017         the user defined conversions.
8018
8019         * driver.cs: Replace / and \ in resource specifications to dots.
8020         Fixes 50752
8021
8022         * class.cs: Add check for duplicate operators.  Fixes 52477
8023
8024 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8025
8026         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8027         that are in the middle of the statements, not only at the end.
8028         Fixes #54987
8029
8030         * class.cs (TypeContainer.AddField): No longer set the
8031         `HaveStaticConstructor' flag, now we call it
8032         `UserDefineStaticConstructor' to diferentiate the slightly
8033         semantic difference.
8034
8035         The situation is that we were not adding BeforeFieldInit (from
8036         Modifiers.TypeAttr) to classes that could have it.
8037         BeforeFieldInit should be set to classes that have no static
8038         constructor. 
8039
8040         See:
8041
8042         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8043
8044         And most importantly Zoltan's comment:
8045
8046         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8047
8048         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8049          before its static fields are used', i.e. initialization does not need
8050          to be triggered by the first access to the type. Setting this flag
8051          helps the JIT to compile better code, since it can run the static
8052          constructor at JIT time, and does not need to generate code to call it
8053          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8054          this flag for lots of classes like String. 
8055          
8056          csc sets this flag if the type does not have an explicit static 
8057          constructor. The reasoning seems to be that if there are only static
8058          initalizers for a type, and no static constructor, then the programmer
8059          does not care when this initialization happens, so beforefieldinit
8060          can be used.
8061          
8062          This bug prevents the AOT compiler from being usable, since it 
8063          generates so many calls to mono_runtime_class_init that the AOT code
8064          is much slower than the JITted code. The JITted code is faster, 
8065          because it does not generate these calls if the vtable is type is
8066          already initialized, which is true in the majority of cases. But the
8067          AOT compiler can't do this."
8068
8069 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8070
8071         * class.cs (MethodData.Emit): Refactor the code so symbolic
8072         information is generated for destructors;  For some reasons we
8073         were taking a code path that did not generate symbolic information
8074         before. 
8075
8076 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8077
8078         * class.cs: Create a Constructor.CheckBase method that
8079         takes care of all validation type code. The method
8080         contains some code that was moved from Define.
8081
8082         It also includes new code that checks for duplicate ctors.
8083         This fixes bug #55148.
8084
8085 2004-03-09  Joshua Tauberer <tauberer@for.net>
8086
8087         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8088         a { ... }-style array creation invokes EmitStaticInitializers
8089         which is not good for reference-type arrays.  String, decimal
8090         and now null constants (NullCast) are not counted toward
8091         static initializers.
8092
8093 2004-03-05  Martin Baulig  <martin@ximian.com>
8094
8095         * location.cs (SourceFile.HasLineDirective): New public field;
8096         specifies whether the file contains or is referenced by a "#line"
8097         directive.
8098         (Location.DefineSymbolDocuments): Ignore source files which
8099         either contain or are referenced by a "#line" directive.        
8100
8101 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8102
8103         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8104         direct access to our parent, so check the method inline there.
8105
8106 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8107
8108         * expression.cs (Invocation.EmitCall): Miguel's last commit
8109         caused a regression. If you had:
8110
8111             T t = null;
8112             t.Foo ();
8113
8114         In Foo the implict this would be null.
8115
8116 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8117
8118         * expression.cs (Invocation.EmitCall): If the method is not
8119         virtual, do not emit a CallVirt to it, use Call.
8120
8121         * typemanager.cs (GetFullNameSignature): Improve the method to
8122         cope with ".ctor" and replace it with the type name.
8123
8124         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8125         as an argument the ConstructorBuilder where it is being defined,
8126         to catch the recursive constructor invocations.
8127
8128 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8129
8130         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8131         routines to check if a type is an enumerable/enumerator allow
8132         classes that implement the IEnumerable or IEnumerator interfaces.
8133
8134         * class.cs (Property, Operator): Implement IIteratorContainer, and
8135         implement SetYields.
8136
8137         (Property.Define): Do the block swapping for get_methods in the
8138         context of iterators.   We need to check if Properties also
8139         include indexers or not.
8140
8141         (Operator): Assign the Block before invoking the
8142         OperatorMethod.Define, so we can trigger the Iterator code
8143         replacement. 
8144
8145         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8146         Property and Operator classes are not created when we parse the
8147         declarator but until we have the block completed, so we use a
8148         singleton SimpleIteratorContainer.Simple to flag whether the
8149         SetYields has been invoked.
8150
8151         We propagate this setting then to the Property or the Operator to
8152         allow the `yield' to function.
8153
8154 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8155
8156         * codegen.cs: Implemented attribute support for modules.
8157         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8158         Assembly/Module functionality.
8159
8160         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8161         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8162         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8163
8164 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8165
8166         * interface.cs (FindMembers): The operation is performed on all base
8167         interfaces and not only on the first. It is required for future CLS Compliance patch.
8168
8169 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8170
8171         * statement.cs, codegen.cs:
8172         This patch deals with patterns such as:
8173
8174         public class List : IEnumerable {
8175
8176                 public MyEnumerator GetEnumerator () {
8177                         return new MyEnumerator(this);
8178                 }
8179
8180                 IEnumerator IEnumerable.GetEnumerator () {
8181                         ...
8182                 }
8183                 
8184                 public struct MyEnumerator : IEnumerator {
8185                         ...
8186                 }
8187         }
8188
8189         Before, there were a few things we did wrong:
8190         1) we would emit callvirt on a struct, which is illegal
8191         2) we emited ldarg when we needed to emit ldarga
8192         3) we would mistakenly call the interface methods on an enumerator
8193         type that derived from IEnumerator and was in another assembly. For example:
8194
8195         public class MyEnumerator : IEnumerator
8196
8197         Would have the interface methods called, even if there were public impls of the
8198         method. In a struct, this lead to invalid IL code.
8199
8200 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8201
8202         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8203           renamed to Emit.
8204
8205         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8206
8207 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8208
8209         * cs-parser.jay: Fix small regression: we were not testing V2
8210         compiler features correctly.
8211
8212         * interface.cs: If the emit context is null, then create one
8213
8214 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8215
8216         * decl.cs (GetSignatureForError): New virtual method to get full name
8217           for error messages.
8218
8219         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8220           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8221
8222         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8223           Duplicated members and code in these classes has been removed.
8224           Better encapsulation in these classes.
8225
8226 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8227
8228         * assign.cs (Assign.DoResolve): When dealing with compound
8229         assignments, there is a new rule in ECMA C# 2.4 (might have been
8230         there before, but it is documented here) that states that in:
8231
8232         a op= b;
8233
8234         If b is of type int, and the `op' is a shift-operator, then the
8235         above is evaluated as:
8236
8237         a = (int) a op b 
8238
8239         * expression.cs (Binary.ResolveOperator): Instead of testing for
8240         int/uint/long/ulong, try to implicitly convert to any of those
8241         types and use that in pointer arithmetic.
8242
8243         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8244         method to print information for from the type, not from the
8245         null-method we were given.
8246
8247 2004-02-01  Duncan Mak  <duncan@ximian.com>
8248
8249         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8250         parsing for cmd, fixes bug #53694.
8251
8252 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8253
8254         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8255         in the member name duplication tests. Property and operator name duplication
8256         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8257
8258 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8259
8260         * interface.cs (PopulateMethod): Fixed crash when interface method
8261         returns not existing type (error test cs0246-3.cs).
8262
8263 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8264
8265         * cs-parser.jay (interface_accessors): Re-write actions to also
8266         store attributes attached to get and set methods. Fix spelling
8267         while at it.
8268
8269         (inteface_property_declaration): Modify accordingly.
8270
8271         (InterfaceAccessorInfo): New helper class to store information to pass
8272         around between rules that use interface_accessors.
8273
8274         * interface.cs (Emit): Apply attributes on the get and set
8275         accessors of properties and indexers too.
8276
8277         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8278         right MethodBuilder when applying attributes to the get and set accessors.
8279
8280 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8281
8282         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8283
8284 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8285
8286         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8287
8288 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8289
8290         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8291         changes that treat `yield' specially when present before `break'
8292         or `return' tokens.
8293
8294         * cs-tokenizer.cs: yield is no longer a keyword.
8295
8296 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8297
8298         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8299         setting for default constructors.
8300         For default constructors are almost every time set wrong Modifier. The
8301         generated IL code has been alright. But inside mcs this values was
8302         wrong and this was reason why several of my CLS Compliance tests
8303         failed.
8304
8305 2004-01-22  Martin Baulig  <martin@ximian.com>
8306
8307         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8308         not a QualifiedIdentifier.  This is what `type_name_expression'
8309         was previously doing.
8310         (type_name_expression): Removed; the code is now in
8311         `namespace_or_type_name'.
8312         (qualified_identifier): Removed, use `namespace_or_type_name'
8313         instead.
8314         (QualifiedIdentifier): Removed this class.      
8315
8316 2004-01-22  Martin Baulig  <martin@ximian.com>
8317
8318         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8319         not a string as alias name.
8320
8321 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8322
8323         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8324         #52730 bug, and instead compute correctly the need to use a
8325         temporary variable when requesting an address based on the
8326         static/instace modified of the field and the constructor.
8327  
8328 2004-01-21  Martin Baulig  <martin@ximian.com>
8329
8330         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8331         class and namespace before looking up aliases.  Fixes #52517.
8332
8333 2004-01-21  Martin Baulig  <martin@ximian.com>
8334
8335         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8336         assinged in a 'try'; fixes exception4.cs.
8337
8338 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8339         * class.cs : Implemented parameter-less constructor for TypeContainer
8340
8341         * decl.cs: Attributes are now stored here. New property OptAttributes
8342
8343         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8344
8345         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8346
8347 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8348
8349         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8350           (CSharpSignature): New method for indexer and property signature.
8351
8352 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8353
8354         * pending.cs (IsVirtualFilter): Faster implementation.
8355
8356 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8357
8358         * typemanager.cs: Avoid inclusion of same assembly more than once.
8359
8360 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8361
8362         * cs-parser.jay: Fixed problem where the last assembly attribute
8363           has been applied also to following declaration (class, struct, etc.)
8364           
8365 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8366
8367         * class.cs: Added error CS0538, CS0539 reporting.
8368         Fixed crash on Microsoft runtime when field type is void.
8369
8370         * cs-parser.jay: Added error CS0537 reporting.
8371
8372         * pending.cs: Added error CS0535 reporting.
8373         Improved error report for errors CS0536, CS0534.
8374
8375 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8376
8377         Merge a few bits from the Anonymous Method MCS tree.
8378
8379         * statement.cs (ToplevelBlock): New class for toplevel methods,
8380         will hold anonymous methods, lifted variables.
8381
8382         * cs-parser.jay: Create toplevel blocks for delegates and for
8383         regular blocks of code. 
8384
8385 2004-01-20  Martin Baulig  <martin@ximian.com>
8386
8387         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8388         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8389         and `NeedExplicitReturn'; added `IsLastStatement'.
8390         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8391         have a `ReturnLabel' or we're not unreachable.
8392
8393         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8394         child's reachability; don't just override ours with it.  Fixes
8395         #58058 (lluis's example).
8396         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8397         InFinally(), InLoop(), InSwitch() and
8398         BreakCrossesTryCatchBoundary() methods.
8399
8400         * statement.cs (Return): Do all error checking in Resolve().
8401         Unless we are the last statement in a top-level block, always
8402         create a return label and jump to it.
8403         (Break, Continue): Do all error checking in Resolve(); also make
8404         sure we aren't leaving a `finally'.
8405         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8406         statement in a top-level block.
8407         (Block.Flags): Added `IsDestructor'.
8408         (Block.IsDestructor): New public property.
8409
8410 2004-01-20  Martin Baulig  <martin@ximian.com>
8411
8412         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8413
8414 2004-01-20  Martin Baulig  <martin@ximian.com>
8415
8416         * statement.cs (Statement.ResolveUnreachable): New public method.
8417         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8418         (Block.Resolve): Resolve unreachable statements.
8419
8420 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8421
8422         * expression.cs: We need to fix the case where we do
8423         not have a temp variable here.
8424
8425         * assign.cs: Only expression compound assignments need
8426         temporary variables.
8427
8428 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8429
8430         * flowanalysis.cs: Reduce memory allocation in a few ways:
8431           - A block with no variables should not allocate a bit
8432             vector for itself.
8433           - A method with no out parameters does not need any tracking
8434             for assignment of the parameters, so we need not allocate
8435             any data for it.
8436           - The arrays:
8437                 public readonly Type[] VariableTypes;
8438                 public readonly string[] VariableNames;
8439             Are redundant. The data is already stored in the variable
8440             map, so we need not allocate another array for it.
8441           - We need to add alot of checks for if (params | locals) == null
8442             due to the first two changes.
8443
8444 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8445
8446         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8447         implement IMemoryLocation, we store a copy on a local variable and
8448         take the address of it.  Patch from Benjamin Jemlich
8449
8450         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8451         to use a special "type_name_expression" rule which reduces the
8452         number of "QualifiedIdentifier" classes created, and instead
8453         directly creates MemberAccess expressions.
8454
8455 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8456
8457         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8458         that fixes #52853.  Null literal assignment to ValueType
8459
8460         * class.cs (MethodData.Emit): Instead of checking the name of the
8461         method to determine if its a destructor, create a new derived
8462         class from Method called Destructor, and test for that.  
8463
8464         * cs-parser.jay: Create a Destructor object instead of a Method.  
8465
8466         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8467
8468         Fixes: 52933
8469
8470 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8471
8472         * expression.cs (Binary.ResolveOperator): Perform an implicit
8473         conversion from MethodGroups to their delegate types on the
8474         Addition operation.
8475
8476         * delegate.cs: Introduce a new class DelegateCreation that is the
8477         base class for `NewDelegate' and `ImplicitDelegateCreation',
8478         factor some code in here.
8479
8480         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8481         conversion from MethodGroups to compatible delegate types. 
8482
8483         * ecore.cs (Expression.Resolve): Do not flag error 654
8484         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8485         we allow conversions from MethodGroups to delegate types now.
8486
8487         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8488         assignments in v2 either.
8489
8490 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8491
8492         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8493         static read-only fields in ctors.
8494
8495         Applied patch from Benjamin Jemlich 
8496
8497         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8498
8499 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8500
8501         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8502         here to return true, as they can be used like this:
8503
8504                 (XXX) int.MEMBER ()
8505
8506         Fixed 49836 and all the other dups
8507
8508 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8509
8510         * driver.cs: Implement /win32res and /win32icon.
8511
8512 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8513
8514         * cs-parser.jay: Add a rule to improve error handling for the
8515         common mistake of placing modifiers after the type.
8516
8517 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8518
8519         * cs-parser.jay (interface_event_declaration): Catch
8520         initialization of events on interfaces, and report cs0068
8521
8522         * cs-parser.jay (interface_event_declaration): Catch
8523         initialization of events. 
8524
8525         * ecore.cs: Better report missing constructors.
8526
8527         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8528         the error reporting done in the wrong place.  Fix.
8529
8530         * expression.cs (Binary.ResolveOperator): Catch the 
8531         operator + (E x, E y) error earlier, and later allow for implicit
8532         conversions in operator +/- (E e, U x) from U to the underlying
8533         type of E.
8534
8535         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8536         52596, if the container class is abstract, the default constructor
8537         is protected otherwise its public (before, we were always public).
8538
8539         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8540         fixed statement.
8541
8542         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8543         Jemlich that fixes bug #52597, MCS was generating invalid code for
8544         idisposable structs.   Thanks to Ben for following up with this
8545         bug as well.
8546
8547 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8548
8549         * driver.cs: Allow assemblies without code to be generated, fixes
8550         52230.
8551
8552 2004-01-07  Nick Drochak <ndrochak@gol.com>
8553
8554         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8555
8556 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8557
8558         * cs-parser.jay: Add rules to improve error reporting if fields or
8559         methods are declared at the namespace level (error 116)
8560
8561         * Add rules to catch event add/remove
8562
8563 2004-01-04  David Sheldon <dave-mono@earth.li>
8564
8565   * expression.cs: Added matching ")" to error message for 
8566   CS0077
8567
8568 2004-01-03 Todd Berman <tberman@gentoo.org>
8569
8570         * ecore.cs, attribute.cs:
8571         Applying fix from #52429.
8572
8573 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8574
8575         * ecore.cs, expression.cs, statement.cs:
8576         Total rewrite of how we handle branching. We
8577         now handle complex boolean expressions with fewer
8578         jumps. As well if (x == 0) no longer emits a ceq.
8579
8580         if (x is Foo) is much faster now, because we generate
8581         better code.
8582
8583         Overall, we get a pretty big improvement on our benchmark
8584         tests. The code we generate is smaller and more readable.
8585
8586         I did a full two-stage bootstrap. The patch was reviewed
8587         by Martin and Miguel.
8588
8589 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8590
8591         * cs-parser.jay: Make primary_expression not take a QI.
8592         we dont need this because the member_access rule covers
8593         us here. So we replace the rule with just IDENTIFIER.
8594
8595         This has two good effects. First, we remove a s/r conflict.
8596         Second, we allocate many fewer QualifiedIdentifier objects.
8597
8598 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8599
8600         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8601         set the correct information via SRE. This prevents
8602         hanging on the MS runtime. Fixes #29374.
8603
8604 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8605
8606         * convert.cs: correctly handle conversions to value types
8607         from Enum and ValueType as unboxing conversions.
8608
8609         Fixes bug #52569. Patch by Benjamin Jemlich.
8610
8611 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8612
8613         * expression.cs (BetterConversion): Prefer int -> uint
8614         over int -> ulong (csc's behaviour). This fixed bug #52046.
8615
8616 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8617
8618         * decl.cs (MemberCache.FindMembers): now returns a
8619         MemberInfo [].
8620
8621         * typemanager.cs: In general, go with with ^^.
8622         (CopyNewMethods): take an IList.
8623         (RealMemberLookup): Only allocate an arraylist
8624         if we copy from two sets of methods.
8625
8626         This change basically does two things:
8627         1) Fewer array lists allocated due to CopyNewMethods.
8628         2) the explicit cast in MemberList costed ALOT.
8629
8630 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8631
8632         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8633         a hashtable to avoid needless string allocations when an identifier is
8634         used more than once (the common case).
8635
8636 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8637
8638         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8639         is broken, it will not return anything. So, we
8640         have to use the information we have in mcs to
8641         do the task.
8642
8643         * typemanager.cs: Add a cache for GetInterfaces,
8644         since this will now be used more often (due to ^^)
8645
8646         (GetExplicitInterfaces) New method that gets the
8647         declared, not effective, interfaces on a type
8648         builder (eg, if you have interface IFoo, interface
8649         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8650         { IBar }.
8651
8652         This patch makes MCS able to bootstrap itself on
8653         Windows again.
8654
8655 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8656
8657         * expression.cs: Remove the Nop's that Miguel put
8658         in by mistake.
8659
8660 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8661
8662         * report.cs, codegen.cs: Give the real stack trace to
8663         the error when an exception is thrown.
8664
8665 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8666
8667         * decl.cs: only allocate hashtables for ifaces if 
8668         it is an iface!
8669
8670 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8671
8672         * expression.cs: fix the error from cs0121-2.cs
8673         (a parent interface has two child interfaces that
8674         have a function with the same name and 0 params
8675         and the function is called through the parent).
8676
8677 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8678
8679         * class.cs, rootcontext.cs, typmanager.cs: do not
8680         leak pointers.
8681
8682 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8683
8684         * codegen.cs: remove stack for the ec flow branching.
8685         It is already a linked list, so no need.
8686
8687 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8688
8689         * Makefile: Allow custom profiler here.
8690
8691 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8692
8693         * typemanager.cs (LookupType):
8694           - Use a static char [], because split takes
8695             a param array for args, so it was allocating
8696             every time.
8697           - Do not store true in a hashtable, it boxes.
8698
8699 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8700
8701         * flowanalysis.cs: bytify common enums.
8702
8703 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8704
8705         * modifiers.cs: Add a new set of flags for the
8706         flags allowed on explicit interface impls.
8707         * cs-parser.jay: catch the use of modifiers in
8708         interfaces correctly.
8709         * class.cs: catch private void IFoo.Blah ().
8710
8711         All related to bug #50572.
8712
8713 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8714
8715         * decl.cs: Rewrite the consistant accessability checking.
8716         Accessability is not linear, it must be implemented in
8717         a tableish way. Fixes #49704.
8718
8719 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8720
8721         * expression.cs: Handle negation in a checked context.
8722         We must use subtraction from zero. Fixes #38674.
8723
8724 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8725
8726         * class.cs: Ignore static void main in DLLs.
8727         * rootcontext.cs: Handle the target type here,
8728         since we are have to access it from class.cs
8729         * driver.cs: account for the above.
8730
8731 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8732
8733         * report.cs: Give line numbers and files if available.
8734
8735 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8736
8737         * driver.cs: Implement /addmodule.
8738
8739         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8740         ModuleBuilders.
8741
8742 2003-12-20  Martin Baulig  <martin@ximian.com>
8743
8744         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8745         (FieldBase.IsAssigned): Removed this field.
8746         (FieldBase.SetAssigned): New public method.
8747         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8748
8749 2003-12-20  Martin Baulig  <martin@ximian.com>
8750
8751         * expression.cs (LocalVariableReference.DoResolve): Don't set
8752         `vi.Used' if we're called from DoResolveLValue().
8753
8754         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8755         returns the usage vector it just merged into the current one -
8756         pass this one to UsageWarning().
8757         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8758         of the `EmitContext', don't call this recursively on our children.
8759
8760 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8761
8762         * driver.cs: Implement /target:module.
8763
8764 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8765
8766         * support.cs (CharArrayHashtable): New helper class.
8767
8768         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8769         char arrays, not strings, so we can avoid creating a string in
8770         consume_identifier if the identifier is a keyword.
8771
8772 2003-12-16  Martin Baulig  <martin@ximian.com>
8773
8774         * statement.cs (LocalInfo.Assigned): Removed this property.
8775         (LocalInfo.Flags): Removed `Assigned'.
8776         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8777         and uses flow analysis.
8778         (Block.UsageWarning): Made this method private.
8779         (Block.Resolve): Call UsageWarning() if appropriate.
8780
8781         * expression.cs (LocalVariableReference.DoResolve): Always set
8782         LocalInfo.Used here.
8783
8784 2003-12-13  Martin Baulig  <martin@ximian.com>
8785
8786         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8787         any value here; we're now using flow analysis to figure out
8788         whether a statement/block returns a value.
8789
8790 2003-12-13  Martin Baulig  <martin@ximian.com>
8791
8792         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8793         working again.
8794         (FlowBranching.MergeFinally): Don't call
8795         `branching.CheckOutParameters()' here, this is called in
8796         MergeTopBlock().
8797         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8798         when adding the `finally' vector.       
8799
8800 2003-12-13  Martin Baulig  <martin@ximian.com>
8801
8802         * flowanalysis.cs
8803         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8804         actually work and also fix #48962.
8805
8806 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8807
8808         * decl.cs: Do not check System.Object for nested types,
8809         since we know it does not have any. Big bang for buck:
8810
8811         BEFORE:
8812            Run 1:   8.35 seconds
8813            Run 2:   8.32 seconds
8814            corlib:  17.99 seconds
8815         AFTER:
8816            Run 1:   8.17 seconds
8817            Run 2:   8.17 seconds
8818            corlib:  17.39 seconds
8819
8820 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8821
8822         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8823         time we are returning 0 members, so we save alot here.
8824
8825 2003-12-11  Martin Baulig  <martin@ximian.com>
8826
8827         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8828         `MergeChild()', also just take the `FlowBranching' as argument;
8829         call Merge() on it and return the result.
8830         (FlowBranching.Merge): We don't need to do anything if we just
8831         have one sibling.
8832
8833 2003-12-11  Martin Baulig  <martin@ximian.com>
8834
8835         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8836         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8837         Maurer for this idea.
8838
8839 2003-12-11  Martin Baulig  <martin@ximian.com>
8840
8841         * flowanalysis.cs (MergeResult): This class is now gone; we now
8842         use the `UsageVector' for this.  The reason for this is that if a
8843         branching just has one sibling, we don't need to "merge" them at
8844         all - that's the next step to do.
8845         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8846         `MergeResult'.
8847
8848 2003-12-11  Martin Baulig  <martin@ximian.com>
8849
8850         Reworked flow analyis and made it more precise and bug-free.  The
8851         most important change is that we're now using a special `Reachability'
8852         class instead of having "magic" meanings of `FlowReturns'.  I'll
8853         do some more cleanups and optimizations and also add some more
8854         documentation this week.
8855
8856         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8857         largely reworked this class.
8858         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8859         the new `Reachability' class instead of having "magic" values here.
8860         (FlowBranching): We're now using an instance of `Reachability'
8861         instead of having separate `Returns', `Breaks' etc. fields.
8862
8863         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8864         based on flow analysis; ignore the return value of block.Emit ().
8865
8866 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8867
8868         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8869         if they are private.
8870
8871 2003-12-09  Martin Baulig  <martin@ximian.com>
8872
8873         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8874         call them directly on the UsageVector.
8875
8876 2003-12-09  Martin Baulig  <martin@ximian.com>
8877
8878         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8879         Changed return type from `FlowReturns' to `Reachability'.
8880
8881 2003-12-09  Martin Baulig  <martin@ximian.com>
8882
8883         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8884         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8885         `Reachable' fields with a single `Reachability' one.
8886
8887 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8888
8889         * class.cs (FindMembers): Remove foreach's.
8890
8891         Bootstrap times:
8892
8893         BEFORE
8894                 Run 1:   8.74 seconds
8895                 Run 2:   8.71 seconds
8896
8897         AFTER
8898                 Run 1:   8.64 seconds
8899                 Run 2:   8.58 seconds
8900
8901
8902 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8903
8904         * cs-parser.jay:
8905         * gen-treedump.cs:
8906         * statement.cs:
8907         This patch does a few things:
8908                 1. EmptyStatement is now a singleton, so it is never reallocated.
8909                 2. All blah is EmptyStatement constructs have been changed to
8910                    blah == EmptyStatement.Value, which is much faster and valid
8911                    now that EmptyStatement is a singleton.
8912                 3. When resolving a block, rather than allocating a new array for
8913                    the non-empty statements, empty statements are replaced with
8914                    EmptyStatement.Value
8915                 4. Some recursive functions have been made non-recursive.
8916         Mainly the performance impact is from (3), however (1) and (2) are needed for
8917         this to work. (4) does not make a big difference in normal situations, however
8918         it makes the profile look saner.
8919
8920         Bootstrap times:
8921
8922         BEFORE
8923         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8924         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8925         Total memory allocated: 56397 KB
8926
8927         AFTER
8928         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8929         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8930         Total memory allocated: 55666 KB
8931
8932 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8933
8934         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8935         than the hashtable in a hashtable version
8936
8937         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8938         we always end up concating a string. This results in a huge perf
8939         loss, because many strings have to be tracked by the GC. In this
8940         patch, we first use a hashtable that works with two keys, so that
8941         the strings do not need to be concat'ed.
8942
8943         Bootstrap times:
8944         BEFORE
8945                 Run 1:   8.74 seconds
8946                 Run 2:   8.71 seconds
8947
8948         AFTER
8949                 Run 1:   8.65 seconds
8950                 Run 2:   8.56 seconds
8951
8952 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8953
8954         * Makefile: Add a new target `do-time' that does a quick and simple
8955         profile, leaving easy to parse output.
8956
8957 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8958
8959         * codegen.cs (Init): Create the dynamic assembly with 
8960         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8961
8962 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8963
8964         * support.cs: Make the PtrHashtable use only one
8965         instance of its comparer.
8966
8967 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8968
8969         * typemanager.cs: Fix lookup of GetNamespaces.
8970
8971 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8972
8973         * expression.cs: Removed redundant line.
8974
8975         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8976         ArrayLists, use for loops with bounds.  
8977
8978         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8979         arraylist.
8980
8981         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8982         arraylists, use for loop with bounds.
8983
8984         The above three changes give us a 0.071 second performance
8985         improvement out of 3.294 seconds down to 3.223.  On my machine
8986         the above changes reduced the memory usage by 1,387 KB during
8987         compiler bootstrap.
8988
8989         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8990         QualifiedIdentifiers.  Before we created a new string through
8991         concatenation, and mostly later on, the result would be
8992         manipulated by DecomposeQI through string manipulation.
8993
8994         This reduced the compiler memory usage for bootstrapping from
8995         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8996         compile times in 0.05 seconds.
8997
8998 2003-11-28  Dick Porter  <dick@ximian.com>
8999
9000         * support.cs: Do string compares with the Invariant culture.
9001
9002         * rootcontext.cs: 
9003         * gen-treedump.cs: 
9004         * expression.cs: 
9005         * driver.cs: 
9006         * decl.cs: 
9007         * codegen.cs: 
9008         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9009         the comparison is done with the Invariant culture.
9010
9011 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9012
9013         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9014         GetEnumerator method.
9015
9016         (ProbeCollectionType): Iterate starting at the most specific type
9017         upwards looking for a GetEnumerator
9018
9019         * expression.cs: Shift count can be up to 31 for int/uint and 63
9020         for long/ulong.
9021
9022 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9023
9024         * statement.cs (Block.LookupLabel): Also look for the label on the
9025         children blocks.  Use a hash table to keep track of visited
9026         nodes. 
9027
9028         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9029         we actually did transform the other operand, otherwise fall back
9030         to the common codepath that casts to long.
9031
9032         * cs-tokenizer.cs: Use the same code pattern as the int case.
9033         Maybe I should do the parsing myself, and avoid depending on the
9034         Parse routines to get this done.
9035
9036 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9039         which fixes bug 51347.  This time test it.
9040
9041         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9042         attributes for example can not tell the difference between these.
9043         The difference was only a syntax feature of the language. 
9044
9045         * attribute.cs: Apply attributes to delegates.
9046
9047         * delegate.cs: Call the apply attributes method.
9048
9049 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9050
9051         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9052         comparing 0 vs Byte.MinValue, not the value
9053
9054         (ImplicitConversionRequired): When reporting a conversion error,
9055         use error 31 to print out the constant error instead of the
9056         simpler 29.
9057
9058         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9059         which fixes bug 51347.
9060
9061 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9062
9063         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9064         which fixes the -warnaserror command line option.
9065
9066 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9067
9068         * cfold.cs (DoNumericPromotions): During constant folding of
9069         additions on UIntConstant, special case intconstants with
9070         IntConstants like we do on the expression binary operator. 
9071
9072 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9073
9074         * convert.cs (ImplicitReferenceConversion): We were missing a case
9075         (System.Enum are not value types or class types, so we need to
9076         classify them separatedly).
9077
9078         * driver.cs: We do not support error 2007.
9079
9080 2003-11-12 Jackson Harper <jackson@ximian.com>
9081
9082         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9083         system directory. Also use the full file name so users can
9084         libraries names mscorlib-o-tron.dll in a non system dir.
9085
9086 2003-11-10  Martin Baulig  <martin@ximian.com>
9087
9088         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9089         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9090         calling `ResolveType()' on them, directly assign their `Type'.
9091
9092 2003-11-08  Martin Baulig  <martin@ximian.com>
9093
9094         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9095         return value and the `out parent' parameter.
9096         (TypeContainer.DefineType): Moved the CS0644 check into
9097         GetClassBases().  Don't pass the interface types to the
9098         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9099         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9100
9101         * ecore.cs (TypeExpr.IsAttribute): New property.
9102         (TypeExpr.GetInterfaces): New method.
9103
9104         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9105         TypeExpr instead of a Type.
9106         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9107         (Interface.DefineType): Don't pass the interface types to the
9108         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9109         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9110
9111         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9112         instead of a `Type[]'.
9113         (TypeManager.RegisterBuilder): Likewise.
9114         (TypeManager.AddUserInterface): Likewise.
9115         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9116         `Type[]' and also return a `TypeExpr[]'.
9117         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9118
9119 2003-11-08  Martin Baulig  <martin@ximian.com>
9120
9121         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9122         Expression.     
9123
9124 2003-11-08  Martin Baulig  <martin@ximian.com>
9125
9126         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9127         TypeManager.ResolveExpressionTypes().
9128
9129         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9130         instead of an Expression.
9131         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9132         (TypeExpression): New public class; formerly known as `TypeExpr'.
9133
9134         * expression.cs (ComposedCast): Derive from TypeExpr.
9135
9136         * typemanager.cs (TypeManager.system_*_expr): These are now
9137         TypExpr's instead of Expression's.
9138         (TypeManager.ResolveExpressionTypes): New public static function;
9139         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9140         of them.        
9141
9142 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9143
9144         * expression.cs (New.DoResolve): Do not dereference value that
9145         might be a null return.
9146
9147         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9148         sure that the constant value has the right type.  Fixes an
9149         unreported bug, similar to 50425.
9150
9151         * const.cs (Const.LookupConstantValue): Call
9152         ImplicitStandardConversionExists before doing a conversion to
9153         avoid havng the TypeManager.ChangeType do conversions.
9154
9155         Reduced the number of casts used
9156
9157         (Const.ChangeType): New routine to enable reuse of the constant
9158         type changing code from statement.
9159
9160         * typemanager.cs (ChangeType): Move common initialization to
9161         static global variables.
9162
9163         Fixes #50425.
9164
9165         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9166         every value type to go through, even if it was void.  Fix that. 
9167
9168         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9169         character of the define, and the is_identifier_part_character for
9170         the rest of the string.
9171
9172 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9173
9174         * expression.cs (UnaryMutator.EmitCode): When I updated
9175         LocalVariableReference.DoResolve, I overdid it, and dropped an
9176         optimization done on local variable references.
9177
9178 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9179
9180         * ecore.cs: Convert the return from Ldlen into an int.
9181
9182 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9183
9184         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9185         the accessibility, this is a special case for toplevel non-public
9186         classes (internal for instance).
9187
9188 2003-10-20  Nick Drochak <ndrochak@gol.com>
9189
9190         * ecore.cs: Fix typo and build.  Needed another right paren.
9191
9192 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9193
9194         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9195         `internal' case regular and protected, but not allowing protected
9196         to be evaluated later.  Bug 49840
9197
9198 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9199
9200         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9201         to kb.Nlast, and not the kb.nFirst to isolate the switch
9202         statement.
9203
9204         Extract the underlying type, so enumerations of long/ulong are
9205         treated like long/ulong.
9206
9207 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9208
9209         * expression.cs (New): Overload the meaning of RequestedType to
9210         track the possible creation of the NewDelegate type, since
9211         DoResolve is invoked more than once for new constructors on field
9212         initialization.
9213
9214         See bugs: #48800 and #37014
9215
9216         * cs-parser.jay (declare_local_constants): Take an arraylist
9217         instead of a single constant.
9218
9219         (local_constant_declaration): It should take a
9220         constant_declarators, not a constant_declarator.  Fixes 49487
9221
9222         * convert.cs: Fix error report.
9223
9224 2003-10-13 Jackson Harper <jackson@ximian.com>
9225
9226         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9227         bug #49611
9228
9229 2003-10-09  Martin Baulig  <martin@ximian.com>
9230
9231         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9232         to the .ctor.
9233         (MethodCore.DoDefineParameters): Removed the TypeContainer
9234         argument; use the DeclSpace which was passed to the .ctor instead.
9235         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9236         TypeContainer; we only need a DeclSpace here.
9237
9238 2003-10-09  Martin Baulig  <martin@ximian.com>
9239
9240         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9241         to the .ctor.
9242         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9243         EmitContext's .ctor.    
9244
9245 2003-10-09  Martin Baulig  <martin@ximian.com>
9246
9247         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9248         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9249         AsAccessible(), moved them as well.
9250
9251         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9252
9253 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9254
9255         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9256
9257 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9258
9259         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9260         generation for >=, as spotted by Paolo, bug 48679.  
9261         Patch from David Waite.
9262
9263         * cs-tokenizer.cs: Add handling for #pragma.
9264
9265         * cs-parser.jay: Allow for both yield and yield return in the
9266         syntax.  The anti-cobolization of C# fight will go on!
9267
9268         * class.cs (TypeBuilder.DefineType): Catch error condition here
9269         (Parent.DefineType erroring out and returning null).
9270
9271         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9272         coping with enumerations variables, we were mistakenly processing
9273         them as a regular value type instead of built-in types.  Fixes the
9274         bug #48063
9275
9276         * typemanager.cs (IsBuiltinOrEnum): New method.
9277
9278 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9279
9280         * cs-parser.jay: Upgrade: yield now needs the return clause.
9281
9282 2003-09-19  Martin Baulig  <martin@ximian.com>
9283
9284         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9285         `MemberCache parent' argument.  Normally, an interface doesn't
9286         have a parent type except System.Object, but we use this in gmcs
9287         for generic type parameters.
9288
9289 2003-09-18  Martin Baulig  <martin@ximian.com>
9290
9291         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9292         on `type.IsInterface'; don't check whether the type has a parent
9293         to determine whether it's an interface.
9294
9295 2003-09-15  Martin Baulig  <martin@ximian.com>
9296
9297         * class.cs (TypeContainer.DefineType): Added an error flag to
9298         avoid reporting duplicate CS0146's ("class definition is
9299         circular.").
9300
9301         * driver.cs (Driver.MainDriver): Abort if
9302         RootContext.ResolveTree() reported any errors.
9303
9304 2003-09-07  Martin Baulig  <martin@ximian.com>
9305
9306         * report.cs (Error, Warning): Added overloaded versions which take
9307         a `params object[] args' and call String.Format().
9308
9309 2003-09-07  Martin Baulig  <martin@ximian.com>
9310
9311         * decl.cs (DeclSpace..ctor): Don't call
9312         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9313         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9314         (DeclSpace.RecordDecl): New method.
9315
9316         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9317
9318 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9319
9320         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9321         value attributes to be applied to ParameterBuilders.
9322
9323         * class.cs (MethodCore.LabelParameters): Make static and more
9324         generic so that it can be used from other places - like interface
9325         methods, for instance.
9326
9327         * interface.cs (Interface.Emit): Call LabelParameters before
9328         emitting attributes on the InterfaceMethod.
9329
9330 2003-08-26  Martin Baulig  <martin@ximian.com>
9331
9332         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9333         resolving aliases; fixes #47927.
9334
9335 2003-08-26  Martin Baulig  <martin@ximian.com>
9336
9337         * statement.cs (Using.DoResolve): This is internally emitting a
9338         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9339         do not always return.  Fixes #47681.
9340
9341 2003-08-26  Martin Baulig  <martin@ximian.com>
9342
9343         * decl.cs (MemberCore): Moved WarningNotHiding(),
9344         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9345         into MemberBase.
9346         (AdditionResult): Make this nested in DeclSpace.
9347         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9348         argument; call NamespaceEntry.Define() unless we're nested in a
9349         class or struct.
9350
9351         * namespace.cs (Namespace.DefineName): New public function.  This
9352         is called from DeclSpace's .ctor to add 
9353         (Namespace.Lookup): Include DeclSpaces in the lookup.
9354
9355         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9356
9357         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9358
9359 2003-08-25  Martin Baulig  <martin@ximian.com>
9360
9361         * convert.cs (Convert.ExplicitReferenceConversion): When
9362         converting from an interface type to a class, unbox if the target
9363         type is a struct type.  Fixes #47822.
9364
9365 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9366
9367         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9368         #47854.
9369
9370 2003-08-22  Martin Baulig  <martin@ximian.com>
9371
9372         * class.cs (TypeManager.DefineType): When defining a nested type,
9373         call DefineType() on our parent; fixes #47801.
9374
9375 2003-08-22  Martin Baulig  <martin@ximian.com>
9376
9377         * class.cs (MethodData.Define): While checking if a method is an
9378         interface implementation, improve the test a bit more to fix #47654.
9379
9380 2003-08-22  Martin Baulig  <martin@ximian.com>
9381
9382         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9383         correctly; fixes #47722.
9384
9385 2003-08-22  Martin Baulig  <martin@ximian.com>
9386
9387         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9388         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9389
9390         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9391
9392 2003-08-22  Martin Baulig  <martin@ximian.com>
9393
9394         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9395         can only be assigned in static constructors.  Fixes #47161.
9396
9397 2003-08-22  Martin Baulig  <martin@ximian.com>
9398
9399         Rewrote and improved the flow analysis code.
9400
9401         * flowbranching.cs (FlowBranching): Make this class abstract.
9402         (FlowBranching.CreateBranching): New static function to create a
9403         new flow branching.
9404         (FlowBranchingBlock, FlowBranchingException): New classes.
9405         (FlowBranching.UsageVector.Type): New public readonly field.
9406         (FlowBranching.UsageVector.Breaks): Removed the setter.
9407         (FlowBranching.UsageVector.Returns): Removed the setter.
9408         (FlowBranching.UsageVector): Added Break(), Return(),
9409         NeverReachable() and Throw() methods to modify the reachability.
9410         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9411         done by FlowBranching.Merge().
9412         (FlowBranching.UsageVector.MergeChild): New method; merges the
9413         merge result into the current vector.
9414         (FlowBranching.Merge): New abstract method to merge a branching.
9415
9416 2003-08-12  Martin Baulig  <martin@ximian.com>
9417
9418         * expression.cs (Indirection.CacheTemporaries): Create the
9419         LocalTemporary with the pointer type, not its element type.
9420
9421 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9422
9423         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9424         token was a keyword or not.
9425
9426         Add `error' options where an IDENTIFIER was expected;  Provide
9427         CheckToken and CheckIdentifierToken convenience error reporting
9428         functions. 
9429
9430         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9431
9432         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9433         NameSpaceEntry NameSpaceEntry.
9434
9435         (LookupInterfaceOrClass): Avoid creating a full qualified name
9436         from namespace and name: avoid doing lookups when we know the
9437         namespace is non-existant.   Use new Tree.LookupByNamespace which
9438         looks up DeclSpaces based on their namespace, name pair.
9439
9440         * driver.cs: Provide a new `parser verbose' to display the
9441         exception thrown during parsing.  This is turned off by default
9442         now, so the output of a failure from mcs is more graceful.
9443
9444         * namespace.cs: Track all the namespaces defined in a hashtable
9445         for quick lookup.
9446
9447         (IsNamespace): New method
9448
9449 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9450
9451         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9452         we know that we need to concatenate (full typename can never be
9453         null). 
9454
9455         * class.cs: ditto.
9456
9457         * statement.cs: Use a bitfield;  Do not initialize to null things
9458         which are done by the constructor by default.
9459
9460         * cs-parser.jay: bug fix, parameter was 4, not 3.
9461
9462         * expression.cs: Just use the property;
9463
9464         * statement.cs: No need for GetVariableInfo method.
9465
9466 2003-08-08  Martin Baulig  <martin@ximian.com>
9467
9468         * flowanalysis.cs (FlowReturns): This is now nested in the
9469         `FlowBranching' class.
9470         (MyBitVector): Moved this here from statement.cs.
9471         (FlowBranching.SiblingType): New enum type.
9472         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9473
9474 2003-08-07  Martin Baulig  <martin@ximian.com>
9475
9476         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9477         `FlowBranching' class and called `BranchingType'.
9478
9479 2003-08-07  Martin Baulig  <martin@ximian.com>
9480
9481         * flowanalysis.cs: Moved all the control flow analysis code into
9482         its own file.
9483
9484 2003-08-07  Martin Baulig  <martin@ximian.com>
9485
9486         * assign.cs (Assign.DoResolve): `target' must either be an
9487         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9488         #37319.
9489
9490 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9491
9492         * expression.cs (BinaryMethod): This kind of expression is created by the
9493         Binary class if it determines that the operator has to be handled
9494         by a method.
9495
9496         (BinaryDelegate): This kind of expression is created if we are
9497         dealing with a + or - operator on delegates.
9498
9499         (Binary): remove method, argumetns, and DelegateOperator: when
9500         dealing with methods, 
9501
9502         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9503
9504         * statement.cs (Block): use bitfields for the three extra booleans
9505         we had in use.   Remove unused topblock parameter.
9506
9507         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9508
9509         * assign.cs: Drop extra unneeded tests.
9510
9511 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9512
9513         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9514
9515         * statement.cs (Foreach): Use VariableStorage instead of
9516         LocalBuilders.   
9517
9518         * codegen.cs (VariableStorage): New class used by clients that
9519         require a variable stored: locals or fields for variables that
9520         need to live across yield.
9521
9522         Maybe provide a convenience api for EmitThis+EmitLoad?
9523
9524         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9525         these bad boys.
9526
9527 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9528
9529         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9530         RemapParameterLValue): New methods that are used to turn a
9531         precomputed FieldInfo into an expression like this:
9532
9533                 instance.FieldInfo
9534
9535         The idea is to use this instead of making LocalVariableReference
9536         have more than one meaning.
9537
9538         * cs-parser.jay: Add error production to BASE.
9539
9540         * ecore.cs: Deal with TypeManager.GetField returning null, which
9541         is now a valid return value.
9542
9543         (FieldExprNoAddress): New expression for Fields whose address can
9544         not be taken.
9545
9546         * expression.cs (LocalVariableReference): During the resolve
9547         phases, create new expressions if we are in a remapping context.
9548         Remove code that dealt with remapping here.
9549
9550         (ParameterReference): same.
9551
9552         (ProxyInstance): New expression, like the `This' expression, but
9553         it is born fully resolved.  We know what we are doing, so remove
9554         the errors that are targeted to user-provided uses of `this'.
9555
9556         * statement.cs (Foreach): our variable is now stored as an
9557         Expression;  During resolution, follow the protocol, dont just
9558         assume it will return this.
9559
9560 2003-08-06  Martin Baulig  <martin@ximian.com>
9561
9562         * support.cs (SeekableStreamReader.cs): New public class.
9563
9564         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9565         SeekableStreamReader instead of the normal StreamReader.
9566
9567 2003-08-04  Martin Baulig  <martin@ximian.com>
9568
9569         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9570         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9571         deambiguate casts and delegate invocations.
9572         (parenthesized_expression): Use the new tokens to ensure this is
9573         not a cast of method invocation.
9574
9575         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9576         when reading a `)' and Deambiguate_CloseParens () was previously
9577         called.
9578
9579         * expression.cs (ParenthesizedExpression): New class.  This is
9580         just used for the CS0075 test.
9581         (Binary.DoResolve): Check for CS0075.   
9582
9583 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9584
9585         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9586         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9587         reference comparison.
9588
9589         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9590         examine the ReturnType for equality - this is necessary in the
9591         cases of implicit and explicit operators whose signature also
9592         includes the return type.
9593
9594 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9595
9596         * namespace.cs: Cache the result of the namespace computation,
9597         instead of computing it every time.
9598
9599 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9600
9601         * decl.cs: Use a global arraylist that we reuse over invocations
9602         to avoid excesive memory consumption.  Reduces memory usage on an
9603         mcs compile by one meg (45 average).
9604
9605         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9606         private, work around that.
9607
9608 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * literal.cs (IntLiteral): Define Zero and One static literals. 
9611
9612         * cs-parser.jay (integer_literal): use static literals to reduce
9613         memory usage for the most used literals (0, 1 and -1).  211kb
9614         reduced in memory usage.
9615
9616         Replace all calls to `new ArrayList' with `new
9617         ArrayList(4)' which is a good average number for most allocations,
9618         and also requires only 16 bytes of memory for its buffer by
9619         default. 
9620
9621         This reduced MCS memory usage in seven megabytes for the RSS after
9622         bootstrapping.
9623
9624 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9625
9626         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9627         handle params methods the correct way by forming only one
9628         applicable set with params and normal methods in them. Earlier we
9629         were looking at params methods only if we found no normal methods
9630         which was not the correct thing to do.
9631
9632         (Invocation.BetterFunction): Take separate arguments indicating
9633         when candidate and the best method are params methods in their
9634         expanded form.
9635
9636         This fixes bugs #43367 and #46199.
9637
9638         * attribute.cs: Documentation updates.
9639
9640         (CheckAttribute): Rename to CheckAttributeTarget.
9641         (GetValidPlaces): Rename to GetValidTargets.
9642
9643         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9644         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9645
9646         Fixes bug #44468.
9647
9648 2003-07-28  Martin Baulig  <martin@ximian.com>
9649
9650         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9651         name when looking up the base class of a nested class.  Fixes #46977.
9652
9653 2003-07-26  Martin Baulig  <martin@ximian.com>
9654
9655         * expression.cs (Indexers.Indexer): New nested struct; contains
9656         getter, setter and the indexer's type.
9657         (Indexers.Properties): This is now an ArrayList of
9658         Indexers.Indexer's.
9659         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9660         indexer doesn't have any getters.
9661
9662         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9663         for embedded property and indexer assignments.
9664
9665 2003-07-26  Martin Baulig  <martin@ximian.com>
9666
9667         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9668         preprocessor directive is not the first non-whitespace character
9669         on a line.
9670
9671 2003-07-26  Martin Baulig  <martin@ximian.com>
9672
9673         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9674         namespace parsing, follow the spec more closely.
9675
9676         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9677         NamespaceEntry.Lookup().
9678
9679 2003-07-25  Martin Baulig  <martin@ximian.com>
9680
9681         * MethodCore.cs (OverridesSomething): New public field; it's set
9682         from TypeContainer.DefineMembers if this method overrides
9683         something (which doesn't need to be a method).  Fix #39462.
9684
9685 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9686
9687         * typemanager.cs (GetMembers): Ensure that the list of members is
9688         reversed. This keeps things in sync.
9689
9690         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9691         find an AttributeUsage attribute.
9692
9693         * expression.cs (Invocation.OverloadResolve): Perform the check
9694         which disallows Invoke to be directly called on a Delegate.
9695
9696         (Error_InvokeOnDelegate): Report error cs1533.
9697
9698 2003-07-25  Martin Baulig  <martin@ximian.com>
9699
9700         * expression.cs (Indexers.GetIndexersForType): Only look in the
9701         interface hierarchy if the requested type is already an
9702         interface.  Fixes #46788 while keeping #46502 fixed.
9703
9704 2003-07-25  Martin Baulig  <martin@ximian.com>
9705
9706         * class.cs (TypeContainer.DefineMembers): Check whether all
9707         readonly fields have been assigned and report warning CS0649 if
9708         not.
9709
9710         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9711         a valuetype.
9712
9713 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9714
9715         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9716         returned from GetMethods to make things consistent with the
9717         assumptions MCS makes about ordering of methods.
9718
9719         This should comprehensively fix bug #45127 and it does :-)
9720
9721         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9722         ordering is actually reverse.
9723
9724         * Clean up some debug messages I left lying around.
9725
9726         * interface.cs (Populate*): Get rid of code which emits attributes
9727         since the stage in which we emit attributes is the 'Emit' stage,
9728         not the define stage.
9729
9730         (Emit): Move attribute emission for interface members here.
9731
9732 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9733
9734         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9735         closely: we eliminate methods in base types when we have an
9736         applicable method in a top-level type.
9737
9738         Please see section 14.5.5.1 for an exact description of what goes
9739         on. 
9740
9741         This fixes bug #45127 and a host of other related to corlib compilation.
9742
9743         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9744         array is the method corresponding to the top-level type (this is
9745         because of the changes made to icall.c) so we change this
9746         accordingly.
9747
9748         (MethodGroupExpr.Name): This too.
9749
9750         * typemanager.cs (GetElementType): New method which does the right
9751         thing when compiling corlib. 
9752
9753         * everywhere: Make use of the above in the relevant places.
9754
9755 2003-07-22  Martin Baulig  <martin@ximian.com>
9756
9757         * cs-parser.jay (invocation_expression): Moved
9758         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9759         `cast_expression', but create a InvocationOrCast which later
9760         resolves to either an Invocation or a Cast.
9761
9762         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9763         method; call this before EmitStatement() to make sure that this
9764         expression can be used as a statement.
9765
9766         * expression.cs (InvocationOrCast): New class; resolves to either
9767         an Invocation or a Cast.
9768
9769         * statement.cs (StatementExpression): Call ResolveStatement() on
9770         the ExpressionStatement before emitting it.
9771
9772 2003-07-21  Martin Baulig  <martin@ximian.com>
9773
9774         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9775         `ref' and `out' attributes match; fixes #46220.
9776         (MemberAccess.ResolveMemberAccess): You can't reference a type
9777         through an expression; fixes #33180.
9778         (Indexers.GetIndexersForType): Don't return the indexers from
9779         interfaces the class implements; fixes #46502.
9780
9781 2003-07-21  Martin Baulig  <martin@ximian.com>
9782
9783         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9784         CS0661 checks; fixes bug #30442.
9785
9786 2003-07-21  Martin Baulig  <martin@ximian.com>
9787
9788         * decl.cs (AdditionResult): Added `Error'.
9789
9790         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9791
9792         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9793         makes cs0031.cs actually work.
9794
9795 2003-07-20  Martin Baulig  <martin@ximian.com>
9796
9797         * namespace.cs: Fixed that bug which caused a crash when compiling
9798         the debugger's GUI.
9799
9800 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9801
9802         * typemanager.cs (LookupTypeReflection): Never expose types which
9803         are NotPublic, NestedPrivate, NestedAssembly, or
9804         NestedFamANDAssem.  We used to return these, and later do a check
9805         that would report a meaningful error, but the problem is that we
9806         would not get the real match, if there was a name override.
9807
9808 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9809
9810         * namespace.cs (Namespace, Name): Do not compute the namespace
9811         name dynamically, compute it in the constructor.  This reduced
9812         memory usage by 1697 KB.
9813
9814         * driver.cs: Use --pause to pause at the end.
9815
9816 2003-07-17  Peter Williams  <peter@newton.cx>
9817
9818         * Makefile: Change the name of the test target so that it doesn't
9819         conflict with the recursive test target.
9820
9821 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9822
9823         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9824         AddressOf): Do not use EmitThis, that was wrong, use the actual
9825         this pointer.
9826
9827 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * class.cs (MethodData.Define): While checking if a method is an
9830         interface implementation, improve the test: If we are not public
9831         (use new test here: use the computed MethodAttributes directly,
9832         instead of the parsed modifier flags) check if the `implementing'
9833         method comes from an interface or not.
9834
9835         * pending.cs (VerifyPendingMethods): Slightly better error
9836         message.
9837
9838         * makefile: add test target that does the mcs bootstrap.
9839
9840 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9841
9842         * interface.cs (Define): Do nothing here since there are no
9843         members to populate etc. Move the attribute emission out of here
9844         since this was just totally the wrong place to put it. Attribute
9845         application happens during the 'Emit' phase, not in the 'Define'
9846         phase.
9847
9848         (Emit): Add this method and move the attribute emission here
9849
9850         * rootcontext.cs (EmitCode): Call the Emit method on interface
9851         types too.
9852
9853 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9854
9855         * expression.cs (OverloadResolve): Report error only if Location
9856         is not 'Null' which means that there was a probe going on.
9857
9858 2003-07-14  Martin Baulig  <martin@ximian.com>
9859
9860         * expression.cs (ConditionalLogicalOperator): New public class to
9861         implement user defined conditional logical operators.
9862         This is section 14.11.2 in the spec and bug #40505.
9863
9864 2003-07-14  Martin Baulig  <martin@ximian.com>
9865
9866         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9867
9868 2003-07-14  Martin Baulig  <martin@ximian.com>
9869
9870         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9871
9872         * ecore.cs (IVariable.VerifyFixed): New interface method.
9873
9874         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9875         operator, check whether the variable is actually fixed.  Fixes bug
9876         #36055.  Set a variable definitely assigned when taking its
9877         address as required by the spec.
9878
9879         * statement.cs (LocalInfo.IsFixed): New field.
9880         (LocalInfo.MakePinned): Set `IsFixed' to true.
9881
9882 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9883
9884         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9885         for .ctors, ensure that we only ask for members declared in the
9886         attribute type (BindingFlags.DeclaredOnly).
9887
9888         Fixes bug #43632.
9889
9890         * expression.cs (Error_WrongNumArguments): Report error 1501
9891         correctly the way CSC does.
9892
9893 2003-07-13  Martin Baulig  <martin@ximian.com>
9894
9895         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9896         lookup on the fully qualified name, to make things like "X.X" work
9897         where "X.X" is a fully qualified type name, but we also have a
9898         namespace "X" in the using list.  Fixes #41975.
9899
9900 2003-07-13  Martin Baulig  <martin@ximian.com>
9901
9902         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9903         function. If we're a CompoundAssign, we need to create an embedded
9904         CompoundAssign, not an embedded Assign.
9905         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9906         Fixes #45854.
9907
9908 2003-07-13  Martin Baulig  <martin@ximian.com>
9909
9910         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9911         work to fix bug #46088.
9912
9913 2003-07-13  Ravi Pratap <ravi@ximian.com>
9914
9915         * class.cs (Operator.Emit): Do not emit attributes here - it is
9916         taken care of by the Method class that we delegate too. This takes
9917         care of bug #45876.
9918
9919 2003-07-10  Martin Baulig  <martin@ximian.com>
9920
9921         * expression.cs (TypeOfVoid): New class.
9922         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9923
9924 2003-07-10  Martin Baulig  <martin@ximian.com>
9925
9926         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9927         bug #35957.
9928
9929 2003-07-10  Martin Baulig  <martin@ximian.com>
9930
9931         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9932         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9933
9934         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9935
9936         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9937
9938 2003-07-10  Martin Baulig  <martin@ximian.com>
9939
9940         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9941         of decimal.  Fixes #42850.
9942
9943         NOTE: I also fixed the created byte blob, but this doesn't work on
9944         the MS runtime and csc never produces any byte blobs for decimal
9945         arrays.
9946
9947 2003-07-10  Martin Baulig  <martin@ximian.com>
9948
9949         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9950         structs; fixes #32068.
9951         (Block.AddChildVariableNames): Fixed #44302.
9952
9953 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9954
9955         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9956
9957 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9958
9959         * attribute.cs: And this test is onger needed.
9960
9961 2003-07-08  Martin Baulig  <martin@ximian.com>
9962
9963         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9964         inaccessible types.  Fixes #36313.
9965
9966         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9967
9968         * namespace.cs (NamespaceEntry): Create implicit entries for all
9969         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9970         implicit entries for N1.N2 and N1.
9971
9972 2003-07-08  Martin Baulig  <martin@ximian.com>
9973
9974         Rewrote the handling of namespaces to fix a lot of the issues
9975         wrt. `using' aliases etc.
9976
9977         * namespace.cs (Namespace): Splitted this class into a
9978         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9979
9980         * typemanager.cs (TypeManager.IsNamespace): Removed.
9981         (TypeManager.ComputeNamespaces): Only compute namespaces from
9982         loaded assemblies here, not the namespaces from the assembly we're
9983         currently compiling.
9984
9985 2003-07-08  Martin Baulig  <martin@ximian.com>
9986
9987         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9988
9989 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9990
9991         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9992         already fixed it.  
9993
9994         I thought about the memory savings here, but LookupTypeReflection
9995         is used under already very constrained scenarios.  Compiling
9996         corlib or mcs only exposes one hit, so it would not really reduce
9997         any memory consumption.
9998
9999 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10000
10001         * typemanager.cs: fixes bug #45889 by only adding public types from
10002         other assemblies to the list of known types.
10003
10004 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10005
10006         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10007         on the type we resolved.
10008
10009 2003-07-05  Martin Baulig  <martin@ximian.com>
10010
10011         * pending.cs (PendingImplementation.ParentImplements): Don't
10012         create the proxy if the parent is abstract.
10013
10014         * class.cs (TypeContainer.DefineIndexers): Process explicit
10015         interface implementations first.  Fixes #37714.
10016
10017 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10018
10019         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10020         defined recursively;  but since we modify the input parameters
10021         (left is set to `this' temporarily), we reset this value if the
10022         left_is_explicit is false, which gives the original semantics to
10023         the code.  
10024
10025         * literal.cs (NullPointer): new class used to represent a null
10026         literal in a pointer context.
10027
10028         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10029         type is a pointer, use a NullPointer object instead of a
10030         NullLiteral.   Closes 43687
10031
10032         (ExplicitConversion): Convert pointer values using
10033         the conv opcode to the proper type.
10034
10035         * ecore.cs (New): change ValueTypeVariable property into a method,
10036         that returns whether the valuetype is suitable for being used.
10037
10038         * expression.cs (Binary.DoNumericPromotions): Only return if we
10039         the int constant was a valid uint, and we can return both left and
10040         right as uints.  If not, we continue processing, to trigger the
10041         type conversion.  This fixes 39018.
10042
10043         * statement.cs (Block.EmitMeta): During constant resolution, set
10044         the CurrentBlock property on the emitcontext, so that we resolve
10045         constants propertly.
10046
10047 2003-07-02  Martin Baulig  <martin@ximian.com>
10048
10049         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10050         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10051
10052         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10053         than emitting it here.
10054
10055         * statement.cs: Fixed some more flow analysis bugs.
10056
10057 2003-07-02  Martin Baulig  <martin@ximian.com>
10058
10059         * class.cs (MethodData.Define): When implementing interface
10060         methods, set Final unless we're Virtual.
10061
10062         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10063         check work for interface methods.
10064
10065 2003-07-01  Martin Baulig  <martin@ximian.com>
10066
10067         * ecore.cs (EmitContext.This): Replaced this property with a
10068         GetThis() method which takes a Location argument.  This ensures
10069         that we get the correct error location for a CS0188.
10070
10071 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10072
10073         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10074         ImplicitStandardConversion.
10075
10076         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10077
10078 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10079
10080         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10081         optimization.
10082
10083 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10084
10085         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10086         constructors.
10087
10088         (MethodData.Define): Turn off initlocals for unsafe methods.
10089
10090 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10091
10092         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10093         complete;  Fixes #37521.
10094
10095         * delegate.cs: Use Modifiers.TypeAttr to compute the
10096         TypeAttributes, instead of rolling our own.  This makes the flags
10097         correct for the delegates.
10098
10099 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10100
10101         * class.cs (Constructor.Define): Set the private flag for static
10102         constructors as well.
10103
10104         * cs-parser.jay (statement_expression): Set the return value to
10105         null, to avoid a crash when we catch an error.
10106
10107 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * cs-parser.jay: Applied patch from Jackson that adds support for
10110         extern and unsafe modifiers to destructor declarations.
10111
10112         * expression.cs: Report error 21 if the user is trying to index a
10113         System.Array.
10114
10115         * driver.cs: Add an error message, suggested by the bug report.
10116
10117         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10118         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10119
10120 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10121
10122         * namespace.cs: Add some information to reduce FAQs.
10123
10124 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10125
10126         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10127         underlying enumeration types.  Fixes #43915.
10128
10129         * expression.cs: Treat ushort/short as legal values to be used in
10130         bitwise operations.
10131
10132 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10133
10134         * delegate.cs: transfer custom attributes for paramenters from
10135         the delegate declaration to Invoke and BeginInvoke.
10136
10137 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10138
10139         * attribute.cs: handle custom marshalers and emit marshal info
10140         for fields, too.
10141
10142 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10143
10144         * makefile.gnu: Added anonymous.cs to the compiler sources.
10145
10146 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10147
10148         * iterators.cs: Change the name of the proxy class to include two
10149         underscores.
10150
10151         * cs-parser.jay: Update grammar to include anonymous methods.
10152
10153         * anonymous.cs: new file.
10154
10155 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * class.cs (Field.Define): Add missing test for pointers and
10158         safety. 
10159
10160 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10161
10162         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10163         we use the stobj opcode.
10164
10165         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10166         since it wasn't the correct fix. 
10167
10168         It still is puzzling that we are required to use stobj for IntPtr
10169         which seems to be a ValueType.
10170
10171 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10172
10173         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10174         during regular simple name resolution.   Now, the trick is that
10175         instead of returning for processing the simplename, we do a
10176         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10177         contextual lookup type).   If a match is found, return that, if
10178         not, return for further composition.
10179
10180         This fixes long-standing 30485.
10181
10182         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10183         using the address to initialize an object, do an Stobj instead of
10184         using the regular Stelem.
10185
10186         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10187         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10188         Because if we are a BaseIndexerAccess that value will be true.
10189         Fixes 43643.
10190
10191         * statement.cs (GotoCase.Resolve): Return after reporting an
10192         error, do not attempt to continue. 
10193
10194         * expression.cs (PointerArithmetic.Emit): If our operand is a
10195         long, convert our constants to match the operand before
10196         multiplying.  Convert to I type before adding.   Fixes 43670.
10197
10198 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10199
10200         * enum.cs (ImplicitConversionExists) : Rename to
10201         ImplicitEnumConversionExists to remove ambiguity. 
10202
10203         * ecore.cs (NullCast): New type of cast expression class which
10204         basically is very similar to EmptyCast with the difference being
10205         it still is a constant since it is used only to cast a null to
10206         something else
10207         (eg. (string) null)
10208
10209         * convert.cs (ImplicitReferenceConversion): When casting a null
10210         literal, we return a NullCast.
10211
10212         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10213         should be around anymore.
10214
10215         The renaming (reported was slightly wrong). Corrections:
10216
10217         ConvertImplicitStandard -> ImplicitConversionStandard
10218         ConvertExplicitStandard -> ExplicitConversionStandard
10219
10220         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10221         before passing them in !
10222
10223         * convert.cs (ImplicitConversionStandard): When comparing for
10224         equal expr and target types, ensure that expr is not a
10225         NullLiteral.
10226
10227         In general, we must not be checking (expr_type ==
10228         target_type) in the top level conversion methods
10229         (ImplicitConversion, ExplicitConversion etc). This checking is
10230         done in the methods that they delegate to.
10231
10232 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10233
10234         * convert.cs: Move Error_CannotConvertType,
10235         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10236         ImplicitNumericConversion, ImplicitConversionExists,
10237         ImplicitUserConversionExists, StandardConversionExists,
10238         FindMostEncompassedType, FindMostSpecificSource,
10239         FindMostSpecificTarget, ImplicitUserConversion,
10240         ExplicitUserConversion, GetConversionOperators,
10241         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10242         TryImplicitIntConversion, Error_CannotConvertImplicit,
10243         ConvertImplicitRequired, ConvertNumericExplicit,
10244         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10245         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10246         its own file.
10247
10248         Perform the following renames:
10249
10250         StandardConversionExists -> ImplicitStandardConversionExists
10251         ConvertImplicit -> ImplicitConversion
10252         ConvertImplicitStandard -> ImplicitStandardConversion
10253         TryImplicitIntConversion -> ImplicitIntConversion
10254         ConvertImplicitRequired -> ImplicitConversionRequired
10255         ConvertNumericExplicit -> ExplicitNumericConversion
10256         ConvertReferenceExplicit -> ExplicitReferenceConversion
10257         ConvertExplicit -> ExplicitConversion
10258         ConvertExplicitStandard -> ExplicitStandardConversion
10259
10260 2003-05-19  Martin Baulig  <martin@ximian.com>
10261
10262         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10263         (TypeInfo): Added support for structs having structs as fields.
10264
10265         * ecore.cs (FieldExpr): Implement IVariable.
10266         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10267         VariableInfo for the field.
10268
10269 2003-05-18  Martin Baulig  <martin@ximian.com>
10270
10271         * expression.cs (This.DoResolve): Report a CS0027 if we're
10272         emitting a field initializer.
10273
10274 2003-05-18  Martin Baulig  <martin@ximian.com>
10275
10276         * expression.cs (This.ResolveBase): New public function.
10277         (This.DoResolve): Check for CS0188.
10278
10279         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10280         This.Resolve().
10281
10282         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10283         `instance_expression' to null if we don't have any non-static
10284         methods.
10285
10286 2003-05-18  Martin Baulig  <martin@ximian.com>
10287
10288         Reworked the way how local variables and parameters are handled by
10289         the flow analysis code.
10290
10291         * statement.cs (TypeInfo, VariableMap): New public classes.
10292         (VariableInfo): New public class.  This is now responsible for
10293         checking whether a variable has been assigned.  It is used for
10294         parameters and local variables.
10295         (Block.EmitMeta): Take the InternalParameters as argument; compute
10296         the layout of the flow vectors here.
10297         (Block.LocalMap, Block.ParameterMap): New public properties.
10298         (FlowBranching): The .ctor doesn't get the InternalParameters
10299         anymore since Block.EmitMeta() now computes the layout of the flow
10300         vector.
10301         (MyStructInfo): This class is now known as `StructInfo' and nested
10302         in `TypeInfo'; we don't access this directly anymore.
10303
10304         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10305         property and removed IsAssigned(), IsFieldAssigned(),
10306         SetAssigned() and SetFieldAssigned(); we now call them on the
10307         VariableInfo so we don't need to duplicate this code everywhere.
10308
10309         * expression.cs (ParameterReference): Added `Block block' argument
10310         to the .ctor.
10311         (LocalVariableReference, ParameterReference, This): The new
10312         VariableInfo class is now responsible for all the definite
10313         assignment stuff.
10314
10315         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10316         IsParameterAssigned, SetParameterAssigned): Removed.
10317
10318 2003-05-18  Martin Baulig  <martin@ximian.com>
10319
10320         * typemanager.cs (InitCoreTypes): Try calling
10321         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10322         the 3-args-version.  Corlib now also needs our `void_type'.
10323         (GetMethod): Added overloaded version which takes an optional
10324         `bool report_errors' to allow lookups of optional methods.
10325
10326 2003-05-12  Martin Baulig  <martin@ximian.com>
10327
10328         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10329         only used for locals and not for parameters.
10330
10331 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10332
10333         * support.cs (InternalParameters.ParameterType): Return the
10334         ExternalType of the parameter.
10335
10336         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10337         they were unused.
10338
10339 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10340
10341         * class.cs (MethodData.Define): Do not set the `newslot' on
10342         interface members, if they are also flagged as "override".
10343
10344         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10345         better code for ++i and i++.  This only works for static fields
10346         and local variables.
10347
10348         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10349         want to pull the DeclSpace out of the builder_to_declspace instead
10350         of the TypeBuilder (like in TypeContainer.FindMembers).
10351
10352         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10353         instead of LookupTypeContainer.  Fixes the crash on .NET for
10354         looking up interface members.
10355
10356         * const.cs: Create our own emit context during the Definition
10357         stage, so that constants are evaluated in the proper context, when
10358         a recursive definition happens.
10359
10360 2003-05-11  Martin Baulig  <martin@ximian.com>
10361
10362         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10363         new block for a switch section.
10364         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10365         the adding/lookup in the switch block.  Fixes #39828.
10366
10367 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10368
10369         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10370         functionality: I needed to convert the data after I had performed
10371         the add/sub operation into the operands type size.
10372
10373         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10374         pass the type for the box operation, otherwise the resulting
10375         object would have been of type object.
10376
10377         (BoxedCast): Add constructor to specify the type to box as.
10378
10379 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10380
10381         * iterators.cs: I was reusing the `count' variable inadvertently,
10382         take steps to not allow this to happen.
10383
10384 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10385
10386         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10387         by creating an array at the point where the params starts and
10388         putting all those arguments there, then adjusting the size of the
10389         array.
10390
10391 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10392
10393         * expression.cs (New.AddressOf): Implement interface
10394         IMemoryLocation.  This is used when the `new' operator is used in
10395         the context of an invocation to a method on a value type.
10396
10397         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10398         example. 
10399
10400         * namespace.cs: Also check the using aliases here.
10401
10402         * driver.cs: Move the test for using validity after the types have
10403         been entered, so we do a single pass that also includes the using
10404         aliases. 
10405
10406         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10407         in the regular case.   CreateSiblingForFinally is doing extra
10408         error checking.
10409
10410         * attribute.cs (GetAttributeArgumentExpression): Store the result
10411         on an out value, and use the return value to indicate failure
10412         instead of using null (which is a valid return for Constant.GetValue).
10413
10414         * statement.cs: Perform the analysis flow for the increment
10415         portion after the statement, because this will be the real flow of
10416         execution.  Fixes #42385
10417
10418         * codegen.cs (EmitContext.EmitArgument,
10419         EmitContext.EmitStoreArgument): New helper functions when the
10420         RemapToProxy flag is set.
10421
10422         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10423         function.
10424
10425         Add support for remapping parameters. 
10426
10427         * iterators.cs: Propagate parameter values;  Store parameter
10428         values in the proxy classes.
10429
10430 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10431
10432         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10433         need a proxy reference;  I do not know what I was thinking
10434
10435         * cs-parser.jay (constructor_initializer): catch another error,
10436         and display nice message.
10437
10438         (field_declaration): catch void field declaration
10439         to flag a better error. 
10440
10441         * class.cs (MemberBase.CheckBase): Report an error instead of a
10442         warning if a new protected member is declared in a struct. 
10443         (Field.Define): catch the error of readonly/volatile.
10444
10445         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10446
10447         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10448         volatile variable is taken
10449
10450 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * statement.cs (Fixed.Resolve): Report an error if we are not in
10453         an unsafe context.
10454
10455 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10456
10457         * typemanager.cs: reuse the code that handles type clashes for
10458         delegates and enumerations.
10459
10460         * class.cs (Report28): Always report.
10461
10462         * expression.cs (EncodeAsAttribute): Allow nulls here.
10463
10464 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10465
10466         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10467         the functionality for testing whether an expression is valid for
10468         an attribute here.  Also handle the case of arrays of elements
10469         being stored. 
10470
10471         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10472         encoding a linear array into an array of objects that are suitable
10473         to be passed to an CustomAttributeBuilder.
10474
10475         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10476
10477         * ecore.cs: (FieldExpr): Handle field remapping here.
10478
10479         * iteratators.cs: Pass the instance variable (if the method is an
10480         instance method) to the constructors, so we can access the field
10481         variables on the class.
10482
10483         TODO: Test this with structs.  I think the THIS variable on
10484         structs might have to be a pointer, and not a refenrece
10485
10486 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10487
10488         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10489         local variables to fields in a proxy class.
10490
10491         * iterators.cs (PopulateProxy): Rename our internal fields to
10492         <XXX>.  
10493         Create a <THIS> field if we are an instance method, so we can
10494         reference our parent container variables.
10495         (MapVariable): Called back from the EmitContext code to enter a
10496         new variable to field mapping into the proxy class (we just create
10497         a FieldBuilder).
10498
10499         * expression.cs
10500         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10501         for using the remapped locals to fields.
10502
10503         I placed the code here, because that gives the same semantics to
10504         local variables, and only changes the Emit code.
10505
10506         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10507         statements inside iterators.
10508         (VariableInfo): Add a FieldBuilder for the cases when we are
10509         remapping local variables to fields in a proxy class
10510
10511         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10512         current_block != null.
10513
10514         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10515         not cope with strings, as it has been moved to the
10516         TableSwitchEmit.  Fixed bug in switch generation.
10517
10518         * expression.cs (New.DoResolve): Provide more context for the user
10519         when reporting an error.
10520
10521         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10522         pointers. 
10523
10524         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10525         check the permissions for it.  Note than in a type-resolution
10526         context the check was already present in DeclSpace.ResolveType,
10527         but was missing from the MemberAccess.
10528
10529         (ArrayCreation.CheckIndices): warn if the user has
10530         more nested levels of expressions, but there are no more
10531         dimensions specified.  Avoids crash on bug 41906.
10532
10533 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10534
10535         * statement.cs (Block): replace Implicit bool, for a generic
10536         flags.   
10537         New flag: `Unchecked'.  This is used during the EmitMeta phase
10538         (which is out-of-line with the regular Resolve/Emit process for a
10539         statement, as this is done ahead of time, but still gets a chance
10540         to call constant resolve).
10541
10542         (Block.Flags): new enum for adding a new flag.
10543
10544         (Block.EmitMeta): track the state of unchecked.
10545
10546         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10547         to enable constant resolution to work there as well.
10548
10549 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10550
10551         * typemanager.cs (ienumerable_type): Also look up
10552         System.Collections.IEnumerable. 
10553
10554 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10555
10556         TODO: Test more than one conditional per method.
10557
10558         * class.cs (Indexer.Define): Report the location where the user is
10559         referencing the unsupported feature.
10560
10561         (MethodData): Overload the use of `conditionals' to
10562         minimize the creation of needless ArrayLists.   This saves roughly
10563         212kb on my machine.
10564
10565         (Method): Implement the new IIteratorContainer interface.
10566         (Method.SetYields): Implement the method by setting the ModFlags
10567         to contain METHOD_YIELDS.
10568
10569         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10570         which just got set to null.
10571
10572         * iterators.cs: New file.
10573
10574         (Yield, YieldBreak): New statements.
10575
10576         * statement.cs (Return.Resolve): Flag an error if we are used in
10577         an iterator method.
10578
10579         * codegen.cs (InIterator): New flag set if the code is being
10580         compiled in an iterator method.
10581
10582         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10583         internal modifier, and we just use it to avoid adding extra
10584         fields, as this is seldom used.  
10585
10586         * cs-parser.jay: Add yield_statement (yield and yield break).
10587
10588         * driver.cs: New flag -v2 to turn on version 2 features. 
10589
10590         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10591         hashtable when v2 is enabled.
10592
10593 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10594
10595         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10596         there is already a namespace defined with this name.
10597
10598         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10599         people upgraded their corlibs.
10600
10601         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10602         always use fully qualified types, no need to use the compiler
10603         front end.
10604
10605         (TypeManager.IsNamespace): Use binarysearch.
10606
10607         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10608         AddDelegate): I did not quite use the new IsValid API properly: I
10609         have to pass the short-name and the fullname.  I was passing only
10610         the basename instead of the fullname sometimes. 
10611
10612         (TypeContainer.DefineType): call NamespaceClash.
10613
10614         * interface.cs (Interface.DefineType): use NamespaceClash before
10615         defining the type.
10616
10617         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10618         defining the type.
10619
10620         * enum.cs: (Enum.DefineType): use NamespaceClash before
10621         defining the type.
10622
10623         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10624         speed increase.  First, use the negative_hits cache when we get a
10625         negative.  Second, add the type with its full original name
10626         instead of the new . and + encoded name (reflection uses + to
10627         separate type from a nested type).  Use LookupTypeReflection
10628         directly which bypasses the type->name hashtable (that we already
10629         know does not contain the type.
10630
10631         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10632         location/container type. 
10633
10634         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10635
10636 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10637
10638         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10639
10640         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10641         method is being referenced in the method group from a static
10642         context, and report error 120 if so.
10643
10644         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10645         Error118. 
10646
10647         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10648         is created, we create the A namespace).
10649
10650         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10651         Fixes #41591
10652
10653 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10654
10655         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10656         invocation to ModuleBuilder.GetType with the same values will
10657         return a new type instance, so we need to cache its return
10658         values. 
10659
10660         * expression.cs (Binary.ResolveOperator): Only allow the compare
10661         operators on enums if they are of the same type.
10662
10663         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10664         types of ValueType on their own case.  Before we were giving them
10665         the same treatment as objects.
10666
10667         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10668         fullname.  Short name is used to compare against container name.
10669         Fullname is used to check against defined namespace names.
10670
10671         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10672         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10673
10674         (Method.CheckBase): Call parent.
10675         (MemberBase.CheckBase): Check for protected members on sealed
10676         classes.
10677         (PropertyBase.CheckBase): Call parent.
10678         (Field.Define): Call parent.
10679
10680         * report.cs: Negative error codes are now mapped to 8000 - code,
10681         so that the display is render more nicely.
10682
10683         * typemanager.cs: Do not use try/catch, instead report a regular
10684         error. 
10685
10686         (GetPointerType, GetReferenceType): These methods provide
10687         mechanisms to obtain the T* and T& from a T.  We had the code
10688         previously scattered around the code base, and it also used
10689         TypeManager.LookupType that would go through plenty of caches.
10690         This one goes directly to the type source.
10691
10692         In some places we did the Type.GetType followed by
10693         ModuleBuilder.GetType, but not in others, so this unifies the
10694         processing as well.
10695
10696         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10697         statements now that we have namespace information.
10698
10699         * typemanager.cs (IsNamespace): New method, returns whether the
10700         string presented is a namespace or not.
10701
10702         (ComputeNamespaces): New public entry point, computes the list of
10703         available namespaces, using the GetNamespaces API call in Mono, or
10704         the slower version in MS.NET.   
10705
10706         Now before we start the semantic analysis phase, we have a
10707         complete list of namespaces including everything that the user has
10708         provided.
10709
10710         Deleted old code to cache namespaces in .nsc files.
10711
10712 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10713
10714         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10715         class/struct location definition Location for the implicit
10716         constructor location.
10717
10718         (Operator.Define): Use the location of the operator for the
10719         implicit Method definition.
10720
10721         (Constructor.Emit): use the constructor location for the implicit
10722         base initializer constructor.
10723
10724         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10725         and the Expression class now contains two new methods:
10726
10727         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10728         isolate type lookup from the rest of the resolution process.
10729
10730         Since we use Expressions to hold type definitions due to the way
10731         we parse the input we have historically overloaded Resolve to
10732         perform the Type lookups if a special flag is passed.  Now this is
10733         eliminated and two methods take their place. 
10734
10735         The differences in the two methods between xStep and xTerminal is
10736         that xStep is involved in our current lookup system that uses
10737         SimpleNames to compose a name, while xTerminal is used just to
10738         catch the case where the simplename lookup failed.
10739
10740 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10741
10742         * expression.cs (ResolveMemberAccess): Remove redundant code.
10743         TypeExpr expressions are always born fully resolved.
10744
10745         * interface.cs (PopulateMethod): Do not lookup the types twice.
10746         We were doing it once during SemanticAnalysis and once during
10747         PopulateMethod.
10748
10749         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10750         in local variable type definitions, were being returned as a
10751         SimpleName (we decomposed everything into a string), that is
10752         because primary_expression was being used instead of a type in the
10753         grammar (reduce/reduce conflicts).
10754
10755         The part that was wrong is that we converted the expression into a
10756         string (an oversimplification in one hand, compounded with primary
10757         expressions doing string concatenation).
10758
10759         So things like:
10760
10761         A.B.C [] x;
10762
10763         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10764         using clauses from working on this particular context.  And a type
10765         was being matched directly against "A.B.C[]".
10766
10767         We now use the correct approach, and allow for ComposedCast to be
10768         part of the unary expression.  So the "A.B.C []" become a composed
10769         cast of "A.B.C" (as a nested group of MemberAccess with a
10770         SimpleName at the end) plus the rank composition "[]". 
10771
10772         Also fixes 35567
10773
10774 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10777         for the access level checking.
10778
10779         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10780         `TypeContainer container', because I kept getting confused when I
10781         was debugging this code.
10782
10783         * expression.cs (Indexers): Instead of tracking getters/setters,
10784         we now track them in parallel.  We create one arraylist less, but
10785         most importantly it is possible now for the LValue code to find a
10786         matching get for a set.
10787
10788         (IndexerAccess.DoResolveLValue): Update the code.
10789         GetIndexersForType has been modified already to extract all the
10790         indexers from a type.  The code assumed it did not.
10791
10792         Also make the code set the correct return type for the indexer.
10793         This was fixed a long time ago for properties, but was missing for
10794         indexers.  It used to be void_type.
10795
10796         (Binary.Emit): Test first for doubles instead of
10797         floats, as they are more common.
10798
10799         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10800         when dealing with floats and the <=, >= operators.  This fixes bug
10801         #39314 
10802
10803         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10804         to load the array value by emitting a load on the foreach variable
10805         type.  This was incorrect.  
10806
10807         We now emit the code to load an element using the the array
10808         variable type, and then we emit the conversion operator.
10809
10810         Fixed #40176
10811
10812 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10813
10814         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10815
10816 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10819         test for protection before we test for signatures. 
10820
10821         (MethodSignature.ToString): implement.
10822
10823         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10824         to the case where we reduced into a LongConstant.
10825
10826         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10827         depend on whether the information is acurrate, because the
10828         Microsoft runtime will always claim that the array type is public,
10829         regardless of the real state.
10830
10831         If the type is a pointer, another problem happens: the type is
10832         reported as non-public in Microsoft.  
10833
10834         In both cases we have to call CheckAccessLevel recursively with
10835         the underlying type as the argument to be tested.
10836
10837 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10838
10839         * assign.cs (Assign.Emit): If we are dealing with a compound
10840         assignment expression, we should use the code path that stores the
10841         intermediate result in a temporary value.  This fixes #40903.
10842
10843         *expression.cs (Indirection.ToString): Provide ToString method for
10844         debugging. 
10845
10846 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10847
10848         * class.cs: Null out fields holding references to Block objects so
10849         they can be garbage collected.
10850
10851         * expression.cs (OverloadResolve): Remove unused local.
10852
10853 2003-04-07  Martin Baulig  <martin@ximian.com>
10854
10855         * codegen.cs (EmitContext.CurrentFile): New public field.
10856         (EmitContext.Mark): Use the CurrentFile to check whether the
10857         location is in the correct file.
10858         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10859
10860 2003-04-07  Martin Baulig  <martin@ximian.com>
10861
10862         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10863
10864         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10865         location.  [FIXME: The location argument which gets passed to this
10866         method is sometimes wrong!]
10867
10868 2003-04-07  Nick Drochak <ndrochak@gol.com>
10869
10870         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10871
10872 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10873
10874         * expression.cs (Indirection.EmitAssign): We were using the
10875         temporary, but returning immediately instead of continuing the
10876         EmitAssing flow.
10877
10878 2003-04-06  Martin Baulig  <martin@ximian.com>
10879
10880         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10881         if it's a nested child, but also deriving from the outer class.
10882         See test 190.cs.
10883
10884         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10885         nested child, but also deriving from the outer class.  See
10886         test-190.cs.
10887         (FilterWithClosure): We may access private members of the outer
10888         class if we're a nested child and deriving from the outer class.
10889         (RealMemberLookup): Only set `closure_private_ok' if the
10890         `original_bf' contained BindingFlags.NonPublic.
10891
10892 2003-04-05  Martin Baulig  <martin@ximian.com>
10893
10894         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10895
10896 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * class.cs (Event.Define): Do not allow abstract events to have
10899         initializers. 
10900
10901 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10902
10903         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10904         block in event declarations.
10905
10906         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10907         value type, get its address.
10908
10909         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10910         leaving a class on the stack instead of a boolean value (int
10911         0/1).  Change the code so we compare against null, and then the
10912         result against zero.
10913
10914         * class.cs (TypeContainer.GetClassBases): We were checking for the
10915         parent class being sealed too late.
10916
10917         * expression.cs (Binary.Emit): For <= and >= when dealing with
10918         floating point values, use cgt.un and clt.un instead of cgt and
10919         clt alone.
10920
10921 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10922
10923         * statement.cs: Apply the same optimization as MS: skip the 
10924         GetEnumerator returning an IEnumerator, and use the one returning a 
10925         CharEnumerator instead. This allows us to avoid the try-finally block 
10926         and the boxing.
10927
10928 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10929
10930         * cs-parser.jay: Attributes cannot be applied to
10931                          namespaces. Fixes #40473
10932
10933 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10934
10935         * class.cs:
10936         (Add*): check if the name is valid using the full name for constants,
10937         fields, properties and events.
10938
10939 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10940
10941         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10942         char constants to be part of the enumeration.
10943
10944         * expression.cs (Conditional.DoResolve): Add support for operator
10945         true. Implements the missing functionality from 14.12
10946
10947         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10948         operator true/false as required by the spec.
10949
10950         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10951         implicit conversion to boolean.
10952
10953         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10954         also one where the type implements `operator true'. 
10955
10956         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10957         get an expression that will invoke operator true based on an
10958         expression.  
10959
10960         (GetConversionOperators): Removed the hack that called op_True
10961         here.  
10962
10963         (Expression.ResolveBoolean): Move this from Statement.
10964
10965 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10966
10967         * ecore.cs (FieldExpr): do not allow initialization of initonly
10968         fields on derived classes
10969
10970 2003-03-13  Martin Baulig  <martin@ximian.com>
10971
10972         * statement.cs (Block.Emit): Call ig.BeginScope() and
10973         ig.EndScope() when compiling with debugging info; call
10974         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10975
10976 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10977
10978         * expression.cs (Indexers): Do not construct immediately, allow
10979         for new members to be appended as we go.  Fixes 38143
10980
10981 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10982
10983         * expression.cs: save/restore context when resolving an unchecked
10984         expression.
10985
10986 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10987
10988         * cfold.cs: Catch division by zero in modulus operator during
10989         constant folding.
10990
10991 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * interface.cs (Interface.DefineMembers): Avoid defining members
10994         twice. 
10995
10996 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10997
10998         * driver.cs: handle the +/- options for -noconfig
10999
11000         * statement.cs (Unckeched.Resolve): Also track the state of
11001         unchecked in the Resolve phase.
11002
11003 2003-02-27  Martin Baulig  <martin@ximian.com>
11004
11005         * ecore.cs (Expression.MemberLookup): Don't create a
11006         MethodGroupExpr for something which is not a method.  Fixes #38291.
11007
11008 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11009
11010         * class.cs (MemberBase.CheckParameters): Also check that the type
11011         is unmanaged if it is a pointer.
11012
11013         * expression.cs (SizeOf.Resolve): Add location information.
11014
11015         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11016         a managed type is declared.
11017
11018         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11019         parameter modifiers as well.  Fixes bug 38606
11020
11021         * class.cs: Very sad.  Am backing out the speed up changes
11022         introduced by the ArrayList -> Array in the TypeContainer, as they
11023         were not actually that much faster, and introduced a bug (no error
11024         reports on duplicated methods).
11025
11026         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11027         source first, this will guarantee that we have a valid expression
11028         before calling in lower levels functions that will require a
11029         resolved object.  Then use this original_source in the
11030         target.ResolveLValue instead of the original source that was
11031         passed to us.
11032
11033         Another change.  Use target.Resolve instead of LValueResolve.
11034         Although we are resolving for LValues, we will let the Assign code
11035         take care of that (it will be called again from Resolve).  This
11036         basically allows code like this:
11037
11038         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11039         class Y { void A (X x) { x [0] += o; }
11040
11041         The problem was that the indexer was trying to resolve for
11042         set_Item (idx, object o) and never finding one.  The real set_Item
11043         was set_Item (idx, X).  By delaying the process we get the right
11044         semantics. 
11045
11046         Fixes bug 36505
11047
11048 2003-02-23  Martin Baulig  <martin@ximian.com>
11049
11050         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11051         while calling DoEmit ().
11052
11053         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11054         source files; if you use the #line directive inside a method, the
11055         compiler stops emitting line numbers for the debugger until it
11056         reaches the end of the method or another #line directive which
11057         restores the original file.
11058
11059 2003-02-23  Martin Baulig  <martin@ximian.com>
11060
11061         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11062
11063 2003-02-23  Martin Baulig  <martin@ximian.com>
11064
11065         * statement.cs (Block.AddChildVariableNames): We need to call this
11066         recursively, not just for our immediate children.
11067
11068 2003-02-23  Martin Baulig  <martin@ximian.com>
11069
11070         * class.cs (Event.Define): Always make the field private, like csc does.
11071
11072         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11073         actually work, fixes bug #37521.
11074
11075 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * delegate.cs: When creating the various temporary "Parameters"
11078         classes, make sure that we call the ComputeAndDefineParameterTypes
11079         on those new parameters (just like we do with the formal ones), to
11080         allow them to be resolved in the context of the DeclSpace.
11081
11082         This fixes the bug that Dick observed in Bugzilla #38530.
11083
11084 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11085
11086         * expression.cs (ResolveMemberAccess): When resolving a constant,
11087         do not attempt to pull a constant if the value was not able to
11088         generate a valid constant.
11089
11090         * const.cs (LookupConstantValue): Do not report more errors than required.
11091
11092 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11093
11094         * expression.cs: fixes bug #38328.
11095
11096 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11097
11098         * class.cs: Changed all the various members that can be part of a
11099         class from being an ArrayList to be an Array of the right type.
11100         During the DefineType type_list, interface_list, delegate_list and
11101         enum_list are turned into types, interfaces, delegates and enums
11102         arrays.  
11103
11104         And during the member population, indexer_list, event_list,
11105         constant_list, field_list, instance_constructor_list, method_list,
11106         operator_list and property_list are turned into their real arrays.
11107
11108         Although we could probably perform this operation earlier, for
11109         good error reporting we need to keep the lists and remove the
11110         lists for longer than required.
11111
11112         This optimization was triggered by Paolo profiling the compiler
11113         speed on the output of `gen-sample-program.pl' perl script. 
11114
11115         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11116         not crash in methods like MemberLookupFailed that use this field.  
11117
11118         This problem arises when the compiler fails to resolve a type
11119         during interface type definition for example.
11120
11121 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11122
11123         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11124         inherit from System.Object, so we have to stop at null, not only
11125         when reaching System.Object.
11126
11127 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11128
11129         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11130         DeclaredOnly because the parent indexer might have had a different
11131         name, but did not loop until the top of the hierarchy was reached.
11132
11133         The problem this one fixes is 35492: when a class implemented an
11134         indexer from an interface, we were getting the interface method
11135         (which was abstract) and we were flagging an error (can not invoke
11136         abstract method).
11137
11138         This also keeps bug 33089 functioning, and test-148 functioning.
11139
11140         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11141         out if a method is special is to see if it is declared in a
11142         property or event, or whether it is one of the predefined operator
11143         names.   This should fix correctly #36804.
11144
11145 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11146
11147         The goal here is to remove the dependency on EmptyCast.Peel ().
11148         Killing it completely.
11149
11150         The problem is that currently in a number of places where
11151         constants are expected, we have to "probe" for an EmptyCast, and
11152         Peel, which is not the correct thing to do, as this will be
11153         repetitive and will likely lead to errors. 
11154
11155         The idea is to remove any EmptyCasts that are used in casts that
11156         can be reduced to constants, so we only have to cope with
11157         constants. 
11158
11159         This bug hunt was triggered by Bug 37363 and the desire to remove
11160         the duplicate pattern where we were "peeling" emptycasts to check
11161         whether they were constants.  Now constants will always be
11162         constants.
11163
11164         * ecore.cs: Use an enumconstant here instead of wrapping with
11165         EmptyCast.  
11166
11167         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11168         throwing me off.  By handling this we can get rid of a few hacks.
11169
11170         * statement.cs (Switch): Removed Peel() code.
11171
11172 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11173
11174         * class.cs: Location information for error 508
11175
11176         * expression.cs (New.DoResolve): Add a guard against double
11177         resolution of an expression.  
11178
11179         The New DoResolve might be called twice when initializing field
11180         expressions (see EmitFieldInitializers, the call to
11181         GetInitializerExpression will perform a resolve on the expression,
11182         and later the assign will trigger another resolution
11183
11184         This leads to bugs (#37014)
11185
11186         * delegate.cs: The signature for EndInvoke should contain any ref
11187         or out parameters as well.  We were not doing this in the past. 
11188
11189         * class.cs (Field.Define): Do not overwrite the type definition
11190         inside the `volatile' group.  Turns out that volatile enumerations
11191         were changing the type here to perform a validity test, which
11192         broke conversions. 
11193
11194 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11195
11196         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11197         and structs, we do not want to load the instance variable
11198
11199         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11200         enum_type has to be handled like an object reference (implicit
11201         conversions exists from this to object), but the regular IsClass
11202         and IsValueType tests will never return true for this one.
11203
11204         Also we use TypeManager.IsValueType instead of type.IsValueType,
11205         just for consistency with the rest of the code (this is only
11206         needed if we ever use the construct exposed by test-180.cs inside
11207         corlib, which we dont today).
11208
11209 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11210
11211         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11212         just InternalCall.
11213
11214 2003-02-09  Martin Baulig  <martin@ximian.com>
11215
11216         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11217         (Namespace.DefineNamespaces): New static public method; this is
11218         called when we're compiling with debugging to add all namespaces
11219         to the symbol file.
11220
11221         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11222         pass it to the Namespace's .ctor.
11223
11224         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11225         and MethodBase arguments; pass the namespace ID to the symwriter;
11226         pass the MethodBase instead of the token to the symwriter.
11227         (SymbolWriter.DefineNamespace): New method to add a namespace to
11228         the symbol file.
11229
11230 2003-02-09  Martin Baulig  <martin@ximian.com>
11231
11232         * symbolwriter.cs: New file.  This is a wrapper around
11233         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11234         methods here in near future.
11235
11236 2003-02-09  Martin Baulig  <martin@ximian.com>
11237
11238         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11239         ILGenerator.MarkSequencePoint() which are actually used by the
11240         symbol writer.
11241
11242 2003-02-09  Martin Baulig  <martin@ximian.com>
11243
11244         * location.cs (SourceFile): New public sealed class.  This
11245         contains the name and an index which is used in the location's token.
11246         (Location): Reserve an appropriate number of bits in the token for
11247         the source file instead of walking over that list, this gives us a
11248         really huge performance improvement when compiling with debugging.
11249
11250         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11251         `SourceFile' argument instead of a string.
11252         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11253         but don't parse/tokenize here, we need to generate the list of all
11254         source files before we do that.
11255         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11256         the files.
11257
11258         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11259         instead of a string.
11260
11261         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11262         of a string.
11263
11264 2003-02-09  Martin Baulig  <martin@ximian.com>
11265
11266         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11267         filename on `#line default'.
11268
11269 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11270
11271         * statement.cs: don't clear the pinned var when the fixed statement
11272         returns from the method (fixes bug#37752).
11273
11274 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11275
11276         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11277         to IsValueType.
11278
11279 2003-02-07  Martin Baulig  <martin@ximian.com>
11280
11281         * driver.cs: Removed the `--debug-args' command line argument.
11282
11283         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11284         automatically by the AsssemblyBuilder.
11285         (CodeGen.InitializeSymbolWriter): We don't need to call any
11286         initialization function on the symbol writer anymore.  This method
11287         doesn't take any arguments.
11288
11289 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11290
11291         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11292         from referenced assemblies as well.
11293
11294 2003-02-02  Martin Baulig  <martin@ximian.com>
11295
11296         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11297
11298 2003-02-02  Martin Baulig  <martin@ximian.com>
11299
11300         * class.cs (Constructor.Emit): Open the symbol writer before
11301         emitting the constructor initializer.
11302         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11303         single-stepping through constructor initializers.
11304
11305 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11306
11307         * class.cs: Handle error 549: do not allow virtual methods in
11308         sealed classes. 
11309
11310 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11311
11312         * decl.cs: Check access levels when resolving types
11313
11314 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11315
11316         * statement.cs: Add parameters and locals set in catch blocks that might 
11317         return to set vector
11318
11319 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11320
11321         * class.cs (Operator): Set the SpecialName flags for operators.
11322
11323         * expression.cs (Invocation.DoResolve): Only block calls to
11324         accessors and operators on SpecialName methods.
11325
11326         (Cast.TryReduce): Handle conversions from char constants.
11327
11328
11329 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11330
11331         * statement.cs: small memory and time optimization in FlowBranching.
11332
11333 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11334
11335         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11336         problem that the last fix but in the other sid (Set).
11337
11338         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11339         access when there is no indexer in the hierarchy.
11340
11341 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11342
11343         * class.cs: Combine some if statements.
11344
11345 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11346
11347         * driver.cs: fixed bug #37187.
11348
11349 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11350
11351         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11352         any indexer, it's needed to build a list with all the indexers in the
11353         hierarchy (AllGetters), else we have problems. Fixes #35653.
11354
11355 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11356
11357         * class.cs (MethodData.Define): It is wrong for an interface
11358         implementation to be static in both cases: explicit and implicit.
11359         We were only handling this in one case.
11360
11361         Improve the if situation there to not have negations.
11362
11363         * class.cs (Field.Define): Turns out that we do not need to check
11364         the unsafe bit on field definition, only on usage.  Remove the test.
11365
11366 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11367
11368         * driver.cs: use assembly.Location instead of Codebase (the latest
11369         patch made mcs fail when using MS assemblies).
11370
11371 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11372
11373         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11374         get the path to *corlib.dll.
11375
11376 2003-01-21  Nick Drochak <ndrochak@gol.com>
11377
11378         * cs-tokenizer.cs:
11379         * pending.cs:
11380         * typemanager.cs: Remove compiler warnings
11381
11382 2003-01-20  Duncan Mak  <duncan@ximian.com>
11383
11384         * AssemblyInfo.cs: Bump the version number to 0.19.
11385
11386 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11387
11388         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11389
11390 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11391
11392         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11393
11394 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11395
11396         * cs-parser.jay: Small fix: we were not comparing the constructor
11397         name correctly.   Thanks to Zoltan for the initial pointer.
11398
11399 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11400
11401         * cs-tokenizer.cs: Set file name when specified with #line
11402
11403 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11404
11405         * cs-parser.jay: Only perform the constructor checks here if we
11406         are named like the class;  This will help provider a better
11407         error.  The constructor path is taken when a type definition is
11408         not found, but most likely the user forgot to add the type, so
11409         report that rather than the constructor error.
11410
11411 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11412
11413         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11414         allocations.
11415
11416 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11417
11418         * cs-parser.jay: Add cleanup call.
11419
11420 2003-01-13  Duncan Mak  <duncan@ximian.com>
11421
11422         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11423         consistent with other methods.
11424
11425 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11426
11427         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11428
11429 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11430
11431         * attribute.cs: only set GuidAttr to true when we have a
11432         GuidAttribute.
11433
11434 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11435
11436         * ecore.cs:
11437         * expression.cs:
11438         * typemanager.cs: fixes to allow mcs compile corlib with the new
11439         Type.IsSubclassOf fix.
11440
11441 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11442
11443         * expression.cs (LocalVariableReference.DoResolve): Classify a
11444         constant as a value, not as a variable.   Also, set the type for
11445         the variable.
11446
11447         * cs-parser.jay (fixed_statement): take a type instead of a
11448         pointer_type, so we can produce a better error message later.
11449
11450         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11451         as an error.  
11452
11453         (For.DoEmit): Make inifinite loops have a
11454         non-conditional branch back.
11455
11456         (Fixed.DoEmit): First populate the pinned variables, then emit the
11457         statement, then clear the variables.  Before I was emitting the
11458         code once for each fixed piece.
11459
11460
11461 2003-01-08  Martin Baulig  <martin@ximian.com>
11462
11463         * statement.cs (FlowBranching.MergeChild): A break in a
11464         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11465
11466 2003-01-08  Martin Baulig  <martin@ximian.com>
11467
11468         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11469         lives in the same number space than `param_map'.  Fixes #36154.
11470
11471 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11472
11473         * cs-parser.jay (constructor_declaration): Set the
11474         Constructor.ModFlags before probing for it.  This makes the
11475         compiler report 514, 515 and 132 (the code was there, but got
11476         broken). 
11477
11478         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11479         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11480         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11481
11482 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11483
11484         * enum.cs: create the enum static fields using the enum type.
11485
11486 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11487
11488         * class.cs: don't try to create the ParamBuilder for the return
11489         type if it's not needed (and handle it breaking for the ms runtime
11490         anyway).
11491
11492 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11493
11494         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11495
11496 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11497
11498         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11499         the command.   This showed up while compiling the JANET source
11500         code, which used \r as its only newline separator.
11501
11502 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * class.cs (Method.Define): If we are an operator (because it
11505         reuses our code), then set the SpecialName and HideBySig.  #36128
11506
11507 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11508
11509         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11510         exception, report error 120 `object reference required'.
11511
11512         * driver.cs: Add --pause option, used during to measure the size
11513         of the process as it goes with --timestamp.
11514
11515         * expression.cs (Invocation.DoResolve): Do not allow methods with
11516         SpecialName to be invoked.
11517
11518 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11519
11520         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11521         number before adding it.
11522
11523 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11524
11525         * ecore.cs (StandardImplicitConversion): When in an unsafe
11526         context, we allow conversion between void * to any other pointer
11527         type. This fixes bug #35973.
11528
11529 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11530
11531         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11532         is not thrown when extensionless outputs are used 
11533
11534 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11535
11536         * rootcontext.cs: fixed compilation of corlib.
11537
11538 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11539
11540         * attribute.cs (Attributes.Contains): Add new method.
11541
11542         * class.cs (MethodCore.LabelParameters): if the parameter is an
11543         `out' parameter, check that no attribute `[In]' has been passed.
11544
11545         * enum.cs: Handle the `value__' name in an enumeration.
11546
11547 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11548
11549         * decl.cs: Added special case to allow overrides on "protected
11550         internal" methods
11551
11552 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11553
11554         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11555         since it makes much more sense.
11556
11557         (Attributes.ctor): Don't require a Location parameter.
11558
11559         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11560
11561         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11562         since we already have that information per attribute.
11563
11564         * everywhere : make appropriate changes.
11565
11566         * class.cs (LabelParameters): Write the code which actually
11567         applies attributes to the return type. We can't do this on the MS
11568         .NET runtime so we flag a warning in the case an exception is
11569         thrown.
11570
11571 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11572
11573         * const.cs: Handle implicit null conversions here too.
11574
11575 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11576
11577         * class.cs (MethodCore.LabelParameters): Remove the extra
11578         Type [] parameter since it is completely unnecessary. Instead
11579         pass in the method's attributes so that we can extract
11580         the "return" attribute.
11581
11582 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11583
11584         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11585         of ignoring it and letting the compile continue.
11586
11587         * typemanager.cs (ChangeType): use an extra argument to return an
11588         error condition instead of throwing an exception.
11589
11590 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11591
11592         * expression.cs (Unary.TryReduce): mimic the code for the regular
11593         code path.  Perform an implicit cast in the cases where we can
11594         implicitly convert to one of the integral types, and then reduce
11595         based on that constant.   This fixes bug #35483.
11596
11597 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11598
11599         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11600
11601 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11602
11603         * namespace.cs: fixed bug #35489.
11604
11605 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11606
11607         * class.cs: Remove some dead code.
11608
11609         * cs-parser.jay: Estimate the number of methods needed
11610         (RootContext.MethodCount);
11611
11612         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11613         numbers instead of StringBuilders.
11614
11615         * support.cs (PtrHashtable): Add constructor with initial size;
11616         We can now reduce reallocations of the method table.
11617
11618 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11619
11620         * attribute.cs (ApplyAttributes): Keep track of the emitted
11621         attributes on a per-target basis. This fixes bug #35413.
11622
11623 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11624
11625         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11626         default to the Windows 1252 encoding.
11627
11628         (UnixParseOption): Support version, thanks to Alp for the missing
11629         pointer. 
11630
11631         * AssemblyInfo.cs: Add nice assembly information.
11632
11633         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11634         (bug 35169).
11635
11636         * cs-parser.jay: Allow a trailing comma before the close bracked
11637         in the attribute_section production.
11638
11639         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11640         address of the instance was being taken, I will take this out,
11641         because we take the address of the object immediately here.
11642
11643 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11644
11645         * typemanager.cs (AreMultipleAllowed): Take care of the most
11646         obvious case where attribute type is not in the current assembly -
11647         stupid me ;-)
11648
11649 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11650
11651         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11652         definitions, instead of doing that afterwards.  
11653
11654         Also we use a nice little hack, depending on the constructor, we
11655         know if we are a "composed" name or a simple name.  Hence, we
11656         avoid the IndexOf test, and we avoid 
11657
11658         * codegen.cs: Add code to assist in a bug reporter to track down
11659         the source of a compiler crash. 
11660
11661 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11662
11663         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11664         types have been emitted for a given element and flag an error
11665         if something which does not have AllowMultiple set is used more
11666         than once.
11667
11668         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11669         attribute types and their corresponding AllowMultiple properties
11670
11671         (AreMultipleAllowed): Check the property for a given type.
11672
11673         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11674         property in the case we have a TypeContainer.
11675
11676         (Attributes.AddAttribute): Detect duplicates and just skip on
11677         adding them. This trivial fix catches a pretty gross error in our
11678         attribute emission - global attributes were being emitted twice!
11679
11680         Bugzilla bug #33187 is now fixed.
11681
11682 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11683
11684         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11685         instead of pp_and).
11686
11687         * expression.cs (Binary.ResolveOperator): I can only use the
11688         Concat (string, string, string) and Concat (string, string,
11689         string, string) if the child is actually a concatenation of
11690         strings. 
11691
11692 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11693
11694         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11695         context where we need a 2-character lookahead.
11696
11697         * pending.cs (PendingImplementation): Rework so we can keep track
11698         of interface types all the time, and flag those which were
11699         implemented by parents as optional.
11700
11701 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11702
11703         * expression.cs (Binary.ResolveOperator): Use
11704         String.Concat(string,string,string) or
11705         String.Concat(string,string,string,string) when possible. 
11706
11707         * typemanager: More helper methods.
11708
11709
11710 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11711
11712         * pending.cs: remove the bogus return from GetMissingInterfaces()
11713         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11714
11715 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11716
11717         * namespace.cs: avoid duplicated 'using xxx' being added to
11718         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11719         when we get more than one 'using' statement for the same namespace.
11720         Report a CS0105 warning for it.
11721
11722 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11723
11724         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11725         of calling getChar/putback, uses internal knowledge of it.    
11726
11727         (xtoken): Reorder tokenizer so most common patterns are checked
11728         first.  This reduces the compilation time in another 5% (from 8.11s
11729         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11730
11731         The parsing time is 22% of the compilation in mcs, and from that
11732         64% is spent on the tokenization process.  
11733
11734         I tried using a binary search for keywords, but this is slower
11735         than the hashtable.  Another option would be to do a couple of
11736         things:
11737
11738                 * Not use a StringBuilder, instead use an array of chars,
11739                   with a set value.  Notice that this way we could catch
11740                   the 645 error without having to do it *afterwards*.
11741
11742                 * We could write a hand-parser to avoid the hashtable
11743                   compares altogether.
11744
11745         The identifier consumption process takes 37% of the tokenization
11746         time.  Another 15% is spent on is_number.  56% of the time spent
11747         on is_number is spent on Int64.Parse:
11748
11749                 * We could probably choose based on the string length to
11750                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11751                   computations. 
11752
11753         Another 3% is spend on wrapping `xtoken' in the `token' function.
11754
11755         Handle 0xa0 as whitespace (#34752)
11756
11757 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11758
11759         * typemanager.cs (IsCLRType): New routine to tell whether a type
11760         is one of the builtin types.  
11761
11762         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11763         typecode in more places instead of doing pointer comparissions.
11764         We could leverage some knowledge about the way the typecodes are
11765         laid out.
11766
11767         New code to cache namespaces in assemblies, it is currently not
11768         invoked, to be used soon.
11769
11770         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11771
11772         * expression.cs (Binary.ResolveOperator): specially handle
11773         strings, and do not perform user-defined operator overloading for
11774         built-in types.
11775
11776 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11777
11778         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11779         internalcall as it is a pretty simple operation;  Avoid whenever
11780         possible to call Char.IsLetter.
11781
11782         (consume_identifier): Cut by half the number of
11783         hashtable calls by merging the is_keyword and GetKeyword behavior.
11784
11785         Do not short-circuit, because if we do, we
11786         report errors (ie, #if false && true would produce an invalid
11787         directive error);
11788
11789
11790 2002-11-24  Martin Baulig  <martin@ximian.com>
11791
11792         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11793         check constant ranges and report a CS0221.  Fixes #33186.
11794
11795 2002-11-24  Martin Baulig  <martin@ximian.com>
11796
11797         * cs-parser.jay: Make this work for uninitialized variable
11798         declarations in the `for' initializer.  Fixes #32416.
11799
11800 2002-11-24  Martin Baulig  <martin@ximian.com>
11801
11802         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11803         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11804
11805 2002-11-24  Martin Baulig  <martin@ximian.com>
11806
11807         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11808         argument; if true, we also check for user-defined conversions.
11809         This is only needed if both arguments are of a user-defined type.
11810         Fixes #30443, added test-175.cs.
11811         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11812
11813         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11814
11815 2002-11-24  Martin Baulig  <martin@ximian.com>
11816
11817         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11818         function to get the store opcode.
11819         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11820         only emit the Ldelema if the store opcode is Stobj.  You must run
11821         both test-34 and test-167 to test this.  Fixes #34529.
11822
11823 2002-11-23  Martin Baulig  <martin@ximian.com>
11824
11825         * ecore.cs (Expression.MemberLookup): Added additional
11826         `qualifier_type' argument which is used when we're being called
11827         from MemberAccess.DoResolve() and null if we're called from a
11828         SimpleName lookup.
11829         (Expression.MemberLookupFailed): New method to report errors; this
11830         does the CS1540 check and reports the correct error message.
11831
11832         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11833         argument for the CS1540 check and redone the way how we're dealing
11834         with private members.  See the comment in the source code for details.
11835         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11836         `closure_start_type' to `closure_qualifier_type' and check whether
11837         it's not null.  It was not this filter being broken, it was just
11838         being called with the wrong arguments.
11839
11840         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11841         and pass it the correct `qualifier_type'; this also does the error
11842         handling for us.
11843
11844 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11845
11846         * expression.cs (Invocation.EmitParams): If the we are dealing
11847         with a non-built-in value type, load its address as well.
11848
11849         (ArrayCreation): Use a a pretty constant instead
11850         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11851         static initializers.  
11852
11853         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11854         because they are not really value types, just glorified integers. 
11855
11856         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11857
11858         * ecore.cs: Remove redundant code for enumerations, make them use
11859         the same code path as everything else, fixes the casting issue
11860         with enumerations in Windows.Forms.
11861
11862         * attribute.cs: Do only cast to string if it is a string, the
11863         validation happens later.
11864
11865         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11866         people upgrade their corlibs.
11867
11868         * ecore.cs: Oops, enumerations were not following the entire code path
11869
11870 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11871
11872         * typemanager.cs (FilterWithClosure): Commented out the test for
11873         1540 in typemanager.cs, as it has problems when accessing
11874         protected methods from a parent class (see test-174.cs). 
11875
11876         * attribute.cs (Attribute.ValidateGuid): new method.
11877         (Attribute.Resolve): Use above.
11878
11879 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11880
11881         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11882
11883         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11884         handling for enumerations, as we only needed the TypeContainer
11885         functionality to begin with (this is required for the fix below to
11886         work for enums that reference constants in a container class for
11887         example). 
11888
11889         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11890
11891         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11892         a valid TypeBuilder to perform lookups on.o
11893
11894         * class.cs (InheritableMemberSignatureCompare): Use true in the
11895         call to GetGetMethod and GetSetMethod, because we are comparing
11896         the signature, and we need to get the methods *even* if they are
11897         private. 
11898
11899         (PropertyBase.CheckBase): ditto.
11900
11901         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11902         GotoCase.Resolve): Use Peel on EmpytCasts.
11903
11904         * ecore.cs (EmptyCast): drop child, add Peel method.
11905
11906 2002-11-17  Martin Baulig  <martin@ximian.com>
11907
11908         * ecore.cs (EmptyCast.Child): New public property.
11909
11910         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11911         label resolved to an EmptyCast.  Fixes #34162.
11912         (GotoCase.Resolve): Likewise.
11913         (Block.EmitMeta): Likewise.
11914
11915 2002-11-17  Martin Baulig  <martin@ximian.com>
11916
11917         * expression.cs (Invocation.BetterConversion): Prefer int over
11918         uint; short over ushort; long over ulong for integer literals.
11919         Use ImplicitConversionExists instead of StandardConversionExists
11920         since we also need to check for user-defined implicit conversions.
11921         Fixes #34165.  Added test-173.cs.
11922
11923 2002-11-16  Martin Baulig  <martin@ximian.com>
11924
11925         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11926         with the `true' and `false' literals.  Fixes #33151.
11927
11928 2002-11-16  Martin Baulig  <martin@ximian.com>
11929
11930         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11931         October 22nd; don't do the cs1540 check for static members.
11932
11933         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11934         now using our own filter here and doing the cs1540 check again.
11935
11936 2002-11-16  Martin Baulig  <martin@ximian.com>
11937
11938         * support.cs (InternalParameters): Don't crash if we don't have
11939         any fixed parameters.  Fixes #33532.
11940
11941 2002-11-16  Martin Baulig  <martin@ximian.com>
11942
11943         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11944         when looking up static methods to make this work on Windows.
11945         Fixes #33773.
11946
11947 2002-11-16  Martin Baulig  <martin@ximian.com>
11948
11949         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11950         a setter rather than using PropertyInfo.CanWrite.
11951
11952 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11953
11954         * class.cs: Allow acces to block member by subclasses. Fixes build
11955         breaker.
11956
11957 2002-11-14  Martin Baulig  <martin@ximian.com>
11958
11959         * class.cs (Constructor.Emit): Added the extern/block check.
11960         Fixes bug #33678.
11961
11962 2002-11-14  Martin Baulig  <martin@ximian.com>
11963
11964         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11965         iteration while looking for indexers, this is needed because the
11966         indexer may have a different name in our base classes.  Fixed the
11967         error reporting (no indexers at all, not get accessor, no
11968         overloaded match).  Fixes bug #33089.
11969         (IndexerAccess.DoResolveLValue): Likewise.
11970
11971 2002-11-14  Martin Baulig  <martin@ximian.com>
11972
11973         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11974         indexers.  Fixes the first part of bug #33089.
11975         (MethodSignature.InheritableMemberSignatureCompare): Added support
11976         for properties.
11977
11978 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11979
11980         * attribute.cs (Attribute.Resolve): Catch the
11981         NullReferenceException and report it since it isn't supposed to
11982         happen. 
11983
11984 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11987         LogicalOr and LogicalAnd that can benefit from recursively
11988         handling EmitBranchable.  The code now should be nice for Paolo.
11989
11990 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11991
11992         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11993         the Type lookups, as we perform quite a number of lookups on
11994         non-Types.  This can be removed once we can deterministically tell
11995         whether we have a type or a namespace in advance.
11996
11997         But this might require special hacks from our corlib.
11998
11999         * TODO: updated.
12000
12001         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12002         and double which avoids a conversion from an integer to a double.
12003
12004         * expression.cs: tiny optimization, avoid calling IsConstant,
12005         because it effectively performs the lookup twice.
12006
12007 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12008
12009         But a bogus return here to keep the semantics of the old code
12010         until the Mono runtime is fixed.
12011
12012         * pending.cs (GetMissingInterfaces): New method used to remove all
12013         the interfaces that are already implemented by our parent
12014         classes from the list of pending methods. 
12015
12016         * interface.cs: Add checks for calls after ResolveTypeExpr.
12017
12018 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * class.cs (Class.Emit): Report warning 67: event not used if the
12021         warning level is beyond 3.
12022
12023         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12024         being a NullLiteral.
12025
12026         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12027         specifiers. 
12028
12029         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12030         path that might fail if a type can not be resolved.
12031
12032         * expression.cs (Binary.Emit): Emit unsigned versions of the
12033         operators. 
12034
12035         * driver.cs: use error 5.
12036
12037 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12038
12039         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12040
12041 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * cs-parser.jay (switch_section): A beautiful patch from Martin
12044         Baulig that fixed 33094.
12045
12046 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12047
12048         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12049         Check whether the base is abstract and report an error if so.
12050
12051         * expression.cs (IndexerAccess.DoResolveLValue,
12052         IndexerAccess.DoResolve): ditto. 
12053
12054         (Invocation.DoResolve): ditto.
12055
12056         (Invocation.FullMethodDesc): Improve the report string.
12057
12058         * statement.cs (Block): Eliminate IsVariableDefined as it is
12059         basically just a wrapper for GetVariableInfo.
12060
12061         * ecore.cs (SimpleName): Use new 
12062
12063         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12064         type, as we return the actual parameter ref/unref state on a
12065         different call.
12066
12067 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12068
12069         * support.cs: Return proper flags REF/OUT fixing the previous
12070         commit.  
12071
12072         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12073         not used to mean `ref' but `ref or out' in ParameterReference
12074
12075         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12076         full type signature instead of calling TypeManger.CSharpName
12077         ourselves. 
12078
12079         * support.cs (InternalParameters.ParameterDesc): Do not compare
12080         directly to the modflags, because REF/OUT will actually be bitsets
12081         if set. 
12082
12083         * delegate.cs (VerifyMethod): Check also the modifiers.
12084
12085         * cs-tokenizer.cs: Fix bug where floating point values with an
12086         exponent where a sign was missing was ignored.
12087
12088         * driver.cs: Allow multiple assemblies to be specified in a single
12089         /r: argument
12090
12091 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12092
12093         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12094         because identifiers after a parenthesis would end up in this kind
12095         of production, and we needed to desamiguate it for having casts
12096         like:
12097
12098                 (UserDefinedType *) xxx
12099
12100 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12103         we should set on the Bindingflags.NonPublic, but not turn on
12104         private_ok.  private_ok controls whether a Private member is
12105         returned (this is chekced on the filter routine), while the
12106         BindingFlags.NonPublic just controls whether private/protected
12107         will be allowed.   This fixes the problem part of the problem of
12108         private properties being allowed to be used in derived classes.
12109
12110         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12111         so we can call the children DoResolveLValue method (this will
12112         properly signal errors on lvalue assignments to base properties)
12113
12114         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12115         getter are null, and we have a property info, we know that this
12116         happened because the lookup failed, so we report an error 122 for
12117         protection level violation.
12118
12119         We also silently return if setter and getter are null in the
12120         resolve functions, this condition only happens if we have flagged
12121         the error before.  This is the other half of the problem. 
12122
12123         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12124         not have accessibility information, that is why we were returning
12125         true in the filter function in typemanager.cs.
12126
12127         To properly report 122 (property is inaccessible because of its
12128         protection level) correctly, we report this error in ResolveAccess
12129         by failing if both the setter and the getter are lacking (ie, the
12130         lookup failed). 
12131
12132         DoResolve and DoLResolve have been modified to check for both
12133         setter/getter being null and returning silently, the reason being
12134         that I did not want to put the knowledge about this error in upper
12135         layers, like:
12136
12137         int old = Report.Errors;
12138         x = new PropertyExpr (...);
12139         if (old != Report.Errors)
12140                 return null;
12141         else
12142                 return x;
12143
12144         So the property expr is returned, but it is invalid, so the error
12145         will be flagged during the resolve process. 
12146
12147         * class.cs: Remove InheritablePropertySignatureCompare from the
12148         class, as we no longer depend on the property signature to compute
12149         whether it is possible to implement a method or not.
12150
12151         The reason is that calling PropertyInfo.GetGetMethod will return
12152         null (in .NET, in Mono it works, and we should change this), in
12153         cases where the Get Method does not exist in that particular
12154         class.
12155
12156         So this code:
12157
12158         class X { public virtual int A { get { return 1; } } }
12159         class Y : X { }
12160         class Z : Y { public override int A { get { return 2; } } }
12161
12162         Would fail in Z because the parent (Y) would not have the property
12163         defined.  So we avoid this completely now (because the alternative
12164         fix was ugly and slow), and we now depend exclusively on the
12165         method names.
12166
12167         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12168         reference method, instead of using the property.
12169
12170         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12171         routines are gone now.
12172
12173         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12174         names, they were incorrectly named.
12175
12176         * cs-tokenizer.cs: Return are more gentle token on failure. 
12177
12178         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12179         had an out-of-sync index variable, which caused it to remove from
12180         the list of pending methods the wrong method sometimes.
12181
12182 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12185         CanWrite, because those refer to this particular instance of the
12186         property, and do not take into account the fact that we can
12187         override single members of a property.
12188
12189         Constructor requires an EmitContext.  The resolution process does
12190         not happen here, but we need to compute the accessors before,
12191         because the resolution does not always happen for properties.
12192
12193         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12194         subclass, before we did not update this flag, but we did update
12195         bindingflags. 
12196
12197         (GetAccessors): Drop this routine, as it did not work in the
12198         presence of partially overwritten set/get methods. 
12199
12200         Notice that this broke the cs1540 detection, but that will require
12201         more thinking. 
12202
12203 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12204
12205         * class.cs:
12206         * codegen.cs:
12207         * driver.cs: issue a warning instead of an error if we don't support
12208         debugging for the platform. Also ignore a couple of errors that may
12209         arise when trying to write the symbols. Undo my previous patch.
12210
12211 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12212
12213         * driver.cs: ignore /debug switch except for Unix platforms.
12214
12215 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12216
12217         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12218
12219 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12220
12221         * driver.cs: Do not make mcs-debug conditional, so we do not break
12222         builds that use it.
12223
12224         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12225         review this patch.  But basically after all the children variables
12226         have been merged, the value of "Breaks" was not being set to
12227         new_breaks for Switch blocks.  I think that it should be set after
12228         it has executed.  Currently I set this to the value of new_breaks,
12229         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12230         conservative, but I do not understand this code very well.
12231
12232         I did not break anything in the build, so that is good ;-)
12233
12234         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12235
12236 2002-10-20  Mark Crichton  <crichton@gimp.org>
12237
12238         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12239
12240 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12241
12242         * cfold.cs: Fixed compile blocker.
12243
12244 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12245
12246         * driver.cs: I was chekcing the key, not the file.
12247
12248 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12249
12250         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12251         message that we were generating - we just need to silently return
12252         a null.
12253
12254 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12255
12256         * class.cs (Event.Define): Change my previous commit, as this
12257         breaks the debugger.  This is a temporary hack, as it seems like
12258         the compiler is generating events incorrectly to begin with.
12259
12260         * expression.cs (Binary.ResolveOperator): Added support for 
12261         "U operator - (E x, E y)"
12262
12263         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12264         y)".
12265
12266         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12267         init-only variables, but this path did not take into account that
12268         there might be also instance readonly variables.  Correct this
12269         problem. 
12270
12271         This fixes bug 32253
12272
12273         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12274         delegates as well.
12275
12276         * driver.cs: Change the extension for modules to `netmodule'
12277
12278         * cs-parser.jay: Improved slightly the location tracking for
12279         the debugger symbols.
12280
12281         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12282         modifiers that were specified instead of the hardcoded value
12283         (FamAndAssem).  This was basically ignoring the static modifier,
12284         and others.  Fixes 32429.
12285
12286         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12287         fixed a bug in the process (32476)
12288
12289         * expression.cs (ArrayAccess.EmitAssign): Patch from
12290         hwang_rob@yahoo.ca that fixes bug 31834.3
12291
12292 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12293
12294         * driver.cs: Make the module extension .netmodule.
12295
12296 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12297
12298         * driver.cs: Report an error if the resource file is not found
12299         instead of crashing.
12300
12301         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12302         false, like Emit does.
12303
12304 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12305
12306         * typemanager.cs: Remove unused private member.  Also reported mcs
12307         bug to report this as a warning like csc.
12308
12309 2002-10-15  Martin Baulig  <martin@gnome.org>
12310
12311         * statement.cs (Statement.Emit): Made this a virtual method; emits
12312         the line number info and calls DoEmit().
12313         (Statement.DoEmit): New protected abstract method, formerly knows
12314         as Statement.Emit().
12315
12316         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12317
12318 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12319
12320         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12321         have fixed a remaining problem: not every AddXXXX was adding a
12322         fully qualified name.  
12323
12324         Now everyone registers a fully qualified name in the DeclSpace as
12325         being defined instead of the partial name.  
12326
12327         Downsides: we are slower than we need to be due to the excess
12328         copies and the names being registered this way.  
12329
12330         The reason for this is that we currently depend (on the corlib
12331         bootstrap for instance) that types are fully qualified, because
12332         we dump all the types in the namespace, and we should really have
12333         types inserted into the proper namespace, so we can only store the
12334         basenames in the defined_names array.
12335
12336 2002-10-10  Martin Baulig  <martin@gnome.org>
12337
12338         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12339         from bug #31834, see the bug report for a testcase which is
12340         miscompiled.
12341
12342 2002-10-10  Martin Baulig  <martin@gnome.org>
12343
12344         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12345         flow analysis code for this.
12346
12347         * statement.cs (Do, While, For): Tell the flow analysis code about
12348         infinite loops.
12349         (FlowBranching.UsageVector): Added support for infinite loops.
12350         (Block.Resolve): Moved the dead code elimination here and use flow
12351         analysis to do it.
12352
12353 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12354
12355         * class.cs (Field.Define): Catch cycles on struct type
12356         definitions. 
12357
12358         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12359         fields if the fields are static.  We only need to check instance
12360         fields. 
12361
12362         * expression.cs (As.DoResolve): Test for reference type.
12363
12364         * statement.cs (Using.ResolveExpression): Use
12365         ConvertImplicitRequired, not ConvertImplicit which reports an
12366         error on failture
12367         (Using.ResolveLocalVariableDecls): ditto.
12368
12369         * expression.cs (Binary.ResolveOperator): Report errors in a few
12370         places where we had to.
12371
12372         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12373
12374 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12375
12376         * expression.cs: Use StoreFromPtr instead of extracting the type
12377         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12378
12379         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12380         an enumeration value to a System.Enum, but System.Enum is not a
12381         value type, but an class type, so we need to box.
12382
12383         (Expression.ConvertExplicit): One codepath could return
12384         errors but not flag them.  Fix this.  Fixes #31853
12385
12386         * parameter.cs (Resolve): Do not allow void as a parameter type.
12387
12388 2002-10-06  Martin Baulig  <martin@gnome.org>
12389
12390         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12391         if it's a class type and not a struct.  Fixes #31815.
12392
12393 2002-10-06  Martin Baulig  <martin@gnome.org>
12394
12395         * statement.cs: Reworked the flow analysis code a bit to make it
12396         usable for dead code elimination.
12397
12398 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12399
12400         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12401
12402 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12403
12404         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12405         to fix the test 165, will investigate deeper.
12406
12407 2002-10-04  Martin Baulig  <martin@gnome.org>
12408
12409         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12410         finally blocks actually work.
12411         (Try.Resolve): We don't need to create a sibling for `finally' if
12412         there is no finally block.
12413
12414 2002-10-04  Martin Baulig  <martin@gnome.org>
12415
12416         * class.cs (Constructor.Define): The default accessibility for a
12417         non-default constructor is private, not public.
12418
12419 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12420
12421         * class.cs (Constructor): Make AllowedModifiers public, add
12422         EXTERN.
12423
12424         * cs-parser.jay: Perform the modifiers test here, as the
12425         constructor for the Constructor class usually receives a zero
12426         because of the way we create it (first we create, later we
12427         customize, and we were never checking the modifiers).
12428
12429         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12430         is a version of LookupTypeReflection that includes the type-name
12431         cache.  This can be used as a fast path for functions that know
12432         the fully qualified name and are only calling into *.GetType() to
12433         obtain a composed type.
12434
12435         This is also used by TypeManager.LookupType during its type
12436         composition.
12437
12438         (LookupType): We now also track the real type name, as sometimes
12439         we can get a quey for the real type name from things like
12440         ComposedCast.  This fixes bug 31422.
12441
12442         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12443         complete type fullname, it does not have to go through the type
12444         resolution system to obtain the composed version of the type (for
12445         obtaining arrays or pointers).
12446
12447         (Conditional.Emit): Use the EmitBoolExpression to
12448         generate nicer code, as requested by Paolo.
12449
12450         (ArrayCreation.CheckIndices): Use the patch from
12451         hwang_rob@yahoo.ca to validate the array initializers. 
12452
12453 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * class.cs (ConstructorInitializer.Emit): simplify code by using
12456         Invocation.EmitCall, and at the same time, fix the bugs in calling
12457         parent constructors that took variable arguments. 
12458
12459         * ecore.cs (Expression.ConvertNumericExplicit,
12460         Expression.ImplicitNumericConversion): Remove the code that
12461         manually wrapped decimal (InternalTypeConstructor call is now gone
12462         as well).
12463
12464         * expression.cs (Cast.TryReduce): Also handle decimal types when
12465         trying to perform a constant fold on the type.
12466
12467         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12468
12469         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12470         that only turned off an error report, and did nothing else. 
12471
12472 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12473
12474         * driver.cs: Handle and ignore /fullpaths
12475
12476 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12477
12478         * expression.cs (Binary.ResolveOperator): Catch the case where
12479         DoNumericPromotions returns true, 
12480
12481         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12482
12483 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12484
12485         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12486         report error 70.
12487
12488 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12489
12490         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12491         conversion exists, but it is also required that the conversion be
12492         performed.  This manifested in "(Type64Enum) 2".  
12493
12494         * class.cs (TypeManager.AddMethod): The fix is not to change
12495         AddEnum, because that one was using a fully qualified name (every
12496         DeclSpace derivative does), but to change the AddMethod routine
12497         that was using an un-namespaced name.  This now correctly reports
12498         the duplicated name.
12499
12500         Revert patch until I can properly fix it.  The issue
12501         is that we have a shared Type space across all namespaces
12502         currently, which is wrong.
12503
12504         Options include making the Namespace a DeclSpace, and merge
12505         current_namespace/current_container in the parser.
12506
12507 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12508
12509         * cs-parser.jay: Improve error reporting when we get a different
12510         kind of expression in local_variable_type and
12511         local_variable_pointer_type. 
12512
12513         Propagate this to avoid missleading errors being reported.
12514
12515         * ecore.cs (ImplicitReferenceConversion): treat
12516         TypeManager.value_type as a target just like object_type.   As
12517         code like this:
12518
12519         ValueType v = 1;
12520
12521         Is valid, and needs to result in the int 1 being boxed before it
12522         is assigned to the value type v.
12523
12524         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12525         to validate the enumeration name.
12526
12527         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12528         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12529         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12530
12531         * ecore.cs (TryImplicitIntConversion): When doing an
12532         implicit-enumeration-conversion, check if the type is 64-bits and
12533         perform a conversion before passing to EnumConstant.
12534
12535 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12536
12537         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12538         report ambiguous type references.  Unlike the MS version, we
12539         report what the ambiguity is.   Innovation at work ;-)
12540
12541         (DeclSpace.FindType): Require a location argument to
12542         display when we display an ambiguous error.
12543
12544         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12545
12546         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12547
12548         * expression.cs (EmitDynamicInitializers): Apply patch from
12549         hwang_rob@yahoo.ca that fixes the order in which we emit our
12550         initializers. 
12551
12552 2002-09-21  Martin Baulig  <martin@gnome.org>
12553
12554         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12555         delegate takes no arguments.
12556
12557 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12558
12559         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12560         from integers.
12561
12562         * expression.cs: Extract the underlying type.
12563
12564         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12565
12566         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12567
12568 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12569
12570         * class.cs (TypeContainer.DefineType): We can not use the nice
12571         PackingSize with the size set to 1 DefineType method, because it
12572         will not allow us to define the interfaces that the struct
12573         implements.
12574
12575         This completes the fixing of bug 27287
12576
12577         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12578         means also structs.  This fixes part of the problem. 
12579         (Expresion.ImplicitReferenceConversionExists): ditto.
12580
12581         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12582         error if there were no errors reported during the type lookup
12583         process, to avoid duplicates or redundant errors.  Without this
12584         you would get an ambiguous errors plus a type not found.  We have
12585         beaten the user enough with the first error.  
12586
12587         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12588         reference. 
12589
12590         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12591         during the resolution process, stop the lookup, this avoids
12592         repeated error reports (same error twice).
12593
12594         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12595
12596         * typemanager.cs (LookupType): Redo the type lookup code to match
12597         the needs of System.Reflection.  
12598
12599         The issue is that System.Reflection requires references to nested
12600         types to begin with a "+" sign instead of a dot.  So toplevel
12601         types look like: "NameSpace.TopLevelClass", and nested ones look
12602         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12603         levels. 
12604
12605 2002-09-19  Martin Baulig  <martin@gnome.org>
12606
12607         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12608         says that a method always returns or always throws an exception,
12609         don't report the CS0161.
12610
12611         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12612         set `Returns = new_returns'.
12613
12614 2002-09-19  Martin Baulig  <martin@gnome.org>
12615
12616         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12617         to an enum constant, check for a CS0176.
12618
12619 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12620
12621         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12622         for operators that must be in pairs and report errors.
12623
12624         * ecore.cs (SimpleName.DoResolveType): During the initial type
12625         resolution process, when we define types recursively, we must
12626         check first for types in our current scope before we perform
12627         lookups in the enclosing scopes.
12628
12629         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12630
12631         (Invocation.VerifyArgumentsCompat): Call
12632         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12633         I thought we were supposed to always call this, but there are a
12634         few places in the code where we dont do it.
12635
12636 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * driver.cs: Add support in -linkres and -resource to specify the
12639         name of the identifier.
12640
12641 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * ecore.cs (StandardConversionExists): Sync with the conversion
12644         code: allow anything-* to void* conversions.
12645
12646         (FindMostSpecificSource): Use an Expression argument
12647         instead of a Type, because we might be handed over a Literal which
12648         gets a few more implicit conversions that plain types do not.  So
12649         this information was being lost.
12650
12651         Also, we drop the temporary type-holder expression when not
12652         required.
12653
12654 2002-09-17  Martin Baulig  <martin@gnome.org>
12655
12656         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12657         this is an explicit interface implementation.
12658
12659 2002-09-17  Martin Baulig  <martin@gnome.org>
12660
12661         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12662         different `IndexerName' attributes.
12663
12664         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12665         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12666         virtual CommonResolve().
12667
12668 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12671         and convert that to the UnderlyingType.
12672
12673         * statement.cs (Foreach.Resolve): Indexers are just like variables
12674         or PropertyAccesses.
12675
12676         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12677         inside quoted strings, we were not doing this before.
12678
12679 2002-09-16  Martin Baulig  <martin@gnome.org>
12680
12681         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12682         resolve it.  This is needed for the definite assignment check of the
12683         instance expression, fixes bug #29846.
12684         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12685
12686 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12687
12688         * parameter.cs: Fix compile error.  Cannot reference static member
12689         from an instance object.  Is this an mcs bug?
12690
12691 2002-09-14  Martin Baulig  <martin@gnome.org>
12692
12693         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12694         multiple times.  Fixes bug #30295, added test-166.cs.
12695
12696 2002-09-14  Martin Baulig  <martin@gnome.org>
12697
12698         * statement.cs (Block.Emit): Don't emit unreachable code.
12699         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12700         `break' statements.
12701         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12702
12703 2002-09-14  Martin Baulig  <martin@gnome.org>
12704
12705         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12706         is set.
12707
12708 2002-09-14  Martin Baulig  <martin@gnome.org>
12709
12710         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12711         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12712         be false on the ms runtime.
12713
12714 2002-09-13  Martin Baulig  <martin@gnome.org>
12715
12716         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12717         the CS0038 error message.
12718
12719 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12720
12721         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12722         constant inside, return it.
12723
12724 2002-09-12  Martin Baulig  <martin@gnome.org>
12725
12726         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12727         implicit conversion can be done between enum types.
12728
12729         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12730         check whether an implicit conversion to the current enum's UnderlyingType
12731         exists and report an error if not.
12732
12733         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12734         without debugging support.
12735
12736         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12737         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12738
12739 2002-09-12  Martin Baulig  <martin@gnome.org>
12740
12741         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12742
12743         * ecore.cs (IMemberExpr.DeclaringType): New property.
12744         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12745         nonstatic member of an outer type (CS0038).
12746
12747 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12748
12749         * driver.cs: Activate the using-error detector at warning level
12750         4 (at least for MS-compatible APIs).
12751
12752         * namespace.cs (VerifyUsing): Small buglett fix.
12753
12754         * pending.cs (PendingImplementation): pass the container pointer. 
12755
12756         * interface.cs (GetMethods): Allow for recursive definition.  Long
12757         term, I would like to move every type to support recursive
12758         definitions, not the current ordering mechanism that we have right
12759         now.
12760
12761         The situation is this: Attributes are handled before interfaces,
12762         so we can apply attributes to interfaces.  But some attributes
12763         implement interfaces, we will now handle the simple cases
12764         (recursive definitions will just get an error).  
12765
12766         * parameter.cs: Only invalidate types at the end if we fail to
12767         lookup all types.  
12768
12769 2002-09-09  Martin Baulig  <martin@gnome.org>
12770
12771         * ecore.cs (PropertyExpr.Emit): Also check for
12772         TypeManager.system_int_array_get_length so this'll also work when
12773         compiling corlib.  Fixes #30003.
12774
12775 2002-09-09  Martin Baulig  <martin@gnome.org>
12776
12777         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12778         and throw an exception if we can't get the type's size.  Fixed #30040,
12779         added test-165.cs.
12780
12781 2002-09-09  Martin Baulig  <martin@gnome.org>
12782
12783         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12784
12785         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12786         context.  Fixes bug #30027.
12787
12788         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12789         virtual functions.  Fixes bug #30043, added test-164.cs.
12790
12791 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12792
12793         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12794
12795 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12796
12797         * driver.cs: Use an object to get the windows codepage since it's not a
12798         static property.
12799
12800 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * statement.cs (For.Emit): for infinite loops (test == null)
12803         return whether there is a break inside, not always "true".
12804
12805         * namespace.cs (UsingEntry): New struct to hold the name of the
12806         using definition, the location where it is defined, and whether it
12807         has been used in a successful type lookup.
12808
12809         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12810         strings.
12811
12812         * decl.cs: ditto.
12813
12814 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12815
12816         * attribute.cs : Fix incorrect code which relied on catching
12817         a NullReferenceException to detect a null being passed in
12818         where an object was expected.
12819
12820 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12821
12822         * statement.cs (Try): flag the catch variable as assigned
12823
12824         * expression.cs (Cast): Simplified by using ResolveType instead of
12825         manually resolving.
12826
12827         * statement.cs (Catch): Fix bug by using ResolveType.
12828
12829 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12830
12831         * expression.cs (BetterConversion): Special case for when we have
12832         a NullLiteral as the argument and we have to choose between string
12833         and object types - we choose string the way csc does.
12834
12835         * attribute.cs (Attribute.Resolve): Catch the
12836         NullReferenceException and report error #182 since the Mono
12837         runtime no more has the bug and having this exception raised means
12838         we tried to select a constructor which takes an object and is
12839         passed a null.
12840
12841 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12842
12843         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12844         message (1502, 1503) when we can't locate a method after overload
12845         resolution. This is much more informative and closes the bug
12846         Miguel reported.
12847
12848         * interface.cs (PopulateMethod): Return if there are no argument
12849         types. Fixes a NullReferenceException bug.
12850
12851         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12852         expressions too. Previously we were checking only in one place for
12853         positional arguments leaving out named arguments.
12854
12855         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12856         type to the enum type is not allowed. Remove code corresponding to
12857         that.
12858
12859         (ConvertNumericExplicit): Allow explicit conversions from
12860         the underlying type to enum type. This precisely follows the spec
12861         and closes a bug filed by Gonzalo.
12862
12863 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12864
12865         * compiler.csproj:
12866         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12867
12868 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12869
12870         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12871         it was important that we stored the right value after the
12872         reduction in `converted'.
12873
12874 2002-09-04  Martin Baulig  <martin@gnome.org>
12875
12876         * location.cs (Location.SymbolDocument): Use full pathnames for the
12877         source files.
12878
12879 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12880
12881         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12882         of the expression resolve mechanism, because that will catch the
12883         SimpleName error failures.
12884
12885         (Conditional): If we can not resolve the
12886         expression, return, do not crash.
12887
12888 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12889
12890         * cs-tokenizer.cs:
12891         (location): display token name instead of its number.
12892
12893 2002-08-28  Martin Baulig  <martin@gnome.org>
12894
12895         * expression.cs (Binary.ResolveOperator): Don't silently return
12896         but return an error if an operator cannot be applied between two
12897         enum types.
12898
12899 2002-08-28  Martin Baulig  <martin@gnome.org>
12900
12901         * class.cs (Constructor.Define): Set the permission attributes
12902         correctly instead of making all constructors public.
12903
12904 2002-08-28  Martin Baulig  <martin@gnome.org>
12905
12906         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12907         for private members before reporting a CS0103; if we find anything,
12908         it's a CS0122.
12909
12910 2002-08-28  Martin Baulig  <martin@gnome.org>
12911
12912         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12913         to check whether `closure_start_type == closure_invocation_type',
12914         we also need to check whether `m.DeclaringType == closure_invocation_type'
12915         before bypassing the permission checks.  We might be accessing
12916         protected/private members from the base class.
12917         (TypeManager.RealMemberLookup): Only set private_ok if private
12918         members were requested via BindingFlags.NonPublic.
12919
12920         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12921
12922         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12923         MethodGroupExpr.IsExplicitImpl if appropriate.
12924         (Invocation.DoResolve): Don't report the CS0120 for explicit
12925         interface implementations.
12926
12927 2002-08-27  Martin Baulig  <martin@gnome.org>
12928
12929         * expression.cs (Invocation.DoResolve): If this is a static
12930         method and we don't have an InstanceExpression, we must report
12931         a CS0120.
12932
12933 2002-08-25  Martin Baulig  <martin@gnome.org>
12934
12935         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12936         `==' between a valuetype and an object.
12937
12938 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * ecore.cs (TypeExpr): Provide a ToString method.
12941
12942 2002-08-24  Martin Baulig  <martin@gnome.org>
12943
12944         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12945         now called proggie.dbg and it's a binary file.
12946
12947 2002-08-23  Martin Baulig  <martin@gnome.org>
12948
12949         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12950
12951 2002-08-23  Martin Baulig  <martin@gnome.org>
12952
12953         * struct.cs (MyStructInfo.ctor): Make this work with empty
12954         structs; it's not allowed to use foreach() on null.
12955
12956 2002-08-23  Martin Baulig  <martin@gnome.org>
12957
12958         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12959         writer the full pathname of the generated assembly.
12960
12961 2002-08-23  Martin Baulig  <martin@gnome.org>
12962
12963         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12964         A `finally' block never returns or breaks; improved handling of
12965         unreachable code.
12966
12967 2002-08-23  Martin Baulig  <martin@gnome.org>
12968
12969         * statement.cs (Throw.Resolve): Allow `throw null'.
12970
12971 2002-08-23  Martin Baulig  <martin@gnome.org>
12972
12973         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12974         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12975         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12976         MemberLookup would return a wrong event if this is an explicit
12977         interface implementation and the class has an event with the same
12978         name.
12979
12980 2002-08-23  Martin Baulig  <martin@gnome.org>
12981
12982         * statement.cs (Block.AddChildVariableNames): New public method.
12983         (Block.AddChildVariableName): Likewise.
12984         (Block.IsVariableNameUsedInChildBlock): Likewise.
12985         (Block.AddVariable): Check whether a variable name has already
12986         been used in a child block.
12987
12988         * cs-parser.jay (declare_local_variables): Mark all variable names
12989         from the current block as being used in a child block in the
12990         implicit block.
12991
12992 2002-08-23  Martin Baulig  <martin@gnome.org>
12993
12994         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12995         find the symbol writer.
12996
12997         * driver.cs: csc also allows the arguments to /define being
12998         separated by commas, not only by semicolons.
12999
13000 2002-08-23  Martin Baulig  <martin@gnome.org>
13001
13002         * interface.cs (Interface.GetMembers): Added static check for events.
13003
13004 2002-08-15  Martin Baulig  <martin@gnome.org>
13005
13006         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13007         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13008
13009         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13010         why the MethodData.EmitDestructor() change was necessary.
13011
13012 2002-08-20  Martin Baulig  <martin@gnome.org>
13013
13014         * class.cs (TypeContainer.FindMembers): Added static check for events.
13015
13016         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13017
13018         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13019         use Type.GetEvents(), not Type.FindMembers().
13020
13021 2002-08-20  Martin Baulig  <martin@gnome.org>
13022
13023         * decl.cs (MemberCache): Added a special method cache which will
13024         be used for method-only searched.  This ensures that a method
13025         search will return a MethodInfo with the correct ReflectedType for
13026         inherited methods.      
13027
13028 2002-08-20  Martin Baulig  <martin@gnome.org>
13029
13030         * decl.cs (DeclSpace.FindMembers): Made this public.
13031
13032 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13033
13034         * delegate.cs: fixed build on windows.
13035         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13036
13037 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13038
13039         * ecore.cs (StandardConversionExists): Return a false
13040         if we are trying to convert the void type to anything else
13041         since that is not allowed.
13042
13043         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13044         we flag error 70 in the event an event is trying to be accessed
13045         directly from outside the declaring type.
13046
13047 2002-08-20  Martin Baulig  <martin@gnome.org>
13048
13049         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13050         MemberCache from typemanager.cs to decl.cs.
13051
13052 2002-08-19  Martin Baulig  <martin@gnome.org>
13053
13054         * class.cs (TypeContainer): Implement IMemberContainer.
13055         (TypeContainer.DefineMembers): Create the MemberCache.
13056         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13057         return public members if BindingFlags.Public was given, check
13058         whether members are static.
13059
13060 2002-08-16  Martin Baulig  <martin@gnome.org>
13061
13062         * decl.cs (DeclSpace.Define): Splitted this in Define and
13063         DefineMembers.  DefineMembers is called first and initializes the
13064         MemberCache.
13065
13066         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13067         DefineMembers() on all our DeclSpaces.
13068
13069         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13070         but call DefineMembers() on all nested interfaces.  We call their
13071         Define() in our new Define() function.
13072
13073         * interface.cs (Interface): Implement IMemberContainer.
13074         (Interface.Define): Moved all code except the attribute stuf to
13075         DefineMembers().
13076         (Interface.DefineMembers): Initialize the member cache.
13077
13078         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13079         need this anymore since we can use MemberCache.FindMembers directly.
13080
13081 2002-08-19  Martin Baulig  <martin@gnome.org>
13082
13083         * typemanager.cs (MemberCache): When creating the cache for an
13084         interface type, add all inherited members.
13085         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13086         to `out bool used_cache' and documented it.
13087         (TypeManager.MemberLookup): If we already used the cache in the first
13088         iteration, we don't need to do the interfaces check.
13089
13090 2002-08-19  Martin Baulig  <martin@gnome.org>
13091
13092         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13093         here from IMemberFinder and don't implement this interface anymore.
13094         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13095
13096         * typemanager.cs (IMemberFinder): This interface is now only used by
13097         classes which actually support the member cache.
13098         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13099         since we only put DeclSpaces into this Hashtable.
13100         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13101         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13102
13103 2002-08-16  Martin Baulig  <martin@gnome.org>
13104
13105         * typemanager.cs (ICachingMemberFinder): Removed.
13106         (IMemberFinder.MemberCache): New property.
13107         (TypeManager.FindMembers): Merged this with RealFindMembers().
13108         This function will never be called from TypeManager.MemberLookup()
13109         so we can't use the cache here, just the IMemberFinder.
13110         (TypeManager.MemberLookup_FindMembers): Check whether the
13111         IMemberFinder has a MemberCache and call the cache's FindMembers
13112         function.
13113         (MemberCache): Rewrote larger parts of this yet another time and
13114         cleaned it up a bit.
13115
13116 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13117
13118         * driver.cs (LoadArgs): Support quoting.
13119
13120         (Usage): Show the CSC-like command line arguments.
13121
13122         Improved a few error messages.
13123
13124 2002-08-15  Martin Baulig  <martin@gnome.org>
13125
13126         * typemanager.cs (IMemberContainer.Type): New property.
13127         (IMemberContainer.IsInterface): New property.
13128
13129         The following changes are conditional to BROKEN_RUNTIME, which is
13130         defined at the top of the file.
13131
13132         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13133         class'es members, but add all members from TypeHandle.ObjectType
13134         if we're an interface.
13135         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13136         is the current type.
13137         (MemberCache.CacheEntry.Container): Removed this field.
13138         (TypeHandle.GetMembers): Include inherited members.
13139
13140 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13141
13142         * typemanager.cs: fixed compilation and added a comment on a field that
13143         is never used.
13144
13145 2002-08-15  Martin Baulig  <martin@gnome.org>
13146
13147         * class.cs (ConstructorInitializer.Resolve): In the
13148         Expression.MemberLookup call, use the queried_type as
13149         invocation_type.
13150
13151         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13152         declared' attribute, it's always true.
13153         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13154         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13155         temporary wrapper for FindMembers which tells MemberLookup whether
13156         members from the base classes are included in the return value.
13157         This will go away soon.
13158         (TypeManager.MemberLookup): Use this temporary hack here; once the
13159         new MemberCache is completed, we don't need to do the DeclaredOnly
13160         looping here anymore since the MemberCache will take care of this.
13161         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13162         (MemberCache): When creating the MemberCache for a class, get
13163         members from the current class and all its base classes.
13164         (MemberCache.CacheEntry.Container): New field.  This is a
13165         temporary hack until the Mono runtime is fixed to distinguish
13166         between ReflectedType and DeclaringType.  It allows us to use MCS
13167         with both the MS runtime and the unfixed Mono runtime without
13168         problems and without accecting performance.
13169         (MemberCache.SearchMembers): The DeclaredOnly looping from
13170         TypeManager.MemberLookup is now done here.      
13171
13172 2002-08-14  Martin Baulig  <martin@gnome.org>
13173
13174         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13175         Type.GetFields on dynamic types but get the fields from the
13176         corresponding TypeContainer.
13177         (MyStructInfo.GetStructInfo): Added check for enum types.
13178
13179         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13180         (MemberList.SyncRoot): Implemented.
13181         (TypeManager.FilterWithClosure): No need to check permissions if
13182         closure_start_type == closure_invocation_type, don't crash if
13183         closure_invocation_type is null.
13184
13185 2002-08-13  Martin Baulig  <martin@gnome.org>
13186
13187         Rewrote TypeContainer.FindMembers to use a member cache.  This
13188         gives us a speed increase of about 35% for the self-hosting MCS
13189         build and of about 15-20% for the class libs (both on GNU/Linux).
13190
13191         * report.cs (Timer): New class to get enhanced profiling.  This
13192         whole class is "TIMER" conditional since it remarkably slows down
13193         compilation speed.
13194
13195         * class.cs (MemberList): New class.  This is an IList wrapper
13196         which we're now using instead of passing MemberInfo[]'s around to
13197         avoid copying this array unnecessarily.
13198         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13199         (ICachingMemberFinder, IMemberContainer): New interface.
13200         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13201         has already been checked, otherwise use it for the name comparision.
13202         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13203         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13204         if possible.  Returns a MemberList, not a MemberInfo [].
13205         (TypeHandle): New class, implements IMemberContainer.  We create
13206         one instance of this class per type, it contains a MemberCache
13207         which is used to do the member lookups.
13208         (MemberCache): New class.  Each instance of this class contains
13209         all members of a type and a name-based hash table.
13210         (MemberCache.FindMembers): This is our new member lookup
13211         function.  First, it looks up all members of the requested name in
13212         the hash table.  Then, it walks this list and sorts out all
13213         applicable members and returns them.
13214
13215 2002-08-13  Martin Baulig  <martin@gnome.org>
13216
13217         In addition to a nice code cleanup, this gives us a performance
13218         increase of about 1.4% on GNU/Linux - not much, but it's already
13219         half a second for the self-hosting MCS compilation.
13220
13221         * typemanager.cs (IMemberFinder): New interface.  It is used by
13222         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13223         Enum, Delegate or Interface.
13224         (TypeManager.finder_to_member_finder): New PtrHashtable.
13225         (TypeManager.finder_to_container): Removed.
13226         (TypeManager.finder_to_delegate): Removed.
13227         (TypeManager.finder_to_interface): Removed.
13228         (TypeManager.finder_to_enum): Removed.
13229
13230         * interface.cs (Interface): Implement IMemberFinder.
13231
13232         * delegate.cs (Delegate): Implement IMemberFinder.
13233
13234         * enum.cs (Enum): Implement IMemberFinder.
13235
13236         * class.cs (TypeContainer): Implement IMemberFinder.
13237
13238 2002-08-12  Martin Baulig  <martin@gnome.org>
13239
13240         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13241
13242 2002-08-12  Martin Baulig  <martin@gnome.org>
13243
13244         * ecore.cs (ITypeExpression): New interface for expressions which
13245         resolve to a type.
13246         (TypeExpression): Renamed to TypeLookupExpression.
13247         (Expression.DoResolve): If we're doing a types-only lookup, the
13248         expression must implement the ITypeExpression interface and we
13249         call DoResolveType() on it.
13250         (SimpleName): Implement the new ITypeExpression interface.
13251         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13252         hack, the situation that we're only looking up types can't happen
13253         anymore when this method is called.  Moved the type lookup code to
13254         DoResolveType() and call it.
13255         (SimpleName.DoResolveType): This ITypeExpression interface method
13256         is now doing the types-only lookup.
13257         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13258         (ResolveFlags): Added MaskExprClass.
13259
13260         * expression.cs (MemberAccess): Implement the ITypeExpression
13261         interface.
13262         (MemberAccess.DoResolve): Added support for a types-only lookup
13263         when we're called via ITypeExpression.DoResolveType().
13264         (ComposedCast): Implement the ITypeExpression interface.
13265
13266         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13267         Expression.Resolve() with ResolveFlags.Type instead.
13268
13269 2002-08-12  Martin Baulig  <martin@gnome.org>
13270
13271         * interface.cs (Interface.Define): Apply attributes.
13272
13273         * attribute.cs (Attribute.ApplyAttributes): Added support for
13274         interface attributes.
13275
13276 2002-08-11  Martin Baulig  <martin@gnome.org>
13277
13278         * statement.cs (Block.Emit): Only check the "this" variable if we
13279         do not always throw an exception.
13280
13281         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13282         whether the property has a set accessor.
13283
13284 2002-08-11  Martin Baulig  <martin@gnome.org>
13285
13286         Added control flow analysis support for structs.
13287
13288         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13289         with control flow analysis turned off.
13290         (IVariable): New interface.
13291         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13292         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13293         (FieldExpr.DoResolve): Resolve the instance expression with flow
13294         analysis turned off and do the definite assignment check after the
13295         resolving when we know what the expression will resolve to.
13296
13297         * expression.cs (LocalVariableReference, ParameterReference):
13298         Implement the new IVariable interface, only call the flow analysis
13299         code if ec.DoFlowAnalysis is true.
13300         (This): Added constructor which takes a Block argument.  Implement
13301         the new IVariable interface.
13302         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13303         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13304         This does the definite assignment checks for struct members.
13305
13306         * class.cs (Constructor.Emit): If this is a non-static `struct'
13307         constructor which doesn't have any initializer, call
13308         Block.AddThisVariable() to tell the flow analysis code that all
13309         struct elements must be initialized before control returns from
13310         the constructor.
13311
13312         * statement.cs (MyStructInfo): New public class.
13313         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13314         argument to this indexer.  If non-zero, check an individual struct
13315         member, not the whole struct.
13316         (FlowBranching.CheckOutParameters): Check struct members.
13317         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13318         overloaded versions of these methods which take an additional
13319         `int field_idx' argument to check struct members.
13320         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13321         overloaded versions of these methods which take an additional
13322         `string field_name' argument to check struct member.s
13323         (VariableInfo): Implement the IVariable interface.
13324         (VariableInfo.StructInfo): New public property.  Returns the
13325         MyStructInfo instance of the variable if it's a struct or null.
13326         (Block.AddThisVariable): New public method.  This is called from
13327         Constructor.Emit() for non-static `struct' constructor which do
13328         not have any initializer.  It creates a special variable for the
13329         "this" instance variable which will be checked by the flow
13330         analysis code to ensure that all of the struct's fields are
13331         initialized before control returns from the constructor.
13332         (UsageVector): Added support for struct members.  If a
13333         variable/parameter is a struct with N members, we reserve a slot
13334         in the usage vector for each member.  A struct is considered fully
13335         initialized if either the struct itself (slot 0) or all its
13336         members are initialized.
13337
13338 2002-08-08  Martin Baulig  <martin@gnome.org>
13339
13340         * driver.cs (Driver.MainDriver): Only report an error CS5001
13341         if there were no compilation errors.
13342
13343         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13344         `UnsafeContext' property to determine whether the parent is in
13345         unsafe context rather than checking the parent's ModFlags:
13346         classes nested in an unsafe class are unsafe as well.
13347
13348 2002-08-08  Martin Baulig  <martin@gnome.org>
13349
13350         * statement.cs (UsageVector.MergeChildren): Distinguish between
13351         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13352         we return.  Added test17() and test18() to test-154.cs.
13353
13354 2002-08-08  Martin Baulig  <martin@gnome.org>
13355
13356         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13357         Family access, make sure the invoking type isn't a subclass of the
13358         queried type (that'd be a CS1540).
13359
13360         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13361         this method which takes an additional `Type invocation_type'.
13362
13363         * expression.cs (BaseAccess.DoResolve): Use the base type as
13364         invocation and query type.
13365         (MemberAccess.DoResolve): If the lookup failed and we're about to
13366         report a CS0122, try a lookup with the ec.ContainerType - if this
13367         succeeds, we must report a CS1540.
13368
13369 2002-08-08  Martin Baulig  <martin@gnome.org>
13370
13371         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13372         (MethodGroupExpr): Implement the IMemberExpr interface.
13373
13374         * expression (MemberAccess.ResolveMemberAccess): No need to have
13375         any special code for MethodGroupExprs anymore, they're now
13376         IMemberExprs.   
13377
13378 2002-08-08  Martin Baulig  <martin@gnome.org>
13379
13380         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13381         Family, FamANDAssem and FamORAssem permissions.
13382         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13383
13384 2002-08-08  Martin Baulig  <martin@gnome.org>
13385
13386         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13387         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13388         or loop block.
13389
13390 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13391
13392         * driver.cs: implemented /resource option to embed managed resources.
13393
13394 2002-08-07  Martin Baulig  <martin@gnome.org>
13395
13396         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13397         (FieldBase.HasFieldInitializer): New public property.
13398         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13399         returns the field initializer and makes sure it is only resolved once.
13400         (TypeContainer.EmitFieldInitializers): Call
13401         FieldBase.GetInitializerExpression to get the initializer, this ensures
13402         that it isn't resolved multiple times.
13403
13404         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13405         the resolving process (SimpleName/MemberLookup) that we're currently
13406         emitting a field initializer (which must not access any instance members,
13407         this is an error CS0236).
13408
13409         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13410         argument, if the `IsFieldInitializer' flag is set, we must report and
13411         error CS0236 and not an error CS0120.   
13412
13413 2002-08-07  Martin Baulig  <martin@gnome.org>
13414
13415         * ecore.cs (IMemberExpr): New public interface.
13416         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13417         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13418         if the expression is an IMemberExpr.
13419
13420         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13421         to be null, implicitly default to `this' if we're non-static in
13422         this case.  Simplified the code a lot by using the new IMemberExpr
13423         interface.  Also fixed bug #28176 here.
13424
13425 2002-08-06  Martin Baulig  <martin@gnome.org>
13426
13427         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13428         ParameterReferences during semantic analysis so that we can do a
13429         type-only search when resolving Cast, TypeOf and SizeOf.
13430         (block): Pass the `current_local_parameters' to the Block's
13431         constructor.
13432
13433         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13434         argument to the constructor.
13435         (ConstructorInitializer.Resolve): Create a temporary implicit
13436         block with the parameters.
13437
13438         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13439         references here if we aren't doing a type-only search.
13440
13441         * statement.cs (Block): Added constructor which takes a
13442         `Parameters parameters' argument.
13443         (Block.Parameters): New public property.
13444
13445         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13446         to `Parameters' and made it public readonly.
13447
13448 2002-08-06  Martin Baulig  <martin@gnome.org>
13449
13450         * ecore.cs (Expression.Warning): Made this public as well.
13451
13452         * report.cs (Report.Debug): Print the contents of collections.
13453
13454 2002-08-06  Martin Baulig  <martin@gnome.org>
13455
13456         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13457         used to tell Resolve() which kinds of expressions it may return.
13458         (Expression.Resolve): Added overloaded version of this method which
13459         takes a `ResolveFlags flags' argument.  This can be used to tell
13460         Resolve() which kinds of expressions it may return.  Reports a
13461         CS0118 on error.
13462         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13463         ResolveFlags.SimpleName.
13464         (Expression.Error118): Added overloaded version of this method which
13465         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13466         which kinds of expressions are allowed.
13467
13468         * expression.cs (Argument.ResolveMethodGroup): New public method.
13469         Resolves an argument, but allows a MethodGroup to be returned.
13470         This is used when invoking a delegate.
13471
13472         * TODO: Updated a bit.
13473
13474 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13475
13476         Fixed compilation with csc.
13477
13478         * ecore.cs: Expression.Error made public. Is this correct? Should
13479         Warning be made public too?
13480
13481         * expression.cs: use ea.Location instead of ea.loc.
13482         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13483
13484 2002-08-06  Martin Baulig  <martin@gnome.org>
13485
13486         * ecore.cs (Expression.loc): Moved the location here instead of
13487         duplicating it in all derived classes.
13488         (Expression.Location): New public property.
13489         (Expression.Error, Expression.Warning): Made them non-static and
13490         removed the location argument.
13491         (Expression.Warning): Added overloaded version which takes an
13492         `int level' argument.
13493         (Expression.Error118): Make this non-static and removed the
13494         expression and location arguments.
13495         (TypeExpr): Added location argument to the constructor.
13496
13497         * expression.cs (StaticCallExpr): Added location argument to
13498         the constructor.
13499         (Indirection, PointerArithmetic): Likewise.
13500         (CheckedExpr, UnCheckedExpr): Likewise.
13501         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13502         (StringPtr): Likewise.
13503
13504
13505 2002-08-05  Martin Baulig  <martin@gnome.org>
13506
13507         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13508
13509         * assign.cs (Assign.DoResolve): Check whether the source
13510         expression is a value or variable.
13511
13512         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13513         while resolving the corresponding blocks.
13514
13515         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13516         an error, don't silently return null.
13517
13518         * statement.cs (Block.AddVariable): Do the error reporting here
13519         and distinguish between CS0128 and CS0136.
13520         (Block.DoResolve): Report all unused labels (warning CS0164).
13521         (LabeledStatement): Pass the location to the constructor.
13522         (LabeledStatement.HasBeenReferenced): New property.
13523         (LabeledStatement.Resolve): Set it to true here.
13524
13525         * statement.cs (Return.Emit): Return success even after reporting
13526         a type mismatch error (CS0126 or CS0127), this is what csc does and
13527         it avoids confusing the users with any consecutive errors.
13528
13529 2002-08-05  Martin Baulig  <martin@gnome.org>
13530
13531         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13532
13533         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13534
13535         * expression.cs (MemberAccess.DoResolve): Silently return if an
13536         error has already been reported.
13537
13538         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13539         error has already been reported.
13540
13541 2002-08-05  Martin Baulig  <martin@gnome.org>
13542
13543         * statement.cs (UsageVector): Only initialize the `parameters'
13544         vector if we actually have any "out" parameters.
13545
13546 2002-08-05  Martin Baulig  <martin@gnome.org>
13547
13548         * expression.cs (Binary.ResolveOperator): When combining delegates,
13549         they must have the same type.
13550
13551 2002-08-05  Martin Baulig  <martin@gnome.org>
13552
13553         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13554         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13555         work with the ms runtime and we also don't need it: if we're a
13556         PropertyBuilder and not in the `indexer_arguments' hash, then we
13557         are a property and not an indexer.
13558
13559         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13560         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13561         since the latter one doesn't work with the ms runtime.
13562
13563 2002-08-03  Martin Baulig  <martin@gnome.org>
13564
13565         Fixed bugs #27998 and #22735.
13566
13567         * class.cs (Method.IsOperator): New public field.
13568         (Method.CheckBase): Report CS0111 if there's already a method
13569         with the same parameters in the current class.  Report CS0508 when
13570         attempting to change the return type of an inherited method.
13571         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13572         and it's not marked abstract or extern.
13573         (PropertyBase): New abstract base class for Property and Indexer.
13574         (PropertyBase.CheckBase): Moved here from Property and made it work
13575         for indexers.
13576         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13577         the same so we can reuse it there.
13578         (Property, Indexer): Derive from PropertyBase.
13579         (MethodSignature.inheritable_property_signature_filter): New delegate
13580         to find properties and indexers.
13581
13582         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13583         argument and improved error reporting.
13584
13585         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13586         EmptyReadOnlyParameters and made it a property.
13587
13588         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13589         version of this method which takes a `PropertyInfo indexer'.
13590         (TypeManager.RegisterIndexer): New method.
13591
13592         * class.cs: Added myself as author of this file :-)
13593
13594 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13595
13596         * class.cs: fixed compilation on windoze.
13597
13598 2002-08-03  Martin Baulig  <martin@gnome.org>
13599
13600         * interface.cs (Interface.GetInterfaceBases): Check whether all
13601         base interfaces are at least as accessible than the current one.
13602
13603         * class.cs (TypeContainer.GetClassBases): Check whether base types
13604         are at least as accessible than the current type.
13605         (TypeContainer.AsAccessible): Implemented and made non-static.
13606         (MemberBase.CheckParameters): Report errors if the accessibility
13607         checks fail.
13608
13609         * delegate.cs (Delegate.Delegate): The default visibility is
13610         internal for top-level types and private for nested types.
13611         (Delegate.Define): Report errors if the accessibility checks fail.
13612
13613         * enum.cs (Enum.Enum): The default visibility is internal for
13614         top-level types and private for nested types.
13615         (Enum.DefineType): Compute the correct visibility.
13616
13617         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13618         function which takes a `bool is_toplevel' instead of a TypeContainer.
13619
13620         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13621         builtin type.
13622
13623 2002-08-02  Martin Baulig  <martin@gnome.org>
13624
13625         * expression.cs (LocalVariableReferenc): Added constructor which
13626         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13627         (LocalVariableReference.IsReadOnly): New property.
13628         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13629         variable is readonly, use our own readonly flag to do this; you can
13630         use the new constructor to get a writable reference to a read-only
13631         variable.
13632
13633         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13634         reference to the local variable.
13635
13636 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13637
13638         * rootcontext.cs (ResolveCore): Also include System.Exception
13639
13640         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13641         we reach an EmptyStatement.
13642
13643         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13644         is also fine.
13645
13646         * expression.cs (Binary.ResolveOperator): Check error result in
13647         two places.
13648
13649         use brtrue/brfalse directly and avoid compares to null.
13650
13651 2002-08-02  Martin Baulig  <martin@gnome.org>
13652
13653         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13654         Fixes bug #28407, added test-155.cs.
13655
13656 2002-08-01  Martin Baulig  <martin@gnome.org>
13657
13658         * class.cs (Event.EmitDefaultMethod): Make this work with static
13659         events.  Fixes #28311, added verify-3.cs.
13660
13661 2002-08-01  Martin Baulig  <martin@gnome.org>
13662
13663         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13664         `is_disposable' fields.
13665         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13666         `hm.is_disposable' if we're using the collection pattern.
13667         (Foreach.EmitCollectionForeach): Use the correct type for the
13668         enumerator's local variable, only emit the try/finally block if
13669         necessary (fixes #27713).
13670
13671 2002-08-01  Martin Baulig  <martin@gnome.org>
13672
13673         * ecore.cs (Expression.report118): Renamed to Error118 and made
13674         it public static.
13675
13676         * statement.cs (Throw.Resolve): Check whether the expression is of
13677         the correct type (CS0118) and whether the type derives from
13678         System.Exception (CS0155).
13679         (Catch.Resolve): New method.  Do the type lookup here and check
13680         whether it derives from System.Exception (CS0155).
13681         (Catch.CatchType, Catch.IsGeneral): New public properties.
13682
13683         * typemanager.cs (TypeManager.exception_type): Added.
13684
13685 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13686
13687         * driver.cs: Updated About function.
13688
13689 2002-07-31  Martin Baulig  <martin@gnome.org>
13690
13691         Implemented Control Flow Analysis.
13692
13693         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13694         (EmitContext.CurrentBranching): Added.
13695         (EmitContext.StartFlowBranching): Added.
13696         (EmitContext.EndFlowBranching): Added.
13697         (EmitContext.KillFlowBranching): Added.
13698         (EmitContext.IsVariableAssigned): Added.
13699         (EmitContext.SetVariableAssigned): Added.
13700         (EmitContext.IsParameterAssigned): Added.
13701         (EmitContext.SetParameterAssigned): Added.
13702         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13703         Added control flow analysis stuff here.
13704
13705         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13706         resolve the expression as lvalue.
13707         (LocalVariableReference.DoResolve): Check whether the variable has
13708         already been assigned.
13709         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13710         the parameter as assigned here.
13711         (ParameterReference.DoResolve): Check whether the parameter has already
13712         been assigned.
13713         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13714         expression as lvalue.
13715
13716         * statement.cs (FlowBranching): New class for the flow analysis code.
13717         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13718         (LabeledStatement.IsDefined): New public property.
13719         (LabeledStatement.AddUsageVector): New public method to tell flow
13720         analyis that the label may be reached via a forward jump.
13721         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13722         flow analysis.
13723         (VariableInfo.Number): New public field.  This is used by flow analysis
13724         to number all locals of a block.
13725         (Block.CountVariables): New public property.  This is the number of
13726         local variables in this block (including the locals from all parent
13727         blocks).
13728         (Block.EmitMeta): Number all the variables.
13729
13730         * statement.cs: Added flow analysis support to all classes.
13731
13732 2002-07-31  Martin Baulig  <martin@gnome.org>
13733
13734         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13735         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13736         then use this argument.
13737
13738         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13739
13740         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13741         use this to specify /define options.
13742
13743 2002-07-29  Martin Baulig  <martin@gnome.org>
13744
13745         * statement.cs (Fixed): Moved all code that does variable lookups
13746         and resolvings from Emit to Resolve.
13747
13748         * statement.cs (For): Moved all code that does variable lookups
13749         and resolvings from Emit to Resolve.
13750
13751         * statement.cs (Using): Moved all code that does variable lookups
13752         and resolvings from Emit to Resolve.
13753
13754 2002-07-29  Martin Baulig  <martin@gnome.org>
13755
13756         * attribute.cs (Attribute.Resolve): Explicitly catch a
13757         System.NullReferenceException when creating the
13758         CustromAttributeBuilder and report a different warning message.
13759
13760 2002-07-29  Martin Baulig  <martin@gnome.org>
13761
13762         * support.cs (ParameterData.ParameterName): Added method to
13763         get the name of a parameter.
13764
13765         * typemanager.cs (TypeManager.IsValueType): New public method.
13766
13767 2002-07-29  Martin Baulig  <martin@gnome.org>
13768
13769         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13770         is a flag which specifies that it's either ref or out.
13771         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13772         the out parameter to `out Parameter.Modifier mod', also set the
13773         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13774
13775         * support.cs (InternalParameters.ParameterModifier): Distinguish
13776         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13777         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13778
13779         * expression.cs (Argument.GetParameterModifier): Distinguish
13780         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13781         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13782
13783 2002-07-29  Martin Baulig  <martin@gnome.org>
13784
13785         * expression.cs (ParameterReference.ParameterReference): Added
13786         `Location loc' argument to the constructor.
13787
13788         * cs-parser.jay: Pass location to ParameterReference.
13789
13790 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13791
13792         * statement.cs (Try): Initialize the location.
13793
13794         * cs-parser.jay: pass location to Try.
13795
13796         * expression.cs (Unary.Reduce): Change the prototype to return
13797         whether a constant fold could be performed or not.  The result is
13798         returned in an out parameters.  In the case of Indirection and
13799         AddressOf, we want to perform the full tests.
13800
13801 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13802
13803         * statement.cs (Statement.Emit): Flag dead code.
13804
13805 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13806
13807         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13808
13809 2002-07-27  Martin Baulig  <martin@gnome.org>
13810
13811         * class.cs (MethodData.Define): Put back call to
13812         TypeManager.AddMethod(), accidentally commented this out.
13813
13814         * report.cs (Debug): New public method to print debugging information,
13815         this is `[Conditional ("DEBUG")]'.
13816
13817 2002-07-26  Martin Baulig  <martin@gnome.org>
13818
13819         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13820         (switch_statement): Push the current_block to the switch_stack and
13821         pop it again when we're done with the switch.
13822         (switch_section): The new block is a child of the current_block.
13823         Fixes bug #24007, added test-152.cs.
13824
13825 2002-07-27  Martin Baulig  <martin@gnome.org>
13826
13827         * expression.cs (Invocation.EmitArguments): When calling a varargs
13828         function with only its fixed arguments, we need to pass an empty
13829         array.
13830
13831 2002-07-27  Martin Baulig  <martin@gnome.org>
13832
13833         Mono 0.13 has been released.
13834
13835 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13836
13837         * driver.cs: Rename --resource to --linkres, because that is what
13838         we do currently, we dont support --resource yet.
13839
13840         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13841
13842 2002-07-25  Martin Baulig  <martin@gnome.org>
13843
13844         * class.cs (MethodData): New public class.  This is a `method builder'
13845         class for a method or one accessor of a Property/Indexer/Event.
13846         (MethodData.GetMethodFlags): Moved here from MemberBase.
13847         (MethodData.ApplyAttributes): Likewise.
13848         (MethodData.ApplyObsoleteAttribute): Likewise.
13849         (MethodData.ApplyConditionalAttribute): Likewise.
13850         (MethodData.ApplyDllImportAttribute): Likewise.
13851         (MethodData.CheckAbstractAndExternal): Likewise.
13852         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13853         (MethodData.Emit): Formerly known as Method.Emit().
13854         (MemberBase): Moved everything which was specific to a single
13855         accessor/method to MethodData.
13856         (Method): Create a new MethodData and call Define() and Emit() on it.
13857         (Property, Indexer, Event): Create a new MethodData objects for each
13858         accessor and call Define() and Emit() on them.
13859
13860 2002-07-25  Martin Baulig  <martin@gnome.org>
13861
13862         Made MethodCore derive from MemberBase to reuse the code from there.
13863         MemberBase now also checks for attributes.
13864
13865         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13866         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13867         as virtual.
13868         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13869         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13870         (MemberBase.ApplyAttributes): New virtual method; applies the
13871         attributes to a method or accessor.
13872         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13873         (MemberBase.ApplyConditionalAttribute): Likewise.
13874         (MemberBase.ApplyDllImportAttribute): Likewise.
13875         (MemberBase.CheckAbstractAndExternal): Likewise.
13876         (MethodCore.ParameterTypes): This is now a property instead of a
13877         method, it's initialized from DoDefineParameters().
13878         (MethodCore.ParameterInfo): Removed the set accessor.
13879         (MethodCore.DoDefineParameters): New protected virtual method to
13880         initialize ParameterTypes and ParameterInfo.
13881         (Method.GetReturnType): We can now simply return the MemberType.
13882         (Method.GetMethodFlags): Override the MemberBase version and add
13883         the conditional flags.
13884         (Method.CheckBase): Moved some code from Define() here, call
13885         DoDefineParameters() here.
13886         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13887         here to avoid some larger code duplication.
13888         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13889         ensure that abstract and external accessors don't declare a body.
13890
13891         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13892         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13893         lookup in the attribute's parent classes, so we need to abort as soon
13894         as we found the first match.
13895         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13896         the attribute has no arguments.
13897
13898         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13899         of a Method.
13900
13901 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13902
13903         * cs-parser.jay: reverted previous patch.
13904
13905 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13906
13907         * cs-parser.jay: fixed bug #22119.
13908
13909 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13910
13911         * attribute.cs: fixed compilation. The error was:
13912         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13913         be assigned to before control leaves the current method."
13914         [FIXME:  Filed as bug #28186: MCS must report this error.]
13915
13916 2002-07-25  Martin Baulig  <martin@gnome.org>
13917
13918         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13919         method to pull the condition name ouf of a Conditional attribute.
13920         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13921         the obsolete message and error flag out of an Obsolete attribute.
13922
13923         * class.cs (Method.GetMethodFlags): New public method to get the
13924         TypeManager.MethodFlags for this method.
13925         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13926         private methods.
13927         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13928         if we're overriding a virtual function, set the new private variable
13929         `parent_method'; call the new TypeManager.AddMethod().
13930
13931         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13932         the MethodBuilder and the Method in a PtrHashtable.
13933         (TypeManager.builder_to_method): Added for this purpose.
13934         (TypeManager.MethodFlags): Added IsObsoleteError.
13935         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13936         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13937         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13938         the message from the attribute.
13939
13940 2002-07-24  Martin Baulig  <martin@gnome.org>
13941
13942         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13943         preprocessor directives, ensure that the argument to #define/#undef is
13944         exactly one identifier and that it's actually an identifier.
13945
13946         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13947         did not work ....
13948
13949 2002-07-24  Martin Baulig  <martin@gnome.org>
13950
13951         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13952         initialize it to TypeManager.object_type in the constructor.
13953         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13954         of the `hm.get_current' method if we're using the collection pattern.
13955         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13956         for the explicit conversion to make it work when we're using the collection
13957         pattern and the `Current' property has a different return type than `object'.
13958         Fixes #27713.
13959
13960 2002-07-24  Martin Baulig  <martin@gnome.org>
13961
13962         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13963         does not match, but don't report any errors.  This method is called in
13964         order for all methods in a MethodGroupExpr until a matching method is
13965         found, so we don't want to bail out if the first method doesn't match.
13966         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13967         matches, report the 123.  Fixes #28070.
13968
13969 2002-07-24  Martin Baulig  <martin@gnome.org>
13970
13971         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13972         TypeManager.TypeToCoreType() to the top of the method so the
13973         following equality checks will work.  Fixes #28107.
13974
13975 2002-07-24  Martin Baulig  <martin@gnome.org>
13976
13977         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13978         operand is of type uint, and the other operand is of type sbyte,
13979         short or int, the operands are converted to type long." -
13980         Actually do what this comment already told us.  Fixes bug #28106,
13981         added test-150.cs.
13982
13983 2002-07-24  Martin Baulig  <martin@gnome.org>
13984
13985         * class.cs (MethodBase): New abstract class.  This is now a base
13986         class for Property, Indexer and Event to avoid some code duplication
13987         in their Define() and DefineMethods() methods.
13988         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13989         generic methods for Define() and DefineMethods().
13990         (FieldBase): Derive from MemberBase, not MemberCore.
13991         (Property): Derive from MemberBase, not MemberCore.
13992         (Property.DefineMethod): Moved all the code from this method to the
13993         new MethodBase.DefineAccessor(), just call it with appropriate
13994         argumetnts.
13995         (Property.Define): Call the new Property.DoDefine(), this does some
13996         sanity checks and we don't need to duplicate the code everywhere.
13997         (Event): Derive from MemberBase, not MemberCore.
13998         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13999         accessors, this will also make them work with interface events.
14000         (Indexer): Derive from MemberBase, not MemberCore.
14001         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14002         (Indexer.Define): Use the new MethodBase functions.
14003
14004         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14005         argument to the constructor.
14006         (Interface.FindMembers): Added support for interface events.
14007         (Interface.PopluateEvent): Implemented.
14008
14009         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14010
14011 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14014         but this is required to check for a method name being the same as
14015         the containing class.  
14016
14017         Handle this now.
14018
14019 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14020
14021         * interface.cs: initialize variable.
14022
14023 2002-07-23  Martin Baulig  <martin@gnome.org>
14024
14025         Implemented the IndexerName attribute in interfaces.
14026
14027         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14028         name if this is an explicit interface implementation.
14029         (Indexer.InterfaceIndexerName): New public variable.  If we're
14030         implementing an interface indexer, this is the IndexerName in that
14031         interface.  Otherwise, it's the IndexerName.
14032         (Indexer.DefineMethod): If we're implementing interface indexer,
14033         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14034         and Pending.ImplementIndexer methods.
14035         (Indexer.Define): Also define the PropertyBuilder if we're
14036         implementing an interface indexer and this is neither an explicit
14037         interface implementation nor do the IndexerName match the one in
14038         the interface.
14039
14040         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14041         If a method is defined here, then we always need to create a proxy
14042         for it.  This is used when implementing interface indexers.
14043         (Pending.IsInterfaceIndexer): New public method.
14044         (Pending.ImplementIndexer): New public method.
14045         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14046         This is used when implementing interface indexers to define a proxy
14047         if necessary.
14048         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14049         define a proxy if necessary.
14050
14051         * interface.cs (Interface.IndexerName): New public variable.
14052         (Interface.PopulateIndexer): Set the IndexerName.
14053         (Interface.DefineIndexers): New private method.  Populate all the
14054         indexers and make sure their IndexerNames match.
14055
14056         * typemanager.cs (IndexerPropertyName): Added support for interface
14057         indexers.
14058
14059 2002-07-22  Martin Baulig  <martin@gnome.org>
14060
14061         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14062         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14063         ret if HasReturnLabel.
14064         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14065         variables.
14066
14067         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14068         and set the ec.LoopBeginTryCatchLevel.
14069         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14070         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14071         the current ec.TryCatchLevel, the branch goes out of an exception
14072         block.  In this case, we need to use Leave and not Br.
14073
14074 2002-07-22  Martin Baulig  <martin@gnome.org>
14075
14076         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14077         block unless the block does not always return or it is contained in
14078         another try { ... } catch { ... } block.  Fixes bug #26506.
14079         Added verify-1.cs to the test suite.
14080
14081 2002-07-22  Martin Baulig  <martin@gnome.org>
14082
14083         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14084         then we do not always return.  Fixes bug #24985.
14085
14086 2002-07-22  Martin Baulig  <martin@gnome.org>
14087
14088         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14089         lookup on a per-class level; ie. walk up the class hierarchy until we
14090         found at least one applicable method, then choose the best among them.
14091         Fixes bug #24463 and test-29.cs.
14092
14093 2002-07-22  Martin Baulig  <martin@gnome.org>
14094
14095         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14096         return types of the methods.  The return type is not part of the
14097         signature and we must not check it to make the `new' modifier work.
14098         Fixes bug #27999, also added test-147.cs.
14099         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14100
14101         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14102         on the method's return type.
14103
14104 2002-07-21  Martin Baulig  <martin@gnome.org>
14105
14106         * assign.cs: Make this work if the rightmost source is a constant and
14107         we need to do an implicit type conversion.  Also adding a few more tests
14108         to test-38.cs which should have caught this.
14109
14110         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14111         target in the makefile for this.  The makefile.gnu is primarily intended
14112         for end-users who don't want to debug the compiler.
14113
14114 2002-07-21  Martin Baulig  <martin@gnome.org>
14115
14116         * assign.cs: Improved the Assign class so it can now handle embedded
14117         assignments (X = Y = Z = something).  As a side-effect this'll now also
14118         consume less local variables.  test-38.cs now passes with MCS, added
14119         a few new test cases to that test.
14120
14121 2002-07-20  Martin Baulig  <martin@gnome.org>
14122
14123         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14124         instructions.  Fixes bug #27977, also added test-146.cs.
14125
14126 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14127
14128         * cs-tokenizer.cs: fixed getHex ().
14129
14130 2002-07-19  Martin Baulig  <martin@gnome.org>
14131
14132         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14133         not Type.GetType() to lookup the array type.  This is needed when
14134         we're constructing an array of a user-defined type.
14135         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14136         single-dimensional arrays, but also for single-dimensial arrays of
14137         type decimal.
14138
14139 2002-07-19  Martin Baulig  <martin@gnome.org>
14140
14141         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14142         this function is called, it's not allowed to share LocalBuilders
14143         among ILGenerators.
14144
14145 2002-07-19  Martin Baulig  <martin@gnome.org>
14146
14147         * expression.cs (Argument.Resolve): Report an error 118 when trying
14148         to pass a type as argument.
14149
14150 2002-07-18  Martin Baulig  <martin@gnome.org>
14151
14152         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14153         Conv_R_Un for the signed `long' type.
14154
14155 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14156
14157         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14158         `expr' for the temporary result, as that will fail if we do
14159         multiple resolves on the same expression.
14160
14161 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14162
14163         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14164         ec.TypeContainer for looking up aliases. 
14165
14166         * class.cs (TypeContainer): Remove LookupAlias from here.
14167
14168         * decl.cs (DeclSpace); Move here.
14169
14170 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14171
14172         * class.cs (FindMembers): Only call filter if the constructor
14173         bulider is not null.
14174
14175         Also handle delegates in `NestedTypes' now.  Now we will perform
14176         type lookups using the standard resolution process.  This also
14177         fixes a bug.
14178
14179         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14180         This uses Expressions (the limited kind that can be parsed by the
14181         tree) instead of strings.
14182
14183         * expression.cs (ComposedCast.ToString): Implement, used to flag
14184         errors since now we have to render expressions.
14185
14186         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14187         FormArrayType. 
14188
14189         * ecore.cs (SimpleName.ToString): ditto.
14190
14191         * cs-parser.jay: Instead of using strings to assemble types, use
14192         Expressions to assemble the type (using SimpleName, ComposedCast,
14193         MemberAccess).  This should fix the type lookups in declarations,
14194         because we were using a different code path for this.
14195
14196         * statement.cs (Block.Resolve): Continue processing statements
14197         even when there is an error.
14198
14199 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14200
14201         * class.cs (Event.Define): Also remove the `remove' method from
14202         the list of pending items.
14203
14204         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14205         generate more compact code. 
14206
14207 2002-07-17  Martin Baulig  <martin@gnome.org>
14208
14209         * const.cs (Const.LookupConstantValue): Add support for constant
14210         `unchecked' and `checked' expressions.
14211         Also adding test case test-140.cs for this.
14212
14213 2002-07-17  Martin Baulig  <martin@gnome.org>
14214
14215         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14216         check whether mi.ReturnType implements the IEnumerator interface; the
14217         `==' and the IsAssignableFrom() will fail in this situation.
14218
14219 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14220
14221         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14222         here too.
14223
14224 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14225
14226         * expression.cs: fixed bug #27811.
14227
14228 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14229
14230         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14231         Molaro: when we are a ref, the value already contains a pointer
14232         value, do not take the address of it.
14233
14234 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14235         * removed mb-parser.jay and mb-tokenizer.cs
14236
14237 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14238
14239         * expression.cs: check against the building corlib void type.
14240
14241 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14242
14243         * ecore.cs: fix for valuetype static readonly fields: when 
14244         initializing them, we need their address, not the address of a copy.
14245
14246 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14247
14248         * typemanager.cs: register also enum_type in corlib.
14249
14250 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14251
14252         * class.cs: allow calling this (but not base) initializers in structs.
14253
14254 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14255
14256         * ecore.cs: make sure we compare against the building base types
14257         in GetTypeSize ().
14258
14259 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14260
14261         * typemanager.cs: fix TypeToCoreType() to handle void and object
14262         (corlib gets no more typerefs after this change).
14263
14264 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14265
14266         * expression.cs (ArrayCreation.EmitArrayArguments): use
14267         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14268
14269         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14270         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14271         array indexes, the runtime actually forbids them.
14272
14273         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14274         for array arguments here.
14275
14276         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14277         instead of the default for ValueTypes.
14278
14279         (New.DoEmit): Use IsValueType instead of
14280         IsSubclassOf (value_type)
14281         (New.DoResolve): ditto.
14282         (Invocation.EmitCall): ditto.
14283
14284         * assign.cs (Assign): ditto.
14285
14286         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14287         Statements *are* currently doing part of their resolution during
14288         Emit.  
14289
14290         Expressions do always resolve during resolve, but statements are
14291         only required to propagate resolution to their children.
14292
14293 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14294
14295         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14296
14297         (LoadAssembly): Do not add the dll if it is already specified
14298
14299         (MainDriver): Add the System directory to the link path at the end,
14300         after all the other -L arguments. 
14301
14302         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14303         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14304         ldelem.u1) and using the opposite for sbytes.
14305
14306         This fixes Digger, and we can finally run it.
14307
14308         * driver.cs (UnixParseOption): Move the option parsing here.  
14309         (CSCParseOption): Implement CSC-like parsing of options.
14310
14311         We now support both modes of operation, the old Unix way, and the
14312         new CSC-like way.  This should help those who wanted to make cross
14313         platform makefiles.
14314
14315         The only thing broken is that /r:, /reference: and /lib: are not
14316         implemented, because I want to make those have the same semantics
14317         as the CSC compiler has, and kill once and for all the confussion
14318         around this.   Will be doing this tomorrow.
14319
14320         * statement.cs (Unsafe.Resolve): The state is checked during
14321         resolve, not emit, so we have to set the flags for IsUnsfe here.
14322
14323 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14326         not catch the Error_ObjectRefRequired in SimpleName (as it is
14327         possible to have a class/instance variable name that later gets
14328         deambiguated), we have to check this here.      
14329
14330 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14331
14332         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14333         make static and put into Expression.
14334
14335         (Event.Define): Register the private field of the event with the 
14336         TypeManager so that GetFieldFromEvent can get at it.
14337
14338         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14339         keep track of the private field associated with an event which
14340         has no accessors.
14341
14342         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14343         private field.
14344
14345         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14346
14347 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * expression.cs (Binary.EmitBranchable): this routine emits the
14350         Binary expression in a branchable context.  This basically means:
14351         we need to branch somewhere, not just get the value on the stack.
14352
14353         This works together with Statement.EmitBoolExpression.
14354
14355         * statement.cs (Statement.EmitBoolExpression): Use
14356         EmitBranchable. 
14357
14358 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * statement.cs (For): Reduce the number of jumps in loops.
14361
14362         (For): Implement loop inversion for the For statement.
14363
14364         (Break): We can be breaking out of a Try/Catch controlled section
14365         (foreach might have an implicit try/catch clause), so we need to
14366         use Leave instead of Br.
14367
14368         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14369         now).  If the instace expression supports IMemoryLocation, we use
14370         the AddressOf method from the IMemoryLocation to extract the
14371         address instead of emitting the instance.
14372
14373         This showed up with `This', as we were emitting the instance
14374         always (Emit) instead of the Address of This.  Particularly
14375         interesting when This is a value type, as we dont want the Emit
14376         effect (which was to load the object).
14377
14378 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14379
14380         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14381
14382         * statement.cs (Checked): Set the CheckedState during the resolve
14383         process too, as the ConvCast operations track the checked state on
14384         the resolve process, and not emit.
14385
14386         * cs-parser.jay (namespace_member_declaration): Flag that we have
14387         found a declaration when we do.  This is used to flag error 1529
14388
14389         * driver.cs: Report ok when we display the help only.
14390
14391 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14392
14393         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14394
14395 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * cs-tokenizer.cs (define): We also have to track locally the
14398         defines.  AllDefines is just used for the Conditional Attribute,
14399         but we also need the local defines for the current source code. 
14400
14401 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14402
14403         * statement.cs (While, For, Do): These loops can exit through a
14404         Break statement, use this information to tell whether the
14405         statement is the last piece of code.
14406
14407         (Break): Flag that we break.
14408
14409         * codegen.cs (EmitContexts): New `Breaks' state variable.
14410
14411 2002-07-03  Martin Baulig  <martin@gnome.org>
14412
14413         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14414         modifiers in method declarations in structs.  Otherwise, you won't
14415         be able to override things like Object.Equals().
14416
14417 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14418
14419         * class.cs (Method, Property, Indexer): Do not allow the public
14420         modifier to be used in explicit interface implementations.
14421
14422         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14423         override modifiers in method declarations in structs
14424
14425 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14426
14427         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14428         integer or real overflow, report an error
14429
14430 2002-07-02  Martin Baulig  <martin@gnome.org>
14431
14432         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14433         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14434         to tell the runtime about our newly created System.Object and
14435         System.ValueType types.
14436
14437 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14438
14439         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14440         struct instead of Ldarg/Starg.
14441
14442 2002-07-02  Martin Baulig  <martin@gnome.org>
14443
14444         * expression.cs (Indirection.Indirection): Call
14445         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14446
14447 2002-07-02  Martin Baulig  <martin@gnome.org>
14448
14449         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14450         ValueType, call TypeManager.TypeToCoreType() on it.
14451         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14452         the OpCodes.Newarr argument.
14453
14454 2002-07-02  Martin Baulig  <martin@gnome.org>
14455
14456         * expression.cs (Invocation.EmitCall): When compiling corlib,
14457         replace all calls to the system's System.Array type to calls to
14458         the newly created one.
14459
14460         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14461         System.Array methods.
14462         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14463         from the system's System.Array type which must be replaced.
14464
14465 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14466
14467         * typemanager.cs: load unverifiable_code_ctor so we can build
14468         corlib using the correct type. Avoid using GetTypeCode() with
14469         TypeBuilders.
14470         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14471         TypeManager.object_type to allow building corlib.
14472
14473 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14474
14475         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14476
14477 2002-07-01  Martin Baulig  <martin@gnome.org>
14478
14479         * class.cs: Make the last change actually work, we need to check
14480         whether `ifaces != null' to avoid a crash.
14481
14482 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14483
14484         * class.cs: when we build structs without fields that implement
14485         interfaces, we need to add the interfaces separately, since there is
14486         no API to both set the size and add the interfaces at type creation
14487         time.
14488
14489 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14490
14491         * expression.cs: the dimension arguments to the array constructors
14492         need to be converted if they are a long.
14493
14494 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14495
14496         * class.cs: don't emit ldarg.0 if there is no parent constructor
14497         (fixes showstopper for corlib).
14498
14499 2002-06-29  Martin Baulig  <martin@gnome.org>
14500
14501         MCS now compiles corlib on GNU/Linux :-)
14502
14503         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14504         ie. check for MethodImplOptions.InternalCall.
14505
14506         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14507         and TypeManager.attribute_type are null, so we must explicitly check
14508         whether parent is not null to find out whether it's an attribute type.
14509         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14510         and SetBuilder, not only if the property is neither abstract nor external.
14511         This is necessary to set the MethodImplOptions on the accessor methods.
14512         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14513         SetBuilder, see Property.Emit().
14514
14515         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14516         populate "System.Object", "System.ValueType" and "System.Attribute" since
14517         they've already been populated from BootCorlib_PopulateCoreTypes().
14518
14519 2002-06-29  Martin Baulig  <martin@gnome.org>
14520
14521         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14522         is the NullLiteral, we also need to make sure that target_type is not
14523         an enum type.   
14524
14525 2002-06-29  Martin Baulig  <martin@gnome.org>
14526
14527         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14528         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14529         before calling BootstrapCorlib_ResolveDelegate ().
14530
14531 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14532
14533         * statement.cs: fixed build-breaker. All tests passed ok.
14534
14535 2002-06-27  Martin Baulig  <martin@gnome.org>
14536
14537         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14538         for System.Decimal when compiling corlib.
14539
14540 2002-06-27  Martin Baulig  <martin@gnome.org>
14541
14542         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14543         switch blocks which contain nothing but a default clause.
14544
14545 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14546
14547        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14548
14549 2002-06-27  Martin Baulig  <martin@gnome.org>
14550
14551         * ecore.cs (PropertyExpr.PropertyExpr): Call
14552         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14553
14554         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14555         is already a TypeBuilder.
14556
14557 2002-06-27  Martin Baulig  <martin@gnome.org>
14558
14559         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14560         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14561         the "from an array-type to System.Array" case.  This makes it work
14562         when compiling corlib.
14563
14564 2002-06-27  Martin Baulig  <martin@gnome.org>
14565
14566         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14567         non-static PropertyExpr, set its InstanceExpression.  This makes
14568         the `ICollection.Count' property work in System/Array.cs.
14569
14570 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14571
14572         * driver.cs: Made error handling more consistent.  Errors now
14573         tracked by Report class, so many methods which used to return int
14574         now return void.  Main() now prints success/failure and 
14575         errors/warnings message.
14576
14577         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14578         the magic number return values (123 and 124).  Now, if the
14579         expected error occurs, the compiler exits with success (exit value
14580         0).  If the compilation completes without seeing that particular
14581         error, the compiler exits with failure (exit value 1).  The
14582         makefile in mcs/errors has been changed to handle the new behaviour.
14583
14584         * report.cs: Made 'expected error' number a property and renamed
14585         it from 'Probe' to 'ExpectedError'.
14586
14587         * genericparser.cs: Removed error handling support, since it is
14588         now all done by Report class.
14589
14590         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14591         class, so parse() no longer returns an int.
14592
14593         * namespace.cs: Use Report.Error instead of GenericParser.error
14594
14595 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14598         TypeContainer.AddOperator): At the front of the list put the
14599         explicit implementations, so they get resolved/defined first. 
14600
14601 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14602
14603         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14604         interface type is implemented by this TypeContainer.  Used during
14605         explicit interface implementation.
14606
14607         (Property.Define, Indexer.Define, Method.Define): Validate that
14608         the given interface in the explicit implementation is one of the
14609         base classes for the containing type.
14610
14611         Also if we are explicitly implementing an interface, but there is
14612         no match in the pending implementation table, report an error.
14613
14614         (Property.Define): Only define the property if we are
14615         not explicitly implementing a property from an interface.  Use the
14616         correct name also for those properties (the same CSC uses,
14617         although that is really not needed).
14618
14619         (Property.Emit): Do not emit attributes for explicitly implemented
14620         properties, as there is no TypeBuilder.
14621
14622         (Indexer.Emit): ditto.
14623
14624         Hiding then means that we do not really *implement* a pending
14625         implementation, which makes code fail.
14626
14627 2002-06-22  Martin Baulig  <martin@gnome.org>
14628
14629         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14630         the return value of Object.GetType().  [FIXME: we need to do this whenever
14631         we get a type back from the reflection library].
14632
14633 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14634
14635         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14636
14637 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * attribute.cs: Return null if we can not look up the type.
14640
14641         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14642         the interface types found.
14643
14644         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14645         interface types found.
14646
14647         * typemanager.cs (GetInterfaces): Make this routine returns alll
14648         the interfaces and work around the lame differences between
14649         System.Type and System.Reflection.Emit.TypeBuilder in the results
14650         result for GetInterfaces.
14651
14652         (ExpandInterfaces): Given an array of interface types, expand and
14653         eliminate repeated ocurrences of an interface.  This expands in
14654         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14655         be IA, IB, IC.
14656
14657 2002-06-21  Martin Baulig  <martin@gnome.org>
14658
14659         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14660         on System.Enum.
14661
14662 2002-06-21  Martin Baulig  <martin@gnome.org>
14663
14664         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14665         and called with one of the core types, return the corresponding typebuilder for
14666         that type.
14667
14668         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14669         element type.
14670
14671 2002-06-21  Martin Baulig  <martin@gnome.org>
14672
14673         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14674         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14675         (Expression.ConvertReferenceExplicit): Likewise.
14676
14677         * expression.cs (ElementAccess.DoResolve): Likewise.
14678         (ElementAccess.DoResolveLValue): Likewise.
14679
14680 2002-06-10  Martin Baulig  <martin@gnome.org>
14681
14682         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14683         add the "value" parameter to the parameter list.
14684
14685         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14686         to our caller.
14687
14688 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14689
14690         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14691         the argument to an int, uint, long or ulong, per the spec.  Also
14692         catch negative constants in array creation.
14693
14694 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14695
14696         * class.cs: do not allow the same interface to appear twice in
14697         the definition list.
14698
14699 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14700
14701         * ecore.cs: don't use ldlen with System.Array.
14702
14703 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14704
14705         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14706
14707 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14708
14709         * modifiers.cs: produce correct field attributes for protected
14710         internal. Easy fix so miguel can work on ther harder stuff:-)
14711
14712 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14713
14714         * pending.cs: New file.  Move the code from class.cs here.
14715         Support clearning the pending flag for all methods (when not doing
14716         explicit interface implementation).
14717
14718 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14719
14720         * rootcontext.cs: added a couple more types needed to bootstrap.
14721
14722 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14725         constructor in the type, instead of any constructor in the type
14726         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14727         a bug in the Mono runtime when applying the params attribute). 
14728
14729 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14730         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14731
14732 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14733
14734         * expression.cs (Unary.ResolveOperator): Use TypeManager
14735         to resolve the type.
14736
14737 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14738
14739         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14740         attached.
14741
14742         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14743         with each member too.
14744
14745         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14746         field builders too - this takes care of the enum member case.
14747
14748 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14749
14750         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14751         address-of operator on both value types and pointers.
14752
14753 2002-06-10  Martin Baulig  <martin@gnome.org>
14754
14755         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14756         PropertyBuilder to the `property_builders' list.
14757
14758         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14759         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14760         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14761         find any indexers which are inherited from an interface.
14762
14763 2002-06-09  Martin Baulig  <martin@gnome.org>
14764
14765         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14766         the same type as the constant if necessary.  There's also a test-130.cs
14767         for this.
14768
14769         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14770
14771         * typemanager.cs (TypeManager.ChangeType): Previously known as
14772         Enum.ChangeEnumType().
14773
14774 2002-06-09  Martin Baulig  <martin@gnome.org>
14775
14776         * expression.cs (Cast.TryReduce): Added support for consts.
14777
14778 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14779
14780         * class.cs (Accessor): Hold attributes information so we can pass
14781         it along.
14782
14783         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14784         Modify to pass in attributes attached to the methods.
14785
14786         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14787
14788         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14789         to handle the Accessor kind :-)
14790
14791         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14792
14793 2002-06-08  Martin Baulig  <martin@gnome.org>
14794
14795         * expression.cs (Unary.TryReduceNegative): Added support for
14796         ULongConstants.
14797
14798 2002-06-08  Martin Baulig  <martin@gnome.org>
14799
14800         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14801         name can't be found in the `defined_names' - the caller will do a
14802         MemberLookup in this case and thus find methods in System.Enum
14803         such as Enum.IsDefined().
14804
14805 2002-06-08  Martin Baulig  <martin@gnome.org>
14806
14807         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14808         Convert.ChangeType() which works with TypeBuilder created types.
14809         (Enum.LookupEnumValue, Enum.Define): Use it here.
14810
14811         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14812         `TypeBuilder.BaseType != null' check.
14813         (TypeContainer.FindMembers): Only lookup parent members if we
14814         actually have a parent.
14815         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14816         (ConstructorInitializer.Resolve): Likewise.
14817
14818         * interface.cs (Interface.FindMembers): Added
14819         `TypeBuilder.BaseType != null' check.
14820
14821         * rootcontext.cs (RootContext.ResolveCore): Added
14822         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14823         classes_second_stage.
14824
14825         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14826         debug_type and trace_type when compiling with --nostdlib.       
14827
14828 2002-06-07  Martin Baulig  <martin@gnome.org>
14829
14830         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14831         (AddField): Set it to true when adding a non-static field.
14832         (DefineType): Use `have_nonstatic_fields' to find out whether we
14833         have non-static fields, not `Fields != null'.
14834
14835 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14836
14837         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14838         dereferencing a null on the static-field code path)
14839
14840 2002-05-30  Martin Baulig  <martin@gnome.org>
14841
14842         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14843         to take command line arguments.  Use reflection to call the new
14844         custom `Initialize' function on the symbol writer and pass it the
14845         command line arguments.
14846
14847         * driver.cs (--debug-args): New command line argument to pass command
14848         line arguments to the symbol writer.
14849
14850 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14853         the target type for indexers and properties.  Thanks to Joe for
14854         catching this.
14855
14856 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * typemanager.cs (MethodFlags): returns the method flags
14859         (Obsolete/ShouldIgnore) that control warning emission and whether
14860         the invocation should be made, or ignored. 
14861
14862         * expression.cs (Invocation.Emit): Remove previous hack, we should
14863         not do this on matching a base type, we should do this based on an attribute
14864
14865         Only emit calls to System.Diagnostics.Debug and
14866         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14867         on the command line.
14868
14869         * rootcontext.cs: Global settings for tracing and debugging.
14870
14871         * cs-tokenizer.cs (define): New utility function to track
14872         defines.   Set the global settings for TRACE and DEBUG if found.
14873
14874 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14875
14876         * interface.cs (Populate*): Pass in the TypeContainer as well as
14877         the DeclSpace as parameters so that we can create EmitContexts and
14878         then use that to apply attributes etc.
14879
14880         (PopulateMethod, PopulateEvent, PopulateProperty)
14881         (PopulateIndexer): Apply attributes everywhere.
14882
14883         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14884         etc.
14885
14886         (ApplyAttributes): Update accordingly.
14887
14888         We now apply interface attributes for all members too.
14889
14890 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14891
14892         * class.cs (Indexer.Define); Correctly check if we are explicit
14893         implementation (instead of checking the Name for a ".", we
14894         directly look up if the InterfaceType was specified).
14895
14896         Delay the creation of the PropertyBuilder.
14897
14898         Only create the PropertyBuilder if we are not an explicit
14899         interface implementation.   This means that explicit interface
14900         implementation members do not participate in regular function
14901         lookups, and hence fixes another major ambiguity problem in
14902         overload resolution (that was the visible effect).
14903
14904         (DefineMethod): Return whether we are doing an interface
14905         implementation. 
14906
14907         * typemanager.cs: Temporary hack until we get attributes in
14908         interfaces (Ravi is working on that) and we get IndexerName
14909         support in interfaces.
14910
14911         * interface.cs: Register the indexers as properties.
14912
14913         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14914         warning, I have verified that this is a bug in the .NET runtime
14915         (JavaScript suffers of the same problem).
14916
14917         * typemanager.cs (MemberLookup): When looking up members for
14918         interfaces, the parent of an interface is the implicit
14919         System.Object (so we succeed in searches of Object methods in an
14920         interface method invocation.  Example:  IEnumerable x;  x.ToString
14921         ()) 
14922
14923 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * class.cs (Event): Events should also register if they do
14926         implement the methods that an interface requires.
14927
14928         * typemanager.cs (MemberLookup); use the new GetInterfaces
14929         method. 
14930
14931         (GetInterfaces): The code used to lookup interfaces for a type is
14932         used in more than one place, factor it here. 
14933
14934         * driver.cs: Track the errors at the bottom of the file, we kept
14935         on going.
14936
14937         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14938         instance if the method we are calling is static!
14939
14940 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14941
14942         * attribute.cs (ApplyAttributes): Make this function filter out
14943         the IndexerName attribute (as that attribute in reality is never
14944         applied) and return the string constant for the IndexerName
14945         attribute. 
14946
14947         * class.cs (TypeContainer.Emit): Validate that all the indexers
14948         have the same IndexerName attribute, and if so, set the
14949         DefaultName attribute on the class. 
14950
14951         * typemanager.cs: The return value might contain other stuff (not
14952         only methods).  For instance, consider a method with an "Item"
14953         property and an Item method.
14954
14955         * class.cs: If there is a problem with the parameter types,
14956         return. 
14957
14958 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14959
14960         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14961         looks at user defined conversion after making a call to 
14962         StandardConversionExists - we need this for overload resolution.
14963
14964         * expression.cs : Update accordingly the various method calls.
14965
14966         This fixes 2 bugs filed against implicit user defined conversions 
14967
14968 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14969
14970         * statement.cs: Track the result of the assignment.
14971
14972 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * expression.cs (MemberAccess): Improved error reporting for
14975         inaccessible members.
14976
14977 2002-05-22  Martin Baulig  <martin@gnome.org>
14978
14979         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14980         itself with debugging support.
14981
14982 2002-05-22  Martin Baulig  <martin@gnome.org>
14983
14984         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14985         Removed, this isn't needed anymore.
14986
14987 2002-05-20  Martin Baulig  <martin@gnome.org>
14988
14989         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14990         be underlying type for an enum.
14991
14992 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14993
14994         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14995         that splits out the loading of just the core types.
14996
14997         * rootcontext.cs (ResolveCore): Split the struct resolution in
14998         two, so we can load the enumeration underlying types before any
14999         enums are used.
15000
15001         * expression.cs (Is): Bandaid until we fix properly Switch (see
15002         bug #24985 for details).
15003
15004         * typemanager.cs (ImplementsInterface): The hashtable will contain
15005         a null if there are no interfaces implemented.
15006
15007 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15008
15009         * cs-parser.jay (indexer_declarator): It is fine to have array
15010         parameters
15011
15012 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15013
15014         * typemanager.cs: (RegisterBuilder): New function used to register
15015         TypeBuilders that implement interfaces.  Since
15016         TypeBuilder.GetInterfaces (as usual) does not work with lame
15017         Reflection.Emit. 
15018         (AddUserType): register interfaces.
15019
15020         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15021         dealing with TypeBuilder.  Also, arrays are showing up as
15022         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15023         methods can not be invoked on them!
15024
15025         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15026         (ImplicitReferenceConversionExists): Split out from
15027         StandardConversionExists. 
15028
15029         * expression.cs (As): We were only implementing one of the three
15030         cases for the as operator.  We now implement them all.
15031         (Is): Implement the various other cases for Is as well.
15032
15033         * typemanager.cs (CACHE): New define used to control if we want or
15034         not the FindMembers cache.  Seems to have a negative impact on
15035         performance currently
15036
15037         (MemberLookup): Nested types have full acess to
15038         enclosing type members
15039
15040         Remove code that coped with instance/static returns for events, we
15041         now catch this in RealFindMembers.
15042
15043         (RealFindMembers): only perform static lookup if the instance
15044         lookup did not return a type or an event.  
15045
15046 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15047
15048         * assign.cs (CompoundAssign): We pass more semantic information
15049         now to Compound Assignments than we did before: now we have all
15050         the information at hand, and now we resolve the target *before* we
15051         do the expression expansion, which allows the "CacheValue" method
15052         to have the effect we intended (before, a [x] += 1 would generate
15053         two differen ArrayAccess expressions from the ElementAccess,
15054         during the resolution process).
15055
15056         (CompoundAssign.DoResolve): Resolve target and original_source here.
15057
15058 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * expression.cs (ArrayAccess): dropped debugging information. 
15061
15062         * typemanager.cs: Small bug fix: I was always returning i_members,
15063         instead of one of i_members or s_members (depending on which had
15064         the content).
15065
15066         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15067         method is invoked before any code generation takes place, and it
15068         is a mechanism to inform that the expression will be invoked more
15069         than once, and that the method should use temporary values to
15070         avoid having side effects
15071
15072         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15073
15074         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15075         implementation.
15076
15077         * expression.cs (Indirection, ArrayAccess): Add support for
15078         CacheTemporaries in these two bad boys. 
15079
15080         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15081         ldobj or ldind_ref.  
15082         (StoreFromPtr): Handle stobj as well.
15083
15084         * expression.cs (UnaryMutator): Share more code.
15085
15086         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15087         down: I was not tracking the Filter function as well, which
15088         was affecting the results of the cache.
15089
15090 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * attribute.cs: Remove the hack to handle the CharSet property on
15093         StructLayouts. 
15094
15095 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15096
15097         * attribute.cs (DoResolve): More uglyness, we now only try to
15098         resolve the attribute partially, to extract the CharSet
15099         information (only if we are a StructLayout attribute).  Otherwise 
15100
15101         (GetExtraTypeInfo): Add some code to conditionally kill in the
15102         future this.   I am more and more convinced that the .NET
15103         framework has special code to handle the attribute setting on
15104         certain elements.
15105
15106         * expression.cs (IsParamsMethodApplicable): Revert my previous
15107         foreach change here, it was wrong.
15108
15109 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15110
15111         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15112         (pp_expr): do not abort on unknown input, just return.
15113         (eval): abort if there are pending chars.
15114
15115         * attribute.cs (Attribute.Resolve): Positional parameters are
15116         optional.  Deal with that case.
15117
15118         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15119         the Ansi/Unicode/Auto information for the type.
15120
15121         (TypeContainer.DefineType): instantiate the EmitContext here, as
15122         we will be using it during the type definition (to resolve
15123         attributes) and during the emit phase.
15124
15125         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15126         to pull type information out of the attributes
15127
15128         (Attribute.Resolve): track the constructor builder, and allow for
15129         multiple invocations (structs and classes will use this).
15130
15131         * ecore.cs (MemberLookupFinal): new version with all the
15132         parameters customizable.
15133
15134         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15135         constructors.  Return if the result value is null (as the error
15136         would have been flagged already by MemberLookupFinal)
15137
15138         Do not allow instances of abstract classes or interfaces to be
15139         created.
15140
15141         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15142         We have to compare the assembly property here when dealing with
15143         FamANDAssem and Assembly access modifiers, because we might be
15144         creating an assembly from *modules* (that means that we are not
15145         getting TypeBuilders for types defined in other modules that are
15146         part of this assembly).
15147
15148         (Method.Emit): If the method is marked abstract and has a body,
15149         emit an error. 
15150
15151         (TypeContainer.DefineMembers): If both the defined member and the
15152         parent name match are methods, then do not emit any warnings: let
15153         the Method.Define routine take care of flagging warnings.  But if
15154         there is a mismatch (method overrides something else, or method is
15155         overriwritten by something, then emit warning).
15156
15157         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15158         set to null, this means `do not check for the return type on the
15159         signature'. 
15160
15161         (Method.Define): set the return type for the method signature to
15162         null, so that we get methods with the same name and parameters and
15163         different return types.  This is used to flag warning 114 (you are
15164         hiding a method, and you probably want to use the new/override
15165         keywords instead).
15166
15167         * typemanager.cs (MemberLookup): Implemented proper access
15168         control, closing a long standing set of bug reports.  The problem
15169         was that the Framework only has two bits: Public and NonPublic,
15170         and NonPublic includes private and protected methods, but we need
15171         to enforce the FamANDAssem, FamOrAssem and Family. 
15172
15173 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * statement.cs (GotoCase): Return true: Ammounts to giving up
15176         knowledge on whether we return or not, and letting the other case
15177         be responsible for it.
15178
15179 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15180
15181         * driver.cs: Do not load directories for each file processed, only
15182         do it if there is a pattern.
15183
15184         * ecore.cs: Report readonly assigns here as well, as we might have
15185         been resolved only by MemberAccess.
15186
15187         (SimpleName.SimpleNameResolve): Also be useful for LValue
15188         resolution.   We need this to propagate assign to local readonly variables
15189
15190         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15191         do not want to reuse potential criteria memory.
15192
15193         * class.cs (MyEventBuilder): Set reflected_type;
15194
15195         * ecore.cs (Constantify): Added support for constifying bools.
15196
15197         (RootContext.LookupType): Added a cache for values looked up in
15198         the declaration space.
15199
15200         * typemanager.cs (FindMembers): Now is a front-end to
15201         RealFindMembers, and provides a two-level hashtable-based cache to
15202         the request.  
15203
15204         15% performance improvement: from 22.5 to 19.2 seconds.
15205
15206         * expression.cs (IsParamsMethodApplicable): use foreach.
15207         (Invocation.DoResolve): ditto.
15208         (New.DoResolve): ditto.
15209         (ArrayCreation.DoResolve): ditto.
15210
15211         * ecore.cs (FindMostEncompassingType): use foreach.
15212
15213         * delegate.cs (NewDelegate.DoResolve): Use foreach
15214
15215         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15216         (RemoveMethods): use foreach.
15217
15218         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15219         nested foreach statements instead of for, and also break out of
15220         the inner loop once a match is found.
15221
15222         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15223
15224 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15225
15226         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15227         we actually unwrap the expression to allow for extra information
15228         to be extracted. 
15229
15230         * expression.cs: Use Shr_Un on unsigned operations. 
15231
15232 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15233
15234         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15235         applicable operators was not being considered correctly. This closes
15236         the bug Miguel reported.
15237
15238 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15239
15240         * attribute.cs: check that the type derives from System.Attribute
15241         and report the correct error in that case (moved the duplicate code to
15242         its own method, too).
15243
15244 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15245
15246         * attribute.cs: lookup attribute type name as the spec says: first the
15247         bare attribute name and then name + "Attribute" (nant compiles with
15248         mcs after this fix).
15249
15250 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15251
15252         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15253         Because of the way we parse things, we should try to see if a
15254         UIntConstant can fit in an integer.
15255
15256 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15257
15258         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15259         when we are in an explicit context.
15260
15261         (ConvertReferenceExplicit): When converting from Iface type S to Class
15262         T make sure the rules are implemented as an OR.
15263
15264         * parameter.cs (ParameterType): Make it a property for now although the
15265         purpose really isn't anything immediate.
15266
15267         * expression.cs (Is*Applicable): Do better checking on the parameter type
15268         of a ref/out parameter. The ones from the system assemblies are already 
15269         marked with the correct type so we don't need to do any correction.
15270
15271         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15272         the object type is standard too so include that.
15273
15274 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15275
15276         * ecore.cs (StandardConversionExists): Augment with missing code:
15277         deal with IntConstant, LongConstants and Enumerations.
15278
15279         * assign.cs: Report the error, instead of failing silently
15280
15281         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15282         typecontainer that they are declared, because the
15283         typecontainer/namespace will have the list of using clauses that
15284         need to be applied.
15285
15286         Assembly Attributes were escaping the normal registration
15287         mechanism. 
15288
15289         (EmitCode): Apply attributes within an EmitContext that represents
15290         the container they were declared on.
15291
15292         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15293
15294 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15295
15296         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15297         Revamp completely - make much cleaner as we now operate only
15298         on a set of Types.
15299
15300         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15301         to implement the logic detailed in the spec more correctly.
15302
15303         (UserDefinedConversion): Update accordingly.
15304
15305 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15306
15307         * statement.cs: Return flow analysis information up.
15308
15309         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15310         and the default.
15311
15312         (token): Do not consume an extra character before calling
15313         decimal_digits.
15314
15315 2002-05-06  Piers Haken <piersh@friskit.com>
15316
15317         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15318
15319 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15320
15321         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15322         EmitContext during the instance constructor initializer
15323         resolution, to stop access to instance variables.
15324
15325         This is mandated by the spec, last paragraph of the `constructor
15326         initializers' section. 
15327
15328 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15329
15330         * cs-parser.jay, class.cs (Accessor): new class used to represent
15331         an accessor (get or set).  In the past we used `null' to represent
15332         a missing accessor.  But this is ambiguous because there was no
15333         way to tell in abstract indexers/properties if one of them was
15334         specified.
15335
15336         Now there is a way of addressing that.
15337
15338         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15339         instead of FindMembers.
15340
15341         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15342         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15343
15344         * attribute.cs: Treat indexers and properties as the same in terms
15345         of applying attributes
15346
15347         * ecore.cs (FindMostEncompassedType): Use statically initialized
15348         EmptyExpressions()s like we do elsewhere to avoid creating useless
15349         objects (and we take this out of the tight loop).
15350
15351         (GetConversionOperators): Move the code to extract the actual
15352         operators to a separate routine to clean things up.
15353
15354 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15355
15356         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15357         events are always registered FieldBuilders.
15358
15359         * class.cs (FieldBase): New class shared by Fields 
15360
15361         * delegate.cs: If we are a toplevel delegate, use our full name.
15362         If we are a nested delegate, then only use our tail name.
15363
15364 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15365
15366         * expression.cs (IsApplicable): Ensure that we add the "&" to
15367         ref/out types before comparing it with the type of the argument.
15368
15369         (IsParamsMethodApplicable): Ditto.
15370
15371         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15372         silly me ;-)
15373
15374         * delegate.cs : Handle the case when we have more than one applicable
15375         method. Flag an error only when we finish checking all.
15376
15377 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15378
15379         * expression.cs: Add support for boolean static initializers.
15380
15381 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15384
15385         * parameter.cs (ComputeParameterTypes,
15386         ComputeAndDefineParameterTypes): Better error handling: now we
15387         clear the `types' cache if we fail during any of the type lookups.
15388         We also return the status code correctly to our caller
15389
15390         * delegate.cs: If we fail to define a delegate, abort the extra
15391         steps. 
15392
15393         * expression.cs (Binary.ResolveOperator): for
15394         operator==(object,object) and operator !=(object, object) we also
15395         have to verify that there is an implicit conversion from one to
15396         the other.
15397
15398         (ArrayAccess.DoResolve): Array Access can operate on
15399         non-variables. 
15400
15401 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15402
15403         * assign.cs (CompoundAssign): A new class used as a "flag" that
15404         the assignment actually is happening as part of a compound
15405         assignment operator.
15406
15407         During compound assignment, a few new rules exist to enable things
15408         like:
15409
15410         byte b |= 1 + 2
15411
15412         From the spec:
15413
15414         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15415         to the type of x) if y is implicitly convertible to the type of x,
15416         and the operator is a builtin operator and the return type of the
15417         operator is explicitly convertible to the type of x. 
15418
15419         * rootcontext.cs: Reset warning level to 2.  4 catches various
15420         "interesting" features in mcs, we must clean this up at some
15421         point, but currently am trying to kill other bugs ;-)
15422
15423         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15424         in container classes as well.  
15425
15426         * expression.cs (Binary.ResolveOperator): Handle string case
15427         before anything else (as operator overloading does emit an error
15428         before doing anything else).
15429
15430         This code could go away when we move to a table driven model, but
15431         i could not come up with a good plan last night.
15432
15433 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15434
15435         * typemanager.cs (CSharpName): reimplementation using regex.
15436         * class.cs: added null check for fields in Emit
15437         * rootcontext.cs: set warninglevel to 4
15438
15439 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15440
15441         * typemanager.cs (CSharpName): reimplemented with Lupus
15442         suggestion.
15443
15444 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * statement.cs (If): correclty implement Resolve, because we were
15447         not catching sem errors in there.  The same process is needed
15448         everywhere else. 
15449         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15450
15451
15452         (Statement.Warning_DeadCodeFound): Factorize code.
15453         (While): Report dead code here too.
15454
15455         (Statement): Added Resolve virtual method to allow
15456         for resolution split from the emit code.
15457
15458 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15459
15460         * statement.cs (EmitBoolExpression): No longer try to resolve the
15461         expression here.    
15462         (MakeBoolean): New utility function that resolve, implicitly
15463         converts to boolean and tags the expression. 
15464
15465
15466         (If, Do): Implement dead code elimination.
15467         (While): Implement loop inversion
15468
15469         (Do, While, For, If): Resolve the expression prior to calling our
15470         code generation.
15471
15472 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15473
15474         * class.cs:
15475           - added method Report28 (warning: program has more than one entry point)
15476           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15477           - modified method Method.Define, the part at the end of the method
15478
15479         * rootcontext.cs: added static public Location EntryPointLocation;
15480           
15481         * ../errors/cs0028.cs : Add test case for the above warning.              
15482
15483         * typemanager.cs:
15484           - modified method CSharpName to allow arrays of primitive type to
15485             be printed nicely (e.g. instead of System.Int32[][] it now prints
15486             int[][])
15487           - added method CSharpSignature: returns the signature of a method
15488             in string format to be used in reporting errors, warnings, etc.
15489
15490         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15491         with String.Empty.
15492
15493 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15494
15495         * delegate.cs (Define): Fix extremely silly bug where I was
15496         setting the type of the 'object' parameter of the BeginInvoke
15497         method to System.IAsyncResult instead of System.Object ;-)
15498
15499 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15502         here. 
15503
15504         (Constructor.Emit): return if we fail to initialize the
15505         constructor.  Another door closed!  
15506
15507         * expression.cs (New.DoResolve): Improve error message (from -6 to
15508         1501).  Use DeclaredOnly lookup to find the exact constructor.
15509
15510         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15511         loop.  This is useful.
15512
15513         * cs-parser.jay: Adjust the default parameters so that destructors
15514         have the proper signature.
15515
15516 2002-04-26  Martin Baulig  <martin@gnome.org>
15517
15518         * driver.cs (LoadAssembly): If `assembly' contains any characters
15519         which are only valid in path names and not in assembly names
15520         (currently slash, backslash and point), use Assembly.LoadFrom ()
15521         instead of Assembly.Load () on the `assembly' (before iteration
15522         over the link_paths).
15523
15524 2002-04-26  Martin Baulig  <martin@gnome.org>
15525
15526         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15527
15528 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15529
15530         * class.cs (Property): use the new typemanager.MemberLookup
15531
15532         (TypeContainer.MemberLookup): Implement using the
15533         TypeManager.MemberLookup now. 
15534
15535         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15536         and return MemberInfos, so that these can be used without an
15537         EmitContext (what we had before).
15538
15539 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * expression.cs: Fix the case where the argument to params if the
15542         type of the params.  I omitted handling this before.   Fixed
15543
15544 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * driver.cs: Call BootCorlib_PopulateCoreType
15547
15548         * class.cs (Property.CheckBase): Check for properties only, not
15549         for all members. 
15550
15551         * interface.cs: Temporary hack: try/catch around the
15552         CustomAttributeBuilder, because I am getting an exception that I
15553         do not understand.
15554
15555         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15556         types whose definitions are required to be there (attributes are
15557         defined before standard types).
15558
15559         Compute definitions as we boot the various types, as they are used
15560         immediately (value_type class will need object_type, but if we do
15561         not initialize object_type, we will pass a null, which will let
15562         the runtime pick the System.Object from the existing corlib, which
15563         is not what we want).
15564
15565 2002-04-22  Patrik Torstensson <totte@labs2.com>
15566
15567         * cs-tokenizer.cs: fixed a number of trim() issues.
15568
15569 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15570
15571         * expression.cs (Argument.Type): Ensure that we return the correct
15572         type when we have out or ref parameters [in which case we 
15573         append a "&"].
15574
15575 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15576
15577         * class.cs (Property, Indexer): Allow extern modifier in there. 
15578
15579         * typemanager.cs (InitBaseTypes): Initializes object_type and
15580         value_type, since those will be used early on during the bootstrap
15581         process to compile corlib.
15582
15583         (InitCoreTypes): Move code from here to InitBaseTypes.
15584
15585 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15588         single-dimension arrays as using the ldlen opcode.  
15589
15590         Daniel Lewis discovered this optimization.  
15591
15592         * typemanager.cs: Add signature for System.Array::get_Length
15593
15594 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15595
15596         * statement.cs: report the error when the foreach does not apply to an
15597         array nor a collection.
15598
15599 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15600
15601         * expression.cs: Add implicit conversions to the operator ~.
15602
15603         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15604
15605         * typemanager.cs: Locate the decimal constructor.
15606
15607 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15608
15609         * attribute.cs: use the new property of TypeOf.
15610         * expression.cs: added 'get' property around typearg.
15611
15612         These changes fix a build breaker reported by NickD. Is this the
15613         correct way to fix?  If not, please, revert my changes and make it
15614         work :-).
15615
15616 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15617
15618         * attribute.cs: Add support for typeof in attribute invocations.
15619         I am not sure that this is right though.
15620
15621 2002-04-14  Duncan Mak  <duncan@ximian.com>
15622
15623         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15624         Binary.Operator.Division case.
15625
15626 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15627
15628         * class.cs (DefineType): Ensure that we do a proper check on
15629         attribute types and also register it with the TypeManager.
15630
15631         (TypeContainer.Targets): The default for attribute types is
15632         AttributeTargets.All.
15633
15634         * attribute.cs (ApplyAttributes): Registering the attribute type
15635         is done elsewhere, not when we discover we have a Usage attribute.
15636
15637 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15638
15639         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15640         and get rid of is_delegate parameter.
15641
15642         * everywhere : update.
15643
15644 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15645
15646         * cs-parser.jay (compilation_unit): Revamp completely to use
15647         some new ideas that I got from Rhys' grammar to solve the problems
15648         with assembly level attributes.
15649
15650         (outer_declaration): New grammar production.
15651
15652         (attribute_sections): Add.
15653
15654         (opt_attributes): Base on attribute_sections
15655
15656         (namespace_declaration): Allow opt_attributes to tackle the case
15657         when we have assembly level attributes - we are clever in this
15658         regard now ;-)
15659
15660         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15661         attributes in the non-global context.
15662
15663         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15664         instead of SetGlobalAttributes.
15665
15666         * class.cs, rootcontext.cs : Ensure we define and generate 
15667         attribute types before anything else.
15668
15669         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15670         and flag the new error -20 for the case when the attribute type
15671         does not have valid targets specified. csc does not catch this.
15672
15673         * ../errors/errors.txt : update for error # -20
15674
15675 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15676
15677         * support.cs (InternalParameters.ParameterModifier): Do some null
15678         checking and return sane values.
15679
15680         * class.cs (Method.Define): If we are a PInvoke method, ensure
15681         that we are static and extern. Report error # 601
15682
15683         * ../errors/cs0601.cs : Add test case for the above error.
15684
15685 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15686
15687         * rootcontext.cs (attribute_types): We need to keep type of
15688         all attribute types separately and emit code for them first.
15689
15690         (RegisterAttribute) : Implement.
15691
15692         * class.cs (DefineType): Check if the current Type is a custom
15693         attribute type and register it accordingly.
15694
15695         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15696         adding the first attribute twice and rename to
15697
15698         (SetGlobalAttributes): this.
15699
15700         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15701         lookups.
15702
15703         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15704         if we are processing global arguments. Hmm, I am unsure of this.
15705
15706 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15707
15708         * expression.cs: added static array of strings to avoid calling
15709         Enum.ToString () for Operator in Binary. Significant recover of
15710         performance.
15711
15712 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15713
15714         * class.cs (FindMembers): Allow the Builders of the various
15715         members to be null.  If they are skip them.  This only happens
15716         during the PInvoke declaration.
15717
15718 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15721         failure, so we do not keep going afterwards.
15722
15723         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15724         wanted to pass `false' as the `is_delegate' argument.  If this is
15725         the case, why not use delegate_type == null to mean `is_delegate =
15726         false' and anything else as is_delegate = true.
15727
15728 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15729
15730         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15731         code for the section, not the beginning of the tests.
15732
15733 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15736
15737         * expression.cs (Binary): same.  Warn about errors where we have
15738         Enum/Enum in operator + as well.
15739
15740 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15741
15742         * statement.cs:
15743                 - added support for switch(bool)
15744                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15745                 - add TableSwitchEmit() to handle table-based switch statements
15746
15747 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15748
15749         * expression.cs (Invocation.OverloadResolve): Factor out code which
15750         does parameter compatibility checking with arguments so that we can 
15751         re-use the code even from Delegate.VerifyApplicability
15752
15753         (VerifyArgumentsCompat): Move above code here.
15754
15755         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15756         and instead make a call to the above method.
15757
15758 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15759
15760         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15761         We use it to keep track of classes which are attribute types.
15762
15763 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * delegate.cs (Delegate.Define): Correctly define the types in the
15766         presence of fixed and array parameters.
15767
15768         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15769         doing FindMembers.
15770
15771         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15772         include NonPublic after the first iteration.
15773
15774         * class.cs (Indexer.CheckBase): Only check if both parents are
15775         non-null. 
15776
15777         * cs-parser.jay (accessor_body): If empty, set to null.
15778
15779         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15780         same code path here to resolve constants names that we did have in
15781         MemberAccess.DoResolve.  There is too much code duplicated here.
15782
15783 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15786
15787         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15788         to MakeUnionSet.
15789
15790         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15791         tokens, numbers and strings.
15792
15793         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15794         parenthesis.
15795
15796         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15797         asyncronous parameters and the regular parameters.  
15798
15799         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15800         specify the target directory.
15801
15802         * expression.cs: (This.DoResolve): Simplify
15803         (As.Emit): Optimize, do not generate IsInst if the expression is
15804         always of the given type.
15805
15806         (Is.DoResolve): Bug fix, we were reporting both always/never for
15807         the is expression.
15808
15809         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15810         creating too many unnecessary arrays.
15811
15812 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15813
15814         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15815         fields instead of rolling our own initializer.   Takes care of all
15816         implicit conversions, and drops unnecessary static checks/argument.
15817
15818 2002-03-31  Dick Porter  <dick@ximian.com>
15819
15820         * driver.cs: use the GetDirectories() return values properly, and
15821         use "/" as path separator.
15822
15823 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15824
15825         * expression.cs (Unary): Optimize - - expr into expr.
15826         (Binary): Optimize a + (-b) into a -b.
15827
15828         * codegen.cs (CodeGen): Made all methods static.
15829
15830 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * rootcontext.cs: 
15833
15834         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15835         TypeBuilder property.
15836
15837         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15838         instead. 
15839
15840         * tree.cs: Removed the various RecordXXXX, and replaced with a
15841         single RecordDecl.  Removed all the accessor methods, and just
15842         left a single access point Type 
15843
15844         * enum.cs: Rename DefineEnum to DefineType.
15845
15846         * decl.cs: New abstract method `DefineType' used to unify the
15847         Defines for Enumerations, Interfaces, TypeContainers and
15848         Delegates.
15849
15850         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15851         LookupBaseClasses method that used to live in class.cs and
15852         interface.cs here, and renamed to FindType.
15853
15854         * delegate.cs: Implement DefineType.  Take advantage of the
15855         refactored pattern for locating the parent builder without taking
15856         the parent_builder argument (which we know does not work if we are
15857         nested, and triggering a toplevel definition).
15858
15859 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15860
15861         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15862         accessibility of a member has changed during override and report
15863         an error if so.
15864
15865         * class.cs (Method.Define, Property.Define): Only complain on
15866         overrides if the method is private, any other accessibility is
15867         fine (and since we just checked the permission is the same, we are
15868         good to go).
15869
15870         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15871         and elif are processed always.  The other pre-processing
15872         directives are only processed if we are "taking" the path
15873
15874 2002-03-29  Martin Baulig  <martin@gnome.org>
15875
15876         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15877         current location is not Null.
15878
15879         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15880         a separate method so we can profile it.
15881
15882         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15883         `span.Seconds' are just seconds, but no minutes or hours.
15884         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15885
15886 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15889         Remove the gratuitous set of Final:
15890
15891                                 // If an interface implementation, then we can set Final.
15892                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15893                                     implementing.DeclaringType.IsInterface)
15894                                         flags |= MethodAttributes.Final;
15895
15896         I do not know what I was smoking when I used that.
15897
15898
15899         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15900         step into fixing the name resolution issues for delegates and
15901         unifying the toplevel name resolution.
15902
15903 2002-03-28  Martin Baulig  <martin@gnome.org>
15904
15905         * class.cs (Method.Emit): If we have a symbol writer, call its
15906         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15907         tell it about the current method.
15908
15909         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15910         writer that we're going to emit the first byte of IL code for a new
15911         statement (a new source line).
15912         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15913         EmitContext.Mark() before emitting any code.
15914
15915         * location.cs (SymbolDocument): Return null when we're Null.
15916
15917         * statement.cs (Statement): Moved the `Location loc' variable here.
15918         (Statement.EmitBoolExpression): If we have a symbol writer, call
15919         ec.Mark() before emitting any code to tell it that we're at the
15920         beginning of a new statement.
15921         (StatementExpression): Added `Location' argument to the constructor.
15922         (Block): Added public readonly variable `StartLocation' and public
15923         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15924         (Block): Added constructor which takes a start and end location.
15925         (Block.SetEndLocation): New method. This sets the end location.
15926         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15927         local variables we create.
15928         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15929         each statement and do also mark the begin and end of the block.
15930
15931         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15932         tell it the current lexer.Location, use Location.Null for the end of the
15933         block.
15934         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15935         current block, set its end location using SetEndLocation().
15936         (statement_expression): StatementExpression constructor now takes the
15937         lexer.Location as additional argument.
15938         (for_statement, declare_local_variables): Likewise.
15939         (declare_local_variables): When creating a new implicit block, use the
15940         new Block constructor and pass it the lexer.Location.
15941
15942 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15945         members also on the parent interfaces recursively.
15946
15947 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * report.cs: Use new formats, since Gonzalo finished the missing
15950         bits. 
15951
15952         * expression.cs (Binary.ResolveOperator): added missing operator|
15953         operator& and operator^ for bool/bool.
15954
15955         * cs-parser.jay: CheckDef now takes a Location argument that is
15956         used to report errors more precisly (instead of reporting the end
15957         of a definition, we try to track something which is a lot closer
15958         to the source of the problem).
15959
15960         * cs-tokenizer.cs: Track global token use, so we can properly flag
15961         the use of #define/#undef after the first token has been seen.
15962
15963         Also, rename the reportXXXX to Error_DescriptiveName
15964
15965         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15966         TypeContainer, so that Enum and Interface can use this too.
15967
15968         * class.cs (TypeContainer.LookupInterfaceOrClass,
15969         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15970         `builder' argument.  Typically this was used to pass the parent
15971         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15972         the definition).  
15973
15974         The problem is that a nested class could trigger the definition of
15975         a toplevel class, and the builder would be obviously wrong in that
15976         case. 
15977
15978         So we drop this argument, and we compute dynamically the
15979         TypeBuilder/ModuleBuilder (the correct information was available
15980         to us anyways from DeclSpace.Parent)
15981
15982         * interface.cs (Interface.DefineInterface): Drop builder
15983         parameter cleanup like class.cs
15984
15985         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15986         like class.cs
15987
15988         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15989         values. 
15990
15991         (Try.Emit): Propagate the returns value from the statement.
15992
15993         (Return.Emit): Even if we are leavning 
15994
15995         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15996
15997         * modifiers.cs: Fix the computation of MethodAttributes flags.
15998
15999 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16000
16001         * driver.cs: allow compilation of files that start with '/'.
16002         Add a default case when checking the argument of --target.
16003
16004 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16005
16006         * interface.cs: Implement the same search algorithm for types in
16007         the interface code.
16008
16009         * delegate.cs: Do not allow multiple definition.
16010
16011         * Recovered ChangeLog that got accidentally amputated
16012
16013         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16014
16015         * rootcontext.cs: Load manually enum to allow core classes to
16016         contain enumerations.
16017
16018         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16019         Update to new static methods in TypeManager.
16020
16021         * typemanager.cs (GetMethod, GetConstructor): Use our
16022         implementation of FindMembers to find the members, since during
16023         corlib compilation, the types are TypeBuilders and GetMethod and
16024         GetConstructor do not work.
16025
16026         Make all methods in TypeManager static.
16027
16028         (InitCodeHelpers): Split the functionality from
16029         the InitCodeTypes function.
16030
16031         * driver.cs: Call InitCodeHelpers after we have populated the
16032         types. 
16033
16034         * cs-parser.jay (delegate_declaration): we did not used to compute
16035         the delegate name correctly for void delegates.
16036
16037 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * rootcontext.cs (RootContext): Init the interface_resolve_order
16040         and type_container_resolve_order always.
16041
16042         (ResolveCore, BootstrapCorlib_ResolveClass,
16043         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16044         compiler when compiling with --nostdlib
16045
16046         * class.cs (TypeContainer.DefineType): Check that our parent is
16047         not null.  This test is most important when we are bootstraping
16048         the core types.
16049
16050         * codegen.cs: Split out the symbol writing code.
16051
16052 2002-03-25  Martin Baulig  <martin@gnome.org>
16053
16054         * driver.cs (-g): Made -g an alias for --debug.
16055
16056 2002-03-24  Martin Baulig  <martin@gnome.org>
16057
16058         * codegen.cs (SymbolWriter): New public variable. Returns the
16059         current symbol writer.
16060         (CodeGen): Added `bool want_debugging_support' argument to the
16061          constructor. If true, tell the ModuleBuild that we want debugging
16062         support and ask it for the ISymbolWriter.
16063         (Save): If we have a symbol writer, call it's Close() method after
16064         saving the assembly.
16065
16066         * driver.c (--debug): New command line argument to create a
16067         debugger information file.
16068
16069         * location.cs (SymbolDocument): New public property. Returns an
16070         ISymbolDocumentWriter object for the current source file or null
16071         if we don't have a symbol writer.
16072
16073 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16074
16075         * driver.cs (LoadAssembly): Correctly return when all the paths
16076         have been tried and not before.
16077
16078         * statement.cs (Switch.Emit): return the actual coverage for this
16079         statement (returns/not-returns)
16080
16081         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16082         switch of the statement if we are the last switch section.  That
16083         kills two problems: try/catch problems (we used to emit an empty
16084         nop at the end) and switch statements where all branches would
16085         return. 
16086
16087 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16088
16089         * driver.cs: Add default assemblies (the equivalent to the
16090         Microsoft CSC.RSP file)
16091
16092         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16093         also update tokens_seen and set it to false.
16094
16095         * driver.cs: Implement --recurse for Mike.
16096
16097         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16098         correctly splitting out the paths.
16099
16100 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16101
16102         * interface.cs (Interface.PopulateProperty): Instead of using
16103         `parent' as the declaration space for the set parameters, use
16104         `this' 
16105
16106         * support.cs (InternalParameters): InternalParameters constructor
16107         takes a DeclSpace instead of a TypeContainer.
16108
16109         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16110         types are being initialized, load the address of it before calling
16111         the function.  
16112
16113         (New): Provide a mechanism to disable the generation of local
16114         value type temporaries when the caller will be providing us with
16115         an address to store it.
16116
16117         (ArrayCreation.EmitDynamicInitializers): Use it.
16118
16119 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16120
16121         * expression.cs (Invocation.EmitArguments): Only probe for array
16122         property if there is more than one argument.  Sorry about that.
16123
16124         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16125         empty param arrays.
16126
16127         * class.cs (Method.LabelParameters): Fix incorrect code path that
16128         prevented the `ParamArrayAttribute' from being applied to the
16129         params attribute.
16130
16131 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16132
16133         * support.cs (ReflectionParameters): Correctly compute whether the
16134         last argument is a params array.  Fixes the problem with
16135         string.Split ('a')
16136
16137         * typemanager.cs: Make the assemblies array always be non-null
16138         (empty, but non-null)
16139
16140         * tree.cs (RecordDecl): New function that abstracts the recording
16141         of names.  This reports error 101, and provides a pointer to the
16142         previous declaration.  Fixes a crash in the compiler.
16143
16144         * cs-parser.jay (constructor_declaration): Update to new grammar,
16145         and provide a constructor_body that can be empty.
16146
16147 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * driver.cs: Add support for --resources.
16150
16151         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16152         Make all types for the various array helper methods be integer.
16153
16154         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16155         CheckState to ConvCast.
16156
16157         (ConvCast): Now it takes a `checked' state argument, to avoid
16158         depending on the emit context for the conversion, and just using
16159         the resolve time setting.
16160
16161         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16162         instead of Invocation.EmitArguments.  We do not emit the original
16163         arguments, instead we emit those which have been converted to
16164         unsigned int expressions.
16165
16166         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16167
16168         * codegen.cs: ditto.
16169
16170         * expression.cs (LocalVariableReference): Drop the use of the
16171         Store function that depended on the variable index.
16172
16173         * statement.cs (VariableInfo): Drop the `Idx' property from this
16174         class, as this is not taking into account the indexes for
16175         temporaries tat we generate during the execution, getting the
16176         indexes wrong.
16177
16178         * class.cs: First emit class initializers, then call the parent
16179         constructor. 
16180
16181         * expression.cs (Binary): Fix opcode emision.
16182         (UnaryMutator.EmitCode): Support checked code generation
16183
16184         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16185         matches for events for both the Static and Instance scans,
16186         pointing to the same element.   Fix that.
16187
16188 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16189
16190         * rootcontext.cs (ResolveTree): Always set the
16191         interface_resolve_order, because nested interfaces will be calling
16192         into us.
16193
16194         * class.cs (GetInterfaceOrClass): Track the same resolution
16195         process used by TypeManager.LookupType.  This fixes the nested
16196         type lookups in class declarations (separate path from
16197         LookupType). 
16198
16199         (TypeContainer.DefineType): Also define nested interfaces.
16200         (TypeContainer.RegisterOrder): New public function used to
16201         register the order in which child interfaces need to be closed.
16202
16203         Nested interfaces need to be closed after their parents have been
16204         created. 
16205
16206         * interface.cs (InterfaceAttr): Put all the logic for computing
16207         the interface attribute here. 
16208
16209         (DefineInterface): Register our interface order with the
16210         RootContext or with the TypeContainer depending on the case.
16211
16212 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16213
16214         * cs-parser.jay: rework foreach statement to work with the new
16215         changes to the policy on SimpleNames.
16216
16217         * report.cs: support Stacktrace on warnings as well.
16218
16219         * makefile: drop --unsafe and /unsafe from the compile.
16220
16221 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16222
16223         * ecore.cs (StandardConversionExists): Modify to take an Expression
16224         as the first parameter. Ensure we do null -> reference type conversion
16225         checking.
16226
16227         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16228         temporary Expression objects.
16229
16230 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16231
16232         * interface.cs: workaround bug in method overloading resolution
16233         (there is already a bugzilla bug for it).
16234
16235 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16236
16237         We could also solve this problem by having a separate path for
16238         performing type lookups, instead of DoResolve, we could have a
16239         ResolveType entry point, and only participating pieces of the
16240         production (simplename, deref, array) would implement this. 
16241
16242         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16243         signal SimpleName to only resolve type names and not attempt to
16244         resolve anything else.
16245
16246         * expression.cs (Cast): Set the flag.
16247
16248         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16249
16250         * class.cs: Only report 108 if there is no `new' modifier.
16251
16252         * cs-parser.jay: rework foreach statement to work with the new
16253         changes to the policy on SimpleNames.
16254
16255         * report.cs: support Stacktrace on warnings as well.
16256
16257         * makefile: drop --unsafe and /unsafe from the compile.
16258
16259 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16260
16261         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16262         lookups here, instead of doing that at parse time.  This means
16263         that our grammar will not introduce `LocalVariableReferences' as
16264         expressions at this point.  That solves the problem of code like
16265         this:
16266
16267         class X {
16268            static void Main ()
16269            { int X = 1;
16270             { X x = null }}}
16271
16272         This is only half the fix.  The full fix requires parameters to
16273         also be handled in this way.
16274
16275         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16276         makes the use more obvious of the DeclSpace.  The
16277         ec.TypeContainer.TypeBuilder is now only used to pull the
16278         TypeBuilder for it.
16279
16280         My theory is that I can get rid of the TypeBuilder completely from
16281         the EmitContext, and have typecasts where it is used (from
16282         DeclSpace to where it matters).  
16283
16284         The only pending problem is that the code that implements Aliases
16285         is on TypeContainer, and probably should go in DeclSpace.
16286
16287         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16288         lookups here, instead of doing that at parse time.  This means
16289         that our grammar will not introduce `LocalVariableReferences' as
16290         expressions at this point.  That solves the problem of code like
16291         this:
16292
16293         class X {
16294            static void Main ()
16295            { int X = 1;
16296             { X x = null }}}
16297
16298         This is only half the fix.  The full fix requires parameters to
16299         also be handled in this way.
16300
16301         * class.cs (Property.DefineMethod): When implementing an interface
16302         method, set newslot, when implementing an abstract method, do not
16303         set the flag (before we tried never setting it, or always setting
16304         it, which is the difference).
16305         (Indexer.DefineMethod): same.
16306         (Method.DefineMethod): same.
16307
16308         * ecore.cs: Only set the status used flag if we get back a Field.
16309
16310         * attribute.cs: Temporary hack, so Paolo can keep working.
16311
16312 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16313
16314         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16315         the unmanaged type in the case we have a MarshalAs attribute.
16316
16317         (Resolve): Handle the case when we are parsing the special MarshalAs
16318         attribute [we need to store the unmanaged type to use later]
16319
16320         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16321         MarshalAs Attribute.
16322
16323         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16324         on parameters and accordingly set the marshalling info.
16325
16326 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16327
16328         * class.cs: Optimizing slightly by removing redundant code after
16329         we switched to the `NoTypes' return value.
16330         (Property.DefineMethod): use NoTypes here too.
16331
16332         This fixes the bug I introduced in my last batch of changes.
16333
16334 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16335
16336         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16337
16338         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16339         Enums since those are types too. 
16340
16341         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16342
16343         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16344         thanks to a call during the lookup process.
16345
16346 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16347
16348         * statement.cs (Foreach): Lots of work to accomodate a particular
16349         kind of foreach statement that I had not kept in mind.  It is
16350         possible to have foreachs on classes that provide a GetEnumerator
16351         method that return objects that implement the "pattern" for using
16352         a foreach, there is no need to support GetEnumerator
16353         specifically. 
16354
16355         This is needed to compile nant.
16356
16357         * decl.cs: Only report 114 if the member is not `Finalize' and if
16358         the warning level is at least 2.
16359
16360         * class.cs: Moved the compare function from Method to
16361         MethodSignature. 
16362
16363         (MethodSignature.InheritableMemberSignatureCompare): Add new
16364         filter function that is used to extract inheritable methods from a
16365         class. 
16366
16367         (Method.Define): Use the new `inheritable_method_signature_filter'
16368         delegate
16369
16370         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16371         command. 
16372
16373 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16374
16375         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16376
16377         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16378
16379         * expression.cs: Pass location information to
16380         ConvertImplicitStandard. 
16381
16382         * class.cs: Added debugging code to track return values from
16383         interfaces. 
16384
16385 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16386
16387         * expression.cs (Is.DoResolve): If either side of the `is' is an
16388         interface, do not flag the warning.
16389
16390         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16391         for interfaces
16392
16393         * report.cs: Allow for --fatal to be used with --probe.
16394
16395         * typemanager.cs (NoTypes): Move the definition for the empty Type
16396         array here. 
16397
16398         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16399         properties. 
16400         (TypeContainer.DefineProxy): New function used to proxy to parent
16401         implementations when implementing interfaces.
16402         (TypeContainer.ParentImplements): used to lookup if our parent
16403         implements a public function that is required by an interface.
16404         (TypeContainer.VerifyPendingMethods): Hook this up.
16405
16406         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16407         `modules' and `assemblies' arraylists into arrays.  We only grow
16408         these are the very early start up of the program, so this improves
16409         the speedof LookupType (nicely measured).
16410
16411         * expression.cs (MakeByteBlob): Replaced unsafe code with
16412         BitConverter, as suggested by Paolo.
16413
16414         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16415         folding of string concatenation, but if either side is a string,
16416         and the other is not, then return null, and let the runtime use
16417         the concatenation on the string plus the object (using
16418         `Object.ToString'). 
16419
16420 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16421
16422         Constant Folding has been implemented now.
16423
16424         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16425         the error instead on types that are not supported in one's
16426         complement. 
16427
16428         * constant.cs (Constant and all children): New set of functions to
16429         perform implict and explicit conversions.
16430
16431         * ecore.cs (EnumConstant): Implement the new functions to perform
16432         conversion by proxying to the child expression.
16433
16434         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16435         own separate setting that can not be turned off from the command
16436         line using --unchecked or --checked and is only controlled using
16437         the checked/unchecked statements and expressions.  This setting is
16438         used by the constant folder to flag errors.
16439
16440         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16441         ConstantCheckState as well.   
16442
16443         During Resolve, they also have to flag the state, because the
16444         constant folder runs completely in the Resolve phase.
16445
16446         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16447         well.
16448
16449 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16450
16451         * cfold.cs: New file, this file contains the constant folder.
16452
16453         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16454         argument to track whether we are using the resulting address to
16455         load or store a value and provide better error messages. 
16456
16457         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16458         new AddressOf arguments.
16459
16460         * statement.cs (Foreach.EmitCollectionForeach): Update
16461
16462         * expression.cs (Argument.Emit): Call AddressOf with proper
16463         arguments to track usage.
16464
16465         (New.DoEmit): Call AddressOf with new arguments.
16466
16467         (Unary.Emit): Adjust AddressOf call.
16468
16469 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16470
16471         * cs-parser.jay (member_access): Change the case for pre-defined types
16472         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16473         this suggestion.
16474
16475         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16476         a method body.
16477
16478         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16479         essentially like methods and apply attributes like MethodImplOptions to them too.
16480
16481         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16482         not being null.
16483
16484         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16485         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16486         is the DeclSpace.
16487
16488         * Update code everywhere accordingly.
16489
16490         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16491
16492         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16493
16494 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16495
16496         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16497         try performing lookups against those instead of jumping straight into using
16498         the 'using' clauses.
16499
16500         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16501
16502         (LookupType): Perform lookups in implicit parents too.
16503
16504         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16505         sequence as RootContext.LookupType. 
16506
16507         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16508         the various cases of namespace lookups into this method.
16509
16510 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16513         in positional arguments)
16514
16515         * class.cs (Operator): Update the AllowedModifiers to contain
16516         extern. 
16517
16518         * cs-parser.jay: Update operator declaration to allow for the
16519         operator body to be empty.
16520
16521         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16522         values. 
16523
16524 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * class.cs (Method.Emit): Label parameters.
16527
16528         * driver.cs: Return 1 or 0 as the program exit code.
16529
16530 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16531
16532         * expression.cs: Special case the `null' object when trying to
16533         auto-compute the type, as anything can be explicitly converted to
16534         that. 
16535
16536         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16537         spotting this Paolo.
16538
16539         (Expression.ImplicitNumericConversion): Perform comparissions of
16540         the type using the underlying type in the case of an enumeration
16541         rather than using the enumeration type for the compare.
16542
16543         Cope with the underlying == type case, which is not possible to
16544         catch before. 
16545
16546         (Expression.ConvertNumericExplicit): Perform comparissions of
16547         the type using the underlying type in the case of an enumeration
16548         rather than using the enumeration type for the compare.
16549
16550         * driver.cs: If the user does not supply an extension, assume .exe
16551
16552         * cs-parser.jay (if_statement): Rewrote so that we can track the
16553         location for the if statement.
16554
16555         * expression.cs (Binary.ConstantFold): Only concat strings when
16556         the operation is "+", not everything ;-)
16557
16558         * statement.cs (Statement.EmitBoolExpression): Take a location
16559         argument. 
16560         (If, While, Do): Track location.
16561
16562         * expression.cs (Binary.ResolveOperator): In the object + string
16563         case, I was missing a call to ConvertImplicit
16564
16565 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16566
16567         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16568         Location arguments. Ensure we use RootContext.LookupType to do our work
16569         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16570
16571         * interface.cs (PopulateMethod): Handle the type of the parameter being
16572         null gracefully.
16573
16574         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16575         have a params method with no fixed arguments and a call is made with no
16576         arguments.
16577
16578 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16579
16580         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16581         the verbatim-string-literal
16582
16583         * support.cs (InternalParameters.ParameterModifier): handle null
16584         fixed parameters.
16585         (InternalParameters.ParameterType): ditto.
16586
16587         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16588         duplicating the name of the variable parameter.
16589         (GetParameterByName): Fix bug where we were not looking up array
16590         paramters if they were the only present (thanks Paolo!).
16591         (GetParameterInfo): We only have an empty set of types if both
16592         fixed and array are set to null.
16593         (GetParameterInfo-idx): Handle FixedParameter == null
16594
16595         * cs-parser.jay: Handle the case where there is no catch
16596         statements (missing null test).
16597
16598 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16599
16600         * driver.cs (MainDriver): Be conservative on our command line
16601         handling.
16602
16603         Catch DirectoryNotFoundException when calling GetFiles.
16604
16605         (SplitPathAndPattern): Used to split the input specification into
16606         a path and a pattern that we can feed to Directory.GetFiles.
16607
16608 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16609
16610         * statement.cs (Fixed): Implement the last case of the Fixed
16611         statement (string handling).
16612
16613         * expression.cs (StringPtr): New class used to return a char * to
16614         a string;  Used by the Fixed statement.
16615
16616         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16617
16618         * expression.cs (Binary.ResolveOperator): Remove redundant
16619         MemberLookup pn parent type.
16620         Optimize union call, we do not need a union if the types are the same.
16621         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16622         type.
16623
16624         Specialize the use of MemberLookup everywhere, instead of using
16625         the default settings. 
16626
16627         (StackAlloc): Implement stackalloc keyword.
16628
16629         * cs-parser.jay: Add rule to parse stackalloc.
16630
16631         * driver.cs: Handle /h, /help, /?
16632
16633         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16634         before we supported unsafe code.
16635
16636         * makefile: add --unsafe to the self compilation of mcs.
16637
16638 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16639
16640         * expression.cs (PointerArithmetic): New class that is used to
16641         perform pointer arithmetic.
16642         (Binary.Resolve): Handle pointer arithmetic
16643         Handle pointer comparission.
16644         (ArrayPtr): Utility expression class that is used to take the
16645         address of an array.
16646
16647         (ElementAccess): Implement array access for pointers
16648
16649         * statement.cs (Fixed): Implement fixed statement for arrays, we
16650         are missing one more case before we are done.
16651
16652         * expression.cs (Indirection): Implement EmitAssign and set the
16653         ExprClass to Variable.  This allows pointer dereferences to be
16654         treated as variables, and to have values assigned to them.
16655
16656         * ecore.cs (Expression.StoreFromPtr): New utility function to
16657         store values dereferencing.
16658
16659 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16660
16661         * expression.cs (Binary.ResolveOperator): Ensure that we are
16662         not trying to operate on a void type - this fixes the reported
16663         bug.
16664
16665         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16666         the parent implementation is sealed.
16667
16668         * ../errors/cs0239.cs : Add.
16669
16670         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16671
16672         * typemanager.cs (unverifiable_code_type): Corresponds to 
16673         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16674         which have unsafe code in them.
16675
16676         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16677         unsafe context.
16678
16679 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16680
16681         * cs-tokenizer.cs: Add support for @"litreal strings"
16682
16683         Make tokenizer accept pre-processor directives
16684         on any column (remove the old C-like limitation). 
16685
16686         * rootcontext.cs (EmitCode): Emit any global attributes.
16687         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16688
16689         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16690
16691         * cs-parser.jay: Add support for global attributes.  
16692
16693 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16694
16695         * expression.cs (Indirection): New helper class.  Unary will
16696         create Indirection classes to be able to implement the
16697         IMemoryLocation interface on it.
16698
16699 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * cs-parser.jay (fixed_statement): reference the right statement.
16702
16703         * statement.cs (Fixed.Emit): Finish implementing the fixed
16704         statement for the &x case.
16705
16706 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16707
16708         * class.cs (Property.Define, Method.Define): Remove newslot when
16709         `implementing'.  
16710
16711         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16712         wrong.  NewSlot should only be used if the `new' keyword is present.
16713
16714         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16715         locating our system dir.  Sorry about this.
16716
16717 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16718
16719         * driver.cs (GetSystemDir): Compute correctly the location of our
16720         system assemblies.  I was using the compiler directory instead of
16721         the library directory.
16722
16723 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16724
16725         * expression.cs (BetterFunction): Put back in what Miguel commented out
16726         since it is the correct fix. The problem is elsewhere ;-)
16727
16728         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16729         parameters of the parms method are themselves compatible or not !
16730
16731         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16732         to check that a class implements an interface before saying that an implicit
16733         conversion was allowed. Use ImplementsInterface to do the checking.
16734
16735 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * class.cs (Method.Define): Track whether we are an explicit
16738         implementation or not.  And only call DefineMethodOverride if we
16739         are an explicit implementation.
16740
16741         (Property.DefineMethod): Ditto.
16742
16743 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16744
16745         * expression.cs (BetterFunction): Catch hideous bug which was
16746          preventing us from detecting ambiguous calls due to implicit casts i.e
16747         cs0121.
16748
16749 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * support.cs (Pair): Remove un-needed method.  I figured why I was
16752         getting the error in cs-parser.jay, the variable in a foreach loop
16753         is readonly, and the compiler does not really treat this as a variable.
16754
16755         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16756         instead of EQUALS in grammar.  
16757
16758         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16759
16760         * expression.cs (Unary.DoResolve): Check whether the argument is
16761         managed or not.
16762
16763 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16764
16765         * support.cs: Api for Pair to set a value.  Despite the fact that
16766         the variables are public the MS C# compiler refuses to compile
16767         code that accesses the field if the variable is part of a foreach
16768         statement. 
16769
16770         * statement.cs (Fixed): Begin implementation of the fixed
16771         statement.
16772
16773         (Block.AddVariable): Return the VariableInfo on success and null
16774         on failure instead of true/false. 
16775
16776         * cs-parser.jay (foreach): Catch errors on variables already
16777         defined (we were ignoring this value before) and properly unwind
16778         the block hierarchy
16779
16780         (fixed_statement): grammar for the fixed statement.
16781
16782 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16783
16784         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16785         pointer types to be incretemented.
16786
16787         (SizeOf): Implement.
16788
16789         * cs-parser.jay (pointer_member_access): Implement
16790         expr->IDENTIFIER production.
16791
16792         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16793         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16794         on safe contexts.
16795
16796         (Unary): Implement indirection.
16797
16798         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16799         use in non-unsafe context).
16800
16801         (SimpleName.DoResolve): Check for pointers in field access on safe
16802         contexts. 
16803
16804         (Expression.LoadFromPtr): Factor the load-indirect code in this
16805         function.  This was duplicated in UnboxCast and ParameterReference
16806
16807 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16808
16809         * expression.cs (ComposedCast): report an error if a pointer cast
16810         is used in a safe region.
16811
16812         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16813         pointer type casts in unsafe context.
16814
16815         * codegen.cs (EmitContext): Set up IsUnsafe.
16816
16817         * cs-parser.jay (non_expression_type): Add productions for pointer
16818         casts. 
16819
16820         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16821         code.  We should not use force into static mode if the method is
16822         not virtual.  Fixes bug in MIS
16823
16824         * statement.cs (Do.Emit, While.Emit, For.Emit,
16825         Statement.EmitBoolExpression): Add support to Do and While to
16826         propagate infinite loop as `I do return' semantics.
16827
16828         Improve the For case to also test for boolean constants.
16829
16830         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16831         to the list of attributes we can add.
16832
16833         Remove `EmitContext' argument.
16834
16835         * class.cs (Method.Define): Apply parameter attributes.
16836         (Constructor.Define): Apply parameter attributes.
16837         (MethodCore.LabelParameters): Move here the core of labeling
16838         parameters. 
16839
16840         * support.cs (ReflectionParameters.ParameterModifier,
16841         InternalParameters.ParameterModifier): Use IsByRef on the type and
16842         only return the OUT bit for these parameters instead of in/out/ref
16843         flags.
16844
16845         This is because I miss-understood things.  The ParameterInfo.IsIn
16846         and IsOut represent whether the parameter has the [In] and [Out]
16847         attributes set.  
16848
16849 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16850
16851         * ecore.cs (FieldExpr.Emit): Release temporaries.
16852
16853         * assign.cs (LocalTemporary.Release): new function.
16854
16855         * codegen.cs (EmitContext.GetTemporaryStorage,
16856         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16857         temporary storage.  Now we can "put back" localbuilders when we
16858         are done with them
16859
16860 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16863         need to make a copy of the variable to generate verifiable code.
16864
16865 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16866
16867         * driver.cs: Compute dynamically the system directory.
16868
16869         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16870         Slower, but more generally useful.  Used by the abstract
16871         registering implementation. 
16872
16873         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16874         the rules for the special rule on Type/instances.  First check if
16875         we have the same name, and if so, try that special static path
16876         rather than the instance path.
16877
16878 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16879
16880         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16881         for, while and if.
16882
16883         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16884         Enum, ValueType, Delegate or Array for non-corlib compiles.
16885
16886         * cs-tokenizer.cs: Catch long identifiers (645)
16887
16888         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16889         piece of code.
16890
16891         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16892         fix, we were returning too early, so we were not registering
16893         pending methods from abstract classes.
16894
16895         Do not register pending methods if the class is abstract.
16896
16897         * expression.cs (Conditional.DoResolve): Report circular implicit
16898         conversions when we neecd to compute it for conditional
16899         expressions. 
16900
16901         (Is.DoResolve): If the expression is always of the provided type,
16902         flag warning 183.  If the expression can not ever be of the
16903         provided type flag warning 184.
16904
16905         * class.cs: Catch 169 as well.
16906
16907         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16908         read. 
16909
16910 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16911
16912         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16913
16914 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16915
16916         * interface.cs: (PopulateMethod): Check for pointers being defined
16917         only if the unsafe context is active.
16918         (PopulateProperty): ditto.
16919         (PopulateIndexer): ditto.
16920
16921         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16922         specified.  If pointers are present, make sure that they are
16923         present in an unsafe context.
16924         (Constructor, Constructor.Define): ditto.
16925         (Field, Field.Define): ditto.
16926         (Property, Property.Define): ditto.
16927         (Event, Event.Define): ditto.
16928
16929         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16930         hashtable if there are classes or structs defined.
16931
16932         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16933         code, as the constant resolution moved.
16934
16935         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16936         the metadata, so we can flag error 133. 
16937
16938         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16939         pointer is being declared in an unsafe context.
16940
16941 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16942
16943         * modifiers.cs (Modifiers.Check): Require a Location argument.
16944         Report error 227 for Unsafe use.
16945
16946         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16947
16948         * statement.cs (For.Emit): If the test is null, then report that
16949         we do `return', as we wont reach anything afterwards.
16950
16951         (Switch.SwitchGoverningType): Track the expression that matched
16952         the conversion.
16953
16954         * driver.cs: Allow negative numbers as an error code to flag.
16955
16956         * cs-parser.jay: Handle 1551.
16957
16958         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16959
16960 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16961
16962         * cs-parser.jay: Report 1518 (type declaration can only contain
16963         class, struct, interface, enum or delegate)
16964
16965         (switch_label): Report 1523 (keywords `case' or `default' must
16966         preced code)
16967
16968         (opt_switch_sections): Report 1522 (empty switch)
16969
16970         * driver.cs: Report 1515 (response file specified multiple times)
16971         Report 1516 (Source file specified multiple times).
16972
16973         * expression.cs (Argument.Resolve): Signal 1510
16974
16975         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16976         access not allowed in static code)
16977
16978 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16979
16980         * typemanager.cs (IsPointerType): Utility method which we are going
16981         to need a lot.
16982
16983         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16984         the object type, so we take care of that.
16985
16986         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16987
16988         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16989         added to non-params parameters :-)
16990
16991         * typemanager.cs (CSharpName): Include 'void' type too. 
16992
16993         (void_ptr_type): Include in the set of core types.
16994
16995         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16996         duplicating code.
16997
16998         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16999         an unsafe context.
17000
17001         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17002         completely forgotten about it.
17003
17004 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17005
17006         * cs-parser.jay (pointer_type): Add. This begins our implementation
17007         of parsing rules for unsafe code.
17008
17009         (unsafe_statement): Implement.
17010
17011         (embedded_statement): Modify to include the above.
17012
17013         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17014
17015         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17016         if the current context is an unsafe one.
17017
17018         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17019         are handled differently, we need separate rules for them.
17020
17021         (local_variable_declaration): Update to use local_variable_pointer_type
17022         to allow variable declarations of unmanaged pointer types.
17023
17024         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17025         in unsafe contexts.
17026
17027         * ../errors/cs0214.cs : Add.
17028
17029 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17030
17031         * makefile: remove 'response' file when cleaning.
17032
17033 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17034
17035         * cs-parser.jay: Report 1524.
17036
17037 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * typemanager.cs (RegisterMethod): drop checking if we have
17040         registered this from here
17041
17042 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17043
17044         * class.cs (Method.EmitDestructor): Implement calling our base
17045         destructor. 
17046
17047         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17048         value of InFinally.
17049
17050         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17051         this routine and will wrap the call in a try/catch block.  Deal
17052         with the case.
17053
17054 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * ecore.cs (Expression.MemberLookup): instead of taking a
17057         parameter `same_type' that was used to tell whether we could
17058         access private members we compute our containing type from the
17059         EmitContext.
17060
17061         (FieldExpr): Added partial support for volatile fields.  This does
17062         not work for volatile fields exposed from assemblies, as I can not
17063         figure out how to extract the modreq from it.
17064
17065         Updated all the source files to use this.
17066
17067         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17068         because it is referenced by MemberLookup very often. 
17069
17070 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17071
17072         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17073         TypeBuilder.GetCustomAttributes to retrieve what we need.
17074
17075         Get rid of redundant default_member_attr_type as this is the same as
17076         default_member_type which already exists.
17077
17078         * interface.cs, attribute.cs : Update accordingly.
17079
17080 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17081
17082         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17083         work for TYpeBuilders though.  Ravi, can you please fix this?
17084
17085         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17086
17087         * expression.cs (Argument.Emit): Handle the case of ref objects
17088         being passed to ref functions;  
17089
17090         (ParameterReference.EmitLoad): Loads the content of the pointer
17091         without dereferencing.
17092
17093 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17096
17097 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17098
17099         * class.cs (Indexer.DefineMethod): Incorporate the interface
17100         type in the name of the method if we are doing explicit interface
17101         implementation.
17102
17103         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17104
17105         (BetterConversion): Fix extremely trivial bug where we were referring to
17106         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17107         again !
17108
17109         * ../errors/bug16.cs : Add although we have fixed it.
17110
17111 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17112
17113         * expression.cs (BaseIndexer): Begin implementation.
17114
17115         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17116
17117         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17118         production directly to remove a shift/reduce, and implement
17119         explicit interface implementation.
17120
17121         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17122         after a floating point suffix.
17123
17124         * expression.cs (DoNumericPromotions): Improved the conversion for
17125         uint/uint.  If we have a constant, we avoid doing a typecast to a
17126         larger type.
17127
17128         * class.cs (Indexer): Implement explicit interface implementation
17129         for indexers.
17130
17131 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17132
17133         * class.cs: make the default instance constructor public and hidebysig.
17134
17135 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17136
17137         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17138         so we can call it from elsewhere.
17139
17140         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17141         we emit it internally if the class has a defined indexer; otherwise the user
17142         emits it by decorating the class definition with the DefaultMemberAttribute.
17143
17144         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17145         attribute is not used on a type which defines an indexer.
17146
17147         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17148         character when we skip whitespace.
17149
17150         * ../errors/cs0646.cs : Add.
17151
17152 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17153
17154         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17155         again. 
17156
17157         * makefile: Add practical target `mcs3.exe' which builds the third
17158         generation compiler. 
17159
17160         * expression.cs (New): Fix structures constructor calling.
17161
17162         * class.cs (Property, Method, Indexer): Emit Final flag on the
17163         method if we are an interface implementation and we are not
17164         abstract. 
17165
17166         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17167         whether this property is referencing a `base' method.
17168
17169         * expression.cs (Invocation.EmitCall): take an extra argument:
17170         is_base, this is used to determine whether the `call' or
17171         `callvirt' opcode should be used.
17172
17173
17174         * delegate.cs: update EmitCall.
17175
17176         * class.cs (Method.Define): Set NewSlot for the cases where we are
17177         not implementing an interface method.
17178
17179         (Property.Define): ditto.
17180
17181 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17184         'r'.  Allows mcs to parse itself fully.
17185
17186 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17187
17188         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17189         of the number of initializers that require the InitializeArray method.
17190
17191         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17192         update the above field where necessary.
17193
17194         (MakeByteBlob): Update accordingly.
17195
17196         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17197         greater than 2.
17198
17199         (EmitDynamicInitializers): Update in accordance with the new optimization.
17200
17201         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17202         same OpCode applies.
17203
17204         * cs-parser.jay : Fix some glaring errors I introduced.
17205
17206 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17207
17208         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17209         so that we can check for name clashes there too.
17210
17211         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17212         for interface indexers.
17213
17214         * interfaces.cs (Define): Emit the default member attribute.
17215
17216         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17217         variable was being referred to while setting the value ;-)
17218
17219 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17220
17221         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17222         byte-by-byte information when we know the data is zero.
17223
17224         Make the block always a multiple of 4, because
17225         DefineInitializedData has a bug.
17226
17227         * assign.cs: Fix, we should assign from the temporary, not from
17228         the source. 
17229
17230         * expression.cs (MakeByteBlob): Fix my incorrect code.
17231
17232 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17233
17234         * typemanager.cs (EnumToUnderlying): This function is used to get
17235         the underlying type from an enumeration, because it does not
17236         always work. 
17237
17238         * constant.cs: Use the I4_S form for values between -128 and 127.
17239
17240         * statement.cs (Block.LookupLabel): Looks up a label.
17241         (Block): Drop support for labeled blocks.
17242
17243         (LabeledStatement): New kind of statement that represents a label
17244         only.
17245
17246         (Goto): Finally implement this bad boy.
17247
17248         * cs-parser.jay: Update to reflect new mechanism to implement
17249         labels.
17250
17251 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17252
17253         * codegen.cs (EmitContext.This): a codegen property that keeps the
17254         a single instance of this instead of creating many different this
17255         instances. 
17256
17257         * delegate.cs (Delegate.DoResolve): Update to use the property;
17258
17259         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17260
17261         * expression.cs (BaseAccess.DoResolve): Ditto.
17262
17263 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17264
17265         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17266         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17267
17268         (InitCoreTypes): Update accordingly.
17269
17270         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17271         so we can quickly store the state.
17272
17273         (ApplyAttributes): Set the correct implementation flags
17274         for InternalCall methods.
17275
17276 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * expression.cs (EmitCall): if a method is not virtual, then do
17279         not use callvirt on it.
17280
17281         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17282         user defined stuff) requires the use of stobj, which takes an
17283         address on the stack instead of an array and an index.  So emit
17284         the Ldelema operation for it.
17285
17286         (EmitStoreOpcode): Use stobj for valuetypes.
17287
17288         (UnaryMutator.EmitCode): Use the right 1 value depending on
17289         whether we are dealing with int64/uint64, float or doubles.
17290
17291         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17292         constructors that I implemented last night.
17293
17294         (Constructor.IsDefault): Fix to work properly for static
17295         constructors.
17296
17297         * cs-parser.jay (CheckDef): report method signature errors.
17298         Update error number 103 to be 132.
17299
17300         * decl.cs: New AdditionResult enumeration value: MethodExists.
17301         Although we do this check for methods later on in the semantic
17302         analysis, catching repeated default constructors is so easy that
17303         we catch these here. 
17304
17305         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17306         promotions code.
17307
17308         (ParameterReference.EmitAssign, Emit): handle
17309         bools as bytes.
17310
17311         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17312         (ArrayAccess.EmitStoreOpcode): ditto.
17313
17314         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17315
17316         * expression.cs (MakeByteBlob): Complete all the missing types
17317         (uint, short, ushort, byte, sbyte)
17318
17319         * class.cs: Only init instance field initializers on instance
17320         constructors. 
17321
17322         Rename `constructors' to instance_constructors. 
17323
17324         (TypeContainer.AddConstructor): Only add constructors to the list
17325         if it is not static.
17326
17327         Make sure that we handle default_static_constructor independently
17328         everywhere where we handle instance_constructors
17329
17330 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17331
17332         * class.cs: Do not lookup or create a base initializer for a
17333         static constructor.
17334
17335         (ConstructorInitializer.Resolve): use the proper type to lookup
17336         for constructors.
17337
17338         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17339
17340         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17341         in DeclSpace. 
17342
17343         * decl.cs: CloseType is now an virtual method, the default
17344         implementation just closes this type.
17345
17346 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17347
17348         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17349         to PreserveSig by default. Also emit HideBySig on such methods.
17350
17351         Basically, set the defaults to standard values.
17352
17353         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17354         argument, if candidate is better, it can't be worse than the best !
17355
17356         (Invocation): Re-write bits to differentiate between methods being
17357         applicable in their expanded form and their normal form - for params
17358         methods of course.
17359
17360         Get rid of use_standard everywhere as only standard conversions are allowed
17361         in overload resolution. 
17362
17363         More spec conformance.
17364
17365 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17366
17367         * driver.cs: Add --timestamp, to see where the compiler spends
17368         most of its time.
17369
17370         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17371         `this' in static code.
17372
17373         (SimpleName.DoResolve): Implement in terms of a helper function
17374         that allows static-references to be passed upstream to
17375         MemberAccess.
17376
17377         (Expression.ResolveWithSimpleName): Resolve specially simple
17378         names when called by MemberAccess to implement the special
17379         semantics. 
17380
17381         (Expression.ImplicitReferenceConversion): Handle conversions from
17382         Null to reference types before others, as Null's type is
17383         System.Object. 
17384
17385         * expression.cs (Invocation.EmitCall): Handle the special case of
17386         calling methods declared on a reference type from a ValueType
17387         (Base classes System.Object and System.Enum)
17388
17389         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17390         the left hand side is a TypeExpr, not on every enumeration. 
17391
17392         (Binary.Resolve): If types are reference types, then do a cast to
17393         object on operators != and == of both arguments.
17394
17395         * typemanager.cs (FindMembers): Extract instance and static
17396         members if requested.
17397
17398         * interface.cs (PopulateProperty): Use void_type instead of null
17399         as the return type for the setter method.
17400
17401         (PopulateIndexer): ditto.
17402
17403 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17404
17405         * support.cs (ReflectionParameters): Fix minor bug where we
17406         were examining the wrong parameter for the ParamArray attribute.
17407
17408         Cope with requests for the type of the parameter at position
17409         greater than the params parameter's. We now return the element
17410         type of the params array as that makes more sense.
17411
17412         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17413         accordingly as we no longer have to extract the element type
17414         ourselves.
17415
17416         (Invocation.OverloadResolve): Update.
17417
17418 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17421         against IEnumerator, test whether the return value is a descendant
17422         of the IEnumerator interface.
17423
17424         * class.cs (Indexer.Define): Use an auxiliary method to implement
17425         the other bits of the method definition.  Begin support for
17426         explicit interface implementation.
17427
17428         (Property.DefineMethod): Use TypeManager.void_type instead of null
17429         for an empty return value.
17430
17431 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17432
17433         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17434         dealing with a FieldExpr which is composed of a FieldBuilder, in
17435         the code path we did extract the constant, but we should have
17436         obtained the underlying value to be able to cast it (otherwise we
17437         end up in an infinite loop, this is what Ravi was running into).
17438
17439         (ArrayCreation.UpdateIndices): Arrays might be empty.
17440
17441         (MemberAccess.ResolveMemberAccess): Add support for section
17442         14.5.4.1 that deals with the special case of E.I when E is a type
17443         and something else, that I can be a reference to a static member.
17444
17445         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17446         handle a particular array type to create byte blobs, it is just
17447         something we dont generate byteblobs for.
17448
17449         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17450         arguments. 
17451
17452         * location.cs (Push): remove the key from the hashtable that we
17453         are about to add.   This happens for empty files.
17454
17455         * driver.cs: Dispose files after we have parsed them.
17456
17457         (tokenize): new function that only runs the tokenizer on its
17458         input, for speed testing.
17459
17460 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17461
17462         * class.cs (Event.Define): Define the private field only if there
17463         are no accessors defined.
17464
17465         * expression.cs (ResolveMemberAccess): If there is no associated
17466         field with the event, that means we have an event defined with its
17467         own accessors and we should flag error cs0070 since transforming
17468         ourselves into a field is not valid in that case.
17469
17470         * ecore.cs (SimpleName.DoResolve): Same as above.
17471
17472         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17473         and charset to sane values.
17474
17475 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17476
17477         * assign.cs (DoResolve): Perform check on events only if they 
17478         are being accessed outside the declaring type.
17479
17480         * cs-parser.jay (event_declarations): Update rules to correctly
17481         set the type of the implicit parameter etc.
17482
17483         (add_accessor, remove_accessor): Set current local parameters.
17484
17485         * expression.cs (Binary): For delegate addition and subtraction,
17486         cast the return value from the method into the appropriate delegate
17487         type.
17488
17489 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17490
17491         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17492         of these as the workaround is unnecessary.
17493
17494         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17495         delegate data - none of that is needed at all.
17496
17497         Re-write bits to extract the instance expression and the delegate method
17498         correctly.
17499
17500         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17501         on delegates too.
17502
17503         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17504         of attaching attributes instead of duplicating code everywhere.
17505
17506         * everywhere : Update code to do attribute emission using the above method.
17507
17508 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17509
17510         * expression.cs (IsParamsMethodApplicable): if there are not
17511         parameters, return immediately.
17512
17513         * ecore.cs: The 0 literal can be implicity converted to an enum
17514         type. 
17515
17516         (SimpleName.DoResolve): First lookup the type, then lookup the
17517         members. 
17518
17519         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17520         want to get its address.  If the InstanceExpression is not
17521         addressable, store the result in a temporary variable, then get
17522         the address of it.
17523
17524         * codegen.cs: Only display 219 errors on warning level or above. 
17525
17526         * expression.cs (ArrayAccess): Make it implement the
17527         IMemoryLocation interface.
17528
17529         (Binary.DoResolve): handle the operator == (object a, object b)
17530         and operator != (object a, object b) without incurring into a
17531         BoxedCast (because 5 != o should never be performed).
17532
17533         Handle binary enumerator operators.
17534
17535         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17536         value type, otherwise use Ldelem_ref.
17537
17538         Use precomputed names;
17539
17540         (AddressOf): Implement address of
17541
17542         * cs-parser.jay (labeled_statement): Fix recursive block
17543         addition by reworking the production.
17544
17545         * expression.cs (New.DoEmit): New has a special case:
17546                 
17547                  If we are dealing with a ValueType, we have a few
17548                  situations to deal with:
17549                 
17550                     * The target of New is a ValueType variable, that is
17551                       easy, we just pass this as the variable reference
17552                 
17553                     * The target of New is being passed as an argument,
17554                       to a boxing operation or a function that takes a
17555                       ValueType.
17556                 
17557                       In this case, we need to create a temporary variable
17558                       that is the argument of New.
17559
17560
17561 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17562
17563         * rootcontext.cs (LookupType): Check that current_type is not null before
17564         going about looking at nested types.
17565
17566         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17567         not implement the IAssignMethod interface any more.
17568
17569         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17570         where we tranform them into FieldExprs if they are being resolved from within
17571         the declaring type.
17572
17573         * ecore.cs (SimpleName.DoResolve): Do the same here.
17574
17575         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17576
17577         * ../errors/bug10.cs : Add.
17578
17579         * ../errors/cs0070.cs : Add.
17580
17581         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17582
17583         * assign.cs : Get rid of EventIsLocal everywhere.
17584
17585 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17586
17587         * ecore.cs (ConvertIntLiteral): finished the implementation.
17588
17589         * statement.cs (SwitchLabel): Convert the value we are using as a
17590         key before looking up the table.
17591
17592 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17593
17594         * codegen.cs (EmitTopBlock): Require a Location argument now.
17595
17596         * cs-parser.jay (constructor_declarator): We need to setup
17597         current_local_parameters before we parse the
17598         opt_constructor_initializer, to allow the variables to be bound
17599         to the constructor arguments.
17600
17601         * rootcontext.cs (LookupType): First lookup nested classes in our
17602         class and our parents before we go looking outside our class.
17603
17604         * expression.cs (ConstantFold): Extract/debox the values at the
17605         beginnning. 
17606
17607         * rootcontext.cs (EmitCode): Resolve the constants first before we
17608         resolve the types.  This is not really needed, but it helps debugging.
17609
17610         * statement.cs: report location.
17611
17612         * cs-parser.jay: pass location to throw statement.
17613
17614         * driver.cs: Small bug fix.
17615
17616         * report.cs: Updated format to be 4-zero filled digits.
17617
17618 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17619
17620         * expression.cs (CheckIndices): Fix minor bug where the wrong
17621         variable was being referred to ;-)
17622
17623         (DoEmit): Do not call EmitStaticInitializers when the 
17624         underlying type is System.Object.
17625
17626 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17627
17628         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17629         and do the usual workaround for SRE.
17630
17631         * class.cs (MyEventBuilder.EventType): New member to get at the type
17632         of the event, quickly.
17633
17634         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17635
17636         * assign.cs (Assign.DoResolve): Handle the case when the target
17637         is an EventExpr and perform the necessary checks.
17638
17639         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17640         interface.
17641
17642         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17643
17644         (EventExpr): Set the type in the constructor itself since we 
17645         are meant to be born fully resolved.
17646
17647         (EventExpr.Define): Revert code I wrote earlier.
17648                 
17649         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17650         instance expression is null. The instance expression is a This in that case
17651         or a null, depending on whether it is a static method or not.
17652
17653         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17654         refers to more than one method.
17655
17656         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17657         and accordingly flag errors.
17658
17659 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17660
17661         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17662
17663 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17664
17665         * location.cs (ToString): Provide useful rutine.
17666
17667 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17670         objects, return the actual integral boxed.
17671
17672         * statement.cs (SwitchLabel): define an ILLabel for each
17673         SwitchLabel. 
17674
17675         (Switch.CheckSwitch): If the value is a Literal, extract
17676         the underlying literal.
17677
17678         Also in the unused hashtable we had, add the SwitchLabel so we can
17679         quickly look this value up.
17680
17681         * constant.cs: Implement a bunch of new constants.  Rewrite
17682         Literal based on this.  Made changes everywhere to adapt to this.
17683
17684         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17685         dereferencing array only once, and also copes with enumrations.
17686
17687         bytes are two bytes wide, not one.
17688
17689         (Cast): Perform constant conversions.
17690
17691         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17692         wrappers to the literals here.
17693
17694         * expression.cs (DoNumericPromotions): long literals can converted
17695         to ulong implicity (this is taken care of elsewhere, but I was
17696         missing this spot).
17697
17698         * ecore.cs (Expression.Literalize): Make the return type Literal,
17699         to improve type checking.
17700
17701         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17702
17703 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17704
17705         * literal.cs: Revert code from ravi that checked the bounds.  The
17706         bounds are sane by the definition of the type itself. 
17707
17708         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17709         need to actually look up in our parent hierarchy for interfaces
17710         implemented. 
17711
17712         * const.cs: Use the underlying type for enumerations
17713
17714         * delegate.cs: Compute the basename for the delegate creation,
17715         that should fix the delegate test case, and restore the correct
17716         Type Lookup semantics in rootcontext
17717
17718         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17719         referencing a nested type with the Reflection API is using the "+"
17720         sign. 
17721
17722         * cs-parser.jay: Do not require EOF token at the end.
17723
17724 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17725
17726         * rootcontext.cs (LookupType): Concatenate type names with
17727         a '.' instead of a '+' The test suite passes again.
17728
17729         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17730         field of the enumeration.
17731
17732         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17733         the case when the member is an EventExpr.
17734
17735         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17736         static has an associated instance expression.
17737
17738         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17739
17740         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17741
17742         * class.cs (Event.Define): Register event and perform appropriate checks
17743         for error #111.
17744
17745         We define the Add and Remove methods even if the use provides none because
17746         in that case, we provide default implementations ourselves.
17747
17748         Define a private field of the type of the event. This is done by the CSC compiler
17749         and we should be doing it too ;-)
17750
17751         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17752         More methods we use in code we generate.
17753
17754         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17755         is important.
17756
17757         (InitCoreTypes): Update accordingly for the above.
17758
17759         * class.cs (Event.Emit): Generate code for default accessors that we provide
17760
17761         (EmitDefaultMethod): Do the job in the above.
17762
17763         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17764         appropriate place.
17765
17766 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17767
17768         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17769         builders even if we were missing one.
17770
17771         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17772         pass the Basename as our class name instead of the Name.  The
17773         basename will be correctly composed for us.
17774
17775         * parameter.cs (Paramters): Now takes a Location argument.
17776
17777         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17778         make all the code call directly LookupType in RootContext and take
17779         this chance to pass the Location information everywhere.
17780
17781         * Everywhere: pass Location information.
17782
17783 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17784
17785         * class.cs (Constructor.Define): Updated way of detecting the
17786         length of the parameters.
17787
17788         (TypeContainer.DefineType): Use basename as the type name for
17789         nested types.
17790
17791         (TypeContainer.Define): Do not recursively define types here, as
17792         definition is taken care in order by the RootContext.
17793
17794         * tree.cs: Keep track of namespaces in a per-file basis.
17795
17796         * parameter.cs (Parameter.ComputeSignature): Update to use
17797         DeclSpace. 
17798
17799         (Parameters.GetSignature): ditto.
17800
17801         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17802         instead of a TypeContainer.
17803
17804         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17805         resolve names.  Because we need to be resolve in our context, not
17806         our parents.
17807
17808         * driver.cs: Implement response files.
17809
17810         * class.cs (TypeContainer.DefineType): If we are defined, do not
17811         redefine ourselves.
17812
17813         (Event.Emit): Emit the code for add/remove handlers.
17814         (Event.Define): Save the MethodBuilders for add/remove.
17815
17816         * typemanager.cs: Use pair here too.
17817
17818         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17819         DictionaryEntry requires the first argument to be non-null.  
17820
17821         (enum_declaration): Compute full name for registering the
17822         enumeration.
17823
17824         (delegate_declaration): Instead of using
17825         formal_parameter_list, use opt_formal_parameter_list as the list
17826         can be empty.
17827
17828         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17829         (EventParsing): New property that controls whether `add' and
17830         `remove' are returned as tokens or identifiers (for events);
17831
17832 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17833
17834         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17835         use MyEventBuilder only and let it wrap the real builder for us.
17836
17837         (MyEventBuilder): Revamp constructor etc.
17838
17839         Implement all operations that we perform on EventBuilder in precisely the same
17840         way here too.
17841
17842         (FindMembers): Update to use the EventBuilder member.
17843
17844         (Event.Emit): Update accordingly.
17845
17846 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17847
17848         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17849         by calling the appropriate methods.
17850
17851         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17852         useful.
17853
17854         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17855
17856 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17857
17858         * delegate.cs (Delegate.Populate): Check that the return type
17859         and various parameters types are indeed accessible.
17860
17861         * class.cs (Constructor.Define): Same here.
17862
17863         (Field.Define): Ditto.
17864
17865         (Event.Define): Ditto.
17866
17867         (Operator.Define): Check that the underlying Method defined itself
17868         correctly - so it's MethodBuilder should not be null.
17869
17870         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17871         expression happens to be null.
17872
17873         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17874         members but as of now we don't seem to be able to do anything really useful with it.
17875
17876         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17877         not the EventBuilder.
17878
17879 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17880
17881         * cs-tokenizer.cs: Add support for defines.
17882         Add support for #if, #elif, #else, #endif
17883
17884         (eval_var): evaluates a variable.
17885         (eval): stubbed for evaluating functions.
17886
17887         * cs-parser.jay: Pass the defines information
17888
17889         * driver.cs: Add --define command line option.
17890
17891         * decl.cs: Move MemberCore here.
17892
17893         Make it the base class for DeclSpace.  This allows us to catch and
17894         report 108 and 109 for everything now.
17895
17896         * class.cs (TypeContainer.Define): Extract all the members
17897         before populating and emit the warning 108 (new keyword required
17898         to override) instead of having each member implement this.
17899
17900         (MemberCore.Define): New abstract method, we will be using this in
17901         the warning reporting engine in Populate.
17902
17903         (Operator.Define): Adjust to new MemberCore protocol. 
17904
17905         * const.cs (Const): This does not derive from Expression, it is a
17906         temporary object we use to create fields, it is a MemberCore. 
17907
17908         * class.cs (Method.Define): Allow the entry point to be in a
17909         specific class.
17910
17911         * driver.cs: Rewrite the argument handler to clean it up a bit.
17912
17913         * rootcontext.cs: Made it just an auxiliary namespace feature by
17914         making everything static.
17915
17916         * driver.cs: Adapt code to use RootContext type name instead of
17917         instance variable.
17918
17919         * delegate.cs: Remove RootContext argument.
17920
17921         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17922         argument. 
17923
17924         * class.cs (Event.Define): The lookup can fail.
17925
17926         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17927
17928         * expression.cs: Resolve the this instance before invoking the code.
17929
17930 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17931
17932         * cs-parser.jay: Add a production in element_access that allows
17933         the thing to become a "type" reference.  This way we can parse
17934         things like "(string [])" as a type.
17935
17936         Note that this still does not handle the more complex rules of
17937         casts. 
17938
17939
17940         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17941
17942         * ecore.cs: (CopyNewMethods): new utility function used to
17943         assemble the list of methods from running FindMembers.
17944
17945         (MemberLookup): Rework FindMembers so that 
17946
17947 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17948
17949         * class.cs (TypeContainer): Remove Delegates who fail to be
17950         defined.
17951
17952         * delegate.cs (Populate): Verify that we dont get null return
17953         values.   TODO: Check for AsAccessible.
17954
17955         * cs-parser.jay: Use basename to emit error 574 (destructor should
17956         have the same name as container class), not the full name.
17957
17958         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17959         possible representation.  
17960
17961         Also implements integer type suffixes U and L.
17962
17963 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * expression.cs (ArrayCreation.DoResolve): We need to do the
17966         argument resolution *always*.
17967
17968         * decl.cs: Make this hold the namespace.  Hold the root context as
17969         well.
17970         (LookupType): Move here.
17971
17972         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17973
17974         * location.cs (Row, Name): Fixed the code, it was always returning
17975         references to the first file.
17976
17977         * interface.cs: Register properties defined through interfaces.
17978
17979         * driver.cs: Add support for globbing on the command line
17980
17981         * class.cs (Field): Make it derive from MemberCore as well.
17982         (Event): ditto.
17983
17984 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17985
17986         * class.cs (Event::Define): Check that the type of the event is a delegate
17987         type else flag error #66.
17988
17989         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17990         same.
17991
17992         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17993         values of EntryPoint, CharSet etc etc.
17994
17995         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17996
17997         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17998         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17999         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18000         which needs this to do its work.
18001
18002         * ../errors/cs0066.cs : Add.
18003
18004 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18005
18006         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18007         helper functions.
18008
18009         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18010         clears out the parameters field.
18011         (MemberSignatureCompare): Cleanup
18012
18013         (MemberCore): New base class used to share code between MethodCore
18014         and Property.
18015
18016         (RegisterRequiredImplementations) BindingFlags.Public requires
18017         either BindingFlags.Instace or Static.  Use instance here.
18018
18019         (Property): Refactored code to cope better with the full spec.
18020
18021         * parameter.cs (GetParameterInfo): Return an empty array instead
18022         of null on error.
18023
18024         * class.cs (Property): Abstract or extern properties have no bodies.
18025
18026         * parameter.cs (GetParameterInfo): return a zero-sized array.
18027
18028         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18029         method modifier validation to the typecontainer so we can reuse
18030         this on properties.
18031
18032         (MethodCore.ParameterTypes): return an empty sized array of types.
18033
18034         (Property.Define): Test property modifier validity.
18035
18036         Add tests for sealed/override too.
18037
18038         (Method.Emit): abstract or extern methods have no bodies.
18039
18040 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18041
18042         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18043         thing.
18044
18045         (Method::Define, ::Emit): Modify accordingly.
18046
18047         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18048
18049         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18050
18051         * makefile: Pass in /unsafe.
18052
18053 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18054
18055         * class.cs (MakeKey): Kill routine.
18056
18057         * class.cs (TypeContainer.Define): Correctly define explicit
18058         method implementations (they require the full interface name plus
18059         the method name).
18060
18061         * typemanager.cs: Deply the PtrHashtable here and stop using the
18062         lame keys.  Things work so much better.
18063
18064         This of course broke everyone who depended on `RegisterMethod' to
18065         do the `test for existance' test.  This has to be done elsewhere.
18066
18067         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18068         the object stupid Equals method (because, that like fails all over
18069         the place).  We still do not use it.
18070
18071         * class.cs (TypeContainer.SetRequiredInterface,
18072         TypeContainer.RequireMethods): Killed these two routines and moved
18073         all the functionality to RegisterRequiredImplementations.
18074
18075         (TypeContainer.RegisterRequiredImplementations): This routine now
18076         registers all the implementations required in an array for the
18077         interfaces and abstract methods.  We use an array of structures
18078         which can be computed ahead of time to reduce memory usage and we
18079         also assume that lookups are cheap as most classes will not
18080         implement too many interfaces.
18081
18082         We also avoid creating too many MethodSignatures.
18083
18084         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18085         clear the "pending" bit if we find that there are problems with
18086         the declaration.
18087
18088         (TypeContainer.VerifyPendingMethods): Update to report errors of
18089         methods that look like implementations but are not.
18090
18091         (TypeContainer.Define): Add support for explicit interface method
18092         implementation. 
18093
18094 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18095
18096         * typemanager.cs: Keep track of the parameters here instead of
18097         being a feature of the TypeContainer.
18098
18099         * class.cs: Drop the registration of parameters here, as
18100         InterfaceMethods are also interface declarations.
18101
18102         * delegate.cs: Register methods with the TypeManager not only with
18103         the TypeContainer.  This code was buggy.
18104
18105         * interface.cs: Full registation here.
18106
18107 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18108
18109         * expression.cs: Remove reducer for binary expressions, it can not
18110         be done this way.
18111
18112         * const.cs: Put here the code that used to go into constant.cs
18113
18114         * constant.cs: Put here the code for constants, this is a new base
18115         class for Literals.
18116
18117         * literal.cs: Make Literal derive from Constant.
18118
18119 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18120
18121         * statement.cs (Return.Emit): Report error 157 if the user
18122         attempts to return from a finally block.
18123
18124         (Return.Emit): Instead of emitting a return, jump to the end of
18125         the function.
18126
18127         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18128         LocalBuilder to store the result of the function.  ReturnLabel is
18129         the target where we jump.
18130
18131
18132 2001-12-09  Radek Doulik  <rodo@ximian.com>
18133
18134         * cs-parser.jay: remember alias in current namespace
18135
18136         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18137         namespaces
18138
18139         * class.cs (LookupAlias): lookup alias in my_namespace
18140
18141         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18142         aliases hashtable
18143         (LookupAlias): lookup alias in this and if needed in parent
18144         namespaces
18145
18146 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18147
18148         * support.cs: 
18149
18150         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18151         making things static.  I need this to avoid passing the
18152         TypeContainer when calling ParameterType.
18153
18154         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18155         that did string manipulation to compute the type and then call
18156         GetType.  Use Parameter.ParameterType instead.
18157
18158         * cs-tokenizer.cs: Consume the suffix for floating values.
18159
18160         * expression.cs (ParameterReference): figure out whether this is a
18161         reference parameter or not.  Kill an extra variable by computing
18162         the arg_idx during emission.
18163
18164         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18165         function that returns whether a parameter is an out/ref value or not.
18166
18167         (Parameter.ParameterType): The type of the parameter (base,
18168         without ref/out applied).
18169
18170         (Parameter.Resolve): Perform resolution here.
18171         (Parameter.ExternalType): The full type (with ref/out applied).
18172
18173         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18174         support for expressions on the using statement.
18175
18176 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18177
18178         * statement.cs (Using.EmitLocalVariableDecls): Split the
18179         localvariable handling of the using statement.
18180
18181         (Block.EmitMeta): Keep track of variable count across blocks.  We
18182         were reusing slots on separate branches of blocks.
18183
18184         (Try.Emit): Emit the general code block, we were not emitting it. 
18185
18186         Check the type of the declaration to be an IDisposable or
18187         something that can be implicity converted to it. 
18188
18189         Emit conversions if required.
18190
18191         * ecore.cs (EmptyExpression): New utility class.
18192         (Expression.ImplicitConversionExists): New utility function.
18193
18194 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18195
18196         * statement.cs (Using): Implement.
18197
18198         * expression.cs (LocalVariableReference): Support read only variables.
18199
18200         * statement.cs: Remove the explicit emit for the Leave opcode.
18201         (VariableInfo): Add a readonly field.
18202
18203 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * ecore.cs (ConvCast): new class used to encapsulate the various
18206         explicit integer conversions that works in both checked and
18207         unchecked contexts.
18208
18209         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18210         properly generate the overflow opcodes.
18211
18212 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18213
18214         * statement.cs: The correct type for the EmptyExpression is the
18215         element_type, not the variable type.  Ravi pointed this out.
18216
18217 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18218
18219         * class.cs (Method::Define): Handle PInvoke methods specially
18220         by using DefinePInvokeMethod instead of the usual one.
18221
18222         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18223         above to do the task of extracting information and defining the method.
18224
18225 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18226
18227         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18228         of the condition for string type.
18229
18230         (Emit): Move that here. 
18231
18232         (ArrayCreation::CheckIndices): Keep string literals in their expression
18233         form.
18234
18235         (EmitDynamicInitializers): Handle strings appropriately.
18236
18237 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * codegen.cs (EmitContext): Replace multiple variables with a
18240         single pointer to the current Switch statement.
18241
18242         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18243         EmitContext.
18244
18245 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18246
18247         * statement.cs 
18248
18249         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18250         default'.
18251
18252         (Foreach.Emit): Foreach on arrays was not setting
18253         up the loop variables (for break/continue).
18254
18255         (GotoCase): Semi-implented.
18256
18257 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18258
18259         * attribute.cs (CheckAttribute): Handle system attributes by using
18260         Attribute.GetAttributes to examine information we need.
18261
18262         (GetValidPlaces): Same here.
18263
18264         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18265
18266         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18267
18268         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18269
18270         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18271
18272         (Method::Emit): Handle the case when we are a PInvoke method.
18273
18274 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18275
18276         * expression.cs: Use ResolveWithSimpleName on compound names.
18277
18278 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18279
18280         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18281         before trying to reduce it.
18282
18283         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18284
18285         * constant.cs (LookupConstantValue): Implement.
18286
18287         (EmitConstant): Use the above in emitting the constant.
18288
18289         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18290         that are user-defined by doing a LookupConstantValue on them.
18291
18292         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18293         too, like above.
18294
18295 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18296
18297         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18298
18299         (BaseAccess.DoResolve): Implement.
18300
18301         (MemberAccess.DoResolve): Split this routine into a
18302         ResolveMemberAccess routine that can be used independently
18303
18304 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18305
18306         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18307         As that share bits of the implementation.  Is returns a boolean,
18308         while As returns the Type that is being probed.
18309
18310 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18311
18312         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18313         instead of a Literal - much easier.
18314
18315         (EnumInTransit): Remove - utterly useless :-)
18316
18317         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18318
18319         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18320
18321         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18322         chain when we have no associated expression.
18323
18324 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18325
18326         * constant.cs (Define): Use Location while reporting the errror.
18327
18328         Also emit a warning when 'new' is used and there is no inherited
18329         member to hide.
18330
18331         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18332         populated.
18333
18334         (LookupEnumValue): Implement to lookup an enum member's value and define it
18335         if necessary.
18336
18337         (Populate): Re-write accordingly to use the above routine.
18338
18339 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18340
18341         * expression.cs (This): Fix prototype for DoResolveLValue to
18342         override the base class DoResolveLValue.
18343
18344         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18345         declarations) 
18346
18347         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18348         (we need to load the address of the field here).  This fixes
18349         test-22. 
18350
18351         (FieldExpr.DoResolveLValue): Call the DoResolve
18352         function to initialize the Instance expression.
18353
18354         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18355         correctly the GetEnumerator operation on a value type.
18356
18357         * cs-parser.jay: Add more simple parsing error catches.
18358
18359         * statement.cs (Switch): Add support for string switches.
18360         Handle null specially.
18361
18362         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18363
18364 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18365
18366         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18367
18368         (declare_local_constant): New helper function.
18369
18370         * statement.cs (AddConstant): Keep a separate record of constants
18371
18372         (IsConstant): Implement to determine if a variable is a constant.
18373
18374         (GetConstantExpression): Implement.
18375
18376         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18377
18378         * statement.cs (IsVariableDefined): Re-write.
18379
18380 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18381
18382         * class.cs (TypeContainer::FindMembers): Look for constants
18383         in the case when we are looking for MemberTypes.Field
18384
18385         * expression.cs (MemberAccess::DoResolve): Check that in the
18386         case we are a FieldExpr and a Literal, we are not being accessed
18387         by an instance reference.
18388
18389         * cs-parser.jay (local_constant_declaration): Implement.
18390
18391         (declaration_statement): Implement for constant declarations.
18392
18393 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18394
18395         * statement.cs (Switch): Catch double defaults.
18396
18397         (Switch): More work on the switch() statement
18398         implementation.  It works for integral values now, need to finish
18399         string support.
18400
18401
18402 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18403
18404         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18405         integer literals into other integer literals.  To be used by
18406         switch. 
18407
18408 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18409
18410         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18411         some memory.
18412
18413         (EmitDynamicInitializers): Cope with the above since we extract data
18414         directly from ArrayData now.
18415
18416         (ExpectInitializers): Keep track of whether initializers are mandatory
18417         or not.
18418
18419         (Bounds): Make it a hashtable to prevent the same dimension being 
18420         recorded for every element in that dimension.
18421
18422         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18423         from being found.
18424
18425         Also fix bug which was causing the indices to be emitted in the reverse
18426         order.
18427
18428 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18429
18430         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18431         unfinished.  They do not work, because the underlying code is
18432         sloppy.
18433
18434 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * cs-parser.jay: Remove bogus fixme.
18437
18438         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18439         on Switch statement.
18440
18441 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18442
18443         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18444         the same. 
18445
18446         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18447         parameter. Apparently, any expression is allowed. 
18448
18449         (ValidateInitializers): Update accordingly.
18450
18451         (CheckIndices): Fix some tricky bugs thanks to recursion.
18452
18453         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18454         I was being completely brain-dead.
18455
18456         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18457         and re-write acordingly.
18458
18459         (DelegateInvocation): Re-write accordingly.
18460
18461         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18462
18463         (MakeByteBlob): Handle types more correctly.
18464
18465         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18466         initialization from expressions but it is incomplete because I am a complete
18467         Dodo :-|
18468
18469 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18470
18471         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18472         on If.  Basically, we have to return `true' (ie, we do return to
18473         our caller) only if both branches of the if return.
18474
18475         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18476         short-circuit operators, handle them as short circuit operators. 
18477
18478         (Cast.DoResolve): Resolve type.
18479         (Cast.Cast): Take an expression as the target type.
18480
18481         * cs-parser.jay (cast_expression): Remove old hack that only
18482         allowed a limited set of types to be handled.  Now we take a
18483         unary_expression and we resolve to a type during semantic
18484         analysis.
18485
18486         Use the grammar productions from Rhys to handle casts (this is
18487         not complete like Rhys syntax yet, we fail to handle that corner
18488         case that C# has regarding (-x), but we will get there.
18489
18490 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18491
18492         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18493         field which is an array type.
18494
18495         * cs-parser.jay (declare_local_variables): Support array initialization too.
18496
18497         * typemanager.cs (MakeKey): Implement.
18498
18499         (everywhere): Use the above appropriately.
18500
18501         * cs-parser.jay (for_statement): Update for array initialization while
18502         declaring variables.
18503
18504         * ecore.cs : The error message was correct, it's the variable's names that
18505         were misleading ;-) Make the code more readable.
18506
18507         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18508         the correct type etc.
18509
18510         (ConvertExplicit): Handle Enum types by examining the underlying type.
18511
18512 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18513
18514         * parameter.cs (GetCallingConvention): Always return
18515         CallingConventions.Standard for now.
18516
18517 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18518
18519         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18520         and `r' after calling DoNumericPromotions.
18521
18522         * ecore.cs: Fix error message (the types were in the wrong order).
18523
18524         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18525         BindingFlags.Instance as well 
18526
18527         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18528         implicit int literal conversion in an empty cast so that we
18529         propagate the right type upstream.
18530
18531         (UnboxCast): new class used to unbox value types.
18532         (Expression.ConvertExplicit): Add explicit type conversions done
18533         by unboxing.
18534
18535         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18536         the target type before applying the implicit LongLiterals to ULong
18537         literal cast.
18538
18539 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18540
18541         * cs-parser.jay (for_statement): Reworked the way For works: now
18542         we declare manually any variables that are introduced in
18543         for_initializer to solve the problem of having out-of-band code
18544         emition (that is what got for broken).
18545
18546         (declaration_statement): Perform the actual variable declaration
18547         that used to be done in local_variable_declaration here.
18548
18549         (local_variable_declaration): Do not declare anything, just pass
18550         the information on a DictionaryEntry
18551
18552 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18553
18554         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18555         re-write of the logic to now make it recursive.
18556
18557         (UpdateIndices): Re-write accordingly.
18558
18559         Store element data in a separate ArrayData list in the above methods.
18560
18561         (MakeByteBlob): Implement to dump the array data into a byte array.
18562
18563 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18564
18565         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18566         into CheckIndices.
18567
18568         * constant.cs (Define): Implement.
18569
18570         (EmitConstant): Re-write fully.
18571
18572         Pass in location info.
18573
18574         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18575         respectively.
18576
18577         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18578         DictionaryEntry since we need location info too.
18579
18580         (constant_declaration): Update accordingly.
18581
18582         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18583         code into another method : UpdateIndices.
18584
18585 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18586
18587         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18588         some type checking etc.
18589
18590 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18591
18592         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18593         bits to provide dimension info if the user skips doing that.
18594
18595         Update second constructor to store the rank correctly.
18596
18597 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18598
18599         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18600         and try to implement.
18601
18602         * ../errors/cs0150.cs : Add.
18603
18604         * ../errors/cs0178.cs : Add.
18605
18606 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * statement.cs: Implement foreach on multi-dimensional arrays. 
18609
18610         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18611         name of the params argument.
18612
18613         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18614         initializing the array.
18615
18616         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18617         we can use this elsewhere.
18618
18619         * statement.cs: Finish implementation of foreach for single
18620         dimension arrays.
18621
18622         * cs-parser.jay: Use an out-of-band stack to pass information
18623         around, I wonder why I need this.
18624
18625         foreach_block: Make the new foreach_block the current_block.
18626
18627         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18628         function used to return a static Parameters structure.  Used for
18629         empty parameters, as those are created very frequently.
18630
18631         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18632
18633 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18634
18635         * interface.cs : Default modifier is private, not public. The
18636         make verify test passes again.
18637
18638 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18639
18640         * support.cs (ReflectionParameters): Fix logic to determine
18641         whether the last parameter is a params one. Test 9 passes again.
18642
18643         * delegate.cs (Populate): Register the builders we define with
18644         RegisterParameterForBuilder. Test 19 passes again.
18645
18646         * cs-parser.jay (property_declaration): Reference $6 instead
18647         of $$ to get at the location.
18648
18649         (indexer_declaration): Similar stuff.
18650
18651         (attribute): Ditto.
18652
18653         * class.cs (Property): Register parameters for the Get and Set methods
18654         if they exist. Test 23 passes again.
18655
18656         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18657         call to EmitArguments as we are sure there aren't any params arguments. 
18658         Test 32 passes again.
18659
18660         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18661         IndexOutOfRangeException. 
18662
18663         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18664         Test 33 now passes again.
18665
18666 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18667
18668         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18669         broke a bunch of things.  Will have to come up with a better way
18670         of tracking locations.
18671
18672         * statement.cs: Implemented foreach for single dimension arrays.
18673
18674 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18675
18676         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18677         an error.  This removes the lookup from the critical path.
18678
18679         * cs-parser.jay: Removed use of temporary_loc, which is completely
18680         broken. 
18681
18682 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18683
18684         * support.cs (ReflectionParameters.ParameterModifier): Report
18685         whether the argument is a PARAMS argument or not.
18686
18687         * class.cs: Set the attribute `ParamArrayAttribute' on the
18688         parameter argument.
18689
18690         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18691         and cons_param_array_attribute (ConstructorInfo for
18692         ParamArrayAttribute)., 
18693
18694         * codegen.cs: Emit the return using the `Return' statement, that
18695         way we can report the error correctly for missing return values. 
18696
18697         * class.cs (Method.Emit): Clean up.
18698
18699         * expression.cs (Argument.Resolve): Take another argument: the
18700         location where this argument is used.  Notice that this is not
18701         part of the "Argument" class as to reduce the size of the
18702         structure (we know the approximate location anyways).
18703
18704         Test if the argument is a variable-reference, if not, then
18705         complain with a 206.
18706
18707         (Argument.Emit): Emit addresses of variables.
18708
18709         (Argument.FullDesc): Simplify.
18710
18711         (Invocation.DoResolve): Update for Argument.Resolve.
18712
18713         (ElementAccess.DoResolve): ditto.
18714
18715         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18716         method should be virtual, as this method is always virtual.
18717
18718         (NewDelegate.DoResolve): Update for Argument.Resolve.
18719
18720         * class.cs (ConstructorInitializer.DoResolve): ditto.
18721
18722         * attribute.cs (Attribute.Resolve): ditto.
18723
18724 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18725
18726         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18727
18728         * expression.cs (ParameterReference): Drop IStackStorage and implement
18729         IAssignMethod instead. 
18730
18731         (LocalVariableReference): ditto.
18732
18733         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18734         IAssignMethod instead. 
18735
18736 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18737
18738         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18739         enumerations that are used in heavily used structures derive from
18740         byte in a laughable and pathetic attempt to reduce memory usage.
18741         This is the kind of pre-optimzations that you should not do at
18742         home without adult supervision.
18743
18744         * expression.cs (UnaryMutator): New class, used to handle ++ and
18745         -- separatedly from the other unary operators.  Cleans up the
18746         code, and kills the ExpressionStatement dependency in Unary.
18747
18748         (Unary): Removed `method' and `Arguments' from this class, making
18749         it smaller, and moving it all to SimpleCall, so I can reuse this
18750         code in other locations and avoid creating a lot of transient data
18751         strucutres when not required.
18752
18753         * cs-parser.jay: Adjust for new changes.
18754
18755 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18756
18757         * enum.cs (Enum.Populate): If there is a failure during
18758         definition, return
18759
18760         * cs-parser.jay (opt_enum_base): we used to catch type errors
18761         here, but this is really incorrect.  The type error should be
18762         catched during semantic analysis.
18763
18764 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18765
18766         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18767         current_local_parameters as expected since I, in my stupidity, had forgotten
18768         to do this :-)
18769
18770         * attribute.cs (GetValidPlaces): Fix stupid bug.
18771
18772         * class.cs (Method::Emit): Perform check on applicability of attributes.
18773
18774         (Constructor::Emit): Ditto.
18775
18776         (Field::Emit): Ditto.
18777
18778         (Field.Location): Store location information.
18779
18780         (Property, Event, Indexer, Operator): Ditto.
18781
18782         * cs-parser.jay (field_declaration): Pass in location for each field.
18783
18784         * ../errors/cs0592.cs : Add.
18785
18786 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18787
18788         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18789
18790         (InitCoreTypes): Update accordingly.
18791
18792         (RegisterAttrType, LookupAttr): Implement.
18793
18794         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18795         info about the same.
18796
18797         (Resolve): Update to populate the above as necessary.
18798
18799         (Error592): Helper.
18800
18801         (GetValidPlaces): Helper to the above.
18802
18803         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18804
18805         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18806
18807 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18808
18809         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18810
18811         * ../errors/cs0617.cs : Add.
18812
18813 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18814
18815         * enum.cs (Emit): Rename to Populate to be more consistent with what
18816         we expect it to do and when exactly it is called.
18817
18818         * class.cs, rootcontext.cs : Update accordingly.
18819
18820         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18821         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18822
18823         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18824
18825         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18826         of a fieldinfo using the above, when dealing with a FieldBuilder.
18827
18828 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18829
18830         * ../errors/cs0031.cs : Add.
18831
18832         * ../errors/cs1008.cs : Add.
18833
18834         * ../errrors/cs0543.cs : Add.
18835
18836         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18837         enum type.
18838
18839         (FindMembers): Implement.
18840
18841         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18842         enums and delegates too.
18843
18844         (enum_types): Rename to builder_to_enum.
18845
18846         (delegate_types): Rename to builder_to_delegate.
18847
18848         * delegate.cs (FindMembers): Implement.
18849
18850 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18851
18852         * typemanager.cs (IsEnumType): Implement.
18853
18854         * enum.cs (Emit): Re-write parts to account for the underlying type
18855         better and perform checking etc.
18856
18857         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18858         of the underlying type.
18859
18860         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18861         value
18862
18863         * enum.cs (error31): Helper to report error #31.
18864
18865         * cs-parser.jay (enum_declaration): Store location of each member too.
18866
18867         * enum.cs (member_to_location): New hashtable. 
18868
18869         (AddEnumMember): Update location hashtable.
18870
18871         (Emit): Use the location of each member while reporting errors.
18872
18873 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * cs-parser.jay: A for_initializer if is a
18876         local_variable_declaration really ammount to have an implicit
18877         block with the variable declaration and no initializer for for.
18878
18879         * statement.cs (For.Emit): Cope with null initializers.
18880
18881         This fixes the infinite loop on for initializers.
18882
18883 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18884
18885         * enum.cs: More cleanup.
18886
18887         * ecore.cs: Remove dead code.
18888
18889         * class.cs (Property.Emit): More simplification.
18890         (Event.Emit): ditto.
18891
18892         Reworked to have less levels of indentation.
18893
18894 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18895
18896         * class.cs (Property): Emit attributes.
18897
18898         (Field): Ditto.
18899
18900         (Event): Ditto.
18901
18902         (Indexer): Ditto.
18903
18904         (Operator): Ditto.
18905
18906         * enum.cs (Emit): Ditto.
18907
18908         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18909         Enums too.
18910
18911         * class.cs (Field, Event, etc.): Move attribute generation into the
18912         Emit method everywhere.
18913
18914         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18915         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18916         as we had no way of defining nested enums !
18917
18918         * rootcontext.cs : Adjust code accordingly.
18919
18920         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18921
18922 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18923
18924         * expression.cs (EvalConstantExpression): Move into ecore.cs
18925
18926         * enum.cs (Enum): Rename some members and make them public and readonly
18927         according to our convention.
18928
18929         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18930         nothing else.
18931
18932         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18933
18934         (Enum::Emit): Write a simple version for now which doesn't try to compute
18935         expressions. I shall modify this to be more robust in just a while.
18936
18937         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18938
18939         (TypeContainer::CloseType): Create the Enum types too.
18940
18941         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18942
18943         * expression.cs (EvalConstantExpression): Get rid of completely.
18944
18945         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18946         user-defined values and other cases.
18947
18948         (IsValidEnumLiteral): Helper function.
18949
18950         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18951         out there in the case we had a literal FieldExpr.
18952
18953         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18954
18955         (Literalize): Revamp a bit to take two arguments.
18956
18957         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18958
18959 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18960
18961         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18962
18963         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18964
18965         (Resolve): Use the above to ensure we have proper initializers.
18966
18967 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18968
18969         * expression.cs (Expression::EvalConstantExpression): New method to 
18970         evaluate constant expressions.
18971
18972         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18973
18974 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18975
18976         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18977         in an array.
18978
18979         (Binary.ResolveOperator): Handle operator != (object a, object b)
18980         and operator == (object a, object b);
18981
18982         (Binary.DoNumericPromotions): Indicate whether the numeric
18983         promotion was possible.
18984
18985         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18986         Implement.  
18987
18988         Made the ArrayAccess implement interface IAssignMethod instead of
18989         IStackStore as the order in which arguments are passed reflects
18990         this.
18991
18992         * assign.cs: Instead of using expr.ExprClass to select the way of
18993         assinging, probe for the IStackStore/IAssignMethod interfaces.
18994
18995         * typemanager.cs: Load InitializeArray definition.
18996
18997         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18998         static data that can be used to initialize arrays. 
18999
19000 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19001
19002         * expression.cs: Handle operator== and operator!= for booleans.
19003
19004         (Conditioal.Reduce): Implement reducer for the ?: operator.
19005
19006         (Conditional.Resolve): Implement dead code elimination.
19007
19008         (Binary.Resolve): Catch string literals and return a new
19009         concatenated string.
19010
19011         (Unary.Reduce): Implement reduction of unary expressions.
19012
19013         * ecore.cs: Split out the expression core handling here.
19014
19015         (Expression.Reduce): New method used to perform constant folding
19016         and CSE.  This is needed to support constant-expressions. 
19017
19018         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19019         targets, and optimize for !x.
19020
19021 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19022
19023         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19024         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19025         set custom atttributes.
19026
19027         * literal.cs (Literal::GetValue): New abstract method to return the actual
19028         value of the literal, cast as an object.
19029
19030         (*Literal): Implement GetValue method.
19031
19032         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19033         expressions to the arraylist but objects of type Argument.
19034
19035         * class.cs (TypeContainer::Emit): Emit our attributes too.
19036
19037         (Method::Emit, Constructor::Emit): Ditto.
19038
19039         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19040         to be ignoring earlier.
19041
19042 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19043
19044         * attribute.cs (AttributeSection::Define): Implement to do the business
19045         of constructing a CustomAttributeBuilder.
19046
19047         (Attribute): New trivial class. Increases readability of code.  
19048
19049         * cs-parser.jay : Update accordingly.
19050
19051         (positional_argument_list, named_argument_list, named_argument): New rules
19052
19053         (attribute_arguments): Use the above so that we are more correct.
19054
19055 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19056
19057         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19058         to perform all checks for a method with a params parameter.
19059
19060         (Invocation::OverloadResolve): Update to use the above method and therefore
19061         cope correctly with params method invocations.
19062
19063         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19064         params too.
19065
19066         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19067         constructors in our parent too because we can't afford to miss out on 
19068         protected ones ;-)
19069
19070         * attribute.cs (AttributeSection): New name for the class Attribute
19071
19072         Other trivial changes to improve readability.
19073
19074         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19075         use the new class names.
19076
19077 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19078
19079         * class.cs (Method::Define): Complete definition for params types too
19080
19081         (Indexer::Define): Ditto.
19082
19083         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19084         Cope everywhere with a request for info about the array parameter.
19085
19086 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19087
19088         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19089
19090         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19091         local_variable_type to extract the string corresponding to the type.
19092
19093         (local_variable_type): Fixup the action to use the new helper method.
19094
19095         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19096         go.
19097
19098         * expression.cs : Clean out code which uses the above.
19099
19100 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19101
19102         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19103         and bale out if necessary by returning a false.
19104
19105         (RegisterProperty): Ditto.
19106
19107         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19108         and print out appropriate error messages.
19109
19110         * interface.cs (everywhere): Ditto.
19111
19112         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19113         location to constructor.
19114
19115         * class.cs (Property, Event, Indexer): Update accordingly.
19116
19117         * ../errors/cs111.cs : Added.
19118
19119         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19120         of a method, as laid down by the spec.
19121
19122         (Invocation::OverloadResolve): Use the above method.
19123
19124 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19125
19126         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19127         now take a TypeContainer and a Parameters object.
19128
19129         (ParameterData): Modify return type of ParameterModifier method to be 
19130         Parameter.Modifier and not a string.
19131
19132         (ReflectionParameters, InternalParameters): Update accordingly.
19133
19134         * expression.cs (Argument::GetParameterModifier): Same here.
19135
19136         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19137         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19138         symbol in it at all so maybe this is only for now.
19139
19140 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19141
19142         * support.cs (InternalParameters): Constructor now takes an extra argument 
19143         which is the actual Parameters class.
19144
19145         (ParameterDesc): Update to provide info on ref/out modifiers.
19146
19147         * class.cs (everywhere): Update call to InternalParameters to pass in
19148         the second argument too.
19149
19150         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19151         to return the modifier info [ref/out etc]
19152
19153         (InternalParameters, ReflectionParameters): Implement the above.
19154
19155         * expression.cs (Argument::ParameterModifier): Similar function to return
19156         info about the argument's modifiers.
19157
19158         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19159         too.
19160
19161         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19162         a new SetFormalParameters object which we pass to InternalParameters.
19163
19164 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19165
19166         * expression.cs (NewArray): Merge into the ArrayCreation class.
19167
19168 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19169
19170         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19171         NewUserdefinedArray into one as there wasn't much of a use in having
19172         two separate ones.
19173
19174         * expression.cs (Argument): Change field's name to ArgType from Type.
19175
19176         (Type): New readonly property which returns the proper type, taking into 
19177         account ref/out modifiers.
19178
19179         (everywhere): Adjust code accordingly for the above.
19180
19181         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19182         whether we are emitting for a ref or out parameter.
19183
19184         * expression.cs (Argument::Emit): Use the above field to set the state.
19185
19186         (LocalVariableReference::Emit): Update to honour the flag and emit the
19187         right stuff.
19188
19189         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19190
19191         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19192
19193         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19194
19195         (ReflectionParameters, InternalParameters): Implement the above method.
19196
19197         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19198         reporting errors.
19199
19200         (Invocation::FullMethodDesc): Ditto. 
19201
19202 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19203
19204         * cs-parser.jay: Add extra production for the second form of array
19205         creation. 
19206
19207         * expression.cs (ArrayCreation): Update to reflect the above
19208         change. 
19209
19210         * Small changes to prepare for Array initialization.
19211
19212 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19213
19214         * typemanager.cs (ImplementsInterface): interface might be null;
19215         Deal with this problem;
19216
19217         Also, we do store negative hits on the cache (null values), so use
19218         this instead of calling t.GetInterfaces on the type everytime.
19219
19220 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19221
19222         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19223
19224         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19225         split functionality out into different classes.
19226
19227         (New::FormArrayType): Move into NewBuiltinArray.
19228
19229         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19230         quite useless.
19231
19232         (NewBuiltinArray): New class to handle creation of built-in arrays.
19233
19234         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19235         account creation of one-dimensional arrays.
19236
19237         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19238
19239         (NewUserdefinedArray::DoResolve): Implement.
19240
19241         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19242
19243         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19244         we maintain inside the TypeManager. This is necessary to perform lookups on the
19245         module builder.
19246
19247         (LookupType): Update to perform GetType on the module builders too.     
19248
19249         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19250
19251         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19252
19253 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19254
19255         * expression.cs (New::DoResolve): Implement guts of array creation.
19256
19257         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19258
19259 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19260
19261         * expression.cs: Fix bug I introduced lsat night that broke
19262         Delegates. 
19263
19264         (Expression.Resolve): Report a 246 error (can not resolve name)
19265         if we find a SimpleName in the stream.
19266
19267         (Expression.ResolveLValue): Ditto.
19268
19269         (Expression.ResolveWithSimpleName): This function is a variant of
19270         ResolveName, this one allows SimpleNames to be returned without a
19271         warning.  The only consumer of SimpleNames is MemberAccess
19272
19273 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19274
19275         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19276         might arrive here.  I have my doubts that this is correct.
19277
19278         * statement.cs (Lock): Implement lock statement.
19279
19280         * cs-parser.jay: Small fixes to support `lock' and `using'
19281
19282         * cs-tokenizer.cs: Remove extra space
19283
19284         * driver.cs: New flag --checked, allows to turn on integer math
19285         checking. 
19286
19287         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19288         Threading.Monitor.Exit 
19289
19290 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19291
19292         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19293         Expression Class to be IndexerAccess.
19294
19295         Notice that Indexer::DoResolve sets the eclass to Value.
19296
19297 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19298
19299         * class.cs (TypeContainer::Emit): Emit code for indexers.
19300
19301         * assign.cs (IAssignMethod): New interface implemented by Indexers
19302         and Properties for handling assignment.
19303
19304         (Assign::Emit): Simplify and reuse code. 
19305
19306         * expression.cs (IndexerAccess, PropertyExpr): Implement
19307         IAssignMethod, clean up old code. 
19308
19309 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19310
19311         * typemanager.cs (ImplementsInterface): New method to determine if a type
19312         implements a given interface. Provides a nice cache too.
19313
19314         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19315         method.
19316
19317         (ConvertReferenceExplicit): Ditto.
19318
19319         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19320         various methods, with correct names etc.
19321
19322         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19323         Operator.UnaryNegation.
19324
19325         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19326         we have a unary plus or minus operator.
19327
19328         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19329         UnaryMinus.
19330
19331         * everywhere : update accordingly.
19332
19333         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19334         respectively.
19335
19336         * class.cs (Method::Define): For the case where we are implementing a method
19337         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19338         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19339
19340 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19341
19342         * interface.cs (FindMembers): Implement to work around S.R.E
19343         lameness.
19344
19345         * typemanager.cs (IsInterfaceType): Implement.
19346
19347         (FindMembers): Update to handle interface types too.
19348
19349         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19350         use IsAssignableFrom as that is not correct - it doesn't work.
19351
19352         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19353         and accordingly override EmitStatement.
19354
19355         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19356         using the correct logic :-)
19357
19358 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19359
19360         * ../errors/cs-11.cs : Add to demonstrate error -11 
19361
19362 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19365         then pass this as a hint to ResolveLValue.
19366
19367         * expression.cs (FieldExpr): Add Location information
19368
19369         (FieldExpr::LValueResolve): Report assignment to readonly
19370         variable. 
19371
19372         (Expression::ExprClassFromMemberInfo): Pass location information.
19373
19374         (Expression::ResolveLValue): Add new method that resolves an
19375         LValue. 
19376
19377         (Expression::DoResolveLValue): Default invocation calls
19378         DoResolve. 
19379
19380         (Indexers): New class used to keep track of indexers in a given
19381         Type. 
19382
19383         (IStackStore): Renamed from LValue, as it did not really describe
19384         what this did.  Also ResolveLValue is gone from this interface and
19385         now is part of Expression.
19386
19387         (ElementAccess): Depending on the element access type
19388
19389         * typemanager.cs: Add `indexer_name_type' as a Core type
19390         (System.Runtime.CompilerServices.IndexerNameAttribute)
19391
19392         * statement.cs (Goto): Take a location.
19393
19394 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19395
19396         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19397         if two delegates are compatible.
19398
19399         (NewDelegate::DoResolve): Update to take care of the case when
19400         we instantiate a delegate from another delegate.
19401
19402         * typemanager.cs (FindMembers): Don't even try to look up members
19403         of Delegate types for now.
19404
19405 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19406
19407         * delegate.cs (NewDelegate): New class to take care of delegate
19408         instantiation.
19409
19410         * expression.cs (New): Split the delegate related code out into 
19411         the NewDelegate class.
19412
19413         * delegate.cs (DelegateInvocation): New class to handle delegate 
19414         invocation.
19415
19416         * expression.cs (Invocation): Split out delegate related code into
19417         the DelegateInvocation class.
19418
19419 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19420
19421         * expression.cs (New::DoResolve): Implement delegate creation fully
19422         and according to the spec.
19423
19424         (New::DoEmit): Update to handle delegates differently.
19425
19426         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19427         because of which we were printing out arguments in reverse order !
19428
19429         * delegate.cs (VerifyMethod): Implement to check if the given method
19430         matches the delegate.
19431
19432         (FullDelegateDesc): Implement.
19433
19434         (VerifyApplicability): Implement.
19435
19436         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19437         delegate invocations too.
19438
19439         (Invocation::Emit): Ditto.
19440
19441         * ../errors/cs1593.cs : Added.
19442
19443         * ../errors/cs1594.cs : Added.
19444
19445         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19446
19447 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19448
19449         * typemanager.cs (intptr_type): Core type for System.IntPtr
19450
19451         (InitCoreTypes): Update for the same.
19452
19453         (iasyncresult_type, asynccallback_type): Ditto.
19454
19455         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19456         correct.
19457
19458         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19459         too.
19460
19461         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19462         the builders for the 4 members of a delegate type :-)
19463
19464         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19465         type.
19466
19467         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19468
19469         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19470
19471 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19472
19473         * statement.cs (Break::Emit): Implement.   
19474         (Continue::Emit): Implement.
19475
19476         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19477         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19478         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19479         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19480         end loop
19481
19482         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19483         properties that track the label for the current loop (begin of the
19484         loop and end of the loop).
19485
19486 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19487
19488         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19489         use of emitting anything at all.
19490
19491         * class.cs, rootcontext.cs : Get rid of calls to the same.
19492
19493         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19494
19495         (Populate): Define the constructor correctly and set the implementation
19496         attributes.
19497
19498         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19499         have been defined.
19500
19501         (AddDelegateType): Implement.
19502
19503         (IsDelegateType): Implement helper method.
19504
19505         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19506
19507         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19508         and accordingly handle it.
19509
19510         * delegate.cs (Populate): Take TypeContainer argument.
19511         Implement bits to define the Invoke method. However, I still haven't figured out
19512         how to take care of the native int bit :-(
19513
19514         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19515         Qualify the name of the delegate, not its return type !
19516
19517         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19518         conversion.
19519
19520         (StandardConversionExists): Checking for array types turns out to be recursive.
19521
19522         (ConvertReferenceExplicit): Implement array conversion.
19523
19524         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19525
19526 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19527
19528         * cs-parser.jay (delegate_declaration): Store the fully qualified
19529         name as it is a type declaration.
19530
19531         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19532         readonly.
19533
19534         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19535         as TypeContainer::DefineType.
19536
19537         (Populate): Method in which all the definition of the various methods (Invoke)
19538         etc is done.
19539
19540         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19541         see.
19542
19543         (CloseDelegate): Finally creates the delegate.
19544
19545         * class.cs (TypeContainer::DefineType): Update to define delegates.
19546         (Populate, Emit and CloseType): Do the same thing here too.
19547
19548         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19549         delegates in all these operations.
19550
19551 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19552
19553         * expression.cs: LocalTemporary: a new expression used to
19554         reference a temporary that has been created.
19555
19556         * assign.cs: Handle PropertyAccess back here, so that we can
19557         provide the proper semantic access to properties.
19558
19559         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19560         a few more explicit conversions. 
19561
19562         * modifiers.cs: `NEW' modifier maps to HideBySig.
19563
19564         * expression.cs (PropertyExpr): Make this into an
19565         ExpressionStatement, and support the EmitStatement code path. 
19566
19567         Perform get/set error checking, clean up the interface.
19568
19569         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19570         them into toplevel access objects.
19571
19572 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19575         SRE.
19576
19577         * typemanager.cs: Keep track here of our PropertyBuilders again to
19578         work around lameness in SRE.
19579
19580 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19581
19582         * expression.cs (LValue::LValueResolve): New method in the
19583         interface, used to perform a second resolution pass for LValues. 
19584
19585         (This::DoResolve): Catch the use of this in static methods.
19586
19587         (This::LValueResolve): Implement.
19588
19589         (This::Store): Remove warning, assigning to `this' in structures
19590         is 
19591
19592         (Invocation::Emit): Deal with invocation of
19593         methods on value types.  We need to pass the address to structure
19594         methods rather than the object itself.  (The equivalent code to
19595         emit "this" for structures leaves the entire structure on the
19596         stack instead of a pointer to it). 
19597
19598         (ParameterReference::DoResolve): Compute the real index for the
19599         argument based on whether the method takes or not a `this' pointer
19600         (ie, the method is static).
19601
19602         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19603         value types returned from functions when we need to invoke a
19604         method on the sturcture.
19605
19606
19607 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19608
19609         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19610         defining the type in the Modulebuilder or Typebuilder. This is to take
19611         care of nested types which need to be defined on the TypeBuilder using
19612         DefineNestedMethod.
19613
19614         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19615         methods in RootContext, only ported to be part of TypeContainer.
19616
19617         (TypeContainer::GetInterfaceOrClass): Ditto.
19618
19619         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19620
19621         * interface.cs (Interface::DefineInterface): New method. Does exactly
19622         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19623         too.
19624
19625         (Interface::GetInterfaces): Move from RootContext here and port.
19626
19627         (Interface::GetInterfaceByName): Same here.
19628
19629         * rootcontext.cs (ResolveTree): Re-write.
19630
19631         (PopulateTypes): Re-write.
19632
19633         * class.cs (TypeContainer::Populate): Populate nested types too.
19634         (TypeContainer::Emit): Emit nested members too.
19635
19636         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19637         instead just use the name argument passed in as it is already fully
19638         qualified.
19639
19640         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19641         to TypeContainer mapping to see if a type is user-defined.
19642
19643         * class.cs (TypeContainer::CloseType): Implement. 
19644
19645         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19646         the default constructor.
19647
19648         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19649         twice.
19650
19651         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19652
19653         * interface.cs (CloseType): Create the type here.
19654
19655         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19656         the hierarchy.
19657
19658         Remove all the methods which are now in TypeContainer.
19659
19660 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19661
19662         * delegate.cs (Define): Re-write bits to define the delegate
19663         correctly.
19664
19665 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19666
19667         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19668
19669         * expression.cs (ImplicitReferenceConversion): handle null as well
19670         as a source to convert to any reference type.
19671
19672         * statement.cs (Return): Perform any implicit conversions to
19673         expected return type.  
19674
19675         Validate use of return statement.  
19676
19677         * codegen.cs (EmitContext): Pass the expected return type here.
19678
19679         * class.cs (Method, Constructor, Property): Pass expected return
19680         type to EmitContext.
19681
19682 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19683
19684         * expression.cs: Make DoResolve take an EmitContext instead of a
19685         TypeContainer.
19686
19687         Replaced `l' and `location' for `loc', for consistency.
19688
19689         (Error, Warning): Remove unneeded Tc argument.
19690
19691         * assign.cs, literal.cs, constant.cs: Update to new calling
19692         convention. 
19693
19694         * codegen.cs: EmitContext now contains a flag indicating whether
19695         code is being generated in a static method or not.
19696
19697         * cs-parser.jay: DecomposeQI, new function that replaces the old
19698         QualifiedIdentifier.  Now we always decompose the assembled
19699         strings from qualified_identifier productions into a group of
19700         memberaccesses.
19701
19702 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19703
19704         * rootcontext.cs: Deal with field-less struct types correctly now
19705         by passing the size option to Define Type.
19706
19707         * class.cs: Removed hack that created one static field. 
19708
19709 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * statement.cs: Moved most of the code generation here. 
19712
19713 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19714
19715         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19716         seem very right.
19717
19718         (ElementAccess): Remove useless bits for now - keep checks as the spec
19719         says.
19720
19721 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19722
19723         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19724         and start performing checks according to the spec.
19725
19726 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19727
19728         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19729         rank_specifiers instead.
19730
19731         (rank_specifiers): Change the order in which the rank specifiers are stored
19732
19733         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19734
19735         * expression.cs (ElementAccess): Implement the LValue interface too.
19736
19737 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19738
19739         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19740         except that user defined conversions are not included.
19741
19742         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19743         perform the conversion of the return type, if necessary.
19744
19745         (New::DoResolve): Check whether we are creating an array or an object
19746         and accordingly do the needful.
19747
19748         (New::Emit): Same here.
19749
19750         (New::DoResolve): Implement guts of array creation.
19751
19752         (New::FormLookupType): Helper function.
19753
19754 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19755
19756         * codegen.cs: Removed most of the code generation here, and move the
19757         corresponding code generation bits to the statement classes. 
19758
19759         Added support for try/catch/finalize and throw.
19760
19761         * cs-parser.jay: Added support for try/catch/finalize.
19762
19763         * class.cs: Catch static methods having the flags override,
19764         virtual or abstract.
19765
19766         * expression.cs (UserCast): This user cast was not really doing
19767         what it was supposed to do.  Which is to be born in fully resolved
19768         state.  Parts of the resolution were being performed at Emit time! 
19769
19770         Fixed this code.
19771
19772 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * expression.cs: Implicity convert the result from UserCast.
19775
19776 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19777
19778         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19779         prevented it from working correctly. 
19780
19781         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19782         merely ConvertImplicit.
19783
19784 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19785
19786         * typemanager.cs: Make the LookupTypeContainer function static,
19787         and not per-instance.  
19788
19789         * class.cs: Make static FindMembers (the one that takes a Type
19790         argument). 
19791
19792         * codegen.cs: Add EmitForeach here.
19793
19794         * cs-parser.jay: Make foreach a toplevel object instead of the
19795         inline expansion, as we need to perform semantic analysis on it. 
19796
19797 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19798
19799         * expression.cs (Expression::ImplicitUserConversion): Rename to
19800         UserDefinedConversion.
19801
19802         (Expression::UserDefinedConversion): Take an extra argument specifying 
19803         whether we look for explicit user conversions too.
19804
19805         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19806
19807         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19808
19809         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19810         with the appropriate arguments.
19811
19812         * cs-parser.jay (cast_expression): Record location too.
19813
19814         * expression.cs (Cast): Record location info.
19815
19816         (Expression::ConvertExplicit): Take location argument.
19817
19818         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19819         to determine if we are doing explicit conversions.
19820
19821         (UserCast::Emit): Update accordingly.
19822
19823         (Expression::ConvertExplicit): Report an error if everything fails.
19824
19825         * ../errors/cs0030.cs : Add.
19826
19827 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19828
19829         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19830         virtual and newslot bits. 
19831
19832         * class.cs (TypeContainer::RegisterRequiredImplementations):
19833         Record methods we need.
19834
19835         (TypeContainer::MakeKey): Helper function to make keys for
19836         MethodBases, since the Methodbase key is useless.
19837
19838         (TypeContainer::Populate): Call RegisterRequiredImplementations
19839         before defining the methods.   
19840
19841         Create a mapping for method_builders_to_methods ahead of time
19842         instead of inside a tight loop.
19843
19844         (::RequireMethods):  Accept an object as the data to set into the
19845         hashtable so we can report interface vs abstract method mismatch.
19846
19847 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19848
19849         * report.cs: Make all of it static.
19850
19851         * rootcontext.cs: Drop object_type and value_type computations, as
19852         we have those in the TypeManager anyways.
19853
19854         Drop report instance variable too, now it is a global.
19855
19856         * driver.cs: Use try/catch on command line handling.
19857
19858         Add --probe option to debug the error reporting system with a test
19859         suite. 
19860
19861         * report.cs: Add support for exiting program when a probe
19862         condition is reached.
19863
19864 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19865
19866         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19867         we do a forcible conversion regardless of type, to check if 
19868         ForceConversion returns a null.
19869
19870         (Binary::error19): Use location to report error.
19871
19872         (Unary::error23): Use location here too.
19873
19874         * ../errors/cs0019.cs : Check in.
19875
19876         * ../errors/cs0023.cs : Check in.
19877
19878         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19879         case of a non-null MethodInfo object with a length of 0 !
19880
19881         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19882         an applicable member - according to the spec :-)
19883         Also fix logic to find members in base types.
19884
19885         (Unary::ResolveOperator): Same here.
19886
19887         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19888         as I was getting thoroughly confused between this and error19 :-)
19889
19890         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19891         (::FindMostEncompassedType): Implement.
19892         (::FindMostEncompassingType): Implement.
19893         (::StandardConversionExists): Implement.
19894
19895         (UserImplicitCast): Re-vamp. We now need info about most specific
19896         source and target types so that we can do the necessary conversions.
19897
19898         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19899         mathematical union with no duplicates.
19900
19901 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19902
19903         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19904         in order from base classes to child classes, so that we can in
19905         child classes look up in our parent for method names and
19906         attributes (required for handling abstract, virtual, new, override
19907         constructs: we need to instrospect our base class, and if we dont
19908         populate the classes in order, the introspection might be
19909         incorrect.  For example, a method could query its parent before
19910         the parent has any methods and would determine that the parent has
19911         no abstract methods (while it could have had them)).
19912
19913         (RootContext::CreateType): Record the order in which we define the
19914         classes.
19915
19916 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19917
19918         * class.cs (TypeContainer::Populate): Also method definitions can
19919         fail now, keep track of this.
19920
19921         (TypeContainer::FindMembers): Implement support for
19922         DeclaredOnly/noDeclaredOnly flag.
19923
19924         (Constructor::Emit) Return the ConstructorBuilder.
19925
19926         (Method::Emit) Return the MethodBuilder. 
19927         Check for abstract or virtual methods to be public.
19928
19929         * rootcontext.cs (RootContext::CreateType): Register all the
19930         abstract methods required for the class to be complete and the
19931         interface methods that must be implemented. 
19932
19933         * cs-parser.jay: Report error 501 (method requires body if it is
19934         not marked abstract or extern).
19935
19936         * expression.cs (TypeOf::Emit): Implement.
19937
19938         * typemanager.cs: runtime_handle_type, new global type.
19939
19940         * class.cs (Property::Emit): Generate code for properties.
19941
19942 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19943
19944         * expression.cs (Unary::ResolveOperator): Find operators on base type
19945         too - we now conform exactly to the spec.
19946
19947         (Binary::ResolveOperator): Same here.
19948
19949         * class.cs (Operator::Define): Fix minor quirk in the tests.
19950
19951         * ../errors/cs0215.cs : Added.
19952
19953         * ../errors/cs0556.cs : Added.
19954
19955         * ../errors/cs0555.cs : Added.
19956
19957 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19960         single integer which is really efficient
19961
19962 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19963
19964         *  expression.cs (Expression::ImplicitUserConversion): Use location
19965         even in the case when we are examining True operators.
19966  
19967         * class.cs (Operator::Define): Perform extensive checks to conform
19968         with the rules for operator overloading in the spec.
19969
19970         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19971         some of the other conversions mentioned in the spec.
19972
19973         * typemanager.cs (array_type): New static member for the System.Array built-in
19974         type.
19975
19976         (cloneable_interface): For System.ICloneable interface.
19977
19978         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19979         we start resolving the tree and populating types.
19980
19981         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19982  
19983 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * expression.cs (Expression::ExprClassFromMemberInfo,
19986         Expression::Literalize): Create literal expressions from
19987         FieldInfos which are literals.
19988
19989         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19990         type casts, because they were wrong.  The test suite in tests
19991         caught these ones.
19992
19993         (ImplicitNumericConversion): ushort to ulong requires a widening
19994         cast. 
19995
19996         Int32 constant to long requires widening cast as well.
19997
19998         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19999         for integers because the type on the stack is not i4.
20000
20001 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * expression.cs (report118): require location argument. 
20004
20005         * parameter.cs: Do not dereference potential null value.
20006
20007         * class.cs: Catch methods that lack the `new' keyword when
20008         overriding a name.  Report warnings when `new' is used without
20009         anything being there to override.
20010
20011         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20012
20013         * class.cs: Only add constructor to hashtable if it is non-null
20014         (as now constructors can fail on define).
20015
20016         (TypeManager, Class, Struct): Take location arguments.
20017
20018         Catch field instance initialization in structs as errors.
20019
20020         accepting_filter: a new filter for FindMembers that is static so
20021         that we dont create an instance per invocation.
20022
20023         (Constructor::Define): Catch errors where a struct constructor is
20024         parameterless 
20025
20026         * cs-parser.jay: Pass location information for various new
20027         constructs. 
20028
20029         * delegate.cs (Delegate): take a location argument.
20030
20031         * driver.cs: Do not call EmitCode if there were problesm in the
20032         Definition of the types, as many Builders wont be there. 
20033
20034         * decl.cs (Decl::Decl): Require a location argument.
20035
20036         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20037         into integers, and find the most appropiate integer for it.
20038
20039         * literal.cs: Implement ULongLiteral.
20040
20041         * rootcontext.cs: Provide better information about the location of
20042         failure when CreateType fails.
20043
20044 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20045
20046         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20047         as well.
20048
20049         * expression.cs (Binary::CheckShiftArguments): Add missing type
20050         computation.
20051         (Binary::ResolveOperator): Add type to the logical and and logical
20052         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20053         before.
20054
20055         (Binary::DoNumericPromotions): In the case where either argument
20056         is ulong (and most signed types combined with ulong cause an
20057         error) perform implicit integer constant conversions as well.
20058
20059 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * expression.cs (UserImplicitCast): Method should always be
20062         non-null. 
20063         (Invocation::BetterConversion): Simplified test for IntLiteral.
20064
20065         (Expression::ImplicitNumericConversion): Split this routine out.
20066         Put the code that performs implicit constant integer conversions
20067         here. 
20068
20069         (Expression::Resolve): Become a wrapper around DoResolve so we can
20070         check eclass and type being set after resolve.
20071
20072         (Invocation::Badness): Remove this dead function
20073
20074         (Binary::ResolveOperator): Do not compute the expensive argumnets
20075         unless we have a union for it.
20076
20077         (Probe::Emit): Is needs to do an isinst and then
20078         compare against null.
20079
20080         (::CanConvert): Added Location argument.  If the Location argument
20081         is null (Location.Null), then we do not report errors.  This is
20082         used by the `probe' mechanism of the Explicit conversion.  We do
20083         not want to generate an error for something that the user
20084         explicitly requested to be casted.  But the pipeline for an
20085         explicit cast first tests for potential implicit casts.
20086
20087         So for now, if the Location is null, it means `Probe only' to
20088         avoid adding another argument.   Might have to revise this
20089         strategy later.
20090
20091         (ClassCast): New class used to type cast objects into arbitrary
20092         classes (used in Explicit Reference Conversions).
20093
20094         Implement `as' as well.
20095
20096         Reverted all the patches from Ravi below: they were broken:
20097
20098                 * The use of `level' as a mechanism to stop recursive
20099                   invocations is wrong.  That was there just to catch the
20100                   bug with a strack trace but not as a way of addressing
20101                   the problem.
20102
20103                   To fix the problem we have to *understand* what is going
20104                   on and the interactions and come up with a plan, not
20105                   just get things going.
20106
20107                 * The use of the type conversion cache that I proposed
20108                   last night had an open topic: How does this work across
20109                   protection domains.  A user defined conversion might not
20110                   be public in the location where we are applying the
20111                   conversion, a different conversion might be selected
20112                   (ie, private A->B (better) but public B->A (worse),
20113                   inside A, A->B applies, but outside it, B->A will
20114                   apply).
20115
20116                 * On top of that (ie, even if the above is solved),
20117                   conversions in a cache need to be abstract.  Ie, `To
20118                   convert from an Int to a Short use an OpcodeCast', not
20119                   `To convert from an Int to a Short use the OpcodeCast on
20120                   the variable 5' (which is what this patch was doing).
20121
20122 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20123
20124         * expression.cs (Invocation::ConversionExists): Re-write to use
20125         the conversion cache
20126
20127         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20128         cache all conversions done, not just user-defined ones.
20129
20130         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20131         to determine if a conversion exists instead of acutually trying to 
20132         perform the conversion. It's faster too.
20133
20134         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20135         and only then attempt the implicit conversion.
20136
20137 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20138
20139         * expression.cs (ConvertImplicit): Use a cache for conversions
20140         already found. Check level of recursion and bail out if necessary.
20141
20142 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20143
20144         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20145         Export standard methods that we expect for string operations.
20146
20147         * statement.cs (Block::UsageWarning): Track usage of variables and
20148         report the errors for not used variables.
20149
20150         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20151         operator. 
20152
20153 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20154
20155         * codegen.cs: remove unnneded code 
20156
20157         * expression.cs: Removed BuiltinTypeAccess class
20158
20159         Fix the order in which implicit conversions are
20160         done.  
20161
20162         The previous fixed dropped support for boxed conversions (adding a
20163         test to the test suite now)
20164
20165         (UserImplicitCast::CanConvert): Remove test for source being null,
20166         that code is broken.  We should not feed a null to begin with, if
20167         we do, then we should track the bug where the problem originates
20168         and not try to cover it up here.
20169
20170         Return a resolved expression of type UserImplicitCast on success
20171         rather than true/false.  Ravi: this is what I was talking about,
20172         the pattern is to use a static method as a "constructor" for
20173         objects. 
20174
20175         Also, do not create arguments until the very last minute,
20176         otherwise we always create the arguments even for lookups that
20177         will never be performed. 
20178
20179         (UserImplicitCast::Resolve): Eliminate, objects of type
20180         UserImplicitCast are born in a fully resolved state. 
20181
20182         * typemanager.cs (InitCoreTypes): Init also value_type
20183         (System.ValueType). 
20184
20185         * expression.cs (Cast::Resolve): First resolve the child expression.
20186
20187         (LValue): Add new method AddressOf to be used by
20188         the `&' operator.  
20189
20190         Change the argument of Store to take an EmitContext instead of an
20191         ILGenerator, because things like FieldExpr need to be able to call
20192         their children expression to generate the instance code. 
20193
20194         (Expression::Error, Expression::Warning): Sugar functions for
20195         reporting errors.
20196
20197         (Expression::MemberLookup): Accept a TypeContainer instead of a
20198         Report as the first argument.
20199
20200         (Expression::ResolvePrimary): Killed.  I still want to improve
20201         this as currently the code is just not right.
20202
20203         (Expression::ResolveMemberAccess): Simplify, but it is still
20204         wrong. 
20205
20206         (Unary::Resolve): Catch errors in AddressOf operators.
20207
20208         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20209         index to a byte for the short-version, or the compiler will choose
20210         the wrong Emit call, which generates the wrong data.
20211
20212         (ParameterReference::Emit, ::Store): same.
20213
20214         (FieldExpr::AddressOf): Implement.
20215
20216         * typemanager.cs: TypeManager: made public variable instead of
20217         property.
20218
20219         * driver.cs: document --fatal.
20220
20221         * report.cs (ErrorMessage, WarningMessage): new names for the old
20222         Error and Warning classes.
20223
20224         * cs-parser.jay (member_access): Turn built-in access to types
20225         into a normal simplename
20226
20227 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20228
20229         * expression.cs (Invocation::BetterConversion): Fix to cope
20230         with q being null, since this was introducing a bug.
20231
20232         * expression.cs (ConvertImplicit): Do built-in conversions first.
20233
20234 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20235
20236         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20237
20238 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20239
20240         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20241         I had introduced long ago (what's new ?).
20242
20243         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20244         the work of all the checking. 
20245         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20246         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20247
20248         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20249         that is the right way. 
20250
20251         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20252         overloading resolution. Use everywhere instead of cutting and pasting code.
20253
20254         (Binary::ResolveOperator): Use MakeUnionSet.
20255
20256         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20257         we have to convert to bool types. Not complete yet.
20258
20259 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * typemanager.cs (TypeManager::CSharpName): support ushort.
20262
20263         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20264         to provide an expression that performsn an implicit constant int
20265         conversion (section 6.1.6).
20266         (Expression::ConvertImplicitRequired): Reworked to include
20267         implicit constant expression conversions.
20268
20269         (Expression::ConvertNumericExplicit): Finished.
20270
20271         (Invocation::Emit): If InstanceExpression is null, then it means
20272         that we perform a call on this.
20273
20274 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * expression.cs (Unary::Emit): Remove some dead code.
20277         (Probe): Implement Resolve and Emit for `is'.
20278         (Expression::ConvertImplicitRequired): Attempt to do constant
20279         expression conversions here.  Maybe should be moved to
20280         ConvertImplicit, but I am not sure.
20281         (Expression::ImplicitLongConstantConversionPossible,
20282         Expression::ImplicitIntConstantConversionPossible): New functions
20283         that tell whether is it possible to apply an implicit constant
20284         expression conversion.
20285
20286         (ConvertNumericExplicit): Started work on explicit numeric
20287         conversions.
20288
20289         * cs-parser.jay: Update operator constants.
20290
20291         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20292         (Parameters::GetSignature): Hook up VerifyArgs here.
20293         (Parameters::VerifyArgs): Verifies that no two arguments have the
20294         same name. 
20295
20296         * class.cs (Operator): Update the operator names to reflect the
20297         ones that the spec expects (as we are just stringizing the
20298         operator names).
20299
20300         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20301         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20302         previous usage did only work for our methods.
20303         (Expression::ConvertImplicit): Handle decimal implicit numeric
20304         conversions as well.
20305         (Expression::InternalTypeConstructor): Used to invoke constructors
20306         on internal types for default promotions.
20307
20308         (Unary::Emit): Implement special handling for the pre/post
20309         increment/decrement for overloaded operators, as they need to have
20310         the same semantics as the other operators.
20311
20312         (Binary::ResolveOperator): ditto.
20313         (Invocation::ConversionExists): ditto.
20314         (UserImplicitCast::Resolve): ditto.
20315
20316 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20317
20318         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20319         operator, return after emitting body. Regression tests pass again !
20320
20321         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20322         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20323         (Invocation::OverloadResolve): Ditto.
20324         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20325
20326         * everywhere : update calls to the above methods accordingly.
20327
20328 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20329
20330         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20331
20332         * expression.cs (ExpressionStatement): New base class used for
20333         expressions that can appear in statements, so that we can provide
20334         an alternate path to generate expression that do not leave a value
20335         on the stack.
20336
20337         (Expression::Emit, and all the derivatives): We no longer return
20338         whether a value is left on the stack or not.  Every expression
20339         after being emitted leaves a single value on the stack.
20340
20341         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20342         facilties of ExpressionStatement if possible.
20343
20344         * cs-parser.jay: Update statement_expression.
20345
20346 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * driver.cs: Change the wording of message
20349
20350 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20351
20352         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20353         the type of the expression to the return type of the method if
20354         we have an overloaded operator match ! The regression tests pass again !
20355         (Unary::ResolveOperator): Ditto.
20356
20357         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20358         to find "op_Implicit", not "implicit" ;-)
20359         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20360         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20361
20362         * everywhere : Correct calls to the above accordingly.
20363
20364         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20365         (ConvertImplicit): Do user-defined conversion if it exists.
20366
20367 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20368
20369         * assign.cs: track location.
20370         (Resolve): Use implicit conversions on assignment.
20371
20372         * literal.cs: Oops.  Not good, Emit of short access values should
20373         pass (Bytes) or the wrong argument will be selected.
20374
20375         * expression.cs (Unary::Emit): Emit code for -expr.
20376
20377         (Unary::ResolveOperator): Handle `Substract' for non-constants
20378         (substract from zero from the non-constants).
20379         Deal with Doubles as well. 
20380
20381         (Expression::ConvertImplicitRequired): New routine that reports an
20382         error if no implicit conversion exists. 
20383
20384         (Invocation::OverloadResolve): Store the converted implicit
20385         expressions if we make them
20386
20387 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20388
20389         * class.cs (ConstructorInitializer): Take a Location argument.
20390         (ConstructorBaseInitializer): Same here.
20391         (ConstructorThisInitializer): Same here.
20392
20393         * cs-parser.jay : Update all calls accordingly.
20394
20395         * expression.cs (Unary, Binary, New): Take location argument.
20396         Update accordingly everywhere.
20397
20398         * cs-parser.jay : Update all calls to the above to take a location
20399         argument.
20400
20401         * class.cs : Ditto.
20402
20403 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20404
20405         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20406         (Invocation::BetterConversion): Same here
20407         (Invocation::ConversionExists): Ditto.
20408
20409         (Invocation::ConversionExists): Implement.
20410
20411 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20412
20413         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20414         Also take an additional TypeContainer argument.
20415
20416         * All over : Pass in TypeContainer as argument to OverloadResolve.
20417
20418         * typemanager.cs (CSharpName): Update to check for the string type and return
20419         that too.
20420
20421         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20422         a given method.
20423
20424 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20425
20426         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20427         (Invocation::BetterFunction): Implement.
20428         (Invocation::BetterConversion): Implement.
20429         (Invocation::ConversionExists): Skeleton, no implementation yet.
20430
20431         Okay, things work fine !
20432
20433 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20434
20435         * typemanager.cs: declare and load enum_type, delegate_type and
20436         void_type. 
20437
20438         * expression.cs (Expression::Emit): Now emit returns a value that
20439         tells whether a value is left on the stack or not.  This strategy
20440         might be reveted tomorrow with a mechanism that would address
20441         multiple assignments.
20442         (Expression::report118): Utility routine to report mismatches on
20443         the ExprClass.
20444
20445         (Unary::Report23): Report impossible type/operator combination
20446         utility function.
20447
20448         (Unary::IsIncrementableNumber): Whether the type can be
20449         incremented or decremented with add.
20450         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20451         complemented. 
20452         (Unary::ResolveOperator): Implement ++, !, ~,
20453
20454         (Invocation::Emit): Deal with new Emit convetion.
20455
20456         * All Expression derivatives: Updated their Emit method to return
20457         whether they leave values on the stack or not.
20458
20459         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20460         stack for expressions that are statements. 
20461
20462 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20463
20464         * expression.cs (LValue): New interface.  Must be implemented by
20465         LValue objects.
20466         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20467         LValue interface.
20468
20469         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20470         interface for generating code, simplifies the code.
20471
20472 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20473
20474         * expression.cs (everywhere): Comment out return statements in ::Resolve
20475         methods to avoid the warnings.
20476
20477 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20478
20479         * driver.cs (parse): Report error 2001 if we can not open the
20480         source file.
20481
20482         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20483         not resolve it.
20484
20485         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20486         object. 
20487
20488         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20489         otherwise nested blocks end up with the same index.
20490
20491         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20492
20493         * expression.cs:  Instead of having FIXMEs in the Resolve
20494         functions, throw exceptions so it is obvious that we are facing a
20495         bug. 
20496
20497         * cs-parser.jay (invocation_expression): Pass Location information.
20498
20499         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20500         Use a basename for those routines because .NET does not like paths
20501         on them. 
20502
20503         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20504         already defined.
20505
20506 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20507
20508         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20509         are loading the correct data types (throws an exception if not).
20510         (TypeManager::InitCoreTypes): Use CoreLookupType
20511
20512         * expression.cs (Unary::ResolveOperator): return the child
20513         expression for expressions which are just +expr.
20514         (Unary::ResolveOperator): Return negative literals for -LITERAL
20515         expressions (otherwise they are Unary {Literal}).
20516         (Invocation::Badness): Take into account `Implicit constant
20517         expression conversions'.
20518
20519         * literal.cs (LongLiteral): Implement long literal class.
20520         (IntLiteral): export the `Value' of the intliteral. 
20521
20522 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20523
20524         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20525
20526         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20527         instead of 'Operator'
20528
20529         * expression.cs (Binary::ResolveOperator): Update accordingly.
20530         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20531         and 'Minus'
20532
20533         * cs-parser.jay (unary_expression): Update to use the new names.
20534
20535         * gen-treedump.cs (GetUnary): Same here.
20536
20537         * expression.cs (Unary::Resolve): Implement.
20538         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20539         operators are found instead of making noise ;-)
20540         (Unary::ResolveOperator): New method to do precisely the same thing which
20541         Binary::ResolveOperator does for Binary expressions.
20542         (Unary.method, .Arguments): Add.
20543         (Unary::OperName): Implement.   
20544         (Unary::ForceConversion): Copy and Paste !
20545
20546         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20547         a unary operator.
20548
20549         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20550         for the inbuilt operators. Only overloading works for now ;-)
20551
20552 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20553
20554         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20555         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20556
20557         * expression.cs (This::Emit): Implement. 
20558         (This::Resolve): Implement.
20559         (TypeOf:Resolve): Implement.
20560         (Expression::ResolveSimpleName): Add an implicit this to instance
20561         field references. 
20562         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20563         Bind instance variable to Field expressions.
20564         (FieldExpr::Instance): New field used to track the expression that
20565         represents the object instance.
20566         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20567         binding 
20568         (FieldExpr::Emit): Implement.
20569
20570         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20571         the last instruction contains a return opcode to avoid generating
20572         the last `ret' instruction (this generates correct code, and it is
20573         nice to pass the peverify output).
20574
20575         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20576         initializer for static and instance variables.
20577         (Constructor::Emit): Allow initializer to be null in the case of
20578         static constructors.  Only emit initializer for instance
20579         constructors. 
20580
20581         (TypeContainer::FindMembers): Return a null array if there are no
20582         matches.
20583
20584         Also fix the code for the MemberTypes.Method branch, as it was not
20585         scanning that for operators (or tried to access null variables before).
20586
20587         * assign.cs (Assign::Emit): Handle instance and static fields. 
20588
20589         * TODO: Updated.
20590
20591         * driver.cs: Stop compilation if there are parse errors.
20592
20593         * cs-parser.jay (constructor_declaration): Provide default base
20594         initializer for non-static constructors.
20595         (constructor_declarator): Do not provide a default base
20596         initializers if none was specified.
20597         Catch the fact that constructors should not have parameters.
20598
20599         * class.cs: Do not emit parent class initializers for static
20600         constructors, that should be flagged as an error.
20601
20602 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20603
20604         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20605         Move back code into TypeContainer::Populate.
20606
20607 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20608
20609         * class.cs (TypeContainer::AddConstructor): Fix the check to
20610         compare against Name, not Basename. 
20611         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20612
20613         * cs-parser.jay : Update accordingly.
20614
20615         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20616         for methods, don't forget to look into the operators too.
20617         (RegisterMethodBuilder): Helper method to take care of this for
20618         methods, constructors and operators.
20619         (Operator::Define): Completely revamp.
20620         (Operator.OperatorMethod, MethodName): New fields.
20621         (TypeContainer::Populate): Move the registering of builders into
20622         RegisterMethodBuilder.
20623         (Operator::Emit): Re-write.
20624
20625         * expression.cs (Binary::Emit): Comment out code path to emit method
20626         invocation stuff for the case when we have a user defined operator. I am
20627         just not able to get it right !
20628
20629 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20630
20631         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20632         argument. 
20633
20634         (Expression::MemberLookup): Provide a version that allows to
20635         specify the MemberTypes and BindingFlags. 
20636
20637         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20638         so it was not fetching variable information from outer blocks.
20639
20640         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20641         Beforefieldinit as it was buggy.
20642
20643         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20644         that Ravi put here.  
20645
20646         * class.cs (Constructor::Emit): Only emit if block is not null.
20647         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20648         deal with this by semantically definining it as if the user had
20649         done it.
20650
20651         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20652         constructors as we now "emit" them at a higher level.
20653
20654         (TypeContainer::DefineDefaultConstructor): Used to define the
20655         default constructors if none was provided.
20656
20657         (ConstructorInitializer): Add methods Resolve and Emit. 
20658
20659         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20660
20661 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20662
20663         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20664         the default constructor builder with our hashtable for methodbuilders
20665         to methodcores.
20666
20667         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20668         and argument_count is 0 in which case we have a match.
20669         (Binary::ResolveOperator): More null checking and miscellaneous coding
20670         style cleanup.
20671
20672 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20673
20674         * rootcontext.cs (IsNameSpace): Compare against null.
20675
20676         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20677
20678         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20679         and Unary::Operator.
20680
20681         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20682         accordingly.
20683
20684         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20685         we have overloaded operators.
20686         (Binary::ResolveOperator): Implement the part which does the operator overload
20687         resolution.
20688
20689         * class.cs (Operator::Emit): Implement.
20690         (TypeContainer::Emit): Emit the operators we have too.
20691
20692         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20693         the case when we have a user-defined operator.
20694
20695 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20696
20697         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20698
20699 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20700
20701         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20702         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20703         (Constructor::Emit): Implement.
20704         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20705         if we have no work to do. 
20706         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20707         Emit method.
20708
20709         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20710         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20711
20712         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20713         of parent.parent.
20714
20715 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20716
20717         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20718         in the source.
20719         (Tree::RecordNamespace): Method to do what the name says ;-)
20720         (Tree::Namespaces): Property to get at the namespaces hashtable.
20721
20722         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20723         keep track.
20724
20725         * rootcontext.cs (IsNamespace): Fixed it :-)
20726
20727 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20728
20729         * class.cs (TypeContainer::FindMembers): Add support for
20730         constructors. 
20731         (MethodCore): New class that encapsulates both the shared aspects
20732         of a Constructor and a Method.  
20733         (Method, Constructor): Factored pieces into MethodCore.
20734
20735         * driver.cs: Added --fatal which makes errors throw exceptions.
20736         Load System assembly as well as part of the standard library.
20737
20738         * report.cs: Allow throwing exceptions on errors for debugging.
20739
20740         * modifiers.cs: Do not use `parent', instead use the real type
20741         container to evaluate permission settings.
20742
20743         * class.cs: Put Ravi's patch back in.  He is right, and we will
20744         have to cope with the
20745
20746 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20747
20748         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20749         FamORAssem, not FamANDAssem.
20750
20751 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20752
20753         * driver.cs: Added --parse option that only parses its input files
20754         and terminates.
20755
20756         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20757         incorrect.  IsTopLevel is not used to tell whether an object is
20758         root_types or not (that can be achieved by testing this ==
20759         root_types).  But to see if this is a top-level *class* (not
20760         necessarly our "toplevel" container). 
20761
20762 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20763
20764         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20765         parent instead of a direct call to GetType.
20766
20767 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20768
20769         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20770         Modifiers.TypeAttr. This should just be a call to that method.
20771
20772         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20773         object so that we can determine if we are top-level or not.
20774
20775         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20776         TypeContainer too.
20777
20778         * enum.cs (Enum::Define): Ditto.
20779
20780         * modifiers.cs (FieldAttr): Re-write.
20781
20782         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20783         (TypeContainer::HaveStaticConstructor): New property to provide access
20784         to precisely that info.
20785
20786         * modifiers.cs (MethodAttr): Re-write.
20787         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20788
20789         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20790         of top-level types as claimed.
20791
20792 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20793
20794         * expression.cs (MemberLookup): Fruitless attempt to lookup
20795         constructors.  Maybe I need to emit default constructors?  That
20796         might be it (currently .NET emits this for me automatically).
20797         (Invocation::OverloadResolve): Cope with Arguments == null.
20798         (Invocation::EmitArguments): new function, shared by the new
20799         constructor and us.
20800         (Invocation::Emit): Handle static and instance methods.  Emit
20801         proper call instruction for virtual or non-virtual invocations.
20802         (New::Emit): Implement.
20803         (New::Resolve): Implement.
20804         (MemberAccess:Resolve): Implement.
20805         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20806         to track instances.
20807         (FieldExpr::Resolve): Set type.
20808
20809         * support.cs: Handle empty arguments.
20810                 
20811         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20812         SimpleLookup): Auxiliary routines to help parse a qualifier
20813         identifier.  
20814
20815         Update qualifier_identifier rule.
20816
20817         * codegen.cs: Removed debugging messages.
20818
20819         * class.cs: Make this a global thing, this acts just as a "key" to
20820         objects that we might have around.
20821
20822         (Populate): Only initialize method_builders_to_methods once.
20823
20824         * expression.cs (PropertyExpr): Initialize type from the
20825         PropertyType. 
20826
20827         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20828         Resolve pattern.  Attempt to implicitly convert value to boolean.
20829         Emit code.
20830
20831         * expression.cs: Set the type for the int32/int32 argument case.
20832         (Binary::ResolveOperator): Set the return type to boolean for
20833         comparission operators
20834
20835         * typemanager.cs: Remove debugging print code.
20836
20837         (Invocation::Resolve): resolve type.
20838
20839         * class.cs: Allocate a MemberInfo of the correct size, as the code
20840         elsewhere depends on the test to reflect the correct contents.
20841
20842         (Method::) Keep track of parameters, due to System.Reflection holes
20843
20844         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20845         mapping here.
20846
20847         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20848         of the exact size and return that.
20849
20850         (Class::LookupMethodByBuilder): New function that maps
20851         MethodBuilders to its methods.  Required to locate the information
20852         on methods because System.Reflection bit us again.
20853
20854         * support.cs: New file, contains an interface ParameterData and
20855         two implementations: ReflectionParameters and InternalParameters
20856         used to access Parameter information.  We will need to grow this
20857         as required.
20858
20859         * expression.cs (Invocation::GetParameterData): implement a cache
20860         and a wrapper around the ParameterData creation for methods. 
20861         (Invocation::OverloadResolve): Use new code.
20862
20863 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20864
20865         * class.cs (TypeContainer::EmitField): Remove and move into 
20866         (Field::Define): here and modify accordingly.
20867         (Field.FieldBuilder): New member.
20868         (TypeContainer::Populate): Update accordingly.
20869         (TypeContainer::FindMembers): Implement.
20870
20871 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20872
20873         * statement.cs: (VariableInfo::VariableType): New field to be
20874         initialized with the full type once it is resolved. 
20875
20876 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20877
20878         * parameter.cs (GetParameterInfo): Use a type cache to compute
20879         things only once, and to reuse this information
20880
20881         * expression.cs (LocalVariableReference::Emit): Implement.
20882         (OpcodeCast::Emit): fix.
20883
20884         (ParameterReference::Resolve): Implement.
20885         (ParameterReference::Emit): Implement.
20886
20887         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20888         that are expressions need to stay as Expressions.
20889
20890         * typemanager.cs (CSharpName): Returns the C# name of a type if
20891         possible. 
20892
20893         * expression.cs (Expression::ConvertImplicit): New function that
20894         implements implicit type conversions.
20895
20896         (Expression::ImplicitReferenceConversion): Implements implicit
20897         reference conversions.
20898
20899         (EmptyCast): New type for transparent casts.
20900
20901         (OpcodeCast): New type for casts of types that are performed with
20902         a sequence of bytecodes.
20903
20904         (BoxedCast): New type used for casting value types into reference
20905         types.  Emits a box opcode.
20906
20907         (Binary::DoNumericPromotions): Implements numeric promotions of
20908         and computation of the Binary::Type.
20909
20910         (Binary::EmitBranchable): Optimization.
20911
20912         (Binary::Emit): Implement code emission for expressions.
20913
20914         * typemanager.cs (TypeManager): Added two new core types: sbyte
20915         and byte.
20916
20917 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20918
20919         * class.cs (TypeContainer::FindMembers): Method which does exactly
20920         what Type.FindMembers does, only we don't have to use reflection. No
20921         implementation yet.
20922
20923         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20924         typecontainer objects as we need to get at them.
20925         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20926
20927         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20928         typecontainer object.
20929
20930         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20931         of just a Report object.
20932
20933 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20934
20935         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20936         "remove_"
20937         (TypeContainer::Populate): Now define the delegates of the type too.
20938         (TypeContainer.Delegates): Property to access the list of delegates defined
20939         in the type.
20940
20941         * delegates.cs (Delegate::Define): Implement partially.
20942
20943         * modifiers.cs (TypeAttr): Handle more flags.
20944
20945 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20946
20947         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20948         and not <=
20949         (Operator::Define): Re-write logic to get types by using the LookupType method
20950         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20951         (Indexer::Define): Ditto.
20952         (Event::Define): Ditto.
20953         (Property::Define): Ditto.
20954
20955 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20956
20957         * class.cs (TypeContainer::Populate): Now define operators too. 
20958         (TypeContainer.Operators): New property to access the list of operators
20959         in a type.
20960         (Operator.OperatorMethodBuilder): New member to hold the method builder
20961         for the operator we are defining.
20962         (Operator::Define): Implement.
20963
20964 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20965
20966         * class.cs (Event::Define): Make the prefixes of the accessor methods
20967         addOn_ and removeOn_ 
20968
20969         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20970         of the location being passed in too. Ideally, this should go later since all
20971         error reporting should be done through the Report object.
20972
20973         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20974         (Populate): Iterate thru the indexers we have and define them too.
20975         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20976         for the get and set accessors.
20977         (Indexer::Define): Implement.
20978
20979 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20980
20981         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20982         my previous implementation, did not work.
20983
20984         * typemanager.cs: Add a couple of missing types (the longs).
20985
20986         * literal.cs: Use TypeManager.bool_type instead of getting it.
20987
20988         * expression.cs (EventExpr): New kind of expressions.
20989         (Expressio::ExprClassFromMemberInfo): finish
20990
20991 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20992
20993         * assign.cs: Emit stores to static fields differently.
20994
20995 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20996
20997         * Merge in changes and adjust code to tackle conflicts. Backed out my
20998         code in Assign::Resolve ;-) 
20999
21000 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21001
21002         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21003         instead Report.Error and also pass in the location.
21004         (CSharpParser::Lexer): New readonly property to return the reference
21005         to the Tokenizer object.
21006         (declare_local_variables): Use Report.Error with location instead of plain 
21007         old error.
21008         (CheckDef): Ditto.
21009
21010         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21011         (Operator.CheckBinaryOperator): Ditto.
21012
21013         * cs-parser.jay (operator_declarator): Update accordingly.
21014
21015         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21016         (CheckBinaryOperator): Same here.
21017
21018         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21019         on the name without any prefixes of namespace names etc. This is because we
21020         already might have something already fully qualified like 
21021         'System.Console.WriteLine'
21022
21023         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21024
21025 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21026
21027         * cs-tokenizer.cs (location): Return a string which also contains
21028         the file name.
21029
21030         * expression.cs (ElementAccess): New class for expressions of the
21031         type 'element access.'
21032         (BaseAccess): New class for expressions of the type 'base access.'
21033         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21034         respectively.
21035
21036         * cs-parser.jay (element_access): Implement action.
21037         (base_access): Implement actions.
21038         (checked_expression, unchecked_expression): Implement.
21039
21040         * cs-parser.jay (local_variable_type): Correct and implement.
21041         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21042
21043         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21044
21045         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21046         name and the specifiers.
21047
21048         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21049
21050         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21051         making them all public ;-)
21052
21053         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21054         class anyways.
21055
21056 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21057
21058         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21059         PropertyExprs.
21060         (FieldExpr, PropertyExprs): New resolved expressions.
21061         (SimpleName::MemberStaticCheck): Perform static checks for access
21062         to non-static fields on static methods. Maybe this should be
21063         generalized for MemberAccesses. 
21064         (SimpleName::ResolveSimpleName): More work on simple name
21065         resolution. 
21066
21067         * cs-parser.jay (primary_expression/qualified_identifier): track
21068         the parameter index.
21069
21070         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21071         (EmitContext::EmitBoolExpression): Chain to expression generation
21072         instead of temporary hack.
21073         (::EmitStatementExpression): Put generic expression code generation.
21074
21075         * assign.cs (Assign::Emit): Implement variable assignments to
21076         local variables, parameters and fields.
21077
21078 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21079
21080         * statement.cs (Block::GetVariableInfo): New method, returns the
21081         VariableInfo for a variable name in a block.
21082         (Block::GetVariableType): Implement in terms of GetVariableInfo
21083
21084         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21085         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21086
21087 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21088
21089         * cs-parser.jay (operator_declaration): Continue on my quest : update
21090         to take attributes argument.
21091         (event_declaration): Ditto.
21092         (enum_declaration): Ditto.
21093         (indexer_declaration): Ditto.
21094
21095         * class.cs (Operator::Operator): Update constructor accordingly.
21096         (Event::Event): Ditto.
21097
21098         * delegate.cs (Delegate::Delegate): Same here.
21099
21100         * enum.cs (Enum::Enum): Same here.
21101
21102 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21103
21104         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21105
21106         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21107
21108         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21109         being passed around as an arraylist.
21110         (Attributes::AddAttribute): Method to add attribute sections.
21111
21112         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21113         (struct_declaration): Update accordingly.
21114         (constant_declaration): Update.
21115         (field_declaration): Update.
21116         (method_header): Update.
21117         (fixed_parameter): Update.
21118         (parameter_array): Ditto.
21119         (property_declaration): Ditto.
21120         (destructor_declaration): Ditto.
21121
21122         * class.cs (Struct::Struct): Update constructors accordingly.
21123         (Class::Class): Ditto.
21124         (Field::Field): Ditto.
21125         (Method::Method): Ditto.
21126         (Property::Property): Ditto.
21127         (TypeContainer::OptAttribute): update property's return type.
21128
21129         * interface.cs (Interface.opt_attributes): New member.
21130         (Interface::Interface): Update to take the extra Attributes argument.
21131
21132         * parameter.cs (Parameter::Parameter): Ditto.
21133
21134         * constant.cs (Constant::Constant): Ditto.
21135
21136         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21137         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21138         the attributes as a parameter.
21139         (InterfaceProperty): Update constructor call.
21140         (InterfaceEvent): Ditto.
21141         (InterfaceMethod): Ditto.
21142         (InterfaceIndexer): Ditto.
21143
21144         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21145         pass the attributes too.
21146         (interface_event_declaration): Ditto.
21147         (interface_property_declaration): Ditto.
21148         (interface_method_declaration): Ditto.
21149         (interface_declaration): Ditto.
21150
21151 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21152
21153         * class.cs (Method::Define): Track the "static Main" definition to
21154         create an entry point. 
21155
21156         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21157         EntryPoint if we find it. 
21158
21159         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21160         (EmitContext::ig): Make this variable public.
21161
21162         * driver.cs: Make the default output file be the first file name
21163         with the .exe extension.  
21164
21165         Detect empty compilations
21166
21167         Handle various kinds of output targets.  Handle --target and
21168         rename -t to --dumper.
21169
21170         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21171         methods inherited from Expression return now an Expression.  This
21172         will is used during the tree rewriting as we resolve them during
21173         semantic analysis.
21174
21175         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21176         the spec.  Missing entirely is the information about
21177         accessability of elements of it.
21178
21179         (Expression::ExprClassFromMemberInfo): New constructor for
21180         Expressions that creates a fully initialized Expression based on
21181         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21182         a Type.
21183
21184         (Invocation::Resolve): Begin implementing resolution of invocations.
21185
21186         * literal.cs (StringLiteral):  Implement Emit.
21187
21188 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21189
21190         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21191         member.
21192
21193 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21194
21195         * cs-parser.jay (attribute_arguments): Implement actions.
21196         (attribute): Fix bug in production. Implement action.
21197         (attribute_list): Implement.
21198         (attribute_target): Implement.
21199         (attribute_target_specifier, opt_target_specifier): Implement
21200         (CheckAttributeTarget): New method to check if the attribute target
21201         is valid.
21202         (attribute_section): Implement.
21203         (opt_attributes): Implement.
21204
21205         * attribute.cs : New file to handle attributes.
21206         (Attribute): Class to hold attribute info.
21207
21208         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21209         (attribute_section): Modify production to use 2 different rules to 
21210         achieve the same thing. 1 s/r conflict down !
21211         Clean out commented, useless, non-reducing dimension_separator rules.
21212
21213         * class.cs (TypeContainer.attributes): New member to hold list
21214         of attributes for a type.
21215         (Struct::Struct): Modify to take one more argument, the attribute list.
21216         (Class::Class): Ditto.
21217         (Field::Field): Ditto.
21218         (Method::Method): Ditto.
21219         (Property::Property): Ditto.
21220
21221         * cs-parser.jay (struct_declaration): Update constructor call to
21222         pass in the attributes too.
21223         (class_declaration): Ditto.
21224         (constant_declaration): Ditto.
21225         (field_declaration): Ditto.
21226         (method_header): Ditto.
21227         (fixed_parameter): Ditto.
21228         (parameter_array): Ditto.
21229         (property_declaration): Ditto.
21230
21231         * constant.cs (Constant::Constant): Update constructor similarly.
21232         Use System.Collections.
21233
21234         * parameter.cs (Parameter::Parameter): Update as above.
21235
21236 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21237
21238         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21239         (TypeContainer.delegates): New member to hold list of delegates.
21240
21241         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21242         this time as I seem to be on crack ;-)
21243
21244 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21245
21246         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21247         tell whether an identifier represents a namespace.
21248
21249         * expression.cs (NamespaceExpr): A namespace expression, used only
21250         temporarly during expression resolution.
21251         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21252         utility functions to resolve names on expressions.
21253
21254 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * codegen.cs: Add hook for StatementExpressions. 
21257
21258         * class.cs: Fix inverted test for static flag in methods.
21259
21260 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21261
21262         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21263         to make it coincide with MS' number.
21264         (Operator::CheckBinaryOperator): Ditto.
21265
21266         * ../errors/errors.txt : Remove error numbers added earlier.
21267
21268         * ../errors/cs1019.cs : Test case for error # 1019
21269
21270         * ../errros/cs1020.cs : Test case for error # 1020
21271
21272         * cs-parser.jay : Clean out commented cruft.
21273         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21274         used anywhere - non-reducing rule.
21275         (namespace_declarations): Non-reducing rule - comment out.
21276
21277         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21278         with TypeContainer::AddEnum.
21279
21280         * delegate.cs : New file for delegate handling classes.
21281         (Delegate): Class for declaring delegates.
21282
21283         * makefile : Update.
21284
21285         * cs-parser.jay (delegate_declaration): Implement.
21286
21287 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21288
21289         * class.cs (Event::Define): Implement.
21290         (Event.EventBuilder): New member.
21291
21292         * class.cs (TypeContainer::Populate): Update to define all enums and events
21293         we have.
21294         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21295         readonly fields for all these cases ?
21296
21297 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21298
21299         * class.cs (Property): Revamp to use the convention of making fields readonly.
21300         Accordingly modify code elsewhere.
21301
21302         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21303         the Define method of the Property class.
21304
21305         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21306         trivial bug.
21307         (TypeContainer::Populate): Update to define all the properties we have. Also
21308         define all enumerations.
21309
21310         * enum.cs (Define): Implement.
21311
21312 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21313
21314         * cs-parser.jay (overloadable_operator): The semantic value is an
21315         enum of the Operator class.
21316         (operator_declarator): Implement actions.
21317         (operator_declaration): Implement.
21318
21319         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21320         validity of definitions.
21321         (Operator::CheckBinaryOperator): Static method to check for binary operators
21322         (TypeContainer::AddOperator): New method to add an operator to a type.
21323
21324         * cs-parser.jay (indexer_declaration): Added line to actually call the
21325         AddIndexer method so it gets added ;-)
21326
21327         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21328         already taken care of by the MS compiler ?  
21329
21330 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21331
21332         * class.cs (Operator): New class for operator declarations.
21333         (Operator::OpType): Enum for the various operators.
21334
21335 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21336
21337         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21338         ostensibly handle this in semantic analysis.
21339
21340         * cs-parser.jay (general_catch_clause): Comment out
21341         (specific_catch_clauses, specific_catch_clause): Ditto.
21342         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21343         (catch_args, opt_catch_args): New productions.
21344         (catch_clause): Rewrite to use the new productions above
21345         (catch_clauses): Modify accordingly.
21346         (opt_catch_clauses): New production to use in try_statement
21347         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21348         and re-write the code in the actions to extract the specific and
21349         general catch clauses by being a little smart ;-)
21350
21351         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21352         Hooray, try and catch statements parse fine !
21353
21354 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21355
21356         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21357         string from the hashtable of variables.
21358
21359         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21360         I end up making that mistake ;-)
21361         (catch_clauses): Fixed gross error which made Key and Value of the 
21362         DictionaryEntry the same : $1 !!
21363
21364 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21365
21366         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21367
21368         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21369         when the add and remove accessors are specified. 
21370
21371 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21372
21373         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21374         information about indexer_declarator.
21375         (indexer_declarator): Implement actions.
21376         (parsing_indexer): New local boolean used to keep track of whether
21377         we are parsing indexers or properties. This is necessary because 
21378         implicit_parameters come into picture even for the get accessor in the 
21379         case of an indexer.
21380         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21381
21382         * class.cs (Indexer): New class for indexer declarations.
21383         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21384         (TypeContainer::indexers): New member to hold list of indexers for the
21385         type.
21386
21387 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21388
21389         * cs-parser.jay (add_accessor_declaration): Implement action.
21390         (remove_accessor_declaration): Implement action.
21391         (event_accessors_declaration): Implement
21392         (variable_declarators): swap statements for first rule - trivial.
21393
21394         * class.cs (Event): New class to hold information about event
21395         declarations.
21396         (TypeContainer::AddEvent): New method to add an event to a type
21397         (TypeContainer::events): New member to hold list of events.
21398
21399         * cs-parser.jay (event_declaration): Implement actions.
21400
21401 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21402
21403         * cs-parser.jay (dim_separators): Implement. Make it a string
21404         concatenating all the commas together, just as they appear.
21405         (opt_dim_separators): Modify accordingly
21406         (rank_specifiers): Update accordingly. Basically do the same
21407         thing - instead, collect the brackets here.
21408         (opt_rank_sepcifiers): Modify accordingly.
21409         (array_type): Modify to actually return the complete type string
21410         instead of ignoring the rank_specifiers.
21411         (expression_list): Implement to collect the expressions
21412         (variable_initializer): Implement. We make it a list of expressions
21413         essentially so that we can handle the array_initializer case neatly too.
21414         (variable_initializer_list): Implement.
21415         (array_initializer): Make it a list of variable_initializers
21416         (opt_array_initializer): Modify accordingly.
21417
21418         * expression.cs (New::NType): Add enumeration to help us
21419         keep track of whether we have an object/delegate creation
21420         or an array creation.
21421         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21422         members to hold data about array creation.
21423         (New:New): Modify to update NewType
21424         (New:New): New Overloaded contructor for the array creation
21425         case.
21426
21427         * cs-parser.jay (array_creation_expression): Implement to call
21428         the overloaded New constructor.
21429
21430 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21431
21432         * class.cs (TypeContainer::Constructors): Return member
21433         constructors instead of returning null.
21434
21435 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21436
21437         * typemanager.cs (InitCoreTypes): Initialize the various core
21438         types after we have populated the type manager with the user
21439         defined types (this distinction will be important later while
21440         compiling corlib.dll)
21441
21442         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21443         on Expression Classification.  Now all expressions have a method
21444         `Resolve' and a method `Emit'.
21445
21446         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21447         generation from working.     Also add some temporary debugging
21448         code. 
21449
21450 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21451
21452         * codegen.cs: Lots of code generation pieces.  This is only the
21453         beginning, will continue tomorrow with more touches of polish.  We
21454         handle the fundamentals of if, while, do, for, return.  Others are
21455         trickier and I need to start working on invocations soon.
21456
21457         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21458         s.InitStatement. 
21459
21460         * codegen.cs (EmitContext): New struct, used during code
21461         emission to keep a context.   Most of the code generation will be
21462         here. 
21463
21464         * cs-parser.jay: Add embedded blocks to the list of statements of
21465         this block.  So code generation proceeds in a top down fashion.
21466
21467 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21468
21469         * statement.cs: Add support for multiple child blocks.
21470
21471 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21472
21473         * codegen.cs (EmitCode): New function, will emit the code for a
21474         Block of code given a TypeContainer and its ILGenerator. 
21475
21476         * statement.cs (Block): Standard public readonly optimization.
21477         (Block::Block constructors): Link children. 
21478         (Block::Child): Child Linker.
21479         (Block::EmitVariables): Emits IL variable declarations.
21480
21481         * class.cs: Drop support for MethodGroups here, delay until
21482         Semantic Analysis.
21483         (Method::): Applied the same simplification that I did before, and
21484         move from Properties to public readonly fields.
21485         (Method::ParameterTypes): Returns the parameter types for the
21486         function, and implements a cache that will be useful later when I
21487         do error checking and the semantic analysis on the methods is
21488         performed.
21489         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21490         and made a method, optional argument tells whether this is a class
21491         or a structure to apply the `has-this' bit.
21492         (Method::GetCallingConvention): Implement, returns the calling
21493         convention. 
21494         (Method::Define): Defines the type, a second pass is performed
21495         later to populate the methods.
21496
21497         (Constructor::ParameterTypes): implement a cache similar to the
21498         one on Method::ParameterTypes, useful later when we do semantic
21499         analysis. 
21500
21501         (TypeContainer::EmitMethod):  New method.  Emits methods.
21502
21503         * expression.cs: Removed MethodGroup class from here.
21504
21505         * parameter.cs (Parameters::GetCallingConvention): new method.
21506
21507 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21508
21509         * class.cs (TypeContainer::Populate): Drop RootContext from the
21510         argument. 
21511
21512         (Constructor::CallingConvention): Returns the calling convention.
21513         (Constructor::ParameterTypes): Returns the constructor parameter
21514         types. 
21515
21516         (TypeContainer::AddConstructor): Keep track of default constructor
21517         and the default static constructor.
21518
21519         (Constructor::) Another class that starts using `public readonly'
21520         instead of properties. 
21521
21522         (Constructor::IsDefault): Whether this is a default constructor. 
21523
21524         (Field::) use readonly public fields instead of properties also.
21525
21526         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21527         track of static constructors;  If none is used, turn on
21528         BeforeFieldInit in the TypeAttributes. 
21529
21530         * cs-parser.jay (opt_argument_list): now the return can be null
21531         for the cases where there are no arguments. 
21532
21533         (constructor_declarator): If there is no implicit `base' or
21534         `this', then invoke the default parent constructor. 
21535
21536         * modifiers.cs (MethodAttr): New static function maps a set of
21537         modifiers flags into a MethodAttributes enum
21538         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21539         MethodAttr, TypeAttr to represent the various mappings where the
21540         modifiers are used.
21541         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21542
21543 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21546         method arguments.
21547
21548         * interface.cs (PopulateIndexer): Implemented the code generator
21549         for interface indexers.
21550
21551 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21552
21553         * interface.cs (InterfaceMemberBase): Now we track the new status
21554         here.  
21555
21556         (PopulateProperty): Implement property population.  Woohoo!  Got
21557         Methods and Properties going today. 
21558
21559         Removed all the properties for interfaces, and replaced them with
21560         `public readonly' fields. 
21561
21562 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21563
21564         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21565         initialize their hashtables/arraylists only when they are needed
21566         instead of doing this always.
21567
21568         * parameter.cs: Handle refs and out parameters.
21569
21570         * cs-parser.jay: Use an ArrayList to construct the arguments
21571         instead of the ParameterCollection, and then cast that to a
21572         Parameter[] array.
21573
21574         * parameter.cs: Drop the use of ParameterCollection and use
21575         instead arrays of Parameters.
21576
21577         (GetParameterInfo): Use the Type, not the Name when resolving
21578         types. 
21579
21580 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21581
21582         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21583         and instead use public readonly fields.
21584
21585         * class.cs: Put back walking code for type containers.
21586
21587 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21588
21589         * class.cs (MakeConstant): Code to define constants.
21590
21591         * rootcontext.cs (LookupType): New function.  Used to locate types 
21592
21593
21594 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21595
21596         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21597         this System.Reflection code is.  Kudos to Microsoft
21598
21599         * typemanager.cs: Implement a type cache and avoid loading all
21600         types at boot time.  Wrap in LookupType the internals.  This made
21601         the compiler so much faster.  Wow.  I rule!
21602
21603         * driver.cs: Make sure we always load mscorlib first (for
21604         debugging purposes, nothing really important).
21605
21606         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21607         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21608
21609         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21610         on namespaces that have been imported using the `using' keyword.
21611
21612         * class.cs (TypeContainer::TypeAttr): Virtualize.
21613         (Class::TypeAttr): Return attributes suitable for this bad boy.
21614         (Struct::TypeAttr): ditto.
21615         Handle nested classes.
21616         (TypeContainer::) Remove all the type visiting code, it is now
21617         replaced with the rootcontext.cs code
21618
21619         * rootcontext.cs (GetClassBases): Added support for structs. 
21620
21621 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * interface.cs, statement.cs, class.cs, parameter.cs,
21624         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21625         Drop use of TypeRefs, and use strings instead.
21626
21627 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * rootcontext.cs: 
21630
21631         * class.cs (Struct::Struct): set the SEALED flags after
21632         checking the modifiers.
21633         (TypeContainer::TypeAttr): new property, returns the
21634         TypeAttributes for a class.  
21635
21636         * cs-parser.jay (type_list): Oops, list production was creating a
21637         new list of base types.
21638
21639         * rootcontext.cs (StdLib): New property.
21640         (GetInterfaceTypeByName): returns an interface by type name, and
21641         encapsulates error handling here.
21642         (GetInterfaces): simplified.
21643         (ResolveTree): Encapsulated all the tree resolution here.
21644         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21645         types. 
21646
21647         * driver.cs: Add support for --nostdlib, to avoid loading the
21648         default assemblies.
21649         (Main): Do not put tree resolution here. 
21650
21651         * rootcontext.cs: Beginning of the class resolution.
21652
21653 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * rootcontext.cs: Provide better error reporting. 
21656
21657         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21658
21659         * rootcontext.cs (CreateInterface): Handle the case where there
21660         are no parent interfaces.
21661
21662         (CloseTypes): Routine to flush types at the end.
21663         (CreateInterface): Track types.
21664         (GetInterfaces): Returns an array of Types from the list of
21665         defined interfaces.
21666
21667         * typemanager.c (AddUserType): Mechanism to track user types (puts
21668         the type on the global type hash, and allows us to close it at the
21669         end). 
21670
21671 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21674         RecordInterface instead.
21675
21676         * cs-parser.jay: Updated to reflect changes above.
21677
21678         * decl.cs (Definition): Keep track of the TypeBuilder type that
21679         represents this type here.  Not sure we will use it in the long
21680         run, but wont hurt for now.
21681
21682         * driver.cs: Smaller changes to accomodate the new code.
21683
21684         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21685         when done. 
21686
21687         * rootcontext.cs (CreateInterface):  New method, used to create
21688         the System.TypeBuilder type for interfaces.
21689         (ResolveInterfaces): new entry point to resolve the interface
21690         hierarchy. 
21691         (CodeGen): Property, used to keep track of the code generator.
21692
21693 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21694
21695         * cs-parser.jay: Add a second production for delegate_declaration
21696         with `VOID'.
21697
21698         (enum_body): Put an opt_comma here instead of putting it on
21699         enum_body or enum_member_declarations so we can handle trailing
21700         commas on enumeration members.  Gets rid of a shift/reduce.
21701
21702         (type_list): Need a COMMA in the middle.
21703
21704         (indexer_declaration): Tell tokenizer to recognize get/set
21705
21706         * Remove old targets.
21707
21708         * Re-add the parser target.
21709
21710 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21711
21712         * cs-parser.jay: Add precendence rules for a number of operators
21713         ot reduce the number of shift/reduce conflicts in the grammar.
21714
21715 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21716
21717         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21718         and put it here.
21719
21720         Get rid of old crufty code.
21721
21722         * rootcontext.cs: Use this to keep track of the parsed
21723         representation and the defined types available to the program. 
21724
21725         * gen-treedump.cs: adjust for new convention.
21726
21727         * type.cs: Split out the type manager, and the assembly builder
21728         from here. 
21729
21730         * typemanager.cs: the type manager will live here now.
21731
21732         * cil-codegen.cs: And the code generator here. 
21733
21734 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21735
21736         * makefile: Fixed up for easy making.
21737
21738 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21739
21740         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21741         the 
21742
21743         (unary_expression): Expand pre_increment_expression and
21744         post_decrement_expression to reduce a shift/reduce.
21745
21746 2001-07-11  Simon Cozens
21747
21748         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21749
21750         Improve allow_keyword_as_indent name.
21751
21752 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21753
21754         * Adjustments for Beta2. 
21755
21756 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21757
21758         * decl.cs: Added `Define' abstract method.
21759         (InTransit): new property, used to catch recursive definitions. 
21760
21761         * interface.cs: Implement `Define'. 
21762
21763         * modifiers.cs: Map Modifiers.constants to
21764         System.Reflection.TypeAttribute flags.
21765
21766         * class.cs: Keep track of types and user-defined types.
21767         (BuilderInit): New method for creating an assembly
21768         (ResolveType): New function to launch the resolution process, only
21769         used by interfaces for now.
21770
21771         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21772         that are inserted into the name space. 
21773
21774 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21775
21776         * ARGH.  I have screwed up my tree so many times due to the use of
21777         rsync rather than using CVS.  Going to fix this at once. 
21778
21779         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21780         load types.
21781
21782 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21783
21784         * Experiment successful: Use System.Type rather that our own
21785         version of Type.  
21786
21787 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21788
21789         * cs-parser.jay: Removed nsAliases from here.
21790
21791         Use new namespaces, handle `using XXX;' 
21792
21793         * namespace.cs: Reimplemented namespace handling, use a recursive
21794         definition of the class.  Now we can keep track of using clauses
21795         and catch invalid using clauses.
21796
21797 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21798
21799         * gen-treedump.cs: Adapted for all the renaming.
21800
21801         * expression.cs (Expression): this class now has a Type property
21802         which returns an expression Type.
21803
21804         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21805         `Type', as this has a different meaning now in the base
21806
21807 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21808
21809         * interface.cs, class.cs: Removed from all the sources the
21810         references to signature computation, as we can not do method
21811         signature computation during the parsing time, as we are not
21812         trying to solve at that point distinguishing:
21813
21814         class X {
21815                 void a (Blah x) {}
21816                 void a (NS.Blah x) {}
21817         }
21818
21819         Which depending on the context might be valid or not, as we do not
21820         know if Blah is the same thing as NS.Blah at that point.
21821
21822         * Redid everything so the code uses TypeRefs now instead of
21823         Types.  TypeRefs are just temporary type placeholders, that need
21824         to be resolved.  They initially have a pointer to a string and the
21825         current scope in which they are used.  This is used later by the
21826         compiler to resolve the reference to an actual Type. 
21827
21828         * DeclSpace is no longer a CIR.Type, and neither are
21829         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21830         are all DeclSpaces, but no Types. 
21831
21832         * type.cs (TypeRefManager): This implements the TypeRef manager,
21833         which keeps track of all the types that need to be resolved after
21834         the parsing has finished. 
21835
21836 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21837
21838         * ARGH.  We are going to have to store `foreach' as a class rather
21839         than resolving it, as we need to verify error 1579 after name
21840         resolution.   *OR* we could keep a flag that says `This request to
21841         IEnumerator comes from a foreach statement' which we can then use
21842         to generate the error.
21843
21844 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * class.cs (TypeContainer.AddMethod): we now add methods to the
21847         MethodGroup instead of the method hashtable.  
21848
21849         * expression.cs: Add MethodGroup abstraction, which gets us one
21850         step closer to the specification in the way we handle method
21851         declarations.  
21852
21853         * cs-parser.jay (primary_expression): qualified_identifier now
21854         tried to match up an identifier to a local variable reference or
21855         to a parameter reference.
21856
21857         current_local_parameters is now a parser global variable that
21858         points to the current parameters for the block, used during name
21859         lookup.
21860
21861         (property_declaration): Now creates an implicit `value' argument to
21862         the set accessor.
21863
21864 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21865
21866         * parameter.cs: Do not use `param' arguments as part of the
21867         signature, per the spec.
21868
21869 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21870
21871         * decl.cs: Base class for classes, structs and interfaces.  This
21872         is the "Declaration Space" 
21873
21874         * cs-parser.jay: Use CheckDef for checking declaration errors
21875         instead of having one on each function.
21876
21877         * class.cs: Factor out some code for handling error handling in
21878         accordance to the "Declarations" section in the "Basic Concepts"
21879         chapter in the ECMA C# spec.
21880
21881         * interface.cs: Make all interface member classes derive from
21882         InterfaceMemberBase.
21883
21884 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21885
21886         * Many things: all interfaces are parsed and generated in
21887         gen-treedump.  Support for member variables, constructors,
21888         destructors, properties, constants is there.
21889
21890         Beginning of the IL backend, but very little done, just there for
21891         testing purposes. 
21892
21893 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21894
21895         * cs-parser.jay: Fix labeled statement.
21896
21897         * cs-tokenizer.cs (escape): Escape " and ' always.
21898         ref_line, ref_name: keep track of the line/filename as instructed
21899         by #line by the compiler.
21900         Parse #line.
21901
21902 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21903
21904         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21905         to match the values in System.CodeDOM.
21906
21907         Divid renamed to Divide.
21908
21909         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21910         statements. 
21911         (Statements.set): remove.
21912
21913         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21914         statements. 
21915
21916         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21917         falseStatements always have valid values. 
21918
21919         * cs-parser.jay: Use System.CodeDOM now.
21920