In mcs:
[mono.git] / mcs / mcs / ChangeLog
1 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2
3         * anonymous.cs: Have the param code handle leaving copies on the
4         stack etc. Allows anonymous params to take part in the assignment
5         code (++, +=, etc). Fixes bug #76550
6
7         * expression.cs: Handle the prepare_for_load/leave_copy by passing
8         it down to the anon code.
9
10         * iterators.cs: Use dummy var here
11
12         * codegen.cs: Handle new vars
13
14 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
15
16         Fix #76849.
17         * class.cs (MethodData.Define): Set proper Obsolete context.
18
19         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
20         obsolete context.
21         (FieldExpr.DoResolve): Ditto.
22
23 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
24
25         Fix #76849.
26         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
27         parent is not obsolete.
28
29 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
30
31         * doc.cs : (FindDocumentedMember) find parameterless members first
32           and get CS0419 in the early stage. Fixed first case of bug #76727.
33
34 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
35
36         Fix #76859.
37         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
38         no error was reported.
39
40         *expression.cs (Binary.DoResolve): left can be null.
41
42 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
43
44         Fix #76783.
45         * class.cs (MethodData.Emit): Parameters should be labeled first.
46
47 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
48
49         Fix #76761.
50         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
51
52 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
53
54         * attribute.cs (AreParametersCompliant): Moved to Parameter.
55
56         * class.cs (MethodCore): Parameter clean up.
57         (IMethodData): Added ParameterInfo.
58         (MethodData): Parameter clean up.
59         (Indexer.Define): Parameter clean up.
60
61         * anonymous.cs,
62         * codegen.cs,
63         * cs-parser.jay,
64         * decl.cs,
65         * doc.cs,
66         * ecore.cs,
67         * flowanalysis.cs,
68         * iterators.cs,
69         * pending.cs,
70         * statement.cs,
71         * typemanager.cs: Parameter clean up.
72
73         * delegate.cs (Define): Get rid of duplicated code.
74
75         * expression.cs (ParameterReference): Removed useless parameters
76         and simplified.
77         (Invocation): Ditto.
78
79         * parameter.cs (ParamsParameter): New class, params specialization.
80         (ArglistParameter): Attemp to separate arglist.
81         (Parameter): Refactored to be reusable and faster.
82         (Parameter.Modifier): Made understandable.
83         (Parameters): Changed to be used as a class for `this' assembly
84         parameters. Refactored to use new specialized classes.
85
86         * support.cs (ParameterData): Added Types property.
87         (InternalParameters): Deleted.
88
89 2005-08-20  Martin Baulig  <martin@ximian.com>
90
91         Merging this patch from GMCS to fix #75867.
92
93         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
94         scope if we don't already have it.
95
96 2005-11-17  Martin Baulig  <martin@ximian.com>
97
98         * anonymous.cs
99         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
100         inherit the scope from our parent.  Fixes #76653.
101
102 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
103
104         * doc.cs : the previous patch does not actually fix the bug.
105           PropertyInfo override check is now implemented and really fixed it.
106         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
107
108 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
109
110         * doc.cs : apply "override filter" also to properties.
111           Fixed bug #76730.
112
113 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
114
115         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
116           no need to check overrides. For classes, omit those results from 
117           interfaces since they must exist in the class. Fixed bug #76726.
118
119 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
120
121         * typemanager.cs : (GetFullNameSignature) differentiate indexers
122           with different parameters. Fixed the second problem in #76685.
123
124 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
125
126         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
127           get expected 'protected' access in CheckValidFamilyAccess()).
128           Fixed bug #76692.
129
130 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
131
132         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
133           Fixed bug #76705.  CS1569 was incorrectly commented out.
134
135 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
136
137         * doc.cs : use Invocation.IsOverride() to do real override check.
138         * expression.cs : made Invocation.IsOverride() internal.
139
140 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
141
142         * doc.cs : use TypeManager.FindMembers() instead of (possible)
143           TypeBuilder.FindMembers() and filter overriden base members out.
144           Fixed bug #76990.
145
146 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
147
148         * doc.cs : ref/out parameters are represented as '@' (instead of
149           '&' in type FullName). Fixed bug #76630 (additionally crefs).
150
151 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
152
153         * doc.cs : when there was no '.' in cref to methods in doc comment,
154           then parameters were missing in the output. Fixed bug #76691.
155
156 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
157
158         * driver.cs : don't output docs when there is an error.
159           Fixed bug #76693.
160
161 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
162
163         * doc.cs :
164           Now it should detect indexers. Fixed primary concern in bug #76685.
165           Fixed CS0419 message to not show the identical member signature in
166           the message.
167
168 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
169
170         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
171           instead of Type.FindMembers() since it does not handle events.
172           Fixed bug #71604.
173
174 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
175
176         * codegen.cs: Fixed typo (speficied -> specified).
177
178 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
179
180         Fix #76369.
181         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
182
183 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
184
185         * attribute.cs: Changed error message.
186
187         * cs-tokenizer.cs: One more check.
188
189 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
190
191         * statement.cs (Block.Resolve): Ignore empty statement.
192
193 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
194
195         * report.cs: Made error/warning methods more strict to avoid
196         their misuse.
197
198         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
199         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
200         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
201         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
202
203 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
204
205         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
206         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
207
208         * class.cs (TypeContainer.IsComImport): New property.
209         (Constructor.Define): Create proper ctor for ComImport types.
210
211         * expression.cs (New.CheckComImport): Fixed.
212
213 2005-11-07  Miguel de Icaza  <miguel@novell.com>
214
215         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
216         that a parameter has been captured does not mean that we do not
217         have to do the rest of the processing.  This fixes the second part
218         of #76592.  If there was another anonymous method capturing
219         values in the past, the Scope would never be set for the second
220         method that captured the same parameter.
221
222         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
223         properly manipulate the stack.   Second part of fix for #76592.
224
225         * expression.cs (New): Add support for invoking "new" on
226         interfaces that have been flagged with the ComImport attribute and
227         the CoClass.  Fixes #76637 
228
229         * statement.cs (Try.DoEmit): When a variable is captured, do not
230         try to emit the vi.LocalBuilder variable as it has been captured.
231         Create a temporary variable and store the results on the
232         FieldBuilder.  Fixes #76642
233
234 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
235
236         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
237
238         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
239
240         * expression.cs (Binary.DoResolve): Added && optimalization.
241     
242         * typemanager.cs (AddUserType): Removed useless argument.
243
244 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
245
246         * statement.cs (Block.variables): Uses ListDictionary.
247
248 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
249
250         Fix #75969.
251         * class.cs (PartialContainer.EmitType): Customized to emit
252         security attributes.
253         (ClassPart.ApplyAttributeBuilder): Transform security attribute
254         for partial classes.
255
256 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
257
258         Fix #76599.
259         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
260         access has to be fixed.
261         
262         * typemanager.cs (IsUnmanagedType): Wrong common field type.
263
264 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
265
266         Fix #76590.
267         * ecore.cs (NullCast.Reduce): Implemented.
268
269         * expression.cs (ArrayCreation.CheckIndices): Correcly check
270         constant type.
271         
272         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
273         properly.
274         (Foreach.Resolve): Catch null properly.
275
276 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
277  
278         * cs-tokenizer.cs: Warning text fix.
279
280         * driver.cs: AllWarningNumbers exposed on public interface.
281
282         * report.cs (): Reviewed warning numbers.
283         (IsValidWarning): Use binary search.
284
285 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
286  
287         * driver.cs: Implemeted resource visibility.
288         (Resources): New class for code sharing between /res: and
289         /linkres:
290  
291 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
292
293         Fix #76568.
294         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
295         folding.
296         
297         * convert (Convert.ImplicitReferenceConversion): NullCast holds
298         contants only.
299         
300         * ecore.cs (NullCast): Child is contant only.
301         
302         * literal.cs (NullLiteral.Reduce): null can be converted to any
303         reference type.
304
305 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
306
307         * driver.cs: Use Encoding.Default as default code page instead
308           of ISO-28591.
309
310 2005-10-27  Raja R Harinath  <rharinath@novell.com>
311
312         Fix #76085.
313         * expression.cs (Invocation.Error_InvalidArguments): Handle
314         __arglist parameters.
315         (Invocation.VerifyArgumentsCompat): Likewise.
316         * support.cs (ReflectionParameters.GetSignatureForError): Print
317         __arglist parameters.
318         (InternalParamters.GetSignatureForError): Likewise.
319         * parameter.cs (Parameters.GetSignatureForError): Likewise.
320
321 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
322
323         * attribute.cs (GetPropertyValue): Made public.
324
325         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
326         Resolve.
327         Add new property WrapNonExceptionThrows to handle 2.0 assembly
328         attribute.
329         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
330         is not defined.
331         
332         * driver.cs: Reflect method name change.
333         
334         * statement.cs (Try.Resolve): Warn when try has both general
335         exception handlers.
336         
337         * typemanager.cs: runtime_compatibility_attr_type new predefined
338         type.
339
340 2005-10-26  Raja R Harinath  <harinath@gmail.com>
341
342         Fix #76419.
343         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
344         treat it as an empty parameter list.
345
346 2005-10-26  Raja R Harinath  <rharinath@novell.com>
347
348         Fix #76271.     
349         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
350         ResolveAsTypeStep silent.
351         * statement.cs (Block.AddConstant): Mark block as used.
352         (Block.ResolveMeta): Avoid piling on error messages
353         if a constant initializer resolution fails.
354
355 2005-10-25  Raja R Harinath  <rharinath@novell.com>
356
357         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
358         Remove.
359         (NamespaceEntry.VerifyAllUsing): New.
360         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
361         behaviour.  Delegates actual resolution of alias to ...
362         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
363         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
364         Update.
365         * driver.cs (Driver.MainDriver): Update.
366         
367         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
368         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
369         property.
370         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
371         Remove.
372         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
373         RootNamespace.DefineNamespacesForAll.
374
375 2005-10-24  Raja R Harinath  <harinath@gmail.com>
376
377         * typemanager.cs (assemblies, external_aliases, modules)
378         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
379         (ComputeNamespaces, GetRootNamespace): Remove extra staging
380         overhead.  Move resposibility ...
381         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
382         * driver.cs, attribute.cs, codegen.cs: Update to changes.
383
384 2005-10-23  Raja R Harinath  <harinath@gmail.com>
385
386         * namespace.cs (RootNamespace.all_namespaces): Renamed from
387         cached_namespaces.  Improve usage.
388         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
389         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
390         Move from GlobalRootNamespace and simplify.
391         (RootNamespace.Global): Make instance variable.
392         (RootNamespace.RootNamespace): Add "alias name" parameter.
393         (GlobalRootNamespace): Simplify drastically.
394         (Namespace.Lookup): Don't use GetNamespace.
395         * typemanager.cs (GetRootNamespace): Rename from
396         ComputeNamespaceForAlias.
397         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
398
399 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
400
401         * anonymous.cs (AnonymousContainer): Don't crash when container
402         doesn't exist.
403
404 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
405
406         * expression.cs (Binary.DoResolve): Warn when comparing same
407         values.
408
409 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
410
411         Fix #76486.
412         * expression.cs (Binary.DoResolve): It looks like there are no
413         convetsion rules in enum context.
414
415 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
416
417         Add support for extern alias qualifiers.
418         * typemanager.cs: Move some LookupTypeReflection code
419         to namespace.cs, to have cleaner code. Added some methods
420         to help us keep track of the extern aliased references.
421         * driver.cs: Add suport for extern alias assemblies on command
422         line and check for their warnings/errors. Also keep track of the
423         extern aliased assemblies.
424         * namespace.cs: Move the global functionality of Namespace
425         to GlobalRootNamespace/RootNamespace. Now the global namespace
426         is GlobalRootNamespace.Globa. Also the code moved from 
427         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
428         Finally added LocalAliasEntry (AliasEntry before) and
429         ExternAliasEntry, to handle alias statements.
430         * cs-parser.jay: Add support in the grammar for extern alias
431         statement.
432         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
433         Update callings to Namespace (now in GlobalRootNamespace).
434
435 2005-10-18  Raja R Harinath  <rharinath@novell.com>
436
437         Fix #76371.
438         * class.cs (TypeContainer.DefineType): Move updating of
439         topological sort earlier in the code.
440         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
441
442 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
443
444         Fix #76273.
445         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
446         
447         * constant.cs (Constant.TryReduce): Moved from Cast class.
448         (Reduce): Made little bit more OO and fixed missing conversions.
449         
450         * ecore.cs (Reduce): Implemented.
451         (Binary.EnumLiftUp): New method to upgrade values to enum values.
452         
453         * literal.cs (Reduce): Implemented.
454         
455         * class.cs: Reverted Miguel's wrong commit.
456
457 2005-10-14  Miguel de Icaza  <miguel@novell.com>
458
459         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
460
461 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
462
463         * cs-parser.jay, expression.cs : CS0214 was missing error location
464           for constants. Fixed bug #76404.
465
466 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
467
468         Fix #76370.
469         * convert.cs (ExplicitConversionCore): Fixed object->enum
470         conversion.
471
472 2005-10-10  Raja R Harinath  <rharinath@novell.com>
473
474         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
475         InstanceExpression.
476         (PropertyExpr.EmitCall): Likewise.
477         * expression.cs (Invocation.EmitArguments): Handle case where
478         arguments == null.
479         (Invocation.EmitCall): Avoid allocating temporary variable if
480         there are no arguments.
481
482 2005-10-07  Raja R Harinath  <rharinath@novell.com>
483
484         Fix #76323.
485         * convert.cs (ImplicitConversionStandard): Move conversion of
486         void* to arbitrary pointer types ...
487         (ExplicitConversionStandard): .. here.
488         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
489         error to always print typenames.
490
491 2005-10-07  Raja R Harinath  <rharinath@novell.com>
492
493         * convert.cs (GetConversionOperator): Rename from
494         GetConversionOperators.  Move operator selection code from ...
495         (UserDefinedConversion): ... here.
496
497 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
498
499         * convert.cs (ExplicitConversionCore): Removed duplicate enum
500         conversion.
501
502 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
503
504         * assign.cs (Assign.DoResolve): Error method changed.
505
506         * cfold.cs (DoConstantNumericPromotions): Error method changed.
507         
508         * const.cs (ResolveValue): Reset in_transit immediately.
509         
510         * constant.cs: Error method changed.
511         
512         * convert.cs: Removed useless location parameter.
513         (ExplicitNumericConversion): Don't do double enum check.
514         (ExplicitConversionCore): Renamed from ExplicitConversion.
515         (ExplicitUnsafe): Extracted from ExplicitConversion.
516         (ExplicitConversion): Uses for error reporting.
517         
518         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
519         error messages.
520         (ResolveBoolean): Uses common error method.
521         (CastToDecimal): Get rid of ec.
522         (CastFromDecimal): Optimized.
523         (ConvCast): Get rid of ec.
524         
525         * enum.cs (ResolveValue): Reset in_transit immediately.
526         (Emit): Return after first error.
527         
528         * expression.cs: Convert changes.
529         
530         * literal.cs: Error method changed.
531         
532         * statement.cs: Error method changed.
533
534 2005-10-03  Raja R Harinath  <rharinath@novell.com>
535
536         * support.cs (SeekableStreamReader.Position): Don't error out when
537         the requested position is just beyond the end of the current
538         buffered data.
539
540 2005-09-28  Raja R Harinath  <rharinath@novell.com>
541
542         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
543         try to keep in sync with the byte count of the underlying Stream.
544         However, this limits us to a window size of 2048 characters: i.e.,
545         the maximum lookahead of our lexer/parser can be 2048 characters.
546
547 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
548
549         Fix #76255.
550         * driver.cs: Fix compilation files with full root path.
551
552 2005-09-25  Miguel de Icaza  <miguel@novell.com>
553
554         * report.cs (SymbolRelatedToPreviousError): Format the output so
555         it does not use an open parenthesis that is never closed. 
556
557         * driver.cs: Follow coding guidelines
558
559 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
560
561         Fix #72930.
562         * const.cs (Const.ResolveValue): Check for assigning non-null
563         value to reference type.
564
565 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
566
567         * anonymous.cs: Implemented ExprClassName.
568         
569         * assign.cs (Assign.DoResolve): Don't chrash when type is not
570         delegate.
571         
572         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
573         check.
574         
575         * class.cs (StaticClass.DefineContainerMembers): Report protected
576         members as error.
577         
578         * codegen.cs: if(ed) PRODUCTION.
579         
580         * convert.cs (Error_CannotImplicitConversion): Better error
581         distinction.
582         
583         * cs-parser.jay: More error checks.
584         
585         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
586         
587         * driver.cs (CSCParseOption): Enabled wrong option check.
588         
589         * ecore.cs (Expression.ExprClassName): Turned to property.
590         (MemberExpr.CheckIntermediateModification): For checking boxed
591         value types     modification.
592         
593         * statement.cs (Fixed.Resolve): Expression type must be
594         convertible to fixed type.
595         (CollectionForeach.GetEnumeratorFilter,TryType):
596         Small refactoring for easier error checking.
597
598 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
599
600         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
601         attributes.
602         
603         * class.cs (GeneratedBaseInitializer): New class for customization
604         compiler generated initializers.
605         (MemberBase.DoDefine): Check Obsolete attribute here.
606         (FieldMember.DoDefine): Ditto.
607         
608         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
609         constants.
610         
611         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
612         (MemberCore.GetObsoleteAttribute): Removed argument.
613         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
614         (MemberCore.CheckObsoleteType): New helper.
615         
616         * delegate.cs,
617         * enum.cs,
618         * statement.cs: Updates after MemberCore changes.
619         
620         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
621         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
622         
623         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
624         obsolete attribute for compiler construct.
625         (As.DoResolve): Cache result.
626         
627         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
628
629 2005-09-26  Raja R Harinath  <rharinath@novell.com>
630
631         Fix #76133.
632         * expression.cs (This.VerifyFixed): In a value type T, the type of
633         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
634         value type R, 'this' is treated as a value parameter.
635
636 2005-09-22  Miguel de Icaza  <miguel@novell.com>
637
638         * statement.cs (Lock): Use the TemporaryVariable class instead of
639         manually using local variables as those do not work when variables
640         are captured.
641
642         * ecore.cs: Moved the TemporaryVariable class from being a nested
643         class inside Foreach to be a public class that can be employed in
644         other places. 
645
646 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
647
648         * cs-parser.jay: interface_accessors replaced by
649         accessor_declarations.
650
651         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
652         location.
653         
654         * statement.cs (GotoCase.Resolve): Convert null constant to
655         null case.
656         (SwitchLabel.ResolveAndReduce): Ditto.
657         (SwitchLabel.NullStringCase): Custom null stamp.
658         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
659         
660         typemanager.cs (CSharpSignature): Don't skip first argument
661         for full names.
662
663 2005-09-18  Miguel de Icaza  <miguel@novell.com>
664
665         * driver.cs: Set InEmacs based on the environment variable EMACS. 
666
667         * location.cs (InEmacs): in this mode, do not report column
668         location as it confuses Emacs.
669
670 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
671
672         * cfold.cs, constant.cs, convert.cs, ecore.cs,
673         expression.cs, iterators.cs, literal.cs: Store constants and
674         literals location.
675         
676         * class.cs (MemberBase.ShortName): Pass location.
677         
678         * cs-parser.jay: Some location fixes.
679         
680         * ecore.cs (Expression.Location): Made virtual.
681
682 2005-09-05  Miguel de Icaza  <miguel@novell.com>
683
684         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
685         if the underlying types are the same, otherwise we need to produce
686         code that will do the proper cast.
687
688         This was exposed by Marek's constant rewrite which produced
689         invalid code for the call site:
690
691         enum X : long { a }
692         void Method (X v) {}
693
694         Method ((X) 5)
695
696         This fixes test-49.cs
697
698 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
699
700         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
701           Type/Object should be allowed as well. Fixed bug #75968.
702
703 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
704
705         * expression.cs : (Binary.DoResolve): when one is enum constant and
706           another is constant 0, then return enum one *as enum type*.
707           Fixed bug 74846.
708
709 2005-09-02  Raja R Harinath  <rharinath@novell.com>
710
711         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
712         internal.
713
714         Fix #75941.
715         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
716         flow-branching for LocalVariableReferences in case we were invoked
717         from a MemberAccess.
718         * expression.cs (LocalVariableReference.VerifyAssigned): New.
719         Carved out of ...
720         (LocalVariableReference.DoResolveBase): ... this.
721         (MemberAccess.Resolve): Do the check that was disabled during
722         SimpleNameResolve.
723
724 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
725
726         * class.cs :
727           (PartialContainer.Create): check abstract/sealed/static strictly
728           but abstract/sealed can exist only at one side. Fixed bug #75883.
729
730 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
731
732         Fix #75945.
733         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
734         specified, don't default to UnmanagedType.I4.
735
736 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
737
738         * expression.cs : conditional operator should check possibly
739           incorrect assign expression. Fixed bug #75946.
740
741 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
742
743         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
744           Reverting the change. gmcs is much complex than mcs on this matter.
745
746 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
747
748         * cs-tokenizer.cs : To read another token ahead of the actual 
749           consumption, use new SavedToken and cache token instead of moving
750           back the stream with SeekableStreamReader (it seemed problematic).
751         * cs-parser.jay,
752           driver.cs : Thus use StreamReader directly.
753         * support.cs : Thus removed SeekableStreamReader.
754
755 2005-08-30  Raja R Harinath  <rharinath@novell.com>
756
757         Fix #75934.
758         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
759         (ScopeInfo.EmitScopeType): Use it to construct field names from
760         names of captured locals.
761
762         Fix #75929.
763         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
764         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
765         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
766         (ExplicitConversion): Remove enum cases already handled by
767         implicit conversion.  Move implicit conversion check to the beginning.
768         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
769         * expression.cs (ArrayCreation.EmitDynamicInitializers):
770         Don't treat System.Enum as a struct.
771
772 2005-08-30  Jb Evain  <jbevain@gmail.com>
773
774         * attribute.cs: handles as expression in parameters.
775
776 2005-08-30  Raja R Harinath  <rharinath@novell.com>
777
778         Fix #75802.
779         * class.cs (TypeContainer.VerifyClsName): Don't use a
780         PartialContainer when verifying CLS compliance.
781         (AbstractPropertyEventMethod): Set Parent here, ...
782         (PropertyMethod): ... not here.
783
784 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
785
786         * attribute.cs : escaped attribute name should not be allowed to be
787           resolved (e.g. @class as classAttribute). Fixed bug #75930.
788
789 2005-08-29  Raja R Harinath  <rharinath@novell.com>
790
791         Fix #75927.
792         * convert.cs (ImplicitStandardConversionExists): Allow zero also
793         when converting a long constant to unsigned long.
794         * expression.cs (Invocation.OverloadResolve): Add sanity check to
795         detect where IsApplicable and VerifyArgumentsCompat disagree.
796
797 2005-08-29  Raja R Harinath  <rharinath@novell.com>
798         and Carlos Alberto Cortez  <carlos@unixmexico.org>
799
800         Fix #75848.
801         * class.cs (TypeContainer.CanElideInitializer): New helper.
802         (TypeContainer.EmitFieldInitializers): Use it to determine if we
803         can safely emitting the initializer of a field.
804
805 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
806
807         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
808           allowed inside a switch (without loop). Fixed bug #75433.
809
810 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
811
812         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
813         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
814
815 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
816
817         * driver.cs : kinda reverting the default encoding changes (not exact 
818           revert since I noticed that "codepage:reset" might not work fine).
819
820 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
821
822         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
823           Location. Now getter and setter store location correctly.
824           (errors/cs0111-12.cs now reports the expected location.)
825
826 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
827
828         * driver.cs : Use default encoding on the environment.
829           Removed (now that) extra parameter for SeekableStreamReader.
830         * support.cs : (SeekableStreamReader) third .ctor() argument for
831           StreamReader is not required (always true). preamble size could
832           be acquired in simpler and safe way.
833
834 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
835
836         * cs-parser.jay: report CS0642 at warning level 3
837           and report CS0642 for an if else statement also
838           fixes bug #74745. Patch by John Luke (and a bit
839           modified by me).
840           Removed extra CS0642 warning check for "while",
841           "for" and "fixed".
842         * statement.cs: In Block.Resolve(), CS0642 check
843           is reimplemented to check a sequence of an empty
844           statement and a block.
845
846           Both fix bug #66777.
847
848 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
849
850         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
851         detection until I fix it.
852         
853         * cs-tokenizer.cs: Changed error message.
854         
855         * cs-parser.jay: Fixed 2 error locations.
856         
857         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
858         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
859         properties.
860         
861         * enum.cs (GetSignatureForError): Fixed.
862         
863         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
864         method detection.
865         
866         * class.cs,
867         * typemanager.cs (RegisterProperty): Removed.
868         
869         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
870
871 2005-08-24  Raja R Harinath  <rharinath@novell.com>
872
873         Fix #75874.
874         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
875         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
876
877 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
878
879         * expression.cs : tiny fix is required for not warning positive ulong.
880           See test-441.cs.
881
882 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
883
884         * expression.cs : add CS0652 check for constant and integral
885           expression. Fixed bug #53974.
886
887 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
888
889         * expression.cs : in DoNumericPromotions(), check if there is implicit
890           conversion overload for string (to check CS0034). Fixed bug #52492.
891
892 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
893
894         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
895
896 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
897
898         * ecore.cs : report location when it is *not* Null.
899
900 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
901
902         * codegen.cs,
903           ecore.cs,
904           flowanalysis.cs,
905           expression.cs:
906           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
907           correctly. Fixed bug #75721.
908
909 2005-08-23  Raja R Harinath  <rharinath@novell.com>
910
911         * support.cs (SeekableStreamReader.Position): Avoid an expensive
912         loop that performs 'min (pos, char_count)'.
913
914         Fix #75862.
915         * expression.cs (Unary.ResolveOperator): Don't discard implicit
916         converted value in Operator.OnesComplement.
917
918 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
919
920         * anonymous.cs: If the anon method is pulled into a helper class,
921         it needs to be `internal' not `private'. Fixes runtime behavior on
922         msft. bug #75704
923
924 2005-08-20  Martin Baulig  <martin@ximian.com>
925
926         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
927         scope if we don't already have it.
928
929         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
930         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
931         fixes #75867.
932
933 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
934
935         Fix #75803
936         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
937         is a partial class.
938
939 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
940
941         The big constants rewrite
942         Fix #75746, #75685 and more
943         As a side effect saved 1MB for MWF ;-)
944         
945         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
946         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
947         enum based for corlib compilation.
948         
949         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
950         subtractions.
951         
952         * class.cs (FixedField.Define): Use ResolveAsConstant.
953         
954         * const.cs (IConstant): Interface constants and enums.
955         (Const.ResolveValue): New method for constant resolvning.
956         (ExternalConstant): Constants from imported assemblies.
957         
958         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
959         conversion; like enums.
960         (Constant.ToType): Converts this constant to different type.
961         (Constant.Increment): Adds 1.
962         
963         * convert.cs (ImplicitConversionRequired): Simplified.
964         
965         * cs-parser.jay: Create EnumMember directly.
966         
967         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
968         
969         * doc.cs (GenerateEnumDocComment): Removed.
970         
971         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
972         (ConvertIntLiteral): Removed.
973         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
974         
975         * enum.cs (EnumMember): Implement IConstant.
976         (Enum.IsValidEnumConstant): Removed.
977         (Enum.GetNextDefaultValue): Removed.
978         (Enum.FindMembers): Updated.
979         (Enum.GenerateDocComment): Iterate enum members.
980         
981         * expression.cs (Cast.TryReduce): Handle enums correctly.
982         (New.Constantify): Made public.
983         (MemberAccess.DoResolve): Removed contant specific if(s).
984         
985         * literal.cs (NullLiteral): Implement new abstract methods.
986         
987         * statement.cs (GotoCase.Resolve): Use new constant methods.
988         (SwitchLabel.ResolveAndReduce): Use new constant methods.
989         
990         * typemanager.cs (LookupEnum): Removed.
991         (IsEnumType): Fixed to work with corlib.
992         (RegisterConstant): Removed.
993         (LookupConstant): Removed.
994         (GetConstant): Changed to work with IConstant.
995
996 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
997
998         * location.cs : Fixed overflown (>255) column number.
999
1000 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1001
1002         First cut of the qualified-alias-member feature.
1003         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1004         token.
1005         * cs-parser.jay (DOUBLE_COLON): New token.
1006         (namespace_or_type_name): Add rule for recognizing
1007         qualified-alias-members.
1008         (primary_expression): Likewise.
1009         (element_access): Allow QualifiedAliasMember as a possible
1010         type-bearing expression.
1011         (local_variable_type, local_variable_pointer_type): Likewise.
1012         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1013         aliases in the current and enclosing namespace declarations.
1014         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1015         * decl.cs (MemberName.is_double_colon): New.
1016         (MemberName.MemberName): Add new constructor for alias-member.
1017         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1018         * expression.cs (QualifiedAliasMember): New expression type.
1019
1020 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1021
1022         * location.cs : it borked when no argument was specified.
1023
1024 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1025
1026         * location.cs : tiny ToString() format fix.
1027
1028 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1029
1030         * statement.cs : oops, it was missing.
1031
1032 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1033
1034         A set of fixes for precise line/column location.
1035
1036         * location.cs :
1037           "token" field now holds a file/line "delta", a line number offset 
1038           from the segment, and a column number. See also:
1039           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1040           December/009508.html
1041           Removed static IsNull. Use instance IsNull property instead.
1042         * cs-tokenizer.cs :
1043           For some tokens it stores Location. For Identifier it stores
1044           LocatedToken which is a pair of string name and location.
1045           Column numbers are adjusted only at getChar().
1046         * report.cs :
1047           Use Location.ToString() for reporting (it now contains column).
1048         * cs-parser.jay :
1049           Largely modified to use LocatedToken instead of
1050           string (IDENTIFIER), and to acquire Location from some tokens.
1051         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1052           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1053           codegen.cs :
1054           Now MemberName holds Location. DeclSpace.ctor() receives Location
1055           as a parameter. Removed extra parameters to all derived classes.
1056           Replaced Location.IsNull() with instance property.
1057         * assign.cs, expression.cs :
1058           Added .ctor() overload that omits Location.
1059         * attribute.cs :
1060           Added "nameEscaped" flag that indicates the identifier was escaped
1061           in the source file. This fixes bug #57047.
1062
1063 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1064
1065         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1066         New method, looking for lo-case imported cls type.
1067
1068         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1069         here.
1070
1071         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1072
1073         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1074
1075         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1076         all_imported_types.
1077         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1078
1079         Optimized to save 3.5 MB for SWF compilation.
1080
1081 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1082
1083         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1084         (PartialContainer.Create): Moved logic AddToContainer.
1085         (PartialContainer.MarkForDuplicationCheck): Shares name.
1086         
1087         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1088         place.
1089         
1090         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1091         initialization.
1092         (Namespace.GetSignatureForError): New method.
1093         
1094         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1095         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1096
1097 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1098
1099         Fix #75669.
1100         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1101         member lookup rather than qualifier_type, since qualifier_type can
1102         be null.
1103
1104 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1105
1106         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1107         enum member.
1108
1109 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1110
1111         * statement.cs: Copy the local exception into the exception
1112         captured local.  Fixes 75674
1113
1114 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1115
1116         Fix #75658.
1117         * expression.cs (Invocation.OverloadResolve): Don't report error
1118         CS1501 if error CS1502 has been reported.
1119         (New.DoResolve): Delegate CS1501 reporting to
1120         Invocation.OverloadResolve.
1121
1122         Fix #75656.
1123         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1124         invariant-meaning-in-block property in an enclosing block if
1125         necessary.
1126
1127 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1128
1129         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1130         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1131         (Switch.CheckSwitch): Just save 50kb for SWF.
1132
1133 2005-07-27  Martin Baulig  <martin@ximian.com>
1134
1135         * anonymous.cs (CaptureContext.AddField): Added
1136         `AnonymousContainer am' argument; compute its toplevel scope if
1137         it's not already computed.  Fixes #75649.
1138
1139 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1140
1141         Fix #75628.
1142         * class.cs (Constructor.Emit): Reset block to null if the block
1143         resolve fails.
1144
1145 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1146
1147         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1148
1149 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1150
1151         * class.cs (MethodData.Define): Check whether accessor implementing
1152         interface is public.
1153
1154         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1155
1156 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1157
1158         Fix #57245
1159         * namespace.cs (LookupType): Moved same type check to...
1160         
1161         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1162         with the same name.
1163
1164 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1165
1166         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1167         already found a typebuilder.
1168         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1169         MemberNames, not strings.
1170
1171         * const.cs (Error_ExpressionMustBeConst): 
1172         Rename from Error_EpressionMustBeConst.
1173         * const.cs, class.cs, statement.cd: Update.
1174
1175 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1176
1177         Fix #65573
1178
1179         * const.cs (Const.LookupConstantValue): Report missing contant expression
1180         everytime.
1181         (Error_EpressionMustBeConstant): Only one error method.
1182
1183         * class.cs, statement.c: Updated.
1184
1185 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1186
1187         * statement.cs (Block.Flags): Add back HasVarargs.
1188         (Block.flags): Make protected.
1189         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1190
1191         * typemanager.cs (types, typecontainers, user_types): Remove.
1192         (UserTypes, TypeContainers): Likewise.
1193         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1194         (CleanUp, Reset): Update.
1195         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1196         (GetNestedType): Use Type.GetNestedType.
1197         (CoreLookupType): Take two arguments, the namespace and the
1198         basename of the type.  Update to use the Namespace.Lookup
1199         mechanism.
1200         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1201         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1202         string concatenation and substring matches.
1203         * class.cs, enum.cs, delegate.cs: Update to changes.
1204
1205 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1206
1207         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1208         Expression and made virtual.
1209
1210         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1211         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1212
1213         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1214
1215         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1216         error message.
1217
1218         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1219         change.
1220
1221 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1222
1223         Fix #57707
1224         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1225         AssemblyCultureAttribute is not used on executable.
1226
1227         * rootcontext.cs,
1228         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1229
1230 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1231
1232         Fix #60638.
1233         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1234         New.  Reports CS0252/CS0253.
1235         Mostly taken from preliminary patch by Duncak Mak.
1236         (Binary.DoResolveOperator): Store results of operator lookup.
1237         Use them to detect if we need to warn about unintended reference
1238         comparisons.
1239
1240 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1241
1242         Fix #72969.
1243         * namespace.cs (Namespace.Lookup): Add back location parameter.
1244         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1245         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1246
1247         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1248         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1249         (Namespace.LookupType): ... this.
1250         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1251         of namespaces.
1252         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1253         purported to handle pointers.
1254         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1255         CoreLookupType.
1256
1257 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1258
1259         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1260         type as namespace.
1261
1262 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1263
1264         * namespace.cs (Namespace.Lookup): Drop location parameter.
1265         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1266         (NamespaceEntry.Lookup): ... this.
1267         (NamespaceEntry.Error_AmbiguousTypeReference):
1268         Move here from DeclSpace.
1269         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1270         names ...
1271         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1272         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1273         Move to NamespaceEntry.
1274         * delegate.cs, expression.cs: Update to changes.
1275
1276 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1277
1278         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1279         CheckAttributeType and refactored.
1280         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1281         ResolveAsTypeTerminal error handling.
1282         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1283         handling.
1284         (GetSignatureForError): Print errors in same way.
1285
1286         * class.cs,
1287         * codegen.cs: Reflect attribute GetSignatureForError change.
1288
1289         * ecore.cs,
1290         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1291
1292         * namespace.cs (UsingEntry): Refactored to make fields private.
1293
1294         * assign.cs,
1295         statement.cs: Error_UnexpectedKind has extra parameter.
1296
1297 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1298
1299         * ecore.cs (IAlias): Remove.
1300         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1301         that implement the interface.
1302         * namespace.cs (Namespace): Likewise.
1303         (Namespace.declspaces): Renamed from 'defined_names'.
1304         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1305         DeclSpace instead of an IAlias.
1306         * tree.cs (Tree.AddDecl): Update.
1307
1308 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1309
1310         * statement.cs (Block.Flags); Remove HasVarargs.
1311         (Block.HasVarargs): Move to ToplevelBlock.
1312         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1313         (Block.Variables): Make protected.  Initialize variable hashtable
1314         if necessary.
1315         (Block.AddVariable): Update.
1316         (Block.Resolve): Update to changes.
1317         (ToplevelBlock.HasVarargs): New boolean.
1318         (ToplevelBlock.ThisVariable): Move here from Block.
1319         (ToplevelBlock.AddThisVariable): Likewise.
1320         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1321         * expression.cs (This.ResolveBase): Update to changes.
1322         (ArglistAccess.DoResolve): Likewise.
1323
1324 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1325
1326         Fix #75321
1327         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1328
1329         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1330         not used and not used & assigned.
1331         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1332
1333 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1334
1335         Fix #75053
1336         * expression.cs (Is.DoResolve): null is never provided type.
1337
1338 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1339
1340         Fix #52496
1341         * cs-parser.jay: Less strict event error rule to catch more errors.
1342
1343 2005-07-08  Martin Baulig  <martin@ximian.com>
1344
1345         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1346         gettter (allowed) or setter (not allowed).
1347
1348         * class.cs (Accessor): Implement IIteratorContainer.
1349         (Accessor.Yields): New public field.
1350         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1351         per-accessor basis.
1352
1353         * cs-parser.jay
1354         (get_accessor_declaration, set_accessor_declaration): Set the
1355         `yields' flag on the accessor, not the property.
1356         (property_declaration): Do the iterators check on a per-accessor
1357         basis and not for the whole property.
1358
1359 2005-07-08  Martin Baulig  <martin@ximian.com>
1360
1361         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1362         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1363
1364 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1365
1366         Fix #74975
1367         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1368         (ExtractSecurityPermissionSet): Cope with self referencing security
1369         attributes properly.
1370
1371         * driver.cs (SetOutputFile): Made public property OutputFile.
1372
1373 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1374
1375         Fix #75486.
1376         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1377         has_nonstatic_fields.  Make into a FieldBase pointer.
1378         (TypeContainer.AddField): Add CS0282 check.
1379         (TypeContainer.EmitType): Update.
1380
1381 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1382
1383         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1384         compare if they start with __.
1385
1386 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1387
1388         * statement.cs (Switch.SwitchGoverningType): Only look at
1389         UserCasts that don't need implicit standard conversions to one of
1390         the allowed switch types (Fixes test-322.cs).
1391         (LocalInfo.Resolve): Re-enable sanity-test.
1392
1393 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1394
1395         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1396         
1397         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1398         
1399         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1400
1401 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1402
1403         Fix #75472.
1404         * ecore.cs (SimpleName.GetSignatureForError): Add.
1405         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1406         (MemberAccess.GetSignatureForError): Add.
1407
1408 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1409  
1410         The big error and warning messages review.
1411         
1412         * anonymous.cs,
1413         * assign.cs,
1414         * attribute.cs,
1415         * class.cs,
1416         * codegen.cs,
1417         * convert.cs,
1418         * cs-parser.jay,
1419         * cs-tokenizer.cs,
1420         * decl.cs,
1421         * delegate.cs,
1422         * doc.cs,
1423         * driver.cs,
1424         * ecore.cs,
1425         * enum.cs,
1426         * expression.cs,
1427         * flowanalysis.cs,
1428         * iterators.cs,
1429         * literal.cs,
1430         * location.cs,
1431         * modifiers.cs,
1432         * namespace.cs,
1433         * parameter.cs,
1434         * pending.cs,
1435         * report.cs,
1436         * rootcontext.cs,
1437         * statement.cs,
1438         * support.cs,
1439         * tree.cs,
1440         * typemanager.cs: Updated.
1441         
1442         * class.cs: (MethodCore.SetYields): Moved here to share.
1443         (PropertyMethod.Define): Moved iterator setup here.
1444         
1445         * iterators.cs: Add orig_method to have full access to parent
1446         container.
1447
1448 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1449
1450         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1451         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1452         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1453         variable of struct type.
1454         * expression.cs (Unary.ResolveOperator): Update to change.
1455         (Indirection.VerifyFixed): Likewise.
1456         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1457         (ParameterReference.VerifyFixed): Value parameters are fixed.
1458         (This.VerifyFixed): Treat 'this' as a value parameter.
1459         * statement.cs (LocalInfo.IsFixed): Remove.
1460
1461 2005-07-01  Martin Baulig  <martin@ximian.com>
1462
1463         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1464         `ec.EmitThis ()' to get the correct scope.
1465
1466 2005-07-01  Martin Baulig  <martin@ximian.com>
1467
1468         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1469         instance is a ParameterReference; fixes #75299.
1470
1471 2005-07-01  Martin Baulig  <martin@ximian.com>
1472
1473         Reverted Marek's latest patch (r46725):
1474         - it contains structural changes which are neither mentioned in
1475           the ChangeLog nor explained anywhere; for example the additional
1476           argument of EmitContext's and Iterator's .ctor's and the
1477           TypeContainer.DefineMembers() change.
1478         - structural changes like this should go in in seperate patches
1479           and not be hidden in a huge patch which just seems to affect
1480           warnings and errors.
1481           a big and hard to understand patch.
1482         - it breaks iterators and causes regressions, for instance in
1483           test-iter-03.cs.      
1484
1485 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1486
1487         Fix #75412.
1488         * expression.cs (Indexers.map): Remove.
1489         (Indexers.Append): Filter out inaccessible setters and getters.
1490         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1491
1492         Fix #75283.
1493         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1494         Refactored from ...
1495         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1496         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1497         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1498         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1499
1500 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1501
1502         Fix #75322
1503         * class.cs (FieldBase.GetInitializerExpression): One more field
1504         for backup.
1505
1506 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1507
1508         * pending.cs: Do not define a proxy if the base method is virtual,
1509         it will be picked up by the runtime (bug 75270).
1510
1511 2005-06-08  Martin Baulig  <martin@ximian.com>
1512
1513         The big Iterators rewrite :-)
1514
1515         * iterators.cs: Rewrite this to use the anonymous methods framework.
1516
1517         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1518         before the TypeContainers; see 2test-21.cs.
1519
1520         * class.cs
1521         (TypeContainer.DefineType): Don't create a new EmitContext if we
1522         already have one (this only happens if we're an Iterator).
1523         (TypeContainer.Define): Also call Define() on all our iterators.
1524         (Method.CreateEmitContext): Added support for iterators.
1525
1526         * anonymous.cs
1527         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1528         (AnonymousContainer.CreateMethodHost): Moved here from
1529         AnonymousMethod and made abstract.
1530         (AnonymousContainer.CreateScopeType): New abstract method.
1531         (AnonymousContainer.IsIterator): New public property.
1532         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1533         get the ScopeTypeBuilder rather than manually defining it here. 
1534         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1535         iterators here.
1536
1537         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1538         before RootContext.DefineTypes().
1539
1540         * codegen.cs (EmitContext.RemapToProxy): Removed.
1541         (EmitContext.CurrentAnonymousMethod): Changed type from
1542         AnonymousMethod -> AnonymousContainer.
1543         (EmitContext.ResolveTopBlock): Protect from being called twice.
1544         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1545         (EmitContext.EmitThis): Removed the iterators hacks; use the
1546         anonymous methods framework for that.
1547
1548         * statement.cs
1549         (ToplevelBlock.Container): Make this a property, not a field.
1550         (ToplevelBlock.ReParent): New public method; move the
1551         ToplevelBlock into a new container.
1552         (Foreach.TemporaryVariable): Simplify.
1553
1554 2005-06-05  Martin Baulig  <martin@ximian.com>
1555
1556         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1557         (Block.AddTemporaryVariable): New public method; creates a new
1558         `LocalInfo' for a temporary variable.
1559         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1560         variables here.
1561         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1562         non-iterator variables.
1563
1564 2005-06-05  Martin Baulig  <martin@ximian.com>
1565
1566         * statement.cs (Foreach.TemporaryVariable): Create the
1567         LocalBuilder in the Emit phase and not in Resolve since in some
1568         situations, we don't have an ILGenerator during Resolve; see
1569         2test-19.cs for an example.
1570
1571 2005-06-04  Martin Baulig  <martin@ximian.com>
1572
1573         **** Merged r45395 from GCS ****
1574
1575         The big Foreach rewrite - Part II.
1576
1577         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1578         with `PropertyInfo ienumerator_getcurrent'.
1579
1580         * codegen.cs (VariableStorage): Removed.
1581
1582         * statement.cs
1583         (Foreach): Derive from Statement, not ExceptionStatement.
1584         (Foreach.CollectionForeach): New nested class.  Moved all the code
1585         dealing with collection foreach here.
1586         (Foreach.ForeachHelperMethods): Removed.
1587         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1588
1589 2005-05-23  Martin Baulig  <martin@ximian.com>
1590
1591         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1592         don't need to.  Fix #75014.
1593
1594 2005-05-20  Martin Baulig  <martin@ximian.com>
1595
1596         Merged r44808 from GMCS.
1597
1598         * class.cs (TypeContainer.CircularDepException): Removed.
1599         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1600         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1601         (CS0146) and interface (CS0529) dependencies here.
1602
1603 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1604
1605         * expression.cs (Invocation.EmitCall): Fix initialization
1606         'this_call' to reflect current behaviour.  Fix indentation.
1607
1608         * convert.cs (FindMostEncompassedType): Add two trivial special
1609         cases (number_of_types == 0 || number_of_types == 1).
1610         (FindMostEncompasingType): Likewise.
1611
1612 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1613
1614         Some cleanups preparing for the fix of #75283.
1615         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1616         error testing.
1617         (EventExpr.InstanceResolve): Likewise.
1618         (EventExpr.DoResolve): Remove redundant checks.
1619
1620 2005-06-10  Duncan Mak  <duncan@novell.com>
1621
1622         * cs-tokenizer.cs (process_directives): New flag for controlling
1623         the processing of preprocessor directives.
1624         (x_token): After seeing a '#', return Token.NONE instead of going
1625         to handle_preprocessing_directive() when not processing
1626         directives. This avoids unnecessary processing during the token peek in
1627         is_punct().
1628
1629         This fixes #74939.
1630
1631         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1632         the existing error reporting methods instead of Report.Error.
1633
1634         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1635         after Raja's rewrite.
1636
1637 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1638
1639         * class.cs: Small fix.
1640
1641 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1642
1643         Fix #75160.
1644         * class.cs (GetPartialBases): Fix return value check of
1645         part.GetClassBases.
1646
1647 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1648
1649         Ensure that partial classes are registered in their enclosing
1650         namespace.  Initial part of fix of #75160.
1651         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1652         Register declspace with namespace here, not in
1653         DeclSpace.RecordDecl.
1654         * cs-parser.jay: Pass namespace to RecordDecl.
1655         * class.cs (PartialContainer.Create): Likewise.
1656         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1657         called.
1658         * decl.cs (Declspace.RecordDecl): Remove.
1659         * namespace.cs (NamespaceEntry.DefineName): Remove.
1660
1661 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1662
1663         * rootcontext.cs: Reset TargetExt as well.
1664
1665 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1666
1667         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1668         -langversion:ISO-1.
1669
1670 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1671
1672         Fix #75080, cs0119.cs.
1673         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1674         of ...
1675         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1676         allowing ExprClass.Type and ExprClass.Namespace for
1677         ResolveFlags.VariableOrValue.
1678         (Expression.Resolve) [1-argument variant]: Change default resolve
1679         flags based on language version.
1680         (Expression.Error_UnexpectedKind): Use a simple string array
1681         rather than an ArrayList.
1682         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1683         not ExprClass.Type.
1684         (TypeOfVoid.DoResolve): Likewise.
1685         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1686         flags argument -- it always has the same value.
1687
1688 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1689
1690         Fix #75081.
1691         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1692         Use it in the error message.
1693         * assign.cs, expression.cs, statement.cs: Update.
1694
1695 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1696
1697         Fix #75088.
1698         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1699         the "almostMatchedMember" case too.
1700         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1701         that failed the accessibility checks to 'almost_match'.
1702
1703 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1704
1705         * attribute.cs: Use internal MethodBuilder methods to set
1706         ExactSpelling and SetLastError on PInvoke methods, instead
1707         of passing them via charset.  Fixes #75060.
1708
1709 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1710
1711         * parameter.cs (Parameter): Remove TODO comment.
1712         (Parameter.DefineParameter): Remove Location parameter.
1713         (Parameters.LabelParameters): Likewise.
1714         * class.cs (Constructor.Emit): Update to change.
1715         (MethodData.Emit): Likewise.
1716         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1717         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1718
1719 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1720
1721         * parameter.cs,
1722           Removed Parameters.Location and added Parameter.Location instead.
1723           Removed Location parameter from Emit() and GetSignature().
1724         * anonymous.cs,
1725           class.cs,
1726           cs-parser.jay,
1727           delegate.cs,
1728           iterators.cs,
1729           statement.cs :
1730           Modified all related calls.
1731
1732 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1733
1734         Improve user-defined conversion handling.
1735         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1736         applicable operators.
1737         (AddConversionOperators): New.  Helper for GetConversionOperators.
1738         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1739         there is only one most encompassed/encompassing type.
1740         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1741         "applicable operator" handling.
1742         (UserConversion): Move cache here from GetConversionOperators.
1743         Directly cache the chosen operator, rather than the whole
1744         MethodGroup.
1745         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1746         case.  Allow conversion of decimal to sbyte and byte too.
1747         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1748         New static methods.  Used to avoid allocating EmptyExpressions in
1749         convert.cs.
1750
1751 2005-05-24  Duncan Mak  <duncan@novell.com>
1752
1753         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1754         another class, used in Convert.ExplicitNumericConversion.
1755         (CastToDecimal): New class, similar to above, but casts to
1756         System.Decimal, used in Convert.ImplicitNumericConversion and also
1757         in explicit convesion from double/float to decimal.
1758
1759         * convert.cs (ImplicitNumericConversion): Handle implicit
1760         conversions to System.Decimal.
1761         (ExplicitNumericConversion): handle explicit conversions to
1762         System.Decimal.
1763
1764         This fixes #68711.
1765         
1766 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1767
1768         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1769         know the type at this stage, just break through.   Fixes #75008 
1770
1771 2005-05-19  Martin Baulig  <martin@ximian.com>
1772
1773         * delegate.cs
1774         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1775         to disable error reporting.
1776
1777         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1778         here since we don't want to report an error; see the new test-336.cs.
1779
1780 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1781
1782         * statement.cs (ToplevelBlock.GetParameterReference)
1783         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1784         Move here from class Block.
1785         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1786         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1787
1788 2005-05-18  Martin Baulig  <martin@ximian.com>
1789
1790         Fix #74978.
1791
1792         * flowanalysis.cs
1793         (FlowBranching.Reachability): Add non-static public And() and Or()
1794         methods.
1795         (FlowBranchingSwitch): New class; do the `break_origins' thing
1796         like in FlowBranchingLoop.
1797         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1798         reachability, not just locals and parameters.
1799         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1800         switch; MergeBreakOrigins() now takes care of that.
1801
1802 2005-05-18  Martin Baulig  <martin@ximian.com>
1803
1804         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1805         a loop and may leave it, reset the barrier; fixes #74974.
1806
1807 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1808         
1809         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1810         is back.
1811         
1812         * cs-parser.jay: Catch more lexical errors.
1813         
1814         * report.cs: Add one more Error method.
1815         
1816         * rootcontext.cs,
1817         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1818
1819 2005-05-17  Martin Baulig  <martin@ximian.com>
1820
1821         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1822         #70970. 
1823
1824 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1825
1826         Fix test-382.cs.  Emit values of decimal constants.
1827         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1828         Carved out of ...
1829         (TypeContainer.AddField): ... this.
1830         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1831         with initializers to include 'Const's.
1832         (ClassPart.RegisterFieldForInitialization): Forward to
1833         PartialContainer.
1834         * const.cs (Const.Const): Pass initializer to base class.
1835         (Const.Define): In case of decimal constants, register them for
1836         initialization in a static constructor.
1837
1838 2005-05-14  Martin Baulig  <martin@ximian.com>
1839
1840         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1841         do not call ResolveUnreachable() on unreachable statements in
1842         here, see the comment in the source code.
1843
1844 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1845
1846         Fix #74934.
1847         * expression.cs (BinaryResolveOperator): If one of the operands of
1848         an equality comparison is 'null' and the other is a pointer type,
1849         convert the null to a NullPointer.
1850         * convert.cs (ImplicitReferenceConversion): If the expression is a
1851         NullLiteral and the target type is a pointer type, return a
1852         NullPointer instead.
1853         (ImplicitConversionStandard): Likewise.
1854
1855 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1856         
1857         * cs-parser.jay: Set readonly context based on special constructs.
1858         
1859         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1860         readonly variable error handling.
1861         
1862         * rootcontext.cs (EmitCode): Don't verify members when error
1863         occurred.
1864         
1865         * statement.cs (LocalInfo): Add reaodnly context information.
1866         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1867
1868 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1869
1870         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1871         for #74041 to initialize 'resolved' to false only for explicit
1872         blocks.  Fixes #74873.
1873
1874 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1875
1876         Fix #74920.
1877         * typemanager.cs (unmanaged_enclosing_types): New.
1878         (IsUnmanagedType): Avoid infloops by using
1879         'unmanaged_enclosing_types' to talk with recursive invocations.
1880
1881 2005-05-13  Martin Baulig  <martin@ximian.com>
1882
1883         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1884         instance variable, not a local.  Fix #74873.
1885         (Block.ResolveUnreachable): Set it to true here.
1886
1887 2005-05-11  Duncan Mak  <duncan@novell.com>
1888
1889         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1890         continuing to process for 'arg'.
1891         (handle_preprocessing_directive): Check the argument of the #endif
1892         directive and report error CS1025 if there are any trailing
1893         characters.
1894
1895         According to the C# spec, having even whitespace after the #endif
1896         directive is illegal; however, because we call arg.TrimEnd ()
1897         beforehand, we have the same behavior as csc, allowing whitespace
1898         after the directive.
1899
1900         Fixes #74892.
1901
1902 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1903
1904         Fix #74863.
1905         
1906         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1907         (Constructor.GetObsoleteAttribute): Implemented correctly.
1908
1909 2005-05-10  Martin Baulig  <martin@ximian.com>
1910
1911         * support.cs (ReflectionParameters.ParameterModifier): Use
1912         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1913         and `ParameterAttributes.In'.  Fixes #74884.
1914
1915 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1916
1917         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1918         
1919         * expression.cs (Argument.GetParameterModifier): Turned to property.
1920         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1921         
1922         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1923         its C# equivalent.
1924         
1925 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1926
1927         Fix #74852.
1928         * decl.cs (MemberCache.AddMethods): Register override methods,
1929         rather than non-override methods.
1930         * typemanager.cs (RegisterOverride): New.
1931         (IsOverride): Update.
1932
1933 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1934
1935         Fix #73105.
1936         
1937         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1938         recursive declaration.
1939         
1940         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1941         
1942 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1943
1944         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1945         
1946         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1947
1948 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1949
1950         Fix #74797.
1951         * decl.cs (DeclSpace.FamilyAccessible): 
1952         Use TypeManager.IsNestedFamilyAccessible.
1953
1954         Fix reopened #64812.
1955         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1956         internal'.
1957
1958 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1959             Abin Thomas  <projectmonokochi@rediffmail.com>
1960             Anoob V E  <projectmonokochi@rediffmail.com>
1961             Harilal P R  <projectmonokochi@rediffmail.com>
1962
1963         Fix #64812.
1964         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1965         allow access to all static members.
1966
1967 2005-05-04  Martin Baulig  <martin@ximian.com>
1968
1969         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1970
1971 2005-05-04  Martin Baulig  <martin@ximian.com>
1972
1973         Fix #74655.
1974
1975         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1976         section at the end; make things work if `default' is not the last
1977         section.        
1978
1979 2005-05-04  Martin Baulig  <martin@ximian.com>
1980
1981         Fix #70400.
1982
1983         * statement.cs (Switch): Replaced the `got_default' field with a
1984         `default_section' one.
1985         (Switch.CheckSwitch): Set `default_section' here.
1986         (Switch.Resolve): If we're a constant switch and the constant is
1987         not found, use the default section.
1988
1989 2005-05-03  Martin Baulig  <martin@ximian.com>
1990
1991         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1992
1993         * statement.cs (Foreach.ArrayForeach): New nested class.
1994         (Foreach.TemporaryVariable): New nested class.
1995         (Foreach.EmitArrayForeach): Removed; this is now in the new
1996         ArrayForeach class.
1997
1998 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1999
2000         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2001         more conservative.
2002         (VerifyPendingMethods): Revert change below.
2003
2004         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2005         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2006         that used to trigger warning -28.  Remove warning -28.
2007         * expression.cs (Invocation.OverloadResolve): Use
2008         TypeManager.IsOverride to distinguish override methods.
2009
2010         Fix #74773.
2011         * pending.cs (VerifyPendingMethods): If a base type implements the
2012         requested interface, don't bother checking individual methods of
2013         the base type.  As a side-effect, this prevents the creation of
2014         unnecessary proxies.
2015
2016 2005-05-02  Martin Baulig  <martin@ximian.com>
2017
2018         Fix #70182.
2019
2020         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2021         Also `And' the locals if the old vector is null.
2022         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2023         null; in this case we basically reset all the variables.        
2024
2025 2005-05-02  Martin Baulig  <martin@ximian.com>
2026
2027         Fix #74529.
2028
2029         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2030         Added `FlowBranching branching' argument; always `and' the
2031         variables instead of `or'ing them unless we're an infinite loop.
2032
2033         * statement.cs (While.Resolve): Create a new sibling unless we're
2034         infinite.       
2035
2036 2005-05-02  Martin Baulig  <martin@ximian.com>
2037
2038         Fix #70140.
2039
2040         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2041         arguments; use it instead of creating a new TopLevelBlock.
2042         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2043         our ConstructorInitializer.
2044
2045         * statement.cs
2046         (TopLevelBlock.TopLevelBranching): New public property.
2047         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2048         and create our `TopLevelBranching'.
2049
2050         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2051         anonymous method host, use `block.TopLevelBranching' rather than
2052         creating a new branching.
2053
2054 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2055
2056         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2057         a ScopeInfo, if any of the current children is a child of the new
2058         entry, move those children there.
2059
2060 2005-04-30  Martin Baulig  <martin@ximian.com>
2061
2062         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2063         at the beginning of a SwitchSection.  Fix #73335.
2064
2065 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2066
2067         Fix #74378
2068         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2069         
2070         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2071         (FieldExpr.DoResolve): Obsolete members are ignored for field
2072         initializers.
2073         
2074 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2075
2076         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2077         of arrays detection.
2078
2079         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2080         verification.
2081         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2082
2083         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2084         arrays report.
2085
2086 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2087
2088         * cs-parser.jay: Use the prefered version of -unsafe in error
2089         message.
2090
2091 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2092
2093         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2094         circumstances.
2095
2096 2005-04-20  John Luke  <john.luke@gmail.com>
2097
2098         * driver.cs: fix typo in error message, --outout to --output
2099
2100 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2101
2102         * codegen.cs (InRefOutArgumentResolving): New field.
2103         
2104         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2105         fields outside contructor.
2106         
2107         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2108         
2109 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2110
2111         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2112         parameter code was not completed ever, so it was not as up-to-date
2113         as local variables.  Must finish it.
2114
2115         The bug fix was to compare the Toplevel of the block, not the
2116         current block.  Thanks for Ben for pointing this out. 
2117
2118 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2119
2120         * decl.cs (AddMethods): Use the declaring type of the problem
2121         method to determine if we want to squash a warning.
2122
2123 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2124
2125         * attribute.cs: Removed debug output.
2126
2127         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2128         
2129         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2130         Report.Stderr.
2131         
2132 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2133
2134         Fix #74481.
2135         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2136         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2137         all null comparisons against reference types.
2138
2139 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2140
2141         Fix# 74565
2142         * class.cs (TypeContainer.CircularDepException) New nested
2143         exception class.
2144         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2145         (TypeContainer.DefineType): Removed error, reset InTransit before
2146         exit.
2147         (Class.DefineType): Throw exception when is in Transit.
2148         Catch exception and report error.
2149         (Struct.DefineType): Throw exception when is in Transit.
2150         Catch exception and report error.
2151         (Interface.DefineType): Throw exception when is in Transit.
2152         Catch exception and report error.
2153
2154         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2155         handle nested exception handlers.
2156
2157         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2158         a catch.
2159
2160         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2161         InFinally and InCatch storage.
2162
2163         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2164         (Catch.Resolve): Set and Restore ec.InCatch.
2165         (Try.Resolve): Set and Restore ec.InFinally.
2166         (Try.HasCatch): True when try has catch.
2167
2168 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2169
2170         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2171           for the same event member, so exclude such cases from warning 419.
2172           Fixed bug #74633.
2173
2174 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2175
2176         * expression.cs (Binary.ResolveOperator): Apply patch from John
2177         Luke to fix bug 59864: operators &, | and ^ on enumerations
2178         require that the same enum type on both sides.
2179
2180         * driver.cs: Add warnings to old flag usage, this is to assist
2181         people who produce Makefiles and hope that the Makefiles will be
2182         used on Windows.
2183
2184         * class.cs (TypeContainer.EmitType): Moved the definition of the
2185         special $PRIVATE$ field from the resolve phase to the Emit phase.
2186         During resolve we do not know if we are a struct with
2187         HasExplicitLayout, we know this only after the attributes for the
2188         type are emitted.
2189
2190         Set the FieldOffset to zero on the dummy field that we create for
2191         the class.   Fixes 74590.
2192
2193 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2194
2195         Fix #73834.
2196         * ecore.cs (PropertyExpr.resolved): New.
2197         (DoResolve): Use it to handle a case of double resolution here.
2198         Handle a case of identical-name-and-type-name.
2199         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2200         resolution by storing the results of expression resolution back
2201         into the "probes" array.
2202
2203 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2204
2205         Fix cs0208-7.cs and cs0208-8.cs.
2206         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2207         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2208         error reporting to point out the reason a struct is not unmanaged.
2209
2210 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2211
2212         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2213           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2214
2215 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2216
2217         Fix #74528.
2218         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2219         IdenticalNameAndTypeName here.
2220         (EventExpr.InstanceResolve): Likewise.
2221
2222 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2223
2224         C# 2.0 DefaultCharSetAttribute implementation
2225         
2226         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2227         which allows us to set GlobalNamespace for every resolve.
2228         (Attribute.ResolveArguments): Cut from Resolve.
2229         (Attribute.GetCharSetValue): Returns CharSet named argument.
2230         (Attribute.DefinePInvokeMethod): Gets default charset from
2231         module settings.
2232         (GlobalAttribute.ResolveAsTypeStep): Override.
2233         (GlobalAttribute.ResolveArguments): Override.
2234         
2235         * class.cs (TypeAttr): Is protected.
2236         
2237         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2238         (ModuleClass.DefaultCharSetType): New memeber.
2239         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2240         
2241         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2242         charset from module.
2243         
2244         * delegate.cs (TypeAttr): Override.
2245         (Delegate.DefineType): Use this TypeAttr.
2246         
2247         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2248         at very early stage (before types are defined) to resolve model
2249         module attributes. It will probably not work with corlib but it
2250         should be ok.
2251         
2252         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2253         charset from module.
2254         
2255         * typemanager.cs (default_charset_type): New type.
2256
2257 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2258
2259         * decl.cs (MemberCache.AddMethods): Don't warn if
2260         System.Object.Finalize has buggy MethodAttributes.
2261
2262         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2263         removed below.
2264
2265 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2266
2267         * doc.cs : detect ambiguous reference to overloaded members.
2268           Fixed bug #71603. MS 1.1 csc does not detect it.
2269
2270 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2271
2272         * doc.cs : delegates must not be referenced with parameters.
2273           Fixed bug #71605.
2274
2275 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2276
2277         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2278
2279 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2280
2281         * driver.cs (MainDriver): Stop processing if the CLS stage found
2282         errors. 
2283
2284         (CompilerCallableEntryPoint.InvokeCompiler): Always
2285         reset after execution;   Take a TextWriter argument for the
2286         output.
2287
2288         * report.cs: Use the error stream instead of hardcoding stderr. 
2289
2290 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2291
2292         * class.cs: Reduce code paths to test, too small of an
2293         optimization to make it worth the extra testing.  Always perform
2294         it. 
2295
2296 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2297
2298         Fix #74510.
2299         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2300         operators that had errors reported on them.
2301
2302 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2303
2304         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2305         argument types.
2306         (Attribute.Resolve): Add named argument type checking.
2307         
2308         * class.cs (FixedField.Define): Use IsPrimitiveType
2309         
2310         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2311         
2312         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2313         unsafe parameter types.
2314         
2315         * statement.cs (Using.ResolveExpression): Add better error description.
2316         
2317         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2318         
2319 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2320
2321         Fix #74484.
2322         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2323         AttributeUsageAttribute in the emitcontext of the attribute class,
2324         not in the emitcontext of the attributable entity it was attached to.
2325         * cs-parser.jay: Use 'current_class', not 'current_container',
2326         when creating a GlobalAttribute.
2327
2328 2005-04-08  Alp Toker  <alp@atoker.com>
2329
2330         * pending.cs: The fix to #58413 failed to compile methods implementing
2331         interfaces with/without params modifiers and vice versa, even though
2332         params modifiers aren't part of the signature. Make the modifier check
2333         less strict as in csc.
2334
2335 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2336             Anoob V E  <projectmonokochi@rediffmail.com>
2337             Harilal P R  <projectmonokochi@rediffmail.com>
2338
2339         Fix #58413.
2340         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2341         modifiers of pending methods.
2342         (PendingImplementation.PendingImplementation): Initialize it.
2343         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2344         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2345         with ParameterData.  Add check for modifiers.
2346         * class.cs (MethodData.Define): Update to changes.
2347
2348 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2349
2350         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2351
2352 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2353
2354         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2355         property.
2356         
2357         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2358         
2359         * rootcontext.cs,
2360         * typemanager.cs: Registered RequiredAttributeAttribute.
2361         
2362 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2363
2364         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2365         Warning CS0169 is back at level 3.
2366         (IMethodData.SetMemberIsUsed): New method.
2367         
2368         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2369         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2370         
2371         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2372
2373         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2374         contants.
2375         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2376         is used.
2377         
2378         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2379         is used.
2380         
2381         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2382         to avoid the problems with nested types.
2383
2384 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2385             Anoob V.E  <projectmonokochi@rediffmail.com>
2386             Harilal P.R  <projectmonokochi@rediffmail.com>
2387             Raja R Harinath  <rharinath@novell.com>
2388
2389         Fix #73820.
2390         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2391         attribute.
2392         * typemanager (GetConstructor): Make public.
2393
2394 2005-04-05  John Luke  <john.luke@gmail.com>
2395             Raja R Harinath  <rharinath@novell.com>
2396
2397         Fix #62232.
2398         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2399         struct too.  Return false quicker in a few cases.
2400         (VerifyUnManaged): Use it.
2401
2402 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2403
2404         Fix #74041.
2405         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2406         not 'unreachable_seen'.
2407
2408 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2409
2410         * attribute.cs (Attribute.GetValue): Removed unused.
2411         
2412         * codegen.cs (CodeGen.TrimExt): Removed unused.
2413         
2414         * cs-parser.jay (output): Removed unused.
2415         
2416         * cs-tokenizer.cs (hex_digits): Removed unused.
2417         
2418         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2419         
2420         * expression.cs (Indirection.LoadExprValue): Removed unused.
2421         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2422         
2423         * iterators.cs (Iterator.param_types): Removed unused.
2424         
2425         * statement.cs (Goto.block): Removed unused.
2426         (ToplevelBlock.did): Removed unused.
2427         (Switch.ResolveConstantSwitch): Removed unused.
2428
2429 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2430
2431         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2432         resetting thingy.
2433
2434 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2435
2436         Fix #74232 and cs0208-3.cs.
2437         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2438         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2439         unmanaged type.  Don't use FieldBuilders when 't' is a
2440         TypeBuilder.  Use ModFlags and MemberType fields.
2441         * class.cs (MemberBase.member_type): Rename from MemberType.
2442         (MemberBase.MemberType): New property.  Determines member_type on
2443         demand.
2444         (MemberBase.DoDefine): Don't initialize MemberType here.
2445         (FieldMember.Define): Likewise.
2446
2447 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2448
2449         Fix #74241
2450         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2451         Attributes are emitted there.
2452         
2453 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2454
2455         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2456         keyword in 'partial enum' too.
2457         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2458         is not allowed).
2459         Report from Kamil Skalski <nazgul@omega.pl>.
2460
2461         Fix #74309.
2462         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2463         have partial containers too.
2464
2465         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2466         in block' checks to Block.CheckInvariantMeaningInBlock.
2467         * statement.cs (Block.GetKnownVariableInfo): Make private.
2468         (Block.IsVariableUsedInChildBlock): Remove.
2469         (Block.IsVariableUsedInBlock): Likewise.
2470         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2471         conflicting declaration.
2472         (Block.AddVariable): Make error messages less long-winded and more
2473         specific.  Show location of conflicting declaration.
2474         * parameter.cs (Parameters.Location): New readonly property.
2475
2476 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2477
2478         Clean up semantics of invoking ResolveMemberAccess.
2479         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2480         can have an instance, ensure that we pass in a non-TypeExpression
2481         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2482         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2483         argument.  Update to changes and simplify.
2484         (FieldExpr.Emitinstance): Remove CS0120 check.
2485         (PropertyExpr.EmitInstance): Likewise.
2486         * expression.cs (Argument.Resolve): Likewise.
2487         (Invocation.DoResolve): Update to changes in semantics of
2488         InstanceExpression.
2489
2490 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2491
2492         Fix #74241
2493         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2494         customization.
2495         
2496         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2497
2498 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2499
2500         Fix difference in behaviour with commandline invocation.
2501         * driver.cs (Driver.Reset): New.
2502         (CompilerCallableEntryPoint): Call it.
2503
2504         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2505         variable" warnings if the boolean expression failed to resolve.
2506
2507 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2508
2509         * attribute.cs: Fix the union of several permissions when some of them
2510         are unrestricted (so the result isn't an unrestricted permission set).
2511         Fix #74036.
2512
2513 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2514
2515         * ecore.cs (MemberExpr): New class.  Convert from interface
2516         IMemberExpr.
2517         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2518         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2519         error checks.
2520         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2521         (MethodGroupExpr.IsExplicitImpl): Remove.
2522         (Expression.GetFieldFromEvent): Remove.
2523         (SimpleName.MemberStaticCheck): Remove.
2524         (SimpleName.DoSimpleNameResolve): Update to changes.
2525         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2526         (MemberAccess.IdenticalNameAndTypeName): Remove.
2527         (MemberAccess.error176): Move to MemberExpr.
2528         (MemberAccess.DoResolve): Update to changes.
2529         (BaseAccess.DoResolve): Likewise.
2530
2531 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2532
2533         C# 2.0 Conditional attribute class implementation
2534         
2535         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2536         Analyzes class whether it has attribute which has ConditionalAttribute
2537         and its condition is not defined.
2538         
2539         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2540         (Class.IsExcluded): New method. Search for at least one defined
2541         condition in ConditionalAttribute of attribute class.
2542
2543 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2544
2545         * ecore.cs (PropertyExpr): Derive from Expression, not
2546         ExpressionStatement.
2547         (PropertyExpr.EmitStatement): Remove.
2548
2549 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2550
2551         Fix #74060.
2552         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2553         internal field "value__" of an enum be private.  The examples for
2554         "value__" that I found on MSDN all used FieldAttributes.Private.
2555
2556         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2557         Don't mention IL method attribute names.
2558
2559         Fix #47991.  Remove a TODO.
2560         * statement.cs (Block.Toplevel): Make into a field.
2561         (Block.Parameters): Move into ToplevelBlock.
2562         (Block.known_variables): Rename from child_variable_names.
2563         (Block.Block): Remove variants that take Parameters.  Initialize
2564         'Toplevel' with the immediately surrounding toplevel block.
2565         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2566         LocalInfo parameter.
2567         (Block.GetKnownVariableInfo): New.
2568         (Block.IsVariableNameUsedInChildBlock): Update.
2569         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2570         the block, even though it may not be in scope.
2571         (Block.AddVariable): Remove Parameters parameter.  Use
2572         Toplevel.Parameters instead.
2573         (Block.AddConstant): Remove Parameters parameter.
2574         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2575         (Block.IsParamaterReference): Likewise.
2576         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2577         (ToplevelBlock.Parameters): New.  Moved from Block.
2578         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2579         initialize Parameters to a non-null value.
2580         * cs-parser.jay: Update to changes.
2581         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2582         simple names that mean different things in the same block.  Use
2583         Block.IsVariableNameUsedInBlock.
2584
2585 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2586
2587         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2588         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2589         GetTypeHandle.  It is possible for a reflected type to derive from
2590         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2591         System.Array during mscorlib compilation).
2592         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2593         contain a method_hash, don't create one either.  Don't create a
2594         deep copy of the base cache's method_hash.
2595         (MemberCache.SetupCache): Rename back from DeepCopy.
2596         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2597         already initialized.  If we see an override function, add its
2598         underlying base virtual function to the member_hash too.
2599
2600         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2601
2602 2005-03-26  Raja R Harinath  <harinath@acm.org>
2603
2604         Fix #73038.
2605         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2606         fails to resolve, ensure that the LHS is still resolved as an
2607         lvalue.
2608
2609 2005-03-25  Raja R Harinath  <harinath@acm.org>
2610
2611         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2612         ec.ContainerType.
2613         (Enum.current_ec): Remove.
2614         (Enum.LookupEnumValue): Remove EmitContext argument.
2615         Just uses the one created during DefineType.
2616         (Enum.FindMembers): Update.
2617         * expression.cs (MemberAccess.DoResolve): Update.
2618
2619 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2620
2621         * assign.cs (Assign.DoResolve): Check for CS1717 when
2622         source and target are same (uses Equals).
2623
2624         * expression.cs (LocalVariableReference, ParameterReference,
2625         This): Implemented Equals, GetHashCode.
2626
2627         * statement.cs (Block.GetParameterReference): Removed useless
2628         local variable.
2629
2630 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2631
2632         Fix cs0128.cs
2633         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2634         blocks before deciding whether the error is cs0136 or cs0128.
2635
2636         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2637         (using_alias_directive, using_namespace_directive): Pass
2638         MemberName, not an expression to Namespace.UsingAlias and
2639         Namespace.Using.
2640         (MakeName): Use the MemberName of the namespace.
2641         * namespace.cs (Namespace.MemberName): New.
2642         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2643         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2644         Likewise.
2645         * decl.cs (MemberName.Name): Make readonly.
2646         (MemberName.FromDotted): New "constructor".
2647         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2648         (MemberCore.Name): Compute from MemberName on demand.
2649         (MemberCore.SetMemberName): Provide a way to change the
2650         MemberName.
2651         (MemberCore.AddToContainer): Don't take a fullname parameter.
2652         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2653         fully qualified name of the container to the member name.
2654         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2655         only if the type is a member of the root container.
2656         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2657         MemberName.Left rather than searching for an embedded ".".
2658         (PartialContainer.CreatePart): Update to changes in RootContext.
2659         (MemberBase.ShortName): Turn into a property.  Use
2660         MemberCore.SetMemberName.
2661         (MemberBase.ExplicitInterfaceName): Remove.
2662         (MemberBase.UpdateMemberName): Remove.
2663         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2664         (PropertyBase.SetMemberName): New override.
2665         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2666         (Tree.GetDecl): New.
2667         (Tree.AllDecls): Rename from Decls.
2668         * attribute.cs, enum.cs, report.cs: Update to changes.
2669         * driver.cs (MainDriver): Use MemberName.FromDotted on
2670         RootContext.MainClass.
2671
2672 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2673
2674         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2675         checks.
2676
2677         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2678
2679 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2680
2681         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2682         property accessor modifiers.
2683
2684         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2685         fixed buffer attribute (CS1716).
2686         (PropertyMethod.HasCustomAccessModifier): When property accessor
2687         has custom modifier.
2688
2689         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2690         modifiers.
2691         (PropertyExpr.DoResolveLValue): Add CS0272.
2692
2693 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2694
2695         * convert.cs: When converting to a pointer, use the proper Conv.U
2696         or Conv.I depending on the source data type.
2697
2698         * cs-tokenizer.cs: Make the size for large decimal constants,
2699         fixes #72957.
2700
2701 2005-03-17  Martin Baulig  <martin@ximian.com>
2702
2703         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2704         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2705
2706 2005-03-17  Martin Baulig  <martin@ximian.com>
2707
2708         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2709         to bool so we can return an error condition.
2710         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2711         returned an error.
2712
2713 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2714
2715         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2716         attributes.
2717
2718 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2719
2720         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2721         Refactor to avoid traversing the list of assemblies, and to avoid
2722         string concatenation.
2723         * typemanager.cs (guid_attr_type): Remove.
2724         (negative_hits, pointers, references): Remove hashes.
2725         (type_hash): New.
2726         (GetConstructedType): New.  Uses type_hash to handle constructed
2727         types (arrays, references, pointers).
2728         (GetReferenceType, GetPointerType): Use it.
2729         (GetNestedType): New.  Uses type_hash to handle nested types of
2730         reflected types.
2731         (LookupType, LookupTypeDirect): Remove.
2732         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2733         'types' hash and LookupTypeReflection directly.
2734         (params_string, params_object): Use GetConstructedType.
2735         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2736         top-level types.
2737         (Namespace.Lookup): Use cached_types.
2738         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2739         provided by old TypeManager.LookupType.
2740         * rootcontext.cs (MakeFQN): Remove.
2741         * decl.cs (DeclSpace.MakeFQN): Likewise.
2742         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2743         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2744         TypeManager.GetConstructedType.
2745         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2746
2747 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2748
2749         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2750         indexers.
2751
2752         * cs-parser.jay: Reports CS1527 for any namespace element.
2753
2754         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2755         Added CS0407.
2756
2757         * expression.cs (ParameterReference.IsAssigned): Changed error to
2758         CS0269.
2759         (Error_WrongNumArguments): Moved CS0245 detection here.
2760
2761         * statement.cs (Return.Resolve): Add CS1622 report.
2762
2763 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2764
2765         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2766
2767 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2768
2769         * attribute.cs expression.cs: Get rid of some allocations.
2770
2771 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2772
2773         * doc.cs : just eliminate the latest change.
2774
2775 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2776
2777         * doc.cs : commented out the latest change. It breaks xml-030.cs
2778
2779 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2780
2781         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2782           fail. So invoke CreateType() in FindDocumentedType().
2783
2784 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2785
2786         * cs-tokenizer.cs : added IsKeyword().
2787         * doc.cs : Detect keyword incorrectly used as identifier.
2788           Allow identifiers prefixed by @.
2789
2790 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2791
2792         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2793         It caused exception in namespace resolving (again!).
2794         
2795         * class.cs (Class.ctor): Removed exit.
2796         (PropertyMethod.ctor): ditto.
2797         
2798         * codegen.cs (Codegen.Reset): Reset static data.
2799         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2800         
2801         * cs-tokenizer.cs (Cleanup): Removed.
2802         
2803         * driver.cs (GetSystemDir): Rewrote to one line command.
2804         It caused problem with unloaded dynamic modules.
2805         (UnixParseOption): Removed Exit.
2806         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2807         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2808         Now can be mcs used as library.
2809         
2810         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2811         empty location.
2812         
2813         * location.cs (Reset): Reset static data.
2814         
2815         * namespace.cs (Reset): Reset static data.
2816         
2817         * report.cs (Report.Reset): Reset static data.
2818         
2819         * rootcontext.cs (RootContext.Reset): Reset static data.
2820         
2821         * tree.cs (RootTypes.ctor): Use Location.Null
2822         
2823         * typemanager.cs (TypeManager.Reset): Reset static data.
2824         (CoreLookupType): Removed Exit.
2825         (TypeHandle.Reset): Reset static data.
2826         
2827 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2828
2829         Fix #73516.
2830         * typemanager.cs (ComputeNamespaces): Import namespaces from
2831         referenced modules too.
2832
2833 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2834
2835         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2836         than '.'.
2837
2838 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2839
2840         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2841         enclosing DeclSpace.  This ensures that a name-lookup populates
2842         more caches and there are fewer 'TypeExpression's.  Carve out
2843         nested type lookup into ...
2844         (LookupNestedTypeInHierarchy): ... this.
2845
2846 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2847
2848         Clean up a few partial-class semantics.  
2849         Fixes test-357.cs and cs1618-2.cs.
2850         * cs-parser.jay (struct_declaration): Use 'current_class' as
2851         parent of newly-created struct.  Remove call to Register ().
2852         Use 'pop_current_class' to complete handing the current struct.
2853         (interface_declaration): Likewise.
2854         (class_declaration): Likewise.
2855         (enum_declaration): Use 'current_class' as parent of newly created
2856         enum.
2857         (delegate_declaration): Likewise.
2858         (pop_current_class): New function.  This is used to handle closing
2859         up the 'current_class' and 'current_container', and pointing them
2860         to the enclosing class/container.
2861         (CSharpParser): Initialize 'current_class' too.
2862         * decl.cs (MemberCore): Add check for invariant: a partial
2863         container is not a parsed entity, and thus does not enclose any
2864         parsed members.
2865         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2866         (DeclSpace.BaseTypeExpr): Use it.
2867         (DeclSpace.LookupType): Add check for invariant.
2868         * class.cs (TypeContainer): Add check for invariant: a nested
2869         class should have the same NamespaceEntry as its enclosing class.
2870         (TypeContainer.EmitFieldInitializers): Make virtual.
2871         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2872         MemberCore.
2873         (TypeContainer.Register): Remove.
2874         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2875         null.  Use TypeResolveEmitContext for resolving base types and
2876         interfaces.  Move initialization of Parts.TypeBuilder here from
2877         ...
2878         (TypeContainer.DefineNestedTypes): ... here.
2879         (PartialContainer): Take a Namespace not a NamespaceEntry.
2880         (PartialContainer.Create): Don't use Register.  Call the
2881         appropriate Add... function directly.
2882         (ClassPart): Take both the PartialContainer and the enclosing
2883         class as constructor arguments.
2884         (ClassPart.EmitFieldInitializers): Override.
2885         (ClassPart.PartFindNestedTypes): Remove.
2886         (FieldBase.GetInitializerExpression): Resolve the initializer
2887         expression in the emit context of the enclosing class.
2888         * tree.cs (RootTypes): Remove Register ().
2889         
2890 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2891
2892         * cs-parser.jay: Removed CS0134.
2893         
2894         * driver.cs: Removed CS1901.
2895         
2896         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2897         for predefined types.
2898
2899 2005-03-07  Duncan Mak  <duncan@novell.com>
2900
2901         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2902         well. Fixes bug #73454.
2903
2904 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2905
2906         * cs-tokenizer.cs (xtoken): Add CS1035.
2907         
2908         * class.cs (MethodData.Define): Add CS0683.
2909         (FieldMember.ctor): Add CS0681.
2910
2911 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2912
2913         * ecore.cs (SimpleName.DoResolve): Rename from
2914         SimpleName.DoResolveAllowStatic.
2915         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2916         Pass 'intermediate' flag to MemberStaticCheck.
2917         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2918         of "intermediate" lookups via MemberAccess.
2919         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2920         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2921
2922 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2923
2924         Fix #73394.
2925         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2926         slipped in because of variable names that are identical to a
2927         builtin type's BCL equivalent ('string String;', 'int Int32;').
2928         (PropertyExpr.EmitInstance): Likewise.
2929
2930 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2931
2932         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2933         
2934         * report.cs (warning_ignore_table): Made public.
2935
2936 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2937
2938         Fix #73282.
2939         * class.cs (MethodData.Emit): Pass 'container' to
2940         container.GetObsoleteAttribute instead of 'container.Parent'.
2941
2942 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2943
2944         * cs-parser.jay: Add 1534 error test.
2945
2946         * iterators.cs (Yield.CheckContext): Add error 1629.
2947         (Iterator.ctor): Save unsafe modifier.
2948         (MoveNextMethod.DoEmit): Restore unsafe context.
2949
2950         * namespace.cs (UsingAlias): Better error message.
2951
2952 2005-03-03  Dan Winship  <danw@novell.com>
2953
2954         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2955         the warning message [#73219]
2956
2957 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2958
2959         Fix compile with MCS 1.0.0.0.
2960         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2961         w_restore to not depend on string constant folding.
2962
2963 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2964
2965         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2966         CS0246 check to users who passed 'silent = false'.
2967         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2968         check.
2969         (SimpleName.SimpleNameResolve): Update.
2970         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2971         (MemberAccess.IdenticalNameAndTypeName): Update.
2972         * doc.cs (FindDocumentedTypeNonArray): Update.
2973
2974 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2975
2976         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2977         * parameters.cs (ComputeAndDefineParameters): Remove.
2978         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2979         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2980         Use GetParameterInfo.
2981
2982 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2983
2984         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2985
2986 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2987
2988         Unify DeclSpace.LookupType and DeclSpace.FindType.
2989         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2990         is in charge of defining nested types on demand.
2991         (DeclSpace.LookupType): Use it when the current_type is a
2992         TypeBuilder.  Use LookupTypeDirect for reflected types.
2993         (DeclSpace.FindType): Remove.
2994         (DeclSpace.LookupInterfaceOrClass): Likewise.
2995         (DeclSpace.DefineTypeAndParents): Likewise.
2996         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2997         DeclSpace.LookupType.
2998         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2999         * typemanager.cs (LookupType): Simplify.
3000         (AddUserType): Remove type from negative_hits.
3001         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3002         * class.cs (TypeContainer.FindMembers): Move handling of nested
3003         types ...
3004         (TypeContainer.FindMembers_NestedTypes): ... here.
3005         (TypeContainer.FindNestedType): Implement override.
3006         (ClassPart.FindNestedType): Delegate to PartialContainer.
3007         (ClassPart.PartFindNestedType): Looks up the nested types of the
3008         part alone.
3009
3010 2005-03-02  Martin Baulig  <martin@ximian.com>
3011
3012         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3013         static constructor in static classes.
3014
3015 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3016
3017         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3018         sizeParamIndex is not specified.
3019
3020 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3021
3022         Fix #73117
3023         * report.cs (WarningMessage.IsEnabled): Missing null check.
3024
3025 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3026
3027         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3028         in the fields and not in the properties.
3029
3030 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3031
3032         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3033         fields as well.
3034
3035 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3036
3037         * attribute.cs: Small refactoring (improved robustness).
3038         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3039         (ValidateGuid): Removed.
3040         (Resolve): Removed referenced to above mentioned.
3041         (GetAttributeUsage): Made private and changed to work without
3042         class assistance.
3043         (GetIndexerAttributeValue): Don't crash.
3044         (GetConditionalAttributeValue): Ditto.
3045         (GetClsCompliantAttributeValue): Ditto.
3046         (ExtractSecurityPermissionSet): All attributes exceptions are
3047         error 648.
3048         (GetPropertyValue): New helper.
3049         (GetMethodImplOptions): New method.
3050         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3051         some missing properties.
3052         
3053         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3054         (Method.ApplyAttributeBuilder): Updated.
3055         
3056         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3057         exception.
3058
3059 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3060
3061         Fix #73052.
3062         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3063         non-simple types (array, pointer, reference).
3064
3065 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3066
3067         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3068
3069         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3070         for operators.
3071         (Method.CheckBase): Catch wrong destructor here.
3072         (MethodData.Define): Add errors 550, 668.
3073
3074         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3075
3076         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3077
3078         * pending.cs (VerifyPendingMethods): Add error 551.
3079
3080         * typemanager.cs (CSharpName): Next error report helper.
3081
3082 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3083
3084         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3085         attributes. Removed useless attribute double check.
3086         It saves almost 2MBs for corlib.
3087
3088 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3089
3090         Fix #72924.
3091         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3092         called twice in case of error.
3093
3094 2005-02-23  Chris Toshok  <toshok@ximian.com>
3095
3096         Fix compiler portions of #72827.
3097         * statement.cs (Block.Emit): call Begin/EndScope on the
3098         EmitContext instead of the ILGenerator.
3099
3100         * codegen.cs (EmitContext.BeginScope): new method, call
3101         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3102         we have one.)
3103         (EmitContext.BeginScope): same, but EndScope and CloseScope
3104
3105         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3106         offset and call the superclass's OpenScope(int) with it.
3107         (SymbolWriter.CloseScope): get the current il
3108         offset and call superclass's CloseScope(int) with it.
3109
3110 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3111
3112         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3113         CS1677 for out and ref as well.
3114
3115         * class.cs (Method.Define): Add error CS1599 detection.
3116         
3117         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3118         
3119         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3120         
3121         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3122         
3123         * support.cs.cs (ModifierDesc): New helper method.
3124
3125 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3126             Abin Thomas  <projectmonokochi@rediffmail.com>
3127             Anoob V E  <projectmonokochi@rediffmail.com>
3128             Harilal P R  <projectmonokochi@rediffmail.com>
3129
3130         Fix #57851, #72718.
3131         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3132         MemberLookup (used for error reporting) actually returns a result.
3133         Fix error report number (122, not 112).
3134
3135 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3136             Anoob V E  <projectmonokochi@rediffmail.com>
3137             Harilal P R  <projectmonokochi@rediffmail.com>
3138
3139         Fix #71134.
3140         * pending.cs (PendingImplementation.GetAbstractMethods):
3141         Find NonPublic members too.
3142
3143 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3144
3145         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3146         Fixed error 217.
3147         
3148         * class.cs (MethodCore.CheckMethodAgainstBase):
3149         Add error 239 report.
3150
3151 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3152
3153         Fix #68955.
3154         * expression.cs (Invocation.IsApplicable): Make public.
3155         (Invocation.IsParamsMethodApplicable): Likewise.
3156         * delegate.cs (Delegate.VerifyApplicability): Don't use
3157         Invocation.VerifyArgumentCompat for parameter applicability
3158         testing.  Use Invocation.IsApplicable and
3159         Invocation.IsParamsMethodApplicable.
3160
3161 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3162
3163         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3164         
3165         * class.cs (Operator.Define): Add error 217 report.
3166         
3167 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3168
3169         * namespace.cs (UsingEntry.Resolve): Undo change below.
3170
3171 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3172
3173         Fix #72756.
3174         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3175         disable the error message when the extended MemberLookup also
3176         fails.
3177         (Expression.MemberLookupFinal): Update.
3178         (SimpleName.DoSimpleNameResolve): Update.
3179         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3180         Don't use MemberLookupFinal.
3181         (New.DoResolve): Update.
3182         (BaseAccess.CommonResolve): Update.
3183
3184 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3185
3186         Fix #72732.
3187         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3188         occured previously, don't resolve again.
3189
3190 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3191
3192         Fix #69949
3193         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3194         argument. Call ResolveAttributeUsage for unresolved.
3195         when types doesn't match ctor arguments.
3196         
3197         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3198         for nested attribute classes.
3199         (Class.attribute_usage): Removed.
3200         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3201         for attribute class.
3202         
3203         * ecore.cs (IsAttribute): Removed.
3204         
3205         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3206         
3207         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3208         now normal types.
3209         (attribute_types): Removed.
3210         (EmitCode): Global attributes are emited as the latest.
3211
3212 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * class.cs (EmitFieldInitializers): Don't emit field initializer
3215         for default values when optimilization is on.
3216         
3217         * constant.cs (Constant.IsDefaultValue): New property.
3218         
3219         * driver.cs: Add /optimize handling.
3220         
3221         * constant.cs,
3222         * ecore.cs,
3223         * literal.cs: Implement new IsDefaultValue property.
3224         
3225         * rootcontext.cs (Optimize): New field, holds /optimize option.
3226
3227 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3228
3229         Fix crasher in re-opened #72347.
3230         * namespace.cs (Namespace.Lookup): Return null if
3231         DeclSpace.DefineType returns null.
3232
3233         Fix #72678.
3234         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3235
3236 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3237
3238         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3239         now returns null if it cannot resolve to an lvalue.
3240         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3241         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3242         returned null.  Remove check for SimpleName.
3243         (EventExpr.DoResolveLValue): New.
3244         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3245         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3246         error from ...
3247         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3248         avoid CS0131 error.
3249         (Unary.ResolveOperator): Move CS0211 check ...
3250         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3251         CS0131 error.
3252         (Unary.DoResolveLValue): Simplify.
3253         (AddressOf.DoResolveLValue): New.
3254         (ArrayAccess.DoResolveLValue): New.
3255
3256 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3257
3258         * attribute.cs (Attribute.Resolve): Add arguments casting for
3259         when types doesn't match ctor arguments.
3260
3261 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3262
3263         Fix parts of #63202.
3264         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3265         lookup of operator in base type.  Ensure that all checks happen
3266         when the operator resolves to an "op_..." method.
3267
3268 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3269
3270         Fix #71992.
3271         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3272         'ignore_cs0104' parameter.  Pass it to ...
3273         (NamespaceEntry.Lookup): ... this.
3274         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3275         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3276         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3277         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3278         Update.  Request that cs0104 errors be ignored.
3279         (ComposedCast.ResolveAsTypeStep): Update.
3280
3281 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3282
3283         Fix #59209.
3284         * expression.cs (Invocation.BetterFunction): Remove support for
3285         comparing virtual functions and their overrides.
3286         (Invocation.IsOverride): New.
3287         (Invocation.OverloadResolve): Don't consider 'override' functions
3288         during candidate selection.  Store them in a lookaside list.
3289         If the selected method is a 'virtual' function, use the list to
3290         find any overrides that are closer to the LHS type.
3291
3292 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3293
3294         * expression.cs (New.DoResolve): Add complex core type reduction.
3295         (New.Constantify): Converts complex core type syntax like 'new int ()'
3296         to simple constant.
3297         
3298 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3299
3300         * decl.cs (EntryType.EntryType): New constructor to create an
3301         updated copy of a cache entry.
3302         (MemberCache.AddMethods): Use it.
3303         (MemberCache.ClearDeclaredOnly): Remove.
3304         (MemberCache.MemberCache): Update.
3305
3306 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3307
3308         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3309         variable.  This one is represents the actual low-level declaration
3310         of the method, as opposed to the semantic level `IsStatic'.   
3311
3312         An anonymous method which is hosted into a static method might be
3313         actually an instance method.  IsStatic would reflect the
3314         container, while MethodIsStatic represents the actual code
3315         generated.
3316
3317         * expression.cs (ParameterReference): Use the new MethodIsStatic
3318         instead of IsStatic.
3319
3320         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3321         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3322         set on the current EmitContext. 
3323
3324         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3325         resolve our casted expression as an LValue.  This triggers the
3326         proper LValue processing that is later required by Assign.
3327
3328         This fixes 72347.
3329
3330         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3331
3332 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3333
3334         C# 2.0 Fixed buffer implementation
3335
3336         * anonymous.cs: Update after RegisterHelperClass renaming.
3337
3338         * attribute.cs (AttributeTester.fixed_buffer_cache):
3339         Cache of external fixed buffers.
3340         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3341         implementation if field is fixed buffer else null.
3342
3343         * class.cs
3344         (TypeContainer.AddField): Accept FieldMember instead of Field.
3345         (FieldBase.IsFieldClsCompliant): Extracted code from
3346         VerifyClsCompliance descendant customization.
3347         (FixedField): New class handles fixed buffer fields.
3348         (FixedFieldExternal): Keeps information about imported fixed
3349         buffer.
3350         (IFixedField): Make access to internal or external fixed buffer
3351         same.
3352
3353         * cs-parser.jay: Add fixed buffer parsing.
3354
3355         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3356         buffer.
3357
3358         * expression.cs (Indirection): Extended implementation to accept
3359         fixed buffer field.
3360         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3361         (ElementAccess.MakePointerAccess): Get type as parameter.
3362         (DoResolve): Add fixed buffer field expression conversion.
3363         (DoResolveLValue): Ditto.
3364         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3365         (ArrayPtr): Derives from FixedBufferPtr.
3366         (ArrayPtr.Emit): Add extra emit for array elements.
3367
3368         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3369
3370         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3371         for compiler generated types.
3372         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3373
3374         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3375         and consume less memory.
3376         (Fixed.Resolve): Add fixed buffer case.
3377
3378         * typemanager.cs (compiler_generated_attr_ctor,
3379         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3380         (HasElementType): Add our own implementation to work on every
3381         runtime.
3382
3383 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3384
3385         * anonymous.cs (CaptureContext): Track whether `this' has been
3386         referenced.   
3387
3388         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3389         only captured `this' if it was implicitly done (instance
3390         methods/variables were used). 
3391
3392         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3393         `this' must be captured.
3394
3395 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3396  
3397         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3398         is null it means that there has been no need to capture anything,
3399         so we just create a sibling.
3400
3401         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3402
3403         Just a partial fix.  The other half is fairly elusive.
3404         
3405 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3406
3407         Fix #52586, cs0121-4.cs.
3408         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3409         and return a hashtable.
3410         (MemberCache.ClearDeclaredOnly): New.
3411         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3412         the method_hash of a base type too.
3413         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3414         type methods.  Overwrite entries with the same MethodHandle so
3415         that the ReflectedType is correct.  The process leaves in base
3416         virtual functions and their overrides as distinct entries.
3417         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3418         matters since it was boxed in a ArrayList before.
3419         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3420         modifier.
3421         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3422         case of a virtual function and its override (choose the overload
3423         as better).
3424         (Invocation.OverloadResolve): Avoid 'override' members during
3425         'applicable_type' calculation.
3426
3427 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3428
3429         Combine two near-redundant caches.
3430         * typemanager.cs (method_params): Rename from method_internal_params.
3431         (TypeManager.GetParameterData): New.  Replace
3432         Invocation.GetParameterData.
3433         (TypeManager.LookupParametersByBuilder): Remove.
3434         * expression.cs (Invocation.method_parameter_cache): Remove.
3435         (Invocation.GetParameterData): Remove.
3436         Update to changes.
3437         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3438         Update to changes.
3439
3440 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3441
3442         Fix #72015.
3443         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3444         TypeManager.multicast_delegate_type is null, resolve it by looking
3445         up "System.MulticastDelegate".
3446         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3447
3448 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3449             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3450             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3451
3452         Fix cs0164.cs.
3453         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3454         (LabeledStatement.AddReference): New.  Set 'referenced'.
3455         (Goto.Resolve): Use it.
3456
3457 2005-02-05  John Luke  <john.luke@gmail.com>
3458
3459         * driver.cs: remove duplicate -doc line in Usage ()
3460
3461 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3462
3463         * location.cs (Location.AddFile): Fix CS2002 error report.
3464
3465 2005-02-02  Martin Baulig  <martin@ximian.com>
3466
3467         * delegate.cs (Delegate.DefineType): Report an internal error if
3468         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3469         details.        
3470
3471 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3472
3473         Fix a crasher in a variant of #31984.
3474         * const.cs (Constant.CheckBase): New override that defers the
3475         new-or-override check in case the base type hasn't been populated
3476         yet.
3477         (Constant.Define): Ensure the new-or-override check is performed.
3478
3479 2005-02-01  Duncan Mak  <duncan@ximian.com>
3480
3481         * const.cs (LookupConstantValue): Check that `ce' is not null
3482         before calling GetValue ().
3483
3484 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3485
3486         Fix test-334.cs (#69519).
3487         * cs-parser.jay (using_alias_directive): Pass in an expression to
3488         NamespaceEntry.UsingAlias.
3489         (using_namespace_directive): Pass in an expression to
3490         NamespaceEntry.Using.
3491         (namespace_name): Don't flatten to a string.
3492         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3493         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3494         ResolveAsTypeStep.
3495         (NamespaceEntry.UsingEntry): Likewise.
3496         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3497         changes.
3498         (NamespaceEntry.LookupForUsing): Remove.
3499         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3500         names.
3501         (NamespaceEntry.Lookup): Remove support for dotted names.
3502
3503 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3504
3505         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3506         split into two.
3507         (NamespaceEntry.ImplicitParent): Compute on demand.
3508         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3509         parallels the current.
3510         (NamespaceEntry.LookupForUsing): Use it.
3511         (NamespaceEntry.Lookup): If the current namespace-entry is
3512         implicit, don't search aliases and using tables.
3513
3514 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3515
3516         Fix #31984.
3517         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3518         BaseCache here.
3519         (TypeContainer.BaseCache): Compute on demand.
3520         (TypeContainer.FindMembers): Define constants and types if they're
3521         not already created.
3522         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3523         check.
3524         * const.cs (Constant.Define): Make idempotent.
3525
3526 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3527
3528         * pending.cs: Produce better code (no nops produced by using Ldarg
3529         + value).
3530         
3531         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3532         i - 1' it should be arg + 1.
3533
3534         Fixes bug #71819.
3535
3536 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3537
3538         * attribute.cs (Attribute.CheckAttributeType): Make private
3539         non-virtual.
3540         (Attribute.ResolveType): Make virtual.
3541         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3542         handling of RootContext.Tree.Types.
3543
3544 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3545
3546         Update attribute-handling to use the SimpleName/MemberAccess
3547         mechanisms.
3548         * cs-parser.jay (attribute): Pass in an expression to the
3549         constructors of Attribute and GlobalAttribute.
3550         * attribute.cs (Attribute): Take an expression for the name.
3551         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3552         passed in attribute name expression.
3553         (Attribute.CheckAttributeType): Use it.
3554         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3555         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3556         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3557         argument to prevent error messages if the lookup fails.
3558
3559 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3560
3561         * expression.cs (Indirection): Implemented IVariable interface
3562         to support indirection in AddressOf operator.
3563         (PointerArithmetic.Emit): Add optimalization for case where
3564         result can be precomputed.
3565
3566 2005-01-26  Martin Baulig  <martin@ximian.com>
3567
3568         * class.cs (TypeContainer.AttributeTargets): Return the correct
3569         AttributeTargets depending on our `Kind' instead of throwing an
3570         exception; fixes #71632.
3571
3572 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3573
3574         Fix #71257
3575         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3576         constant members.
3577
3578 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3579
3580         Fix #71602.
3581         * expression.cs (MemberAccess.DoResolve): Don't complain with
3582         cs0572 when the LHS of a member access has identical name and type
3583         name.
3584
3585 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3586
3587         Fix #71651, #71675
3588         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3589         CreatePermission.
3590         Create custom PermissionSet only for PermissionSetAttribute.
3591
3592 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3593
3594         Fix #71649
3595         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3596         delegates in static class.
3597
3598 2005-01-24  Martin Baulig  <martin@ximian.com>
3599
3600         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3601         merging an implicit block, just use its reachability.
3602
3603         * statement.cs (Block.Resolve): Make the unreachable code check
3604         work wrt. implicit blocks; see test-337 from #63842.
3605
3606 2005-01-21  Alp Toker  <alp@atoker.com>
3607  
3608         * cs-parser.jay: destructor_declaration's container is PartialContainer
3609         not Class when partial types are used, so use Kind prop instead of
3610         'is'.
3611         
3612 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3613
3614         * cs-parser.jay: Improve error reporting when an interface
3615         declares new types.
3616
3617 2005-01-20  Dick Porter  <dick@ximian.com>
3618
3619         * support.cs: SeekableStreamReader fix from Sandor Dobos
3620         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3621         chars are read.  Fixes bug 70369.
3622
3623 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3624
3625         * cs-parser.jay (catch_clause): Simplify current_block handling
3626         somewhat.
3627
3628 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3629
3630         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3631         code with ImplicitStandardConversion to handle the implicit
3632         conversion of method groups into valid delegate invocations. 
3633
3634         The problem is that in parameter handling we were using this code
3635         path.  Fixes bug #64698
3636
3637 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3638
3639         * cs-parser.jay: Fix several infelicities.
3640         - Avoid assigning to the parser value stack.  Code like 
3641           '$3 = null' is unclean.  Synthesize a value for the code block
3642           instead. 
3643         - Avoid using oob_stack for storing location information.  Use ...
3644         (_mark_): ... this.  New (empty) rule.  Saves the current location
3645         in $$.
3646         (foreach_statement): Avoid using oob_stack for current_block
3647         handling.  Use technique used in for_statement and
3648         using_statement.  Synthesize a value for the code block to store
3649         additional intermediate information.
3650
3651 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3652
3653         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3654         of a different type is only allowed to private fields of a
3655         containing type, not on fields of a base class.
3656
3657         See test-174.cs and error cs0122-9.cs
3658
3659 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3660
3661         Fix test-335.cs (bug #58126).
3662         * cs-parser.jay (argument): Split out non-expression parts of the
3663         rule into 'non_simple_argument'.
3664         (invocation_expression): Support parenthesized invocations with
3665         multiple arguments, and with single non-simple arguments.
3666
3667 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3668
3669         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3670         places.
3671
3672 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3673
3674         Fix cs0038-1.cs, cs1640-6.cs.
3675         * ecore.cs (Expression.Resolve): Remove special-case for
3676         SimpleName in error-handling.
3677         (Expression.almostMatchedMembers): Relax access permission to
3678         protected.
3679         (Expression.MemberLookupFailed): Handle duplicates in
3680         almostMatchedMembers list.
3681         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3682         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3683         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3684         overload if the passed in MemberInfo is a MethodBase.
3685
3686 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3687
3688         Fix #70749
3689         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3690         for non-CAS & merge permission sets properly.
3691
3692 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3693
3694         Improve standard-compliance of simple name and member access 
3695         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3696         * ecore.cs (FullNamedExpression): New abstract base class 
3697         for Namespaces and TypeExpressions.
3698         (ResolveFlags.SimpleName): Remove.
3699         (SimpleName): Remove support for dotted names.
3700         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3701         DeclSpace.FindType and DeclSpace.LookupType.
3702         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3703         (Expression.ExprClassName): Make member function.
3704         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3705         a namespace.  Remove creation of dotted "SimpleName"s.
3706         (MemberAccess.DoResolve): Likewise.
3707         * decl.cs (DeclSpace.Cache): Make private.
3708         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3709         (DeclSpace.FindType): Update.
3710         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3711         FullNamedExpression.
3712         * namespace.cs (Namespace): Derive from FullNamedExpression
3713         so that it can be part of expression resolution.
3714         (Namespace.Lookup): Return an FullNamedExpression.
3715         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3716         namespace.
3717         * rootcontext.cs (NamespaceLookup): Remove.
3718         (LookupType): Move to DeclSpace.
3719         * attribute.cs (CheckAttributeType): Update.
3720         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3721         (FindDocumentedTypeNonArray): Likewise.
3722
3723 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3724
3725         Fix cs0509.cs, cs1632.cs.
3726         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3727         is the same as IsInterface.
3728         (TypeContainer.GetClassBases): Likewise.
3729         * statement.cs (LabeledStatement.ig): New field.
3730         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3731         label.
3732         (LabeledStatement.DoEmit): Check that the label was created with
3733         the same ILGenerator.
3734
3735 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3736
3737         Fix #71058
3738         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3739         accessors to its properties.
3740
3741         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3742         from accessors to property.
3743         
3744 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3745
3746         Fix #70722
3747         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3748         only for overrides.
3749         
3750 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3751
3752         * attribute.cs: Check for null and empty strings.  
3753
3754         I have lost another battle to Paolo.
3755
3756 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3757
3758         Fix #70942
3759         * class.cs (PropertyMethod): Set Parent field in ctors.
3760         (SetMethod.InternalParameters): Add unsafe switch hack.
3761         Override MarkForDuplicationCheck where it is appropriate.
3762
3763         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3764         It says whether container allows members with the same name.
3765         Base default is no.
3766         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3767         Removed is_method parameter.
3768
3769 2005-01-06  Duncan Mak  <duncan@ximian.com>
3770
3771         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3772         because the previous change led to incorrect reporting of CS1032
3773         ("Cannot define/undefine preprocessor symbols after first token in
3774         file"). Instead of using `tokens_seen' as the only flag that
3775         triggers CS1040, introduce `comments_seen'. This new flag is used
3776         to signify having seen comments on the current line, so it is
3777         unset after a newline.
3778
3779 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3780
3781         * doc.cs : When searching for a type, find nested type too.
3782           This fixes bug #71040.
3783
3784 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3785
3786         * doc.cs :
3787           - Warn missing member comment on those classes which also does not
3788             have doc comments. Fixed bug #71041.
3789           - Don't warn missing doc comment on default constructor.
3790             Fixed bug #71042.
3791
3792 2005-01-06  Duncan Mak  <duncan@ximian.com>
3793
3794         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3795         comments, set `tokens_seen' to true. This allows us to detect
3796         misplaced preprocessor directives (i.e. not at the beginning of
3797         the a line, nor after whitespaces). In that case, report error
3798         CS1040. This fixes bug #56460.
3799
3800         * cs-parser.jay (interface_member_declaration): Add checks for
3801         IsExplicitImpl, and report CS0541 error if an interface member is
3802         defined as an explicit interface declaration.
3803
3804 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3805
3806         Fix #70817
3807         * class.cs (PropertyMethod): Set Parent field in ctors.
3808         (SetMethod.InternalParameters): Add unsafe switch hack.
3809         
3810         * decl.cs (MemberCore.Parent): Cannot be readonly.
3811
3812 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3813
3814         * decl.cs (DeclSpace.ResolveType): Remove.
3815         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3816         Merge in code from ...
3817         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3818         * class.cs, enum.cs: Update to changes.
3819
3820 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3821
3822         * anonymous.cs: Ensure that we init the scope of our parent if it
3823         has not been initialized yet.
3824
3825 2004-12-30  Duncan Mak  <duncan@ximian.com>
3826
3827         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3828         if field.FieldBuilder is null. Fixes #70758.
3829
3830         * convert.cs: Fixed some typos and updated some of the comments.
3831         (ImplicitStandardConversionExists):
3832         (TryImplicitIntConversion): If `target_type' is an interface and
3833         the type of `ic' implements this interface, return true or a new
3834         BoxedCast instead of null. This fixes #70468.
3835
3836 2004-12-29  Duncan Mak  <duncan@ximian.com>
3837
3838         * expression.cs (Argument.Emit): Check that Expr is
3839         IMemoryLocation before casting to it, and report CS1510 otherwise.
3840
3841         This fixes #70402.
3842
3843 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3844
3845         * statement.cs (Block.ThisVariable): remove the recursion here, to
3846         make the --profile more sane.
3847
3848 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3849
3850         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3851         assembly, by JB Evain.
3852
3853 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3854
3855         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3856           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3857         "parent" refers to enclosing type/class.  "base" refers to superclass.
3858
3859 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3860
3861         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3862         Ensure that we only have GlobalAttributes.
3863         * attribute.cs (Attribute.Emit): Make non-virtual.
3864         (GlobalAttribute.Emit): Remove.
3865         (Attribute.Resolve): Make virtual.
3866         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3867         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3868         the argument. Don't create one.
3869         (Attribute.GetObsoleteAttribute): Likewise.
3870         (Attribute.GetClsCompliantAttributeValue): Likewise.
3871         * class.cs, decl.cs: Update to changes.
3872
3873 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3874
3875         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3876         
3877         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3878         
3879         * statement.cs (Foreach.Resolve): Add error 186 report.
3880
3881 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3882
3883         * expression.cs (Conditional.DoResolve): Add warning 429.
3884         
3885         * statement.cs (If.Resolve): Add warning 665.
3886
3887 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3888
3889         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3890         except when in the parser, and in GlobalAttribute.
3891         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3892         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3893         RootContext.Tree.Types.NamespaceEntry once work is done.
3894         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3895         and resets RootContext.Tree.Types.NamespaceEntry.
3896
3897 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3898
3899         * cs-parser.jay: Don't create a block for every variable.
3900
3901 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3902
3903         * location.cs: Provide extra information.
3904
3905         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3906         variables from the captured environment, it is the ldarg_0.
3907
3908 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3909
3910         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3911         find a conclusion.
3912         
3913         * class.cs: Changed warning level for 169 to avoid developer
3914         displeasure from warning flooding. It will be changed back when they
3915         fix most of current BCL warnings.
3916         
3917         * RootContext.cs: Pushed default WarningLevel to 3.
3918         
3919         * statement.cs: Removed unused variable.
3920
3921 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3922
3923         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3924         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3925         Add error 502 report.
3926         (StaticClass.DefineType): Add error 441 report.
3927         (Class.AllowedModifiersProp): New virtual property as temporary
3928         extension to AllowedModifiers.
3929         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3930         to share implementation with StaticClass and don't call virtual
3931         methods from ctor.
3932         
3933         * driver.cs (MainDriver): Add error 1558 test.
3934
3935         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3936         report. Moved error 36 test here.
3937
3938         * statement.cs (Throw.Resolve): Add error 724 report.
3939
3940         * typemanager.cs: Add out_attribute_type core type.
3941         
3942 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3943
3944         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3945         3018 report.
3946         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3947
3948         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3949         3017 report.
3950         
3951         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3952
3953         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3954         Add error 3023 report.
3955         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3956
3957         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3958         implementation.
3959
3960 2004-12-12  John Luke  <john.luke@gmail.com>
3961
3962         * driver.cs (AddArgs): take -- into account when
3963         adding arguments, fixes bug 65710 
3964
3965 2004-12-12  Martin Baulig  <martin@ximian.com>
3966
3967         * expression.cs (Unary.TryReduceNegative): Added support for
3968         SByteConstant and ByteConstant.
3969         (Unary.Reduce): Check error values from TryReduceNegative().
3970
3971 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3972
3973         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3974         and report exception as error 182.
3975
3976 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3977
3978         * driver.cs (Main): Fix message when there are warnings.
3979
3980 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3981
3982         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3983
3984 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3985
3986         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3987         Reduced number of warnings.
3988         
3989         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3990
3991 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3992
3993         * driver.cs: Removed message.
3994
3995         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3996
3997 2004-12-08    <vargaz@freemail.hu>
3998
3999         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4000
4001 2004-12-08  Martin Baulig  <martin@ximian.com>
4002
4003         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4004         instead of a CS3002 for properties and indexer.
4005
4006 2004-12-08  Martin Baulig  <martin@ximian.com>
4007
4008         * decl.cs (MemberName.ToString): Make this work again.
4009
4010 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4011
4012         * attribute.cs (Resolve): Add error 591 detection.
4013
4014         * class.cs (FieldMember.Define): Add error 1547 detection.
4015         (Indexer.Define): Add error 620 detection.
4016         (Operator.Define): Add error 590 detection.
4017
4018         * ecore.cs: Missing argument for error 79.
4019
4020         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4021         detection.
4022
4023 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4024
4025         Fix #70106
4026         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4027         only.
4028
4029 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4030
4031         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4032           Some operator comments were suppressed.
4033         * doc.cs : Implicit/explicit operator name in doc comments are like
4034           "op_Explicit(type)~returnType", so added suffix handling.
4035
4036 2004-12-07  Martin Baulig  <martin@ximian.com>
4037
4038         * decl.cs
4039         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4040         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4041         (DeclSpace.ec): New protected field; store the EmitContext here.
4042         (DeclSpace.EmitContext): New public property; moved here from
4043         `TypeContainer'.
4044         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4045         EmitContext.
4046
4047         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4048         (Enum.Emit): Don't create a new EmitContext.
4049
4050         * delegate.cs (Delegate.DefineType): Always create the
4051         EmitContext.
4052
4053         * iterators.cs (Iterators.DefineIterator): Create a new
4054         EmitContext and store it in `ec'.
4055
4056 2004-08-24  Martin Baulig  <martin@ximian.com>
4057
4058         * typemanager.cs
4059         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4060         this for accessibility checks.
4061         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4062         IsNestedFamilyAccessible.
4063         (TypeManager.IsSubclassOf): New method, do what the name actually
4064         says.   
4065
4066 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4067
4068         Fix crash on cs0657-17.cs.
4069         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4070         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4071         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4072         the case where the NamespaceEntry gets overwritten.
4073
4074 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4075
4076         Fixed #69195, #56821
4077         * ecore.cs (ResolveBoolean): Tiny refactoring.
4078
4079         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4080         of right expression resolving when left is false constant and
4081         operator is LogicalAnd OR true constant and operator is LogicalOr.
4082
4083         * statement.cs (ResolveUnreachable): Always reports warning.
4084
4085 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4086
4087         * class.cs: Distinguish between 1721 and 1722 (just a little help
4088         for the programmer).
4089
4090 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4091
4092         * delegate.cs: Only allow this on new versions of the language. 
4093
4094 2004-12-02  Duncan Mak  <duncan@ximian.com>
4095
4096         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4097         Expression class.
4098         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4099         here as a static method. Take an additional bool out parameter
4100         `must_do_cs1540_check' for signaling to InstanceResolve.
4101         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4102         member field from PropertyExpr class and made it an argument of
4103         the method instead.
4104         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4105         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4106         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4107         and `remove_accessor' as well as InstanceResolve: report CS0122
4108         where applicable.
4109
4110         Fixes #70129.
4111
4112 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4113
4114         Fix test-327.cs, test-328.cs, and put in early infrastructure
4115         for eventually fixing #52697.
4116         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4117         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4118         from other methods.
4119         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4120         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4121         (VerifyUsing, error246): Update.
4122         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4123         'NamespaceEntry.LookupNamespaceOrType'.
4124
4125 2004-12-03  Martin Baulig  <martin@ximian.com>
4126
4127         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4128         method as our child, call AnonymousMethod.Compatible() on it.
4129
4130 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4131
4132         Disable XML documentation support in 'basic' profile.
4133         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4134         Redirect XmlElement to System.Object.
4135         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4136         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4137         * mcs.exe.sources: Add doc-bootstrap.cs.
4138         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4139         of doc.cs.
4140
4141 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4142
4143         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4144           comments are allowed.
4145
4146 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4147
4148         * delegate.cs: Add checks for subtypes in paramaters and return values
4149         in VerifyMethod () to add support for Covariance/Contravariance
4150         in delegates.
4151         
4152 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4153
4154         * report.cs: Remove extra closing parenthesis.
4155
4156         * convert.cs (Error_CannotImplicitConversion): If the name of the
4157         types are the same, provide some extra information.
4158
4159         * class.cs (FieldBase): Use an unused bit field from the field to
4160         encode the `has_offset' property from the FieldMember.  This saves
4161         a couple of Ks on bootstrap compilation.
4162
4163         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4164         method as our child, return the AnonymousMethod resolved
4165         expression.
4166
4167         * expression.cs (New.DoResolve): Allow return values from
4168         NewDelegate to also include AnonymousMethods.
4169
4170         Fixes #70150.
4171
4172 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4173
4174         Fix bug #70102
4175         * attribute.cs (Resolve): Improved implementation of params
4176         attribute arguments.
4177
4178         * support.cs (ParameterData): Add HasParams to be faster.
4179
4180 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4181
4182         all things are for /doc support:
4183
4184         * doc.cs: new file that supports XML documentation generation.
4185         * mcs.exe.sources: added doc.cs.
4186         * driver.cs:
4187           Handle /doc command line option.
4188           Report error 2006 instead of 5 for missing file name for /doc.
4189           Generate XML documentation when required, after type resolution.
4190         * cs-tokenizer.cs:
4191           Added support for picking up documentation (/// and /** ... */),
4192           including a new XmlCommentState enumeration.
4193         * cs-parser.jay:
4194           Added lines to fill Documentation element for field, constant,
4195           property, indexer, method, constructor, destructor, operator, event
4196           and class, struct, interface, delegate, enum.
4197           Added lines to warn incorrect comment.
4198         * rootcontext.cs :
4199           Added Documentation field (passed only when /doc was specified).
4200         * decl.cs:
4201           Added DocComment, DocCommentHeader, GenerateDocComment() and
4202           OnGenerateDocComment() and some supporting private members for
4203           /doc feature to MemberCore.
4204         * class.cs:
4205           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4206         * delegate.cs:
4207           Added overriden DocCommentHeader.
4208         * enum.cs:
4209           Added overriden DocCommentHeader and GenerateDocComment().
4210
4211 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4212
4213         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4214         unwrapping the enumeration values, chain to
4215         DoConstantNumericPromotions again, so we can promote things to the
4216         fundamental types (takes care of enums that are bytes, sbytes).
4217
4218         Fixes bug #62054.
4219
4220 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4221
4222         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4223         Fix long-standing bug in type-lookup.  Use FindType instead of
4224         LookupType when ec.ResolvingTypeTree.
4225         (Attribute.ResolveType, Attribute.Resolve)
4226         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4227         Update to changes.
4228         (Attributes.Search): Remove internal version.  Update.
4229         (Attributes.SearchMulti): Update.
4230         (Attributes.GetClsCompliantAttribute): Remove.
4231         (Attributes.GetIndexerNameAttribute): Remove.
4232         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4233         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4234         * class.cs (Indexer.Define): Likewise.
4235
4236 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4237
4238         Fix bug #68790
4239         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4240         MarshallByReference members access.
4241
4242         * expression.cs: Use CheckMarshallByRefAccess;
4243         Better error CS0197 message.
4244
4245         * report.cs: Print whole related error message.
4246
4247 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4248
4249         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4250         the current directory to help debugging.
4251
4252 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4253
4254         * class (GetClassBases): Better error 60 report.
4255         (EventProperty): Disabled warning 67 detection.
4256
4257 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4258
4259         Fix bug #60324
4260         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4261
4262         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4263         precise values.
4264
4265 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4266
4267         Fix bug #49488
4268         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4269
4270         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4271
4272 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4273
4274         * attribute.cs (Attribute.Resolve): Refine error reporting and
4275         report a cs0117 if the identifier does not exist, to distinguish
4276         from 0617 which is a miss-use of the actual identifier.
4277
4278         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4279         between cs0070 and cs0079.
4280
4281         * class.cs (MemberBase.DoDefine): When reporting a wrong
4282         accessibility level, we use MethodCore to compare instead of
4283         Method (this was a regression in some refactoring effort).
4284
4285         So now we correctly report cs0056 again.
4286
4287         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4288         testing the target_type (which was known to be object_type) and
4289         not the source type (which is anonymous_method).
4290
4291         Fixed reporting of error cs1660.
4292
4293         * expression.cs (UserCast.Source): Expose the underlying cast.
4294
4295         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4296         allowed types to find a match to int32 first (most common).
4297
4298         In addition, it ignores any ImplicitUserConversions that did an
4299         internal implicit conversion (as the switch statement allows only
4300         one integral conversion to exist).
4301
4302         * class.cs (PartialContainer.Create): rename `name' to
4303         `member_name' for clarity.  Then replace the string calls with a
4304         call to MemberName.GetPartialName, as now using
4305         MemberName.ToString is an error (this is due to the side effects
4306         it had, that were fixed in the past).
4307
4308         This will restore the error reporting on a number of partial class
4309         errors that were missusing this (and getting an exception as a
4310         results, which is now just a plain textual warning, because
4311         yyparse debug output would crash otherwise).
4312
4313 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4314
4315         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4316
4317 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4318
4319         * rootcontext.cs (LookupType): Make sure to cache lookups that
4320         don't give us a negative result. This saves about 5% of corlib
4321         compilation time.
4322
4323 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4324
4325         * report.cs (AbstractMessage.Print): messages are sent to stderr
4326
4327         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4328         non-interface in the list of interfaces (at this point, either
4329         parent was properly set, or a base class is being listed in the
4330         interfaces section).
4331
4332         This flags error 1722, and resolves the crash from bug 69259.
4333
4334 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4335
4336         * statement.cs (Using.EmitExpressionFinally): make this work right
4337         for valuetypes. Fixes 69926.
4338
4339 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4340
4341         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4342         converted to an enum" here, before we try to change the underlying
4343         type.  This code exists, but it is a different code path than the
4344         one used while encoding constants.
4345
4346         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4347         old bug: when converting from the null literal to a pointer,
4348         return an EmptyCast, not the NullLiteral.
4349
4350         This fixes #69921, the recent null_type changes probably made this
4351         bug more prominent.
4352
4353         (ImplicitReferenceConversionExists): In addition, resynchronized
4354         the code here, so it matches the same code in
4355         ImplicitReferenceConversionExists for the `from any class-type S
4356         to any interface-type T'.
4357         
4358
4359 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4360
4361         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4362
4363 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4364
4365         * cs-parser.jay: Use verbosity accordingly. 
4366
4367 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4368
4369         * expression.cs (Unary.ResolveOperator): Do not report warning;
4370         AddressOf reads from variable.
4371         
4372         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4373
4374 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4375
4376         Fix bug #69462
4377
4378         * attribute.cs (Attributable): Removed CheckTargets.
4379         (Attributes.Emit): Explicit attribute targets are tested here.
4380
4381         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4382         not enabled for interfaces.
4383
4384         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4385         (GetAssemblyName): Ouch next bug there.
4386
4387 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4388
4389         * expression.cs: Error 275 added.
4390         
4391 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4392
4393         Fix bug #69177 (Implemented decimal constant support)
4394
4395         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4396         (BinaryFold): Add DecimalConstant.
4397
4398         * const.cs (Define): Decimal constant 
4399         (is not constant.
4400         (ChangeType): Add decimal type handling.
4401         (LookupConstantValue): Don't set value for decimal type but
4402         emit DecimalConstantAttribute. Needed for constant optimization.
4403
4404         * constant.cs (ToDecimal): New method.
4405         (ConvertToDecimal): New method.
4406         (IntConstant): Implemented ConvertToDecimal.
4407         (DecimalConstant.Emit): Emit optimized version for decimals in
4408         int range.
4409
4410         * expression.cs (ResolveOperator): Changed order of constant
4411         reduction to work correctly with native types which have
4412         overloaded operators.
4413         (ResolveMemberAccess): Extract constant value from attribute
4414         for decimal type.
4415
4416         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4417
4418         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4419         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4420         (ChangeType): Decimal is special.
4421         (TypeToCoreType): Add decimal type.
4422
4423 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4424
4425         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4426         decimal types.
4427
4428 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4429
4430         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4431         test cs1667-5.cs.
4432
4433 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4434
4435         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4436
4437         * pending.cs (PendingImplementation): Grab only interfaces.
4438
4439 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4440
4441         * statement.cs (ForeachHelperMethods): Add location member and
4442         error 202 detection.
4443
4444 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4445
4446         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4447         automatically handled by executable.make.
4448         (PROGRAM): Make profile-specific.
4449
4450 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4451
4452         * expression.cs (DoResolveBase): Fixed wrong warning for out
4453         variables.
4454
4455 2004-11-18  Martin Baulig  <martin@ximian.com>
4456
4457         Merged latest changes into gmcs.  Please keep this comment in
4458         here, it makes it easier for me to see what changed in MCS since
4459         the last time I merged.
4460
4461 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4462
4463         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4464         (TypeHandle.GetMemberCache): New.
4465         (TypeHandle.TypeHandle): Update.
4466         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4467         (TypeManager.LookupParentInterfacesCache):
4468         Rename from LookupInterfaceCache.  Optimize slightly.
4469         (TypeManager.MemberLookup_FindMembers): Update.
4470         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4471         multi-type variant.
4472         (AddCacheContents): Rename from AddHashtable.
4473         * class.cs (TypeContainer.parent_container): Remove.
4474         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4475         (TypeContainer.DoDefineMembers): Don't initialize it.
4476         Update to name changes.
4477         
4478 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4479
4480         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4481         that factors the code to check access modifiers on override.  
4482
4483         (PropertyBase): Use the code here.
4484
4485         Patch from Lluis S'anchez, fixes bug #69361.
4486
4487 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4488
4489         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4490         routine that is used to report the use of a captured variable
4491         whose address has been taken.
4492
4493         There are two checks: one when variables are being captured and
4494         the other check is when the address of a variable is taken. 
4495         
4496         (because an anonymous methods might be resolved before *or* after
4497         the address has been taken) and 
4498
4499         * expression.cs (Conditional.DoResolve): Remove the special
4500         casing that Martin added to trueExpr and falseExpr being both
4501         NullLiteral.  We get the right behavior now just by introducing
4502         the null_type into the compiler. 
4503
4504         * convert.cs (ExplicitConversion): Change the code to use
4505         null_type instead of testing `expr is NullLiteral'.
4506         (ImplicitConversionStandard): use null_type too.
4507         (ImplicitReferenceConversionExists): use null_type too.
4508         (ImplicitReferenceConversion): use null_type too.
4509
4510         * literal.cs: The type of `NullLiteral' is now null_type instead
4511         of object_type. 
4512         (Resolve): Set the type here.
4513
4514         * typemanager.cs: Introduce null_type.
4515
4516 2004-11-17  Martin Baulig  <martin@ximian.com>
4517
4518         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4519         direction, like FindMembers() does.  Fixes #69546, testcase is in
4520         test-315.cs.    
4521
4522 2004-11-16  Martin Baulig  <martin@ximian.com>
4523
4524         This is based on a patch from Marek Safar, see bug #69082.
4525         Fixes bugs #63705 and #67130.
4526
4527         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4528         method; create a MemberCache for an interface type and cache the
4529         result.
4530
4531         * decl.cs (IMemberContainer.ParentContainer): Removed.
4532         (IMemberContainer.ParentCache): New property.
4533         (MemberCache.SetupCacheForInterface): Removed.
4534         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4535         to create a cache for an interface's "parent".
4536
4537         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4538         interfaces too.
4539
4540 2004-11-16  Martin Baulig  <martin@ximian.com>
4541
4542         Merged back from gmcs; these changes already went into gmcs a
4543         couple of weeks ago.
4544
4545         * typemanager.cs
4546         (TypeManager.AddUserType): Removed the `ifaces' argument.
4547         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4548         `TypeExpr []'.
4549         (TypeManager.AddUserInterface): Removed.
4550         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4551         `TypeExpr []'.
4552         (TypeManager.GetInterfaces): Likewise.
4553         (TypeManager.GetExplicitInterfaces): Likewise.
4554
4555         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4556
4557         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4558         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4559
4560 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4561
4562         * statement.cs: Avoid adding bools to a hashtable.
4563
4564 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4565
4566         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4567         calling an unsafe method from a safe location.
4568
4569 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4570
4571         Fix #69167
4572         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4573
4574 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4575
4576         * namespace.cs (VerifyUsing): use GetPartialName instead of
4577         ToString. 
4578
4579 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4580
4581         * statement.cs (Return.Resolve): Fix regression in typo: if
4582         `in_exc', we have to request a NeedReturnLabel, this was a typo
4583         introduced in the anonymous method check-in.  Fixes #69131.
4584
4585         * Indexers were using the ShortName when defining themselves,
4586         causing a regression in the compiler bootstrap when applying the
4587         patch from 2004-11-02 (first part), now they use their full name
4588         and the bug is gone.
4589
4590 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4591
4592         * driver.cs: Strip the path from the names of embedded resources. Fixes
4593         #68519.
4594
4595 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4596
4597         Fix error message regression: cs0104-2.cs.
4598         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4599         (AliasEntry.Resolve): Update.
4600         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4601         'silent' flag.
4602         (RootContext.LookupType): Update.
4603
4604 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4605
4606         * cs-parser.jay: Add support for handling accessor modifiers
4607         * class: Add support port accessor modifiers and error checking,
4608         define PropertyMethod.Define as virtual (not abstract anymore)
4609         * ecore.cs: Add checking for proeprties access with access modifiers
4610         * iterators.cs: Modify Accessor constructor call based in the modified
4611         constructor
4612 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4613
4614         * expression.cs (StringConcat): Handle being called twice,
4615         as when we have a concat in a field init with more than two
4616         ctors in the class
4617
4618 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4619
4620         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4621         special case explicit implementations, we should always produce
4622         the .property or .event declaration.
4623         
4624         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4625         since it will not return correct data if people use this
4626         unresolved in the presence of using statements (see test-313).
4627
4628         * class.cs (MethodData.Define): If we are an explicit interface
4629         implementation, set the method name to the full name of the
4630         interface plus the name of the method.  
4631
4632         Notice that using the method.MethodName.GetFullName() does not
4633         work, as it will only contain the name as declared on the source
4634         file (it can be a shorthand in the presence of using statements)
4635         and not the fully qualifed type name, for example:
4636
4637         using System;
4638
4639         class D : ICloneable {
4640                 object ICloneable.Clone ()  {
4641                 }
4642         }
4643
4644         Would produce a method called `ICloneable.Clone' instead of
4645         `System.ICloneable.Clone'.
4646
4647         * namespace.cs (Alias.Resolve): Use GetPartialName.
4648         
4649 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4650
4651         * cs-parser.jay: Add error 1055 report.
4652
4653 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4654
4655         * assign.cs (Assign.DoResolve): Only do the transform of
4656         assignment into a New if the types are compatible, if not, fall
4657         through and let the implicit code deal with the errors and with
4658         the necessary conversions. 
4659
4660 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4661
4662         * cs-parser.jay: Add error 1031 report.
4663
4664         * cs-tokenizer.cs: Add location for error 1038.
4665
4666 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4667
4668         * cs-parser.jay: Add error 1016 report.
4669
4670 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4671
4672         * cs-parser.jay: Add errors 1575,1611 report.
4673
4674 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4675
4676         * cs-parser.jay: Add error 1001 report.
4677
4678 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4679
4680         Fix #68850
4681         * attribute.cs (GetMarshal): Add method argument for
4682         caller identification.
4683
4684         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4685         agument for GetMarshal and RuntimeMissingSupport.
4686
4687 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4688
4689         * attribute.cs (ExtractSecurityPermissionSet): Removed
4690         TypeManager.code_access_permission_type.
4691
4692         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4693
4694 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4695
4696         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4697         for obsolete use of a variable here.   Fixes regression on errors
4698         cs0619-25 and cs0619-26.
4699
4700 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4701
4702         Fix #62358, implemented security attribute encoding.
4703
4704         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4705         Tests permitted SecurityAction for assembly or other types.
4706         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4707         data from SecurityPermissionAttribute to PermisionSet class.
4708
4709         * class.cs (ApplyAttributeBuilder): Added special handling
4710         for System.Security.Permissions.SecurityAttribute based types.
4711
4712         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4713         special handling for System.Security.Permissions.SecurityAttribute
4714         based types.
4715
4716         * enum.cs (ApplyAttributeBuilder): Added special handling
4717         for System.Security.Permissions.SecurityAttribute based types.
4718
4719         * parameter.cs (ApplyAttributeBuilder): Added special handling
4720         for System.Security.Permissions.SecurityAttribute based types.
4721
4722         * rootcontext.cs: Next 2 core types.
4723
4724         * typemanager.cs (TypeManager.security_permission_attr_type):
4725         Built in type for the SecurityPermission Attribute.
4726         (code_access_permission_type): Build in type.
4727
4728 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4729
4730         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4731         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4732         all of this information into
4733         EmitContext.EmitCapturedVariableInstance.
4734         
4735         * codegen.cs (EmitCapturedVariableInstance): move here the
4736         funcionality of emitting an ldarg.0 in the presence of a
4737         remapping.   This centralizes the instance emit code.
4738
4739         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4740         then emit a load of this: it means that we have reached the
4741         topmost ScopeInfo: the one that contains the pointer to the
4742         instance of the class hosting the anonymous method.
4743
4744         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4745         captures to the topmost CaptureContext.
4746
4747 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4748
4749         * expression.cs (LocalVariableReference): Move the knowledge about
4750         the iterators into codegen's EmitCapturedVariableInstance.
4751
4752 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4753
4754         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4755         all code paths return a value from an anonymous method (it is the
4756         same as the 161 error, but for anonymous methods).
4757
4758 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4759
4760         The introduction of anonymous methods in the compiler changed
4761         various ways of doing things in the compiler.  The most
4762         significant one is the hard split between the resolution phase
4763         and the emission phases of the compiler.
4764
4765         For instance, routines that referenced local variables no
4766         longer can safely create temporary variables during the
4767         resolution phase: they must do so from the emission phase,
4768         since the variable might have been "captured", hence access to
4769         it can not be done with the local-variable operations from the runtime.
4770         
4771         * statement.cs 
4772
4773         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4774         is a toplevel block.
4775
4776         (ToplevelBlock): A new kind of Block, these are the blocks that
4777         are created by the parser for all toplevel method bodies.  These
4778         include methods, accessors and anonymous methods.
4779
4780         These contain some extra information not found in regular blocks:
4781         A pointer to an optional CaptureContext (for tracking captured
4782         local variables and parameters).  A pointer to the parent
4783         ToplevelBlock.
4784         
4785         (Return.Resolve): Catch missmatches when returning a value from an
4786         anonymous method (error 1662).
4787         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4788         phase.
4789
4790         (Break.Resolve): ditto.
4791
4792         (SwitchLabel): instead of defining the labels during the
4793         resolution phase, we now turned the public ILLabel and ILLabelCode
4794         labels into methods called GetILLabelCode() and GetILLabel() that
4795         only define the label during the Emit phase.
4796
4797         (GotoCase): Track the SwitchLabel instead of the computed label
4798         (its contained therein).  Emit the code by using
4799         SwitchLabel.GetILLabelCode ().
4800
4801         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4802         whether the Local has been captured or not.
4803
4804         (LocalInfo.IsCaptured): New property, used to tell whether the
4805         local has been captured.
4806         
4807         * anonymous.cs: Vastly updated to contain the anonymous method
4808         support.
4809
4810         The main classes here are: CaptureContext which tracks any
4811         captured information for a toplevel block and ScopeInfo used to
4812         track the activation frames for various local variables.   
4813
4814         Each toplevel block has an optional capture context associated
4815         with it.  When a method contains an anonymous method both the
4816         toplevel method and the anonymous method will create a capture
4817         context.   When variables or parameters are captured, they are
4818         recorded on the CaptureContext that owns them, for example:
4819
4820         void Demo () {
4821              int a;
4822              MyDelegate d = delegate {
4823                  a = 1;
4824              }
4825         }
4826
4827         Here `a' will be recorded as captured on the toplevel
4828         CapturedContext, the inner captured context will not have anything
4829         (it will only have data if local variables or parameters from it
4830         are captured in a nested anonymous method.
4831
4832         The ScopeInfo is used to track the activation frames for local
4833         variables, for example:
4834
4835         for (int i = 0; i < 10; i++)
4836                 for (int j = 0; j < 10; j++){
4837                    MyDelegate d = delegate {
4838                         call (i, j);
4839                    }
4840                 }
4841
4842         At runtime this captures a single captured variable `i', but it
4843         captures 10 different versions of the variable `j'.  The variable
4844         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4845         recorded on a child.  
4846
4847         The toplevel ScopeInfo will also track information like the `this'
4848         pointer if instance variables were referenced (this is necessary
4849         as the anonymous method lives inside a nested class in the host
4850         type of the method). 
4851
4852         (AnonymousMethod): Expanded to track the Toplevel, implement
4853         `AnonymousMethod.Compatible' to tell whether an anonymous method
4854         can be converted to a target delegate type. 
4855
4856         The routine now also produces the anonymous method content
4857
4858         (AnonymousDelegate): A helper class that derives from
4859         DelegateCreation, this is used to generate the code necessary to
4860         produce the delegate for the anonymous method that was created. 
4861
4862         * assign.cs: API adjustments for new changes in
4863         Convert.ImplicitStandardConversionExists.
4864
4865         * class.cs: Adjustments to cope with the fact that now toplevel
4866         blocks are of type `ToplevelBlock'. 
4867
4868         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4869         insteda of standard blocks.
4870
4871         Flag errors if params arguments are passed to anonymous methods.
4872
4873         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4874         `CurrentAnonymousMethod' which points to the current Anonymous
4875         Method.  The variable points to the AnonymousMethod class that
4876         holds the code being compiled.  It is set in the new EmitContext
4877         created for the anonymous method.
4878
4879         (EmitContext.Phase): Introduce a variable and an enumeration to
4880         assist in enforcing some rules about when and where we are allowed
4881         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4882         only one that enfonces this right now).
4883
4884         (EmitContext.HaveCaptureInfo): new helper method that returns
4885         whether we have a CapturedContext initialized.
4886
4887         (EmitContext.CaptureVariable): New method used to register that a
4888         LocalInfo must be flagged for capturing. 
4889
4890         (EmitContext.CapturedParameter): New method used to register that a
4891         parameters must be flagged for capturing. 
4892         
4893         (EmitContext.CapturedField): New method used to register that a
4894         field must be flagged for capturing. 
4895
4896         (EmitContext.HaveCapturedVariables,
4897         EmitContext.HaveCapturedFields): Return whether there are captured
4898         variables or fields. 
4899
4900         (EmitContext.EmitMethodHostInstance): This is used to emit the
4901         instance for the anonymous method.  The instance might be null
4902         (static methods), this (for anonymous methods that capture nothing
4903         and happen to live side-by-side with the current method body) or a
4904         more complicated expression if the method has a CaptureContext.
4905
4906         (EmitContext.EmitTopBlock): Routine that drives the emission of
4907         code: it will first resolve the top block, then emit any metadata
4908         and then emit the code.  The split is done so that we can extract
4909         any anonymous methods and flag any captured variables/parameters.
4910         
4911         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4912         during this phase, the ILGenerator should not be used as labels
4913         and local variables declared here might not be accessible to any
4914         code that is part of an anonymous method.  
4915
4916         Exceptions to this include the temporary variables that are
4917         created by some statements internally for holding temporary
4918         variables. 
4919         
4920         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4921         metadata for a cb
4922
4923         (EmitContext.TemporaryReturn): This method is typically called
4924         from the Emit phase, and its the only place where we allow the
4925         ReturnLabel to be defined other than the EmitMeta.  The reason is
4926         that otherwise we would have to duplicate a lot of logic in the
4927         Resolve phases of various methods that today is on the Emit
4928         phase. 
4929
4930         (EmitContext.NeedReturnLabel): This no longer creates the label,
4931         as the ILGenerator is not valid during the resolve phase.
4932
4933         (EmitContext.EmitThis): Extended the knowledge in this class to
4934         work in anonymous methods in addition to iterators. 
4935
4936         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4937         code is necessary on the stack to access the instance to a local
4938         variable (the variable will be accessed as a field).
4939
4940         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4941         EmitContext.EmitAddressOfParameter): Routines to support
4942         parameters (not completed at this point). 
4943         
4944         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4945         will also remove the parameters.
4946
4947         * convert.cs (Convert): Define a `ConstantEC' which points to a
4948         null.  This is just to prefity some code that uses
4949         ImplicitStandardConversion code and do not have an EmitContext
4950         handy.
4951
4952         The idea is to flag explicitly that at that point in time, it is
4953         known that the conversion will not trigger the delegate checking
4954         code in implicit conversions (which requires a valid
4955         EmitContext). 
4956
4957         Everywhere: pass new EmitContext parameter since
4958         ImplicitStandardConversionExists now requires it to check for
4959         anonymous method conversions. 
4960
4961         (Convert.ImplicitStandardConversionExists): If the type of an
4962         expression is the anonymous_method_type, and the type is a
4963         delegate, we invoke the AnonymousMethod.Compatible method to check
4964         whether an implicit conversion is possible. 
4965
4966         (Convert.ImplicitConversionStandard): Only do implicit method
4967         group conversions if the language level is not ISO_1.
4968
4969         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4970         MethodInfo for the Invoke method.  used by Delegate and
4971         AnonymousDelegate.
4972
4973         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4974         method conversions if the target type is a delegate.
4975
4976         Removed extra debugging nops.
4977
4978         (LocalVariableReference): Turn the `local_info' into a public
4979         field. 
4980
4981         Add `prepared' field, the same hack used for FieldExprs to cope
4982         with composed assignments, as Local variables do not necessarily
4983         operate purely on the stack as they used to: they can be captured
4984         fields. 
4985
4986         Add `temp' for a temporary result, like fields.
4987
4988         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4989
4990         It now copes with Local variables that are captured and emits the
4991         proper instance variable to load it from a field in the captured
4992         case. 
4993
4994         (ParameterReference.DoResolveBase): During the resolve phase,
4995         capture parameters if we are in an anonymous method.
4996
4997         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4998         anonymous method, use the EmitContext helper routines to emit the
4999         parameter reference.
5000
5001         * iterators.cs: Set RemapToProxy to true/false during the
5002         EmitDispose class.
5003
5004         * parameters.cs (GetParameterByName): New helper method. 
5005
5006         * typemanager.cs (anonymous_method_type) a new type that
5007         represents an anonyous method.  This is always an internal type,
5008         used as a fencepost to test against the anonymous-methodness of an
5009         expression. 
5010         
5011 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5012
5013         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5014         561 report.
5015         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5016
5017 2004-10-18  Martin Baulig  <martin@ximian.com>
5018
5019         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5020         `Type' directly, but call ResolveType() on it.
5021         (Catch.Resolve): Likewise.
5022         (Foreach.Resolve): Likewise.
5023
5024 2004-10-18  Martin Baulig  <martin@ximian.com>
5025
5026         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5027         `Type' directly, but call ResolveType() on it.
5028         (Probe.DoResolve): Likewise.
5029         (ArrayCreation.LookupType): Likewise.
5030         (TypeOf.DoResolve): Likewise.
5031         (SizeOf.DoResolve): Likewise.
5032
5033 2004-10-18  Martin Baulig  <martin@ximian.com>
5034
5035         * expression.cs (Invocation.BetterFunction): Put back
5036         TypeManager.TypeToCoreType().
5037
5038 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5039
5040         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5041         the ResolveType.
5042
5043 2004-10-18  Martin Baulig  <martin@ximian.com>
5044
5045         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5046         `Type' directly, but call ResolveType() on it.
5047
5048 2004-10-18  Martin Baulig  <martin@ximian.com>
5049
5050         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5051         `Type' directly, but call ResolveType() on it.
5052         (MemberBase.DoDefine): Likewise.
5053
5054         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5055         `Type' directly, but call ResolveType() on it.
5056         (ComposedCast.DoResolveAsTypeStep): Likewise.
5057
5058         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5059         `Type' directly, but call ResolveType() on it.
5060
5061 2004-10-17  John Luke  <john.luke@gmail.com>
5062
5063         * class.cs (Operator.GetSignatureForError): use CSharpName
5064
5065         * parameter.cs (Parameter.GetSignatureForError): Returns
5066         correct name even if was not defined.
5067
5068 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5069
5070         Fix #65816.
5071         * class.cs (TypeContainer.EmitContext): New property.
5072         (DefineNestedTypes): Create an emitcontext for each part.
5073         (MethodCore.DoDefineParameters): Use container's emitcontext.
5074         Pass type array to InternalParameters.
5075         (MemberBase.DoDefine): Use container's emitcontext.
5076         (FieldMember.Define): Likewise.
5077         (Event.Define): Likewise.
5078         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5079         Pass type array to InternalParameters.
5080         (SetIndexerMethod.GetParameterInfo): Likewise.
5081         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5082         * delegate.cs (Define): Pass emitcontext to
5083         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5084         array to InternalParameters.
5085         * expression.cs (ParameterReference.DoResolveBase): Pass
5086         emitcontext to GetParameterInfo.
5087         (ComposedCast.DoResolveAsTypeStep): Remove check on
5088         ec.ResolvingTypeTree.
5089         * parameter.cs (Parameter.Resolve): Change argument to
5090         EmitContext.  Use ResolveAsTypeTerminal.
5091         (Parameter.GetSignature): Change argument to EmitContext.
5092         (Parameters.ComputeSignature): Likewise.
5093         (Parameters.ComputeParameterTypes): Likewise.
5094         (Parameters.GetParameterInfo): Likewise.
5095         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5096         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5097         * support.cs (InternalParameters..ctor): Remove variant that takes
5098         a DeclSpace.
5099         * typemanager.cs (system_intptr_expr): New.
5100         (InitExpressionTypes): Initialize it.
5101
5102 2004-10-12  Chris Toshok  <toshok@ximian.com>
5103
5104         * cs-parser.jay: fix location for try_statement and catch_clause.
5105
5106 2004-10-11  Martin Baulig  <martin@ximian.com>
5107
5108         * report.cs: Don't make --fatal abort on warnings, we have
5109         -warnaserror for that.
5110
5111 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5112
5113         More DeclSpace.ResolveType avoidance.
5114         * decl.cs (MemberCore.InUnsafe): New property.
5115         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5116         with newly created EmitContext.
5117         (FieldMember.Define): Likewise.
5118         * delegate.cs (Delegate.Define): Likewise.
5119         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5120         only if normal name-lookup fails.
5121         (TypeExpr.DoResolve): Enable error-checking.
5122         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5123         (SizeOf.DoResolve): Likewise.
5124         (ComposedCast.DoResolveAsTypeStep): Likewise.
5125         (StackAlloc.DoResolve): Likewise.
5126         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5127         (Block.Unsafe): New property.
5128         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5129         (Unsafe): Set 'unsafe' flag of contained block.
5130         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5131         (Fixed.Resolve): Likewise.
5132         (Catch.Resolve): Likewise.
5133         (Using.ResolveLocalVariableDecls): Likewise.
5134         (Foreach.Resolve): Likewise.
5135
5136 2004-10-05  John Luke <john.luke@gmail.com>
5137
5138         * cs-parser.jay: add location to error CS0175
5139
5140 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5141
5142         * ecore.cs (Expression.Constantity): Add support for turning null
5143         into a constant.
5144
5145         * const.cs (Const.Define): Allow constants to be reference types
5146         as long as the value is Null.
5147
5148 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5149
5150         * namespace.cs (NamespaceEntry.Using): No matter which warning
5151         level is set, check if this namespace name has already been added.
5152
5153 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5154
5155         * expression.cs: reftype [!=]= null should always use br[true,false].
5156         # 67410
5157
5158 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5159
5160         Fix #67108
5161         * attribute.cs: Enum conversion moved to 
5162         GetAttributeArgumentExpression to be applied to the all
5163         expressions.
5164
5165 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5166
5167         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5168         * class.c (TypeContainer.DefineType): Flag error if
5169         base types aren't accessible due to access permissions.
5170         * decl.cs (DeclSpace.ResolveType): Move logic to
5171         Expression.ResolveAsTypeTerminal.
5172         (DeclSpace.ResolveTypeExpr): Thin layer over
5173         Expression.ResolveAsTypeTerminal.
5174         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5175         Refactor code into NestedAccess.  Use it.
5176         (DeclSpace.NestedAccess): New.
5177         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5178         argument to silence errors.  Check access permissions.
5179         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5180         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5181         (Cast.DoResolve): Likewise.
5182         (New.DoResolve): Likewise.
5183         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5184         (TypeOf.DoResolve): Likewise.
5185
5186         * expression.cs (Invocation.BetterConversion): Return the Type of
5187         the better conversion.  Implement section 14.4.2.3 more faithfully.
5188         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5189         section 14.4.2.2 explicit.
5190         (Invocation.OverloadResolve): Update.
5191         (Invocation): Remove is_base field.
5192         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5193         (Invocation.Emit): Likewise.
5194
5195 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5196
5197         * README: Update to changes.
5198
5199 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5200
5201         * cs-parser.jay: Reverted 642 warning fix.
5202
5203 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5204
5205         Fix bug #66615
5206         * decl.cs (FindMemberWithSameName): Indexer can have more than
5207         1 argument.
5208
5209 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5210
5211         * expression.cs (LocalVariableReference.DoResolveLValue):
5212         Do not report warning 219 for out values.
5213         (EmptyExpression.Null): New member to avoid extra allocations.
5214
5215 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5216
5217         * cs-parser.jay: Fix wrong warning 642 report.
5218
5219         * cs-tokenizer.cs (CheckNextToken): New helper;
5220         Inspect next character if is same as expected.
5221
5222 2004-09-23  Martin Baulig  <martin@ximian.com>
5223
5224         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5225         (Convert.ImplicitReferenceConversionExists): Likewise.
5226
5227 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5228
5229         * class.cs (Operator.Define): Add error 448 and 559 report.
5230
5231 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5232
5233         * class.cs (MemberBase.IsTypePermitted): New protected
5234         method for checking error CS0610.
5235
5236 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5237
5238         * class.cs (TypeContainer.HasExplicitLayout): New property
5239         Returns whether container has StructLayout attribute set Explicit.
5240         (FieldMember): New abstract class for consts and fields.
5241         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5242         (Field): Reuse FieldMember.
5243
5244         * const.cs (Const): Reuse FieldMember.
5245
5246         * rootcontext.cs: EmitConstants call moved to class.
5247
5248 2004-09-22  Martin Baulig  <martin@ximian.com>
5249
5250         Thanks to Peter Sestoft for this bug report.
5251
5252         * expression.cs (Conditional): If both the `trueExpr' and the
5253         `falseExpr' is a NullLiteral, return a NullLiteral.
5254
5255 2004-09-22  Martin Baulig  <martin@ximian.com>
5256
5257         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5258         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5259         for the "get_Current" call.
5260
5261 2004-09-22  Martin Baulig  <martin@ximian.com>
5262
5263         Marek and me just fixed one of our oldest bugs: #28562 :-)
5264
5265         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5266
5267         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5268         we're an EnumConstant, just return that.
5269         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5270         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5271         to get the value which'll actually be written into the attribute.
5272         However, we have to use GetValue() to access the attribute's value
5273         in the compiler.        
5274
5275 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5276
5277         * constant.cs (Constant.IsNegative): New abstract property
5278         IsNegative.
5279
5280         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5281         (StackAlloc.DoResolve): Reused IsNegative.
5282
5283 2004-09-21  Martin Baulig  <martin@ximian.com>
5284
5285         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5286         if we're used in an iterator, we may be called from different
5287         methods.
5288
5289         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5290         we actually have an exception block.
5291
5292 2004-09-20  John Luke <jluke@cfl.rr.com>
5293
5294         * class.cs, cs-parser.jay: Improve the error report for 1520:
5295         report the actual line where the error happens, not where the
5296         class was declared.
5297
5298         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5299         Pass location information that was available elsewhere.
5300
5301 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5302
5303         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5304         runtime to delay sign assemblies.
5305
5306 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5307
5308         * cs-parser.jay: Do not report the stack trace, this is barely
5309         used nowadays.
5310
5311 2004-08-22  John Luke  <john.luke@gmail.com>
5312  
5313         * driver.cs : check that a resource id is not already used
5314         before adding it, report CS1508 if it is, bug #63637
5315
5316 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5317
5318         * ecore.cs: Removed dead code.
5319
5320 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5321
5322         * class.cs: Do not report warning CS0067 on the interfaces.
5323
5324 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5325
5326         * cs-parser.jay: Add error 504 report.
5327
5328 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5329
5330         * rootcontext.cs: WarningLevel is 4 by default now.
5331
5332         * statement.cs (Fixed.Resolve): Do not null
5333         VariableInfo.
5334
5335 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5336
5337         Fixed bug #55780
5338         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5339         deep search when property is not virtual.
5340         (PropertyExpr.ResolveAccessors): Make one call for both
5341         accessors.
5342
5343 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5344
5345         Fixed bug #65766
5346         * statement.cs: Error 152 report constains also location.
5347
5348 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5349
5350         Fixed bug #65766
5351         * const.cs: Explicitly set constant as static.
5352
5353 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5354
5355         Fixed bug #64226
5356         * cs-parser.jay: Add error 1017 report.
5357
5358 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5359
5360         Fixed bug #59980, #64224
5361         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5362
5363         * typemanager.cs (IsSpecialMethod): Simplified
5364
5365 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5366
5367         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5368         condition with better params.
5369
5370 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5371
5372         Fixed bug #65238
5373         * attribute.cs (Resolve): Property has to have both
5374         accessors.
5375
5376 2004-09-14  Martin Baulig  <martin@ximian.com>
5377
5378         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5379
5380 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5381
5382         Fixed bug #61902
5383         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5384         called and is obsolete then this member suppress message
5385         when call is inside next [Obsolete] method or type.
5386
5387         * expression.cs: Use TestObsoleteMethodUsage member.
5388
5389 2004-09-14  Martin Baulig  <martin@ximian.com>
5390
5391         * cs-parser.jay: Sync a bit with the GMCS version.
5392
5393 2004-09-14  Martin Baulig  <martin@ximian.com>
5394
5395         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5396         (CSharpParser.yacc_verbose_flag): New public field.
5397
5398         * genericparser.cs: Removed.
5399
5400 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5401
5402         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5403
5404 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5405
5406         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5407
5408 2004-09-10  Martin Baulig  <martin@ximian.com>
5409
5410         Backported my MemberName changes from GMCS into MCS.
5411
5412         - we are now using a special `MemberName' class instead of using
5413         strings; in GMCS, the `MemberName' also contains the type
5414         arguments.
5415
5416         - changed the grammar rules a bit:
5417           * the old `member_name' is now a `namespace_or_type_name':
5418             The rule is that we use `namespace_or_type_name' everywhere
5419             where we expect either a "member name" (GetEnumerator) or a
5420             "member name" with an explicit interface name
5421             (IEnumerable.GetEnumerator).
5422             In GMCS, the explicit interface name may include type arguments
5423             (IEnumerable<T>.GetEnumerator).
5424           * we use `member_name' instead of just `IDENTIFIER' for
5425             "member names":
5426             The rule is that we use `member_name' wherever a member may
5427             have type parameters in GMCS.       
5428
5429         * decl.cs (MemberName): New public class.
5430         (MemberCore.MemberName): New public readonly field.
5431         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5432         (DeclSpace): Likewise.
5433
5434         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5435         * enum.cs (Enum.ctor): Likewise.
5436
5437         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5438         MemberName.     
5439         (AliasEntry.ctor): Take a MemberName, not an Expression.
5440         (AliasEntry.UsingAlias): Likewise.
5441
5442         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5443         (IMethodData.MemberName): Changed type from string to MemberName.
5444         (MemberBase.ExplicitInterfaceName): Likewise.
5445         (AbstractPropertyEventMethod.SetupName): Make this private.
5446         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5447         argument; compute the member name here.
5448         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5449         on the `member.MemberName' and the `prefix'.
5450
5451         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5452         not `type_name'.
5453         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5454         thus, we get a `MemberName' instead of a `string'.  These
5455         declarations may have type parameters in GMCS.
5456         (interface_method_declaration, delegate_declaration): Likewise.
5457         (class_declaration, interface_declaration): Likewise.
5458         (method_header): Use `namespace_or_type_name' instead of
5459         `member_name'.  We may be an explicit interface implementation.
5460         (property_declaration, event_declaration): Likewise.
5461         (member_name): This is now just an `IDENTIFIER', not a
5462         `namespace_or_type_name'.
5463         (type_name, interface_type): Removed.
5464         (namespace_or_type_name): Return a MemberName, not an Expression.
5465         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5466         call GetTypeExpression() on the MemberName to get an expression.
5467         (IndexerDeclaration.interface_type): Changed type from string to
5468         MemberName.
5469         (MakeName): Operate on MemberName's instead of string's.
5470
5471 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5472
5473         Fix bug #55770.
5474         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5475         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5476         lookup to avoid symbols introduced by 'using'.
5477         * rootcontext.cs (NamespaceLookup): Update.
5478
5479 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5480
5481         * class.cs (TypeContainer.DoDefineMembers): Do not call
5482         DefineDefaultConstructor for static classes.
5483
5484 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5485
5486         * attribute.cs (Attribute.Resolve): Add error 653 report.
5487
5488         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5489         report.
5490         (Method.ApplyAttributeBuilder): Add error 685 report.
5491         (Operator.Define): Add error 564 report.
5492
5493         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5494
5495         * expression.cs (Invocation.DoResolve): Add error
5496         245 and 250 report.
5497
5498         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5499         error 674 report.
5500
5501 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5502
5503         * class.cs (ConstructorInitializer.Resolve):
5504         Wrong error number (515->516).
5505
5506 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5507
5508         * class.cs (Indexer.Define): Add error 631 report.
5509
5510 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5511
5512         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5513
5514 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5515
5516         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5517
5518 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5519
5520         * cs-parser.jay: Added error CS0241 report.
5521
5522 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5523
5524         * cs-parser.jay (fixed_statement): Introduce a scope for the
5525         declaration in the 'fixed' statement.
5526
5527 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5528
5529         * cs-parser.jay: Added CS0230 error report.
5530
5531 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5532
5533         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5534
5535 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5536
5537         * expression.cs (Argument.Resolve): Added error CS0192 and
5538         CS0199 report.
5539
5540 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5541
5542         C# 2.0 #pragma warning feature
5543
5544         * cs-tokenizer.cs (PreProcessPragma): New method; 
5545         Handles #pragma directive.
5546
5547         * report.cs (WarningRegions): New class; Support
5548         class for #pragma warning directive. It tests whether
5549         warning is enabled for a given line.
5550
5551 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5552
5553         * const.cs: Add more descriptive error report, tahnks to
5554         Sebastien. 
5555
5556 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5557
5558         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5559
5560 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5561
5562         * expression.cs: Apply patch from Ben: Remove dead code from
5563         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5564         as that code just threw an exception anwyays.
5565
5566         * const.cs: Remove the call to the turnintoconstant, for details
5567         see bug: #63144
5568         
5569         * literal.cs: The type of the null-literal is the null type;  So
5570         we use a placeholder type (literal.cs:System.Null, defined here)
5571         for it.
5572
5573         * expression.cs (Conditional.DoResolve): Remove some old code that
5574         is no longer needed, conversions have been fixed.
5575
5576         (ArrayCreationExpression.DoResolve): Return false if we fail to
5577         resolve the inner expression.
5578
5579 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5580
5581         Fix test-290.cs.
5582         * cs-parser.jay (delegate_declaration): Record a delegate
5583         declaration as a type declaration.
5584         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5585
5586 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5587
5588         * parameter.cs: Do not crash if the type can not be resolved. 
5589
5590         * expression.cs: Report errors with unsafe pointers, fixes #64896
5591
5592 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5593
5594         * expression.cs: Pointer arith always needs to do a conv.i
5595         if the operand is a long. fix 65320
5596
5597 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5598
5599         Fixed cs0619-37.cs, cs0619-38.cs
5600
5601         * enum.cs (GetObsoleteAttribute): Removed.
5602
5603         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5604         on Enum member is double staged. The first is tested member
5605         and then enum.
5606
5607 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5608
5609         Fixed #56986, #63631, #65231
5610
5611         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5612         adds member to name container.
5613         (TypeContainer.AddToTypeContainer): New method, adds type to
5614         name container.
5615         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5616         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5617         AddOperator): Simplified by reusing AddToMemberContainer.
5618         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5619         instead of field.
5620         (Method.CheckForDuplications): Fixed implementation to test all
5621         possibilities.
5622         (MemberBase): Detection whether member is explicit interface
5623         implementation is now in constructor.
5624         (MemberBase.UpdateMemberName): Handles IndexerName.
5625         (Accessor): Changed to keep also location information.
5626         (AbstractPropertyEventMethod): Is derived from MemberCore.
5627         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5628         will be emited or not.
5629         (PropertyBase.AreAccessorsDuplicateImplementation):
5630         Tests whether accessors are not in collision with some method.
5631         (Operator): Is derived from MethodCore to simplify common
5632         operations.
5633
5634         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5635         must be performed.
5636         (DeclSpace.AddToContainer): Adds the member to defined_names
5637         table. It tests for duplications and enclosing name conflicts.
5638
5639         * enum.cs (EnumMember): Clean up to reuse the base structures
5640
5641 2004-09-03  Martin Baulig  <martin@ximian.com>
5642
5643         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5644         into TypeContainer, to make partial classes work again.
5645
5646 2004-09-03  Martin Baulig  <martin@ximian.com>
5647
5648         * rootcontext.cs (RootContext.V2): Removed.
5649
5650 2004-03-23  Martin Baulig  <martin@ximian.com>
5651
5652         * expression.cs (Invocation.OverloadResolve): Added `bool
5653         may_fail' argument and use it instead of the Location.IsNull() hack.
5654
5655 2004-09-03  Martin Baulig  <martin@ximian.com>
5656
5657         Merged latest changes into gmcs.  Please keep this comment in
5658         here, it makes it easier for me to see what changed in MCS since
5659         the last time I merged.
5660
5661 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5662
5663         Fix #61128.
5664         * expression.cs (BetterConversion): Don't allow either conversion 
5665         to be null.  Remove redundant implicit conversion test when 'q ==
5666         null' -- when this function is invoked, we already know that the
5667         implicit conversion exists.
5668         (BetterFunction): Assume that 'best' is non-null.  Remove
5669         redundant reimplementation of IsApplicable when 'best' is null.
5670         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5671         number of arguments.
5672         (IsAncestralType): Extract from OverloadResolve.
5673         (OverloadResolve): Make robust to the MethodGroupExpr being
5674         unsorted.  Implement all the logic of Section 14.5.5.1, and
5675         support overloading of methods from multiple applicable types.
5676         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5677
5678         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5679         (RealError, Warning): Append type of report to related symbol.
5680
5681 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5682
5683         * enum.cs: Fixed CLS-Compliance checks for enum members.
5684         Error tests cs3008-8.cs, cs3014-8.cs
5685
5686 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5687
5688         Fixed bug #62342, #63102
5689         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5690         like ImplementMethod.
5691
5692 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5693
5694         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5695         Fixed bug #65170.
5696
5697 2004-09-02  Martin Baulig  <martin@ximian.com>
5698
5699         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5700         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5701         on the MethodBase.
5702
5703 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5704
5705         C# 2.0 Static classes implemented
5706
5707         * class.cs (TypeContainer): instance_constructors,
5708         initialized_fields, initialized_static_fields,
5709         default_constructor, base_inteface_types are protected to be
5710         accessible from StaticClass.
5711         (TypeContainer.DefineDefaultConstructor): New virtual method
5712         for custom default constructor generating
5713         (StaticClass): New class to handle "Static classes" feature.
5714
5715         * cs-parser.jay: Handle static keyword on class like instance
5716         of StaticClass.
5717
5718         * driver.cs: Added "/langversion" command line switch with two
5719         options (iso-1, default).
5720
5721 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5722
5723         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5724
5725 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5726
5727         * delegate.cs: Style.
5728
5729 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5730
5731         * delegate.cs: Add seperate instance expr field for miguel.
5732
5733 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5734
5735         * PointerArithmetic (Resolve): make sure we are not doing
5736         pointer arith on void*. Also, make sure we are resolved
5737         by not setting eclass until resolve.
5738
5739         All callers: Make sure that PointerArithmetic gets resolved.
5740
5741 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5742
5743         * ArrayCreation (LookupType): If the type does not resolve 
5744         to an array, give an error.
5745
5746 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5747
5748         * statement.cs (Try.Resolve): Fixed bug #64222
5749
5750 2004-08-27  Martin Baulig  <martin@ximian.com>
5751
5752         * class.cs
5753         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5754         crash here.     
5755
5756 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5757
5758         * ecore.cs (Constantify): Get underlying type via
5759         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5760         Windows in special cases.
5761
5762 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5763
5764         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5765         for obtaining also private methods.
5766         (GetRemoveMethod): Used GetRemoveMethod (true)
5767         for obtaining also private methods.
5768
5769 2004-08-24  Martin Baulig  <martin@ximian.com>
5770
5771         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5772         MethodAttributes.HideBySig for operators.
5773
5774 2004-08-23  Martin Baulig  <martin@ximian.com>
5775
5776         Back to the old error reporting system :-)
5777
5778         * report.cs (Message): Removed.
5779         (Report.MessageData, ErrorData, WarningData): Removed.
5780         (Report.Error, Warning): Back to the old system.
5781
5782 2004-08-23  Martin Baulig  <martin@ximian.com>
5783
5784         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5785
5786         * class.cs (TypeContainer.ParentContainer): New public virtual
5787         method; replaces the explicit interface implementation.
5788         (ClassPart.ParentContainer): Override.
5789
5790 2004-08-23  Martin Baulig  <martin@ximian.com>
5791
5792         * statement.cs (Switch): Added support for constant switches; see
5793         #59428 or test-285.cs.
5794
5795 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5796
5797         Fixed bug #62740.
5798         * statement.cs (GetEnumeratorFilter): Removed useless
5799         logic because C# specs is strict. GetEnumerator must be
5800         public.
5801
5802 2004-08-22  Martin Baulig  <martin@ximian.com>
5803
5804         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5805         a switch and may break, reset the barrier.  Fixes #59867.
5806
5807 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5808
5809         CLS-Compliance speed up (~5% for corlib)
5810
5811         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5812         New method. Tests container for CLS-Compliant names
5813
5814         * class.cs (TypeContainer.VerifyClsName): New method.
5815         Checks whether container name is CLS Compliant.
5816         (Constructor): Implements IMethodData.
5817
5818         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5819         low-case table for CLS Compliance test.
5820         (MemberCache.VerifyClsParameterConflict): New method.
5821         Checks method parameters for CS3006 error.
5822
5823         * enum.cs (EnumMember): Is derived from MemberCore.
5824         (Enum.VerifyClsName): Optimized for better performance.
5825
5826 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5827
5828         * report.cs: Renamed Error_T to Error and changed all
5829         references.
5830
5831 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5832
5833         * class.cs (TypeContainer.IndexerArrayList): New inner class
5834         container for indexers.
5835         (TypeContainer.DefaultIndexerName): New constant for default
5836         indexer name. Replaced all "Item" with this constant.
5837         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5838
5839         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5840         DefaultMemberAttribute constructor.
5841
5842 2004-08-05  Martin Baulig  <martin@ximian.com>
5843
5844         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5845         Fix bug #59429.
5846
5847 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5848
5849         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5850         multi platforms problem.
5851
5852         * compiler.csproj: Included shared files.
5853
5854 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5855
5856         Fix bug 60333, 55971 in the more general way
5857         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5858         Added arg_type argument for constant conversion.
5859         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5860
5861 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5862
5863         Fix bug #59760
5864         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5865         OperatorArrayList, MethodCoreArrayList for typecontainer
5866         containers. Changed class member types to these new types.
5867         (MethodArrayList.DefineMembers): Added test for CS0659.
5868
5869 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5870
5871         * cfold.cs: Synchronize the folding with the code in expression.cs
5872         Binary.DoNumericPromotions for uint operands.
5873
5874         * attribute.cs: Revert patch from Raja, it introduced a regression
5875         while building Blam-1.2.1 (hard to isolate a test case).
5876
5877 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5878
5879         Fix for #55382
5880         * class.cs:
5881         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5882         name collision.
5883         (MethodCore.parent_method): New member. The method we're overriding
5884         if this is an override method.
5885         (MethodCore.CheckBase): Moved from Method class and made common.
5886         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5887         private.
5888         (MethodCore.CheckForDuplications): New abstract method. For custom
5889         member duplication search in a container
5890         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5891         method and its return type.
5892         (Event.conflict_symbol): New member. Symbol with same name in the
5893         parent class.
5894
5895         * decl.cs:
5896         (MemberCache.FindMemberWithSameName): New method. The method
5897         is looking for conflict with inherited symbols.
5898
5899 2004-08-04  Martin Baulig  <martin@ximian.com>
5900
5901         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5902
5903         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5904
5905 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * report.cs (Message): New enum for better error, warning reference in
5908         the code.
5909         (MessageData): New inner abstract class. It generally handles printing of
5910         error and warning messages.
5911         Removed unused Error, Warning, Message methods.
5912
5913 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5914
5915         Fix for cs0592-8.cs test
5916         * attribute.cs
5917         (Attributable.ValidAttributeTargets): Made public.
5918         (Attribute.ExplicitTarget): New member for explicit target value.
5919         (Attribute.CheckTargets): Now we translate explicit attribute
5920         target to Target here.
5921
5922 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5923
5924         * ecore.cs (MethodGroupExpr): new IsBase property.
5925
5926         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5927
5928         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5929         rather than an instance expr.
5930
5931         (DelegateCreation.Emit): Use the method group rather than
5932         the instance expression. Also, if you have base.Foo as the
5933         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5934
5935         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5936
5937         (NewDelegate.DoResolve): Only check for the existance of Invoke
5938         if the method is going to be needed. Use MethodGroupExpr.
5939
5940         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5941
5942         * expression.cs: For pointer arith., make sure to use
5943         the size of the type, not the size of the pointer to
5944         the type.
5945
5946 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5947
5948         Fix for #60722
5949         * class.cs (Class): Added error CS0502 test.
5950
5951 2004-08-03  John Luke  <jluke@cfl.rr.com>
5952             Raja R Harinath  <rharinath@novell.com>
5953
5954         Fix for #60997.
5955         * attribute.cs (Attribute.complained_before): New flag.
5956         (Attribute.ResolveType, Attribute.Resolve),
5957         (Attribute.DefinePInvokeMethod): Set it.
5958         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5959         
5960 2004-08-03  Martin Baulig  <martin@ximian.com>
5961
5962         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5963         use a user-defined operator; we still need to do numeric
5964         promotions in case one argument is a builtin type and the other
5965         one has an implicit conversion to that type.  Fixes #62322.
5966
5967 2004-08-02  Martin Baulig  <martin@ximian.com>
5968
5969         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5970         (LocalInfo.IsThis): New public property.
5971         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5972
5973 2004-08-01  Martin Baulig  <martin@ximian.com>
5974
5975         * class.cs (TypeContainer.GetClassBases): Don't set the default
5976         here since we may get called from GetPartialBases().
5977         (TypeContainer.DefineType): If GetClassBases() didn't return a
5978         parent, use the default one.
5979
5980 2004-07-30  Duncan Mak  <duncan@ximian.com>
5981
5982         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5983
5984 2004-07-30  Martin Baulig  <martin@ximian.com>
5985
5986         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5987
5988         * class.cs (SourceMethod): New public class, derive from the
5989         symbol writer's ISourceMethod.
5990         (Method): Use the new symbol writer API.
5991
5992         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5993         as argument and use the new symbol writer.
5994
5995         * location.cs
5996         (SourceFile): Implement the symbol writer's ISourceFile.
5997         (Location.SymbolDocument): Removed.
5998         (Location.SourceFile): New public property.
5999
6000         * symbolwriter.cs: Use the new symbol writer API.
6001
6002 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6003
6004         * Makefile (install-local): Remove.  Functionality moved to
6005         executable.make.
6006
6007 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6008
6009         * Makefile: Install mcs.exe.config file together with mcs.exe.
6010         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6011         correct runtime version.
6012         
6013 2004-07-25  Martin Baulig  <martin@ximian.com>
6014
6015         * class.cs
6016         (TypeContainer.RegisterOrder): Removed, this was unused.
6017         (TypeContainer, interface_order): Removed.
6018         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6019         TypeContainer as argument since we can also be called with a
6020         `PartialContainer' for a partial class/struct/interface.
6021         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6022         of checking whether we're an `Interface' - we could be a
6023         `PartialContainer'.
6024         (PartialContainer.Register): Override; call
6025         AddClass()/AddStruct()/AddInterface() on our parent.
6026
6027         * cs-parser.jay (interface_member_declaration): Add things to the
6028         `current_container', not the `current_class'.
6029
6030         * rootcontext.cs (RegisterOrder): The overloaded version which
6031         takes an `Interface' was unused, removed.
6032
6033         * typemanager.cs (TypeManager.LookupInterface): Return a
6034         `TypeContainer', not an `Interface'.
6035         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6036         contain a `PartialContainer' for an interface, so check it's
6037         `Kind' to figure out what it is.
6038
6039 2004-07-25  Martin Baulig  <martin@ximian.com>
6040
6041         * class.cs (Class.DefaultTypeAttributes): New public constant.
6042         (Struct.DefaultTypeAttributes): Likewise.
6043         (Interface.DefaultTypeAttributes): Likewise.
6044         (PartialContainer.TypeAttr): Override this and add the
6045         DefaultTypeAttributes.
6046
6047 2004-07-25  Martin Baulig  <martin@ximian.com>
6048
6049         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6050         we can just use the `Parent' field instead.
6051
6052 2004-07-25  Martin Baulig  <martin@ximian.com>
6053
6054         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6055
6056 2004-07-25  Martin Baulig  <martin@ximian.com>
6057
6058         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6059         our parts before defining any methods.
6060         (TypeContainer.VerifyImplements): Make this virtual.
6061         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6062         on our PartialContainer.
6063
6064 2004-07-25  Martin Baulig  <martin@ximian.com>
6065
6066         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6067
6068         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6069         argument, we can just use the `Parent' field instead.
6070
6071         * class.cs
6072         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6073         (MemberBase.DoDefine): Likewise.
6074
6075 2004-07-24  Martin Baulig  <martin@ximian.com>
6076
6077         * decl.cs (MemberCore.Parent): New public field.
6078         (DeclSpace.Parent): Moved to MemberCore.
6079
6080         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6081         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6082         parent's .ctor.
6083         (FieldBase, Field, Operator): Likewise.
6084         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6085         (EventField, Event): Likewise.
6086
6087 2004-07-23  Martin Baulig  <martin@ximian.com>
6088
6089         * class.cs (PartialContainer): New public class.
6090         (ClassPart): New public class.
6091         (TypeContainer): Added support for partial classes.
6092         (TypeContainer.GetClassBases): Splitted some of the functionality
6093         out into GetNormalBases() and GetPartialBases().
6094
6095         * cs-tokenizer.cs (Token.PARTIAL): New token.
6096         (Tokenizer.consume_identifier): Added some hacks to recognize
6097         `partial', but only if it's immediately followed by `class',
6098         `struct' or `interface'.
6099
6100         * cs-parser.jay: Added support for partial clases.
6101
6102 2004-07-23  Martin Baulig  <martin@ximian.com>
6103
6104         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6105         a `DeclSpace' and also made it readonly.
6106         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6107         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6108         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6109
6110         * cs-parser.jay: Pass the `current_class', not the
6111         `current_container' (at the moment, this is still the same thing)
6112         to a new Method, Property, Event, Indexer or Constructor.
6113
6114 2004-07-23  Martin Baulig  <martin@ximian.com>
6115
6116         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6117         and removed the `current_interface' one.
6118         (struct_declaration, class_declaration, interface_declaration):
6119         Set `current_class' to the newly created class/struct/interface;
6120         set their `Bases' and call Register() before parsing their body.
6121
6122 2004-07-23  Martin Baulig  <martin@ximian.com>
6123
6124         * class.cs (Kind): New public enum.
6125         (TypeContainer): Made this class abstract.
6126         (TypeContainer.Kind): New public readonly field.
6127         (TypeContainer.CheckDef): New public method; moved here from
6128         cs-parser.jay.
6129         (TypeContainer.Register): New public abstract method.
6130         (TypeContainer.GetPendingImplementations): New public abstract
6131         method.
6132         (TypeContainer.GetClassBases): Removed the `is_class' and
6133         `is_iface' parameters.
6134         (TypeContainer.DefineNestedTypes): Formerly known as
6135         DoDefineType().
6136         (ClassOrStruct): Made this class abstract.
6137
6138         * tree.cs (RootTypes): New public type. 
6139
6140 2004-07-20  Martin Baulig  <martin@ximian.com>
6141
6142         * tree.cs (Tree.RecordNamespace): Removed.
6143         (Tree.Namespaces): Removed.
6144
6145         * rootcontext.cs (RootContext.IsNamespace): Removed.
6146
6147         * cs-parser.jay (namespace_declaration): Just create a new
6148         NamespaceEntry here.
6149
6150 2004-07-20  Martin Baulig  <martin@ximian.com>
6151
6152         * statement.cs (ExceptionStatement): New abstract class.  This is
6153         now used as a base class for everyone who's using `finally'.
6154         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6155         our local variables before using them.
6156
6157         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6158         virtual method.  This is used by Yield.Resolve() to "steal" an
6159         outer block's `finally' clauses.
6160         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6161         argument.
6162
6163         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6164         version which takes an ExceptionStatement.  This version must be
6165         used to create exception branchings.
6166
6167         * iterator.cs
6168         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6169         (Iterator.EmitMoveNext): Added exception support; protect the
6170         block with a `fault' clause, properly handle 'finally' clauses.
6171         (Iterator.EmitDispose): Run all the `finally' clauses here.
6172
6173 2004-07-20  Martin Baulig  <martin@ximian.com>
6174
6175         * iterator.cs: This is the first of a set of changes in the
6176         iterator code.  Match the spec more closely: if we're an
6177         IEnumerable, then GetEnumerator() must be called.  The first time
6178         GetEnumerator() is called, it returns the current instance; all
6179         subsequent invocations (if any) must create a copy.
6180
6181 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6182
6183         * expression.cs: Resolve the constant expression before returning
6184         it. 
6185
6186 2004-07-19  Martin Baulig  <martin@ximian.com>
6187
6188         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6189         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6190         the return type of the new EmitContext.
6191
6192 2004-07-18  Martin Baulig  <martin@ximian.com>
6193
6194         * class.cs (Property.Define): Fix iterators.
6195
6196         * iterators.cs (Iterator.Define): Moved the
6197         `container.AddInterator (this)' call here from the .ctor; only do
6198         it if we resolved successfully.
6199
6200 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6201
6202         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6203         `true' for preprocessing directives that we parse.  The return
6204         value indicates whether we should return to regular tokenizing or
6205         not, not whether it was parsed successfully.
6206
6207         In the past if we were in: #if false ... #line #endif, we would
6208         resume parsing after `#line'.  See bug 61604.
6209
6210         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6211         building: IsEnumType should return true only for enums, not for
6212         enums or System.Enum itself.  This fixes #61593.
6213
6214         Likely what happened is that corlib was wrong: mcs depended on
6215         this bug in some places.  The bug got fixed, we had to add the
6216         hack, which caused bug 61593.
6217
6218         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6219         that was a workaround for the older conditions.
6220
6221 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6222
6223         * assign.cs: IAssignMethod has a new interface, as documented
6224         inline. All assignment code now uses this new api.
6225
6226         * ecore.cs, expression.cs: All classes which implement
6227         IAssignMethod now use the new interface.
6228
6229         * expression.cs (Invocation): add a hack to EmitCall so that
6230         IndexerAccess can be the target of a compound assignment without
6231         evaluating its arguments twice.
6232
6233         * statement.cs: Handle changes in Invocation api.
6234
6235 2004-07-16  Martin Baulig  <martin@ximian.com>
6236
6237         * iterators.cs: Rewrote this.  We're now using one single Proxy
6238         class for both the IEnumerable and the IEnumerator interface and
6239         `Iterator' derives from Class so we can use the high-level API.
6240
6241         * class.cs (TypeContainer.AddIterator): New method.
6242         (TypeContainer.DoDefineType): New protected virtual method, which
6243         is called from DefineType().
6244         (TypeContainer.DoDefineMembers): Call DefineType() and
6245         DefineMembers() on all our iterators.
6246         (TypeContainer.Emit): Call Emit() on all our iterators.
6247         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6248
6249         * codegen.cs (EmitContext.CurrentIterator): New public field.
6250
6251 2004-07-15  Martin Baulig  <martin@ximian.com>
6252
6253         * typemanager.cs
6254         (TypeManager.not_supported_exception_type): New type.   
6255
6256 2004-07-14  Martin Baulig  <martin@ximian.com>
6257
6258         * iterators.cs: Use real error numbers.
6259
6260 2004-07-14  Martin Baulig  <martin@ximian.com>
6261
6262         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6263         requires this to be a System.Collection.IEnumerable and not a
6264         class implementing that interface.
6265         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6266
6267 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6268
6269         * class.cs: Fixed previous fix, it broke some error tests.
6270
6271 2004-07-12  Martin Baulig  <martin@ximian.com>
6272
6273         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6274         Fixes #61293.
6275
6276 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6277
6278         * assign.cs (LocalTemporary): Add new argument: is_address,If
6279         `is_address' is true, then the value that we store is the address
6280         to the real value, and not the value itself.
6281         
6282         * ecore.cs (PropertyExpr): use the new local temporary
6283         stuff to allow us to handle X.Y += z (where X is a struct)
6284
6285 2004-07-08  Martin Baulig  <martin@ximian.com>
6286
6287         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6288         not always return, just like we're doing in Using.Resolve().
6289
6290 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6291
6292         * cs-parser.jay (fixed_statement): flag this as Pinned.
6293
6294 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6295
6296         * typemanager.cs (TypeManager): Removed MakePinned method, this
6297         mechanism is replaced with the .NET 2.x compatible mechanism of
6298         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6299
6300         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6301         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6302         `IsFixed' property which has a different meaning.
6303
6304 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6305
6306         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6307         visible from inside a nested class, not just the names of the
6308         immediately enclosing class.
6309         Fix for bug #60730.
6310
6311 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6312
6313         * expression.cs (BetterConversion): Remove buggy special-case
6314         handling of "implicit constant expression conversions".  At this
6315         point, we already know that the conversion is possible -- we're
6316         only checking to see which is better.
6317
6318 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6319
6320         * cs-parser.jay: Added error CS0210 test.
6321
6322 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6323
6324         * cs-parser.jay: Added error CS0134 test.
6325
6326 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6327
6328         Fix bug #52507
6329         * cs-parser.jay: Added error CS0145 test.
6330
6331 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6332
6333         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6334
6335 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6336         
6337         * expression.cs (StackAlloc.Resolve): The argument may not
6338         be a constant; deal with this case.
6339         
6340 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6341
6342         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6343         GetIndexerAttributeValue.
6344         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6345
6346         * class.cs (Indexer.Define): Added error tests for CS0415,
6347         CS0609.
6348
6349 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6350
6351         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6352         property code.
6353
6354 2004-06-23  Martin Baulig  <martin@ximian.com>
6355
6356         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6357         neither return nor throw, reset the barrier as well.  Fixes #60457.
6358
6359 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6360
6361         * class.cs : EventAttributes is now set to None by default.
6362           This fixes bug #60459.
6363
6364 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6365
6366         Fix bug #60219
6367         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6368         Don't throw exception but return null (it's sufficient now).
6369
6370 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6371
6372         * typemanager.cs (GetArgumentTypes): Faster implementation.
6373
6374 2004-06-18  Martin Baulig  <martin@ximian.com>
6375
6376         * attribute.cs (Attribute.Resolve): Check whether we're an
6377         EmptyCast which a Constant child.  Fixes #60333.
6378
6379 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6380
6381         * statement.cs (EmitCollectionForeach): Account for the fact that
6382         not all valuetypes are in areas which we can take the address of.
6383         For these variables, we store to a temporary variable. Also, make
6384         sure that we dont emit a `callvirt' on a valuetype method.
6385
6386 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6387
6388         * expression.cs (StackAlloc.DoReSolve): Added test for
6389         negative parameter (CS0247).
6390
6391 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6392
6393         Fix bug #59792
6394         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6395
6396 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6397
6398         Fix bug #59781
6399         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6400         ulong.
6401
6402 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6403
6404         Fix bug #58254 & cs1555.cs, cs1556.cs
6405         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6406
6407 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6408
6409         * cs-parser.jay: Added error CS1669 test for indexers.
6410
6411 2004-06-11  Martin Baulig  <martin@ximian.com>
6412
6413         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6414         call this twice: for params and varargs methods.
6415
6416 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6417
6418         * class.cs:
6419         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6420
6421 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * attribute.cs (Attribute.GetValidTargets): Made public.
6424
6425         * class.cs: 
6426         (AbstractPropertyEventMethod): New class for better code sharing.
6427         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6428         CS1667 report.
6429         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6430
6431 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6432
6433         Fix bug #59477.
6434         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6435         that the call to Resolve is part of a MemberAccess.
6436         (Expression.Resolve): Use it for SimpleName resolution.
6437         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6438         Add 'intermediate' boolean argument.
6439         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6440         error message when the SimpleName can be resolved ambiguously
6441         between an expression and a type.
6442         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6443         public.
6444         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6445         call on the left-side.
6446
6447 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6448
6449         * class.cs:
6450         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6451
6452 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6453
6454         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6455
6456 2004-06-11  Martin Baulig  <martin@ximian.com>
6457
6458         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6459         varargs methods if applicable.
6460
6461 2004-06-11  Martin Baulig  <martin@ximian.com>
6462
6463         * expression.cs (Invocation.EmitCall): Don't use
6464         `method.CallingConvention == CallingConventions.VarArgs' since the
6465         method could also have `CallingConventions.HasThis'.
6466
6467 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6468
6469         * class.cs (Event.GetSignatureForError): Implemented.
6470         Fixed crash in error test cs3010.cs
6471
6472 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6473
6474         * cs-tokenizer.cs: Change the way we track __arglist to be
6475         consistent with the other keywords.
6476
6477 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6478
6479         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6480         tomorrow.
6481
6482 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6483
6484         * codegen.cs: Check that all referenced assemblies have a strongname
6485         before strongnaming the compiled assembly. If not report error CS1577.
6486         Fix bug #56563. Patch by Jackson Harper.
6487         * typemanager.cs: Added a method to return all referenced assemblies.
6488         Fix bug #56563. Patch by Jackson Harper.
6489
6490 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6491
6492         * class.cs:
6493         (Method.ApplyAttributeBuilder): Moved and added conditional
6494         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6495
6496         * delegate.cs:
6497         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6498
6499 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6500
6501         Fixed #59640
6502         * class.cs: (EventField.attribute_targets): Changed default target.
6503
6504 2004-06-08  Martin Baulig  <martin@ximian.com>
6505
6506         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6507
6508 2004-06-08  Martin Baulig  <martin@ximian.com>
6509
6510         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6511
6512 2004-06-07  Martin Baulig  <martin@ximian.com>
6513
6514         Added support for varargs methods.
6515
6516         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6517         keyword.
6518
6519         * cs-parser.jay: Added support for `__arglist'.
6520
6521         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6522
6523         * expression.cs (Argument.AType): Added `ArgList'.
6524         (Invocation): Added support for varargs methods.
6525         (ArglistAccess): New public class.
6526         (Arglist): New public class.
6527
6528         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6529
6530         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6531         a method's top-level block if the method has varargs.
6532
6533         * support.cs (ReflectionParameters, InternalParameters): Added
6534         support for varargs methods.    
6535
6536 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6537
6538         * class.cs: Provide location in indexer error report.
6539
6540         * driver.cs: Use standard names.
6541
6542         * namespace.cs: Catch the use of using after a namespace has been
6543         declared also on using aliases.
6544
6545 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6546
6547         Bug #50820.
6548         * typemanager.cs (closure_private_ok, closure_invocation_type)
6549         (closure_qualifier_type, closure_invocation_assembly)
6550         (FilterWithClosure): Move to ...
6551         (Closure): New internal nested class.
6552         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6553         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6554         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6555         (MemberLookup, MemberLookupFailed): Use it.
6556         * expression.cs (New.DoResolve): Treat the lookup for the
6557         constructor as being qualified by the 'new'ed type.
6558         (Indexers.GetIndexersForTypeOrInterface): Update.
6559
6560 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6561
6562         * attribute.cs
6563         (GetConditionalAttributeValue): New method. Returns
6564         condition of ConditionalAttribute.
6565         (SearchMulti): New method.  Returns all attributes of type 't'.
6566         Use it when attribute is AllowMultiple = true.
6567         (IsConditionalMethodExcluded): New method.
6568
6569         * class.cs
6570         (Method.IsExcluded): Implemented. Returns true if method has conditional
6571         attribute and the conditions is not defined (method is excluded).
6572         (IMethodData): Extended interface for ConditionalAttribute support.
6573         (PropertyMethod.IsExcluded): Implemented.
6574
6575         * decl.cs
6576         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6577
6578         * expression.cs
6579         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6580         on the method.
6581
6582 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6583
6584         * expression.cs (ArrayCreationExpression): Make this just an
6585         `expression'. It can't be a statement, so the code here was
6586         dead.
6587
6588 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6589
6590         Fixed #59072
6591         * typemanager.cs (GetFullNameSignature): New method for
6592         MethodBase types.
6593
6594 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6595
6596         Fixed #56452
6597         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6598         Use this method when MethodBuilder is null.
6599         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6600         Added test for error CS0626 (MONO reports error for this situation).
6601         (IMethodData.GetSignatureForError): Extended interface.
6602
6603 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6604
6605         * attribute.cs
6606         (AttributeTester.GetObsoleteAttribute): Returns instance of
6607         ObsoleteAttribute when type is obsolete.
6608
6609         * class.cs
6610         (TypeContainer.VerifyObsoleteAttribute): Override.
6611         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6612         (MethodCode.VerifyObsoleteAttribute): Override.
6613         (MemberBase.VerifyObsoleteAttribute): Override.
6614
6615         * decl.cs
6616         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6617         and report proper error.
6618
6619         *delegate.cs
6620         Delegate.VerifyObsoleteAttribute): Override.
6621
6622         * ecore.cs
6623         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6624         and report proper error.
6625         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6626
6627         * enum.cs
6628         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6629         and enum member.
6630
6631         * expression.cs
6632         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6633         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6634         Added test for ObsoleteAttribute.
6635
6636         * statement.cs
6637         (Catch): Derived from Statement.
6638
6639 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6640  
6641         Fixed bug #59071 & cs0160.cs
6642  
6643         * statement.cs (Try.Resolve): Check here whether order of catch
6644         clauses matches their dependencies.
6645
6646 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6647
6648         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6649         caused a regression: #59343.  Referencing nested classes from an
6650         assembly stopped working.
6651
6652 2004-05-31  Martin Baulig  <martin@ximian.com>
6653
6654         MCS is now frozen for beta 2.
6655
6656 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6657
6658         * convert.cs: add a trivial cache for overload operator resolution.
6659
6660 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6661
6662         * decl.cs: If possible, use lookuptypedirect here. We can only do
6663         this if there is no `.' after the namespace. Avoids using
6664         LookupType, which does lots of slow processing.
6665         (FindNestedType) New method, does what it says :-).
6666         * namespace.cs: use LookupTypeDirect.
6667         * rootcontext.cs: use membercache, if possible.
6668         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6669
6670 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6671
6672         * expression.cs:
6673         According to the spec, 
6674
6675         In a member access of the form E.I, if E is a single identifier,
6676         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6677         field, property, localvariable, or parameter with the same type as
6678         the meaning of E as a type-name (§3.8), then both possible
6679         meanings of E are permitted.
6680
6681         We did not check that E as a simple-name had the same type as E as
6682         a type name.
6683
6684         This trivial check gives us 5-7% on bootstrap time.
6685
6686 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6687
6688         * expression.cs (Invocation.OverloadResolve): Avoid the
6689         use of hashtables and boxing here by allocating on demand.
6690
6691 2004-05-30  Martin Baulig  <martin@ximian.com>
6692
6693         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6694         we're doing a silent lookup.  Don't try to lookup nested types in
6695         TypeManager.object_type (thanks to Ben Maurer).
6696
6697 2004-05-30  Martin Baulig  <martin@ximian.com>
6698
6699         Committing a patch from Ben Maurer.
6700
6701         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6702
6703 2004-05-29  Martin Baulig  <martin@ximian.com>
6704
6705         * class.cs (IMethodData.ShouldIgnore): New method.
6706
6707         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6708         `Location' argument, we don't need it anywhere.  Use
6709         `IMethodData.ShouldIgnore ()' instead of
6710         `MethodData.GetMethodFlags ()'.
6711         (TypeManager.AddMethod): Removed.
6712         (TypeManager.AddMethod2): Renamed to AddMethod.
6713
6714 2004-05-29  Martin Baulig  <martin@ximian.com>
6715
6716         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6717
6718         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6719         converting from a class type S to an interface type and we already
6720         have an object on the stack, don't box it again.  Fixes #52578.
6721
6722 2004-05-29  Martin Baulig  <martin@ximian.com>
6723
6724         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6725         Added support for `params' parameters.  Fixes #59267.
6726
6727 2004-05-29  Martin Baulig  <martin@ximian.com>
6728
6729         * literal.cs (NullPointer): Provide a private .ctor which sets
6730         `type' to TypeManager.object_type.  Fixes #59048.
6731
6732 2004-05-29  Martin Baulig  <martin@ximian.com>
6733
6734         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6735         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6736
6737         * ecore.cs (EventExpr.instance_expr): Make the field private.
6738
6739 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6740
6741         Fixed bug #50080 & cs0214-2.cs
6742         * expression.cs (Cast.DoResolve): Check unsafe context here.
6743         
6744         * statement.cs (Resolve.DoResolve): Likewise.
6745
6746 2004-05-26  Martin Baulig  <martin@ximian.com>
6747
6748         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6749
6750         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6751         (RootContext.LookupType): Pass down the `silent' flag.
6752
6753 2004-05-25  Martin Baulig  <martin@ximian.com>
6754
6755         * expression.cs
6756         (MethodGroupExpr.IdenticalTypeName): New public property.
6757         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6758         expression actually refers to a type.
6759
6760 2004-05-25  Martin Baulig  <martin@ximian.com>
6761
6762         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6763         for #56176 and made it actually work.
6764
6765 2004-05-25  Martin Baulig  <martin@ximian.com>
6766
6767         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6768         (FieldExpr, PropertyExpr): Override and implement
6769         CacheTemporaries.  Fixes #52279.
6770
6771 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6772
6773         * location.cs: In the new compiler listing a file twice is a
6774         warning, not an error.
6775
6776 2004-05-24  Martin Baulig  <martin@ximian.com>
6777
6778         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6779         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6780
6781 2004-05-24  Martin Baulig  <martin@ximian.com>
6782
6783         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6784         walking the `using' list.  Fixes #53921.
6785
6786 2004-05-24  Martin Baulig  <martin@ximian.com>
6787
6788         * const.cs (Const.LookupConstantValue): Added support for
6789         EmptyCast's; fixes #55251.
6790
6791 2004-05-24  Martin Baulig  <martin@ximian.com>
6792
6793         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6794         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6795         which does the CS0135 check.  The reason is that we first need to
6796         check whether the variable actually exists.
6797
6798 2004-05-24  Martin Baulig  <martin@ximian.com>
6799
6800         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6801         than RootContext.LookupType() to find the explicit interface
6802         type.  Fixes #58584.
6803
6804 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6805
6806         * Makefile: Simplify.  Use executable.make.
6807         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6808
6809 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6810
6811         * decl.cs:
6812         * enum.cs:
6813         Use the invariant culture when doing String.Compare for CLS case
6814         sensitivity.
6815         
6816 2004-05-23  Martin Baulig  <martin@ximian.com>
6817
6818         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6819         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6820
6821         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6822         
6823 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6824
6825         * class.cs (MemberBase.Define): Reuse MemberType member for 
6826         resolved type. Other methods can use it too.
6827
6828 2004-05-23  Martin Baulig  <martin@ximian.com>
6829
6830         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6831         the variable also exists in the current block (otherwise, we need
6832         to report a CS0103).  Fixes #58670.
6833
6834 2004-05-23  Martin Baulig  <martin@ximian.com>
6835
6836         * flowanalysis.cs (Reachability.Reachable): Compute this
6837         on-the-fly rather than storing it as a field.
6838
6839 2004-05-23  Martin Baulig  <martin@ximian.com>
6840
6841         * flowanalysis.cs (Reachability.And): Manually compute the
6842         resulting `barrier' from the reachability.      
6843        
6844 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6845
6846         Fix bug #57835
6847         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6848         instance of ObsoleteAttribute when symbol is obsolete.
6849
6850         * class.cs
6851         (IMethodData): Extended interface for ObsoleteAttribute support.
6852
6853 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6854
6855         * attribute.cs: Fix bug #55970
6856
6857 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6858
6859         Fix bug #52705
6860         * attribute.cs
6861         (GetObsoleteAttribute): New method. Creates the instance of
6862         ObsoleteAttribute.
6863         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6864         ObsoleteAttribute when member is obsolete.
6865         (AttributeTester.Report_ObsoleteMessage): Common method for
6866         Obsolete error/warning reporting.
6867
6868         * class.cs
6869         (TypeContainer.base_classs_type): New member for storing parent type.
6870
6871         * decl.cs
6872         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6873         for this MemberCore.
6874
6875 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6876
6877         * attribute.cs, const.cs: Fix bug #58590
6878
6879 2004-05-21  Martin Baulig  <martin@ximian.com>
6880
6881         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6882         out parameters if the end of the method is unreachable.  Fixes
6883         #58098. 
6884
6885 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6886
6887         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6888         Hari was right, why extra method.
6889
6890 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6891
6892         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6893
6894 2004-05-20  Martin Baulig  <martin@ximian.com>
6895
6896         Merged this back from gmcs to keep the differences to a minumum.
6897
6898         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6899         instead of a Declspace.
6900         (Attribute.ResolveType): Likewise.
6901         (Attributes.Search): Likewise.
6902         (Attributes.Contains): Likewise.
6903         (Attributes.GetClsCompliantAttribute): Likewise.
6904
6905         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6906         argument.
6907         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6908         DeclSpace.
6909
6910 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6911
6912         Fix bug #58688 (MCS does not report error when the same attribute
6913         is assigned twice)
6914
6915         * attribute.cs (Attribute.Emit): Distinction between null and default.
6916
6917 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6918
6919         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6920         of a top-level attribute without an attribute target.
6921         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6922         Make non-static.
6923         (Attribute.Conditional_GetConditionName), 
6924         (Attribute.Obsolete_GetObsoleteMessage): Update.
6925         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6926         part of ScanForIndexerName.
6927         (Attribute.CanIgnoreInvalidAttribute): New function.
6928         (Attribute.ScanForIndexerName): Move to ...
6929         (Attributes.ScanForIndexerName): ... here.
6930         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6931         (Attributes.Search): New internal variant that can choose not to
6932         complain if types aren't resolved.  The original signature now
6933         complains.
6934         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6935         complaints suppressed.
6936         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6937         only if it not useful.
6938         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6939         top-level for attributes that are shared between the assembly
6940         and a top-level class.
6941         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6942         * class.cs: Update to reflect changes.
6943         (DefineIndexers): Fuse loops.
6944         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6945         a couple more variants of attribute names.
6946
6947 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6948
6949         Fix bug #52585 (Implemented explicit attribute declaration)
6950
6951         * attribute.cs:
6952         (Attributable.ValidAttributeTargets): New abstract method. It gets
6953         list of valid attribute targets for explicit target declaration.
6954         (Attribute.Target): It holds target itself.
6955         (AttributeSection): Removed.
6956         (Attribute.CheckTargets): New method. It checks whether attribute
6957         target is valid for the current element.
6958
6959         * class.cs:
6960         (EventProperty): New class. For events that are declared like
6961         property (with add and remove accessors).
6962         (EventField): New class. For events that are declared like field.
6963         class.cs
6964
6965         * cs-parser.jay: Implemented explicit attribute target declaration.
6966
6967         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6968         Override ValidAttributeTargets.
6969
6970         * parameter.cs:
6971         (ReturnParameter): Class for applying custom attributes on 
6972         the return type.
6973         (ParameterAtribute): New class. Class for applying custom
6974         attributes on the parameter type.
6975
6976 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6977
6978         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6979         definitions. 
6980
6981         (Method): Allow UNSAFE here.
6982
6983         * modifiers.cs: Support unsafe reporting.
6984
6985 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6986
6987         * decl.cs: Fix bug #58478.
6988
6989 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6990
6991         * statement.cs: When checking for unreachable code on an EmptyStatement,
6992         set the location. Fixes bug #58488.
6993
6994 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6995
6996         * driver.cs: Add -pkg handling.
6997
6998         From Gonzalo: UseShelLExecute=false
6999
7000 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7001
7002         * attribute.cs:
7003         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7004         for attribute.
7005         (Attribute.IsClsCompliaceRequired): Moved to base for better
7006         accesibility.
7007         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7008         when attribute is AttributeUsageAttribute.
7009         (Attribute.GetValidTargets): Simplified.
7010         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7011         attribute for this type.
7012         (Attribute.ApplyAttributes): Method renamed to Emit and make
7013         non-static.
7014         (GlobalAttributeSection): New class for special handling of global
7015         attributes (assembly, module).
7016         (AttributeSection.Emit): New method.
7017
7018         * class.cs: Implemented Attributable abstract methods.
7019         (MethodCore.LabelParameters): Moved to Parameter class.
7020         (Accessor): Is back simple class.
7021         (PropertyMethod): Implemented Attributable abstract class.
7022         (DelegateMethod): Implemented Attributable abstract class.
7023         (Event): New constructor for disctintion between normal Event
7024         and Event with accessors.
7025
7026         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7027
7028         * codegen.cs, const.cs, decl.cs, delegate.cs:
7029         (CommonAssemblyModulClass): Implemented Attributable abstract class
7030         and simplified.
7031
7032         * enum.cs: Implement IAttributeSupport interface.
7033         (EnumMember): New class for emum members. Implemented Attributable
7034         abstract class
7035
7036         * parameter.cs:
7037         (ParameterBase): Is abstract.
7038         (ReturnParameter): New class for easier [return:] attribute handling.
7039
7040         * typemanager.cs: Removed builder_to_attr.
7041
7042 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7043
7044         Fix bug #57151.
7045         * attribute.cs (Attribute.GetPositionalValue): New function.
7046         * class.cs (TypeContainer.VerifyMembers): New function.
7047         (TypeContainer.Emit): Use it.
7048         (ClassOrStruct): New base class for Class and Struct.
7049         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7050         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7051         class.
7052         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7053         then each non-static field should have a FieldOffset attribute.
7054         Otherwise, none of the fields should have a FieldOffset attribute.
7055         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7056         and FieldOffset attributes.
7057         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7058         (TypeManager.field_offset_attribute_type): New core types.
7059         (TypeManager.InitCoreTypes): Initialize them.
7060
7061 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7062
7063         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7064         Return correct type.
7065         From bug #58270.
7066
7067 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7068
7069         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7070         be implicitly converted to ulong.
7071         
7072         * expression.cs: The logic for allowing operator &, | and ^ worked
7073         was wrong, it worked before because we did not report an error in
7074         an else branch.  Fixes 57895.
7075
7076         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7077         allow volatile fields to be reference types.
7078
7079 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7080
7081         * driver.cs: Add support for /debug-
7082
7083 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7084
7085         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7086         Add a 'complain' parameter to silence errors.
7087         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7088         silently overlooked type-resolutions.
7089         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7090         to reflect changes.
7091         (Attributes.Search): New function.
7092         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7093         (Attributes.GetAttributeFullName): Remove hack.
7094         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7095         Update to reflect changes.
7096         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7097         Use Attributes.Search instead of nested loops.
7098
7099 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7100
7101         * decl.cs:
7102         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7103         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7104         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7105
7106         * report.cs: (Report.Warning): Renamed to Warning_T because of
7107         parameter collision.
7108
7109 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7110
7111         * expression.cs (MemberAccess.ResolveMemberAccess):
7112         Exit with non-zero status after Report.Error.
7113         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7114         Likewise.
7115         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7116
7117 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7118
7119         * support.cs: Don't hang when the file is empty.
7120
7121 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7122
7123         * support.cs: In SeekableStreamReader, compute the preamble size of the
7124           underlying stream. Position changes should take into account that initial
7125           count of bytes.
7126
7127 2004-05-03  Todd Berman  <tberman@sevenl.net>
7128
7129         * driver.cs: remove unused GetSysVersion function.
7130
7131 2004-05-03  Todd Berman  <tberman@sevenl.net>
7132
7133         * driver.cs: Remove the hack from saturday, as well as the hack
7134         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7135         link_paths to get that bit proper.
7136
7137 2004-05-01  Todd Berman  <tberman@sevenl.net>
7138
7139         * driver.cs: Try a LoadFrom before a Load, this checks the current
7140         path. This is currently a bug in mono that is be fixed, however, this
7141         provides a workaround for now. This will be removed when the bug
7142         is fixed.
7143
7144 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7145
7146         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7147         incomplete key pairs (#57941).
7148
7149 2004-05-01  Todd Berman  <tberman@sevenl.net>
7150
7151         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7152         from the GAC
7153
7154 2004-04-30  Jackson Harper  <jackson@ximian.com>
7155
7156         * codegen.cs: Open keys readonly.
7157         
7158 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7159
7160         * typemanager.cs: don't report cyclic struct layout when a struct
7161         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7162         which has 2 Pango.Rectangle fields.
7163
7164 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7165
7166         * expression.cs: Handle IntPtr comparisons with IL code
7167         rather than a method call.
7168
7169 2004-04-29  Martin Baulig  <martin@ximian.com>
7170
7171         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7172         the list of PropertyInfo's in class hierarchy and find the
7173         accessor.  Fixes #56013.
7174
7175 2004-04-29  Martin Baulig  <martin@ximian.com>
7176
7177         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7178
7179 2004-04-29  Martin Baulig  <martin@ximian.com>
7180
7181         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7182
7183         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7184
7185 2004-04-29  Martin Baulig  <martin@ximian.com>
7186
7187         * class.cs (ConstructorInitializer.Resolve): Check whether the
7188         parent .ctor is accessible.  Fixes #52146.
7189
7190 2004-04-29  Martin Baulig  <martin@ximian.com>
7191
7192         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7193
7194         * statement.cs (Using.EmitLocalVariableDecls): Use
7195         TypeManager.idisposable_type, not typeof (IDisposable).
7196         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7197
7198 2004-04-29  Martin Baulig  <martin@ximian.com>
7199
7200         * class.cs (Event.Define): Don't emit the field and don't set
7201         RTSpecialName and SpecialName for events on interfaces.  Fixes
7202         #57703. 
7203
7204 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7205
7206         Refactor Attribute.ApplyAttributes.
7207         * attribute.cs (Attributable): New base class for objects that can
7208         have Attributes applied on them.
7209         (Attribute): Make AttributeUsage fields public.
7210         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7211         (Attribute.IsInternalCall): New property.
7212         (Attribute.UsageAttr): Convert to a public read-only property.
7213         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7214         (Attribute.ResolveType, Attribute.Resolve)
7215         (Attribute.ScanForIndexerName): Update to reflect changes.
7216         (Attribute.CheckAttributeTarget): Re-format.
7217         (Attribute.ApplyAttributes): Refactor, to various
7218         Attributable.ApplyAttributeBuilder methods.
7219         * decl.cs (MemberCore): Make Attributable.
7220         * class.cs (Accessor): Make Attributable.
7221         (MethodData.ApplyAttributes): Use proper attribute types, not
7222         attribute names.
7223         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7224         (TypeContainer.ApplyAttributeBuilder)
7225         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7226         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7227         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7228         (Operator.ApplyAttributeBuilder): New factored-out methods.
7229         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7230         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7231         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7232         * parameter.cs (ParameterBase): New Attributable base class
7233         that can also represent Return types.
7234         (Parameter): Update to the changes.
7235
7236 2004-04-29  Jackson Harper  <jackson@ximian.com>
7237
7238         * driver.cs: Prefer the corlib system version when looking for
7239         assemblies in the GAC. This is still a hack, but its a better hack
7240         now.
7241         
7242 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7243
7244         * decl.cs, enum.cs: Improved error 3005 reporting.
7245   
7246         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7247         (related_symbols): New private member for list of symbols
7248         related to reported error/warning.
7249         
7250         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7251
7252 2004-04-29  Martin Baulig  <martin@ximian.com>
7253
7254         * ecore.cs (Expression.Constantify): If we're an enum and
7255         TypeManager.TypeToCoreType() doesn't give us another type, use
7256         t.UnderlyingSystemType.  Fixes #56178.  
7257
7258 2004-04-29  Martin Baulig  <martin@ximian.com>
7259
7260         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7261         interfaces and for each interface, only add members directly
7262         declared in that interface.  Fixes #53255.
7263
7264 2004-04-28  Martin Baulig  <martin@ximian.com>
7265
7266         * expression.cs (ConditionalLogicalOperator): Use a temporary
7267         variable for `left' to avoid that we evaluate it more than once;
7268         bug #52588.
7269
7270 2004-04-28  Martin Baulig  <martin@ximian.com>
7271
7272         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7273         `void[]' (CS1547).
7274
7275 2004-04-28  Martin Baulig  <martin@ximian.com>
7276
7277         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7278         void (CS1547).
7279
7280         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7281         whether the type is not void (CS1547).
7282
7283 2004-04-28  Martin Baulig  <martin@ximian.com>
7284
7285         * expression.cs (Unary.DoResolveLValue): Override this and report
7286         CS0131 for anything but Operator.Indirection.
7287
7288 2004-04-28  Martin Baulig  <martin@ximian.com>
7289
7290         Committing a patch from Ben Maurer; see bug #50820.
7291
7292         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7293         check for classes.
7294
7295         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7296         classes.        
7297
7298 2004-04-28  Martin Baulig  <martin@ximian.com>
7299
7300         Committing a patch from Ben Maurer; see bug #50820.
7301
7302         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7303         check for classes.
7304
7305         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7306         classes.        
7307
7308 2004-04-28  Martin Baulig  <martin@ximian.com>
7309
7310         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7311         (Block.AddLabel): Call DoLookupLabel() to only search in the
7312         current block.
7313
7314 2004-04-28  Martin Baulig  <martin@ximian.com>
7315
7316         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7317         comparing StringConstants and NullLiterals in Equality and Inequality.
7318
7319 2004-04-28  Jackson Harper  <jackson@ximian.com>
7320
7321         * driver.cs: Attempt to load referenced assemblies from the
7322         GAC. This is the quick and dirty version of this method that
7323         doesnt take into account versions and just takes the first
7324         canidate found. Will be good enough for now as we will not have more
7325         then one version installed into the GAC until I update this method.
7326
7327 2004-04-28  Martin Baulig  <martin@ximian.com>
7328
7329         * typemanager.cs (TypeManager.CheckStructCycles): New public
7330         static method to check for cycles in the struct layout.
7331
7332         * rootcontext.cs (RootContext.PopulateTypes): Call
7333         TypeManager.CheckStructCycles() for each TypeContainer.
7334         [Note: We only need to visit each type once.]
7335
7336 2004-04-28  Martin Baulig  <martin@ximian.com>
7337
7338         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7339
7340         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7341         success and added `out object value'.  Use a `bool resolved' field
7342         to check whether we've already been called rather than
7343         `ConstantValue != null' since this breaks for NullLiterals.
7344
7345 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7346
7347         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7348         setting of this flag, since the 'set' method may be non-public.
7349
7350 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7351
7352         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7353         check on current_vector.Block.
7354
7355 2004-04-27  Martin Baulig  <martin@ximian.com>
7356
7357         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7358         a field initializer.  Fixes #56459.
7359
7360 2004-04-27  Martin Baulig  <martin@ximian.com>
7361
7362         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7363         we're not attempting to use an indexer.  Fixes #52154.
7364
7365 2004-04-27  Martin Baulig  <martin@ximian.com>
7366
7367         * statement.cs (Return): Don't create a return label if we don't
7368         need it; reverts my change from January 20th.  Thanks to Ben
7369         Maurer for this.
7370
7371 2004-04-27  Martin Baulig  <martin@ximian.com>
7372
7373         According to the spec, `goto' can only leave a nested scope, but
7374         never enter it.
7375
7376         * statement.cs (Block.LookupLabel): Only lookup in the current
7377         block, don't recurse into parent or child blocks.
7378         (Block.AddLabel): Check in parent and child blocks, report
7379         CS0140/CS0158 if we find a duplicate.
7380         (Block): Removed this indexer for label lookups.
7381         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7382         this already does the error reporting for us.
7383
7384         * flowanalysis.cs
7385         (FlowBranching.UsageVector.Block): New public variable; may be null.
7386         (FlowBranching.CreateSibling): Added `Block' argument.
7387         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7388         label for the target of a `goto' and check whether we're not
7389         leaving a `finally'.
7390
7391 2004-04-27  Martin Baulig  <martin@ximian.com>
7392
7393         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7394         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7395         just for returns).
7396
7397 2004-04-27  Martin Baulig  <martin@ximian.com>
7398
7399         * statement.cs (Block.AddLabel): Also check for implicit blocks
7400         and added a CS0158 check.
7401
7402 2004-04-27  Martin Baulig  <martin@ximian.com>
7403
7404         * flowanalysis.cs (FlowBranchingLoop): New class.
7405         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7406         UsageVector's instead of an ArrayList.
7407         (FlowBranching.Label): Likewise.
7408         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7409         (FlowBranching.AddBreakVector): New method.
7410
7411 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * attribute.cs: Small regression fix: only convert the type if we
7414         the type is different, fixes System.Drawing build.
7415
7416 2004-04-27  Martin Baulig  <martin@ximian.com>
7417
7418         * attribute.cs (Attribute.Resolve): If we have a constant value
7419         for a named field or property, implicity convert it to the correct
7420         type.
7421
7422 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7423
7424         * statement.cs (Block.Block): Implicit blocks share
7425         'child_variable_names' fields with parent blocks.
7426         (Block.AddChildVariableNames): Remove.
7427         (Block.AddVariable): Mark variable as "used by a child block" in
7428         every surrounding block.
7429         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7430         been used in a child block, complain about violation of "Invariant
7431         meaning in blocks" rule.
7432         * cs-parser.jay (declare_local_variables): Don't use
7433         AddChildVariableNames.
7434         (foreach_statement): Don't create an implicit block: 'foreach'
7435         introduces a scope.
7436
7437 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7438
7439         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7440         converting from 0L to ulong.  Fixes 57522.
7441
7442 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7443
7444         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7445         derived class hides via 'new' keyword field from base class (test-242.cs).
7446         TODO: Handle this in the more general way.
7447         
7448         * class.cs (CheckBase): Ditto.
7449
7450 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7451
7452         * decl.cs (caching_flags): New member for storing cached values
7453         as bit flags.
7454         (MemberCore.Flags): New enum where bit flags for caching_flags
7455         are defined.
7456         (MemberCore.cls_compliance): Moved to caching_flags.
7457         (DeclSpace.Created): Moved to caching_flags.
7458
7459         * class.cs: Use caching_flags instead of DeclSpace.Created
7460         
7461 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7462
7463         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7464         if we are only a derived class, not a nested class.
7465
7466         * typemanager.cs: Same as above, but do this at the MemberLookup
7467         level (used by field and methods, properties are handled in
7468         PropertyExpr).   Allow for the qualified access if we are a nested
7469         method. 
7470
7471 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7472
7473         * class.cs: Refactoring.
7474         (IMethodData): New inteface; Holds links to parent members
7475         to avoid member duplication (reduced memory allocation).
7476         (Method): Implemented IMethodData interface.
7477         (PropertyBase): New inner classes for get/set methods.
7478         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7479         (Event): New inner classes for add/remove methods.
7480         (Event.DelegateMethod): Implemented IMethodData interface.
7481
7482         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7483         EmitContext (related to class.cs refactoring).
7484
7485 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7486
7487         * delegate.cs (Delegate.VerifyApplicability): If the number of
7488         arguments are the same as the number of parameters, first try to
7489         verify applicability ignoring  any 'params' modifier on the last
7490         parameter.
7491         Fixes #56442.
7492
7493 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7494
7495         * class.cs (TypeContainer.AddIndexer): Use
7496         'ExplicitInterfaceName' to determine if interface name was
7497         explicitly specified.  'InterfaceType' is not initialized at this time.
7498         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7499         Indexers array is already in the required order.  Initialize
7500         'IndexerName' only if there are normal indexers.
7501         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7502         (TypeContainer.Emit): Emit DefaultMember attribute only if
7503         IndexerName is initialized.
7504         Fixes #56300.
7505
7506 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7507
7508         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7509         Fixes #57007
7510
7511 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7512
7513         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7514         attributes.
7515         Fix for #56456.
7516
7517         * attribute.cs (Attribute.Resolve): Check for duplicate named
7518         attributes.
7519         Fix for #56463.
7520
7521 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7522
7523         * iterators.cs (MarkYield): track whether we are in an exception,
7524         and generate code accordingly.  Use a temporary value to store the
7525         result for our state.
7526
7527         I had ignored a bit the interaction of try/catch with iterators
7528         since their behavior was not entirely obvious, but now it is
7529         possible to verify that our behavior is the same as MS .NET 2.0
7530
7531         Fixes 54814
7532
7533 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7534
7535         * iterators.cs: Avoid creating temporaries if there is no work to
7536         do. 
7537
7538         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7539         Enumerations, use TypeManager.EnumToUnderlying and call
7540         recursively. 
7541
7542         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7543         bug #57013
7544
7545         (This.Emit): Use EmitContext.EmitThis to emit our
7546         instance variable.
7547
7548         (This.EmitAssign): Ditto.
7549
7550         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7551         codepaths, we will move all the functionality into
7552         Mono.CSharp.This 
7553
7554         (FieldExpr.EmitAssign): Ditto.
7555
7556         This fixes several hidden bugs that I uncovered while doing a code
7557         review of this today.
7558
7559         * codegen.cs (EmitThis): reworked so the semantics are more clear
7560         and also support value types "this" instances.
7561
7562         * iterators.cs: Changed so that for iterators in value types, we
7563         do not pass the value type as a parameter.  
7564
7565         Initialization of the enumerator helpers is now done in the caller
7566         instead of passing the parameters to the constructors and having
7567         the constructor set the fields.
7568
7569         The fields have now `assembly' visibility instead of private.
7570
7571 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7572
7573         * expression.cs (Argument.Resolve): Check if fields passed as ref
7574         or out are contained in a MarshalByRefObject.
7575
7576         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7577         another compiler type.
7578
7579 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7580
7581         * class.cs (Indexer.Define): use the new name checking method.
7582         Also, return false on an error.
7583         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7584         (is_identifier_[start/part]_character): make static.
7585
7586 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7587
7588         * expression.cs (Binary.ResolveOperator): Do no append strings
7589         twice: since we can be invoked more than once (array evaluation)
7590         on the same concatenation, take care of this here.  Based on a fix
7591         from Ben (bug #56454)
7592
7593 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7594
7595         * codegen.cs: Fix another case where CS1548 must be reported (when 
7596         delay-sign isn't specified and no private is available #56564). Fix
7597         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7598         error when MCS is used on the MS runtime and we need to delay-sign 
7599         (which seems unsupported by AssemblyBuilder - see #56621).
7600
7601 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7604         (TypeManager.ComputeNamespaces): Faster implementation for
7605         Microsoft runtime.
7606
7607         * compiler.csproj: Updated AssemblyName to mcs.
7608
7609 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7610
7611         * rootcontext.cs: Add new types to the boot resolution.
7612
7613         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7614         MulticastDelegate is not allowed.
7615
7616         * typemanager.cs: Add new types to lookup: System.TypedReference
7617         and ArgIterator.
7618
7619         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7620         check for TypedReference or ArgIterator, they are not allowed. 
7621
7622         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7623         makes us properly catch 1510 in some conditions (see bug 56016 for
7624         details). 
7625
7626 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7627
7628         * CryptoConvert.cs: update from corlib version
7629         with endian fixes.
7630
7631 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7632
7633         * class.cs (Indexer.Define): Check indexername declaration
7634
7635 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7636
7637         * attribute.cs (IsClsCompliant): Fixed problem with handling
7638         all three states (compliant, not-compliant, undetected).
7639
7640 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7641
7642         * attribute.cs (Attribute): Location is now public.
7643         (Resolve): Store resolved arguments (pos_values) in attribute class.
7644         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7645         (GetClsCompliantAttributeValue): New method that gets
7646         CLSCompliantAttribute value.
7647         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7648         if exists else null.
7649         (AttributeTester): New class for CLS-Compliant verification routines.
7650
7651         * class.cs (Emit): Add CLS-Compliant verification.
7652         (Method.GetSignatureForError): Implemented.
7653         (Constructor.GetSignatureForError): Implemented
7654         (Constructor.HasCompliantArgs): Returns if constructor has
7655         CLS-Compliant arguments.
7656         (Constructor.Emit): Override.
7657         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7658         is needed to test only parameters.
7659         (FieldBase.GetSignatureForError): Implemented.
7660         (TypeContainer): New member for storing base interfaces.
7661         (TypeContainer.FindMembers): Search in base interfaces too.
7662
7663         * codegen.cs (GetClsComplianceAttribute): New method that gets
7664         assembly or module CLSCompliantAttribute value.
7665         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7666         for assembly.
7667         (ModuleClass.Emit): Add error 3012 test.
7668
7669         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7670
7671         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7672         state for all decl types.
7673         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7674         if CLS-Compliant tests are required.
7675         (IsClsCompliaceRequired): New method. Analyze whether code
7676         must be CLS-Compliant.
7677         (IsExposedFromAssembly): New method. Returns true when MemberCore
7678         is exposed from assembly.
7679         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7680         value or gets cached value.
7681         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7682         is explicitly marked with CLSCompliantAttribute.
7683         (IsIdentifierClsCompliant): New abstract method. This method is
7684         used to testing error 3005.
7685         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7686         for identifier and parameters CLS-Compliant testing.
7687         (VerifyClsCompliance): New method. The main virtual method for
7688         CLS-Compliant verifications.
7689         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7690         null. I don't know why is null (too many public members !).
7691         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7692         and get value of first CLSCompliantAttribute that found.
7693
7694         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7695         (VerifyClsCompliance): Override and add extra tests.
7696
7697         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7698         clscheck- disable CLS-Compliant verification event if assembly is has
7699         CLSCompliantAttribute(true).
7700
7701         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7702         ApllyAttribute is now called in emit section as in the other cases.
7703         Possible future Emit integration.
7704         (IsIdentifierClsCompliant): New override.
7705         (VerifyClsCompliance): New override.
7706         (GetEnumeratorName): Returns full enum name.
7707
7708         * parameter.cs (GetSignatureForError): Implemented.
7709
7710         * report.cs (WarningData): New struct for Warning message information.
7711         (LocationOfPreviousError): New method.
7712         (Warning): New method. Reports warning based on the warning table.
7713         (Error_T): New method. Reports error based on the error table.
7714
7715         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7716         verifications are done here.
7717
7718         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7719
7720         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7721         CLSCompliantAttribute.
7722         (all_imported_types): New member holds all imported types from other
7723         assemblies.
7724         (LoadAllImportedTypes): New method fills static table with exported types
7725         from all referenced assemblies.
7726         (Modules): New property returns all assembly modules.
7727
7728 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7729
7730         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7731         throwing a parser error.
7732
7733         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7734         which removes the hardcoded get_/set_ prefixes for properties, as
7735         IL allows for the properties to be named something else.  
7736
7737         Bug #56013
7738
7739         * expression.cs: Do not override operand before we know if it is
7740         non-null.  Fix 56207
7741
7742 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7743
7744         * typemanager.cs: support for pinned variables.
7745
7746 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7747
7748         * decl.cs, typemanager.cs: Avoid using an arraylist
7749         as a buffer if there is only one result set.
7750
7751 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7752
7753         * expression.cs: Make sure you cant call a static method
7754         with an instance expression, bug #56174.
7755
7756 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7757
7758         * class.cs (IsDuplicateImplementation): Improve error reporting to
7759         flag 663 (method only differs in parameter modifier).
7760
7761         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7762         in preprocessor directives.
7763
7764         * location.cs (LookupFile): Allow for the empty path.
7765
7766         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7767         better approach for some of that patch, but its failing with the
7768         CharSet enumeration.  For now try/catch will do.
7769
7770         * typemanager.cs: Do not crash if a struct does not have fields.
7771         Fixes 56150.
7772
7773 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7774
7775         * expression.cs: cs0213, cant fix a fixed expression.
7776         fixes 50231.
7777
7778 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7779
7780         * cs-parser.jay: detect invalid embeded statements gracefully.
7781         bug #51113.
7782
7783 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7784
7785         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7786         As a regex:
7787         s/
7788         the invocation type may not be a subclass of the tye of the item/
7789         The type of the item must be a subclass of the invocation item.
7790         /g
7791
7792         Fixes bug #50820.
7793
7794 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7795
7796         * attribute.cs: Added methods to get a string and a bool from an
7797         attribute. Required to information from AssemblyKeyFileAttribute,
7798         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7799         * codegen.cs: Modified AssemblyName creation to include support for
7800         strongnames. Catch additional exceptions to report them as CS1548.
7801         * compiler.csproj: Updated include CryptoConvert.cs.
7802         * compiler.csproj.user: Removed file - user specific configuration.
7803         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7804         Mono.Security assembly. The original class is maintained and tested in
7805         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7806         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7807         like CSC 8.0 (C# v2) supports.
7808         * Makefile: Added CryptoConvert.cs to mcs sources.
7809         * rootcontext.cs: Added new options for strongnames.
7810
7811 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7812
7813         * driver.cs: For --expect-error, report error code `2'
7814         if the program compiled with no errors, error code `1' if
7815         it compiled with an error other than the one expected.
7816
7817 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7818
7819         * compiler.csproj: Updated for Visual Studio .NET 2003.
7820         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7821         * compiler.sln: Updated for Visual Studio .NET 2003.
7822
7823 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7824
7825         * expression.cs: Fix bug #47234. We basically need to apply the
7826         rule that we prefer the conversion of null to a reference type
7827         when faced with a conversion to 'object' (csc behaviour).
7828
7829 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7830
7831         * statement.cs: Shorter form for foreach, eliminates
7832         a local variable. r=Martin.
7833
7834 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7835
7836         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7837         checks if we can use brtrue/brfalse to test for 0.
7838         * expression.cs: use the above in the test for using brtrue/brfalse.
7839         cleanup code a bit.
7840
7841 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7842
7843         * expression.cs: Rewrite string concat stuff. Benefits:
7844
7845         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7846         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7847         rather than a concat chain.
7848
7849         * typemanager.cs: Add lookups for more concat overloads.
7850
7851 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7852
7853         * expression.cs: Emit shorter il code for array init.
7854
7855         newarr
7856         dup
7857         // set 1
7858
7859         // set 2
7860
7861         newarr
7862         stloc.x
7863
7864         ldloc.x
7865         // set 1
7866
7867         ldloc.x
7868         // set 2
7869
7870 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7871
7872         * statement.cs: Before, two switch blocks would be merged if the
7873         total size of the blocks (end_item - begin_item + 1) was less than
7874         two times the combined sizes of the blocks.
7875
7876         Now, it will only merge if after the merge at least half of the
7877         slots are filled.
7878
7879         fixes 55885.
7880
7881 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7882
7883         * class.cs : csc build fix for GetMethods(). See bug #52503.
7884
7885 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7886
7887         * expression.cs: Make sure fp comparisons work with NaN.
7888         This fixes bug #54303. Mig approved this patch a long
7889         time ago, but we were not able to test b/c the runtime
7890         had a related bug.
7891
7892 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7893
7894         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7895
7896 2004-03-19  Martin Baulig  <martin@ximian.com>
7897
7898         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7899         error here and not in our caller.
7900
7901 2004-03-19  Martin Baulig  <martin@ximian.com>
7902
7903         * interface.cs: Completely killed this file.
7904         (Interface): We're now a TypeContainer and live in class.cs.
7905
7906         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7907         argument; we're now also called for interfaces.
7908         (TypeContainer.DefineMembers): Allow this method being called
7909         multiple times.
7910         (TypeContainer.GetMethods): New public method; formerly known as
7911         Interface.GetMethod().  This is used by PendingImplementation.
7912         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7913         it's now private and non-static.
7914         (Interface): Moved this here; it's now implemented similar to
7915         Class and Struct.
7916         (Method, Property, Event, Indexer): Added `bool is_interface'
7917         argument to their .ctor's.
7918         (MemberBase.IsInterface): New public field.
7919
7920         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7921         instances instead of InterfaceMethod, InterfaceProperty, etc.
7922         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7923         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7924
7925 2004-03-19  Martin Baulig  <martin@ximian.com>
7926
7927         * class.cs (MethodCore.IsDuplicateImplementation): New private
7928         method which does the CS0111 checking.
7929         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7930         Use IsDuplicateImplementation().
7931
7932 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7933
7934         * decl.cs (FindMemberToOverride): New method to find the correct
7935         method or property to override in the base class.
7936         * class.cs
7937             - Make Method/Property use the above method to find the
7938               version in the base class.
7939             - Remove the InheritableMemberSignatureCompare as it is now
7940               dead code.
7941
7942         This patch makes large code bases much faster to compile, as it is
7943         O(n) rather than O(n^2) to do this validation.
7944
7945         Also, it fixes bug 52458 which is that nested classes are not
7946         taken into account when finding the base class member.
7947
7948         Reviewed/Approved by Martin.
7949
7950 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7951
7952         * interface.cs: In all interface classes removed redundant
7953         member initialization.
7954
7955 2004-03-16  Martin Baulig  <martin@ximian.com>
7956
7957         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7958
7959 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7960
7961         * decl.cs (DefineTypeAndParents): New helper method to define a
7962         type's containers before the type itself is defined;  This is a
7963         bug exposed by the recent changes to Windows.Forms when an
7964         implemented interface was defined inside a class that had not been
7965         built yet.   
7966
7967         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7968
7969         (Check): Loop correctly to report errors modifiers
7970         (UNSAFE was not in the loop, since it was the same as TOP).
7971
7972         * interface.cs: Every interface member now takes a ModFlags,
7973         instead of a "is_new" bool, which we set on the base MemberCore. 
7974
7975         Every place where we called "UnsafeOk" in the interface, now we
7976         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7977         the unsafe settings from the member declaration instead of the
7978         container interface. 
7979
7980         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7981
7982         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7983         `set_indexer_name' to the pending bits (one per type).
7984
7985         We fixed a bug today that was picking the wrong method to
7986         override, since for properties the existing InterfaceMethod code
7987         basically ignored the method name.  Now we make sure that the
7988         method name is one of the valid indexer names.
7989
7990 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7991  
7992         * support.cs (SeekableStreamReader): Keep track of stream byte
7993         positions and don't mix them with character offsets to the buffer.
7994
7995         Patch from Gustavo Giráldez
7996
7997 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7998
7999         * interface.cs (InterfaceSetGetBase): Removed double member
8000         initialization, base class does it as well.
8001
8002 2004-03-13  Martin Baulig  <martin@ximian.com>
8003
8004         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8005         when compiling corlib.
8006
8007 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8008
8009         * convert.cs (ExplicitConversion): We were reporting an error on
8010         certain conversions (object_type source to a value type, when the
8011         expression was `null') before we had a chance to pass it through
8012         the user defined conversions.
8013
8014         * driver.cs: Replace / and \ in resource specifications to dots.
8015         Fixes 50752
8016
8017         * class.cs: Add check for duplicate operators.  Fixes 52477
8018
8019 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8020
8021         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8022         that are in the middle of the statements, not only at the end.
8023         Fixes #54987
8024
8025         * class.cs (TypeContainer.AddField): No longer set the
8026         `HaveStaticConstructor' flag, now we call it
8027         `UserDefineStaticConstructor' to diferentiate the slightly
8028         semantic difference.
8029
8030         The situation is that we were not adding BeforeFieldInit (from
8031         Modifiers.TypeAttr) to classes that could have it.
8032         BeforeFieldInit should be set to classes that have no static
8033         constructor. 
8034
8035         See:
8036
8037         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8038
8039         And most importantly Zoltan's comment:
8040
8041         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8042
8043         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8044          before its static fields are used', i.e. initialization does not need
8045          to be triggered by the first access to the type. Setting this flag
8046          helps the JIT to compile better code, since it can run the static
8047          constructor at JIT time, and does not need to generate code to call it
8048          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8049          this flag for lots of classes like String. 
8050          
8051          csc sets this flag if the type does not have an explicit static 
8052          constructor. The reasoning seems to be that if there are only static
8053          initalizers for a type, and no static constructor, then the programmer
8054          does not care when this initialization happens, so beforefieldinit
8055          can be used.
8056          
8057          This bug prevents the AOT compiler from being usable, since it 
8058          generates so many calls to mono_runtime_class_init that the AOT code
8059          is much slower than the JITted code. The JITted code is faster, 
8060          because it does not generate these calls if the vtable is type is
8061          already initialized, which is true in the majority of cases. But the
8062          AOT compiler can't do this."
8063
8064 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8065
8066         * class.cs (MethodData.Emit): Refactor the code so symbolic
8067         information is generated for destructors;  For some reasons we
8068         were taking a code path that did not generate symbolic information
8069         before. 
8070
8071 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8072
8073         * class.cs: Create a Constructor.CheckBase method that
8074         takes care of all validation type code. The method
8075         contains some code that was moved from Define.
8076
8077         It also includes new code that checks for duplicate ctors.
8078         This fixes bug #55148.
8079
8080 2004-03-09  Joshua Tauberer <tauberer@for.net>
8081
8082         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8083         a { ... }-style array creation invokes EmitStaticInitializers
8084         which is not good for reference-type arrays.  String, decimal
8085         and now null constants (NullCast) are not counted toward
8086         static initializers.
8087
8088 2004-03-05  Martin Baulig  <martin@ximian.com>
8089
8090         * location.cs (SourceFile.HasLineDirective): New public field;
8091         specifies whether the file contains or is referenced by a "#line"
8092         directive.
8093         (Location.DefineSymbolDocuments): Ignore source files which
8094         either contain or are referenced by a "#line" directive.        
8095
8096 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8097
8098         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8099         direct access to our parent, so check the method inline there.
8100
8101 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8102
8103         * expression.cs (Invocation.EmitCall): Miguel's last commit
8104         caused a regression. If you had:
8105
8106             T t = null;
8107             t.Foo ();
8108
8109         In Foo the implict this would be null.
8110
8111 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8112
8113         * expression.cs (Invocation.EmitCall): If the method is not
8114         virtual, do not emit a CallVirt to it, use Call.
8115
8116         * typemanager.cs (GetFullNameSignature): Improve the method to
8117         cope with ".ctor" and replace it with the type name.
8118
8119         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8120         as an argument the ConstructorBuilder where it is being defined,
8121         to catch the recursive constructor invocations.
8122
8123 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8124
8125         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8126         routines to check if a type is an enumerable/enumerator allow
8127         classes that implement the IEnumerable or IEnumerator interfaces.
8128
8129         * class.cs (Property, Operator): Implement IIteratorContainer, and
8130         implement SetYields.
8131
8132         (Property.Define): Do the block swapping for get_methods in the
8133         context of iterators.   We need to check if Properties also
8134         include indexers or not.
8135
8136         (Operator): Assign the Block before invoking the
8137         OperatorMethod.Define, so we can trigger the Iterator code
8138         replacement. 
8139
8140         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8141         Property and Operator classes are not created when we parse the
8142         declarator but until we have the block completed, so we use a
8143         singleton SimpleIteratorContainer.Simple to flag whether the
8144         SetYields has been invoked.
8145
8146         We propagate this setting then to the Property or the Operator to
8147         allow the `yield' to function.
8148
8149 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8150
8151         * codegen.cs: Implemented attribute support for modules.
8152         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8153         Assembly/Module functionality.
8154
8155         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8156         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8157         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8158
8159 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8160
8161         * interface.cs (FindMembers): The operation is performed on all base
8162         interfaces and not only on the first. It is required for future CLS Compliance patch.
8163
8164 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8165
8166         * statement.cs, codegen.cs:
8167         This patch deals with patterns such as:
8168
8169         public class List : IEnumerable {
8170
8171                 public MyEnumerator GetEnumerator () {
8172                         return new MyEnumerator(this);
8173                 }
8174
8175                 IEnumerator IEnumerable.GetEnumerator () {
8176                         ...
8177                 }
8178                 
8179                 public struct MyEnumerator : IEnumerator {
8180                         ...
8181                 }
8182         }
8183
8184         Before, there were a few things we did wrong:
8185         1) we would emit callvirt on a struct, which is illegal
8186         2) we emited ldarg when we needed to emit ldarga
8187         3) we would mistakenly call the interface methods on an enumerator
8188         type that derived from IEnumerator and was in another assembly. For example:
8189
8190         public class MyEnumerator : IEnumerator
8191
8192         Would have the interface methods called, even if there were public impls of the
8193         method. In a struct, this lead to invalid IL code.
8194
8195 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8196
8197         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8198           renamed to Emit.
8199
8200         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8201
8202 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8203
8204         * cs-parser.jay: Fix small regression: we were not testing V2
8205         compiler features correctly.
8206
8207         * interface.cs: If the emit context is null, then create one
8208
8209 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8210
8211         * decl.cs (GetSignatureForError): New virtual method to get full name
8212           for error messages.
8213
8214         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8215           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8216
8217         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8218           Duplicated members and code in these classes has been removed.
8219           Better encapsulation in these classes.
8220
8221 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8222
8223         * assign.cs (Assign.DoResolve): When dealing with compound
8224         assignments, there is a new rule in ECMA C# 2.4 (might have been
8225         there before, but it is documented here) that states that in:
8226
8227         a op= b;
8228
8229         If b is of type int, and the `op' is a shift-operator, then the
8230         above is evaluated as:
8231
8232         a = (int) a op b 
8233
8234         * expression.cs (Binary.ResolveOperator): Instead of testing for
8235         int/uint/long/ulong, try to implicitly convert to any of those
8236         types and use that in pointer arithmetic.
8237
8238         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8239         method to print information for from the type, not from the
8240         null-method we were given.
8241
8242 2004-02-01  Duncan Mak  <duncan@ximian.com>
8243
8244         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8245         parsing for cmd, fixes bug #53694.
8246
8247 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8248
8249         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8250         in the member name duplication tests. Property and operator name duplication
8251         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8252
8253 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8254
8255         * interface.cs (PopulateMethod): Fixed crash when interface method
8256         returns not existing type (error test cs0246-3.cs).
8257
8258 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8259
8260         * cs-parser.jay (interface_accessors): Re-write actions to also
8261         store attributes attached to get and set methods. Fix spelling
8262         while at it.
8263
8264         (inteface_property_declaration): Modify accordingly.
8265
8266         (InterfaceAccessorInfo): New helper class to store information to pass
8267         around between rules that use interface_accessors.
8268
8269         * interface.cs (Emit): Apply attributes on the get and set
8270         accessors of properties and indexers too.
8271
8272         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8273         right MethodBuilder when applying attributes to the get and set accessors.
8274
8275 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8276
8277         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8278
8279 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8280
8281         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8282
8283 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8284
8285         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8286         changes that treat `yield' specially when present before `break'
8287         or `return' tokens.
8288
8289         * cs-tokenizer.cs: yield is no longer a keyword.
8290
8291 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8292
8293         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8294         setting for default constructors.
8295         For default constructors are almost every time set wrong Modifier. The
8296         generated IL code has been alright. But inside mcs this values was
8297         wrong and this was reason why several of my CLS Compliance tests
8298         failed.
8299
8300 2004-01-22  Martin Baulig  <martin@ximian.com>
8301
8302         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8303         not a QualifiedIdentifier.  This is what `type_name_expression'
8304         was previously doing.
8305         (type_name_expression): Removed; the code is now in
8306         `namespace_or_type_name'.
8307         (qualified_identifier): Removed, use `namespace_or_type_name'
8308         instead.
8309         (QualifiedIdentifier): Removed this class.      
8310
8311 2004-01-22  Martin Baulig  <martin@ximian.com>
8312
8313         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8314         not a string as alias name.
8315
8316 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8317
8318         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8319         #52730 bug, and instead compute correctly the need to use a
8320         temporary variable when requesting an address based on the
8321         static/instace modified of the field and the constructor.
8322  
8323 2004-01-21  Martin Baulig  <martin@ximian.com>
8324
8325         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8326         class and namespace before looking up aliases.  Fixes #52517.
8327
8328 2004-01-21  Martin Baulig  <martin@ximian.com>
8329
8330         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8331         assinged in a 'try'; fixes exception4.cs.
8332
8333 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8334         * class.cs : Implemented parameter-less constructor for TypeContainer
8335
8336         * decl.cs: Attributes are now stored here. New property OptAttributes
8337
8338         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8339
8340         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8341
8342 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8343
8344         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8345           (CSharpSignature): New method for indexer and property signature.
8346
8347 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8348
8349         * pending.cs (IsVirtualFilter): Faster implementation.
8350
8351 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8352
8353         * typemanager.cs: Avoid inclusion of same assembly more than once.
8354
8355 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8356
8357         * cs-parser.jay: Fixed problem where the last assembly attribute
8358           has been applied also to following declaration (class, struct, etc.)
8359           
8360 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8361
8362         * class.cs: Added error CS0538, CS0539 reporting.
8363         Fixed crash on Microsoft runtime when field type is void.
8364
8365         * cs-parser.jay: Added error CS0537 reporting.
8366
8367         * pending.cs: Added error CS0535 reporting.
8368         Improved error report for errors CS0536, CS0534.
8369
8370 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8371
8372         Merge a few bits from the Anonymous Method MCS tree.
8373
8374         * statement.cs (ToplevelBlock): New class for toplevel methods,
8375         will hold anonymous methods, lifted variables.
8376
8377         * cs-parser.jay: Create toplevel blocks for delegates and for
8378         regular blocks of code. 
8379
8380 2004-01-20  Martin Baulig  <martin@ximian.com>
8381
8382         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8383         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8384         and `NeedExplicitReturn'; added `IsLastStatement'.
8385         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8386         have a `ReturnLabel' or we're not unreachable.
8387
8388         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8389         child's reachability; don't just override ours with it.  Fixes
8390         #58058 (lluis's example).
8391         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8392         InFinally(), InLoop(), InSwitch() and
8393         BreakCrossesTryCatchBoundary() methods.
8394
8395         * statement.cs (Return): Do all error checking in Resolve().
8396         Unless we are the last statement in a top-level block, always
8397         create a return label and jump to it.
8398         (Break, Continue): Do all error checking in Resolve(); also make
8399         sure we aren't leaving a `finally'.
8400         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8401         statement in a top-level block.
8402         (Block.Flags): Added `IsDestructor'.
8403         (Block.IsDestructor): New public property.
8404
8405 2004-01-20  Martin Baulig  <martin@ximian.com>
8406
8407         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8408
8409 2004-01-20  Martin Baulig  <martin@ximian.com>
8410
8411         * statement.cs (Statement.ResolveUnreachable): New public method.
8412         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8413         (Block.Resolve): Resolve unreachable statements.
8414
8415 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8416
8417         * expression.cs: We need to fix the case where we do
8418         not have a temp variable here.
8419
8420         * assign.cs: Only expression compound assignments need
8421         temporary variables.
8422
8423 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8424
8425         * flowanalysis.cs: Reduce memory allocation in a few ways:
8426           - A block with no variables should not allocate a bit
8427             vector for itself.
8428           - A method with no out parameters does not need any tracking
8429             for assignment of the parameters, so we need not allocate
8430             any data for it.
8431           - The arrays:
8432                 public readonly Type[] VariableTypes;
8433                 public readonly string[] VariableNames;
8434             Are redundant. The data is already stored in the variable
8435             map, so we need not allocate another array for it.
8436           - We need to add alot of checks for if (params | locals) == null
8437             due to the first two changes.
8438
8439 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8440
8441         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8442         implement IMemoryLocation, we store a copy on a local variable and
8443         take the address of it.  Patch from Benjamin Jemlich
8444
8445         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8446         to use a special "type_name_expression" rule which reduces the
8447         number of "QualifiedIdentifier" classes created, and instead
8448         directly creates MemberAccess expressions.
8449
8450 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8451
8452         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8453         that fixes #52853.  Null literal assignment to ValueType
8454
8455         * class.cs (MethodData.Emit): Instead of checking the name of the
8456         method to determine if its a destructor, create a new derived
8457         class from Method called Destructor, and test for that.  
8458
8459         * cs-parser.jay: Create a Destructor object instead of a Method.  
8460
8461         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8462
8463         Fixes: 52933
8464
8465 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8466
8467         * expression.cs (Binary.ResolveOperator): Perform an implicit
8468         conversion from MethodGroups to their delegate types on the
8469         Addition operation.
8470
8471         * delegate.cs: Introduce a new class DelegateCreation that is the
8472         base class for `NewDelegate' and `ImplicitDelegateCreation',
8473         factor some code in here.
8474
8475         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8476         conversion from MethodGroups to compatible delegate types. 
8477
8478         * ecore.cs (Expression.Resolve): Do not flag error 654
8479         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8480         we allow conversions from MethodGroups to delegate types now.
8481
8482         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8483         assignments in v2 either.
8484
8485 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8486
8487         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8488         static read-only fields in ctors.
8489
8490         Applied patch from Benjamin Jemlich 
8491
8492         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8493
8494 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8495
8496         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8497         here to return true, as they can be used like this:
8498
8499                 (XXX) int.MEMBER ()
8500
8501         Fixed 49836 and all the other dups
8502
8503 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8504
8505         * driver.cs: Implement /win32res and /win32icon.
8506
8507 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8508
8509         * cs-parser.jay: Add a rule to improve error handling for the
8510         common mistake of placing modifiers after the type.
8511
8512 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8513
8514         * cs-parser.jay (interface_event_declaration): Catch
8515         initialization of events on interfaces, and report cs0068
8516
8517         * cs-parser.jay (interface_event_declaration): Catch
8518         initialization of events. 
8519
8520         * ecore.cs: Better report missing constructors.
8521
8522         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8523         the error reporting done in the wrong place.  Fix.
8524
8525         * expression.cs (Binary.ResolveOperator): Catch the 
8526         operator + (E x, E y) error earlier, and later allow for implicit
8527         conversions in operator +/- (E e, U x) from U to the underlying
8528         type of E.
8529
8530         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8531         52596, if the container class is abstract, the default constructor
8532         is protected otherwise its public (before, we were always public).
8533
8534         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8535         fixed statement.
8536
8537         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8538         Jemlich that fixes bug #52597, MCS was generating invalid code for
8539         idisposable structs.   Thanks to Ben for following up with this
8540         bug as well.
8541
8542 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8543
8544         * driver.cs: Allow assemblies without code to be generated, fixes
8545         52230.
8546
8547 2004-01-07  Nick Drochak <ndrochak@gol.com>
8548
8549         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8550
8551 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8552
8553         * cs-parser.jay: Add rules to improve error reporting if fields or
8554         methods are declared at the namespace level (error 116)
8555
8556         * Add rules to catch event add/remove
8557
8558 2004-01-04  David Sheldon <dave-mono@earth.li>
8559
8560   * expression.cs: Added matching ")" to error message for 
8561   CS0077
8562
8563 2004-01-03 Todd Berman <tberman@gentoo.org>
8564
8565         * ecore.cs, attribute.cs:
8566         Applying fix from #52429.
8567
8568 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8569
8570         * ecore.cs, expression.cs, statement.cs:
8571         Total rewrite of how we handle branching. We
8572         now handle complex boolean expressions with fewer
8573         jumps. As well if (x == 0) no longer emits a ceq.
8574
8575         if (x is Foo) is much faster now, because we generate
8576         better code.
8577
8578         Overall, we get a pretty big improvement on our benchmark
8579         tests. The code we generate is smaller and more readable.
8580
8581         I did a full two-stage bootstrap. The patch was reviewed
8582         by Martin and Miguel.
8583
8584 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8585
8586         * cs-parser.jay: Make primary_expression not take a QI.
8587         we dont need this because the member_access rule covers
8588         us here. So we replace the rule with just IDENTIFIER.
8589
8590         This has two good effects. First, we remove a s/r conflict.
8591         Second, we allocate many fewer QualifiedIdentifier objects.
8592
8593 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8594
8595         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8596         set the correct information via SRE. This prevents
8597         hanging on the MS runtime. Fixes #29374.
8598
8599 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8600
8601         * convert.cs: correctly handle conversions to value types
8602         from Enum and ValueType as unboxing conversions.
8603
8604         Fixes bug #52569. Patch by Benjamin Jemlich.
8605
8606 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8607
8608         * expression.cs (BetterConversion): Prefer int -> uint
8609         over int -> ulong (csc's behaviour). This fixed bug #52046.
8610
8611 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8612
8613         * decl.cs (MemberCache.FindMembers): now returns a
8614         MemberInfo [].
8615
8616         * typemanager.cs: In general, go with with ^^.
8617         (CopyNewMethods): take an IList.
8618         (RealMemberLookup): Only allocate an arraylist
8619         if we copy from two sets of methods.
8620
8621         This change basically does two things:
8622         1) Fewer array lists allocated due to CopyNewMethods.
8623         2) the explicit cast in MemberList costed ALOT.
8624
8625 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8626
8627         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8628         a hashtable to avoid needless string allocations when an identifier is
8629         used more than once (the common case).
8630
8631 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8632
8633         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8634         is broken, it will not return anything. So, we
8635         have to use the information we have in mcs to
8636         do the task.
8637
8638         * typemanager.cs: Add a cache for GetInterfaces,
8639         since this will now be used more often (due to ^^)
8640
8641         (GetExplicitInterfaces) New method that gets the
8642         declared, not effective, interfaces on a type
8643         builder (eg, if you have interface IFoo, interface
8644         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8645         { IBar }.
8646
8647         This patch makes MCS able to bootstrap itself on
8648         Windows again.
8649
8650 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8651
8652         * expression.cs: Remove the Nop's that Miguel put
8653         in by mistake.
8654
8655 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8656
8657         * report.cs, codegen.cs: Give the real stack trace to
8658         the error when an exception is thrown.
8659
8660 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8661
8662         * decl.cs: only allocate hashtables for ifaces if 
8663         it is an iface!
8664
8665 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8666
8667         * expression.cs: fix the error from cs0121-2.cs
8668         (a parent interface has two child interfaces that
8669         have a function with the same name and 0 params
8670         and the function is called through the parent).
8671
8672 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8673
8674         * class.cs, rootcontext.cs, typmanager.cs: do not
8675         leak pointers.
8676
8677 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8678
8679         * codegen.cs: remove stack for the ec flow branching.
8680         It is already a linked list, so no need.
8681
8682 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8683
8684         * Makefile: Allow custom profiler here.
8685
8686 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8687
8688         * typemanager.cs (LookupType):
8689           - Use a static char [], because split takes
8690             a param array for args, so it was allocating
8691             every time.
8692           - Do not store true in a hashtable, it boxes.
8693
8694 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8695
8696         * flowanalysis.cs: bytify common enums.
8697
8698 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8699
8700         * modifiers.cs: Add a new set of flags for the
8701         flags allowed on explicit interface impls.
8702         * cs-parser.jay: catch the use of modifiers in
8703         interfaces correctly.
8704         * class.cs: catch private void IFoo.Blah ().
8705
8706         All related to bug #50572.
8707
8708 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8709
8710         * decl.cs: Rewrite the consistant accessability checking.
8711         Accessability is not linear, it must be implemented in
8712         a tableish way. Fixes #49704.
8713
8714 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8715
8716         * expression.cs: Handle negation in a checked context.
8717         We must use subtraction from zero. Fixes #38674.
8718
8719 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8720
8721         * class.cs: Ignore static void main in DLLs.
8722         * rootcontext.cs: Handle the target type here,
8723         since we are have to access it from class.cs
8724         * driver.cs: account for the above.
8725
8726 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8727
8728         * report.cs: Give line numbers and files if available.
8729
8730 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8731
8732         * driver.cs: Implement /addmodule.
8733
8734         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8735         ModuleBuilders.
8736
8737 2003-12-20  Martin Baulig  <martin@ximian.com>
8738
8739         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8740         (FieldBase.IsAssigned): Removed this field.
8741         (FieldBase.SetAssigned): New public method.
8742         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8743
8744 2003-12-20  Martin Baulig  <martin@ximian.com>
8745
8746         * expression.cs (LocalVariableReference.DoResolve): Don't set
8747         `vi.Used' if we're called from DoResolveLValue().
8748
8749         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8750         returns the usage vector it just merged into the current one -
8751         pass this one to UsageWarning().
8752         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8753         of the `EmitContext', don't call this recursively on our children.
8754
8755 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8756
8757         * driver.cs: Implement /target:module.
8758
8759 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8760
8761         * support.cs (CharArrayHashtable): New helper class.
8762
8763         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8764         char arrays, not strings, so we can avoid creating a string in
8765         consume_identifier if the identifier is a keyword.
8766
8767 2003-12-16  Martin Baulig  <martin@ximian.com>
8768
8769         * statement.cs (LocalInfo.Assigned): Removed this property.
8770         (LocalInfo.Flags): Removed `Assigned'.
8771         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8772         and uses flow analysis.
8773         (Block.UsageWarning): Made this method private.
8774         (Block.Resolve): Call UsageWarning() if appropriate.
8775
8776         * expression.cs (LocalVariableReference.DoResolve): Always set
8777         LocalInfo.Used here.
8778
8779 2003-12-13  Martin Baulig  <martin@ximian.com>
8780
8781         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8782         any value here; we're now using flow analysis to figure out
8783         whether a statement/block returns a value.
8784
8785 2003-12-13  Martin Baulig  <martin@ximian.com>
8786
8787         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8788         working again.
8789         (FlowBranching.MergeFinally): Don't call
8790         `branching.CheckOutParameters()' here, this is called in
8791         MergeTopBlock().
8792         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8793         when adding the `finally' vector.       
8794
8795 2003-12-13  Martin Baulig  <martin@ximian.com>
8796
8797         * flowanalysis.cs
8798         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8799         actually work and also fix #48962.
8800
8801 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8802
8803         * decl.cs: Do not check System.Object for nested types,
8804         since we know it does not have any. Big bang for buck:
8805
8806         BEFORE:
8807            Run 1:   8.35 seconds
8808            Run 2:   8.32 seconds
8809            corlib:  17.99 seconds
8810         AFTER:
8811            Run 1:   8.17 seconds
8812            Run 2:   8.17 seconds
8813            corlib:  17.39 seconds
8814
8815 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8816
8817         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8818         time we are returning 0 members, so we save alot here.
8819
8820 2003-12-11  Martin Baulig  <martin@ximian.com>
8821
8822         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8823         `MergeChild()', also just take the `FlowBranching' as argument;
8824         call Merge() on it and return the result.
8825         (FlowBranching.Merge): We don't need to do anything if we just
8826         have one sibling.
8827
8828 2003-12-11  Martin Baulig  <martin@ximian.com>
8829
8830         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8831         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8832         Maurer for this idea.
8833
8834 2003-12-11  Martin Baulig  <martin@ximian.com>
8835
8836         * flowanalysis.cs (MergeResult): This class is now gone; we now
8837         use the `UsageVector' for this.  The reason for this is that if a
8838         branching just has one sibling, we don't need to "merge" them at
8839         all - that's the next step to do.
8840         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8841         `MergeResult'.
8842
8843 2003-12-11  Martin Baulig  <martin@ximian.com>
8844
8845         Reworked flow analyis and made it more precise and bug-free.  The
8846         most important change is that we're now using a special `Reachability'
8847         class instead of having "magic" meanings of `FlowReturns'.  I'll
8848         do some more cleanups and optimizations and also add some more
8849         documentation this week.
8850
8851         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8852         largely reworked this class.
8853         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8854         the new `Reachability' class instead of having "magic" values here.
8855         (FlowBranching): We're now using an instance of `Reachability'
8856         instead of having separate `Returns', `Breaks' etc. fields.
8857
8858         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8859         based on flow analysis; ignore the return value of block.Emit ().
8860
8861 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8862
8863         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8864         if they are private.
8865
8866 2003-12-09  Martin Baulig  <martin@ximian.com>
8867
8868         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8869         call them directly on the UsageVector.
8870
8871 2003-12-09  Martin Baulig  <martin@ximian.com>
8872
8873         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8874         Changed return type from `FlowReturns' to `Reachability'.
8875
8876 2003-12-09  Martin Baulig  <martin@ximian.com>
8877
8878         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8879         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8880         `Reachable' fields with a single `Reachability' one.
8881
8882 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8883
8884         * class.cs (FindMembers): Remove foreach's.
8885
8886         Bootstrap times:
8887
8888         BEFORE
8889                 Run 1:   8.74 seconds
8890                 Run 2:   8.71 seconds
8891
8892         AFTER
8893                 Run 1:   8.64 seconds
8894                 Run 2:   8.58 seconds
8895
8896
8897 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8898
8899         * cs-parser.jay:
8900         * gen-treedump.cs:
8901         * statement.cs:
8902         This patch does a few things:
8903                 1. EmptyStatement is now a singleton, so it is never reallocated.
8904                 2. All blah is EmptyStatement constructs have been changed to
8905                    blah == EmptyStatement.Value, which is much faster and valid
8906                    now that EmptyStatement is a singleton.
8907                 3. When resolving a block, rather than allocating a new array for
8908                    the non-empty statements, empty statements are replaced with
8909                    EmptyStatement.Value
8910                 4. Some recursive functions have been made non-recursive.
8911         Mainly the performance impact is from (3), however (1) and (2) are needed for
8912         this to work. (4) does not make a big difference in normal situations, however
8913         it makes the profile look saner.
8914
8915         Bootstrap times:
8916
8917         BEFORE
8918         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8919         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8920         Total memory allocated: 56397 KB
8921
8922         AFTER
8923         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8924         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8925         Total memory allocated: 55666 KB
8926
8927 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8928
8929         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8930         than the hashtable in a hashtable version
8931
8932         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8933         we always end up concating a string. This results in a huge perf
8934         loss, because many strings have to be tracked by the GC. In this
8935         patch, we first use a hashtable that works with two keys, so that
8936         the strings do not need to be concat'ed.
8937
8938         Bootstrap times:
8939         BEFORE
8940                 Run 1:   8.74 seconds
8941                 Run 2:   8.71 seconds
8942
8943         AFTER
8944                 Run 1:   8.65 seconds
8945                 Run 2:   8.56 seconds
8946
8947 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8948
8949         * Makefile: Add a new target `do-time' that does a quick and simple
8950         profile, leaving easy to parse output.
8951
8952 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8953
8954         * codegen.cs (Init): Create the dynamic assembly with 
8955         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8956
8957 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8958
8959         * support.cs: Make the PtrHashtable use only one
8960         instance of its comparer.
8961
8962 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8963
8964         * typemanager.cs: Fix lookup of GetNamespaces.
8965
8966 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8967
8968         * expression.cs: Removed redundant line.
8969
8970         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8971         ArrayLists, use for loops with bounds.  
8972
8973         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8974         arraylist.
8975
8976         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8977         arraylists, use for loop with bounds.
8978
8979         The above three changes give us a 0.071 second performance
8980         improvement out of 3.294 seconds down to 3.223.  On my machine
8981         the above changes reduced the memory usage by 1,387 KB during
8982         compiler bootstrap.
8983
8984         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8985         QualifiedIdentifiers.  Before we created a new string through
8986         concatenation, and mostly later on, the result would be
8987         manipulated by DecomposeQI through string manipulation.
8988
8989         This reduced the compiler memory usage for bootstrapping from
8990         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8991         compile times in 0.05 seconds.
8992
8993 2003-11-28  Dick Porter  <dick@ximian.com>
8994
8995         * support.cs: Do string compares with the Invariant culture.
8996
8997         * rootcontext.cs: 
8998         * gen-treedump.cs: 
8999         * expression.cs: 
9000         * driver.cs: 
9001         * decl.cs: 
9002         * codegen.cs: 
9003         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9004         the comparison is done with the Invariant culture.
9005
9006 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9007
9008         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9009         GetEnumerator method.
9010
9011         (ProbeCollectionType): Iterate starting at the most specific type
9012         upwards looking for a GetEnumerator
9013
9014         * expression.cs: Shift count can be up to 31 for int/uint and 63
9015         for long/ulong.
9016
9017 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9018
9019         * statement.cs (Block.LookupLabel): Also look for the label on the
9020         children blocks.  Use a hash table to keep track of visited
9021         nodes. 
9022
9023         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9024         we actually did transform the other operand, otherwise fall back
9025         to the common codepath that casts to long.
9026
9027         * cs-tokenizer.cs: Use the same code pattern as the int case.
9028         Maybe I should do the parsing myself, and avoid depending on the
9029         Parse routines to get this done.
9030
9031 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9032
9033         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9034         which fixes bug 51347.  This time test it.
9035
9036         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9037         attributes for example can not tell the difference between these.
9038         The difference was only a syntax feature of the language. 
9039
9040         * attribute.cs: Apply attributes to delegates.
9041
9042         * delegate.cs: Call the apply attributes method.
9043
9044 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9045
9046         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9047         comparing 0 vs Byte.MinValue, not the value
9048
9049         (ImplicitConversionRequired): When reporting a conversion error,
9050         use error 31 to print out the constant error instead of the
9051         simpler 29.
9052
9053         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9054         which fixes bug 51347.
9055
9056 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9057
9058         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9059         which fixes the -warnaserror command line option.
9060
9061 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9062
9063         * cfold.cs (DoNumericPromotions): During constant folding of
9064         additions on UIntConstant, special case intconstants with
9065         IntConstants like we do on the expression binary operator. 
9066
9067 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9068
9069         * convert.cs (ImplicitReferenceConversion): We were missing a case
9070         (System.Enum are not value types or class types, so we need to
9071         classify them separatedly).
9072
9073         * driver.cs: We do not support error 2007.
9074
9075 2003-11-12 Jackson Harper <jackson@ximian.com>
9076
9077         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9078         system directory. Also use the full file name so users can
9079         libraries names mscorlib-o-tron.dll in a non system dir.
9080
9081 2003-11-10  Martin Baulig  <martin@ximian.com>
9082
9083         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9084         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9085         calling `ResolveType()' on them, directly assign their `Type'.
9086
9087 2003-11-08  Martin Baulig  <martin@ximian.com>
9088
9089         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9090         return value and the `out parent' parameter.
9091         (TypeContainer.DefineType): Moved the CS0644 check into
9092         GetClassBases().  Don't pass the interface types to the
9093         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9094         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9095
9096         * ecore.cs (TypeExpr.IsAttribute): New property.
9097         (TypeExpr.GetInterfaces): New method.
9098
9099         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9100         TypeExpr instead of a Type.
9101         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9102         (Interface.DefineType): Don't pass the interface types to the
9103         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9104         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9105
9106         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9107         instead of a `Type[]'.
9108         (TypeManager.RegisterBuilder): Likewise.
9109         (TypeManager.AddUserInterface): Likewise.
9110         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9111         `Type[]' and also return a `TypeExpr[]'.
9112         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9113
9114 2003-11-08  Martin Baulig  <martin@ximian.com>
9115
9116         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9117         Expression.     
9118
9119 2003-11-08  Martin Baulig  <martin@ximian.com>
9120
9121         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9122         TypeManager.ResolveExpressionTypes().
9123
9124         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9125         instead of an Expression.
9126         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9127         (TypeExpression): New public class; formerly known as `TypeExpr'.
9128
9129         * expression.cs (ComposedCast): Derive from TypeExpr.
9130
9131         * typemanager.cs (TypeManager.system_*_expr): These are now
9132         TypExpr's instead of Expression's.
9133         (TypeManager.ResolveExpressionTypes): New public static function;
9134         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9135         of them.        
9136
9137 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9138
9139         * expression.cs (New.DoResolve): Do not dereference value that
9140         might be a null return.
9141
9142         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9143         sure that the constant value has the right type.  Fixes an
9144         unreported bug, similar to 50425.
9145
9146         * const.cs (Const.LookupConstantValue): Call
9147         ImplicitStandardConversionExists before doing a conversion to
9148         avoid havng the TypeManager.ChangeType do conversions.
9149
9150         Reduced the number of casts used
9151
9152         (Const.ChangeType): New routine to enable reuse of the constant
9153         type changing code from statement.
9154
9155         * typemanager.cs (ChangeType): Move common initialization to
9156         static global variables.
9157
9158         Fixes #50425.
9159
9160         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9161         every value type to go through, even if it was void.  Fix that. 
9162
9163         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9164         character of the define, and the is_identifier_part_character for
9165         the rest of the string.
9166
9167 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9168
9169         * expression.cs (UnaryMutator.EmitCode): When I updated
9170         LocalVariableReference.DoResolve, I overdid it, and dropped an
9171         optimization done on local variable references.
9172
9173 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9174
9175         * ecore.cs: Convert the return from Ldlen into an int.
9176
9177 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9178
9179         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9180         the accessibility, this is a special case for toplevel non-public
9181         classes (internal for instance).
9182
9183 2003-10-20  Nick Drochak <ndrochak@gol.com>
9184
9185         * ecore.cs: Fix typo and build.  Needed another right paren.
9186
9187 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9188
9189         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9190         `internal' case regular and protected, but not allowing protected
9191         to be evaluated later.  Bug 49840
9192
9193 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9194
9195         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9196         to kb.Nlast, and not the kb.nFirst to isolate the switch
9197         statement.
9198
9199         Extract the underlying type, so enumerations of long/ulong are
9200         treated like long/ulong.
9201
9202 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9203
9204         * expression.cs (New): Overload the meaning of RequestedType to
9205         track the possible creation of the NewDelegate type, since
9206         DoResolve is invoked more than once for new constructors on field
9207         initialization.
9208
9209         See bugs: #48800 and #37014
9210
9211         * cs-parser.jay (declare_local_constants): Take an arraylist
9212         instead of a single constant.
9213
9214         (local_constant_declaration): It should take a
9215         constant_declarators, not a constant_declarator.  Fixes 49487
9216
9217         * convert.cs: Fix error report.
9218
9219 2003-10-13 Jackson Harper <jackson@ximian.com>
9220
9221         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9222         bug #49611
9223
9224 2003-10-09  Martin Baulig  <martin@ximian.com>
9225
9226         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9227         to the .ctor.
9228         (MethodCore.DoDefineParameters): Removed the TypeContainer
9229         argument; use the DeclSpace which was passed to the .ctor instead.
9230         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9231         TypeContainer; we only need a DeclSpace here.
9232
9233 2003-10-09  Martin Baulig  <martin@ximian.com>
9234
9235         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9236         to the .ctor.
9237         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9238         EmitContext's .ctor.    
9239
9240 2003-10-09  Martin Baulig  <martin@ximian.com>
9241
9242         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9243         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9244         AsAccessible(), moved them as well.
9245
9246         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9247
9248 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9249
9250         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9251
9252 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9253
9254         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9255         generation for >=, as spotted by Paolo, bug 48679.  
9256         Patch from David Waite.
9257
9258         * cs-tokenizer.cs: Add handling for #pragma.
9259
9260         * cs-parser.jay: Allow for both yield and yield return in the
9261         syntax.  The anti-cobolization of C# fight will go on!
9262
9263         * class.cs (TypeBuilder.DefineType): Catch error condition here
9264         (Parent.DefineType erroring out and returning null).
9265
9266         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9267         coping with enumerations variables, we were mistakenly processing
9268         them as a regular value type instead of built-in types.  Fixes the
9269         bug #48063
9270
9271         * typemanager.cs (IsBuiltinOrEnum): New method.
9272
9273 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9274
9275         * cs-parser.jay: Upgrade: yield now needs the return clause.
9276
9277 2003-09-19  Martin Baulig  <martin@ximian.com>
9278
9279         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9280         `MemberCache parent' argument.  Normally, an interface doesn't
9281         have a parent type except System.Object, but we use this in gmcs
9282         for generic type parameters.
9283
9284 2003-09-18  Martin Baulig  <martin@ximian.com>
9285
9286         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9287         on `type.IsInterface'; don't check whether the type has a parent
9288         to determine whether it's an interface.
9289
9290 2003-09-15  Martin Baulig  <martin@ximian.com>
9291
9292         * class.cs (TypeContainer.DefineType): Added an error flag to
9293         avoid reporting duplicate CS0146's ("class definition is
9294         circular.").
9295
9296         * driver.cs (Driver.MainDriver): Abort if
9297         RootContext.ResolveTree() reported any errors.
9298
9299 2003-09-07  Martin Baulig  <martin@ximian.com>
9300
9301         * report.cs (Error, Warning): Added overloaded versions which take
9302         a `params object[] args' and call String.Format().
9303
9304 2003-09-07  Martin Baulig  <martin@ximian.com>
9305
9306         * decl.cs (DeclSpace..ctor): Don't call
9307         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9308         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9309         (DeclSpace.RecordDecl): New method.
9310
9311         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9312
9313 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9314
9315         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9316         value attributes to be applied to ParameterBuilders.
9317
9318         * class.cs (MethodCore.LabelParameters): Make static and more
9319         generic so that it can be used from other places - like interface
9320         methods, for instance.
9321
9322         * interface.cs (Interface.Emit): Call LabelParameters before
9323         emitting attributes on the InterfaceMethod.
9324
9325 2003-08-26  Martin Baulig  <martin@ximian.com>
9326
9327         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9328         resolving aliases; fixes #47927.
9329
9330 2003-08-26  Martin Baulig  <martin@ximian.com>
9331
9332         * statement.cs (Using.DoResolve): This is internally emitting a
9333         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9334         do not always return.  Fixes #47681.
9335
9336 2003-08-26  Martin Baulig  <martin@ximian.com>
9337
9338         * decl.cs (MemberCore): Moved WarningNotHiding(),
9339         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9340         into MemberBase.
9341         (AdditionResult): Make this nested in DeclSpace.
9342         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9343         argument; call NamespaceEntry.Define() unless we're nested in a
9344         class or struct.
9345
9346         * namespace.cs (Namespace.DefineName): New public function.  This
9347         is called from DeclSpace's .ctor to add 
9348         (Namespace.Lookup): Include DeclSpaces in the lookup.
9349
9350         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9351
9352         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9353
9354 2003-08-25  Martin Baulig  <martin@ximian.com>
9355
9356         * convert.cs (Convert.ExplicitReferenceConversion): When
9357         converting from an interface type to a class, unbox if the target
9358         type is a struct type.  Fixes #47822.
9359
9360 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9361
9362         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9363         #47854.
9364
9365 2003-08-22  Martin Baulig  <martin@ximian.com>
9366
9367         * class.cs (TypeManager.DefineType): When defining a nested type,
9368         call DefineType() on our parent; fixes #47801.
9369
9370 2003-08-22  Martin Baulig  <martin@ximian.com>
9371
9372         * class.cs (MethodData.Define): While checking if a method is an
9373         interface implementation, improve the test a bit more to fix #47654.
9374
9375 2003-08-22  Martin Baulig  <martin@ximian.com>
9376
9377         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9378         correctly; fixes #47722.
9379
9380 2003-08-22  Martin Baulig  <martin@ximian.com>
9381
9382         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9383         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9384
9385         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9386
9387 2003-08-22  Martin Baulig  <martin@ximian.com>
9388
9389         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9390         can only be assigned in static constructors.  Fixes #47161.
9391
9392 2003-08-22  Martin Baulig  <martin@ximian.com>
9393
9394         Rewrote and improved the flow analysis code.
9395
9396         * flowbranching.cs (FlowBranching): Make this class abstract.
9397         (FlowBranching.CreateBranching): New static function to create a
9398         new flow branching.
9399         (FlowBranchingBlock, FlowBranchingException): New classes.
9400         (FlowBranching.UsageVector.Type): New public readonly field.
9401         (FlowBranching.UsageVector.Breaks): Removed the setter.
9402         (FlowBranching.UsageVector.Returns): Removed the setter.
9403         (FlowBranching.UsageVector): Added Break(), Return(),
9404         NeverReachable() and Throw() methods to modify the reachability.
9405         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9406         done by FlowBranching.Merge().
9407         (FlowBranching.UsageVector.MergeChild): New method; merges the
9408         merge result into the current vector.
9409         (FlowBranching.Merge): New abstract method to merge a branching.
9410
9411 2003-08-12  Martin Baulig  <martin@ximian.com>
9412
9413         * expression.cs (Indirection.CacheTemporaries): Create the
9414         LocalTemporary with the pointer type, not its element type.
9415
9416 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9417
9418         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9419         token was a keyword or not.
9420
9421         Add `error' options where an IDENTIFIER was expected;  Provide
9422         CheckToken and CheckIdentifierToken convenience error reporting
9423         functions. 
9424
9425         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9426
9427         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9428         NameSpaceEntry NameSpaceEntry.
9429
9430         (LookupInterfaceOrClass): Avoid creating a full qualified name
9431         from namespace and name: avoid doing lookups when we know the
9432         namespace is non-existant.   Use new Tree.LookupByNamespace which
9433         looks up DeclSpaces based on their namespace, name pair.
9434
9435         * driver.cs: Provide a new `parser verbose' to display the
9436         exception thrown during parsing.  This is turned off by default
9437         now, so the output of a failure from mcs is more graceful.
9438
9439         * namespace.cs: Track all the namespaces defined in a hashtable
9440         for quick lookup.
9441
9442         (IsNamespace): New method
9443
9444 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9445
9446         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9447         we know that we need to concatenate (full typename can never be
9448         null). 
9449
9450         * class.cs: ditto.
9451
9452         * statement.cs: Use a bitfield;  Do not initialize to null things
9453         which are done by the constructor by default.
9454
9455         * cs-parser.jay: bug fix, parameter was 4, not 3.
9456
9457         * expression.cs: Just use the property;
9458
9459         * statement.cs: No need for GetVariableInfo method.
9460
9461 2003-08-08  Martin Baulig  <martin@ximian.com>
9462
9463         * flowanalysis.cs (FlowReturns): This is now nested in the
9464         `FlowBranching' class.
9465         (MyBitVector): Moved this here from statement.cs.
9466         (FlowBranching.SiblingType): New enum type.
9467         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9468
9469 2003-08-07  Martin Baulig  <martin@ximian.com>
9470
9471         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9472         `FlowBranching' class and called `BranchingType'.
9473
9474 2003-08-07  Martin Baulig  <martin@ximian.com>
9475
9476         * flowanalysis.cs: Moved all the control flow analysis code into
9477         its own file.
9478
9479 2003-08-07  Martin Baulig  <martin@ximian.com>
9480
9481         * assign.cs (Assign.DoResolve): `target' must either be an
9482         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9483         #37319.
9484
9485 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9486
9487         * expression.cs (BinaryMethod): This kind of expression is created by the
9488         Binary class if it determines that the operator has to be handled
9489         by a method.
9490
9491         (BinaryDelegate): This kind of expression is created if we are
9492         dealing with a + or - operator on delegates.
9493
9494         (Binary): remove method, argumetns, and DelegateOperator: when
9495         dealing with methods, 
9496
9497         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9498
9499         * statement.cs (Block): use bitfields for the three extra booleans
9500         we had in use.   Remove unused topblock parameter.
9501
9502         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9503
9504         * assign.cs: Drop extra unneeded tests.
9505
9506 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9507
9508         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9509
9510         * statement.cs (Foreach): Use VariableStorage instead of
9511         LocalBuilders.   
9512
9513         * codegen.cs (VariableStorage): New class used by clients that
9514         require a variable stored: locals or fields for variables that
9515         need to live across yield.
9516
9517         Maybe provide a convenience api for EmitThis+EmitLoad?
9518
9519         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9520         these bad boys.
9521
9522 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9523
9524         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9525         RemapParameterLValue): New methods that are used to turn a
9526         precomputed FieldInfo into an expression like this:
9527
9528                 instance.FieldInfo
9529
9530         The idea is to use this instead of making LocalVariableReference
9531         have more than one meaning.
9532
9533         * cs-parser.jay: Add error production to BASE.
9534
9535         * ecore.cs: Deal with TypeManager.GetField returning null, which
9536         is now a valid return value.
9537
9538         (FieldExprNoAddress): New expression for Fields whose address can
9539         not be taken.
9540
9541         * expression.cs (LocalVariableReference): During the resolve
9542         phases, create new expressions if we are in a remapping context.
9543         Remove code that dealt with remapping here.
9544
9545         (ParameterReference): same.
9546
9547         (ProxyInstance): New expression, like the `This' expression, but
9548         it is born fully resolved.  We know what we are doing, so remove
9549         the errors that are targeted to user-provided uses of `this'.
9550
9551         * statement.cs (Foreach): our variable is now stored as an
9552         Expression;  During resolution, follow the protocol, dont just
9553         assume it will return this.
9554
9555 2003-08-06  Martin Baulig  <martin@ximian.com>
9556
9557         * support.cs (SeekableStreamReader.cs): New public class.
9558
9559         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9560         SeekableStreamReader instead of the normal StreamReader.
9561
9562 2003-08-04  Martin Baulig  <martin@ximian.com>
9563
9564         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9565         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9566         deambiguate casts and delegate invocations.
9567         (parenthesized_expression): Use the new tokens to ensure this is
9568         not a cast of method invocation.
9569
9570         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9571         when reading a `)' and Deambiguate_CloseParens () was previously
9572         called.
9573
9574         * expression.cs (ParenthesizedExpression): New class.  This is
9575         just used for the CS0075 test.
9576         (Binary.DoResolve): Check for CS0075.   
9577
9578 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9579
9580         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9581         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9582         reference comparison.
9583
9584         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9585         examine the ReturnType for equality - this is necessary in the
9586         cases of implicit and explicit operators whose signature also
9587         includes the return type.
9588
9589 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9590
9591         * namespace.cs: Cache the result of the namespace computation,
9592         instead of computing it every time.
9593
9594 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9595
9596         * decl.cs: Use a global arraylist that we reuse over invocations
9597         to avoid excesive memory consumption.  Reduces memory usage on an
9598         mcs compile by one meg (45 average).
9599
9600         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9601         private, work around that.
9602
9603 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9604
9605         * literal.cs (IntLiteral): Define Zero and One static literals. 
9606
9607         * cs-parser.jay (integer_literal): use static literals to reduce
9608         memory usage for the most used literals (0, 1 and -1).  211kb
9609         reduced in memory usage.
9610
9611         Replace all calls to `new ArrayList' with `new
9612         ArrayList(4)' which is a good average number for most allocations,
9613         and also requires only 16 bytes of memory for its buffer by
9614         default. 
9615
9616         This reduced MCS memory usage in seven megabytes for the RSS after
9617         bootstrapping.
9618
9619 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9620
9621         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9622         handle params methods the correct way by forming only one
9623         applicable set with params and normal methods in them. Earlier we
9624         were looking at params methods only if we found no normal methods
9625         which was not the correct thing to do.
9626
9627         (Invocation.BetterFunction): Take separate arguments indicating
9628         when candidate and the best method are params methods in their
9629         expanded form.
9630
9631         This fixes bugs #43367 and #46199.
9632
9633         * attribute.cs: Documentation updates.
9634
9635         (CheckAttribute): Rename to CheckAttributeTarget.
9636         (GetValidPlaces): Rename to GetValidTargets.
9637
9638         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9639         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9640
9641         Fixes bug #44468.
9642
9643 2003-07-28  Martin Baulig  <martin@ximian.com>
9644
9645         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9646         name when looking up the base class of a nested class.  Fixes #46977.
9647
9648 2003-07-26  Martin Baulig  <martin@ximian.com>
9649
9650         * expression.cs (Indexers.Indexer): New nested struct; contains
9651         getter, setter and the indexer's type.
9652         (Indexers.Properties): This is now an ArrayList of
9653         Indexers.Indexer's.
9654         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9655         indexer doesn't have any getters.
9656
9657         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9658         for embedded property and indexer assignments.
9659
9660 2003-07-26  Martin Baulig  <martin@ximian.com>
9661
9662         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9663         preprocessor directive is not the first non-whitespace character
9664         on a line.
9665
9666 2003-07-26  Martin Baulig  <martin@ximian.com>
9667
9668         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9669         namespace parsing, follow the spec more closely.
9670
9671         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9672         NamespaceEntry.Lookup().
9673
9674 2003-07-25  Martin Baulig  <martin@ximian.com>
9675
9676         * MethodCore.cs (OverridesSomething): New public field; it's set
9677         from TypeContainer.DefineMembers if this method overrides
9678         something (which doesn't need to be a method).  Fix #39462.
9679
9680 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9681
9682         * typemanager.cs (GetMembers): Ensure that the list of members is
9683         reversed. This keeps things in sync.
9684
9685         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9686         find an AttributeUsage attribute.
9687
9688         * expression.cs (Invocation.OverloadResolve): Perform the check
9689         which disallows Invoke to be directly called on a Delegate.
9690
9691         (Error_InvokeOnDelegate): Report error cs1533.
9692
9693 2003-07-25  Martin Baulig  <martin@ximian.com>
9694
9695         * expression.cs (Indexers.GetIndexersForType): Only look in the
9696         interface hierarchy if the requested type is already an
9697         interface.  Fixes #46788 while keeping #46502 fixed.
9698
9699 2003-07-25  Martin Baulig  <martin@ximian.com>
9700
9701         * class.cs (TypeContainer.DefineMembers): Check whether all
9702         readonly fields have been assigned and report warning CS0649 if
9703         not.
9704
9705         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9706         a valuetype.
9707
9708 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9709
9710         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9711         returned from GetMethods to make things consistent with the
9712         assumptions MCS makes about ordering of methods.
9713
9714         This should comprehensively fix bug #45127 and it does :-)
9715
9716         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9717         ordering is actually reverse.
9718
9719         * Clean up some debug messages I left lying around.
9720
9721         * interface.cs (Populate*): Get rid of code which emits attributes
9722         since the stage in which we emit attributes is the 'Emit' stage,
9723         not the define stage.
9724
9725         (Emit): Move attribute emission for interface members here.
9726
9727 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9728
9729         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9730         closely: we eliminate methods in base types when we have an
9731         applicable method in a top-level type.
9732
9733         Please see section 14.5.5.1 for an exact description of what goes
9734         on. 
9735
9736         This fixes bug #45127 and a host of other related to corlib compilation.
9737
9738         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9739         array is the method corresponding to the top-level type (this is
9740         because of the changes made to icall.c) so we change this
9741         accordingly.
9742
9743         (MethodGroupExpr.Name): This too.
9744
9745         * typemanager.cs (GetElementType): New method which does the right
9746         thing when compiling corlib. 
9747
9748         * everywhere: Make use of the above in the relevant places.
9749
9750 2003-07-22  Martin Baulig  <martin@ximian.com>
9751
9752         * cs-parser.jay (invocation_expression): Moved
9753         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9754         `cast_expression', but create a InvocationOrCast which later
9755         resolves to either an Invocation or a Cast.
9756
9757         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9758         method; call this before EmitStatement() to make sure that this
9759         expression can be used as a statement.
9760
9761         * expression.cs (InvocationOrCast): New class; resolves to either
9762         an Invocation or a Cast.
9763
9764         * statement.cs (StatementExpression): Call ResolveStatement() on
9765         the ExpressionStatement before emitting it.
9766
9767 2003-07-21  Martin Baulig  <martin@ximian.com>
9768
9769         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9770         `ref' and `out' attributes match; fixes #46220.
9771         (MemberAccess.ResolveMemberAccess): You can't reference a type
9772         through an expression; fixes #33180.
9773         (Indexers.GetIndexersForType): Don't return the indexers from
9774         interfaces the class implements; fixes #46502.
9775
9776 2003-07-21  Martin Baulig  <martin@ximian.com>
9777
9778         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9779         CS0661 checks; fixes bug #30442.
9780
9781 2003-07-21  Martin Baulig  <martin@ximian.com>
9782
9783         * decl.cs (AdditionResult): Added `Error'.
9784
9785         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9786
9787         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9788         makes cs0031.cs actually work.
9789
9790 2003-07-20  Martin Baulig  <martin@ximian.com>
9791
9792         * namespace.cs: Fixed that bug which caused a crash when compiling
9793         the debugger's GUI.
9794
9795 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9796
9797         * typemanager.cs (LookupTypeReflection): Never expose types which
9798         are NotPublic, NestedPrivate, NestedAssembly, or
9799         NestedFamANDAssem.  We used to return these, and later do a check
9800         that would report a meaningful error, but the problem is that we
9801         would not get the real match, if there was a name override.
9802
9803 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9804
9805         * namespace.cs (Namespace, Name): Do not compute the namespace
9806         name dynamically, compute it in the constructor.  This reduced
9807         memory usage by 1697 KB.
9808
9809         * driver.cs: Use --pause to pause at the end.
9810
9811 2003-07-17  Peter Williams  <peter@newton.cx>
9812
9813         * Makefile: Change the name of the test target so that it doesn't
9814         conflict with the recursive test target.
9815
9816 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9817
9818         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9819         AddressOf): Do not use EmitThis, that was wrong, use the actual
9820         this pointer.
9821
9822 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9823
9824         * class.cs (MethodData.Define): While checking if a method is an
9825         interface implementation, improve the test: If we are not public
9826         (use new test here: use the computed MethodAttributes directly,
9827         instead of the parsed modifier flags) check if the `implementing'
9828         method comes from an interface or not.
9829
9830         * pending.cs (VerifyPendingMethods): Slightly better error
9831         message.
9832
9833         * makefile: add test target that does the mcs bootstrap.
9834
9835 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9836
9837         * interface.cs (Define): Do nothing here since there are no
9838         members to populate etc. Move the attribute emission out of here
9839         since this was just totally the wrong place to put it. Attribute
9840         application happens during the 'Emit' phase, not in the 'Define'
9841         phase.
9842
9843         (Emit): Add this method and move the attribute emission here
9844
9845         * rootcontext.cs (EmitCode): Call the Emit method on interface
9846         types too.
9847
9848 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9849
9850         * expression.cs (OverloadResolve): Report error only if Location
9851         is not 'Null' which means that there was a probe going on.
9852
9853 2003-07-14  Martin Baulig  <martin@ximian.com>
9854
9855         * expression.cs (ConditionalLogicalOperator): New public class to
9856         implement user defined conditional logical operators.
9857         This is section 14.11.2 in the spec and bug #40505.
9858
9859 2003-07-14  Martin Baulig  <martin@ximian.com>
9860
9861         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9862
9863 2003-07-14  Martin Baulig  <martin@ximian.com>
9864
9865         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9866
9867         * ecore.cs (IVariable.VerifyFixed): New interface method.
9868
9869         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9870         operator, check whether the variable is actually fixed.  Fixes bug
9871         #36055.  Set a variable definitely assigned when taking its
9872         address as required by the spec.
9873
9874         * statement.cs (LocalInfo.IsFixed): New field.
9875         (LocalInfo.MakePinned): Set `IsFixed' to true.
9876
9877 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9878
9879         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9880         for .ctors, ensure that we only ask for members declared in the
9881         attribute type (BindingFlags.DeclaredOnly).
9882
9883         Fixes bug #43632.
9884
9885         * expression.cs (Error_WrongNumArguments): Report error 1501
9886         correctly the way CSC does.
9887
9888 2003-07-13  Martin Baulig  <martin@ximian.com>
9889
9890         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9891         lookup on the fully qualified name, to make things like "X.X" work
9892         where "X.X" is a fully qualified type name, but we also have a
9893         namespace "X" in the using list.  Fixes #41975.
9894
9895 2003-07-13  Martin Baulig  <martin@ximian.com>
9896
9897         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9898         function. If we're a CompoundAssign, we need to create an embedded
9899         CompoundAssign, not an embedded Assign.
9900         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9901         Fixes #45854.
9902
9903 2003-07-13  Martin Baulig  <martin@ximian.com>
9904
9905         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9906         work to fix bug #46088.
9907
9908 2003-07-13  Ravi Pratap <ravi@ximian.com>
9909
9910         * class.cs (Operator.Emit): Do not emit attributes here - it is
9911         taken care of by the Method class that we delegate too. This takes
9912         care of bug #45876.
9913
9914 2003-07-10  Martin Baulig  <martin@ximian.com>
9915
9916         * expression.cs (TypeOfVoid): New class.
9917         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9918
9919 2003-07-10  Martin Baulig  <martin@ximian.com>
9920
9921         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9922         bug #35957.
9923
9924 2003-07-10  Martin Baulig  <martin@ximian.com>
9925
9926         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9927         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9928
9929         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9930
9931         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9932
9933 2003-07-10  Martin Baulig  <martin@ximian.com>
9934
9935         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9936         of decimal.  Fixes #42850.
9937
9938         NOTE: I also fixed the created byte blob, but this doesn't work on
9939         the MS runtime and csc never produces any byte blobs for decimal
9940         arrays.
9941
9942 2003-07-10  Martin Baulig  <martin@ximian.com>
9943
9944         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9945         structs; fixes #32068.
9946         (Block.AddChildVariableNames): Fixed #44302.
9947
9948 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9949
9950         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9951
9952 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9953
9954         * attribute.cs: And this test is onger needed.
9955
9956 2003-07-08  Martin Baulig  <martin@ximian.com>
9957
9958         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9959         inaccessible types.  Fixes #36313.
9960
9961         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9962
9963         * namespace.cs (NamespaceEntry): Create implicit entries for all
9964         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9965         implicit entries for N1.N2 and N1.
9966
9967 2003-07-08  Martin Baulig  <martin@ximian.com>
9968
9969         Rewrote the handling of namespaces to fix a lot of the issues
9970         wrt. `using' aliases etc.
9971
9972         * namespace.cs (Namespace): Splitted this class into a
9973         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9974
9975         * typemanager.cs (TypeManager.IsNamespace): Removed.
9976         (TypeManager.ComputeNamespaces): Only compute namespaces from
9977         loaded assemblies here, not the namespaces from the assembly we're
9978         currently compiling.
9979
9980 2003-07-08  Martin Baulig  <martin@ximian.com>
9981
9982         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9983
9984 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9985
9986         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9987         already fixed it.  
9988
9989         I thought about the memory savings here, but LookupTypeReflection
9990         is used under already very constrained scenarios.  Compiling
9991         corlib or mcs only exposes one hit, so it would not really reduce
9992         any memory consumption.
9993
9994 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9995
9996         * typemanager.cs: fixes bug #45889 by only adding public types from
9997         other assemblies to the list of known types.
9998
9999 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10000
10001         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10002         on the type we resolved.
10003
10004 2003-07-05  Martin Baulig  <martin@ximian.com>
10005
10006         * pending.cs (PendingImplementation.ParentImplements): Don't
10007         create the proxy if the parent is abstract.
10008
10009         * class.cs (TypeContainer.DefineIndexers): Process explicit
10010         interface implementations first.  Fixes #37714.
10011
10012 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10013
10014         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10015         defined recursively;  but since we modify the input parameters
10016         (left is set to `this' temporarily), we reset this value if the
10017         left_is_explicit is false, which gives the original semantics to
10018         the code.  
10019
10020         * literal.cs (NullPointer): new class used to represent a null
10021         literal in a pointer context.
10022
10023         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10024         type is a pointer, use a NullPointer object instead of a
10025         NullLiteral.   Closes 43687
10026
10027         (ExplicitConversion): Convert pointer values using
10028         the conv opcode to the proper type.
10029
10030         * ecore.cs (New): change ValueTypeVariable property into a method,
10031         that returns whether the valuetype is suitable for being used.
10032
10033         * expression.cs (Binary.DoNumericPromotions): Only return if we
10034         the int constant was a valid uint, and we can return both left and
10035         right as uints.  If not, we continue processing, to trigger the
10036         type conversion.  This fixes 39018.
10037
10038         * statement.cs (Block.EmitMeta): During constant resolution, set
10039         the CurrentBlock property on the emitcontext, so that we resolve
10040         constants propertly.
10041
10042 2003-07-02  Martin Baulig  <martin@ximian.com>
10043
10044         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10045         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10046
10047         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10048         than emitting it here.
10049
10050         * statement.cs: Fixed some more flow analysis bugs.
10051
10052 2003-07-02  Martin Baulig  <martin@ximian.com>
10053
10054         * class.cs (MethodData.Define): When implementing interface
10055         methods, set Final unless we're Virtual.
10056
10057         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10058         check work for interface methods.
10059
10060 2003-07-01  Martin Baulig  <martin@ximian.com>
10061
10062         * ecore.cs (EmitContext.This): Replaced this property with a
10063         GetThis() method which takes a Location argument.  This ensures
10064         that we get the correct error location for a CS0188.
10065
10066 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10067
10068         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10069         ImplicitStandardConversion.
10070
10071         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10072
10073 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10074
10075         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10076         optimization.
10077
10078 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10081         constructors.
10082
10083         (MethodData.Define): Turn off initlocals for unsafe methods.
10084
10085 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10086
10087         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10088         complete;  Fixes #37521.
10089
10090         * delegate.cs: Use Modifiers.TypeAttr to compute the
10091         TypeAttributes, instead of rolling our own.  This makes the flags
10092         correct for the delegates.
10093
10094 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10095
10096         * class.cs (Constructor.Define): Set the private flag for static
10097         constructors as well.
10098
10099         * cs-parser.jay (statement_expression): Set the return value to
10100         null, to avoid a crash when we catch an error.
10101
10102 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10103
10104         * cs-parser.jay: Applied patch from Jackson that adds support for
10105         extern and unsafe modifiers to destructor declarations.
10106
10107         * expression.cs: Report error 21 if the user is trying to index a
10108         System.Array.
10109
10110         * driver.cs: Add an error message, suggested by the bug report.
10111
10112         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10113         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10114
10115 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10116
10117         * namespace.cs: Add some information to reduce FAQs.
10118
10119 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10120
10121         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10122         underlying enumeration types.  Fixes #43915.
10123
10124         * expression.cs: Treat ushort/short as legal values to be used in
10125         bitwise operations.
10126
10127 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10128
10129         * delegate.cs: transfer custom attributes for paramenters from
10130         the delegate declaration to Invoke and BeginInvoke.
10131
10132 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10133
10134         * attribute.cs: handle custom marshalers and emit marshal info
10135         for fields, too.
10136
10137 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10138
10139         * makefile.gnu: Added anonymous.cs to the compiler sources.
10140
10141 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * iterators.cs: Change the name of the proxy class to include two
10144         underscores.
10145
10146         * cs-parser.jay: Update grammar to include anonymous methods.
10147
10148         * anonymous.cs: new file.
10149
10150 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10151
10152         * class.cs (Field.Define): Add missing test for pointers and
10153         safety. 
10154
10155 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10156
10157         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10158         we use the stobj opcode.
10159
10160         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10161         since it wasn't the correct fix. 
10162
10163         It still is puzzling that we are required to use stobj for IntPtr
10164         which seems to be a ValueType.
10165
10166 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10167
10168         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10169         during regular simple name resolution.   Now, the trick is that
10170         instead of returning for processing the simplename, we do a
10171         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10172         contextual lookup type).   If a match is found, return that, if
10173         not, return for further composition.
10174
10175         This fixes long-standing 30485.
10176
10177         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10178         using the address to initialize an object, do an Stobj instead of
10179         using the regular Stelem.
10180
10181         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10182         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10183         Because if we are a BaseIndexerAccess that value will be true.
10184         Fixes 43643.
10185
10186         * statement.cs (GotoCase.Resolve): Return after reporting an
10187         error, do not attempt to continue. 
10188
10189         * expression.cs (PointerArithmetic.Emit): If our operand is a
10190         long, convert our constants to match the operand before
10191         multiplying.  Convert to I type before adding.   Fixes 43670.
10192
10193 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10194
10195         * enum.cs (ImplicitConversionExists) : Rename to
10196         ImplicitEnumConversionExists to remove ambiguity. 
10197
10198         * ecore.cs (NullCast): New type of cast expression class which
10199         basically is very similar to EmptyCast with the difference being
10200         it still is a constant since it is used only to cast a null to
10201         something else
10202         (eg. (string) null)
10203
10204         * convert.cs (ImplicitReferenceConversion): When casting a null
10205         literal, we return a NullCast.
10206
10207         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10208         should be around anymore.
10209
10210         The renaming (reported was slightly wrong). Corrections:
10211
10212         ConvertImplicitStandard -> ImplicitConversionStandard
10213         ConvertExplicitStandard -> ExplicitConversionStandard
10214
10215         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10216         before passing them in !
10217
10218         * convert.cs (ImplicitConversionStandard): When comparing for
10219         equal expr and target types, ensure that expr is not a
10220         NullLiteral.
10221
10222         In general, we must not be checking (expr_type ==
10223         target_type) in the top level conversion methods
10224         (ImplicitConversion, ExplicitConversion etc). This checking is
10225         done in the methods that they delegate to.
10226
10227 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * convert.cs: Move Error_CannotConvertType,
10230         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10231         ImplicitNumericConversion, ImplicitConversionExists,
10232         ImplicitUserConversionExists, StandardConversionExists,
10233         FindMostEncompassedType, FindMostSpecificSource,
10234         FindMostSpecificTarget, ImplicitUserConversion,
10235         ExplicitUserConversion, GetConversionOperators,
10236         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10237         TryImplicitIntConversion, Error_CannotConvertImplicit,
10238         ConvertImplicitRequired, ConvertNumericExplicit,
10239         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10240         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10241         its own file.
10242
10243         Perform the following renames:
10244
10245         StandardConversionExists -> ImplicitStandardConversionExists
10246         ConvertImplicit -> ImplicitConversion
10247         ConvertImplicitStandard -> ImplicitStandardConversion
10248         TryImplicitIntConversion -> ImplicitIntConversion
10249         ConvertImplicitRequired -> ImplicitConversionRequired
10250         ConvertNumericExplicit -> ExplicitNumericConversion
10251         ConvertReferenceExplicit -> ExplicitReferenceConversion
10252         ConvertExplicit -> ExplicitConversion
10253         ConvertExplicitStandard -> ExplicitStandardConversion
10254
10255 2003-05-19  Martin Baulig  <martin@ximian.com>
10256
10257         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10258         (TypeInfo): Added support for structs having structs as fields.
10259
10260         * ecore.cs (FieldExpr): Implement IVariable.
10261         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10262         VariableInfo for the field.
10263
10264 2003-05-18  Martin Baulig  <martin@ximian.com>
10265
10266         * expression.cs (This.DoResolve): Report a CS0027 if we're
10267         emitting a field initializer.
10268
10269 2003-05-18  Martin Baulig  <martin@ximian.com>
10270
10271         * expression.cs (This.ResolveBase): New public function.
10272         (This.DoResolve): Check for CS0188.
10273
10274         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10275         This.Resolve().
10276
10277         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10278         `instance_expression' to null if we don't have any non-static
10279         methods.
10280
10281 2003-05-18  Martin Baulig  <martin@ximian.com>
10282
10283         Reworked the way how local variables and parameters are handled by
10284         the flow analysis code.
10285
10286         * statement.cs (TypeInfo, VariableMap): New public classes.
10287         (VariableInfo): New public class.  This is now responsible for
10288         checking whether a variable has been assigned.  It is used for
10289         parameters and local variables.
10290         (Block.EmitMeta): Take the InternalParameters as argument; compute
10291         the layout of the flow vectors here.
10292         (Block.LocalMap, Block.ParameterMap): New public properties.
10293         (FlowBranching): The .ctor doesn't get the InternalParameters
10294         anymore since Block.EmitMeta() now computes the layout of the flow
10295         vector.
10296         (MyStructInfo): This class is now known as `StructInfo' and nested
10297         in `TypeInfo'; we don't access this directly anymore.
10298
10299         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10300         property and removed IsAssigned(), IsFieldAssigned(),
10301         SetAssigned() and SetFieldAssigned(); we now call them on the
10302         VariableInfo so we don't need to duplicate this code everywhere.
10303
10304         * expression.cs (ParameterReference): Added `Block block' argument
10305         to the .ctor.
10306         (LocalVariableReference, ParameterReference, This): The new
10307         VariableInfo class is now responsible for all the definite
10308         assignment stuff.
10309
10310         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10311         IsParameterAssigned, SetParameterAssigned): Removed.
10312
10313 2003-05-18  Martin Baulig  <martin@ximian.com>
10314
10315         * typemanager.cs (InitCoreTypes): Try calling
10316         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10317         the 3-args-version.  Corlib now also needs our `void_type'.
10318         (GetMethod): Added overloaded version which takes an optional
10319         `bool report_errors' to allow lookups of optional methods.
10320
10321 2003-05-12  Martin Baulig  <martin@ximian.com>
10322
10323         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10324         only used for locals and not for parameters.
10325
10326 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10327
10328         * support.cs (InternalParameters.ParameterType): Return the
10329         ExternalType of the parameter.
10330
10331         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10332         they were unused.
10333
10334 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10335
10336         * class.cs (MethodData.Define): Do not set the `newslot' on
10337         interface members, if they are also flagged as "override".
10338
10339         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10340         better code for ++i and i++.  This only works for static fields
10341         and local variables.
10342
10343         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10344         want to pull the DeclSpace out of the builder_to_declspace instead
10345         of the TypeBuilder (like in TypeContainer.FindMembers).
10346
10347         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10348         instead of LookupTypeContainer.  Fixes the crash on .NET for
10349         looking up interface members.
10350
10351         * const.cs: Create our own emit context during the Definition
10352         stage, so that constants are evaluated in the proper context, when
10353         a recursive definition happens.
10354
10355 2003-05-11  Martin Baulig  <martin@ximian.com>
10356
10357         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10358         new block for a switch section.
10359         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10360         the adding/lookup in the switch block.  Fixes #39828.
10361
10362 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10365         functionality: I needed to convert the data after I had performed
10366         the add/sub operation into the operands type size.
10367
10368         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10369         pass the type for the box operation, otherwise the resulting
10370         object would have been of type object.
10371
10372         (BoxedCast): Add constructor to specify the type to box as.
10373
10374 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * iterators.cs: I was reusing the `count' variable inadvertently,
10377         take steps to not allow this to happen.
10378
10379 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10380
10381         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10382         by creating an array at the point where the params starts and
10383         putting all those arguments there, then adjusting the size of the
10384         array.
10385
10386 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10387
10388         * expression.cs (New.AddressOf): Implement interface
10389         IMemoryLocation.  This is used when the `new' operator is used in
10390         the context of an invocation to a method on a value type.
10391
10392         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10393         example. 
10394
10395         * namespace.cs: Also check the using aliases here.
10396
10397         * driver.cs: Move the test for using validity after the types have
10398         been entered, so we do a single pass that also includes the using
10399         aliases. 
10400
10401         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10402         in the regular case.   CreateSiblingForFinally is doing extra
10403         error checking.
10404
10405         * attribute.cs (GetAttributeArgumentExpression): Store the result
10406         on an out value, and use the return value to indicate failure
10407         instead of using null (which is a valid return for Constant.GetValue).
10408
10409         * statement.cs: Perform the analysis flow for the increment
10410         portion after the statement, because this will be the real flow of
10411         execution.  Fixes #42385
10412
10413         * codegen.cs (EmitContext.EmitArgument,
10414         EmitContext.EmitStoreArgument): New helper functions when the
10415         RemapToProxy flag is set.
10416
10417         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10418         function.
10419
10420         Add support for remapping parameters. 
10421
10422         * iterators.cs: Propagate parameter values;  Store parameter
10423         values in the proxy classes.
10424
10425 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10426
10427         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10428         need a proxy reference;  I do not know what I was thinking
10429
10430         * cs-parser.jay (constructor_initializer): catch another error,
10431         and display nice message.
10432
10433         (field_declaration): catch void field declaration
10434         to flag a better error. 
10435
10436         * class.cs (MemberBase.CheckBase): Report an error instead of a
10437         warning if a new protected member is declared in a struct. 
10438         (Field.Define): catch the error of readonly/volatile.
10439
10440         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10441
10442         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10443         volatile variable is taken
10444
10445 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10446
10447         * statement.cs (Fixed.Resolve): Report an error if we are not in
10448         an unsafe context.
10449
10450 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * typemanager.cs: reuse the code that handles type clashes for
10453         delegates and enumerations.
10454
10455         * class.cs (Report28): Always report.
10456
10457         * expression.cs (EncodeAsAttribute): Allow nulls here.
10458
10459 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10460
10461         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10462         the functionality for testing whether an expression is valid for
10463         an attribute here.  Also handle the case of arrays of elements
10464         being stored. 
10465
10466         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10467         encoding a linear array into an array of objects that are suitable
10468         to be passed to an CustomAttributeBuilder.
10469
10470         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10471
10472         * ecore.cs: (FieldExpr): Handle field remapping here.
10473
10474         * iteratators.cs: Pass the instance variable (if the method is an
10475         instance method) to the constructors, so we can access the field
10476         variables on the class.
10477
10478         TODO: Test this with structs.  I think the THIS variable on
10479         structs might have to be a pointer, and not a refenrece
10480
10481 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10484         local variables to fields in a proxy class.
10485
10486         * iterators.cs (PopulateProxy): Rename our internal fields to
10487         <XXX>.  
10488         Create a <THIS> field if we are an instance method, so we can
10489         reference our parent container variables.
10490         (MapVariable): Called back from the EmitContext code to enter a
10491         new variable to field mapping into the proxy class (we just create
10492         a FieldBuilder).
10493
10494         * expression.cs
10495         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10496         for using the remapped locals to fields.
10497
10498         I placed the code here, because that gives the same semantics to
10499         local variables, and only changes the Emit code.
10500
10501         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10502         statements inside iterators.
10503         (VariableInfo): Add a FieldBuilder for the cases when we are
10504         remapping local variables to fields in a proxy class
10505
10506         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10507         current_block != null.
10508
10509         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10510         not cope with strings, as it has been moved to the
10511         TableSwitchEmit.  Fixed bug in switch generation.
10512
10513         * expression.cs (New.DoResolve): Provide more context for the user
10514         when reporting an error.
10515
10516         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10517         pointers. 
10518
10519         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10520         check the permissions for it.  Note than in a type-resolution
10521         context the check was already present in DeclSpace.ResolveType,
10522         but was missing from the MemberAccess.
10523
10524         (ArrayCreation.CheckIndices): warn if the user has
10525         more nested levels of expressions, but there are no more
10526         dimensions specified.  Avoids crash on bug 41906.
10527
10528 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10529
10530         * statement.cs (Block): replace Implicit bool, for a generic
10531         flags.   
10532         New flag: `Unchecked'.  This is used during the EmitMeta phase
10533         (which is out-of-line with the regular Resolve/Emit process for a
10534         statement, as this is done ahead of time, but still gets a chance
10535         to call constant resolve).
10536
10537         (Block.Flags): new enum for adding a new flag.
10538
10539         (Block.EmitMeta): track the state of unchecked.
10540
10541         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10542         to enable constant resolution to work there as well.
10543
10544 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10545
10546         * typemanager.cs (ienumerable_type): Also look up
10547         System.Collections.IEnumerable. 
10548
10549 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10550
10551         TODO: Test more than one conditional per method.
10552
10553         * class.cs (Indexer.Define): Report the location where the user is
10554         referencing the unsupported feature.
10555
10556         (MethodData): Overload the use of `conditionals' to
10557         minimize the creation of needless ArrayLists.   This saves roughly
10558         212kb on my machine.
10559
10560         (Method): Implement the new IIteratorContainer interface.
10561         (Method.SetYields): Implement the method by setting the ModFlags
10562         to contain METHOD_YIELDS.
10563
10564         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10565         which just got set to null.
10566
10567         * iterators.cs: New file.
10568
10569         (Yield, YieldBreak): New statements.
10570
10571         * statement.cs (Return.Resolve): Flag an error if we are used in
10572         an iterator method.
10573
10574         * codegen.cs (InIterator): New flag set if the code is being
10575         compiled in an iterator method.
10576
10577         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10578         internal modifier, and we just use it to avoid adding extra
10579         fields, as this is seldom used.  
10580
10581         * cs-parser.jay: Add yield_statement (yield and yield break).
10582
10583         * driver.cs: New flag -v2 to turn on version 2 features. 
10584
10585         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10586         hashtable when v2 is enabled.
10587
10588 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10589
10590         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10591         there is already a namespace defined with this name.
10592
10593         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10594         people upgraded their corlibs.
10595
10596         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10597         always use fully qualified types, no need to use the compiler
10598         front end.
10599
10600         (TypeManager.IsNamespace): Use binarysearch.
10601
10602         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10603         AddDelegate): I did not quite use the new IsValid API properly: I
10604         have to pass the short-name and the fullname.  I was passing only
10605         the basename instead of the fullname sometimes. 
10606
10607         (TypeContainer.DefineType): call NamespaceClash.
10608
10609         * interface.cs (Interface.DefineType): use NamespaceClash before
10610         defining the type.
10611
10612         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10613         defining the type.
10614
10615         * enum.cs: (Enum.DefineType): use NamespaceClash before
10616         defining the type.
10617
10618         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10619         speed increase.  First, use the negative_hits cache when we get a
10620         negative.  Second, add the type with its full original name
10621         instead of the new . and + encoded name (reflection uses + to
10622         separate type from a nested type).  Use LookupTypeReflection
10623         directly which bypasses the type->name hashtable (that we already
10624         know does not contain the type.
10625
10626         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10627         location/container type. 
10628
10629         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10630
10631 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10632
10633         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10634
10635         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10636         method is being referenced in the method group from a static
10637         context, and report error 120 if so.
10638
10639         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10640         Error118. 
10641
10642         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10643         is created, we create the A namespace).
10644
10645         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10646         Fixes #41591
10647
10648 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10649
10650         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10651         invocation to ModuleBuilder.GetType with the same values will
10652         return a new type instance, so we need to cache its return
10653         values. 
10654
10655         * expression.cs (Binary.ResolveOperator): Only allow the compare
10656         operators on enums if they are of the same type.
10657
10658         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10659         types of ValueType on their own case.  Before we were giving them
10660         the same treatment as objects.
10661
10662         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10663         fullname.  Short name is used to compare against container name.
10664         Fullname is used to check against defined namespace names.
10665
10666         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10667         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10668
10669         (Method.CheckBase): Call parent.
10670         (MemberBase.CheckBase): Check for protected members on sealed
10671         classes.
10672         (PropertyBase.CheckBase): Call parent.
10673         (Field.Define): Call parent.
10674
10675         * report.cs: Negative error codes are now mapped to 8000 - code,
10676         so that the display is render more nicely.
10677
10678         * typemanager.cs: Do not use try/catch, instead report a regular
10679         error. 
10680
10681         (GetPointerType, GetReferenceType): These methods provide
10682         mechanisms to obtain the T* and T& from a T.  We had the code
10683         previously scattered around the code base, and it also used
10684         TypeManager.LookupType that would go through plenty of caches.
10685         This one goes directly to the type source.
10686
10687         In some places we did the Type.GetType followed by
10688         ModuleBuilder.GetType, but not in others, so this unifies the
10689         processing as well.
10690
10691         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10692         statements now that we have namespace information.
10693
10694         * typemanager.cs (IsNamespace): New method, returns whether the
10695         string presented is a namespace or not.
10696
10697         (ComputeNamespaces): New public entry point, computes the list of
10698         available namespaces, using the GetNamespaces API call in Mono, or
10699         the slower version in MS.NET.   
10700
10701         Now before we start the semantic analysis phase, we have a
10702         complete list of namespaces including everything that the user has
10703         provided.
10704
10705         Deleted old code to cache namespaces in .nsc files.
10706
10707 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10708
10709         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10710         class/struct location definition Location for the implicit
10711         constructor location.
10712
10713         (Operator.Define): Use the location of the operator for the
10714         implicit Method definition.
10715
10716         (Constructor.Emit): use the constructor location for the implicit
10717         base initializer constructor.
10718
10719         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10720         and the Expression class now contains two new methods:
10721
10722         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10723         isolate type lookup from the rest of the resolution process.
10724
10725         Since we use Expressions to hold type definitions due to the way
10726         we parse the input we have historically overloaded Resolve to
10727         perform the Type lookups if a special flag is passed.  Now this is
10728         eliminated and two methods take their place. 
10729
10730         The differences in the two methods between xStep and xTerminal is
10731         that xStep is involved in our current lookup system that uses
10732         SimpleNames to compose a name, while xTerminal is used just to
10733         catch the case where the simplename lookup failed.
10734
10735 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10736
10737         * expression.cs (ResolveMemberAccess): Remove redundant code.
10738         TypeExpr expressions are always born fully resolved.
10739
10740         * interface.cs (PopulateMethod): Do not lookup the types twice.
10741         We were doing it once during SemanticAnalysis and once during
10742         PopulateMethod.
10743
10744         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10745         in local variable type definitions, were being returned as a
10746         SimpleName (we decomposed everything into a string), that is
10747         because primary_expression was being used instead of a type in the
10748         grammar (reduce/reduce conflicts).
10749
10750         The part that was wrong is that we converted the expression into a
10751         string (an oversimplification in one hand, compounded with primary
10752         expressions doing string concatenation).
10753
10754         So things like:
10755
10756         A.B.C [] x;
10757
10758         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10759         using clauses from working on this particular context.  And a type
10760         was being matched directly against "A.B.C[]".
10761
10762         We now use the correct approach, and allow for ComposedCast to be
10763         part of the unary expression.  So the "A.B.C []" become a composed
10764         cast of "A.B.C" (as a nested group of MemberAccess with a
10765         SimpleName at the end) plus the rank composition "[]". 
10766
10767         Also fixes 35567
10768
10769 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10770
10771         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10772         for the access level checking.
10773
10774         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10775         `TypeContainer container', because I kept getting confused when I
10776         was debugging this code.
10777
10778         * expression.cs (Indexers): Instead of tracking getters/setters,
10779         we now track them in parallel.  We create one arraylist less, but
10780         most importantly it is possible now for the LValue code to find a
10781         matching get for a set.
10782
10783         (IndexerAccess.DoResolveLValue): Update the code.
10784         GetIndexersForType has been modified already to extract all the
10785         indexers from a type.  The code assumed it did not.
10786
10787         Also make the code set the correct return type for the indexer.
10788         This was fixed a long time ago for properties, but was missing for
10789         indexers.  It used to be void_type.
10790
10791         (Binary.Emit): Test first for doubles instead of
10792         floats, as they are more common.
10793
10794         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10795         when dealing with floats and the <=, >= operators.  This fixes bug
10796         #39314 
10797
10798         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10799         to load the array value by emitting a load on the foreach variable
10800         type.  This was incorrect.  
10801
10802         We now emit the code to load an element using the the array
10803         variable type, and then we emit the conversion operator.
10804
10805         Fixed #40176
10806
10807 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10808
10809         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10810
10811 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10812
10813         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10814         test for protection before we test for signatures. 
10815
10816         (MethodSignature.ToString): implement.
10817
10818         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10819         to the case where we reduced into a LongConstant.
10820
10821         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10822         depend on whether the information is acurrate, because the
10823         Microsoft runtime will always claim that the array type is public,
10824         regardless of the real state.
10825
10826         If the type is a pointer, another problem happens: the type is
10827         reported as non-public in Microsoft.  
10828
10829         In both cases we have to call CheckAccessLevel recursively with
10830         the underlying type as the argument to be tested.
10831
10832 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10833
10834         * assign.cs (Assign.Emit): If we are dealing with a compound
10835         assignment expression, we should use the code path that stores the
10836         intermediate result in a temporary value.  This fixes #40903.
10837
10838         *expression.cs (Indirection.ToString): Provide ToString method for
10839         debugging. 
10840
10841 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10842
10843         * class.cs: Null out fields holding references to Block objects so
10844         they can be garbage collected.
10845
10846         * expression.cs (OverloadResolve): Remove unused local.
10847
10848 2003-04-07  Martin Baulig  <martin@ximian.com>
10849
10850         * codegen.cs (EmitContext.CurrentFile): New public field.
10851         (EmitContext.Mark): Use the CurrentFile to check whether the
10852         location is in the correct file.
10853         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10854
10855 2003-04-07  Martin Baulig  <martin@ximian.com>
10856
10857         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10858
10859         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10860         location.  [FIXME: The location argument which gets passed to this
10861         method is sometimes wrong!]
10862
10863 2003-04-07  Nick Drochak <ndrochak@gol.com>
10864
10865         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10866
10867 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10868
10869         * expression.cs (Indirection.EmitAssign): We were using the
10870         temporary, but returning immediately instead of continuing the
10871         EmitAssing flow.
10872
10873 2003-04-06  Martin Baulig  <martin@ximian.com>
10874
10875         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10876         if it's a nested child, but also deriving from the outer class.
10877         See test 190.cs.
10878
10879         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10880         nested child, but also deriving from the outer class.  See
10881         test-190.cs.
10882         (FilterWithClosure): We may access private members of the outer
10883         class if we're a nested child and deriving from the outer class.
10884         (RealMemberLookup): Only set `closure_private_ok' if the
10885         `original_bf' contained BindingFlags.NonPublic.
10886
10887 2003-04-05  Martin Baulig  <martin@ximian.com>
10888
10889         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10890
10891 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10892
10893         * class.cs (Event.Define): Do not allow abstract events to have
10894         initializers. 
10895
10896 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10899         block in event declarations.
10900
10901         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10902         value type, get its address.
10903
10904         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10905         leaving a class on the stack instead of a boolean value (int
10906         0/1).  Change the code so we compare against null, and then the
10907         result against zero.
10908
10909         * class.cs (TypeContainer.GetClassBases): We were checking for the
10910         parent class being sealed too late.
10911
10912         * expression.cs (Binary.Emit): For <= and >= when dealing with
10913         floating point values, use cgt.un and clt.un instead of cgt and
10914         clt alone.
10915
10916 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10917
10918         * statement.cs: Apply the same optimization as MS: skip the 
10919         GetEnumerator returning an IEnumerator, and use the one returning a 
10920         CharEnumerator instead. This allows us to avoid the try-finally block 
10921         and the boxing.
10922
10923 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10924
10925         * cs-parser.jay: Attributes cannot be applied to
10926                          namespaces. Fixes #40473
10927
10928 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10929
10930         * class.cs:
10931         (Add*): check if the name is valid using the full name for constants,
10932         fields, properties and events.
10933
10934 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10935
10936         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10937         char constants to be part of the enumeration.
10938
10939         * expression.cs (Conditional.DoResolve): Add support for operator
10940         true. Implements the missing functionality from 14.12
10941
10942         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10943         operator true/false as required by the spec.
10944
10945         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10946         implicit conversion to boolean.
10947
10948         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10949         also one where the type implements `operator true'. 
10950
10951         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10952         get an expression that will invoke operator true based on an
10953         expression.  
10954
10955         (GetConversionOperators): Removed the hack that called op_True
10956         here.  
10957
10958         (Expression.ResolveBoolean): Move this from Statement.
10959
10960 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10961
10962         * ecore.cs (FieldExpr): do not allow initialization of initonly
10963         fields on derived classes
10964
10965 2003-03-13  Martin Baulig  <martin@ximian.com>
10966
10967         * statement.cs (Block.Emit): Call ig.BeginScope() and
10968         ig.EndScope() when compiling with debugging info; call
10969         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10970
10971 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * expression.cs (Indexers): Do not construct immediately, allow
10974         for new members to be appended as we go.  Fixes 38143
10975
10976 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10977
10978         * expression.cs: save/restore context when resolving an unchecked
10979         expression.
10980
10981 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10982
10983         * cfold.cs: Catch division by zero in modulus operator during
10984         constant folding.
10985
10986 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10987
10988         * interface.cs (Interface.DefineMembers): Avoid defining members
10989         twice. 
10990
10991 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * driver.cs: handle the +/- options for -noconfig
10994
10995         * statement.cs (Unckeched.Resolve): Also track the state of
10996         unchecked in the Resolve phase.
10997
10998 2003-02-27  Martin Baulig  <martin@ximian.com>
10999
11000         * ecore.cs (Expression.MemberLookup): Don't create a
11001         MethodGroupExpr for something which is not a method.  Fixes #38291.
11002
11003 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11004
11005         * class.cs (MemberBase.CheckParameters): Also check that the type
11006         is unmanaged if it is a pointer.
11007
11008         * expression.cs (SizeOf.Resolve): Add location information.
11009
11010         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11011         a managed type is declared.
11012
11013         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11014         parameter modifiers as well.  Fixes bug 38606
11015
11016         * class.cs: Very sad.  Am backing out the speed up changes
11017         introduced by the ArrayList -> Array in the TypeContainer, as they
11018         were not actually that much faster, and introduced a bug (no error
11019         reports on duplicated methods).
11020
11021         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11022         source first, this will guarantee that we have a valid expression
11023         before calling in lower levels functions that will require a
11024         resolved object.  Then use this original_source in the
11025         target.ResolveLValue instead of the original source that was
11026         passed to us.
11027
11028         Another change.  Use target.Resolve instead of LValueResolve.
11029         Although we are resolving for LValues, we will let the Assign code
11030         take care of that (it will be called again from Resolve).  This
11031         basically allows code like this:
11032
11033         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11034         class Y { void A (X x) { x [0] += o; }
11035
11036         The problem was that the indexer was trying to resolve for
11037         set_Item (idx, object o) and never finding one.  The real set_Item
11038         was set_Item (idx, X).  By delaying the process we get the right
11039         semantics. 
11040
11041         Fixes bug 36505
11042
11043 2003-02-23  Martin Baulig  <martin@ximian.com>
11044
11045         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11046         while calling DoEmit ().
11047
11048         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11049         source files; if you use the #line directive inside a method, the
11050         compiler stops emitting line numbers for the debugger until it
11051         reaches the end of the method or another #line directive which
11052         restores the original file.
11053
11054 2003-02-23  Martin Baulig  <martin@ximian.com>
11055
11056         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11057
11058 2003-02-23  Martin Baulig  <martin@ximian.com>
11059
11060         * statement.cs (Block.AddChildVariableNames): We need to call this
11061         recursively, not just for our immediate children.
11062
11063 2003-02-23  Martin Baulig  <martin@ximian.com>
11064
11065         * class.cs (Event.Define): Always make the field private, like csc does.
11066
11067         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11068         actually work, fixes bug #37521.
11069
11070 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * delegate.cs: When creating the various temporary "Parameters"
11073         classes, make sure that we call the ComputeAndDefineParameterTypes
11074         on those new parameters (just like we do with the formal ones), to
11075         allow them to be resolved in the context of the DeclSpace.
11076
11077         This fixes the bug that Dick observed in Bugzilla #38530.
11078
11079 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * expression.cs (ResolveMemberAccess): When resolving a constant,
11082         do not attempt to pull a constant if the value was not able to
11083         generate a valid constant.
11084
11085         * const.cs (LookupConstantValue): Do not report more errors than required.
11086
11087 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11088
11089         * expression.cs: fixes bug #38328.
11090
11091 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11092
11093         * class.cs: Changed all the various members that can be part of a
11094         class from being an ArrayList to be an Array of the right type.
11095         During the DefineType type_list, interface_list, delegate_list and
11096         enum_list are turned into types, interfaces, delegates and enums
11097         arrays.  
11098
11099         And during the member population, indexer_list, event_list,
11100         constant_list, field_list, instance_constructor_list, method_list,
11101         operator_list and property_list are turned into their real arrays.
11102
11103         Although we could probably perform this operation earlier, for
11104         good error reporting we need to keep the lists and remove the
11105         lists for longer than required.
11106
11107         This optimization was triggered by Paolo profiling the compiler
11108         speed on the output of `gen-sample-program.pl' perl script. 
11109
11110         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11111         not crash in methods like MemberLookupFailed that use this field.  
11112
11113         This problem arises when the compiler fails to resolve a type
11114         during interface type definition for example.
11115
11116 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11117
11118         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11119         inherit from System.Object, so we have to stop at null, not only
11120         when reaching System.Object.
11121
11122 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11123
11124         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11125         DeclaredOnly because the parent indexer might have had a different
11126         name, but did not loop until the top of the hierarchy was reached.
11127
11128         The problem this one fixes is 35492: when a class implemented an
11129         indexer from an interface, we were getting the interface method
11130         (which was abstract) and we were flagging an error (can not invoke
11131         abstract method).
11132
11133         This also keeps bug 33089 functioning, and test-148 functioning.
11134
11135         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11136         out if a method is special is to see if it is declared in a
11137         property or event, or whether it is one of the predefined operator
11138         names.   This should fix correctly #36804.
11139
11140 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11141
11142         The goal here is to remove the dependency on EmptyCast.Peel ().
11143         Killing it completely.
11144
11145         The problem is that currently in a number of places where
11146         constants are expected, we have to "probe" for an EmptyCast, and
11147         Peel, which is not the correct thing to do, as this will be
11148         repetitive and will likely lead to errors. 
11149
11150         The idea is to remove any EmptyCasts that are used in casts that
11151         can be reduced to constants, so we only have to cope with
11152         constants. 
11153
11154         This bug hunt was triggered by Bug 37363 and the desire to remove
11155         the duplicate pattern where we were "peeling" emptycasts to check
11156         whether they were constants.  Now constants will always be
11157         constants.
11158
11159         * ecore.cs: Use an enumconstant here instead of wrapping with
11160         EmptyCast.  
11161
11162         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11163         throwing me off.  By handling this we can get rid of a few hacks.
11164
11165         * statement.cs (Switch): Removed Peel() code.
11166
11167 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11168
11169         * class.cs: Location information for error 508
11170
11171         * expression.cs (New.DoResolve): Add a guard against double
11172         resolution of an expression.  
11173
11174         The New DoResolve might be called twice when initializing field
11175         expressions (see EmitFieldInitializers, the call to
11176         GetInitializerExpression will perform a resolve on the expression,
11177         and later the assign will trigger another resolution
11178
11179         This leads to bugs (#37014)
11180
11181         * delegate.cs: The signature for EndInvoke should contain any ref
11182         or out parameters as well.  We were not doing this in the past. 
11183
11184         * class.cs (Field.Define): Do not overwrite the type definition
11185         inside the `volatile' group.  Turns out that volatile enumerations
11186         were changing the type here to perform a validity test, which
11187         broke conversions. 
11188
11189 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11190
11191         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11192         and structs, we do not want to load the instance variable
11193
11194         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11195         enum_type has to be handled like an object reference (implicit
11196         conversions exists from this to object), but the regular IsClass
11197         and IsValueType tests will never return true for this one.
11198
11199         Also we use TypeManager.IsValueType instead of type.IsValueType,
11200         just for consistency with the rest of the code (this is only
11201         needed if we ever use the construct exposed by test-180.cs inside
11202         corlib, which we dont today).
11203
11204 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11205
11206         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11207         just InternalCall.
11208
11209 2003-02-09  Martin Baulig  <martin@ximian.com>
11210
11211         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11212         (Namespace.DefineNamespaces): New static public method; this is
11213         called when we're compiling with debugging to add all namespaces
11214         to the symbol file.
11215
11216         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11217         pass it to the Namespace's .ctor.
11218
11219         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11220         and MethodBase arguments; pass the namespace ID to the symwriter;
11221         pass the MethodBase instead of the token to the symwriter.
11222         (SymbolWriter.DefineNamespace): New method to add a namespace to
11223         the symbol file.
11224
11225 2003-02-09  Martin Baulig  <martin@ximian.com>
11226
11227         * symbolwriter.cs: New file.  This is a wrapper around
11228         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11229         methods here in near future.
11230
11231 2003-02-09  Martin Baulig  <martin@ximian.com>
11232
11233         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11234         ILGenerator.MarkSequencePoint() which are actually used by the
11235         symbol writer.
11236
11237 2003-02-09  Martin Baulig  <martin@ximian.com>
11238
11239         * location.cs (SourceFile): New public sealed class.  This
11240         contains the name and an index which is used in the location's token.
11241         (Location): Reserve an appropriate number of bits in the token for
11242         the source file instead of walking over that list, this gives us a
11243         really huge performance improvement when compiling with debugging.
11244
11245         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11246         `SourceFile' argument instead of a string.
11247         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11248         but don't parse/tokenize here, we need to generate the list of all
11249         source files before we do that.
11250         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11251         the files.
11252
11253         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11254         instead of a string.
11255
11256         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11257         of a string.
11258
11259 2003-02-09  Martin Baulig  <martin@ximian.com>
11260
11261         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11262         filename on `#line default'.
11263
11264 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11265
11266         * statement.cs: don't clear the pinned var when the fixed statement
11267         returns from the method (fixes bug#37752).
11268
11269 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11270
11271         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11272         to IsValueType.
11273
11274 2003-02-07  Martin Baulig  <martin@ximian.com>
11275
11276         * driver.cs: Removed the `--debug-args' command line argument.
11277
11278         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11279         automatically by the AsssemblyBuilder.
11280         (CodeGen.InitializeSymbolWriter): We don't need to call any
11281         initialization function on the symbol writer anymore.  This method
11282         doesn't take any arguments.
11283
11284 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11285
11286         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11287         from referenced assemblies as well.
11288
11289 2003-02-02  Martin Baulig  <martin@ximian.com>
11290
11291         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11292
11293 2003-02-02  Martin Baulig  <martin@ximian.com>
11294
11295         * class.cs (Constructor.Emit): Open the symbol writer before
11296         emitting the constructor initializer.
11297         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11298         single-stepping through constructor initializers.
11299
11300 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11301
11302         * class.cs: Handle error 549: do not allow virtual methods in
11303         sealed classes. 
11304
11305 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11306
11307         * decl.cs: Check access levels when resolving types
11308
11309 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11310
11311         * statement.cs: Add parameters and locals set in catch blocks that might 
11312         return to set vector
11313
11314 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11315
11316         * class.cs (Operator): Set the SpecialName flags for operators.
11317
11318         * expression.cs (Invocation.DoResolve): Only block calls to
11319         accessors and operators on SpecialName methods.
11320
11321         (Cast.TryReduce): Handle conversions from char constants.
11322
11323
11324 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11325
11326         * statement.cs: small memory and time optimization in FlowBranching.
11327
11328 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11329
11330         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11331         problem that the last fix but in the other sid (Set).
11332
11333         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11334         access when there is no indexer in the hierarchy.
11335
11336 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11337
11338         * class.cs: Combine some if statements.
11339
11340 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11341
11342         * driver.cs: fixed bug #37187.
11343
11344 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11345
11346         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11347         any indexer, it's needed to build a list with all the indexers in the
11348         hierarchy (AllGetters), else we have problems. Fixes #35653.
11349
11350 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11351
11352         * class.cs (MethodData.Define): It is wrong for an interface
11353         implementation to be static in both cases: explicit and implicit.
11354         We were only handling this in one case.
11355
11356         Improve the if situation there to not have negations.
11357
11358         * class.cs (Field.Define): Turns out that we do not need to check
11359         the unsafe bit on field definition, only on usage.  Remove the test.
11360
11361 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11362
11363         * driver.cs: use assembly.Location instead of Codebase (the latest
11364         patch made mcs fail when using MS assemblies).
11365
11366 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11367
11368         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11369         get the path to *corlib.dll.
11370
11371 2003-01-21  Nick Drochak <ndrochak@gol.com>
11372
11373         * cs-tokenizer.cs:
11374         * pending.cs:
11375         * typemanager.cs: Remove compiler warnings
11376
11377 2003-01-20  Duncan Mak  <duncan@ximian.com>
11378
11379         * AssemblyInfo.cs: Bump the version number to 0.19.
11380
11381 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11382
11383         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11384
11385 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11386
11387         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11388
11389 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11390
11391         * cs-parser.jay: Small fix: we were not comparing the constructor
11392         name correctly.   Thanks to Zoltan for the initial pointer.
11393
11394 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11395
11396         * cs-tokenizer.cs: Set file name when specified with #line
11397
11398 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11399
11400         * cs-parser.jay: Only perform the constructor checks here if we
11401         are named like the class;  This will help provider a better
11402         error.  The constructor path is taken when a type definition is
11403         not found, but most likely the user forgot to add the type, so
11404         report that rather than the constructor error.
11405
11406 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11407
11408         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11409         allocations.
11410
11411 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11412
11413         * cs-parser.jay: Add cleanup call.
11414
11415 2003-01-13  Duncan Mak  <duncan@ximian.com>
11416
11417         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11418         consistent with other methods.
11419
11420 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11421
11422         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11423
11424 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11425
11426         * attribute.cs: only set GuidAttr to true when we have a
11427         GuidAttribute.
11428
11429 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11430
11431         * ecore.cs:
11432         * expression.cs:
11433         * typemanager.cs: fixes to allow mcs compile corlib with the new
11434         Type.IsSubclassOf fix.
11435
11436 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11437
11438         * expression.cs (LocalVariableReference.DoResolve): Classify a
11439         constant as a value, not as a variable.   Also, set the type for
11440         the variable.
11441
11442         * cs-parser.jay (fixed_statement): take a type instead of a
11443         pointer_type, so we can produce a better error message later.
11444
11445         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11446         as an error.  
11447
11448         (For.DoEmit): Make inifinite loops have a
11449         non-conditional branch back.
11450
11451         (Fixed.DoEmit): First populate the pinned variables, then emit the
11452         statement, then clear the variables.  Before I was emitting the
11453         code once for each fixed piece.
11454
11455
11456 2003-01-08  Martin Baulig  <martin@ximian.com>
11457
11458         * statement.cs (FlowBranching.MergeChild): A break in a
11459         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11460
11461 2003-01-08  Martin Baulig  <martin@ximian.com>
11462
11463         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11464         lives in the same number space than `param_map'.  Fixes #36154.
11465
11466 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11467
11468         * cs-parser.jay (constructor_declaration): Set the
11469         Constructor.ModFlags before probing for it.  This makes the
11470         compiler report 514, 515 and 132 (the code was there, but got
11471         broken). 
11472
11473         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11474         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11475         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11476
11477 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11478
11479         * enum.cs: create the enum static fields using the enum type.
11480
11481 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11482
11483         * class.cs: don't try to create the ParamBuilder for the return
11484         type if it's not needed (and handle it breaking for the ms runtime
11485         anyway).
11486
11487 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11488
11489         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11490
11491 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11492
11493         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11494         the command.   This showed up while compiling the JANET source
11495         code, which used \r as its only newline separator.
11496
11497 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11498
11499         * class.cs (Method.Define): If we are an operator (because it
11500         reuses our code), then set the SpecialName and HideBySig.  #36128
11501
11502 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11505         exception, report error 120 `object reference required'.
11506
11507         * driver.cs: Add --pause option, used during to measure the size
11508         of the process as it goes with --timestamp.
11509
11510         * expression.cs (Invocation.DoResolve): Do not allow methods with
11511         SpecialName to be invoked.
11512
11513 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11514
11515         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11516         number before adding it.
11517
11518 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11519
11520         * ecore.cs (StandardImplicitConversion): When in an unsafe
11521         context, we allow conversion between void * to any other pointer
11522         type. This fixes bug #35973.
11523
11524 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11525
11526         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11527         is not thrown when extensionless outputs are used 
11528
11529 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11530
11531         * rootcontext.cs: fixed compilation of corlib.
11532
11533 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11534
11535         * attribute.cs (Attributes.Contains): Add new method.
11536
11537         * class.cs (MethodCore.LabelParameters): if the parameter is an
11538         `out' parameter, check that no attribute `[In]' has been passed.
11539
11540         * enum.cs: Handle the `value__' name in an enumeration.
11541
11542 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11543
11544         * decl.cs: Added special case to allow overrides on "protected
11545         internal" methods
11546
11547 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11548
11549         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11550         since it makes much more sense.
11551
11552         (Attributes.ctor): Don't require a Location parameter.
11553
11554         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11555
11556         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11557         since we already have that information per attribute.
11558
11559         * everywhere : make appropriate changes.
11560
11561         * class.cs (LabelParameters): Write the code which actually
11562         applies attributes to the return type. We can't do this on the MS
11563         .NET runtime so we flag a warning in the case an exception is
11564         thrown.
11565
11566 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11567
11568         * const.cs: Handle implicit null conversions here too.
11569
11570 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11571
11572         * class.cs (MethodCore.LabelParameters): Remove the extra
11573         Type [] parameter since it is completely unnecessary. Instead
11574         pass in the method's attributes so that we can extract
11575         the "return" attribute.
11576
11577 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11578
11579         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11580         of ignoring it and letting the compile continue.
11581
11582         * typemanager.cs (ChangeType): use an extra argument to return an
11583         error condition instead of throwing an exception.
11584
11585 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11586
11587         * expression.cs (Unary.TryReduce): mimic the code for the regular
11588         code path.  Perform an implicit cast in the cases where we can
11589         implicitly convert to one of the integral types, and then reduce
11590         based on that constant.   This fixes bug #35483.
11591
11592 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11593
11594         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11595
11596 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11597
11598         * namespace.cs: fixed bug #35489.
11599
11600 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11601
11602         * class.cs: Remove some dead code.
11603
11604         * cs-parser.jay: Estimate the number of methods needed
11605         (RootContext.MethodCount);
11606
11607         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11608         numbers instead of StringBuilders.
11609
11610         * support.cs (PtrHashtable): Add constructor with initial size;
11611         We can now reduce reallocations of the method table.
11612
11613 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11614
11615         * attribute.cs (ApplyAttributes): Keep track of the emitted
11616         attributes on a per-target basis. This fixes bug #35413.
11617
11618 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11619
11620         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11621         default to the Windows 1252 encoding.
11622
11623         (UnixParseOption): Support version, thanks to Alp for the missing
11624         pointer. 
11625
11626         * AssemblyInfo.cs: Add nice assembly information.
11627
11628         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11629         (bug 35169).
11630
11631         * cs-parser.jay: Allow a trailing comma before the close bracked
11632         in the attribute_section production.
11633
11634         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11635         address of the instance was being taken, I will take this out,
11636         because we take the address of the object immediately here.
11637
11638 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11639
11640         * typemanager.cs (AreMultipleAllowed): Take care of the most
11641         obvious case where attribute type is not in the current assembly -
11642         stupid me ;-)
11643
11644 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11647         definitions, instead of doing that afterwards.  
11648
11649         Also we use a nice little hack, depending on the constructor, we
11650         know if we are a "composed" name or a simple name.  Hence, we
11651         avoid the IndexOf test, and we avoid 
11652
11653         * codegen.cs: Add code to assist in a bug reporter to track down
11654         the source of a compiler crash. 
11655
11656 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11657
11658         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11659         types have been emitted for a given element and flag an error
11660         if something which does not have AllowMultiple set is used more
11661         than once.
11662
11663         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11664         attribute types and their corresponding AllowMultiple properties
11665
11666         (AreMultipleAllowed): Check the property for a given type.
11667
11668         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11669         property in the case we have a TypeContainer.
11670
11671         (Attributes.AddAttribute): Detect duplicates and just skip on
11672         adding them. This trivial fix catches a pretty gross error in our
11673         attribute emission - global attributes were being emitted twice!
11674
11675         Bugzilla bug #33187 is now fixed.
11676
11677 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11680         instead of pp_and).
11681
11682         * expression.cs (Binary.ResolveOperator): I can only use the
11683         Concat (string, string, string) and Concat (string, string,
11684         string, string) if the child is actually a concatenation of
11685         strings. 
11686
11687 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11688
11689         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11690         context where we need a 2-character lookahead.
11691
11692         * pending.cs (PendingImplementation): Rework so we can keep track
11693         of interface types all the time, and flag those which were
11694         implemented by parents as optional.
11695
11696 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11697
11698         * expression.cs (Binary.ResolveOperator): Use
11699         String.Concat(string,string,string) or
11700         String.Concat(string,string,string,string) when possible. 
11701
11702         * typemanager: More helper methods.
11703
11704
11705 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11706
11707         * pending.cs: remove the bogus return from GetMissingInterfaces()
11708         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11709
11710 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11711
11712         * namespace.cs: avoid duplicated 'using xxx' being added to
11713         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11714         when we get more than one 'using' statement for the same namespace.
11715         Report a CS0105 warning for it.
11716
11717 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11718
11719         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11720         of calling getChar/putback, uses internal knowledge of it.    
11721
11722         (xtoken): Reorder tokenizer so most common patterns are checked
11723         first.  This reduces the compilation time in another 5% (from 8.11s
11724         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11725
11726         The parsing time is 22% of the compilation in mcs, and from that
11727         64% is spent on the tokenization process.  
11728
11729         I tried using a binary search for keywords, but this is slower
11730         than the hashtable.  Another option would be to do a couple of
11731         things:
11732
11733                 * Not use a StringBuilder, instead use an array of chars,
11734                   with a set value.  Notice that this way we could catch
11735                   the 645 error without having to do it *afterwards*.
11736
11737                 * We could write a hand-parser to avoid the hashtable
11738                   compares altogether.
11739
11740         The identifier consumption process takes 37% of the tokenization
11741         time.  Another 15% is spent on is_number.  56% of the time spent
11742         on is_number is spent on Int64.Parse:
11743
11744                 * We could probably choose based on the string length to
11745                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11746                   computations. 
11747
11748         Another 3% is spend on wrapping `xtoken' in the `token' function.
11749
11750         Handle 0xa0 as whitespace (#34752)
11751
11752 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * typemanager.cs (IsCLRType): New routine to tell whether a type
11755         is one of the builtin types.  
11756
11757         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11758         typecode in more places instead of doing pointer comparissions.
11759         We could leverage some knowledge about the way the typecodes are
11760         laid out.
11761
11762         New code to cache namespaces in assemblies, it is currently not
11763         invoked, to be used soon.
11764
11765         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11766
11767         * expression.cs (Binary.ResolveOperator): specially handle
11768         strings, and do not perform user-defined operator overloading for
11769         built-in types.
11770
11771 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11772
11773         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11774         internalcall as it is a pretty simple operation;  Avoid whenever
11775         possible to call Char.IsLetter.
11776
11777         (consume_identifier): Cut by half the number of
11778         hashtable calls by merging the is_keyword and GetKeyword behavior.
11779
11780         Do not short-circuit, because if we do, we
11781         report errors (ie, #if false && true would produce an invalid
11782         directive error);
11783
11784
11785 2002-11-24  Martin Baulig  <martin@ximian.com>
11786
11787         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11788         check constant ranges and report a CS0221.  Fixes #33186.
11789
11790 2002-11-24  Martin Baulig  <martin@ximian.com>
11791
11792         * cs-parser.jay: Make this work for uninitialized variable
11793         declarations in the `for' initializer.  Fixes #32416.
11794
11795 2002-11-24  Martin Baulig  <martin@ximian.com>
11796
11797         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11798         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11799
11800 2002-11-24  Martin Baulig  <martin@ximian.com>
11801
11802         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11803         argument; if true, we also check for user-defined conversions.
11804         This is only needed if both arguments are of a user-defined type.
11805         Fixes #30443, added test-175.cs.
11806         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11807
11808         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11809
11810 2002-11-24  Martin Baulig  <martin@ximian.com>
11811
11812         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11813         function to get the store opcode.
11814         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11815         only emit the Ldelema if the store opcode is Stobj.  You must run
11816         both test-34 and test-167 to test this.  Fixes #34529.
11817
11818 2002-11-23  Martin Baulig  <martin@ximian.com>
11819
11820         * ecore.cs (Expression.MemberLookup): Added additional
11821         `qualifier_type' argument which is used when we're being called
11822         from MemberAccess.DoResolve() and null if we're called from a
11823         SimpleName lookup.
11824         (Expression.MemberLookupFailed): New method to report errors; this
11825         does the CS1540 check and reports the correct error message.
11826
11827         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11828         argument for the CS1540 check and redone the way how we're dealing
11829         with private members.  See the comment in the source code for details.
11830         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11831         `closure_start_type' to `closure_qualifier_type' and check whether
11832         it's not null.  It was not this filter being broken, it was just
11833         being called with the wrong arguments.
11834
11835         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11836         and pass it the correct `qualifier_type'; this also does the error
11837         handling for us.
11838
11839 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11840
11841         * expression.cs (Invocation.EmitParams): If the we are dealing
11842         with a non-built-in value type, load its address as well.
11843
11844         (ArrayCreation): Use a a pretty constant instead
11845         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11846         static initializers.  
11847
11848         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11849         because they are not really value types, just glorified integers. 
11850
11851         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11852
11853         * ecore.cs: Remove redundant code for enumerations, make them use
11854         the same code path as everything else, fixes the casting issue
11855         with enumerations in Windows.Forms.
11856
11857         * attribute.cs: Do only cast to string if it is a string, the
11858         validation happens later.
11859
11860         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11861         people upgrade their corlibs.
11862
11863         * ecore.cs: Oops, enumerations were not following the entire code path
11864
11865 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11866
11867         * typemanager.cs (FilterWithClosure): Commented out the test for
11868         1540 in typemanager.cs, as it has problems when accessing
11869         protected methods from a parent class (see test-174.cs). 
11870
11871         * attribute.cs (Attribute.ValidateGuid): new method.
11872         (Attribute.Resolve): Use above.
11873
11874 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11875
11876         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11877
11878         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11879         handling for enumerations, as we only needed the TypeContainer
11880         functionality to begin with (this is required for the fix below to
11881         work for enums that reference constants in a container class for
11882         example). 
11883
11884         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11885
11886         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11887         a valid TypeBuilder to perform lookups on.o
11888
11889         * class.cs (InheritableMemberSignatureCompare): Use true in the
11890         call to GetGetMethod and GetSetMethod, because we are comparing
11891         the signature, and we need to get the methods *even* if they are
11892         private. 
11893
11894         (PropertyBase.CheckBase): ditto.
11895
11896         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11897         GotoCase.Resolve): Use Peel on EmpytCasts.
11898
11899         * ecore.cs (EmptyCast): drop child, add Peel method.
11900
11901 2002-11-17  Martin Baulig  <martin@ximian.com>
11902
11903         * ecore.cs (EmptyCast.Child): New public property.
11904
11905         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11906         label resolved to an EmptyCast.  Fixes #34162.
11907         (GotoCase.Resolve): Likewise.
11908         (Block.EmitMeta): Likewise.
11909
11910 2002-11-17  Martin Baulig  <martin@ximian.com>
11911
11912         * expression.cs (Invocation.BetterConversion): Prefer int over
11913         uint; short over ushort; long over ulong for integer literals.
11914         Use ImplicitConversionExists instead of StandardConversionExists
11915         since we also need to check for user-defined implicit conversions.
11916         Fixes #34165.  Added test-173.cs.
11917
11918 2002-11-16  Martin Baulig  <martin@ximian.com>
11919
11920         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11921         with the `true' and `false' literals.  Fixes #33151.
11922
11923 2002-11-16  Martin Baulig  <martin@ximian.com>
11924
11925         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11926         October 22nd; don't do the cs1540 check for static members.
11927
11928         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11929         now using our own filter here and doing the cs1540 check again.
11930
11931 2002-11-16  Martin Baulig  <martin@ximian.com>
11932
11933         * support.cs (InternalParameters): Don't crash if we don't have
11934         any fixed parameters.  Fixes #33532.
11935
11936 2002-11-16  Martin Baulig  <martin@ximian.com>
11937
11938         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11939         when looking up static methods to make this work on Windows.
11940         Fixes #33773.
11941
11942 2002-11-16  Martin Baulig  <martin@ximian.com>
11943
11944         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11945         a setter rather than using PropertyInfo.CanWrite.
11946
11947 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11948
11949         * class.cs: Allow acces to block member by subclasses. Fixes build
11950         breaker.
11951
11952 2002-11-14  Martin Baulig  <martin@ximian.com>
11953
11954         * class.cs (Constructor.Emit): Added the extern/block check.
11955         Fixes bug #33678.
11956
11957 2002-11-14  Martin Baulig  <martin@ximian.com>
11958
11959         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11960         iteration while looking for indexers, this is needed because the
11961         indexer may have a different name in our base classes.  Fixed the
11962         error reporting (no indexers at all, not get accessor, no
11963         overloaded match).  Fixes bug #33089.
11964         (IndexerAccess.DoResolveLValue): Likewise.
11965
11966 2002-11-14  Martin Baulig  <martin@ximian.com>
11967
11968         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11969         indexers.  Fixes the first part of bug #33089.
11970         (MethodSignature.InheritableMemberSignatureCompare): Added support
11971         for properties.
11972
11973 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11974
11975         * attribute.cs (Attribute.Resolve): Catch the
11976         NullReferenceException and report it since it isn't supposed to
11977         happen. 
11978
11979 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11980
11981         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11982         LogicalOr and LogicalAnd that can benefit from recursively
11983         handling EmitBranchable.  The code now should be nice for Paolo.
11984
11985 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11986
11987         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11988         the Type lookups, as we perform quite a number of lookups on
11989         non-Types.  This can be removed once we can deterministically tell
11990         whether we have a type or a namespace in advance.
11991
11992         But this might require special hacks from our corlib.
11993
11994         * TODO: updated.
11995
11996         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11997         and double which avoids a conversion from an integer to a double.
11998
11999         * expression.cs: tiny optimization, avoid calling IsConstant,
12000         because it effectively performs the lookup twice.
12001
12002 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12003
12004         But a bogus return here to keep the semantics of the old code
12005         until the Mono runtime is fixed.
12006
12007         * pending.cs (GetMissingInterfaces): New method used to remove all
12008         the interfaces that are already implemented by our parent
12009         classes from the list of pending methods. 
12010
12011         * interface.cs: Add checks for calls after ResolveTypeExpr.
12012
12013 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12014
12015         * class.cs (Class.Emit): Report warning 67: event not used if the
12016         warning level is beyond 3.
12017
12018         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12019         being a NullLiteral.
12020
12021         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12022         specifiers. 
12023
12024         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12025         path that might fail if a type can not be resolved.
12026
12027         * expression.cs (Binary.Emit): Emit unsigned versions of the
12028         operators. 
12029
12030         * driver.cs: use error 5.
12031
12032 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12033
12034         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12035
12036 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12037
12038         * cs-parser.jay (switch_section): A beautiful patch from Martin
12039         Baulig that fixed 33094.
12040
12041 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12044         Check whether the base is abstract and report an error if so.
12045
12046         * expression.cs (IndexerAccess.DoResolveLValue,
12047         IndexerAccess.DoResolve): ditto. 
12048
12049         (Invocation.DoResolve): ditto.
12050
12051         (Invocation.FullMethodDesc): Improve the report string.
12052
12053         * statement.cs (Block): Eliminate IsVariableDefined as it is
12054         basically just a wrapper for GetVariableInfo.
12055
12056         * ecore.cs (SimpleName): Use new 
12057
12058         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12059         type, as we return the actual parameter ref/unref state on a
12060         different call.
12061
12062 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12063
12064         * support.cs: Return proper flags REF/OUT fixing the previous
12065         commit.  
12066
12067         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12068         not used to mean `ref' but `ref or out' in ParameterReference
12069
12070         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12071         full type signature instead of calling TypeManger.CSharpName
12072         ourselves. 
12073
12074         * support.cs (InternalParameters.ParameterDesc): Do not compare
12075         directly to the modflags, because REF/OUT will actually be bitsets
12076         if set. 
12077
12078         * delegate.cs (VerifyMethod): Check also the modifiers.
12079
12080         * cs-tokenizer.cs: Fix bug where floating point values with an
12081         exponent where a sign was missing was ignored.
12082
12083         * driver.cs: Allow multiple assemblies to be specified in a single
12084         /r: argument
12085
12086 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12087
12088         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12089         because identifiers after a parenthesis would end up in this kind
12090         of production, and we needed to desamiguate it for having casts
12091         like:
12092
12093                 (UserDefinedType *) xxx
12094
12095 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12096
12097         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12098         we should set on the Bindingflags.NonPublic, but not turn on
12099         private_ok.  private_ok controls whether a Private member is
12100         returned (this is chekced on the filter routine), while the
12101         BindingFlags.NonPublic just controls whether private/protected
12102         will be allowed.   This fixes the problem part of the problem of
12103         private properties being allowed to be used in derived classes.
12104
12105         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12106         so we can call the children DoResolveLValue method (this will
12107         properly signal errors on lvalue assignments to base properties)
12108
12109         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12110         getter are null, and we have a property info, we know that this
12111         happened because the lookup failed, so we report an error 122 for
12112         protection level violation.
12113
12114         We also silently return if setter and getter are null in the
12115         resolve functions, this condition only happens if we have flagged
12116         the error before.  This is the other half of the problem. 
12117
12118         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12119         not have accessibility information, that is why we were returning
12120         true in the filter function in typemanager.cs.
12121
12122         To properly report 122 (property is inaccessible because of its
12123         protection level) correctly, we report this error in ResolveAccess
12124         by failing if both the setter and the getter are lacking (ie, the
12125         lookup failed). 
12126
12127         DoResolve and DoLResolve have been modified to check for both
12128         setter/getter being null and returning silently, the reason being
12129         that I did not want to put the knowledge about this error in upper
12130         layers, like:
12131
12132         int old = Report.Errors;
12133         x = new PropertyExpr (...);
12134         if (old != Report.Errors)
12135                 return null;
12136         else
12137                 return x;
12138
12139         So the property expr is returned, but it is invalid, so the error
12140         will be flagged during the resolve process. 
12141
12142         * class.cs: Remove InheritablePropertySignatureCompare from the
12143         class, as we no longer depend on the property signature to compute
12144         whether it is possible to implement a method or not.
12145
12146         The reason is that calling PropertyInfo.GetGetMethod will return
12147         null (in .NET, in Mono it works, and we should change this), in
12148         cases where the Get Method does not exist in that particular
12149         class.
12150
12151         So this code:
12152
12153         class X { public virtual int A { get { return 1; } } }
12154         class Y : X { }
12155         class Z : Y { public override int A { get { return 2; } } }
12156
12157         Would fail in Z because the parent (Y) would not have the property
12158         defined.  So we avoid this completely now (because the alternative
12159         fix was ugly and slow), and we now depend exclusively on the
12160         method names.
12161
12162         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12163         reference method, instead of using the property.
12164
12165         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12166         routines are gone now.
12167
12168         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12169         names, they were incorrectly named.
12170
12171         * cs-tokenizer.cs: Return are more gentle token on failure. 
12172
12173         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12174         had an out-of-sync index variable, which caused it to remove from
12175         the list of pending methods the wrong method sometimes.
12176
12177 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12178
12179         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12180         CanWrite, because those refer to this particular instance of the
12181         property, and do not take into account the fact that we can
12182         override single members of a property.
12183
12184         Constructor requires an EmitContext.  The resolution process does
12185         not happen here, but we need to compute the accessors before,
12186         because the resolution does not always happen for properties.
12187
12188         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12189         subclass, before we did not update this flag, but we did update
12190         bindingflags. 
12191
12192         (GetAccessors): Drop this routine, as it did not work in the
12193         presence of partially overwritten set/get methods. 
12194
12195         Notice that this broke the cs1540 detection, but that will require
12196         more thinking. 
12197
12198 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12199
12200         * class.cs:
12201         * codegen.cs:
12202         * driver.cs: issue a warning instead of an error if we don't support
12203         debugging for the platform. Also ignore a couple of errors that may
12204         arise when trying to write the symbols. Undo my previous patch.
12205
12206 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12207
12208         * driver.cs: ignore /debug switch except for Unix platforms.
12209
12210 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12211
12212         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12213
12214 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12215
12216         * driver.cs: Do not make mcs-debug conditional, so we do not break
12217         builds that use it.
12218
12219         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12220         review this patch.  But basically after all the children variables
12221         have been merged, the value of "Breaks" was not being set to
12222         new_breaks for Switch blocks.  I think that it should be set after
12223         it has executed.  Currently I set this to the value of new_breaks,
12224         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12225         conservative, but I do not understand this code very well.
12226
12227         I did not break anything in the build, so that is good ;-)
12228
12229         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12230
12231 2002-10-20  Mark Crichton  <crichton@gimp.org>
12232
12233         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12234
12235 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12236
12237         * cfold.cs: Fixed compile blocker.
12238
12239 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * driver.cs: I was chekcing the key, not the file.
12242
12243 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12244
12245         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12246         message that we were generating - we just need to silently return
12247         a null.
12248
12249 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12250
12251         * class.cs (Event.Define): Change my previous commit, as this
12252         breaks the debugger.  This is a temporary hack, as it seems like
12253         the compiler is generating events incorrectly to begin with.
12254
12255         * expression.cs (Binary.ResolveOperator): Added support for 
12256         "U operator - (E x, E y)"
12257
12258         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12259         y)".
12260
12261         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12262         init-only variables, but this path did not take into account that
12263         there might be also instance readonly variables.  Correct this
12264         problem. 
12265
12266         This fixes bug 32253
12267
12268         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12269         delegates as well.
12270
12271         * driver.cs: Change the extension for modules to `netmodule'
12272
12273         * cs-parser.jay: Improved slightly the location tracking for
12274         the debugger symbols.
12275
12276         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12277         modifiers that were specified instead of the hardcoded value
12278         (FamAndAssem).  This was basically ignoring the static modifier,
12279         and others.  Fixes 32429.
12280
12281         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12282         fixed a bug in the process (32476)
12283
12284         * expression.cs (ArrayAccess.EmitAssign): Patch from
12285         hwang_rob@yahoo.ca that fixes bug 31834.3
12286
12287 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12288
12289         * driver.cs: Make the module extension .netmodule.
12290
12291 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12292
12293         * driver.cs: Report an error if the resource file is not found
12294         instead of crashing.
12295
12296         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12297         false, like Emit does.
12298
12299 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12300
12301         * typemanager.cs: Remove unused private member.  Also reported mcs
12302         bug to report this as a warning like csc.
12303
12304 2002-10-15  Martin Baulig  <martin@gnome.org>
12305
12306         * statement.cs (Statement.Emit): Made this a virtual method; emits
12307         the line number info and calls DoEmit().
12308         (Statement.DoEmit): New protected abstract method, formerly knows
12309         as Statement.Emit().
12310
12311         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12312
12313 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12314
12315         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12316         have fixed a remaining problem: not every AddXXXX was adding a
12317         fully qualified name.  
12318
12319         Now everyone registers a fully qualified name in the DeclSpace as
12320         being defined instead of the partial name.  
12321
12322         Downsides: we are slower than we need to be due to the excess
12323         copies and the names being registered this way.  
12324
12325         The reason for this is that we currently depend (on the corlib
12326         bootstrap for instance) that types are fully qualified, because
12327         we dump all the types in the namespace, and we should really have
12328         types inserted into the proper namespace, so we can only store the
12329         basenames in the defined_names array.
12330
12331 2002-10-10  Martin Baulig  <martin@gnome.org>
12332
12333         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12334         from bug #31834, see the bug report for a testcase which is
12335         miscompiled.
12336
12337 2002-10-10  Martin Baulig  <martin@gnome.org>
12338
12339         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12340         flow analysis code for this.
12341
12342         * statement.cs (Do, While, For): Tell the flow analysis code about
12343         infinite loops.
12344         (FlowBranching.UsageVector): Added support for infinite loops.
12345         (Block.Resolve): Moved the dead code elimination here and use flow
12346         analysis to do it.
12347
12348 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12349
12350         * class.cs (Field.Define): Catch cycles on struct type
12351         definitions. 
12352
12353         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12354         fields if the fields are static.  We only need to check instance
12355         fields. 
12356
12357         * expression.cs (As.DoResolve): Test for reference type.
12358
12359         * statement.cs (Using.ResolveExpression): Use
12360         ConvertImplicitRequired, not ConvertImplicit which reports an
12361         error on failture
12362         (Using.ResolveLocalVariableDecls): ditto.
12363
12364         * expression.cs (Binary.ResolveOperator): Report errors in a few
12365         places where we had to.
12366
12367         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12368
12369 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12370
12371         * expression.cs: Use StoreFromPtr instead of extracting the type
12372         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12373
12374         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12375         an enumeration value to a System.Enum, but System.Enum is not a
12376         value type, but an class type, so we need to box.
12377
12378         (Expression.ConvertExplicit): One codepath could return
12379         errors but not flag them.  Fix this.  Fixes #31853
12380
12381         * parameter.cs (Resolve): Do not allow void as a parameter type.
12382
12383 2002-10-06  Martin Baulig  <martin@gnome.org>
12384
12385         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12386         if it's a class type and not a struct.  Fixes #31815.
12387
12388 2002-10-06  Martin Baulig  <martin@gnome.org>
12389
12390         * statement.cs: Reworked the flow analysis code a bit to make it
12391         usable for dead code elimination.
12392
12393 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12394
12395         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12396
12397 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12398
12399         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12400         to fix the test 165, will investigate deeper.
12401
12402 2002-10-04  Martin Baulig  <martin@gnome.org>
12403
12404         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12405         finally blocks actually work.
12406         (Try.Resolve): We don't need to create a sibling for `finally' if
12407         there is no finally block.
12408
12409 2002-10-04  Martin Baulig  <martin@gnome.org>
12410
12411         * class.cs (Constructor.Define): The default accessibility for a
12412         non-default constructor is private, not public.
12413
12414 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12415
12416         * class.cs (Constructor): Make AllowedModifiers public, add
12417         EXTERN.
12418
12419         * cs-parser.jay: Perform the modifiers test here, as the
12420         constructor for the Constructor class usually receives a zero
12421         because of the way we create it (first we create, later we
12422         customize, and we were never checking the modifiers).
12423
12424         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12425         is a version of LookupTypeReflection that includes the type-name
12426         cache.  This can be used as a fast path for functions that know
12427         the fully qualified name and are only calling into *.GetType() to
12428         obtain a composed type.
12429
12430         This is also used by TypeManager.LookupType during its type
12431         composition.
12432
12433         (LookupType): We now also track the real type name, as sometimes
12434         we can get a quey for the real type name from things like
12435         ComposedCast.  This fixes bug 31422.
12436
12437         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12438         complete type fullname, it does not have to go through the type
12439         resolution system to obtain the composed version of the type (for
12440         obtaining arrays or pointers).
12441
12442         (Conditional.Emit): Use the EmitBoolExpression to
12443         generate nicer code, as requested by Paolo.
12444
12445         (ArrayCreation.CheckIndices): Use the patch from
12446         hwang_rob@yahoo.ca to validate the array initializers. 
12447
12448 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12449
12450         * class.cs (ConstructorInitializer.Emit): simplify code by using
12451         Invocation.EmitCall, and at the same time, fix the bugs in calling
12452         parent constructors that took variable arguments. 
12453
12454         * ecore.cs (Expression.ConvertNumericExplicit,
12455         Expression.ImplicitNumericConversion): Remove the code that
12456         manually wrapped decimal (InternalTypeConstructor call is now gone
12457         as well).
12458
12459         * expression.cs (Cast.TryReduce): Also handle decimal types when
12460         trying to perform a constant fold on the type.
12461
12462         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12463
12464         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12465         that only turned off an error report, and did nothing else. 
12466
12467 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12468
12469         * driver.cs: Handle and ignore /fullpaths
12470
12471 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * expression.cs (Binary.ResolveOperator): Catch the case where
12474         DoNumericPromotions returns true, 
12475
12476         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12477
12478 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12479
12480         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12481         report error 70.
12482
12483 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12484
12485         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12486         conversion exists, but it is also required that the conversion be
12487         performed.  This manifested in "(Type64Enum) 2".  
12488
12489         * class.cs (TypeManager.AddMethod): The fix is not to change
12490         AddEnum, because that one was using a fully qualified name (every
12491         DeclSpace derivative does), but to change the AddMethod routine
12492         that was using an un-namespaced name.  This now correctly reports
12493         the duplicated name.
12494
12495         Revert patch until I can properly fix it.  The issue
12496         is that we have a shared Type space across all namespaces
12497         currently, which is wrong.
12498
12499         Options include making the Namespace a DeclSpace, and merge
12500         current_namespace/current_container in the parser.
12501
12502 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12503
12504         * cs-parser.jay: Improve error reporting when we get a different
12505         kind of expression in local_variable_type and
12506         local_variable_pointer_type. 
12507
12508         Propagate this to avoid missleading errors being reported.
12509
12510         * ecore.cs (ImplicitReferenceConversion): treat
12511         TypeManager.value_type as a target just like object_type.   As
12512         code like this:
12513
12514         ValueType v = 1;
12515
12516         Is valid, and needs to result in the int 1 being boxed before it
12517         is assigned to the value type v.
12518
12519         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12520         to validate the enumeration name.
12521
12522         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12523         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12524         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12525
12526         * ecore.cs (TryImplicitIntConversion): When doing an
12527         implicit-enumeration-conversion, check if the type is 64-bits and
12528         perform a conversion before passing to EnumConstant.
12529
12530 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12531
12532         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12533         report ambiguous type references.  Unlike the MS version, we
12534         report what the ambiguity is.   Innovation at work ;-)
12535
12536         (DeclSpace.FindType): Require a location argument to
12537         display when we display an ambiguous error.
12538
12539         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12540
12541         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12542
12543         * expression.cs (EmitDynamicInitializers): Apply patch from
12544         hwang_rob@yahoo.ca that fixes the order in which we emit our
12545         initializers. 
12546
12547 2002-09-21  Martin Baulig  <martin@gnome.org>
12548
12549         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12550         delegate takes no arguments.
12551
12552 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12553
12554         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12555         from integers.
12556
12557         * expression.cs: Extract the underlying type.
12558
12559         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12560
12561         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12562
12563 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12564
12565         * class.cs (TypeContainer.DefineType): We can not use the nice
12566         PackingSize with the size set to 1 DefineType method, because it
12567         will not allow us to define the interfaces that the struct
12568         implements.
12569
12570         This completes the fixing of bug 27287
12571
12572         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12573         means also structs.  This fixes part of the problem. 
12574         (Expresion.ImplicitReferenceConversionExists): ditto.
12575
12576         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12577         error if there were no errors reported during the type lookup
12578         process, to avoid duplicates or redundant errors.  Without this
12579         you would get an ambiguous errors plus a type not found.  We have
12580         beaten the user enough with the first error.  
12581
12582         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12583         reference. 
12584
12585         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12586         during the resolution process, stop the lookup, this avoids
12587         repeated error reports (same error twice).
12588
12589         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12590
12591         * typemanager.cs (LookupType): Redo the type lookup code to match
12592         the needs of System.Reflection.  
12593
12594         The issue is that System.Reflection requires references to nested
12595         types to begin with a "+" sign instead of a dot.  So toplevel
12596         types look like: "NameSpace.TopLevelClass", and nested ones look
12597         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12598         levels. 
12599
12600 2002-09-19  Martin Baulig  <martin@gnome.org>
12601
12602         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12603         says that a method always returns or always throws an exception,
12604         don't report the CS0161.
12605
12606         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12607         set `Returns = new_returns'.
12608
12609 2002-09-19  Martin Baulig  <martin@gnome.org>
12610
12611         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12612         to an enum constant, check for a CS0176.
12613
12614 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12615
12616         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12617         for operators that must be in pairs and report errors.
12618
12619         * ecore.cs (SimpleName.DoResolveType): During the initial type
12620         resolution process, when we define types recursively, we must
12621         check first for types in our current scope before we perform
12622         lookups in the enclosing scopes.
12623
12624         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12625
12626         (Invocation.VerifyArgumentsCompat): Call
12627         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12628         I thought we were supposed to always call this, but there are a
12629         few places in the code where we dont do it.
12630
12631 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * driver.cs: Add support in -linkres and -resource to specify the
12634         name of the identifier.
12635
12636 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12637
12638         * ecore.cs (StandardConversionExists): Sync with the conversion
12639         code: allow anything-* to void* conversions.
12640
12641         (FindMostSpecificSource): Use an Expression argument
12642         instead of a Type, because we might be handed over a Literal which
12643         gets a few more implicit conversions that plain types do not.  So
12644         this information was being lost.
12645
12646         Also, we drop the temporary type-holder expression when not
12647         required.
12648
12649 2002-09-17  Martin Baulig  <martin@gnome.org>
12650
12651         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12652         this is an explicit interface implementation.
12653
12654 2002-09-17  Martin Baulig  <martin@gnome.org>
12655
12656         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12657         different `IndexerName' attributes.
12658
12659         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12660         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12661         virtual CommonResolve().
12662
12663 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12664
12665         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12666         and convert that to the UnderlyingType.
12667
12668         * statement.cs (Foreach.Resolve): Indexers are just like variables
12669         or PropertyAccesses.
12670
12671         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12672         inside quoted strings, we were not doing this before.
12673
12674 2002-09-16  Martin Baulig  <martin@gnome.org>
12675
12676         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12677         resolve it.  This is needed for the definite assignment check of the
12678         instance expression, fixes bug #29846.
12679         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12680
12681 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12682
12683         * parameter.cs: Fix compile error.  Cannot reference static member
12684         from an instance object.  Is this an mcs bug?
12685
12686 2002-09-14  Martin Baulig  <martin@gnome.org>
12687
12688         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12689         multiple times.  Fixes bug #30295, added test-166.cs.
12690
12691 2002-09-14  Martin Baulig  <martin@gnome.org>
12692
12693         * statement.cs (Block.Emit): Don't emit unreachable code.
12694         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12695         `break' statements.
12696         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12697
12698 2002-09-14  Martin Baulig  <martin@gnome.org>
12699
12700         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12701         is set.
12702
12703 2002-09-14  Martin Baulig  <martin@gnome.org>
12704
12705         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12706         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12707         be false on the ms runtime.
12708
12709 2002-09-13  Martin Baulig  <martin@gnome.org>
12710
12711         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12712         the CS0038 error message.
12713
12714 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12715
12716         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12717         constant inside, return it.
12718
12719 2002-09-12  Martin Baulig  <martin@gnome.org>
12720
12721         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12722         implicit conversion can be done between enum types.
12723
12724         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12725         check whether an implicit conversion to the current enum's UnderlyingType
12726         exists and report an error if not.
12727
12728         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12729         without debugging support.
12730
12731         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12732         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12733
12734 2002-09-12  Martin Baulig  <martin@gnome.org>
12735
12736         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12737
12738         * ecore.cs (IMemberExpr.DeclaringType): New property.
12739         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12740         nonstatic member of an outer type (CS0038).
12741
12742 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12743
12744         * driver.cs: Activate the using-error detector at warning level
12745         4 (at least for MS-compatible APIs).
12746
12747         * namespace.cs (VerifyUsing): Small buglett fix.
12748
12749         * pending.cs (PendingImplementation): pass the container pointer. 
12750
12751         * interface.cs (GetMethods): Allow for recursive definition.  Long
12752         term, I would like to move every type to support recursive
12753         definitions, not the current ordering mechanism that we have right
12754         now.
12755
12756         The situation is this: Attributes are handled before interfaces,
12757         so we can apply attributes to interfaces.  But some attributes
12758         implement interfaces, we will now handle the simple cases
12759         (recursive definitions will just get an error).  
12760
12761         * parameter.cs: Only invalidate types at the end if we fail to
12762         lookup all types.  
12763
12764 2002-09-09  Martin Baulig  <martin@gnome.org>
12765
12766         * ecore.cs (PropertyExpr.Emit): Also check for
12767         TypeManager.system_int_array_get_length so this'll also work when
12768         compiling corlib.  Fixes #30003.
12769
12770 2002-09-09  Martin Baulig  <martin@gnome.org>
12771
12772         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12773         and throw an exception if we can't get the type's size.  Fixed #30040,
12774         added test-165.cs.
12775
12776 2002-09-09  Martin Baulig  <martin@gnome.org>
12777
12778         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12779
12780         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12781         context.  Fixes bug #30027.
12782
12783         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12784         virtual functions.  Fixes bug #30043, added test-164.cs.
12785
12786 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12787
12788         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12789
12790 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12791
12792         * driver.cs: Use an object to get the windows codepage since it's not a
12793         static property.
12794
12795 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12796
12797         * statement.cs (For.Emit): for infinite loops (test == null)
12798         return whether there is a break inside, not always "true".
12799
12800         * namespace.cs (UsingEntry): New struct to hold the name of the
12801         using definition, the location where it is defined, and whether it
12802         has been used in a successful type lookup.
12803
12804         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12805         strings.
12806
12807         * decl.cs: ditto.
12808
12809 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12810
12811         * attribute.cs : Fix incorrect code which relied on catching
12812         a NullReferenceException to detect a null being passed in
12813         where an object was expected.
12814
12815 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12816
12817         * statement.cs (Try): flag the catch variable as assigned
12818
12819         * expression.cs (Cast): Simplified by using ResolveType instead of
12820         manually resolving.
12821
12822         * statement.cs (Catch): Fix bug by using ResolveType.
12823
12824 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12825
12826         * expression.cs (BetterConversion): Special case for when we have
12827         a NullLiteral as the argument and we have to choose between string
12828         and object types - we choose string the way csc does.
12829
12830         * attribute.cs (Attribute.Resolve): Catch the
12831         NullReferenceException and report error #182 since the Mono
12832         runtime no more has the bug and having this exception raised means
12833         we tried to select a constructor which takes an object and is
12834         passed a null.
12835
12836 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12837
12838         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12839         message (1502, 1503) when we can't locate a method after overload
12840         resolution. This is much more informative and closes the bug
12841         Miguel reported.
12842
12843         * interface.cs (PopulateMethod): Return if there are no argument
12844         types. Fixes a NullReferenceException bug.
12845
12846         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12847         expressions too. Previously we were checking only in one place for
12848         positional arguments leaving out named arguments.
12849
12850         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12851         type to the enum type is not allowed. Remove code corresponding to
12852         that.
12853
12854         (ConvertNumericExplicit): Allow explicit conversions from
12855         the underlying type to enum type. This precisely follows the spec
12856         and closes a bug filed by Gonzalo.
12857
12858 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12859
12860         * compiler.csproj:
12861         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12862
12863 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12866         it was important that we stored the right value after the
12867         reduction in `converted'.
12868
12869 2002-09-04  Martin Baulig  <martin@gnome.org>
12870
12871         * location.cs (Location.SymbolDocument): Use full pathnames for the
12872         source files.
12873
12874 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12875
12876         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12877         of the expression resolve mechanism, because that will catch the
12878         SimpleName error failures.
12879
12880         (Conditional): If we can not resolve the
12881         expression, return, do not crash.
12882
12883 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12884
12885         * cs-tokenizer.cs:
12886         (location): display token name instead of its number.
12887
12888 2002-08-28  Martin Baulig  <martin@gnome.org>
12889
12890         * expression.cs (Binary.ResolveOperator): Don't silently return
12891         but return an error if an operator cannot be applied between two
12892         enum types.
12893
12894 2002-08-28  Martin Baulig  <martin@gnome.org>
12895
12896         * class.cs (Constructor.Define): Set the permission attributes
12897         correctly instead of making all constructors public.
12898
12899 2002-08-28  Martin Baulig  <martin@gnome.org>
12900
12901         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12902         for private members before reporting a CS0103; if we find anything,
12903         it's a CS0122.
12904
12905 2002-08-28  Martin Baulig  <martin@gnome.org>
12906
12907         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12908         to check whether `closure_start_type == closure_invocation_type',
12909         we also need to check whether `m.DeclaringType == closure_invocation_type'
12910         before bypassing the permission checks.  We might be accessing
12911         protected/private members from the base class.
12912         (TypeManager.RealMemberLookup): Only set private_ok if private
12913         members were requested via BindingFlags.NonPublic.
12914
12915         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12916
12917         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12918         MethodGroupExpr.IsExplicitImpl if appropriate.
12919         (Invocation.DoResolve): Don't report the CS0120 for explicit
12920         interface implementations.
12921
12922 2002-08-27  Martin Baulig  <martin@gnome.org>
12923
12924         * expression.cs (Invocation.DoResolve): If this is a static
12925         method and we don't have an InstanceExpression, we must report
12926         a CS0120.
12927
12928 2002-08-25  Martin Baulig  <martin@gnome.org>
12929
12930         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12931         `==' between a valuetype and an object.
12932
12933 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * ecore.cs (TypeExpr): Provide a ToString method.
12936
12937 2002-08-24  Martin Baulig  <martin@gnome.org>
12938
12939         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12940         now called proggie.dbg and it's a binary file.
12941
12942 2002-08-23  Martin Baulig  <martin@gnome.org>
12943
12944         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12945
12946 2002-08-23  Martin Baulig  <martin@gnome.org>
12947
12948         * struct.cs (MyStructInfo.ctor): Make this work with empty
12949         structs; it's not allowed to use foreach() on null.
12950
12951 2002-08-23  Martin Baulig  <martin@gnome.org>
12952
12953         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12954         writer the full pathname of the generated assembly.
12955
12956 2002-08-23  Martin Baulig  <martin@gnome.org>
12957
12958         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12959         A `finally' block never returns or breaks; improved handling of
12960         unreachable code.
12961
12962 2002-08-23  Martin Baulig  <martin@gnome.org>
12963
12964         * statement.cs (Throw.Resolve): Allow `throw null'.
12965
12966 2002-08-23  Martin Baulig  <martin@gnome.org>
12967
12968         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12969         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12970         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12971         MemberLookup would return a wrong event if this is an explicit
12972         interface implementation and the class has an event with the same
12973         name.
12974
12975 2002-08-23  Martin Baulig  <martin@gnome.org>
12976
12977         * statement.cs (Block.AddChildVariableNames): New public method.
12978         (Block.AddChildVariableName): Likewise.
12979         (Block.IsVariableNameUsedInChildBlock): Likewise.
12980         (Block.AddVariable): Check whether a variable name has already
12981         been used in a child block.
12982
12983         * cs-parser.jay (declare_local_variables): Mark all variable names
12984         from the current block as being used in a child block in the
12985         implicit block.
12986
12987 2002-08-23  Martin Baulig  <martin@gnome.org>
12988
12989         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12990         find the symbol writer.
12991
12992         * driver.cs: csc also allows the arguments to /define being
12993         separated by commas, not only by semicolons.
12994
12995 2002-08-23  Martin Baulig  <martin@gnome.org>
12996
12997         * interface.cs (Interface.GetMembers): Added static check for events.
12998
12999 2002-08-15  Martin Baulig  <martin@gnome.org>
13000
13001         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13002         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13003
13004         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13005         why the MethodData.EmitDestructor() change was necessary.
13006
13007 2002-08-20  Martin Baulig  <martin@gnome.org>
13008
13009         * class.cs (TypeContainer.FindMembers): Added static check for events.
13010
13011         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13012
13013         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13014         use Type.GetEvents(), not Type.FindMembers().
13015
13016 2002-08-20  Martin Baulig  <martin@gnome.org>
13017
13018         * decl.cs (MemberCache): Added a special method cache which will
13019         be used for method-only searched.  This ensures that a method
13020         search will return a MethodInfo with the correct ReflectedType for
13021         inherited methods.      
13022
13023 2002-08-20  Martin Baulig  <martin@gnome.org>
13024
13025         * decl.cs (DeclSpace.FindMembers): Made this public.
13026
13027 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13028
13029         * delegate.cs: fixed build on windows.
13030         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13031
13032 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13033
13034         * ecore.cs (StandardConversionExists): Return a false
13035         if we are trying to convert the void type to anything else
13036         since that is not allowed.
13037
13038         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13039         we flag error 70 in the event an event is trying to be accessed
13040         directly from outside the declaring type.
13041
13042 2002-08-20  Martin Baulig  <martin@gnome.org>
13043
13044         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13045         MemberCache from typemanager.cs to decl.cs.
13046
13047 2002-08-19  Martin Baulig  <martin@gnome.org>
13048
13049         * class.cs (TypeContainer): Implement IMemberContainer.
13050         (TypeContainer.DefineMembers): Create the MemberCache.
13051         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13052         return public members if BindingFlags.Public was given, check
13053         whether members are static.
13054
13055 2002-08-16  Martin Baulig  <martin@gnome.org>
13056
13057         * decl.cs (DeclSpace.Define): Splitted this in Define and
13058         DefineMembers.  DefineMembers is called first and initializes the
13059         MemberCache.
13060
13061         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13062         DefineMembers() on all our DeclSpaces.
13063
13064         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13065         but call DefineMembers() on all nested interfaces.  We call their
13066         Define() in our new Define() function.
13067
13068         * interface.cs (Interface): Implement IMemberContainer.
13069         (Interface.Define): Moved all code except the attribute stuf to
13070         DefineMembers().
13071         (Interface.DefineMembers): Initialize the member cache.
13072
13073         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13074         need this anymore since we can use MemberCache.FindMembers directly.
13075
13076 2002-08-19  Martin Baulig  <martin@gnome.org>
13077
13078         * typemanager.cs (MemberCache): When creating the cache for an
13079         interface type, add all inherited members.
13080         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13081         to `out bool used_cache' and documented it.
13082         (TypeManager.MemberLookup): If we already used the cache in the first
13083         iteration, we don't need to do the interfaces check.
13084
13085 2002-08-19  Martin Baulig  <martin@gnome.org>
13086
13087         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13088         here from IMemberFinder and don't implement this interface anymore.
13089         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13090
13091         * typemanager.cs (IMemberFinder): This interface is now only used by
13092         classes which actually support the member cache.
13093         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13094         since we only put DeclSpaces into this Hashtable.
13095         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13096         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13097
13098 2002-08-16  Martin Baulig  <martin@gnome.org>
13099
13100         * typemanager.cs (ICachingMemberFinder): Removed.
13101         (IMemberFinder.MemberCache): New property.
13102         (TypeManager.FindMembers): Merged this with RealFindMembers().
13103         This function will never be called from TypeManager.MemberLookup()
13104         so we can't use the cache here, just the IMemberFinder.
13105         (TypeManager.MemberLookup_FindMembers): Check whether the
13106         IMemberFinder has a MemberCache and call the cache's FindMembers
13107         function.
13108         (MemberCache): Rewrote larger parts of this yet another time and
13109         cleaned it up a bit.
13110
13111 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13112
13113         * driver.cs (LoadArgs): Support quoting.
13114
13115         (Usage): Show the CSC-like command line arguments.
13116
13117         Improved a few error messages.
13118
13119 2002-08-15  Martin Baulig  <martin@gnome.org>
13120
13121         * typemanager.cs (IMemberContainer.Type): New property.
13122         (IMemberContainer.IsInterface): New property.
13123
13124         The following changes are conditional to BROKEN_RUNTIME, which is
13125         defined at the top of the file.
13126
13127         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13128         class'es members, but add all members from TypeHandle.ObjectType
13129         if we're an interface.
13130         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13131         is the current type.
13132         (MemberCache.CacheEntry.Container): Removed this field.
13133         (TypeHandle.GetMembers): Include inherited members.
13134
13135 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13136
13137         * typemanager.cs: fixed compilation and added a comment on a field that
13138         is never used.
13139
13140 2002-08-15  Martin Baulig  <martin@gnome.org>
13141
13142         * class.cs (ConstructorInitializer.Resolve): In the
13143         Expression.MemberLookup call, use the queried_type as
13144         invocation_type.
13145
13146         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13147         declared' attribute, it's always true.
13148         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13149         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13150         temporary wrapper for FindMembers which tells MemberLookup whether
13151         members from the base classes are included in the return value.
13152         This will go away soon.
13153         (TypeManager.MemberLookup): Use this temporary hack here; once the
13154         new MemberCache is completed, we don't need to do the DeclaredOnly
13155         looping here anymore since the MemberCache will take care of this.
13156         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13157         (MemberCache): When creating the MemberCache for a class, get
13158         members from the current class and all its base classes.
13159         (MemberCache.CacheEntry.Container): New field.  This is a
13160         temporary hack until the Mono runtime is fixed to distinguish
13161         between ReflectedType and DeclaringType.  It allows us to use MCS
13162         with both the MS runtime and the unfixed Mono runtime without
13163         problems and without accecting performance.
13164         (MemberCache.SearchMembers): The DeclaredOnly looping from
13165         TypeManager.MemberLookup is now done here.      
13166
13167 2002-08-14  Martin Baulig  <martin@gnome.org>
13168
13169         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13170         Type.GetFields on dynamic types but get the fields from the
13171         corresponding TypeContainer.
13172         (MyStructInfo.GetStructInfo): Added check for enum types.
13173
13174         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13175         (MemberList.SyncRoot): Implemented.
13176         (TypeManager.FilterWithClosure): No need to check permissions if
13177         closure_start_type == closure_invocation_type, don't crash if
13178         closure_invocation_type is null.
13179
13180 2002-08-13  Martin Baulig  <martin@gnome.org>
13181
13182         Rewrote TypeContainer.FindMembers to use a member cache.  This
13183         gives us a speed increase of about 35% for the self-hosting MCS
13184         build and of about 15-20% for the class libs (both on GNU/Linux).
13185
13186         * report.cs (Timer): New class to get enhanced profiling.  This
13187         whole class is "TIMER" conditional since it remarkably slows down
13188         compilation speed.
13189
13190         * class.cs (MemberList): New class.  This is an IList wrapper
13191         which we're now using instead of passing MemberInfo[]'s around to
13192         avoid copying this array unnecessarily.
13193         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13194         (ICachingMemberFinder, IMemberContainer): New interface.
13195         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13196         has already been checked, otherwise use it for the name comparision.
13197         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13198         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13199         if possible.  Returns a MemberList, not a MemberInfo [].
13200         (TypeHandle): New class, implements IMemberContainer.  We create
13201         one instance of this class per type, it contains a MemberCache
13202         which is used to do the member lookups.
13203         (MemberCache): New class.  Each instance of this class contains
13204         all members of a type and a name-based hash table.
13205         (MemberCache.FindMembers): This is our new member lookup
13206         function.  First, it looks up all members of the requested name in
13207         the hash table.  Then, it walks this list and sorts out all
13208         applicable members and returns them.
13209
13210 2002-08-13  Martin Baulig  <martin@gnome.org>
13211
13212         In addition to a nice code cleanup, this gives us a performance
13213         increase of about 1.4% on GNU/Linux - not much, but it's already
13214         half a second for the self-hosting MCS compilation.
13215
13216         * typemanager.cs (IMemberFinder): New interface.  It is used by
13217         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13218         Enum, Delegate or Interface.
13219         (TypeManager.finder_to_member_finder): New PtrHashtable.
13220         (TypeManager.finder_to_container): Removed.
13221         (TypeManager.finder_to_delegate): Removed.
13222         (TypeManager.finder_to_interface): Removed.
13223         (TypeManager.finder_to_enum): Removed.
13224
13225         * interface.cs (Interface): Implement IMemberFinder.
13226
13227         * delegate.cs (Delegate): Implement IMemberFinder.
13228
13229         * enum.cs (Enum): Implement IMemberFinder.
13230
13231         * class.cs (TypeContainer): Implement IMemberFinder.
13232
13233 2002-08-12  Martin Baulig  <martin@gnome.org>
13234
13235         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13236
13237 2002-08-12  Martin Baulig  <martin@gnome.org>
13238
13239         * ecore.cs (ITypeExpression): New interface for expressions which
13240         resolve to a type.
13241         (TypeExpression): Renamed to TypeLookupExpression.
13242         (Expression.DoResolve): If we're doing a types-only lookup, the
13243         expression must implement the ITypeExpression interface and we
13244         call DoResolveType() on it.
13245         (SimpleName): Implement the new ITypeExpression interface.
13246         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13247         hack, the situation that we're only looking up types can't happen
13248         anymore when this method is called.  Moved the type lookup code to
13249         DoResolveType() and call it.
13250         (SimpleName.DoResolveType): This ITypeExpression interface method
13251         is now doing the types-only lookup.
13252         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13253         (ResolveFlags): Added MaskExprClass.
13254
13255         * expression.cs (MemberAccess): Implement the ITypeExpression
13256         interface.
13257         (MemberAccess.DoResolve): Added support for a types-only lookup
13258         when we're called via ITypeExpression.DoResolveType().
13259         (ComposedCast): Implement the ITypeExpression interface.
13260
13261         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13262         Expression.Resolve() with ResolveFlags.Type instead.
13263
13264 2002-08-12  Martin Baulig  <martin@gnome.org>
13265
13266         * interface.cs (Interface.Define): Apply attributes.
13267
13268         * attribute.cs (Attribute.ApplyAttributes): Added support for
13269         interface attributes.
13270
13271 2002-08-11  Martin Baulig  <martin@gnome.org>
13272
13273         * statement.cs (Block.Emit): Only check the "this" variable if we
13274         do not always throw an exception.
13275
13276         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13277         whether the property has a set accessor.
13278
13279 2002-08-11  Martin Baulig  <martin@gnome.org>
13280
13281         Added control flow analysis support for structs.
13282
13283         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13284         with control flow analysis turned off.
13285         (IVariable): New interface.
13286         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13287         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13288         (FieldExpr.DoResolve): Resolve the instance expression with flow
13289         analysis turned off and do the definite assignment check after the
13290         resolving when we know what the expression will resolve to.
13291
13292         * expression.cs (LocalVariableReference, ParameterReference):
13293         Implement the new IVariable interface, only call the flow analysis
13294         code if ec.DoFlowAnalysis is true.
13295         (This): Added constructor which takes a Block argument.  Implement
13296         the new IVariable interface.
13297         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13298         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13299         This does the definite assignment checks for struct members.
13300
13301         * class.cs (Constructor.Emit): If this is a non-static `struct'
13302         constructor which doesn't have any initializer, call
13303         Block.AddThisVariable() to tell the flow analysis code that all
13304         struct elements must be initialized before control returns from
13305         the constructor.
13306
13307         * statement.cs (MyStructInfo): New public class.
13308         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13309         argument to this indexer.  If non-zero, check an individual struct
13310         member, not the whole struct.
13311         (FlowBranching.CheckOutParameters): Check struct members.
13312         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13313         overloaded versions of these methods which take an additional
13314         `int field_idx' argument to check struct members.
13315         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13316         overloaded versions of these methods which take an additional
13317         `string field_name' argument to check struct member.s
13318         (VariableInfo): Implement the IVariable interface.
13319         (VariableInfo.StructInfo): New public property.  Returns the
13320         MyStructInfo instance of the variable if it's a struct or null.
13321         (Block.AddThisVariable): New public method.  This is called from
13322         Constructor.Emit() for non-static `struct' constructor which do
13323         not have any initializer.  It creates a special variable for the
13324         "this" instance variable which will be checked by the flow
13325         analysis code to ensure that all of the struct's fields are
13326         initialized before control returns from the constructor.
13327         (UsageVector): Added support for struct members.  If a
13328         variable/parameter is a struct with N members, we reserve a slot
13329         in the usage vector for each member.  A struct is considered fully
13330         initialized if either the struct itself (slot 0) or all its
13331         members are initialized.
13332
13333 2002-08-08  Martin Baulig  <martin@gnome.org>
13334
13335         * driver.cs (Driver.MainDriver): Only report an error CS5001
13336         if there were no compilation errors.
13337
13338         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13339         `UnsafeContext' property to determine whether the parent is in
13340         unsafe context rather than checking the parent's ModFlags:
13341         classes nested in an unsafe class are unsafe as well.
13342
13343 2002-08-08  Martin Baulig  <martin@gnome.org>
13344
13345         * statement.cs (UsageVector.MergeChildren): Distinguish between
13346         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13347         we return.  Added test17() and test18() to test-154.cs.
13348
13349 2002-08-08  Martin Baulig  <martin@gnome.org>
13350
13351         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13352         Family access, make sure the invoking type isn't a subclass of the
13353         queried type (that'd be a CS1540).
13354
13355         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13356         this method which takes an additional `Type invocation_type'.
13357
13358         * expression.cs (BaseAccess.DoResolve): Use the base type as
13359         invocation and query type.
13360         (MemberAccess.DoResolve): If the lookup failed and we're about to
13361         report a CS0122, try a lookup with the ec.ContainerType - if this
13362         succeeds, we must report a CS1540.
13363
13364 2002-08-08  Martin Baulig  <martin@gnome.org>
13365
13366         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13367         (MethodGroupExpr): Implement the IMemberExpr interface.
13368
13369         * expression (MemberAccess.ResolveMemberAccess): No need to have
13370         any special code for MethodGroupExprs anymore, they're now
13371         IMemberExprs.   
13372
13373 2002-08-08  Martin Baulig  <martin@gnome.org>
13374
13375         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13376         Family, FamANDAssem and FamORAssem permissions.
13377         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13378
13379 2002-08-08  Martin Baulig  <martin@gnome.org>
13380
13381         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13382         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13383         or loop block.
13384
13385 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13386
13387         * driver.cs: implemented /resource option to embed managed resources.
13388
13389 2002-08-07  Martin Baulig  <martin@gnome.org>
13390
13391         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13392         (FieldBase.HasFieldInitializer): New public property.
13393         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13394         returns the field initializer and makes sure it is only resolved once.
13395         (TypeContainer.EmitFieldInitializers): Call
13396         FieldBase.GetInitializerExpression to get the initializer, this ensures
13397         that it isn't resolved multiple times.
13398
13399         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13400         the resolving process (SimpleName/MemberLookup) that we're currently
13401         emitting a field initializer (which must not access any instance members,
13402         this is an error CS0236).
13403
13404         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13405         argument, if the `IsFieldInitializer' flag is set, we must report and
13406         error CS0236 and not an error CS0120.   
13407
13408 2002-08-07  Martin Baulig  <martin@gnome.org>
13409
13410         * ecore.cs (IMemberExpr): New public interface.
13411         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13412         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13413         if the expression is an IMemberExpr.
13414
13415         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13416         to be null, implicitly default to `this' if we're non-static in
13417         this case.  Simplified the code a lot by using the new IMemberExpr
13418         interface.  Also fixed bug #28176 here.
13419
13420 2002-08-06  Martin Baulig  <martin@gnome.org>
13421
13422         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13423         ParameterReferences during semantic analysis so that we can do a
13424         type-only search when resolving Cast, TypeOf and SizeOf.
13425         (block): Pass the `current_local_parameters' to the Block's
13426         constructor.
13427
13428         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13429         argument to the constructor.
13430         (ConstructorInitializer.Resolve): Create a temporary implicit
13431         block with the parameters.
13432
13433         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13434         references here if we aren't doing a type-only search.
13435
13436         * statement.cs (Block): Added constructor which takes a
13437         `Parameters parameters' argument.
13438         (Block.Parameters): New public property.
13439
13440         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13441         to `Parameters' and made it public readonly.
13442
13443 2002-08-06  Martin Baulig  <martin@gnome.org>
13444
13445         * ecore.cs (Expression.Warning): Made this public as well.
13446
13447         * report.cs (Report.Debug): Print the contents of collections.
13448
13449 2002-08-06  Martin Baulig  <martin@gnome.org>
13450
13451         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13452         used to tell Resolve() which kinds of expressions it may return.
13453         (Expression.Resolve): Added overloaded version of this method which
13454         takes a `ResolveFlags flags' argument.  This can be used to tell
13455         Resolve() which kinds of expressions it may return.  Reports a
13456         CS0118 on error.
13457         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13458         ResolveFlags.SimpleName.
13459         (Expression.Error118): Added overloaded version of this method which
13460         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13461         which kinds of expressions are allowed.
13462
13463         * expression.cs (Argument.ResolveMethodGroup): New public method.
13464         Resolves an argument, but allows a MethodGroup to be returned.
13465         This is used when invoking a delegate.
13466
13467         * TODO: Updated a bit.
13468
13469 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13470
13471         Fixed compilation with csc.
13472
13473         * ecore.cs: Expression.Error made public. Is this correct? Should
13474         Warning be made public too?
13475
13476         * expression.cs: use ea.Location instead of ea.loc.
13477         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13478
13479 2002-08-06  Martin Baulig  <martin@gnome.org>
13480
13481         * ecore.cs (Expression.loc): Moved the location here instead of
13482         duplicating it in all derived classes.
13483         (Expression.Location): New public property.
13484         (Expression.Error, Expression.Warning): Made them non-static and
13485         removed the location argument.
13486         (Expression.Warning): Added overloaded version which takes an
13487         `int level' argument.
13488         (Expression.Error118): Make this non-static and removed the
13489         expression and location arguments.
13490         (TypeExpr): Added location argument to the constructor.
13491
13492         * expression.cs (StaticCallExpr): Added location argument to
13493         the constructor.
13494         (Indirection, PointerArithmetic): Likewise.
13495         (CheckedExpr, UnCheckedExpr): Likewise.
13496         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13497         (StringPtr): Likewise.
13498
13499
13500 2002-08-05  Martin Baulig  <martin@gnome.org>
13501
13502         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13503
13504         * assign.cs (Assign.DoResolve): Check whether the source
13505         expression is a value or variable.
13506
13507         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13508         while resolving the corresponding blocks.
13509
13510         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13511         an error, don't silently return null.
13512
13513         * statement.cs (Block.AddVariable): Do the error reporting here
13514         and distinguish between CS0128 and CS0136.
13515         (Block.DoResolve): Report all unused labels (warning CS0164).
13516         (LabeledStatement): Pass the location to the constructor.
13517         (LabeledStatement.HasBeenReferenced): New property.
13518         (LabeledStatement.Resolve): Set it to true here.
13519
13520         * statement.cs (Return.Emit): Return success even after reporting
13521         a type mismatch error (CS0126 or CS0127), this is what csc does and
13522         it avoids confusing the users with any consecutive errors.
13523
13524 2002-08-05  Martin Baulig  <martin@gnome.org>
13525
13526         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13527
13528         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13529
13530         * expression.cs (MemberAccess.DoResolve): Silently return if an
13531         error has already been reported.
13532
13533         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13534         error has already been reported.
13535
13536 2002-08-05  Martin Baulig  <martin@gnome.org>
13537
13538         * statement.cs (UsageVector): Only initialize the `parameters'
13539         vector if we actually have any "out" parameters.
13540
13541 2002-08-05  Martin Baulig  <martin@gnome.org>
13542
13543         * expression.cs (Binary.ResolveOperator): When combining delegates,
13544         they must have the same type.
13545
13546 2002-08-05  Martin Baulig  <martin@gnome.org>
13547
13548         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13549         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13550         work with the ms runtime and we also don't need it: if we're a
13551         PropertyBuilder and not in the `indexer_arguments' hash, then we
13552         are a property and not an indexer.
13553
13554         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13555         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13556         since the latter one doesn't work with the ms runtime.
13557
13558 2002-08-03  Martin Baulig  <martin@gnome.org>
13559
13560         Fixed bugs #27998 and #22735.
13561
13562         * class.cs (Method.IsOperator): New public field.
13563         (Method.CheckBase): Report CS0111 if there's already a method
13564         with the same parameters in the current class.  Report CS0508 when
13565         attempting to change the return type of an inherited method.
13566         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13567         and it's not marked abstract or extern.
13568         (PropertyBase): New abstract base class for Property and Indexer.
13569         (PropertyBase.CheckBase): Moved here from Property and made it work
13570         for indexers.
13571         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13572         the same so we can reuse it there.
13573         (Property, Indexer): Derive from PropertyBase.
13574         (MethodSignature.inheritable_property_signature_filter): New delegate
13575         to find properties and indexers.
13576
13577         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13578         argument and improved error reporting.
13579
13580         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13581         EmptyReadOnlyParameters and made it a property.
13582
13583         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13584         version of this method which takes a `PropertyInfo indexer'.
13585         (TypeManager.RegisterIndexer): New method.
13586
13587         * class.cs: Added myself as author of this file :-)
13588
13589 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13590
13591         * class.cs: fixed compilation on windoze.
13592
13593 2002-08-03  Martin Baulig  <martin@gnome.org>
13594
13595         * interface.cs (Interface.GetInterfaceBases): Check whether all
13596         base interfaces are at least as accessible than the current one.
13597
13598         * class.cs (TypeContainer.GetClassBases): Check whether base types
13599         are at least as accessible than the current type.
13600         (TypeContainer.AsAccessible): Implemented and made non-static.
13601         (MemberBase.CheckParameters): Report errors if the accessibility
13602         checks fail.
13603
13604         * delegate.cs (Delegate.Delegate): The default visibility is
13605         internal for top-level types and private for nested types.
13606         (Delegate.Define): Report errors if the accessibility checks fail.
13607
13608         * enum.cs (Enum.Enum): The default visibility is internal for
13609         top-level types and private for nested types.
13610         (Enum.DefineType): Compute the correct visibility.
13611
13612         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13613         function which takes a `bool is_toplevel' instead of a TypeContainer.
13614
13615         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13616         builtin type.
13617
13618 2002-08-02  Martin Baulig  <martin@gnome.org>
13619
13620         * expression.cs (LocalVariableReferenc): Added constructor which
13621         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13622         (LocalVariableReference.IsReadOnly): New property.
13623         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13624         variable is readonly, use our own readonly flag to do this; you can
13625         use the new constructor to get a writable reference to a read-only
13626         variable.
13627
13628         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13629         reference to the local variable.
13630
13631 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * rootcontext.cs (ResolveCore): Also include System.Exception
13634
13635         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13636         we reach an EmptyStatement.
13637
13638         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13639         is also fine.
13640
13641         * expression.cs (Binary.ResolveOperator): Check error result in
13642         two places.
13643
13644         use brtrue/brfalse directly and avoid compares to null.
13645
13646 2002-08-02  Martin Baulig  <martin@gnome.org>
13647
13648         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13649         Fixes bug #28407, added test-155.cs.
13650
13651 2002-08-01  Martin Baulig  <martin@gnome.org>
13652
13653         * class.cs (Event.EmitDefaultMethod): Make this work with static
13654         events.  Fixes #28311, added verify-3.cs.
13655
13656 2002-08-01  Martin Baulig  <martin@gnome.org>
13657
13658         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13659         `is_disposable' fields.
13660         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13661         `hm.is_disposable' if we're using the collection pattern.
13662         (Foreach.EmitCollectionForeach): Use the correct type for the
13663         enumerator's local variable, only emit the try/finally block if
13664         necessary (fixes #27713).
13665
13666 2002-08-01  Martin Baulig  <martin@gnome.org>
13667
13668         * ecore.cs (Expression.report118): Renamed to Error118 and made
13669         it public static.
13670
13671         * statement.cs (Throw.Resolve): Check whether the expression is of
13672         the correct type (CS0118) and whether the type derives from
13673         System.Exception (CS0155).
13674         (Catch.Resolve): New method.  Do the type lookup here and check
13675         whether it derives from System.Exception (CS0155).
13676         (Catch.CatchType, Catch.IsGeneral): New public properties.
13677
13678         * typemanager.cs (TypeManager.exception_type): Added.
13679
13680 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13681
13682         * driver.cs: Updated About function.
13683
13684 2002-07-31  Martin Baulig  <martin@gnome.org>
13685
13686         Implemented Control Flow Analysis.
13687
13688         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13689         (EmitContext.CurrentBranching): Added.
13690         (EmitContext.StartFlowBranching): Added.
13691         (EmitContext.EndFlowBranching): Added.
13692         (EmitContext.KillFlowBranching): Added.
13693         (EmitContext.IsVariableAssigned): Added.
13694         (EmitContext.SetVariableAssigned): Added.
13695         (EmitContext.IsParameterAssigned): Added.
13696         (EmitContext.SetParameterAssigned): Added.
13697         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13698         Added control flow analysis stuff here.
13699
13700         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13701         resolve the expression as lvalue.
13702         (LocalVariableReference.DoResolve): Check whether the variable has
13703         already been assigned.
13704         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13705         the parameter as assigned here.
13706         (ParameterReference.DoResolve): Check whether the parameter has already
13707         been assigned.
13708         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13709         expression as lvalue.
13710
13711         * statement.cs (FlowBranching): New class for the flow analysis code.
13712         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13713         (LabeledStatement.IsDefined): New public property.
13714         (LabeledStatement.AddUsageVector): New public method to tell flow
13715         analyis that the label may be reached via a forward jump.
13716         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13717         flow analysis.
13718         (VariableInfo.Number): New public field.  This is used by flow analysis
13719         to number all locals of a block.
13720         (Block.CountVariables): New public property.  This is the number of
13721         local variables in this block (including the locals from all parent
13722         blocks).
13723         (Block.EmitMeta): Number all the variables.
13724
13725         * statement.cs: Added flow analysis support to all classes.
13726
13727 2002-07-31  Martin Baulig  <martin@gnome.org>
13728
13729         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13730         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13731         then use this argument.
13732
13733         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13734
13735         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13736         use this to specify /define options.
13737
13738 2002-07-29  Martin Baulig  <martin@gnome.org>
13739
13740         * statement.cs (Fixed): Moved all code that does variable lookups
13741         and resolvings from Emit to Resolve.
13742
13743         * statement.cs (For): Moved all code that does variable lookups
13744         and resolvings from Emit to Resolve.
13745
13746         * statement.cs (Using): Moved all code that does variable lookups
13747         and resolvings from Emit to Resolve.
13748
13749 2002-07-29  Martin Baulig  <martin@gnome.org>
13750
13751         * attribute.cs (Attribute.Resolve): Explicitly catch a
13752         System.NullReferenceException when creating the
13753         CustromAttributeBuilder and report a different warning message.
13754
13755 2002-07-29  Martin Baulig  <martin@gnome.org>
13756
13757         * support.cs (ParameterData.ParameterName): Added method to
13758         get the name of a parameter.
13759
13760         * typemanager.cs (TypeManager.IsValueType): New public method.
13761
13762 2002-07-29  Martin Baulig  <martin@gnome.org>
13763
13764         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13765         is a flag which specifies that it's either ref or out.
13766         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13767         the out parameter to `out Parameter.Modifier mod', also set the
13768         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13769
13770         * support.cs (InternalParameters.ParameterModifier): Distinguish
13771         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13772         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13773
13774         * expression.cs (Argument.GetParameterModifier): Distinguish
13775         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13776         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13777
13778 2002-07-29  Martin Baulig  <martin@gnome.org>
13779
13780         * expression.cs (ParameterReference.ParameterReference): Added
13781         `Location loc' argument to the constructor.
13782
13783         * cs-parser.jay: Pass location to ParameterReference.
13784
13785 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13786
13787         * statement.cs (Try): Initialize the location.
13788
13789         * cs-parser.jay: pass location to Try.
13790
13791         * expression.cs (Unary.Reduce): Change the prototype to return
13792         whether a constant fold could be performed or not.  The result is
13793         returned in an out parameters.  In the case of Indirection and
13794         AddressOf, we want to perform the full tests.
13795
13796 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13797
13798         * statement.cs (Statement.Emit): Flag dead code.
13799
13800 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13801
13802         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13803
13804 2002-07-27  Martin Baulig  <martin@gnome.org>
13805
13806         * class.cs (MethodData.Define): Put back call to
13807         TypeManager.AddMethod(), accidentally commented this out.
13808
13809         * report.cs (Debug): New public method to print debugging information,
13810         this is `[Conditional ("DEBUG")]'.
13811
13812 2002-07-26  Martin Baulig  <martin@gnome.org>
13813
13814         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13815         (switch_statement): Push the current_block to the switch_stack and
13816         pop it again when we're done with the switch.
13817         (switch_section): The new block is a child of the current_block.
13818         Fixes bug #24007, added test-152.cs.
13819
13820 2002-07-27  Martin Baulig  <martin@gnome.org>
13821
13822         * expression.cs (Invocation.EmitArguments): When calling a varargs
13823         function with only its fixed arguments, we need to pass an empty
13824         array.
13825
13826 2002-07-27  Martin Baulig  <martin@gnome.org>
13827
13828         Mono 0.13 has been released.
13829
13830 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13831
13832         * driver.cs: Rename --resource to --linkres, because that is what
13833         we do currently, we dont support --resource yet.
13834
13835         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13836
13837 2002-07-25  Martin Baulig  <martin@gnome.org>
13838
13839         * class.cs (MethodData): New public class.  This is a `method builder'
13840         class for a method or one accessor of a Property/Indexer/Event.
13841         (MethodData.GetMethodFlags): Moved here from MemberBase.
13842         (MethodData.ApplyAttributes): Likewise.
13843         (MethodData.ApplyObsoleteAttribute): Likewise.
13844         (MethodData.ApplyConditionalAttribute): Likewise.
13845         (MethodData.ApplyDllImportAttribute): Likewise.
13846         (MethodData.CheckAbstractAndExternal): Likewise.
13847         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13848         (MethodData.Emit): Formerly known as Method.Emit().
13849         (MemberBase): Moved everything which was specific to a single
13850         accessor/method to MethodData.
13851         (Method): Create a new MethodData and call Define() and Emit() on it.
13852         (Property, Indexer, Event): Create a new MethodData objects for each
13853         accessor and call Define() and Emit() on them.
13854
13855 2002-07-25  Martin Baulig  <martin@gnome.org>
13856
13857         Made MethodCore derive from MemberBase to reuse the code from there.
13858         MemberBase now also checks for attributes.
13859
13860         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13861         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13862         as virtual.
13863         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13864         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13865         (MemberBase.ApplyAttributes): New virtual method; applies the
13866         attributes to a method or accessor.
13867         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13868         (MemberBase.ApplyConditionalAttribute): Likewise.
13869         (MemberBase.ApplyDllImportAttribute): Likewise.
13870         (MemberBase.CheckAbstractAndExternal): Likewise.
13871         (MethodCore.ParameterTypes): This is now a property instead of a
13872         method, it's initialized from DoDefineParameters().
13873         (MethodCore.ParameterInfo): Removed the set accessor.
13874         (MethodCore.DoDefineParameters): New protected virtual method to
13875         initialize ParameterTypes and ParameterInfo.
13876         (Method.GetReturnType): We can now simply return the MemberType.
13877         (Method.GetMethodFlags): Override the MemberBase version and add
13878         the conditional flags.
13879         (Method.CheckBase): Moved some code from Define() here, call
13880         DoDefineParameters() here.
13881         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13882         here to avoid some larger code duplication.
13883         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13884         ensure that abstract and external accessors don't declare a body.
13885
13886         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13887         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13888         lookup in the attribute's parent classes, so we need to abort as soon
13889         as we found the first match.
13890         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13891         the attribute has no arguments.
13892
13893         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13894         of a Method.
13895
13896 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13897
13898         * cs-parser.jay: reverted previous patch.
13899
13900 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13901
13902         * cs-parser.jay: fixed bug #22119.
13903
13904 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13905
13906         * attribute.cs: fixed compilation. The error was:
13907         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13908         be assigned to before control leaves the current method."
13909         [FIXME:  Filed as bug #28186: MCS must report this error.]
13910
13911 2002-07-25  Martin Baulig  <martin@gnome.org>
13912
13913         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13914         method to pull the condition name ouf of a Conditional attribute.
13915         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13916         the obsolete message and error flag out of an Obsolete attribute.
13917
13918         * class.cs (Method.GetMethodFlags): New public method to get the
13919         TypeManager.MethodFlags for this method.
13920         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13921         private methods.
13922         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13923         if we're overriding a virtual function, set the new private variable
13924         `parent_method'; call the new TypeManager.AddMethod().
13925
13926         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13927         the MethodBuilder and the Method in a PtrHashtable.
13928         (TypeManager.builder_to_method): Added for this purpose.
13929         (TypeManager.MethodFlags): Added IsObsoleteError.
13930         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13931         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13932         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13933         the message from the attribute.
13934
13935 2002-07-24  Martin Baulig  <martin@gnome.org>
13936
13937         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13938         preprocessor directives, ensure that the argument to #define/#undef is
13939         exactly one identifier and that it's actually an identifier.
13940
13941         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13942         did not work ....
13943
13944 2002-07-24  Martin Baulig  <martin@gnome.org>
13945
13946         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13947         initialize it to TypeManager.object_type in the constructor.
13948         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13949         of the `hm.get_current' method if we're using the collection pattern.
13950         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13951         for the explicit conversion to make it work when we're using the collection
13952         pattern and the `Current' property has a different return type than `object'.
13953         Fixes #27713.
13954
13955 2002-07-24  Martin Baulig  <martin@gnome.org>
13956
13957         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13958         does not match, but don't report any errors.  This method is called in
13959         order for all methods in a MethodGroupExpr until a matching method is
13960         found, so we don't want to bail out if the first method doesn't match.
13961         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13962         matches, report the 123.  Fixes #28070.
13963
13964 2002-07-24  Martin Baulig  <martin@gnome.org>
13965
13966         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13967         TypeManager.TypeToCoreType() to the top of the method so the
13968         following equality checks will work.  Fixes #28107.
13969
13970 2002-07-24  Martin Baulig  <martin@gnome.org>
13971
13972         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13973         operand is of type uint, and the other operand is of type sbyte,
13974         short or int, the operands are converted to type long." -
13975         Actually do what this comment already told us.  Fixes bug #28106,
13976         added test-150.cs.
13977
13978 2002-07-24  Martin Baulig  <martin@gnome.org>
13979
13980         * class.cs (MethodBase): New abstract class.  This is now a base
13981         class for Property, Indexer and Event to avoid some code duplication
13982         in their Define() and DefineMethods() methods.
13983         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13984         generic methods for Define() and DefineMethods().
13985         (FieldBase): Derive from MemberBase, not MemberCore.
13986         (Property): Derive from MemberBase, not MemberCore.
13987         (Property.DefineMethod): Moved all the code from this method to the
13988         new MethodBase.DefineAccessor(), just call it with appropriate
13989         argumetnts.
13990         (Property.Define): Call the new Property.DoDefine(), this does some
13991         sanity checks and we don't need to duplicate the code everywhere.
13992         (Event): Derive from MemberBase, not MemberCore.
13993         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13994         accessors, this will also make them work with interface events.
13995         (Indexer): Derive from MemberBase, not MemberCore.
13996         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13997         (Indexer.Define): Use the new MethodBase functions.
13998
13999         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14000         argument to the constructor.
14001         (Interface.FindMembers): Added support for interface events.
14002         (Interface.PopluateEvent): Implemented.
14003
14004         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14005
14006 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14007
14008         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14009         but this is required to check for a method name being the same as
14010         the containing class.  
14011
14012         Handle this now.
14013
14014 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14015
14016         * interface.cs: initialize variable.
14017
14018 2002-07-23  Martin Baulig  <martin@gnome.org>
14019
14020         Implemented the IndexerName attribute in interfaces.
14021
14022         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14023         name if this is an explicit interface implementation.
14024         (Indexer.InterfaceIndexerName): New public variable.  If we're
14025         implementing an interface indexer, this is the IndexerName in that
14026         interface.  Otherwise, it's the IndexerName.
14027         (Indexer.DefineMethod): If we're implementing interface indexer,
14028         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14029         and Pending.ImplementIndexer methods.
14030         (Indexer.Define): Also define the PropertyBuilder if we're
14031         implementing an interface indexer and this is neither an explicit
14032         interface implementation nor do the IndexerName match the one in
14033         the interface.
14034
14035         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14036         If a method is defined here, then we always need to create a proxy
14037         for it.  This is used when implementing interface indexers.
14038         (Pending.IsInterfaceIndexer): New public method.
14039         (Pending.ImplementIndexer): New public method.
14040         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14041         This is used when implementing interface indexers to define a proxy
14042         if necessary.
14043         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14044         define a proxy if necessary.
14045
14046         * interface.cs (Interface.IndexerName): New public variable.
14047         (Interface.PopulateIndexer): Set the IndexerName.
14048         (Interface.DefineIndexers): New private method.  Populate all the
14049         indexers and make sure their IndexerNames match.
14050
14051         * typemanager.cs (IndexerPropertyName): Added support for interface
14052         indexers.
14053
14054 2002-07-22  Martin Baulig  <martin@gnome.org>
14055
14056         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14057         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14058         ret if HasReturnLabel.
14059         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14060         variables.
14061
14062         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14063         and set the ec.LoopBeginTryCatchLevel.
14064         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14065         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14066         the current ec.TryCatchLevel, the branch goes out of an exception
14067         block.  In this case, we need to use Leave and not Br.
14068
14069 2002-07-22  Martin Baulig  <martin@gnome.org>
14070
14071         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14072         block unless the block does not always return or it is contained in
14073         another try { ... } catch { ... } block.  Fixes bug #26506.
14074         Added verify-1.cs to the test suite.
14075
14076 2002-07-22  Martin Baulig  <martin@gnome.org>
14077
14078         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14079         then we do not always return.  Fixes bug #24985.
14080
14081 2002-07-22  Martin Baulig  <martin@gnome.org>
14082
14083         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14084         lookup on a per-class level; ie. walk up the class hierarchy until we
14085         found at least one applicable method, then choose the best among them.
14086         Fixes bug #24463 and test-29.cs.
14087
14088 2002-07-22  Martin Baulig  <martin@gnome.org>
14089
14090         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14091         return types of the methods.  The return type is not part of the
14092         signature and we must not check it to make the `new' modifier work.
14093         Fixes bug #27999, also added test-147.cs.
14094         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14095
14096         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14097         on the method's return type.
14098
14099 2002-07-21  Martin Baulig  <martin@gnome.org>
14100
14101         * assign.cs: Make this work if the rightmost source is a constant and
14102         we need to do an implicit type conversion.  Also adding a few more tests
14103         to test-38.cs which should have caught this.
14104
14105         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14106         target in the makefile for this.  The makefile.gnu is primarily intended
14107         for end-users who don't want to debug the compiler.
14108
14109 2002-07-21  Martin Baulig  <martin@gnome.org>
14110
14111         * assign.cs: Improved the Assign class so it can now handle embedded
14112         assignments (X = Y = Z = something).  As a side-effect this'll now also
14113         consume less local variables.  test-38.cs now passes with MCS, added
14114         a few new test cases to that test.
14115
14116 2002-07-20  Martin Baulig  <martin@gnome.org>
14117
14118         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14119         instructions.  Fixes bug #27977, also added test-146.cs.
14120
14121 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14122
14123         * cs-tokenizer.cs: fixed getHex ().
14124
14125 2002-07-19  Martin Baulig  <martin@gnome.org>
14126
14127         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14128         not Type.GetType() to lookup the array type.  This is needed when
14129         we're constructing an array of a user-defined type.
14130         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14131         single-dimensional arrays, but also for single-dimensial arrays of
14132         type decimal.
14133
14134 2002-07-19  Martin Baulig  <martin@gnome.org>
14135
14136         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14137         this function is called, it's not allowed to share LocalBuilders
14138         among ILGenerators.
14139
14140 2002-07-19  Martin Baulig  <martin@gnome.org>
14141
14142         * expression.cs (Argument.Resolve): Report an error 118 when trying
14143         to pass a type as argument.
14144
14145 2002-07-18  Martin Baulig  <martin@gnome.org>
14146
14147         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14148         Conv_R_Un for the signed `long' type.
14149
14150 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14151
14152         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14153         `expr' for the temporary result, as that will fail if we do
14154         multiple resolves on the same expression.
14155
14156 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14157
14158         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14159         ec.TypeContainer for looking up aliases. 
14160
14161         * class.cs (TypeContainer): Remove LookupAlias from here.
14162
14163         * decl.cs (DeclSpace); Move here.
14164
14165 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14166
14167         * class.cs (FindMembers): Only call filter if the constructor
14168         bulider is not null.
14169
14170         Also handle delegates in `NestedTypes' now.  Now we will perform
14171         type lookups using the standard resolution process.  This also
14172         fixes a bug.
14173
14174         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14175         This uses Expressions (the limited kind that can be parsed by the
14176         tree) instead of strings.
14177
14178         * expression.cs (ComposedCast.ToString): Implement, used to flag
14179         errors since now we have to render expressions.
14180
14181         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14182         FormArrayType. 
14183
14184         * ecore.cs (SimpleName.ToString): ditto.
14185
14186         * cs-parser.jay: Instead of using strings to assemble types, use
14187         Expressions to assemble the type (using SimpleName, ComposedCast,
14188         MemberAccess).  This should fix the type lookups in declarations,
14189         because we were using a different code path for this.
14190
14191         * statement.cs (Block.Resolve): Continue processing statements
14192         even when there is an error.
14193
14194 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14195
14196         * class.cs (Event.Define): Also remove the `remove' method from
14197         the list of pending items.
14198
14199         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14200         generate more compact code. 
14201
14202 2002-07-17  Martin Baulig  <martin@gnome.org>
14203
14204         * const.cs (Const.LookupConstantValue): Add support for constant
14205         `unchecked' and `checked' expressions.
14206         Also adding test case test-140.cs for this.
14207
14208 2002-07-17  Martin Baulig  <martin@gnome.org>
14209
14210         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14211         check whether mi.ReturnType implements the IEnumerator interface; the
14212         `==' and the IsAssignableFrom() will fail in this situation.
14213
14214 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14215
14216         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14217         here too.
14218
14219 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14220
14221         * expression.cs: fixed bug #27811.
14222
14223 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14224
14225         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14226         Molaro: when we are a ref, the value already contains a pointer
14227         value, do not take the address of it.
14228
14229 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14230         * removed mb-parser.jay and mb-tokenizer.cs
14231
14232 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14233
14234         * expression.cs: check against the building corlib void type.
14235
14236 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14237
14238         * ecore.cs: fix for valuetype static readonly fields: when 
14239         initializing them, we need their address, not the address of a copy.
14240
14241 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14242
14243         * typemanager.cs: register also enum_type in corlib.
14244
14245 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14246
14247         * class.cs: allow calling this (but not base) initializers in structs.
14248
14249 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14250
14251         * ecore.cs: make sure we compare against the building base types
14252         in GetTypeSize ().
14253
14254 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14255
14256         * typemanager.cs: fix TypeToCoreType() to handle void and object
14257         (corlib gets no more typerefs after this change).
14258
14259 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14260
14261         * expression.cs (ArrayCreation.EmitArrayArguments): use
14262         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14263
14264         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14265         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14266         array indexes, the runtime actually forbids them.
14267
14268         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14269         for array arguments here.
14270
14271         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14272         instead of the default for ValueTypes.
14273
14274         (New.DoEmit): Use IsValueType instead of
14275         IsSubclassOf (value_type)
14276         (New.DoResolve): ditto.
14277         (Invocation.EmitCall): ditto.
14278
14279         * assign.cs (Assign): ditto.
14280
14281         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14282         Statements *are* currently doing part of their resolution during
14283         Emit.  
14284
14285         Expressions do always resolve during resolve, but statements are
14286         only required to propagate resolution to their children.
14287
14288 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14289
14290         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14291
14292         (LoadAssembly): Do not add the dll if it is already specified
14293
14294         (MainDriver): Add the System directory to the link path at the end,
14295         after all the other -L arguments. 
14296
14297         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14298         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14299         ldelem.u1) and using the opposite for sbytes.
14300
14301         This fixes Digger, and we can finally run it.
14302
14303         * driver.cs (UnixParseOption): Move the option parsing here.  
14304         (CSCParseOption): Implement CSC-like parsing of options.
14305
14306         We now support both modes of operation, the old Unix way, and the
14307         new CSC-like way.  This should help those who wanted to make cross
14308         platform makefiles.
14309
14310         The only thing broken is that /r:, /reference: and /lib: are not
14311         implemented, because I want to make those have the same semantics
14312         as the CSC compiler has, and kill once and for all the confussion
14313         around this.   Will be doing this tomorrow.
14314
14315         * statement.cs (Unsafe.Resolve): The state is checked during
14316         resolve, not emit, so we have to set the flags for IsUnsfe here.
14317
14318 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14321         not catch the Error_ObjectRefRequired in SimpleName (as it is
14322         possible to have a class/instance variable name that later gets
14323         deambiguated), we have to check this here.      
14324
14325 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14326
14327         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14328         make static and put into Expression.
14329
14330         (Event.Define): Register the private field of the event with the 
14331         TypeManager so that GetFieldFromEvent can get at it.
14332
14333         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14334         keep track of the private field associated with an event which
14335         has no accessors.
14336
14337         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14338         private field.
14339
14340         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14341
14342 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14343
14344         * expression.cs (Binary.EmitBranchable): this routine emits the
14345         Binary expression in a branchable context.  This basically means:
14346         we need to branch somewhere, not just get the value on the stack.
14347
14348         This works together with Statement.EmitBoolExpression.
14349
14350         * statement.cs (Statement.EmitBoolExpression): Use
14351         EmitBranchable. 
14352
14353 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * statement.cs (For): Reduce the number of jumps in loops.
14356
14357         (For): Implement loop inversion for the For statement.
14358
14359         (Break): We can be breaking out of a Try/Catch controlled section
14360         (foreach might have an implicit try/catch clause), so we need to
14361         use Leave instead of Br.
14362
14363         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14364         now).  If the instace expression supports IMemoryLocation, we use
14365         the AddressOf method from the IMemoryLocation to extract the
14366         address instead of emitting the instance.
14367
14368         This showed up with `This', as we were emitting the instance
14369         always (Emit) instead of the Address of This.  Particularly
14370         interesting when This is a value type, as we dont want the Emit
14371         effect (which was to load the object).
14372
14373 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14376
14377         * statement.cs (Checked): Set the CheckedState during the resolve
14378         process too, as the ConvCast operations track the checked state on
14379         the resolve process, and not emit.
14380
14381         * cs-parser.jay (namespace_member_declaration): Flag that we have
14382         found a declaration when we do.  This is used to flag error 1529
14383
14384         * driver.cs: Report ok when we display the help only.
14385
14386 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14387
14388         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14389
14390 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14391
14392         * cs-tokenizer.cs (define): We also have to track locally the
14393         defines.  AllDefines is just used for the Conditional Attribute,
14394         but we also need the local defines for the current source code. 
14395
14396 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14397
14398         * statement.cs (While, For, Do): These loops can exit through a
14399         Break statement, use this information to tell whether the
14400         statement is the last piece of code.
14401
14402         (Break): Flag that we break.
14403
14404         * codegen.cs (EmitContexts): New `Breaks' state variable.
14405
14406 2002-07-03  Martin Baulig  <martin@gnome.org>
14407
14408         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14409         modifiers in method declarations in structs.  Otherwise, you won't
14410         be able to override things like Object.Equals().
14411
14412 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14413
14414         * class.cs (Method, Property, Indexer): Do not allow the public
14415         modifier to be used in explicit interface implementations.
14416
14417         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14418         override modifiers in method declarations in structs
14419
14420 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14421
14422         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14423         integer or real overflow, report an error
14424
14425 2002-07-02  Martin Baulig  <martin@gnome.org>
14426
14427         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14428         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14429         to tell the runtime about our newly created System.Object and
14430         System.ValueType types.
14431
14432 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14435         struct instead of Ldarg/Starg.
14436
14437 2002-07-02  Martin Baulig  <martin@gnome.org>
14438
14439         * expression.cs (Indirection.Indirection): Call
14440         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14441
14442 2002-07-02  Martin Baulig  <martin@gnome.org>
14443
14444         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14445         ValueType, call TypeManager.TypeToCoreType() on it.
14446         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14447         the OpCodes.Newarr argument.
14448
14449 2002-07-02  Martin Baulig  <martin@gnome.org>
14450
14451         * expression.cs (Invocation.EmitCall): When compiling corlib,
14452         replace all calls to the system's System.Array type to calls to
14453         the newly created one.
14454
14455         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14456         System.Array methods.
14457         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14458         from the system's System.Array type which must be replaced.
14459
14460 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14461
14462         * typemanager.cs: load unverifiable_code_ctor so we can build
14463         corlib using the correct type. Avoid using GetTypeCode() with
14464         TypeBuilders.
14465         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14466         TypeManager.object_type to allow building corlib.
14467
14468 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14469
14470         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14471
14472 2002-07-01  Martin Baulig  <martin@gnome.org>
14473
14474         * class.cs: Make the last change actually work, we need to check
14475         whether `ifaces != null' to avoid a crash.
14476
14477 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14478
14479         * class.cs: when we build structs without fields that implement
14480         interfaces, we need to add the interfaces separately, since there is
14481         no API to both set the size and add the interfaces at type creation
14482         time.
14483
14484 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14485
14486         * expression.cs: the dimension arguments to the array constructors
14487         need to be converted if they are a long.
14488
14489 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14490
14491         * class.cs: don't emit ldarg.0 if there is no parent constructor
14492         (fixes showstopper for corlib).
14493
14494 2002-06-29  Martin Baulig  <martin@gnome.org>
14495
14496         MCS now compiles corlib on GNU/Linux :-)
14497
14498         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14499         ie. check for MethodImplOptions.InternalCall.
14500
14501         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14502         and TypeManager.attribute_type are null, so we must explicitly check
14503         whether parent is not null to find out whether it's an attribute type.
14504         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14505         and SetBuilder, not only if the property is neither abstract nor external.
14506         This is necessary to set the MethodImplOptions on the accessor methods.
14507         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14508         SetBuilder, see Property.Emit().
14509
14510         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14511         populate "System.Object", "System.ValueType" and "System.Attribute" since
14512         they've already been populated from BootCorlib_PopulateCoreTypes().
14513
14514 2002-06-29  Martin Baulig  <martin@gnome.org>
14515
14516         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14517         is the NullLiteral, we also need to make sure that target_type is not
14518         an enum type.   
14519
14520 2002-06-29  Martin Baulig  <martin@gnome.org>
14521
14522         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14523         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14524         before calling BootstrapCorlib_ResolveDelegate ().
14525
14526 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14527
14528         * statement.cs: fixed build-breaker. All tests passed ok.
14529
14530 2002-06-27  Martin Baulig  <martin@gnome.org>
14531
14532         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14533         for System.Decimal when compiling corlib.
14534
14535 2002-06-27  Martin Baulig  <martin@gnome.org>
14536
14537         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14538         switch blocks which contain nothing but a default clause.
14539
14540 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14541
14542        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14543
14544 2002-06-27  Martin Baulig  <martin@gnome.org>
14545
14546         * ecore.cs (PropertyExpr.PropertyExpr): Call
14547         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14548
14549         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14550         is already a TypeBuilder.
14551
14552 2002-06-27  Martin Baulig  <martin@gnome.org>
14553
14554         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14555         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14556         the "from an array-type to System.Array" case.  This makes it work
14557         when compiling corlib.
14558
14559 2002-06-27  Martin Baulig  <martin@gnome.org>
14560
14561         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14562         non-static PropertyExpr, set its InstanceExpression.  This makes
14563         the `ICollection.Count' property work in System/Array.cs.
14564
14565 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14566
14567         * driver.cs: Made error handling more consistent.  Errors now
14568         tracked by Report class, so many methods which used to return int
14569         now return void.  Main() now prints success/failure and 
14570         errors/warnings message.
14571
14572         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14573         the magic number return values (123 and 124).  Now, if the
14574         expected error occurs, the compiler exits with success (exit value
14575         0).  If the compilation completes without seeing that particular
14576         error, the compiler exits with failure (exit value 1).  The
14577         makefile in mcs/errors has been changed to handle the new behaviour.
14578
14579         * report.cs: Made 'expected error' number a property and renamed
14580         it from 'Probe' to 'ExpectedError'.
14581
14582         * genericparser.cs: Removed error handling support, since it is
14583         now all done by Report class.
14584
14585         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14586         class, so parse() no longer returns an int.
14587
14588         * namespace.cs: Use Report.Error instead of GenericParser.error
14589
14590 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14593         TypeContainer.AddOperator): At the front of the list put the
14594         explicit implementations, so they get resolved/defined first. 
14595
14596 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14599         interface type is implemented by this TypeContainer.  Used during
14600         explicit interface implementation.
14601
14602         (Property.Define, Indexer.Define, Method.Define): Validate that
14603         the given interface in the explicit implementation is one of the
14604         base classes for the containing type.
14605
14606         Also if we are explicitly implementing an interface, but there is
14607         no match in the pending implementation table, report an error.
14608
14609         (Property.Define): Only define the property if we are
14610         not explicitly implementing a property from an interface.  Use the
14611         correct name also for those properties (the same CSC uses,
14612         although that is really not needed).
14613
14614         (Property.Emit): Do not emit attributes for explicitly implemented
14615         properties, as there is no TypeBuilder.
14616
14617         (Indexer.Emit): ditto.
14618
14619         Hiding then means that we do not really *implement* a pending
14620         implementation, which makes code fail.
14621
14622 2002-06-22  Martin Baulig  <martin@gnome.org>
14623
14624         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14625         the return value of Object.GetType().  [FIXME: we need to do this whenever
14626         we get a type back from the reflection library].
14627
14628 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14629
14630         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14631
14632 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * attribute.cs: Return null if we can not look up the type.
14635
14636         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14637         the interface types found.
14638
14639         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14640         interface types found.
14641
14642         * typemanager.cs (GetInterfaces): Make this routine returns alll
14643         the interfaces and work around the lame differences between
14644         System.Type and System.Reflection.Emit.TypeBuilder in the results
14645         result for GetInterfaces.
14646
14647         (ExpandInterfaces): Given an array of interface types, expand and
14648         eliminate repeated ocurrences of an interface.  This expands in
14649         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14650         be IA, IB, IC.
14651
14652 2002-06-21  Martin Baulig  <martin@gnome.org>
14653
14654         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14655         on System.Enum.
14656
14657 2002-06-21  Martin Baulig  <martin@gnome.org>
14658
14659         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14660         and called with one of the core types, return the corresponding typebuilder for
14661         that type.
14662
14663         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14664         element type.
14665
14666 2002-06-21  Martin Baulig  <martin@gnome.org>
14667
14668         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14669         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14670         (Expression.ConvertReferenceExplicit): Likewise.
14671
14672         * expression.cs (ElementAccess.DoResolve): Likewise.
14673         (ElementAccess.DoResolveLValue): Likewise.
14674
14675 2002-06-10  Martin Baulig  <martin@gnome.org>
14676
14677         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14678         add the "value" parameter to the parameter list.
14679
14680         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14681         to our caller.
14682
14683 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14684
14685         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14686         the argument to an int, uint, long or ulong, per the spec.  Also
14687         catch negative constants in array creation.
14688
14689 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14690
14691         * class.cs: do not allow the same interface to appear twice in
14692         the definition list.
14693
14694 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14695
14696         * ecore.cs: don't use ldlen with System.Array.
14697
14698 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14699
14700         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14701
14702 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14703
14704         * modifiers.cs: produce correct field attributes for protected
14705         internal. Easy fix so miguel can work on ther harder stuff:-)
14706
14707 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14708
14709         * pending.cs: New file.  Move the code from class.cs here.
14710         Support clearning the pending flag for all methods (when not doing
14711         explicit interface implementation).
14712
14713 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14714
14715         * rootcontext.cs: added a couple more types needed to bootstrap.
14716
14717 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14718
14719         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14720         constructor in the type, instead of any constructor in the type
14721         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14722         a bug in the Mono runtime when applying the params attribute). 
14723
14724 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14725         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14726
14727 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14728
14729         * expression.cs (Unary.ResolveOperator): Use TypeManager
14730         to resolve the type.
14731
14732 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14733
14734         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14735         attached.
14736
14737         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14738         with each member too.
14739
14740         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14741         field builders too - this takes care of the enum member case.
14742
14743 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14744
14745         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14746         address-of operator on both value types and pointers.
14747
14748 2002-06-10  Martin Baulig  <martin@gnome.org>
14749
14750         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14751         PropertyBuilder to the `property_builders' list.
14752
14753         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14754         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14755         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14756         find any indexers which are inherited from an interface.
14757
14758 2002-06-09  Martin Baulig  <martin@gnome.org>
14759
14760         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14761         the same type as the constant if necessary.  There's also a test-130.cs
14762         for this.
14763
14764         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14765
14766         * typemanager.cs (TypeManager.ChangeType): Previously known as
14767         Enum.ChangeEnumType().
14768
14769 2002-06-09  Martin Baulig  <martin@gnome.org>
14770
14771         * expression.cs (Cast.TryReduce): Added support for consts.
14772
14773 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14774
14775         * class.cs (Accessor): Hold attributes information so we can pass
14776         it along.
14777
14778         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14779         Modify to pass in attributes attached to the methods.
14780
14781         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14782
14783         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14784         to handle the Accessor kind :-)
14785
14786         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14787
14788 2002-06-08  Martin Baulig  <martin@gnome.org>
14789
14790         * expression.cs (Unary.TryReduceNegative): Added support for
14791         ULongConstants.
14792
14793 2002-06-08  Martin Baulig  <martin@gnome.org>
14794
14795         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14796         name can't be found in the `defined_names' - the caller will do a
14797         MemberLookup in this case and thus find methods in System.Enum
14798         such as Enum.IsDefined().
14799
14800 2002-06-08  Martin Baulig  <martin@gnome.org>
14801
14802         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14803         Convert.ChangeType() which works with TypeBuilder created types.
14804         (Enum.LookupEnumValue, Enum.Define): Use it here.
14805
14806         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14807         `TypeBuilder.BaseType != null' check.
14808         (TypeContainer.FindMembers): Only lookup parent members if we
14809         actually have a parent.
14810         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14811         (ConstructorInitializer.Resolve): Likewise.
14812
14813         * interface.cs (Interface.FindMembers): Added
14814         `TypeBuilder.BaseType != null' check.
14815
14816         * rootcontext.cs (RootContext.ResolveCore): Added
14817         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14818         classes_second_stage.
14819
14820         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14821         debug_type and trace_type when compiling with --nostdlib.       
14822
14823 2002-06-07  Martin Baulig  <martin@gnome.org>
14824
14825         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14826         (AddField): Set it to true when adding a non-static field.
14827         (DefineType): Use `have_nonstatic_fields' to find out whether we
14828         have non-static fields, not `Fields != null'.
14829
14830 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14831
14832         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14833         dereferencing a null on the static-field code path)
14834
14835 2002-05-30  Martin Baulig  <martin@gnome.org>
14836
14837         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14838         to take command line arguments.  Use reflection to call the new
14839         custom `Initialize' function on the symbol writer and pass it the
14840         command line arguments.
14841
14842         * driver.cs (--debug-args): New command line argument to pass command
14843         line arguments to the symbol writer.
14844
14845 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14846
14847         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14848         the target type for indexers and properties.  Thanks to Joe for
14849         catching this.
14850
14851 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14852
14853         * typemanager.cs (MethodFlags): returns the method flags
14854         (Obsolete/ShouldIgnore) that control warning emission and whether
14855         the invocation should be made, or ignored. 
14856
14857         * expression.cs (Invocation.Emit): Remove previous hack, we should
14858         not do this on matching a base type, we should do this based on an attribute
14859
14860         Only emit calls to System.Diagnostics.Debug and
14861         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14862         on the command line.
14863
14864         * rootcontext.cs: Global settings for tracing and debugging.
14865
14866         * cs-tokenizer.cs (define): New utility function to track
14867         defines.   Set the global settings for TRACE and DEBUG if found.
14868
14869 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14870
14871         * interface.cs (Populate*): Pass in the TypeContainer as well as
14872         the DeclSpace as parameters so that we can create EmitContexts and
14873         then use that to apply attributes etc.
14874
14875         (PopulateMethod, PopulateEvent, PopulateProperty)
14876         (PopulateIndexer): Apply attributes everywhere.
14877
14878         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14879         etc.
14880
14881         (ApplyAttributes): Update accordingly.
14882
14883         We now apply interface attributes for all members too.
14884
14885 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14886
14887         * class.cs (Indexer.Define); Correctly check if we are explicit
14888         implementation (instead of checking the Name for a ".", we
14889         directly look up if the InterfaceType was specified).
14890
14891         Delay the creation of the PropertyBuilder.
14892
14893         Only create the PropertyBuilder if we are not an explicit
14894         interface implementation.   This means that explicit interface
14895         implementation members do not participate in regular function
14896         lookups, and hence fixes another major ambiguity problem in
14897         overload resolution (that was the visible effect).
14898
14899         (DefineMethod): Return whether we are doing an interface
14900         implementation. 
14901
14902         * typemanager.cs: Temporary hack until we get attributes in
14903         interfaces (Ravi is working on that) and we get IndexerName
14904         support in interfaces.
14905
14906         * interface.cs: Register the indexers as properties.
14907
14908         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14909         warning, I have verified that this is a bug in the .NET runtime
14910         (JavaScript suffers of the same problem).
14911
14912         * typemanager.cs (MemberLookup): When looking up members for
14913         interfaces, the parent of an interface is the implicit
14914         System.Object (so we succeed in searches of Object methods in an
14915         interface method invocation.  Example:  IEnumerable x;  x.ToString
14916         ()) 
14917
14918 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14919
14920         * class.cs (Event): Events should also register if they do
14921         implement the methods that an interface requires.
14922
14923         * typemanager.cs (MemberLookup); use the new GetInterfaces
14924         method. 
14925
14926         (GetInterfaces): The code used to lookup interfaces for a type is
14927         used in more than one place, factor it here. 
14928
14929         * driver.cs: Track the errors at the bottom of the file, we kept
14930         on going.
14931
14932         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14933         instance if the method we are calling is static!
14934
14935 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14936
14937         * attribute.cs (ApplyAttributes): Make this function filter out
14938         the IndexerName attribute (as that attribute in reality is never
14939         applied) and return the string constant for the IndexerName
14940         attribute. 
14941
14942         * class.cs (TypeContainer.Emit): Validate that all the indexers
14943         have the same IndexerName attribute, and if so, set the
14944         DefaultName attribute on the class. 
14945
14946         * typemanager.cs: The return value might contain other stuff (not
14947         only methods).  For instance, consider a method with an "Item"
14948         property and an Item method.
14949
14950         * class.cs: If there is a problem with the parameter types,
14951         return. 
14952
14953 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14954
14955         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14956         looks at user defined conversion after making a call to 
14957         StandardConversionExists - we need this for overload resolution.
14958
14959         * expression.cs : Update accordingly the various method calls.
14960
14961         This fixes 2 bugs filed against implicit user defined conversions 
14962
14963 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14964
14965         * statement.cs: Track the result of the assignment.
14966
14967 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14968
14969         * expression.cs (MemberAccess): Improved error reporting for
14970         inaccessible members.
14971
14972 2002-05-22  Martin Baulig  <martin@gnome.org>
14973
14974         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14975         itself with debugging support.
14976
14977 2002-05-22  Martin Baulig  <martin@gnome.org>
14978
14979         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14980         Removed, this isn't needed anymore.
14981
14982 2002-05-20  Martin Baulig  <martin@gnome.org>
14983
14984         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14985         be underlying type for an enum.
14986
14987 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14990         that splits out the loading of just the core types.
14991
14992         * rootcontext.cs (ResolveCore): Split the struct resolution in
14993         two, so we can load the enumeration underlying types before any
14994         enums are used.
14995
14996         * expression.cs (Is): Bandaid until we fix properly Switch (see
14997         bug #24985 for details).
14998
14999         * typemanager.cs (ImplementsInterface): The hashtable will contain
15000         a null if there are no interfaces implemented.
15001
15002 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * cs-parser.jay (indexer_declarator): It is fine to have array
15005         parameters
15006
15007 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15008
15009         * typemanager.cs: (RegisterBuilder): New function used to register
15010         TypeBuilders that implement interfaces.  Since
15011         TypeBuilder.GetInterfaces (as usual) does not work with lame
15012         Reflection.Emit. 
15013         (AddUserType): register interfaces.
15014
15015         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15016         dealing with TypeBuilder.  Also, arrays are showing up as
15017         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15018         methods can not be invoked on them!
15019
15020         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15021         (ImplicitReferenceConversionExists): Split out from
15022         StandardConversionExists. 
15023
15024         * expression.cs (As): We were only implementing one of the three
15025         cases for the as operator.  We now implement them all.
15026         (Is): Implement the various other cases for Is as well.
15027
15028         * typemanager.cs (CACHE): New define used to control if we want or
15029         not the FindMembers cache.  Seems to have a negative impact on
15030         performance currently
15031
15032         (MemberLookup): Nested types have full acess to
15033         enclosing type members
15034
15035         Remove code that coped with instance/static returns for events, we
15036         now catch this in RealFindMembers.
15037
15038         (RealFindMembers): only perform static lookup if the instance
15039         lookup did not return a type or an event.  
15040
15041 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * assign.cs (CompoundAssign): We pass more semantic information
15044         now to Compound Assignments than we did before: now we have all
15045         the information at hand, and now we resolve the target *before* we
15046         do the expression expansion, which allows the "CacheValue" method
15047         to have the effect we intended (before, a [x] += 1 would generate
15048         two differen ArrayAccess expressions from the ElementAccess,
15049         during the resolution process).
15050
15051         (CompoundAssign.DoResolve): Resolve target and original_source here.
15052
15053 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * expression.cs (ArrayAccess): dropped debugging information. 
15056
15057         * typemanager.cs: Small bug fix: I was always returning i_members,
15058         instead of one of i_members or s_members (depending on which had
15059         the content).
15060
15061         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15062         method is invoked before any code generation takes place, and it
15063         is a mechanism to inform that the expression will be invoked more
15064         than once, and that the method should use temporary values to
15065         avoid having side effects
15066
15067         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15068
15069         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15070         implementation.
15071
15072         * expression.cs (Indirection, ArrayAccess): Add support for
15073         CacheTemporaries in these two bad boys. 
15074
15075         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15076         ldobj or ldind_ref.  
15077         (StoreFromPtr): Handle stobj as well.
15078
15079         * expression.cs (UnaryMutator): Share more code.
15080
15081         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15082         down: I was not tracking the Filter function as well, which
15083         was affecting the results of the cache.
15084
15085 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * attribute.cs: Remove the hack to handle the CharSet property on
15088         StructLayouts. 
15089
15090 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * attribute.cs (DoResolve): More uglyness, we now only try to
15093         resolve the attribute partially, to extract the CharSet
15094         information (only if we are a StructLayout attribute).  Otherwise 
15095
15096         (GetExtraTypeInfo): Add some code to conditionally kill in the
15097         future this.   I am more and more convinced that the .NET
15098         framework has special code to handle the attribute setting on
15099         certain elements.
15100
15101         * expression.cs (IsParamsMethodApplicable): Revert my previous
15102         foreach change here, it was wrong.
15103
15104 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15105
15106         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15107         (pp_expr): do not abort on unknown input, just return.
15108         (eval): abort if there are pending chars.
15109
15110         * attribute.cs (Attribute.Resolve): Positional parameters are
15111         optional.  Deal with that case.
15112
15113         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15114         the Ansi/Unicode/Auto information for the type.
15115
15116         (TypeContainer.DefineType): instantiate the EmitContext here, as
15117         we will be using it during the type definition (to resolve
15118         attributes) and during the emit phase.
15119
15120         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15121         to pull type information out of the attributes
15122
15123         (Attribute.Resolve): track the constructor builder, and allow for
15124         multiple invocations (structs and classes will use this).
15125
15126         * ecore.cs (MemberLookupFinal): new version with all the
15127         parameters customizable.
15128
15129         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15130         constructors.  Return if the result value is null (as the error
15131         would have been flagged already by MemberLookupFinal)
15132
15133         Do not allow instances of abstract classes or interfaces to be
15134         created.
15135
15136         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15137         We have to compare the assembly property here when dealing with
15138         FamANDAssem and Assembly access modifiers, because we might be
15139         creating an assembly from *modules* (that means that we are not
15140         getting TypeBuilders for types defined in other modules that are
15141         part of this assembly).
15142
15143         (Method.Emit): If the method is marked abstract and has a body,
15144         emit an error. 
15145
15146         (TypeContainer.DefineMembers): If both the defined member and the
15147         parent name match are methods, then do not emit any warnings: let
15148         the Method.Define routine take care of flagging warnings.  But if
15149         there is a mismatch (method overrides something else, or method is
15150         overriwritten by something, then emit warning).
15151
15152         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15153         set to null, this means `do not check for the return type on the
15154         signature'. 
15155
15156         (Method.Define): set the return type for the method signature to
15157         null, so that we get methods with the same name and parameters and
15158         different return types.  This is used to flag warning 114 (you are
15159         hiding a method, and you probably want to use the new/override
15160         keywords instead).
15161
15162         * typemanager.cs (MemberLookup): Implemented proper access
15163         control, closing a long standing set of bug reports.  The problem
15164         was that the Framework only has two bits: Public and NonPublic,
15165         and NonPublic includes private and protected methods, but we need
15166         to enforce the FamANDAssem, FamOrAssem and Family. 
15167
15168 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15169
15170         * statement.cs (GotoCase): Return true: Ammounts to giving up
15171         knowledge on whether we return or not, and letting the other case
15172         be responsible for it.
15173
15174 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15175
15176         * driver.cs: Do not load directories for each file processed, only
15177         do it if there is a pattern.
15178
15179         * ecore.cs: Report readonly assigns here as well, as we might have
15180         been resolved only by MemberAccess.
15181
15182         (SimpleName.SimpleNameResolve): Also be useful for LValue
15183         resolution.   We need this to propagate assign to local readonly variables
15184
15185         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15186         do not want to reuse potential criteria memory.
15187
15188         * class.cs (MyEventBuilder): Set reflected_type;
15189
15190         * ecore.cs (Constantify): Added support for constifying bools.
15191
15192         (RootContext.LookupType): Added a cache for values looked up in
15193         the declaration space.
15194
15195         * typemanager.cs (FindMembers): Now is a front-end to
15196         RealFindMembers, and provides a two-level hashtable-based cache to
15197         the request.  
15198
15199         15% performance improvement: from 22.5 to 19.2 seconds.
15200
15201         * expression.cs (IsParamsMethodApplicable): use foreach.
15202         (Invocation.DoResolve): ditto.
15203         (New.DoResolve): ditto.
15204         (ArrayCreation.DoResolve): ditto.
15205
15206         * ecore.cs (FindMostEncompassingType): use foreach.
15207
15208         * delegate.cs (NewDelegate.DoResolve): Use foreach
15209
15210         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15211         (RemoveMethods): use foreach.
15212
15213         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15214         nested foreach statements instead of for, and also break out of
15215         the inner loop once a match is found.
15216
15217         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15218
15219 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15222         we actually unwrap the expression to allow for extra information
15223         to be extracted. 
15224
15225         * expression.cs: Use Shr_Un on unsigned operations. 
15226
15227 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15228
15229         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15230         applicable operators was not being considered correctly. This closes
15231         the bug Miguel reported.
15232
15233 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15234
15235         * attribute.cs: check that the type derives from System.Attribute
15236         and report the correct error in that case (moved the duplicate code to
15237         its own method, too).
15238
15239 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15240
15241         * attribute.cs: lookup attribute type name as the spec says: first the
15242         bare attribute name and then name + "Attribute" (nant compiles with
15243         mcs after this fix).
15244
15245 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15248         Because of the way we parse things, we should try to see if a
15249         UIntConstant can fit in an integer.
15250
15251 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15252
15253         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15254         when we are in an explicit context.
15255
15256         (ConvertReferenceExplicit): When converting from Iface type S to Class
15257         T make sure the rules are implemented as an OR.
15258
15259         * parameter.cs (ParameterType): Make it a property for now although the
15260         purpose really isn't anything immediate.
15261
15262         * expression.cs (Is*Applicable): Do better checking on the parameter type
15263         of a ref/out parameter. The ones from the system assemblies are already 
15264         marked with the correct type so we don't need to do any correction.
15265
15266         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15267         the object type is standard too so include that.
15268
15269 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15270
15271         * ecore.cs (StandardConversionExists): Augment with missing code:
15272         deal with IntConstant, LongConstants and Enumerations.
15273
15274         * assign.cs: Report the error, instead of failing silently
15275
15276         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15277         typecontainer that they are declared, because the
15278         typecontainer/namespace will have the list of using clauses that
15279         need to be applied.
15280
15281         Assembly Attributes were escaping the normal registration
15282         mechanism. 
15283
15284         (EmitCode): Apply attributes within an EmitContext that represents
15285         the container they were declared on.
15286
15287         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15288
15289 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15290
15291         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15292         Revamp completely - make much cleaner as we now operate only
15293         on a set of Types.
15294
15295         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15296         to implement the logic detailed in the spec more correctly.
15297
15298         (UserDefinedConversion): Update accordingly.
15299
15300 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * statement.cs: Return flow analysis information up.
15303
15304         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15305         and the default.
15306
15307         (token): Do not consume an extra character before calling
15308         decimal_digits.
15309
15310 2002-05-06  Piers Haken <piersh@friskit.com>
15311
15312         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15313
15314 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15315
15316         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15317         EmitContext during the instance constructor initializer
15318         resolution, to stop access to instance variables.
15319
15320         This is mandated by the spec, last paragraph of the `constructor
15321         initializers' section. 
15322
15323 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15324
15325         * cs-parser.jay, class.cs (Accessor): new class used to represent
15326         an accessor (get or set).  In the past we used `null' to represent
15327         a missing accessor.  But this is ambiguous because there was no
15328         way to tell in abstract indexers/properties if one of them was
15329         specified.
15330
15331         Now there is a way of addressing that.
15332
15333         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15334         instead of FindMembers.
15335
15336         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15337         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15338
15339         * attribute.cs: Treat indexers and properties as the same in terms
15340         of applying attributes
15341
15342         * ecore.cs (FindMostEncompassedType): Use statically initialized
15343         EmptyExpressions()s like we do elsewhere to avoid creating useless
15344         objects (and we take this out of the tight loop).
15345
15346         (GetConversionOperators): Move the code to extract the actual
15347         operators to a separate routine to clean things up.
15348
15349 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15350
15351         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15352         events are always registered FieldBuilders.
15353
15354         * class.cs (FieldBase): New class shared by Fields 
15355
15356         * delegate.cs: If we are a toplevel delegate, use our full name.
15357         If we are a nested delegate, then only use our tail name.
15358
15359 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15360
15361         * expression.cs (IsApplicable): Ensure that we add the "&" to
15362         ref/out types before comparing it with the type of the argument.
15363
15364         (IsParamsMethodApplicable): Ditto.
15365
15366         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15367         silly me ;-)
15368
15369         * delegate.cs : Handle the case when we have more than one applicable
15370         method. Flag an error only when we finish checking all.
15371
15372 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * expression.cs: Add support for boolean static initializers.
15375
15376 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15377
15378         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15379
15380         * parameter.cs (ComputeParameterTypes,
15381         ComputeAndDefineParameterTypes): Better error handling: now we
15382         clear the `types' cache if we fail during any of the type lookups.
15383         We also return the status code correctly to our caller
15384
15385         * delegate.cs: If we fail to define a delegate, abort the extra
15386         steps. 
15387
15388         * expression.cs (Binary.ResolveOperator): for
15389         operator==(object,object) and operator !=(object, object) we also
15390         have to verify that there is an implicit conversion from one to
15391         the other.
15392
15393         (ArrayAccess.DoResolve): Array Access can operate on
15394         non-variables. 
15395
15396 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * assign.cs (CompoundAssign): A new class used as a "flag" that
15399         the assignment actually is happening as part of a compound
15400         assignment operator.
15401
15402         During compound assignment, a few new rules exist to enable things
15403         like:
15404
15405         byte b |= 1 + 2
15406
15407         From the spec:
15408
15409         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15410         to the type of x) if y is implicitly convertible to the type of x,
15411         and the operator is a builtin operator and the return type of the
15412         operator is explicitly convertible to the type of x. 
15413
15414         * rootcontext.cs: Reset warning level to 2.  4 catches various
15415         "interesting" features in mcs, we must clean this up at some
15416         point, but currently am trying to kill other bugs ;-)
15417
15418         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15419         in container classes as well.  
15420
15421         * expression.cs (Binary.ResolveOperator): Handle string case
15422         before anything else (as operator overloading does emit an error
15423         before doing anything else).
15424
15425         This code could go away when we move to a table driven model, but
15426         i could not come up with a good plan last night.
15427
15428 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15429
15430         * typemanager.cs (CSharpName): reimplementation using regex.
15431         * class.cs: added null check for fields in Emit
15432         * rootcontext.cs: set warninglevel to 4
15433
15434 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15435
15436         * typemanager.cs (CSharpName): reimplemented with Lupus
15437         suggestion.
15438
15439 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15440
15441         * statement.cs (If): correclty implement Resolve, because we were
15442         not catching sem errors in there.  The same process is needed
15443         everywhere else. 
15444         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15445
15446
15447         (Statement.Warning_DeadCodeFound): Factorize code.
15448         (While): Report dead code here too.
15449
15450         (Statement): Added Resolve virtual method to allow
15451         for resolution split from the emit code.
15452
15453 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * statement.cs (EmitBoolExpression): No longer try to resolve the
15456         expression here.    
15457         (MakeBoolean): New utility function that resolve, implicitly
15458         converts to boolean and tags the expression. 
15459
15460
15461         (If, Do): Implement dead code elimination.
15462         (While): Implement loop inversion
15463
15464         (Do, While, For, If): Resolve the expression prior to calling our
15465         code generation.
15466
15467 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15468
15469         * class.cs:
15470           - added method Report28 (warning: program has more than one entry point)
15471           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15472           - modified method Method.Define, the part at the end of the method
15473
15474         * rootcontext.cs: added static public Location EntryPointLocation;
15475           
15476         * ../errors/cs0028.cs : Add test case for the above warning.              
15477
15478         * typemanager.cs:
15479           - modified method CSharpName to allow arrays of primitive type to
15480             be printed nicely (e.g. instead of System.Int32[][] it now prints
15481             int[][])
15482           - added method CSharpSignature: returns the signature of a method
15483             in string format to be used in reporting errors, warnings, etc.
15484
15485         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15486         with String.Empty.
15487
15488 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15489
15490         * delegate.cs (Define): Fix extremely silly bug where I was
15491         setting the type of the 'object' parameter of the BeginInvoke
15492         method to System.IAsyncResult instead of System.Object ;-)
15493
15494 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15495
15496         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15497         here. 
15498
15499         (Constructor.Emit): return if we fail to initialize the
15500         constructor.  Another door closed!  
15501
15502         * expression.cs (New.DoResolve): Improve error message (from -6 to
15503         1501).  Use DeclaredOnly lookup to find the exact constructor.
15504
15505         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15506         loop.  This is useful.
15507
15508         * cs-parser.jay: Adjust the default parameters so that destructors
15509         have the proper signature.
15510
15511 2002-04-26  Martin Baulig  <martin@gnome.org>
15512
15513         * driver.cs (LoadAssembly): If `assembly' contains any characters
15514         which are only valid in path names and not in assembly names
15515         (currently slash, backslash and point), use Assembly.LoadFrom ()
15516         instead of Assembly.Load () on the `assembly' (before iteration
15517         over the link_paths).
15518
15519 2002-04-26  Martin Baulig  <martin@gnome.org>
15520
15521         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15522
15523 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15524
15525         * class.cs (Property): use the new typemanager.MemberLookup
15526
15527         (TypeContainer.MemberLookup): Implement using the
15528         TypeManager.MemberLookup now. 
15529
15530         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15531         and return MemberInfos, so that these can be used without an
15532         EmitContext (what we had before).
15533
15534 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * expression.cs: Fix the case where the argument to params if the
15537         type of the params.  I omitted handling this before.   Fixed
15538
15539 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * driver.cs: Call BootCorlib_PopulateCoreType
15542
15543         * class.cs (Property.CheckBase): Check for properties only, not
15544         for all members. 
15545
15546         * interface.cs: Temporary hack: try/catch around the
15547         CustomAttributeBuilder, because I am getting an exception that I
15548         do not understand.
15549
15550         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15551         types whose definitions are required to be there (attributes are
15552         defined before standard types).
15553
15554         Compute definitions as we boot the various types, as they are used
15555         immediately (value_type class will need object_type, but if we do
15556         not initialize object_type, we will pass a null, which will let
15557         the runtime pick the System.Object from the existing corlib, which
15558         is not what we want).
15559
15560 2002-04-22  Patrik Torstensson <totte@labs2.com>
15561
15562         * cs-tokenizer.cs: fixed a number of trim() issues.
15563
15564 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15565
15566         * expression.cs (Argument.Type): Ensure that we return the correct
15567         type when we have out or ref parameters [in which case we 
15568         append a "&"].
15569
15570 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15571
15572         * class.cs (Property, Indexer): Allow extern modifier in there. 
15573
15574         * typemanager.cs (InitBaseTypes): Initializes object_type and
15575         value_type, since those will be used early on during the bootstrap
15576         process to compile corlib.
15577
15578         (InitCoreTypes): Move code from here to InitBaseTypes.
15579
15580 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15583         single-dimension arrays as using the ldlen opcode.  
15584
15585         Daniel Lewis discovered this optimization.  
15586
15587         * typemanager.cs: Add signature for System.Array::get_Length
15588
15589 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15590
15591         * statement.cs: report the error when the foreach does not apply to an
15592         array nor a collection.
15593
15594 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15595
15596         * expression.cs: Add implicit conversions to the operator ~.
15597
15598         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15599
15600         * typemanager.cs: Locate the decimal constructor.
15601
15602 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15603
15604         * attribute.cs: use the new property of TypeOf.
15605         * expression.cs: added 'get' property around typearg.
15606
15607         These changes fix a build breaker reported by NickD. Is this the
15608         correct way to fix?  If not, please, revert my changes and make it
15609         work :-).
15610
15611 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15612
15613         * attribute.cs: Add support for typeof in attribute invocations.
15614         I am not sure that this is right though.
15615
15616 2002-04-14  Duncan Mak  <duncan@ximian.com>
15617
15618         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15619         Binary.Operator.Division case.
15620
15621 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15622
15623         * class.cs (DefineType): Ensure that we do a proper check on
15624         attribute types and also register it with the TypeManager.
15625
15626         (TypeContainer.Targets): The default for attribute types is
15627         AttributeTargets.All.
15628
15629         * attribute.cs (ApplyAttributes): Registering the attribute type
15630         is done elsewhere, not when we discover we have a Usage attribute.
15631
15632 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15633
15634         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15635         and get rid of is_delegate parameter.
15636
15637         * everywhere : update.
15638
15639 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15640
15641         * cs-parser.jay (compilation_unit): Revamp completely to use
15642         some new ideas that I got from Rhys' grammar to solve the problems
15643         with assembly level attributes.
15644
15645         (outer_declaration): New grammar production.
15646
15647         (attribute_sections): Add.
15648
15649         (opt_attributes): Base on attribute_sections
15650
15651         (namespace_declaration): Allow opt_attributes to tackle the case
15652         when we have assembly level attributes - we are clever in this
15653         regard now ;-)
15654
15655         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15656         attributes in the non-global context.
15657
15658         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15659         instead of SetGlobalAttributes.
15660
15661         * class.cs, rootcontext.cs : Ensure we define and generate 
15662         attribute types before anything else.
15663
15664         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15665         and flag the new error -20 for the case when the attribute type
15666         does not have valid targets specified. csc does not catch this.
15667
15668         * ../errors/errors.txt : update for error # -20
15669
15670 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15671
15672         * support.cs (InternalParameters.ParameterModifier): Do some null
15673         checking and return sane values.
15674
15675         * class.cs (Method.Define): If we are a PInvoke method, ensure
15676         that we are static and extern. Report error # 601
15677
15678         * ../errors/cs0601.cs : Add test case for the above error.
15679
15680 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15681
15682         * rootcontext.cs (attribute_types): We need to keep type of
15683         all attribute types separately and emit code for them first.
15684
15685         (RegisterAttribute) : Implement.
15686
15687         * class.cs (DefineType): Check if the current Type is a custom
15688         attribute type and register it accordingly.
15689
15690         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15691         adding the first attribute twice and rename to
15692
15693         (SetGlobalAttributes): this.
15694
15695         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15696         lookups.
15697
15698         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15699         if we are processing global arguments. Hmm, I am unsure of this.
15700
15701 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15702
15703         * expression.cs: added static array of strings to avoid calling
15704         Enum.ToString () for Operator in Binary. Significant recover of
15705         performance.
15706
15707 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15708
15709         * class.cs (FindMembers): Allow the Builders of the various
15710         members to be null.  If they are skip them.  This only happens
15711         during the PInvoke declaration.
15712
15713 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15714
15715         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15716         failure, so we do not keep going afterwards.
15717
15718         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15719         wanted to pass `false' as the `is_delegate' argument.  If this is
15720         the case, why not use delegate_type == null to mean `is_delegate =
15721         false' and anything else as is_delegate = true.
15722
15723 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15724
15725         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15726         code for the section, not the beginning of the tests.
15727
15728 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15729
15730         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15731
15732         * expression.cs (Binary): same.  Warn about errors where we have
15733         Enum/Enum in operator + as well.
15734
15735 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15736
15737         * statement.cs:
15738                 - added support for switch(bool)
15739                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15740                 - add TableSwitchEmit() to handle table-based switch statements
15741
15742 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15743
15744         * expression.cs (Invocation.OverloadResolve): Factor out code which
15745         does parameter compatibility checking with arguments so that we can 
15746         re-use the code even from Delegate.VerifyApplicability
15747
15748         (VerifyArgumentsCompat): Move above code here.
15749
15750         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15751         and instead make a call to the above method.
15752
15753 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15754
15755         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15756         We use it to keep track of classes which are attribute types.
15757
15758 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15759
15760         * delegate.cs (Delegate.Define): Correctly define the types in the
15761         presence of fixed and array parameters.
15762
15763         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15764         doing FindMembers.
15765
15766         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15767         include NonPublic after the first iteration.
15768
15769         * class.cs (Indexer.CheckBase): Only check if both parents are
15770         non-null. 
15771
15772         * cs-parser.jay (accessor_body): If empty, set to null.
15773
15774         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15775         same code path here to resolve constants names that we did have in
15776         MemberAccess.DoResolve.  There is too much code duplicated here.
15777
15778 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15781
15782         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15783         to MakeUnionSet.
15784
15785         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15786         tokens, numbers and strings.
15787
15788         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15789         parenthesis.
15790
15791         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15792         asyncronous parameters and the regular parameters.  
15793
15794         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15795         specify the target directory.
15796
15797         * expression.cs: (This.DoResolve): Simplify
15798         (As.Emit): Optimize, do not generate IsInst if the expression is
15799         always of the given type.
15800
15801         (Is.DoResolve): Bug fix, we were reporting both always/never for
15802         the is expression.
15803
15804         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15805         creating too many unnecessary arrays.
15806
15807 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15808
15809         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15810         fields instead of rolling our own initializer.   Takes care of all
15811         implicit conversions, and drops unnecessary static checks/argument.
15812
15813 2002-03-31  Dick Porter  <dick@ximian.com>
15814
15815         * driver.cs: use the GetDirectories() return values properly, and
15816         use "/" as path separator.
15817
15818 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15819
15820         * expression.cs (Unary): Optimize - - expr into expr.
15821         (Binary): Optimize a + (-b) into a -b.
15822
15823         * codegen.cs (CodeGen): Made all methods static.
15824
15825 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * rootcontext.cs: 
15828
15829         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15830         TypeBuilder property.
15831
15832         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15833         instead. 
15834
15835         * tree.cs: Removed the various RecordXXXX, and replaced with a
15836         single RecordDecl.  Removed all the accessor methods, and just
15837         left a single access point Type 
15838
15839         * enum.cs: Rename DefineEnum to DefineType.
15840
15841         * decl.cs: New abstract method `DefineType' used to unify the
15842         Defines for Enumerations, Interfaces, TypeContainers and
15843         Delegates.
15844
15845         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15846         LookupBaseClasses method that used to live in class.cs and
15847         interface.cs here, and renamed to FindType.
15848
15849         * delegate.cs: Implement DefineType.  Take advantage of the
15850         refactored pattern for locating the parent builder without taking
15851         the parent_builder argument (which we know does not work if we are
15852         nested, and triggering a toplevel definition).
15853
15854 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15855
15856         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15857         accessibility of a member has changed during override and report
15858         an error if so.
15859
15860         * class.cs (Method.Define, Property.Define): Only complain on
15861         overrides if the method is private, any other accessibility is
15862         fine (and since we just checked the permission is the same, we are
15863         good to go).
15864
15865         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15866         and elif are processed always.  The other pre-processing
15867         directives are only processed if we are "taking" the path
15868
15869 2002-03-29  Martin Baulig  <martin@gnome.org>
15870
15871         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15872         current location is not Null.
15873
15874         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15875         a separate method so we can profile it.
15876
15877         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15878         `span.Seconds' are just seconds, but no minutes or hours.
15879         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15880
15881 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15882
15883         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15884         Remove the gratuitous set of Final:
15885
15886                                 // If an interface implementation, then we can set Final.
15887                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15888                                     implementing.DeclaringType.IsInterface)
15889                                         flags |= MethodAttributes.Final;
15890
15891         I do not know what I was smoking when I used that.
15892
15893
15894         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15895         step into fixing the name resolution issues for delegates and
15896         unifying the toplevel name resolution.
15897
15898 2002-03-28  Martin Baulig  <martin@gnome.org>
15899
15900         * class.cs (Method.Emit): If we have a symbol writer, call its
15901         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15902         tell it about the current method.
15903
15904         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15905         writer that we're going to emit the first byte of IL code for a new
15906         statement (a new source line).
15907         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15908         EmitContext.Mark() before emitting any code.
15909
15910         * location.cs (SymbolDocument): Return null when we're Null.
15911
15912         * statement.cs (Statement): Moved the `Location loc' variable here.
15913         (Statement.EmitBoolExpression): If we have a symbol writer, call
15914         ec.Mark() before emitting any code to tell it that we're at the
15915         beginning of a new statement.
15916         (StatementExpression): Added `Location' argument to the constructor.
15917         (Block): Added public readonly variable `StartLocation' and public
15918         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15919         (Block): Added constructor which takes a start and end location.
15920         (Block.SetEndLocation): New method. This sets the end location.
15921         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15922         local variables we create.
15923         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15924         each statement and do also mark the begin and end of the block.
15925
15926         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15927         tell it the current lexer.Location, use Location.Null for the end of the
15928         block.
15929         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15930         current block, set its end location using SetEndLocation().
15931         (statement_expression): StatementExpression constructor now takes the
15932         lexer.Location as additional argument.
15933         (for_statement, declare_local_variables): Likewise.
15934         (declare_local_variables): When creating a new implicit block, use the
15935         new Block constructor and pass it the lexer.Location.
15936
15937 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15938
15939         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15940         members also on the parent interfaces recursively.
15941
15942 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * report.cs: Use new formats, since Gonzalo finished the missing
15945         bits. 
15946
15947         * expression.cs (Binary.ResolveOperator): added missing operator|
15948         operator& and operator^ for bool/bool.
15949
15950         * cs-parser.jay: CheckDef now takes a Location argument that is
15951         used to report errors more precisly (instead of reporting the end
15952         of a definition, we try to track something which is a lot closer
15953         to the source of the problem).
15954
15955         * cs-tokenizer.cs: Track global token use, so we can properly flag
15956         the use of #define/#undef after the first token has been seen.
15957
15958         Also, rename the reportXXXX to Error_DescriptiveName
15959
15960         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15961         TypeContainer, so that Enum and Interface can use this too.
15962
15963         * class.cs (TypeContainer.LookupInterfaceOrClass,
15964         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15965         `builder' argument.  Typically this was used to pass the parent
15966         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15967         the definition).  
15968
15969         The problem is that a nested class could trigger the definition of
15970         a toplevel class, and the builder would be obviously wrong in that
15971         case. 
15972
15973         So we drop this argument, and we compute dynamically the
15974         TypeBuilder/ModuleBuilder (the correct information was available
15975         to us anyways from DeclSpace.Parent)
15976
15977         * interface.cs (Interface.DefineInterface): Drop builder
15978         parameter cleanup like class.cs
15979
15980         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15981         like class.cs
15982
15983         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15984         values. 
15985
15986         (Try.Emit): Propagate the returns value from the statement.
15987
15988         (Return.Emit): Even if we are leavning 
15989
15990         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15991
15992         * modifiers.cs: Fix the computation of MethodAttributes flags.
15993
15994 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15995
15996         * driver.cs: allow compilation of files that start with '/'.
15997         Add a default case when checking the argument of --target.
15998
15999 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16000
16001         * interface.cs: Implement the same search algorithm for types in
16002         the interface code.
16003
16004         * delegate.cs: Do not allow multiple definition.
16005
16006         * Recovered ChangeLog that got accidentally amputated
16007
16008         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16009
16010         * rootcontext.cs: Load manually enum to allow core classes to
16011         contain enumerations.
16012
16013         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16014         Update to new static methods in TypeManager.
16015
16016         * typemanager.cs (GetMethod, GetConstructor): Use our
16017         implementation of FindMembers to find the members, since during
16018         corlib compilation, the types are TypeBuilders and GetMethod and
16019         GetConstructor do not work.
16020
16021         Make all methods in TypeManager static.
16022
16023         (InitCodeHelpers): Split the functionality from
16024         the InitCodeTypes function.
16025
16026         * driver.cs: Call InitCodeHelpers after we have populated the
16027         types. 
16028
16029         * cs-parser.jay (delegate_declaration): we did not used to compute
16030         the delegate name correctly for void delegates.
16031
16032 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * rootcontext.cs (RootContext): Init the interface_resolve_order
16035         and type_container_resolve_order always.
16036
16037         (ResolveCore, BootstrapCorlib_ResolveClass,
16038         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16039         compiler when compiling with --nostdlib
16040
16041         * class.cs (TypeContainer.DefineType): Check that our parent is
16042         not null.  This test is most important when we are bootstraping
16043         the core types.
16044
16045         * codegen.cs: Split out the symbol writing code.
16046
16047 2002-03-25  Martin Baulig  <martin@gnome.org>
16048
16049         * driver.cs (-g): Made -g an alias for --debug.
16050
16051 2002-03-24  Martin Baulig  <martin@gnome.org>
16052
16053         * codegen.cs (SymbolWriter): New public variable. Returns the
16054         current symbol writer.
16055         (CodeGen): Added `bool want_debugging_support' argument to the
16056          constructor. If true, tell the ModuleBuild that we want debugging
16057         support and ask it for the ISymbolWriter.
16058         (Save): If we have a symbol writer, call it's Close() method after
16059         saving the assembly.
16060
16061         * driver.c (--debug): New command line argument to create a
16062         debugger information file.
16063
16064         * location.cs (SymbolDocument): New public property. Returns an
16065         ISymbolDocumentWriter object for the current source file or null
16066         if we don't have a symbol writer.
16067
16068 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * driver.cs (LoadAssembly): Correctly return when all the paths
16071         have been tried and not before.
16072
16073         * statement.cs (Switch.Emit): return the actual coverage for this
16074         statement (returns/not-returns)
16075
16076         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16077         switch of the statement if we are the last switch section.  That
16078         kills two problems: try/catch problems (we used to emit an empty
16079         nop at the end) and switch statements where all branches would
16080         return. 
16081
16082 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16083
16084         * driver.cs: Add default assemblies (the equivalent to the
16085         Microsoft CSC.RSP file)
16086
16087         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16088         also update tokens_seen and set it to false.
16089
16090         * driver.cs: Implement --recurse for Mike.
16091
16092         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16093         correctly splitting out the paths.
16094
16095 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16096
16097         * interface.cs (Interface.PopulateProperty): Instead of using
16098         `parent' as the declaration space for the set parameters, use
16099         `this' 
16100
16101         * support.cs (InternalParameters): InternalParameters constructor
16102         takes a DeclSpace instead of a TypeContainer.
16103
16104         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16105         types are being initialized, load the address of it before calling
16106         the function.  
16107
16108         (New): Provide a mechanism to disable the generation of local
16109         value type temporaries when the caller will be providing us with
16110         an address to store it.
16111
16112         (ArrayCreation.EmitDynamicInitializers): Use it.
16113
16114 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * expression.cs (Invocation.EmitArguments): Only probe for array
16117         property if there is more than one argument.  Sorry about that.
16118
16119         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16120         empty param arrays.
16121
16122         * class.cs (Method.LabelParameters): Fix incorrect code path that
16123         prevented the `ParamArrayAttribute' from being applied to the
16124         params attribute.
16125
16126 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16127
16128         * support.cs (ReflectionParameters): Correctly compute whether the
16129         last argument is a params array.  Fixes the problem with
16130         string.Split ('a')
16131
16132         * typemanager.cs: Make the assemblies array always be non-null
16133         (empty, but non-null)
16134
16135         * tree.cs (RecordDecl): New function that abstracts the recording
16136         of names.  This reports error 101, and provides a pointer to the
16137         previous declaration.  Fixes a crash in the compiler.
16138
16139         * cs-parser.jay (constructor_declaration): Update to new grammar,
16140         and provide a constructor_body that can be empty.
16141
16142 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16143
16144         * driver.cs: Add support for --resources.
16145
16146         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16147         Make all types for the various array helper methods be integer.
16148
16149         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16150         CheckState to ConvCast.
16151
16152         (ConvCast): Now it takes a `checked' state argument, to avoid
16153         depending on the emit context for the conversion, and just using
16154         the resolve time setting.
16155
16156         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16157         instead of Invocation.EmitArguments.  We do not emit the original
16158         arguments, instead we emit those which have been converted to
16159         unsigned int expressions.
16160
16161         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16162
16163         * codegen.cs: ditto.
16164
16165         * expression.cs (LocalVariableReference): Drop the use of the
16166         Store function that depended on the variable index.
16167
16168         * statement.cs (VariableInfo): Drop the `Idx' property from this
16169         class, as this is not taking into account the indexes for
16170         temporaries tat we generate during the execution, getting the
16171         indexes wrong.
16172
16173         * class.cs: First emit class initializers, then call the parent
16174         constructor. 
16175
16176         * expression.cs (Binary): Fix opcode emision.
16177         (UnaryMutator.EmitCode): Support checked code generation
16178
16179         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16180         matches for events for both the Static and Instance scans,
16181         pointing to the same element.   Fix that.
16182
16183 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16184
16185         * rootcontext.cs (ResolveTree): Always set the
16186         interface_resolve_order, because nested interfaces will be calling
16187         into us.
16188
16189         * class.cs (GetInterfaceOrClass): Track the same resolution
16190         process used by TypeManager.LookupType.  This fixes the nested
16191         type lookups in class declarations (separate path from
16192         LookupType). 
16193
16194         (TypeContainer.DefineType): Also define nested interfaces.
16195         (TypeContainer.RegisterOrder): New public function used to
16196         register the order in which child interfaces need to be closed.
16197
16198         Nested interfaces need to be closed after their parents have been
16199         created. 
16200
16201         * interface.cs (InterfaceAttr): Put all the logic for computing
16202         the interface attribute here. 
16203
16204         (DefineInterface): Register our interface order with the
16205         RootContext or with the TypeContainer depending on the case.
16206
16207 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * cs-parser.jay: rework foreach statement to work with the new
16210         changes to the policy on SimpleNames.
16211
16212         * report.cs: support Stacktrace on warnings as well.
16213
16214         * makefile: drop --unsafe and /unsafe from the compile.
16215
16216 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16217
16218         * ecore.cs (StandardConversionExists): Modify to take an Expression
16219         as the first parameter. Ensure we do null -> reference type conversion
16220         checking.
16221
16222         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16223         temporary Expression objects.
16224
16225 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16226
16227         * interface.cs: workaround bug in method overloading resolution
16228         (there is already a bugzilla bug for it).
16229
16230 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16231
16232         We could also solve this problem by having a separate path for
16233         performing type lookups, instead of DoResolve, we could have a
16234         ResolveType entry point, and only participating pieces of the
16235         production (simplename, deref, array) would implement this. 
16236
16237         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16238         signal SimpleName to only resolve type names and not attempt to
16239         resolve anything else.
16240
16241         * expression.cs (Cast): Set the flag.
16242
16243         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16244
16245         * class.cs: Only report 108 if there is no `new' modifier.
16246
16247         * cs-parser.jay: rework foreach statement to work with the new
16248         changes to the policy on SimpleNames.
16249
16250         * report.cs: support Stacktrace on warnings as well.
16251
16252         * makefile: drop --unsafe and /unsafe from the compile.
16253
16254 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16255
16256         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16257         lookups here, instead of doing that at parse time.  This means
16258         that our grammar will not introduce `LocalVariableReferences' as
16259         expressions at this point.  That solves the problem of code like
16260         this:
16261
16262         class X {
16263            static void Main ()
16264            { int X = 1;
16265             { X x = null }}}
16266
16267         This is only half the fix.  The full fix requires parameters to
16268         also be handled in this way.
16269
16270         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16271         makes the use more obvious of the DeclSpace.  The
16272         ec.TypeContainer.TypeBuilder is now only used to pull the
16273         TypeBuilder for it.
16274
16275         My theory is that I can get rid of the TypeBuilder completely from
16276         the EmitContext, and have typecasts where it is used (from
16277         DeclSpace to where it matters).  
16278
16279         The only pending problem is that the code that implements Aliases
16280         is on TypeContainer, and probably should go in DeclSpace.
16281
16282         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16283         lookups here, instead of doing that at parse time.  This means
16284         that our grammar will not introduce `LocalVariableReferences' as
16285         expressions at this point.  That solves the problem of code like
16286         this:
16287
16288         class X {
16289            static void Main ()
16290            { int X = 1;
16291             { X x = null }}}
16292
16293         This is only half the fix.  The full fix requires parameters to
16294         also be handled in this way.
16295
16296         * class.cs (Property.DefineMethod): When implementing an interface
16297         method, set newslot, when implementing an abstract method, do not
16298         set the flag (before we tried never setting it, or always setting
16299         it, which is the difference).
16300         (Indexer.DefineMethod): same.
16301         (Method.DefineMethod): same.
16302
16303         * ecore.cs: Only set the status used flag if we get back a Field.
16304
16305         * attribute.cs: Temporary hack, so Paolo can keep working.
16306
16307 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16308
16309         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16310         the unmanaged type in the case we have a MarshalAs attribute.
16311
16312         (Resolve): Handle the case when we are parsing the special MarshalAs
16313         attribute [we need to store the unmanaged type to use later]
16314
16315         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16316         MarshalAs Attribute.
16317
16318         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16319         on parameters and accordingly set the marshalling info.
16320
16321 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16322
16323         * class.cs: Optimizing slightly by removing redundant code after
16324         we switched to the `NoTypes' return value.
16325         (Property.DefineMethod): use NoTypes here too.
16326
16327         This fixes the bug I introduced in my last batch of changes.
16328
16329 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16330
16331         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16332
16333         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16334         Enums since those are types too. 
16335
16336         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16337
16338         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16339         thanks to a call during the lookup process.
16340
16341 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * statement.cs (Foreach): Lots of work to accomodate a particular
16344         kind of foreach statement that I had not kept in mind.  It is
16345         possible to have foreachs on classes that provide a GetEnumerator
16346         method that return objects that implement the "pattern" for using
16347         a foreach, there is no need to support GetEnumerator
16348         specifically. 
16349
16350         This is needed to compile nant.
16351
16352         * decl.cs: Only report 114 if the member is not `Finalize' and if
16353         the warning level is at least 2.
16354
16355         * class.cs: Moved the compare function from Method to
16356         MethodSignature. 
16357
16358         (MethodSignature.InheritableMemberSignatureCompare): Add new
16359         filter function that is used to extract inheritable methods from a
16360         class. 
16361
16362         (Method.Define): Use the new `inheritable_method_signature_filter'
16363         delegate
16364
16365         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16366         command. 
16367
16368 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16369
16370         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16371
16372         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16373
16374         * expression.cs: Pass location information to
16375         ConvertImplicitStandard. 
16376
16377         * class.cs: Added debugging code to track return values from
16378         interfaces. 
16379
16380 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * expression.cs (Is.DoResolve): If either side of the `is' is an
16383         interface, do not flag the warning.
16384
16385         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16386         for interfaces
16387
16388         * report.cs: Allow for --fatal to be used with --probe.
16389
16390         * typemanager.cs (NoTypes): Move the definition for the empty Type
16391         array here. 
16392
16393         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16394         properties. 
16395         (TypeContainer.DefineProxy): New function used to proxy to parent
16396         implementations when implementing interfaces.
16397         (TypeContainer.ParentImplements): used to lookup if our parent
16398         implements a public function that is required by an interface.
16399         (TypeContainer.VerifyPendingMethods): Hook this up.
16400
16401         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16402         `modules' and `assemblies' arraylists into arrays.  We only grow
16403         these are the very early start up of the program, so this improves
16404         the speedof LookupType (nicely measured).
16405
16406         * expression.cs (MakeByteBlob): Replaced unsafe code with
16407         BitConverter, as suggested by Paolo.
16408
16409         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16410         folding of string concatenation, but if either side is a string,
16411         and the other is not, then return null, and let the runtime use
16412         the concatenation on the string plus the object (using
16413         `Object.ToString'). 
16414
16415 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16416
16417         Constant Folding has been implemented now.
16418
16419         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16420         the error instead on types that are not supported in one's
16421         complement. 
16422
16423         * constant.cs (Constant and all children): New set of functions to
16424         perform implict and explicit conversions.
16425
16426         * ecore.cs (EnumConstant): Implement the new functions to perform
16427         conversion by proxying to the child expression.
16428
16429         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16430         own separate setting that can not be turned off from the command
16431         line using --unchecked or --checked and is only controlled using
16432         the checked/unchecked statements and expressions.  This setting is
16433         used by the constant folder to flag errors.
16434
16435         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16436         ConstantCheckState as well.   
16437
16438         During Resolve, they also have to flag the state, because the
16439         constant folder runs completely in the Resolve phase.
16440
16441         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16442         well.
16443
16444 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16445
16446         * cfold.cs: New file, this file contains the constant folder.
16447
16448         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16449         argument to track whether we are using the resulting address to
16450         load or store a value and provide better error messages. 
16451
16452         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16453         new AddressOf arguments.
16454
16455         * statement.cs (Foreach.EmitCollectionForeach): Update
16456
16457         * expression.cs (Argument.Emit): Call AddressOf with proper
16458         arguments to track usage.
16459
16460         (New.DoEmit): Call AddressOf with new arguments.
16461
16462         (Unary.Emit): Adjust AddressOf call.
16463
16464 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16465
16466         * cs-parser.jay (member_access): Change the case for pre-defined types
16467         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16468         this suggestion.
16469
16470         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16471         a method body.
16472
16473         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16474         essentially like methods and apply attributes like MethodImplOptions to them too.
16475
16476         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16477         not being null.
16478
16479         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16480         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16481         is the DeclSpace.
16482
16483         * Update code everywhere accordingly.
16484
16485         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16486
16487         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16488
16489 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16490
16491         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16492         try performing lookups against those instead of jumping straight into using
16493         the 'using' clauses.
16494
16495         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16496
16497         (LookupType): Perform lookups in implicit parents too.
16498
16499         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16500         sequence as RootContext.LookupType. 
16501
16502         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16503         the various cases of namespace lookups into this method.
16504
16505 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16506
16507         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16508         in positional arguments)
16509
16510         * class.cs (Operator): Update the AllowedModifiers to contain
16511         extern. 
16512
16513         * cs-parser.jay: Update operator declaration to allow for the
16514         operator body to be empty.
16515
16516         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16517         values. 
16518
16519 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16520
16521         * class.cs (Method.Emit): Label parameters.
16522
16523         * driver.cs: Return 1 or 0 as the program exit code.
16524
16525 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * expression.cs: Special case the `null' object when trying to
16528         auto-compute the type, as anything can be explicitly converted to
16529         that. 
16530
16531         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16532         spotting this Paolo.
16533
16534         (Expression.ImplicitNumericConversion): Perform comparissions of
16535         the type using the underlying type in the case of an enumeration
16536         rather than using the enumeration type for the compare.
16537
16538         Cope with the underlying == type case, which is not possible to
16539         catch before. 
16540
16541         (Expression.ConvertNumericExplicit): Perform comparissions of
16542         the type using the underlying type in the case of an enumeration
16543         rather than using the enumeration type for the compare.
16544
16545         * driver.cs: If the user does not supply an extension, assume .exe
16546
16547         * cs-parser.jay (if_statement): Rewrote so that we can track the
16548         location for the if statement.
16549
16550         * expression.cs (Binary.ConstantFold): Only concat strings when
16551         the operation is "+", not everything ;-)
16552
16553         * statement.cs (Statement.EmitBoolExpression): Take a location
16554         argument. 
16555         (If, While, Do): Track location.
16556
16557         * expression.cs (Binary.ResolveOperator): In the object + string
16558         case, I was missing a call to ConvertImplicit
16559
16560 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16561
16562         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16563         Location arguments. Ensure we use RootContext.LookupType to do our work
16564         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16565
16566         * interface.cs (PopulateMethod): Handle the type of the parameter being
16567         null gracefully.
16568
16569         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16570         have a params method with no fixed arguments and a call is made with no
16571         arguments.
16572
16573 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16574
16575         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16576         the verbatim-string-literal
16577
16578         * support.cs (InternalParameters.ParameterModifier): handle null
16579         fixed parameters.
16580         (InternalParameters.ParameterType): ditto.
16581
16582         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16583         duplicating the name of the variable parameter.
16584         (GetParameterByName): Fix bug where we were not looking up array
16585         paramters if they were the only present (thanks Paolo!).
16586         (GetParameterInfo): We only have an empty set of types if both
16587         fixed and array are set to null.
16588         (GetParameterInfo-idx): Handle FixedParameter == null
16589
16590         * cs-parser.jay: Handle the case where there is no catch
16591         statements (missing null test).
16592
16593 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16594
16595         * driver.cs (MainDriver): Be conservative on our command line
16596         handling.
16597
16598         Catch DirectoryNotFoundException when calling GetFiles.
16599
16600         (SplitPathAndPattern): Used to split the input specification into
16601         a path and a pattern that we can feed to Directory.GetFiles.
16602
16603 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16604
16605         * statement.cs (Fixed): Implement the last case of the Fixed
16606         statement (string handling).
16607
16608         * expression.cs (StringPtr): New class used to return a char * to
16609         a string;  Used by the Fixed statement.
16610
16611         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16612
16613         * expression.cs (Binary.ResolveOperator): Remove redundant
16614         MemberLookup pn parent type.
16615         Optimize union call, we do not need a union if the types are the same.
16616         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16617         type.
16618
16619         Specialize the use of MemberLookup everywhere, instead of using
16620         the default settings. 
16621
16622         (StackAlloc): Implement stackalloc keyword.
16623
16624         * cs-parser.jay: Add rule to parse stackalloc.
16625
16626         * driver.cs: Handle /h, /help, /?
16627
16628         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16629         before we supported unsafe code.
16630
16631         * makefile: add --unsafe to the self compilation of mcs.
16632
16633 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16634
16635         * expression.cs (PointerArithmetic): New class that is used to
16636         perform pointer arithmetic.
16637         (Binary.Resolve): Handle pointer arithmetic
16638         Handle pointer comparission.
16639         (ArrayPtr): Utility expression class that is used to take the
16640         address of an array.
16641
16642         (ElementAccess): Implement array access for pointers
16643
16644         * statement.cs (Fixed): Implement fixed statement for arrays, we
16645         are missing one more case before we are done.
16646
16647         * expression.cs (Indirection): Implement EmitAssign and set the
16648         ExprClass to Variable.  This allows pointer dereferences to be
16649         treated as variables, and to have values assigned to them.
16650
16651         * ecore.cs (Expression.StoreFromPtr): New utility function to
16652         store values dereferencing.
16653
16654 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16655
16656         * expression.cs (Binary.ResolveOperator): Ensure that we are
16657         not trying to operate on a void type - this fixes the reported
16658         bug.
16659
16660         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16661         the parent implementation is sealed.
16662
16663         * ../errors/cs0239.cs : Add.
16664
16665         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16666
16667         * typemanager.cs (unverifiable_code_type): Corresponds to 
16668         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16669         which have unsafe code in them.
16670
16671         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16672         unsafe context.
16673
16674 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16675
16676         * cs-tokenizer.cs: Add support for @"litreal strings"
16677
16678         Make tokenizer accept pre-processor directives
16679         on any column (remove the old C-like limitation). 
16680
16681         * rootcontext.cs (EmitCode): Emit any global attributes.
16682         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16683
16684         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16685
16686         * cs-parser.jay: Add support for global attributes.  
16687
16688 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16689
16690         * expression.cs (Indirection): New helper class.  Unary will
16691         create Indirection classes to be able to implement the
16692         IMemoryLocation interface on it.
16693
16694 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * cs-parser.jay (fixed_statement): reference the right statement.
16697
16698         * statement.cs (Fixed.Emit): Finish implementing the fixed
16699         statement for the &x case.
16700
16701 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16702
16703         * class.cs (Property.Define, Method.Define): Remove newslot when
16704         `implementing'.  
16705
16706         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16707         wrong.  NewSlot should only be used if the `new' keyword is present.
16708
16709         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16710         locating our system dir.  Sorry about this.
16711
16712 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * driver.cs (GetSystemDir): Compute correctly the location of our
16715         system assemblies.  I was using the compiler directory instead of
16716         the library directory.
16717
16718 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16719
16720         * expression.cs (BetterFunction): Put back in what Miguel commented out
16721         since it is the correct fix. The problem is elsewhere ;-)
16722
16723         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16724         parameters of the parms method are themselves compatible or not !
16725
16726         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16727         to check that a class implements an interface before saying that an implicit
16728         conversion was allowed. Use ImplementsInterface to do the checking.
16729
16730 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16731
16732         * class.cs (Method.Define): Track whether we are an explicit
16733         implementation or not.  And only call DefineMethodOverride if we
16734         are an explicit implementation.
16735
16736         (Property.DefineMethod): Ditto.
16737
16738 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16739
16740         * expression.cs (BetterFunction): Catch hideous bug which was
16741          preventing us from detecting ambiguous calls due to implicit casts i.e
16742         cs0121.
16743
16744 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * support.cs (Pair): Remove un-needed method.  I figured why I was
16747         getting the error in cs-parser.jay, the variable in a foreach loop
16748         is readonly, and the compiler does not really treat this as a variable.
16749
16750         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16751         instead of EQUALS in grammar.  
16752
16753         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16754
16755         * expression.cs (Unary.DoResolve): Check whether the argument is
16756         managed or not.
16757
16758 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16759
16760         * support.cs: Api for Pair to set a value.  Despite the fact that
16761         the variables are public the MS C# compiler refuses to compile
16762         code that accesses the field if the variable is part of a foreach
16763         statement. 
16764
16765         * statement.cs (Fixed): Begin implementation of the fixed
16766         statement.
16767
16768         (Block.AddVariable): Return the VariableInfo on success and null
16769         on failure instead of true/false. 
16770
16771         * cs-parser.jay (foreach): Catch errors on variables already
16772         defined (we were ignoring this value before) and properly unwind
16773         the block hierarchy
16774
16775         (fixed_statement): grammar for the fixed statement.
16776
16777 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16778
16779         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16780         pointer types to be incretemented.
16781
16782         (SizeOf): Implement.
16783
16784         * cs-parser.jay (pointer_member_access): Implement
16785         expr->IDENTIFIER production.
16786
16787         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16788         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16789         on safe contexts.
16790
16791         (Unary): Implement indirection.
16792
16793         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16794         use in non-unsafe context).
16795
16796         (SimpleName.DoResolve): Check for pointers in field access on safe
16797         contexts. 
16798
16799         (Expression.LoadFromPtr): Factor the load-indirect code in this
16800         function.  This was duplicated in UnboxCast and ParameterReference
16801
16802 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16803
16804         * expression.cs (ComposedCast): report an error if a pointer cast
16805         is used in a safe region.
16806
16807         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16808         pointer type casts in unsafe context.
16809
16810         * codegen.cs (EmitContext): Set up IsUnsafe.
16811
16812         * cs-parser.jay (non_expression_type): Add productions for pointer
16813         casts. 
16814
16815         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16816         code.  We should not use force into static mode if the method is
16817         not virtual.  Fixes bug in MIS
16818
16819         * statement.cs (Do.Emit, While.Emit, For.Emit,
16820         Statement.EmitBoolExpression): Add support to Do and While to
16821         propagate infinite loop as `I do return' semantics.
16822
16823         Improve the For case to also test for boolean constants.
16824
16825         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16826         to the list of attributes we can add.
16827
16828         Remove `EmitContext' argument.
16829
16830         * class.cs (Method.Define): Apply parameter attributes.
16831         (Constructor.Define): Apply parameter attributes.
16832         (MethodCore.LabelParameters): Move here the core of labeling
16833         parameters. 
16834
16835         * support.cs (ReflectionParameters.ParameterModifier,
16836         InternalParameters.ParameterModifier): Use IsByRef on the type and
16837         only return the OUT bit for these parameters instead of in/out/ref
16838         flags.
16839
16840         This is because I miss-understood things.  The ParameterInfo.IsIn
16841         and IsOut represent whether the parameter has the [In] and [Out]
16842         attributes set.  
16843
16844 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * ecore.cs (FieldExpr.Emit): Release temporaries.
16847
16848         * assign.cs (LocalTemporary.Release): new function.
16849
16850         * codegen.cs (EmitContext.GetTemporaryStorage,
16851         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16852         temporary storage.  Now we can "put back" localbuilders when we
16853         are done with them
16854
16855 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16856
16857         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16858         need to make a copy of the variable to generate verifiable code.
16859
16860 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * driver.cs: Compute dynamically the system directory.
16863
16864         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16865         Slower, but more generally useful.  Used by the abstract
16866         registering implementation. 
16867
16868         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16869         the rules for the special rule on Type/instances.  First check if
16870         we have the same name, and if so, try that special static path
16871         rather than the instance path.
16872
16873 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16876         for, while and if.
16877
16878         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16879         Enum, ValueType, Delegate or Array for non-corlib compiles.
16880
16881         * cs-tokenizer.cs: Catch long identifiers (645)
16882
16883         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16884         piece of code.
16885
16886         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16887         fix, we were returning too early, so we were not registering
16888         pending methods from abstract classes.
16889
16890         Do not register pending methods if the class is abstract.
16891
16892         * expression.cs (Conditional.DoResolve): Report circular implicit
16893         conversions when we neecd to compute it for conditional
16894         expressions. 
16895
16896         (Is.DoResolve): If the expression is always of the provided type,
16897         flag warning 183.  If the expression can not ever be of the
16898         provided type flag warning 184.
16899
16900         * class.cs: Catch 169 as well.
16901
16902         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16903         read. 
16904
16905 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16906
16907         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16908
16909 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16910
16911         * interface.cs: (PopulateMethod): Check for pointers being defined
16912         only if the unsafe context is active.
16913         (PopulateProperty): ditto.
16914         (PopulateIndexer): ditto.
16915
16916         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16917         specified.  If pointers are present, make sure that they are
16918         present in an unsafe context.
16919         (Constructor, Constructor.Define): ditto.
16920         (Field, Field.Define): ditto.
16921         (Property, Property.Define): ditto.
16922         (Event, Event.Define): ditto.
16923
16924         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16925         hashtable if there are classes or structs defined.
16926
16927         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16928         code, as the constant resolution moved.
16929
16930         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16931         the metadata, so we can flag error 133. 
16932
16933         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16934         pointer is being declared in an unsafe context.
16935
16936 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16937
16938         * modifiers.cs (Modifiers.Check): Require a Location argument.
16939         Report error 227 for Unsafe use.
16940
16941         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16942
16943         * statement.cs (For.Emit): If the test is null, then report that
16944         we do `return', as we wont reach anything afterwards.
16945
16946         (Switch.SwitchGoverningType): Track the expression that matched
16947         the conversion.
16948
16949         * driver.cs: Allow negative numbers as an error code to flag.
16950
16951         * cs-parser.jay: Handle 1551.
16952
16953         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16954
16955 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16956
16957         * cs-parser.jay: Report 1518 (type declaration can only contain
16958         class, struct, interface, enum or delegate)
16959
16960         (switch_label): Report 1523 (keywords `case' or `default' must
16961         preced code)
16962
16963         (opt_switch_sections): Report 1522 (empty switch)
16964
16965         * driver.cs: Report 1515 (response file specified multiple times)
16966         Report 1516 (Source file specified multiple times).
16967
16968         * expression.cs (Argument.Resolve): Signal 1510
16969
16970         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16971         access not allowed in static code)
16972
16973 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16974
16975         * typemanager.cs (IsPointerType): Utility method which we are going
16976         to need a lot.
16977
16978         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16979         the object type, so we take care of that.
16980
16981         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16982
16983         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16984         added to non-params parameters :-)
16985
16986         * typemanager.cs (CSharpName): Include 'void' type too. 
16987
16988         (void_ptr_type): Include in the set of core types.
16989
16990         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16991         duplicating code.
16992
16993         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16994         an unsafe context.
16995
16996         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16997         completely forgotten about it.
16998
16999 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17000
17001         * cs-parser.jay (pointer_type): Add. This begins our implementation
17002         of parsing rules for unsafe code.
17003
17004         (unsafe_statement): Implement.
17005
17006         (embedded_statement): Modify to include the above.
17007
17008         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17009
17010         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17011         if the current context is an unsafe one.
17012
17013         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17014         are handled differently, we need separate rules for them.
17015
17016         (local_variable_declaration): Update to use local_variable_pointer_type
17017         to allow variable declarations of unmanaged pointer types.
17018
17019         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17020         in unsafe contexts.
17021
17022         * ../errors/cs0214.cs : Add.
17023
17024 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17025
17026         * makefile: remove 'response' file when cleaning.
17027
17028 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17029
17030         * cs-parser.jay: Report 1524.
17031
17032 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * typemanager.cs (RegisterMethod): drop checking if we have
17035         registered this from here
17036
17037 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * class.cs (Method.EmitDestructor): Implement calling our base
17040         destructor. 
17041
17042         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17043         value of InFinally.
17044
17045         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17046         this routine and will wrap the call in a try/catch block.  Deal
17047         with the case.
17048
17049 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17050
17051         * ecore.cs (Expression.MemberLookup): instead of taking a
17052         parameter `same_type' that was used to tell whether we could
17053         access private members we compute our containing type from the
17054         EmitContext.
17055
17056         (FieldExpr): Added partial support for volatile fields.  This does
17057         not work for volatile fields exposed from assemblies, as I can not
17058         figure out how to extract the modreq from it.
17059
17060         Updated all the source files to use this.
17061
17062         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17063         because it is referenced by MemberLookup very often. 
17064
17065 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17066
17067         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17068         TypeBuilder.GetCustomAttributes to retrieve what we need.
17069
17070         Get rid of redundant default_member_attr_type as this is the same as
17071         default_member_type which already exists.
17072
17073         * interface.cs, attribute.cs : Update accordingly.
17074
17075 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17076
17077         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17078         work for TYpeBuilders though.  Ravi, can you please fix this?
17079
17080         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17081
17082         * expression.cs (Argument.Emit): Handle the case of ref objects
17083         being passed to ref functions;  
17084
17085         (ParameterReference.EmitLoad): Loads the content of the pointer
17086         without dereferencing.
17087
17088 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17089
17090         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17091
17092 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17093
17094         * class.cs (Indexer.DefineMethod): Incorporate the interface
17095         type in the name of the method if we are doing explicit interface
17096         implementation.
17097
17098         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17099
17100         (BetterConversion): Fix extremely trivial bug where we were referring to
17101         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17102         again !
17103
17104         * ../errors/bug16.cs : Add although we have fixed it.
17105
17106 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17107
17108         * expression.cs (BaseIndexer): Begin implementation.
17109
17110         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17111
17112         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17113         production directly to remove a shift/reduce, and implement
17114         explicit interface implementation.
17115
17116         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17117         after a floating point suffix.
17118
17119         * expression.cs (DoNumericPromotions): Improved the conversion for
17120         uint/uint.  If we have a constant, we avoid doing a typecast to a
17121         larger type.
17122
17123         * class.cs (Indexer): Implement explicit interface implementation
17124         for indexers.
17125
17126 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17127
17128         * class.cs: make the default instance constructor public and hidebysig.
17129
17130 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17131
17132         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17133         so we can call it from elsewhere.
17134
17135         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17136         we emit it internally if the class has a defined indexer; otherwise the user
17137         emits it by decorating the class definition with the DefaultMemberAttribute.
17138
17139         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17140         attribute is not used on a type which defines an indexer.
17141
17142         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17143         character when we skip whitespace.
17144
17145         * ../errors/cs0646.cs : Add.
17146
17147 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17148
17149         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17150         again. 
17151
17152         * makefile: Add practical target `mcs3.exe' which builds the third
17153         generation compiler. 
17154
17155         * expression.cs (New): Fix structures constructor calling.
17156
17157         * class.cs (Property, Method, Indexer): Emit Final flag on the
17158         method if we are an interface implementation and we are not
17159         abstract. 
17160
17161         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17162         whether this property is referencing a `base' method.
17163
17164         * expression.cs (Invocation.EmitCall): take an extra argument:
17165         is_base, this is used to determine whether the `call' or
17166         `callvirt' opcode should be used.
17167
17168
17169         * delegate.cs: update EmitCall.
17170
17171         * class.cs (Method.Define): Set NewSlot for the cases where we are
17172         not implementing an interface method.
17173
17174         (Property.Define): ditto.
17175
17176 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17177
17178         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17179         'r'.  Allows mcs to parse itself fully.
17180
17181 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17182
17183         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17184         of the number of initializers that require the InitializeArray method.
17185
17186         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17187         update the above field where necessary.
17188
17189         (MakeByteBlob): Update accordingly.
17190
17191         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17192         greater than 2.
17193
17194         (EmitDynamicInitializers): Update in accordance with the new optimization.
17195
17196         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17197         same OpCode applies.
17198
17199         * cs-parser.jay : Fix some glaring errors I introduced.
17200
17201 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17202
17203         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17204         so that we can check for name clashes there too.
17205
17206         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17207         for interface indexers.
17208
17209         * interfaces.cs (Define): Emit the default member attribute.
17210
17211         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17212         variable was being referred to while setting the value ;-)
17213
17214 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17215
17216         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17217         byte-by-byte information when we know the data is zero.
17218
17219         Make the block always a multiple of 4, because
17220         DefineInitializedData has a bug.
17221
17222         * assign.cs: Fix, we should assign from the temporary, not from
17223         the source. 
17224
17225         * expression.cs (MakeByteBlob): Fix my incorrect code.
17226
17227 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17228
17229         * typemanager.cs (EnumToUnderlying): This function is used to get
17230         the underlying type from an enumeration, because it does not
17231         always work. 
17232
17233         * constant.cs: Use the I4_S form for values between -128 and 127.
17234
17235         * statement.cs (Block.LookupLabel): Looks up a label.
17236         (Block): Drop support for labeled blocks.
17237
17238         (LabeledStatement): New kind of statement that represents a label
17239         only.
17240
17241         (Goto): Finally implement this bad boy.
17242
17243         * cs-parser.jay: Update to reflect new mechanism to implement
17244         labels.
17245
17246 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17247
17248         * codegen.cs (EmitContext.This): a codegen property that keeps the
17249         a single instance of this instead of creating many different this
17250         instances. 
17251
17252         * delegate.cs (Delegate.DoResolve): Update to use the property;
17253
17254         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17255
17256         * expression.cs (BaseAccess.DoResolve): Ditto.
17257
17258 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17259
17260         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17261         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17262
17263         (InitCoreTypes): Update accordingly.
17264
17265         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17266         so we can quickly store the state.
17267
17268         (ApplyAttributes): Set the correct implementation flags
17269         for InternalCall methods.
17270
17271 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17272
17273         * expression.cs (EmitCall): if a method is not virtual, then do
17274         not use callvirt on it.
17275
17276         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17277         user defined stuff) requires the use of stobj, which takes an
17278         address on the stack instead of an array and an index.  So emit
17279         the Ldelema operation for it.
17280
17281         (EmitStoreOpcode): Use stobj for valuetypes.
17282
17283         (UnaryMutator.EmitCode): Use the right 1 value depending on
17284         whether we are dealing with int64/uint64, float or doubles.
17285
17286         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17287         constructors that I implemented last night.
17288
17289         (Constructor.IsDefault): Fix to work properly for static
17290         constructors.
17291
17292         * cs-parser.jay (CheckDef): report method signature errors.
17293         Update error number 103 to be 132.
17294
17295         * decl.cs: New AdditionResult enumeration value: MethodExists.
17296         Although we do this check for methods later on in the semantic
17297         analysis, catching repeated default constructors is so easy that
17298         we catch these here. 
17299
17300         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17301         promotions code.
17302
17303         (ParameterReference.EmitAssign, Emit): handle
17304         bools as bytes.
17305
17306         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17307         (ArrayAccess.EmitStoreOpcode): ditto.
17308
17309         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17310
17311         * expression.cs (MakeByteBlob): Complete all the missing types
17312         (uint, short, ushort, byte, sbyte)
17313
17314         * class.cs: Only init instance field initializers on instance
17315         constructors. 
17316
17317         Rename `constructors' to instance_constructors. 
17318
17319         (TypeContainer.AddConstructor): Only add constructors to the list
17320         if it is not static.
17321
17322         Make sure that we handle default_static_constructor independently
17323         everywhere where we handle instance_constructors
17324
17325 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17326
17327         * class.cs: Do not lookup or create a base initializer for a
17328         static constructor.
17329
17330         (ConstructorInitializer.Resolve): use the proper type to lookup
17331         for constructors.
17332
17333         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17334
17335         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17336         in DeclSpace. 
17337
17338         * decl.cs: CloseType is now an virtual method, the default
17339         implementation just closes this type.
17340
17341 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17342
17343         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17344         to PreserveSig by default. Also emit HideBySig on such methods.
17345
17346         Basically, set the defaults to standard values.
17347
17348         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17349         argument, if candidate is better, it can't be worse than the best !
17350
17351         (Invocation): Re-write bits to differentiate between methods being
17352         applicable in their expanded form and their normal form - for params
17353         methods of course.
17354
17355         Get rid of use_standard everywhere as only standard conversions are allowed
17356         in overload resolution. 
17357
17358         More spec conformance.
17359
17360 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * driver.cs: Add --timestamp, to see where the compiler spends
17363         most of its time.
17364
17365         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17366         `this' in static code.
17367
17368         (SimpleName.DoResolve): Implement in terms of a helper function
17369         that allows static-references to be passed upstream to
17370         MemberAccess.
17371
17372         (Expression.ResolveWithSimpleName): Resolve specially simple
17373         names when called by MemberAccess to implement the special
17374         semantics. 
17375
17376         (Expression.ImplicitReferenceConversion): Handle conversions from
17377         Null to reference types before others, as Null's type is
17378         System.Object. 
17379
17380         * expression.cs (Invocation.EmitCall): Handle the special case of
17381         calling methods declared on a reference type from a ValueType
17382         (Base classes System.Object and System.Enum)
17383
17384         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17385         the left hand side is a TypeExpr, not on every enumeration. 
17386
17387         (Binary.Resolve): If types are reference types, then do a cast to
17388         object on operators != and == of both arguments.
17389
17390         * typemanager.cs (FindMembers): Extract instance and static
17391         members if requested.
17392
17393         * interface.cs (PopulateProperty): Use void_type instead of null
17394         as the return type for the setter method.
17395
17396         (PopulateIndexer): ditto.
17397
17398 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17399
17400         * support.cs (ReflectionParameters): Fix minor bug where we
17401         were examining the wrong parameter for the ParamArray attribute.
17402
17403         Cope with requests for the type of the parameter at position
17404         greater than the params parameter's. We now return the element
17405         type of the params array as that makes more sense.
17406
17407         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17408         accordingly as we no longer have to extract the element type
17409         ourselves.
17410
17411         (Invocation.OverloadResolve): Update.
17412
17413 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17416         against IEnumerator, test whether the return value is a descendant
17417         of the IEnumerator interface.
17418
17419         * class.cs (Indexer.Define): Use an auxiliary method to implement
17420         the other bits of the method definition.  Begin support for
17421         explicit interface implementation.
17422
17423         (Property.DefineMethod): Use TypeManager.void_type instead of null
17424         for an empty return value.
17425
17426 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17427
17428         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17429         dealing with a FieldExpr which is composed of a FieldBuilder, in
17430         the code path we did extract the constant, but we should have
17431         obtained the underlying value to be able to cast it (otherwise we
17432         end up in an infinite loop, this is what Ravi was running into).
17433
17434         (ArrayCreation.UpdateIndices): Arrays might be empty.
17435
17436         (MemberAccess.ResolveMemberAccess): Add support for section
17437         14.5.4.1 that deals with the special case of E.I when E is a type
17438         and something else, that I can be a reference to a static member.
17439
17440         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17441         handle a particular array type to create byte blobs, it is just
17442         something we dont generate byteblobs for.
17443
17444         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17445         arguments. 
17446
17447         * location.cs (Push): remove the key from the hashtable that we
17448         are about to add.   This happens for empty files.
17449
17450         * driver.cs: Dispose files after we have parsed them.
17451
17452         (tokenize): new function that only runs the tokenizer on its
17453         input, for speed testing.
17454
17455 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17456
17457         * class.cs (Event.Define): Define the private field only if there
17458         are no accessors defined.
17459
17460         * expression.cs (ResolveMemberAccess): If there is no associated
17461         field with the event, that means we have an event defined with its
17462         own accessors and we should flag error cs0070 since transforming
17463         ourselves into a field is not valid in that case.
17464
17465         * ecore.cs (SimpleName.DoResolve): Same as above.
17466
17467         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17468         and charset to sane values.
17469
17470 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17471
17472         * assign.cs (DoResolve): Perform check on events only if they 
17473         are being accessed outside the declaring type.
17474
17475         * cs-parser.jay (event_declarations): Update rules to correctly
17476         set the type of the implicit parameter etc.
17477
17478         (add_accessor, remove_accessor): Set current local parameters.
17479
17480         * expression.cs (Binary): For delegate addition and subtraction,
17481         cast the return value from the method into the appropriate delegate
17482         type.
17483
17484 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17485
17486         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17487         of these as the workaround is unnecessary.
17488
17489         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17490         delegate data - none of that is needed at all.
17491
17492         Re-write bits to extract the instance expression and the delegate method
17493         correctly.
17494
17495         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17496         on delegates too.
17497
17498         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17499         of attaching attributes instead of duplicating code everywhere.
17500
17501         * everywhere : Update code to do attribute emission using the above method.
17502
17503 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17504
17505         * expression.cs (IsParamsMethodApplicable): if there are not
17506         parameters, return immediately.
17507
17508         * ecore.cs: The 0 literal can be implicity converted to an enum
17509         type. 
17510
17511         (SimpleName.DoResolve): First lookup the type, then lookup the
17512         members. 
17513
17514         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17515         want to get its address.  If the InstanceExpression is not
17516         addressable, store the result in a temporary variable, then get
17517         the address of it.
17518
17519         * codegen.cs: Only display 219 errors on warning level or above. 
17520
17521         * expression.cs (ArrayAccess): Make it implement the
17522         IMemoryLocation interface.
17523
17524         (Binary.DoResolve): handle the operator == (object a, object b)
17525         and operator != (object a, object b) without incurring into a
17526         BoxedCast (because 5 != o should never be performed).
17527
17528         Handle binary enumerator operators.
17529
17530         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17531         value type, otherwise use Ldelem_ref.
17532
17533         Use precomputed names;
17534
17535         (AddressOf): Implement address of
17536
17537         * cs-parser.jay (labeled_statement): Fix recursive block
17538         addition by reworking the production.
17539
17540         * expression.cs (New.DoEmit): New has a special case:
17541                 
17542                  If we are dealing with a ValueType, we have a few
17543                  situations to deal with:
17544                 
17545                     * The target of New is a ValueType variable, that is
17546                       easy, we just pass this as the variable reference
17547                 
17548                     * The target of New is being passed as an argument,
17549                       to a boxing operation or a function that takes a
17550                       ValueType.
17551                 
17552                       In this case, we need to create a temporary variable
17553                       that is the argument of New.
17554
17555
17556 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17557
17558         * rootcontext.cs (LookupType): Check that current_type is not null before
17559         going about looking at nested types.
17560
17561         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17562         not implement the IAssignMethod interface any more.
17563
17564         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17565         where we tranform them into FieldExprs if they are being resolved from within
17566         the declaring type.
17567
17568         * ecore.cs (SimpleName.DoResolve): Do the same here.
17569
17570         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17571
17572         * ../errors/bug10.cs : Add.
17573
17574         * ../errors/cs0070.cs : Add.
17575
17576         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17577
17578         * assign.cs : Get rid of EventIsLocal everywhere.
17579
17580 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17581
17582         * ecore.cs (ConvertIntLiteral): finished the implementation.
17583
17584         * statement.cs (SwitchLabel): Convert the value we are using as a
17585         key before looking up the table.
17586
17587 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17588
17589         * codegen.cs (EmitTopBlock): Require a Location argument now.
17590
17591         * cs-parser.jay (constructor_declarator): We need to setup
17592         current_local_parameters before we parse the
17593         opt_constructor_initializer, to allow the variables to be bound
17594         to the constructor arguments.
17595
17596         * rootcontext.cs (LookupType): First lookup nested classes in our
17597         class and our parents before we go looking outside our class.
17598
17599         * expression.cs (ConstantFold): Extract/debox the values at the
17600         beginnning. 
17601
17602         * rootcontext.cs (EmitCode): Resolve the constants first before we
17603         resolve the types.  This is not really needed, but it helps debugging.
17604
17605         * statement.cs: report location.
17606
17607         * cs-parser.jay: pass location to throw statement.
17608
17609         * driver.cs: Small bug fix.
17610
17611         * report.cs: Updated format to be 4-zero filled digits.
17612
17613 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17614
17615         * expression.cs (CheckIndices): Fix minor bug where the wrong
17616         variable was being referred to ;-)
17617
17618         (DoEmit): Do not call EmitStaticInitializers when the 
17619         underlying type is System.Object.
17620
17621 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17622
17623         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17624         and do the usual workaround for SRE.
17625
17626         * class.cs (MyEventBuilder.EventType): New member to get at the type
17627         of the event, quickly.
17628
17629         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17630
17631         * assign.cs (Assign.DoResolve): Handle the case when the target
17632         is an EventExpr and perform the necessary checks.
17633
17634         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17635         interface.
17636
17637         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17638
17639         (EventExpr): Set the type in the constructor itself since we 
17640         are meant to be born fully resolved.
17641
17642         (EventExpr.Define): Revert code I wrote earlier.
17643                 
17644         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17645         instance expression is null. The instance expression is a This in that case
17646         or a null, depending on whether it is a static method or not.
17647
17648         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17649         refers to more than one method.
17650
17651         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17652         and accordingly flag errors.
17653
17654 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17655
17656         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17657
17658 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17659
17660         * location.cs (ToString): Provide useful rutine.
17661
17662 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17665         objects, return the actual integral boxed.
17666
17667         * statement.cs (SwitchLabel): define an ILLabel for each
17668         SwitchLabel. 
17669
17670         (Switch.CheckSwitch): If the value is a Literal, extract
17671         the underlying literal.
17672
17673         Also in the unused hashtable we had, add the SwitchLabel so we can
17674         quickly look this value up.
17675
17676         * constant.cs: Implement a bunch of new constants.  Rewrite
17677         Literal based on this.  Made changes everywhere to adapt to this.
17678
17679         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17680         dereferencing array only once, and also copes with enumrations.
17681
17682         bytes are two bytes wide, not one.
17683
17684         (Cast): Perform constant conversions.
17685
17686         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17687         wrappers to the literals here.
17688
17689         * expression.cs (DoNumericPromotions): long literals can converted
17690         to ulong implicity (this is taken care of elsewhere, but I was
17691         missing this spot).
17692
17693         * ecore.cs (Expression.Literalize): Make the return type Literal,
17694         to improve type checking.
17695
17696         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17697
17698 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17699
17700         * literal.cs: Revert code from ravi that checked the bounds.  The
17701         bounds are sane by the definition of the type itself. 
17702
17703         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17704         need to actually look up in our parent hierarchy for interfaces
17705         implemented. 
17706
17707         * const.cs: Use the underlying type for enumerations
17708
17709         * delegate.cs: Compute the basename for the delegate creation,
17710         that should fix the delegate test case, and restore the correct
17711         Type Lookup semantics in rootcontext
17712
17713         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17714         referencing a nested type with the Reflection API is using the "+"
17715         sign. 
17716
17717         * cs-parser.jay: Do not require EOF token at the end.
17718
17719 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17720
17721         * rootcontext.cs (LookupType): Concatenate type names with
17722         a '.' instead of a '+' The test suite passes again.
17723
17724         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17725         field of the enumeration.
17726
17727         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17728         the case when the member is an EventExpr.
17729
17730         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17731         static has an associated instance expression.
17732
17733         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17734
17735         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17736
17737         * class.cs (Event.Define): Register event and perform appropriate checks
17738         for error #111.
17739
17740         We define the Add and Remove methods even if the use provides none because
17741         in that case, we provide default implementations ourselves.
17742
17743         Define a private field of the type of the event. This is done by the CSC compiler
17744         and we should be doing it too ;-)
17745
17746         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17747         More methods we use in code we generate.
17748
17749         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17750         is important.
17751
17752         (InitCoreTypes): Update accordingly for the above.
17753
17754         * class.cs (Event.Emit): Generate code for default accessors that we provide
17755
17756         (EmitDefaultMethod): Do the job in the above.
17757
17758         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17759         appropriate place.
17760
17761 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17764         builders even if we were missing one.
17765
17766         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17767         pass the Basename as our class name instead of the Name.  The
17768         basename will be correctly composed for us.
17769
17770         * parameter.cs (Paramters): Now takes a Location argument.
17771
17772         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17773         make all the code call directly LookupType in RootContext and take
17774         this chance to pass the Location information everywhere.
17775
17776         * Everywhere: pass Location information.
17777
17778 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17779
17780         * class.cs (Constructor.Define): Updated way of detecting the
17781         length of the parameters.
17782
17783         (TypeContainer.DefineType): Use basename as the type name for
17784         nested types.
17785
17786         (TypeContainer.Define): Do not recursively define types here, as
17787         definition is taken care in order by the RootContext.
17788
17789         * tree.cs: Keep track of namespaces in a per-file basis.
17790
17791         * parameter.cs (Parameter.ComputeSignature): Update to use
17792         DeclSpace. 
17793
17794         (Parameters.GetSignature): ditto.
17795
17796         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17797         instead of a TypeContainer.
17798
17799         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17800         resolve names.  Because we need to be resolve in our context, not
17801         our parents.
17802
17803         * driver.cs: Implement response files.
17804
17805         * class.cs (TypeContainer.DefineType): If we are defined, do not
17806         redefine ourselves.
17807
17808         (Event.Emit): Emit the code for add/remove handlers.
17809         (Event.Define): Save the MethodBuilders for add/remove.
17810
17811         * typemanager.cs: Use pair here too.
17812
17813         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17814         DictionaryEntry requires the first argument to be non-null.  
17815
17816         (enum_declaration): Compute full name for registering the
17817         enumeration.
17818
17819         (delegate_declaration): Instead of using
17820         formal_parameter_list, use opt_formal_parameter_list as the list
17821         can be empty.
17822
17823         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17824         (EventParsing): New property that controls whether `add' and
17825         `remove' are returned as tokens or identifiers (for events);
17826
17827 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17828
17829         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17830         use MyEventBuilder only and let it wrap the real builder for us.
17831
17832         (MyEventBuilder): Revamp constructor etc.
17833
17834         Implement all operations that we perform on EventBuilder in precisely the same
17835         way here too.
17836
17837         (FindMembers): Update to use the EventBuilder member.
17838
17839         (Event.Emit): Update accordingly.
17840
17841 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17842
17843         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17844         by calling the appropriate methods.
17845
17846         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17847         useful.
17848
17849         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17850
17851 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17852
17853         * delegate.cs (Delegate.Populate): Check that the return type
17854         and various parameters types are indeed accessible.
17855
17856         * class.cs (Constructor.Define): Same here.
17857
17858         (Field.Define): Ditto.
17859
17860         (Event.Define): Ditto.
17861
17862         (Operator.Define): Check that the underlying Method defined itself
17863         correctly - so it's MethodBuilder should not be null.
17864
17865         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17866         expression happens to be null.
17867
17868         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17869         members but as of now we don't seem to be able to do anything really useful with it.
17870
17871         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17872         not the EventBuilder.
17873
17874 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17875
17876         * cs-tokenizer.cs: Add support for defines.
17877         Add support for #if, #elif, #else, #endif
17878
17879         (eval_var): evaluates a variable.
17880         (eval): stubbed for evaluating functions.
17881
17882         * cs-parser.jay: Pass the defines information
17883
17884         * driver.cs: Add --define command line option.
17885
17886         * decl.cs: Move MemberCore here.
17887
17888         Make it the base class for DeclSpace.  This allows us to catch and
17889         report 108 and 109 for everything now.
17890
17891         * class.cs (TypeContainer.Define): Extract all the members
17892         before populating and emit the warning 108 (new keyword required
17893         to override) instead of having each member implement this.
17894
17895         (MemberCore.Define): New abstract method, we will be using this in
17896         the warning reporting engine in Populate.
17897
17898         (Operator.Define): Adjust to new MemberCore protocol. 
17899
17900         * const.cs (Const): This does not derive from Expression, it is a
17901         temporary object we use to create fields, it is a MemberCore. 
17902
17903         * class.cs (Method.Define): Allow the entry point to be in a
17904         specific class.
17905
17906         * driver.cs: Rewrite the argument handler to clean it up a bit.
17907
17908         * rootcontext.cs: Made it just an auxiliary namespace feature by
17909         making everything static.
17910
17911         * driver.cs: Adapt code to use RootContext type name instead of
17912         instance variable.
17913
17914         * delegate.cs: Remove RootContext argument.
17915
17916         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17917         argument. 
17918
17919         * class.cs (Event.Define): The lookup can fail.
17920
17921         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17922
17923         * expression.cs: Resolve the this instance before invoking the code.
17924
17925 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17926
17927         * cs-parser.jay: Add a production in element_access that allows
17928         the thing to become a "type" reference.  This way we can parse
17929         things like "(string [])" as a type.
17930
17931         Note that this still does not handle the more complex rules of
17932         casts. 
17933
17934
17935         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17936
17937         * ecore.cs: (CopyNewMethods): new utility function used to
17938         assemble the list of methods from running FindMembers.
17939
17940         (MemberLookup): Rework FindMembers so that 
17941
17942 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17943
17944         * class.cs (TypeContainer): Remove Delegates who fail to be
17945         defined.
17946
17947         * delegate.cs (Populate): Verify that we dont get null return
17948         values.   TODO: Check for AsAccessible.
17949
17950         * cs-parser.jay: Use basename to emit error 574 (destructor should
17951         have the same name as container class), not the full name.
17952
17953         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17954         possible representation.  
17955
17956         Also implements integer type suffixes U and L.
17957
17958 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17959
17960         * expression.cs (ArrayCreation.DoResolve): We need to do the
17961         argument resolution *always*.
17962
17963         * decl.cs: Make this hold the namespace.  Hold the root context as
17964         well.
17965         (LookupType): Move here.
17966
17967         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17968
17969         * location.cs (Row, Name): Fixed the code, it was always returning
17970         references to the first file.
17971
17972         * interface.cs: Register properties defined through interfaces.
17973
17974         * driver.cs: Add support for globbing on the command line
17975
17976         * class.cs (Field): Make it derive from MemberCore as well.
17977         (Event): ditto.
17978
17979 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17980
17981         * class.cs (Event::Define): Check that the type of the event is a delegate
17982         type else flag error #66.
17983
17984         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17985         same.
17986
17987         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17988         values of EntryPoint, CharSet etc etc.
17989
17990         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17991
17992         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17993         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17994         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17995         which needs this to do its work.
17996
17997         * ../errors/cs0066.cs : Add.
17998
17999 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18000
18001         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18002         helper functions.
18003
18004         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18005         clears out the parameters field.
18006         (MemberSignatureCompare): Cleanup
18007
18008         (MemberCore): New base class used to share code between MethodCore
18009         and Property.
18010
18011         (RegisterRequiredImplementations) BindingFlags.Public requires
18012         either BindingFlags.Instace or Static.  Use instance here.
18013
18014         (Property): Refactored code to cope better with the full spec.
18015
18016         * parameter.cs (GetParameterInfo): Return an empty array instead
18017         of null on error.
18018
18019         * class.cs (Property): Abstract or extern properties have no bodies.
18020
18021         * parameter.cs (GetParameterInfo): return a zero-sized array.
18022
18023         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18024         method modifier validation to the typecontainer so we can reuse
18025         this on properties.
18026
18027         (MethodCore.ParameterTypes): return an empty sized array of types.
18028
18029         (Property.Define): Test property modifier validity.
18030
18031         Add tests for sealed/override too.
18032
18033         (Method.Emit): abstract or extern methods have no bodies.
18034
18035 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18036
18037         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18038         thing.
18039
18040         (Method::Define, ::Emit): Modify accordingly.
18041
18042         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18043
18044         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18045
18046         * makefile: Pass in /unsafe.
18047
18048 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18049
18050         * class.cs (MakeKey): Kill routine.
18051
18052         * class.cs (TypeContainer.Define): Correctly define explicit
18053         method implementations (they require the full interface name plus
18054         the method name).
18055
18056         * typemanager.cs: Deply the PtrHashtable here and stop using the
18057         lame keys.  Things work so much better.
18058
18059         This of course broke everyone who depended on `RegisterMethod' to
18060         do the `test for existance' test.  This has to be done elsewhere.
18061
18062         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18063         the object stupid Equals method (because, that like fails all over
18064         the place).  We still do not use it.
18065
18066         * class.cs (TypeContainer.SetRequiredInterface,
18067         TypeContainer.RequireMethods): Killed these two routines and moved
18068         all the functionality to RegisterRequiredImplementations.
18069
18070         (TypeContainer.RegisterRequiredImplementations): This routine now
18071         registers all the implementations required in an array for the
18072         interfaces and abstract methods.  We use an array of structures
18073         which can be computed ahead of time to reduce memory usage and we
18074         also assume that lookups are cheap as most classes will not
18075         implement too many interfaces.
18076
18077         We also avoid creating too many MethodSignatures.
18078
18079         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18080         clear the "pending" bit if we find that there are problems with
18081         the declaration.
18082
18083         (TypeContainer.VerifyPendingMethods): Update to report errors of
18084         methods that look like implementations but are not.
18085
18086         (TypeContainer.Define): Add support for explicit interface method
18087         implementation. 
18088
18089 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18090
18091         * typemanager.cs: Keep track of the parameters here instead of
18092         being a feature of the TypeContainer.
18093
18094         * class.cs: Drop the registration of parameters here, as
18095         InterfaceMethods are also interface declarations.
18096
18097         * delegate.cs: Register methods with the TypeManager not only with
18098         the TypeContainer.  This code was buggy.
18099
18100         * interface.cs: Full registation here.
18101
18102 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18103
18104         * expression.cs: Remove reducer for binary expressions, it can not
18105         be done this way.
18106
18107         * const.cs: Put here the code that used to go into constant.cs
18108
18109         * constant.cs: Put here the code for constants, this is a new base
18110         class for Literals.
18111
18112         * literal.cs: Make Literal derive from Constant.
18113
18114 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18115
18116         * statement.cs (Return.Emit): Report error 157 if the user
18117         attempts to return from a finally block.
18118
18119         (Return.Emit): Instead of emitting a return, jump to the end of
18120         the function.
18121
18122         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18123         LocalBuilder to store the result of the function.  ReturnLabel is
18124         the target where we jump.
18125
18126
18127 2001-12-09  Radek Doulik  <rodo@ximian.com>
18128
18129         * cs-parser.jay: remember alias in current namespace
18130
18131         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18132         namespaces
18133
18134         * class.cs (LookupAlias): lookup alias in my_namespace
18135
18136         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18137         aliases hashtable
18138         (LookupAlias): lookup alias in this and if needed in parent
18139         namespaces
18140
18141 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18142
18143         * support.cs: 
18144
18145         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18146         making things static.  I need this to avoid passing the
18147         TypeContainer when calling ParameterType.
18148
18149         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18150         that did string manipulation to compute the type and then call
18151         GetType.  Use Parameter.ParameterType instead.
18152
18153         * cs-tokenizer.cs: Consume the suffix for floating values.
18154
18155         * expression.cs (ParameterReference): figure out whether this is a
18156         reference parameter or not.  Kill an extra variable by computing
18157         the arg_idx during emission.
18158
18159         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18160         function that returns whether a parameter is an out/ref value or not.
18161
18162         (Parameter.ParameterType): The type of the parameter (base,
18163         without ref/out applied).
18164
18165         (Parameter.Resolve): Perform resolution here.
18166         (Parameter.ExternalType): The full type (with ref/out applied).
18167
18168         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18169         support for expressions on the using statement.
18170
18171 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * statement.cs (Using.EmitLocalVariableDecls): Split the
18174         localvariable handling of the using statement.
18175
18176         (Block.EmitMeta): Keep track of variable count across blocks.  We
18177         were reusing slots on separate branches of blocks.
18178
18179         (Try.Emit): Emit the general code block, we were not emitting it. 
18180
18181         Check the type of the declaration to be an IDisposable or
18182         something that can be implicity converted to it. 
18183
18184         Emit conversions if required.
18185
18186         * ecore.cs (EmptyExpression): New utility class.
18187         (Expression.ImplicitConversionExists): New utility function.
18188
18189 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18190
18191         * statement.cs (Using): Implement.
18192
18193         * expression.cs (LocalVariableReference): Support read only variables.
18194
18195         * statement.cs: Remove the explicit emit for the Leave opcode.
18196         (VariableInfo): Add a readonly field.
18197
18198 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18199
18200         * ecore.cs (ConvCast): new class used to encapsulate the various
18201         explicit integer conversions that works in both checked and
18202         unchecked contexts.
18203
18204         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18205         properly generate the overflow opcodes.
18206
18207 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18208
18209         * statement.cs: The correct type for the EmptyExpression is the
18210         element_type, not the variable type.  Ravi pointed this out.
18211
18212 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18213
18214         * class.cs (Method::Define): Handle PInvoke methods specially
18215         by using DefinePInvokeMethod instead of the usual one.
18216
18217         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18218         above to do the task of extracting information and defining the method.
18219
18220 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18221
18222         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18223         of the condition for string type.
18224
18225         (Emit): Move that here. 
18226
18227         (ArrayCreation::CheckIndices): Keep string literals in their expression
18228         form.
18229
18230         (EmitDynamicInitializers): Handle strings appropriately.
18231
18232 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * codegen.cs (EmitContext): Replace multiple variables with a
18235         single pointer to the current Switch statement.
18236
18237         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18238         EmitContext.
18239
18240 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18241
18242         * statement.cs 
18243
18244         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18245         default'.
18246
18247         (Foreach.Emit): Foreach on arrays was not setting
18248         up the loop variables (for break/continue).
18249
18250         (GotoCase): Semi-implented.
18251
18252 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18253
18254         * attribute.cs (CheckAttribute): Handle system attributes by using
18255         Attribute.GetAttributes to examine information we need.
18256
18257         (GetValidPlaces): Same here.
18258
18259         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18260
18261         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18262
18263         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18264
18265         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18266
18267         (Method::Emit): Handle the case when we are a PInvoke method.
18268
18269 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * expression.cs: Use ResolveWithSimpleName on compound names.
18272
18273 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18274
18275         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18276         before trying to reduce it.
18277
18278         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18279
18280         * constant.cs (LookupConstantValue): Implement.
18281
18282         (EmitConstant): Use the above in emitting the constant.
18283
18284         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18285         that are user-defined by doing a LookupConstantValue on them.
18286
18287         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18288         too, like above.
18289
18290 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18293
18294         (BaseAccess.DoResolve): Implement.
18295
18296         (MemberAccess.DoResolve): Split this routine into a
18297         ResolveMemberAccess routine that can be used independently
18298
18299 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18300
18301         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18302         As that share bits of the implementation.  Is returns a boolean,
18303         while As returns the Type that is being probed.
18304
18305 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18306
18307         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18308         instead of a Literal - much easier.
18309
18310         (EnumInTransit): Remove - utterly useless :-)
18311
18312         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18313
18314         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18315
18316         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18317         chain when we have no associated expression.
18318
18319 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18320
18321         * constant.cs (Define): Use Location while reporting the errror.
18322
18323         Also emit a warning when 'new' is used and there is no inherited
18324         member to hide.
18325
18326         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18327         populated.
18328
18329         (LookupEnumValue): Implement to lookup an enum member's value and define it
18330         if necessary.
18331
18332         (Populate): Re-write accordingly to use the above routine.
18333
18334 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * expression.cs (This): Fix prototype for DoResolveLValue to
18337         override the base class DoResolveLValue.
18338
18339         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18340         declarations) 
18341
18342         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18343         (we need to load the address of the field here).  This fixes
18344         test-22. 
18345
18346         (FieldExpr.DoResolveLValue): Call the DoResolve
18347         function to initialize the Instance expression.
18348
18349         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18350         correctly the GetEnumerator operation on a value type.
18351
18352         * cs-parser.jay: Add more simple parsing error catches.
18353
18354         * statement.cs (Switch): Add support for string switches.
18355         Handle null specially.
18356
18357         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18358
18359 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18360
18361         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18362
18363         (declare_local_constant): New helper function.
18364
18365         * statement.cs (AddConstant): Keep a separate record of constants
18366
18367         (IsConstant): Implement to determine if a variable is a constant.
18368
18369         (GetConstantExpression): Implement.
18370
18371         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18372
18373         * statement.cs (IsVariableDefined): Re-write.
18374
18375 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18376
18377         * class.cs (TypeContainer::FindMembers): Look for constants
18378         in the case when we are looking for MemberTypes.Field
18379
18380         * expression.cs (MemberAccess::DoResolve): Check that in the
18381         case we are a FieldExpr and a Literal, we are not being accessed
18382         by an instance reference.
18383
18384         * cs-parser.jay (local_constant_declaration): Implement.
18385
18386         (declaration_statement): Implement for constant declarations.
18387
18388 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18389
18390         * statement.cs (Switch): Catch double defaults.
18391
18392         (Switch): More work on the switch() statement
18393         implementation.  It works for integral values now, need to finish
18394         string support.
18395
18396
18397 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18398
18399         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18400         integer literals into other integer literals.  To be used by
18401         switch. 
18402
18403 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18404
18405         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18406         some memory.
18407
18408         (EmitDynamicInitializers): Cope with the above since we extract data
18409         directly from ArrayData now.
18410
18411         (ExpectInitializers): Keep track of whether initializers are mandatory
18412         or not.
18413
18414         (Bounds): Make it a hashtable to prevent the same dimension being 
18415         recorded for every element in that dimension.
18416
18417         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18418         from being found.
18419
18420         Also fix bug which was causing the indices to be emitted in the reverse
18421         order.
18422
18423 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18424
18425         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18426         unfinished.  They do not work, because the underlying code is
18427         sloppy.
18428
18429 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18430
18431         * cs-parser.jay: Remove bogus fixme.
18432
18433         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18434         on Switch statement.
18435
18436 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18437
18438         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18439         the same. 
18440
18441         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18442         parameter. Apparently, any expression is allowed. 
18443
18444         (ValidateInitializers): Update accordingly.
18445
18446         (CheckIndices): Fix some tricky bugs thanks to recursion.
18447
18448         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18449         I was being completely brain-dead.
18450
18451         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18452         and re-write acordingly.
18453
18454         (DelegateInvocation): Re-write accordingly.
18455
18456         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18457
18458         (MakeByteBlob): Handle types more correctly.
18459
18460         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18461         initialization from expressions but it is incomplete because I am a complete
18462         Dodo :-|
18463
18464 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18465
18466         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18467         on If.  Basically, we have to return `true' (ie, we do return to
18468         our caller) only if both branches of the if return.
18469
18470         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18471         short-circuit operators, handle them as short circuit operators. 
18472
18473         (Cast.DoResolve): Resolve type.
18474         (Cast.Cast): Take an expression as the target type.
18475
18476         * cs-parser.jay (cast_expression): Remove old hack that only
18477         allowed a limited set of types to be handled.  Now we take a
18478         unary_expression and we resolve to a type during semantic
18479         analysis.
18480
18481         Use the grammar productions from Rhys to handle casts (this is
18482         not complete like Rhys syntax yet, we fail to handle that corner
18483         case that C# has regarding (-x), but we will get there.
18484
18485 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18486
18487         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18488         field which is an array type.
18489
18490         * cs-parser.jay (declare_local_variables): Support array initialization too.
18491
18492         * typemanager.cs (MakeKey): Implement.
18493
18494         (everywhere): Use the above appropriately.
18495
18496         * cs-parser.jay (for_statement): Update for array initialization while
18497         declaring variables.
18498
18499         * ecore.cs : The error message was correct, it's the variable's names that
18500         were misleading ;-) Make the code more readable.
18501
18502         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18503         the correct type etc.
18504
18505         (ConvertExplicit): Handle Enum types by examining the underlying type.
18506
18507 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18508
18509         * parameter.cs (GetCallingConvention): Always return
18510         CallingConventions.Standard for now.
18511
18512 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18513
18514         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18515         and `r' after calling DoNumericPromotions.
18516
18517         * ecore.cs: Fix error message (the types were in the wrong order).
18518
18519         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18520         BindingFlags.Instance as well 
18521
18522         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18523         implicit int literal conversion in an empty cast so that we
18524         propagate the right type upstream.
18525
18526         (UnboxCast): new class used to unbox value types.
18527         (Expression.ConvertExplicit): Add explicit type conversions done
18528         by unboxing.
18529
18530         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18531         the target type before applying the implicit LongLiterals to ULong
18532         literal cast.
18533
18534 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18535
18536         * cs-parser.jay (for_statement): Reworked the way For works: now
18537         we declare manually any variables that are introduced in
18538         for_initializer to solve the problem of having out-of-band code
18539         emition (that is what got for broken).
18540
18541         (declaration_statement): Perform the actual variable declaration
18542         that used to be done in local_variable_declaration here.
18543
18544         (local_variable_declaration): Do not declare anything, just pass
18545         the information on a DictionaryEntry
18546
18547 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18548
18549         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18550         re-write of the logic to now make it recursive.
18551
18552         (UpdateIndices): Re-write accordingly.
18553
18554         Store element data in a separate ArrayData list in the above methods.
18555
18556         (MakeByteBlob): Implement to dump the array data into a byte array.
18557
18558 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18559
18560         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18561         into CheckIndices.
18562
18563         * constant.cs (Define): Implement.
18564
18565         (EmitConstant): Re-write fully.
18566
18567         Pass in location info.
18568
18569         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18570         respectively.
18571
18572         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18573         DictionaryEntry since we need location info too.
18574
18575         (constant_declaration): Update accordingly.
18576
18577         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18578         code into another method : UpdateIndices.
18579
18580 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18581
18582         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18583         some type checking etc.
18584
18585 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18586
18587         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18588         bits to provide dimension info if the user skips doing that.
18589
18590         Update second constructor to store the rank correctly.
18591
18592 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18593
18594         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18595         and try to implement.
18596
18597         * ../errors/cs0150.cs : Add.
18598
18599         * ../errors/cs0178.cs : Add.
18600
18601 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18602
18603         * statement.cs: Implement foreach on multi-dimensional arrays. 
18604
18605         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18606         name of the params argument.
18607
18608         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18609         initializing the array.
18610
18611         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18612         we can use this elsewhere.
18613
18614         * statement.cs: Finish implementation of foreach for single
18615         dimension arrays.
18616
18617         * cs-parser.jay: Use an out-of-band stack to pass information
18618         around, I wonder why I need this.
18619
18620         foreach_block: Make the new foreach_block the current_block.
18621
18622         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18623         function used to return a static Parameters structure.  Used for
18624         empty parameters, as those are created very frequently.
18625
18626         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18627
18628 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18629
18630         * interface.cs : Default modifier is private, not public. The
18631         make verify test passes again.
18632
18633 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18634
18635         * support.cs (ReflectionParameters): Fix logic to determine
18636         whether the last parameter is a params one. Test 9 passes again.
18637
18638         * delegate.cs (Populate): Register the builders we define with
18639         RegisterParameterForBuilder. Test 19 passes again.
18640
18641         * cs-parser.jay (property_declaration): Reference $6 instead
18642         of $$ to get at the location.
18643
18644         (indexer_declaration): Similar stuff.
18645
18646         (attribute): Ditto.
18647
18648         * class.cs (Property): Register parameters for the Get and Set methods
18649         if they exist. Test 23 passes again.
18650
18651         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18652         call to EmitArguments as we are sure there aren't any params arguments. 
18653         Test 32 passes again.
18654
18655         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18656         IndexOutOfRangeException. 
18657
18658         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18659         Test 33 now passes again.
18660
18661 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18662
18663         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18664         broke a bunch of things.  Will have to come up with a better way
18665         of tracking locations.
18666
18667         * statement.cs: Implemented foreach for single dimension arrays.
18668
18669 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18670
18671         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18672         an error.  This removes the lookup from the critical path.
18673
18674         * cs-parser.jay: Removed use of temporary_loc, which is completely
18675         broken. 
18676
18677 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * support.cs (ReflectionParameters.ParameterModifier): Report
18680         whether the argument is a PARAMS argument or not.
18681
18682         * class.cs: Set the attribute `ParamArrayAttribute' on the
18683         parameter argument.
18684
18685         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18686         and cons_param_array_attribute (ConstructorInfo for
18687         ParamArrayAttribute)., 
18688
18689         * codegen.cs: Emit the return using the `Return' statement, that
18690         way we can report the error correctly for missing return values. 
18691
18692         * class.cs (Method.Emit): Clean up.
18693
18694         * expression.cs (Argument.Resolve): Take another argument: the
18695         location where this argument is used.  Notice that this is not
18696         part of the "Argument" class as to reduce the size of the
18697         structure (we know the approximate location anyways).
18698
18699         Test if the argument is a variable-reference, if not, then
18700         complain with a 206.
18701
18702         (Argument.Emit): Emit addresses of variables.
18703
18704         (Argument.FullDesc): Simplify.
18705
18706         (Invocation.DoResolve): Update for Argument.Resolve.
18707
18708         (ElementAccess.DoResolve): ditto.
18709
18710         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18711         method should be virtual, as this method is always virtual.
18712
18713         (NewDelegate.DoResolve): Update for Argument.Resolve.
18714
18715         * class.cs (ConstructorInitializer.DoResolve): ditto.
18716
18717         * attribute.cs (Attribute.Resolve): ditto.
18718
18719 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18720
18721         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18722
18723         * expression.cs (ParameterReference): Drop IStackStorage and implement
18724         IAssignMethod instead. 
18725
18726         (LocalVariableReference): ditto.
18727
18728         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18729         IAssignMethod instead. 
18730
18731 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18732
18733         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18734         enumerations that are used in heavily used structures derive from
18735         byte in a laughable and pathetic attempt to reduce memory usage.
18736         This is the kind of pre-optimzations that you should not do at
18737         home without adult supervision.
18738
18739         * expression.cs (UnaryMutator): New class, used to handle ++ and
18740         -- separatedly from the other unary operators.  Cleans up the
18741         code, and kills the ExpressionStatement dependency in Unary.
18742
18743         (Unary): Removed `method' and `Arguments' from this class, making
18744         it smaller, and moving it all to SimpleCall, so I can reuse this
18745         code in other locations and avoid creating a lot of transient data
18746         strucutres when not required.
18747
18748         * cs-parser.jay: Adjust for new changes.
18749
18750 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18751
18752         * enum.cs (Enum.Populate): If there is a failure during
18753         definition, return
18754
18755         * cs-parser.jay (opt_enum_base): we used to catch type errors
18756         here, but this is really incorrect.  The type error should be
18757         catched during semantic analysis.
18758
18759 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18760
18761         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18762         current_local_parameters as expected since I, in my stupidity, had forgotten
18763         to do this :-)
18764
18765         * attribute.cs (GetValidPlaces): Fix stupid bug.
18766
18767         * class.cs (Method::Emit): Perform check on applicability of attributes.
18768
18769         (Constructor::Emit): Ditto.
18770
18771         (Field::Emit): Ditto.
18772
18773         (Field.Location): Store location information.
18774
18775         (Property, Event, Indexer, Operator): Ditto.
18776
18777         * cs-parser.jay (field_declaration): Pass in location for each field.
18778
18779         * ../errors/cs0592.cs : Add.
18780
18781 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18782
18783         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18784
18785         (InitCoreTypes): Update accordingly.
18786
18787         (RegisterAttrType, LookupAttr): Implement.
18788
18789         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18790         info about the same.
18791
18792         (Resolve): Update to populate the above as necessary.
18793
18794         (Error592): Helper.
18795
18796         (GetValidPlaces): Helper to the above.
18797
18798         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18799
18800         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18801
18802 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18803
18804         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18805
18806         * ../errors/cs0617.cs : Add.
18807
18808 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18809
18810         * enum.cs (Emit): Rename to Populate to be more consistent with what
18811         we expect it to do and when exactly it is called.
18812
18813         * class.cs, rootcontext.cs : Update accordingly.
18814
18815         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18816         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18817
18818         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18819
18820         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18821         of a fieldinfo using the above, when dealing with a FieldBuilder.
18822
18823 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18824
18825         * ../errors/cs0031.cs : Add.
18826
18827         * ../errors/cs1008.cs : Add.
18828
18829         * ../errrors/cs0543.cs : Add.
18830
18831         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18832         enum type.
18833
18834         (FindMembers): Implement.
18835
18836         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18837         enums and delegates too.
18838
18839         (enum_types): Rename to builder_to_enum.
18840
18841         (delegate_types): Rename to builder_to_delegate.
18842
18843         * delegate.cs (FindMembers): Implement.
18844
18845 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18846
18847         * typemanager.cs (IsEnumType): Implement.
18848
18849         * enum.cs (Emit): Re-write parts to account for the underlying type
18850         better and perform checking etc.
18851
18852         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18853         of the underlying type.
18854
18855         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18856         value
18857
18858         * enum.cs (error31): Helper to report error #31.
18859
18860         * cs-parser.jay (enum_declaration): Store location of each member too.
18861
18862         * enum.cs (member_to_location): New hashtable. 
18863
18864         (AddEnumMember): Update location hashtable.
18865
18866         (Emit): Use the location of each member while reporting errors.
18867
18868 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18869
18870         * cs-parser.jay: A for_initializer if is a
18871         local_variable_declaration really ammount to have an implicit
18872         block with the variable declaration and no initializer for for.
18873
18874         * statement.cs (For.Emit): Cope with null initializers.
18875
18876         This fixes the infinite loop on for initializers.
18877
18878 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18879
18880         * enum.cs: More cleanup.
18881
18882         * ecore.cs: Remove dead code.
18883
18884         * class.cs (Property.Emit): More simplification.
18885         (Event.Emit): ditto.
18886
18887         Reworked to have less levels of indentation.
18888
18889 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18890
18891         * class.cs (Property): Emit attributes.
18892
18893         (Field): Ditto.
18894
18895         (Event): Ditto.
18896
18897         (Indexer): Ditto.
18898
18899         (Operator): Ditto.
18900
18901         * enum.cs (Emit): Ditto.
18902
18903         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18904         Enums too.
18905
18906         * class.cs (Field, Event, etc.): Move attribute generation into the
18907         Emit method everywhere.
18908
18909         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18910         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18911         as we had no way of defining nested enums !
18912
18913         * rootcontext.cs : Adjust code accordingly.
18914
18915         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18916
18917 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18918
18919         * expression.cs (EvalConstantExpression): Move into ecore.cs
18920
18921         * enum.cs (Enum): Rename some members and make them public and readonly
18922         according to our convention.
18923
18924         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18925         nothing else.
18926
18927         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18928
18929         (Enum::Emit): Write a simple version for now which doesn't try to compute
18930         expressions. I shall modify this to be more robust in just a while.
18931
18932         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18933
18934         (TypeContainer::CloseType): Create the Enum types too.
18935
18936         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18937
18938         * expression.cs (EvalConstantExpression): Get rid of completely.
18939
18940         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18941         user-defined values and other cases.
18942
18943         (IsValidEnumLiteral): Helper function.
18944
18945         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18946         out there in the case we had a literal FieldExpr.
18947
18948         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18949
18950         (Literalize): Revamp a bit to take two arguments.
18951
18952         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18953
18954 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18955
18956         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18957
18958         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18959
18960         (Resolve): Use the above to ensure we have proper initializers.
18961
18962 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18963
18964         * expression.cs (Expression::EvalConstantExpression): New method to 
18965         evaluate constant expressions.
18966
18967         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18968
18969 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18972         in an array.
18973
18974         (Binary.ResolveOperator): Handle operator != (object a, object b)
18975         and operator == (object a, object b);
18976
18977         (Binary.DoNumericPromotions): Indicate whether the numeric
18978         promotion was possible.
18979
18980         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18981         Implement.  
18982
18983         Made the ArrayAccess implement interface IAssignMethod instead of
18984         IStackStore as the order in which arguments are passed reflects
18985         this.
18986
18987         * assign.cs: Instead of using expr.ExprClass to select the way of
18988         assinging, probe for the IStackStore/IAssignMethod interfaces.
18989
18990         * typemanager.cs: Load InitializeArray definition.
18991
18992         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18993         static data that can be used to initialize arrays. 
18994
18995 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18996
18997         * expression.cs: Handle operator== and operator!= for booleans.
18998
18999         (Conditioal.Reduce): Implement reducer for the ?: operator.
19000
19001         (Conditional.Resolve): Implement dead code elimination.
19002
19003         (Binary.Resolve): Catch string literals and return a new
19004         concatenated string.
19005
19006         (Unary.Reduce): Implement reduction of unary expressions.
19007
19008         * ecore.cs: Split out the expression core handling here.
19009
19010         (Expression.Reduce): New method used to perform constant folding
19011         and CSE.  This is needed to support constant-expressions. 
19012
19013         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19014         targets, and optimize for !x.
19015
19016 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19017
19018         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19019         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19020         set custom atttributes.
19021
19022         * literal.cs (Literal::GetValue): New abstract method to return the actual
19023         value of the literal, cast as an object.
19024
19025         (*Literal): Implement GetValue method.
19026
19027         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19028         expressions to the arraylist but objects of type Argument.
19029
19030         * class.cs (TypeContainer::Emit): Emit our attributes too.
19031
19032         (Method::Emit, Constructor::Emit): Ditto.
19033
19034         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19035         to be ignoring earlier.
19036
19037 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19038
19039         * attribute.cs (AttributeSection::Define): Implement to do the business
19040         of constructing a CustomAttributeBuilder.
19041
19042         (Attribute): New trivial class. Increases readability of code.  
19043
19044         * cs-parser.jay : Update accordingly.
19045
19046         (positional_argument_list, named_argument_list, named_argument): New rules
19047
19048         (attribute_arguments): Use the above so that we are more correct.
19049
19050 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19051
19052         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19053         to perform all checks for a method with a params parameter.
19054
19055         (Invocation::OverloadResolve): Update to use the above method and therefore
19056         cope correctly with params method invocations.
19057
19058         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19059         params too.
19060
19061         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19062         constructors in our parent too because we can't afford to miss out on 
19063         protected ones ;-)
19064
19065         * attribute.cs (AttributeSection): New name for the class Attribute
19066
19067         Other trivial changes to improve readability.
19068
19069         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19070         use the new class names.
19071
19072 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19073
19074         * class.cs (Method::Define): Complete definition for params types too
19075
19076         (Indexer::Define): Ditto.
19077
19078         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19079         Cope everywhere with a request for info about the array parameter.
19080
19081 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19082
19083         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19084
19085         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19086         local_variable_type to extract the string corresponding to the type.
19087
19088         (local_variable_type): Fixup the action to use the new helper method.
19089
19090         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19091         go.
19092
19093         * expression.cs : Clean out code which uses the above.
19094
19095 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19096
19097         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19098         and bale out if necessary by returning a false.
19099
19100         (RegisterProperty): Ditto.
19101
19102         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19103         and print out appropriate error messages.
19104
19105         * interface.cs (everywhere): Ditto.
19106
19107         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19108         location to constructor.
19109
19110         * class.cs (Property, Event, Indexer): Update accordingly.
19111
19112         * ../errors/cs111.cs : Added.
19113
19114         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19115         of a method, as laid down by the spec.
19116
19117         (Invocation::OverloadResolve): Use the above method.
19118
19119 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19120
19121         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19122         now take a TypeContainer and a Parameters object.
19123
19124         (ParameterData): Modify return type of ParameterModifier method to be 
19125         Parameter.Modifier and not a string.
19126
19127         (ReflectionParameters, InternalParameters): Update accordingly.
19128
19129         * expression.cs (Argument::GetParameterModifier): Same here.
19130
19131         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19132         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19133         symbol in it at all so maybe this is only for now.
19134
19135 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19136
19137         * support.cs (InternalParameters): Constructor now takes an extra argument 
19138         which is the actual Parameters class.
19139
19140         (ParameterDesc): Update to provide info on ref/out modifiers.
19141
19142         * class.cs (everywhere): Update call to InternalParameters to pass in
19143         the second argument too.
19144
19145         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19146         to return the modifier info [ref/out etc]
19147
19148         (InternalParameters, ReflectionParameters): Implement the above.
19149
19150         * expression.cs (Argument::ParameterModifier): Similar function to return
19151         info about the argument's modifiers.
19152
19153         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19154         too.
19155
19156         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19157         a new SetFormalParameters object which we pass to InternalParameters.
19158
19159 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19160
19161         * expression.cs (NewArray): Merge into the ArrayCreation class.
19162
19163 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19164
19165         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19166         NewUserdefinedArray into one as there wasn't much of a use in having
19167         two separate ones.
19168
19169         * expression.cs (Argument): Change field's name to ArgType from Type.
19170
19171         (Type): New readonly property which returns the proper type, taking into 
19172         account ref/out modifiers.
19173
19174         (everywhere): Adjust code accordingly for the above.
19175
19176         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19177         whether we are emitting for a ref or out parameter.
19178
19179         * expression.cs (Argument::Emit): Use the above field to set the state.
19180
19181         (LocalVariableReference::Emit): Update to honour the flag and emit the
19182         right stuff.
19183
19184         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19185
19186         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19187
19188         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19189
19190         (ReflectionParameters, InternalParameters): Implement the above method.
19191
19192         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19193         reporting errors.
19194
19195         (Invocation::FullMethodDesc): Ditto. 
19196
19197 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19198
19199         * cs-parser.jay: Add extra production for the second form of array
19200         creation. 
19201
19202         * expression.cs (ArrayCreation): Update to reflect the above
19203         change. 
19204
19205         * Small changes to prepare for Array initialization.
19206
19207 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19208
19209         * typemanager.cs (ImplementsInterface): interface might be null;
19210         Deal with this problem;
19211
19212         Also, we do store negative hits on the cache (null values), so use
19213         this instead of calling t.GetInterfaces on the type everytime.
19214
19215 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19216
19217         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19218
19219         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19220         split functionality out into different classes.
19221
19222         (New::FormArrayType): Move into NewBuiltinArray.
19223
19224         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19225         quite useless.
19226
19227         (NewBuiltinArray): New class to handle creation of built-in arrays.
19228
19229         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19230         account creation of one-dimensional arrays.
19231
19232         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19233
19234         (NewUserdefinedArray::DoResolve): Implement.
19235
19236         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19237
19238         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19239         we maintain inside the TypeManager. This is necessary to perform lookups on the
19240         module builder.
19241
19242         (LookupType): Update to perform GetType on the module builders too.     
19243
19244         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19245
19246         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19247
19248 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19249
19250         * expression.cs (New::DoResolve): Implement guts of array creation.
19251
19252         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19253
19254 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19255
19256         * expression.cs: Fix bug I introduced lsat night that broke
19257         Delegates. 
19258
19259         (Expression.Resolve): Report a 246 error (can not resolve name)
19260         if we find a SimpleName in the stream.
19261
19262         (Expression.ResolveLValue): Ditto.
19263
19264         (Expression.ResolveWithSimpleName): This function is a variant of
19265         ResolveName, this one allows SimpleNames to be returned without a
19266         warning.  The only consumer of SimpleNames is MemberAccess
19267
19268 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19269
19270         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19271         might arrive here.  I have my doubts that this is correct.
19272
19273         * statement.cs (Lock): Implement lock statement.
19274
19275         * cs-parser.jay: Small fixes to support `lock' and `using'
19276
19277         * cs-tokenizer.cs: Remove extra space
19278
19279         * driver.cs: New flag --checked, allows to turn on integer math
19280         checking. 
19281
19282         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19283         Threading.Monitor.Exit 
19284
19285 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19286
19287         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19288         Expression Class to be IndexerAccess.
19289
19290         Notice that Indexer::DoResolve sets the eclass to Value.
19291
19292 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19293
19294         * class.cs (TypeContainer::Emit): Emit code for indexers.
19295
19296         * assign.cs (IAssignMethod): New interface implemented by Indexers
19297         and Properties for handling assignment.
19298
19299         (Assign::Emit): Simplify and reuse code. 
19300
19301         * expression.cs (IndexerAccess, PropertyExpr): Implement
19302         IAssignMethod, clean up old code. 
19303
19304 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19305
19306         * typemanager.cs (ImplementsInterface): New method to determine if a type
19307         implements a given interface. Provides a nice cache too.
19308
19309         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19310         method.
19311
19312         (ConvertReferenceExplicit): Ditto.
19313
19314         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19315         various methods, with correct names etc.
19316
19317         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19318         Operator.UnaryNegation.
19319
19320         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19321         we have a unary plus or minus operator.
19322
19323         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19324         UnaryMinus.
19325
19326         * everywhere : update accordingly.
19327
19328         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19329         respectively.
19330
19331         * class.cs (Method::Define): For the case where we are implementing a method
19332         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19333         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19334
19335 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19336
19337         * interface.cs (FindMembers): Implement to work around S.R.E
19338         lameness.
19339
19340         * typemanager.cs (IsInterfaceType): Implement.
19341
19342         (FindMembers): Update to handle interface types too.
19343
19344         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19345         use IsAssignableFrom as that is not correct - it doesn't work.
19346
19347         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19348         and accordingly override EmitStatement.
19349
19350         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19351         using the correct logic :-)
19352
19353 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19354
19355         * ../errors/cs-11.cs : Add to demonstrate error -11 
19356
19357 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19358
19359         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19360         then pass this as a hint to ResolveLValue.
19361
19362         * expression.cs (FieldExpr): Add Location information
19363
19364         (FieldExpr::LValueResolve): Report assignment to readonly
19365         variable. 
19366
19367         (Expression::ExprClassFromMemberInfo): Pass location information.
19368
19369         (Expression::ResolveLValue): Add new method that resolves an
19370         LValue. 
19371
19372         (Expression::DoResolveLValue): Default invocation calls
19373         DoResolve. 
19374
19375         (Indexers): New class used to keep track of indexers in a given
19376         Type. 
19377
19378         (IStackStore): Renamed from LValue, as it did not really describe
19379         what this did.  Also ResolveLValue is gone from this interface and
19380         now is part of Expression.
19381
19382         (ElementAccess): Depending on the element access type
19383
19384         * typemanager.cs: Add `indexer_name_type' as a Core type
19385         (System.Runtime.CompilerServices.IndexerNameAttribute)
19386
19387         * statement.cs (Goto): Take a location.
19388
19389 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19390
19391         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19392         if two delegates are compatible.
19393
19394         (NewDelegate::DoResolve): Update to take care of the case when
19395         we instantiate a delegate from another delegate.
19396
19397         * typemanager.cs (FindMembers): Don't even try to look up members
19398         of Delegate types for now.
19399
19400 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19401
19402         * delegate.cs (NewDelegate): New class to take care of delegate
19403         instantiation.
19404
19405         * expression.cs (New): Split the delegate related code out into 
19406         the NewDelegate class.
19407
19408         * delegate.cs (DelegateInvocation): New class to handle delegate 
19409         invocation.
19410
19411         * expression.cs (Invocation): Split out delegate related code into
19412         the DelegateInvocation class.
19413
19414 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19415
19416         * expression.cs (New::DoResolve): Implement delegate creation fully
19417         and according to the spec.
19418
19419         (New::DoEmit): Update to handle delegates differently.
19420
19421         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19422         because of which we were printing out arguments in reverse order !
19423
19424         * delegate.cs (VerifyMethod): Implement to check if the given method
19425         matches the delegate.
19426
19427         (FullDelegateDesc): Implement.
19428
19429         (VerifyApplicability): Implement.
19430
19431         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19432         delegate invocations too.
19433
19434         (Invocation::Emit): Ditto.
19435
19436         * ../errors/cs1593.cs : Added.
19437
19438         * ../errors/cs1594.cs : Added.
19439
19440         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19441
19442 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19443
19444         * typemanager.cs (intptr_type): Core type for System.IntPtr
19445
19446         (InitCoreTypes): Update for the same.
19447
19448         (iasyncresult_type, asynccallback_type): Ditto.
19449
19450         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19451         correct.
19452
19453         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19454         too.
19455
19456         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19457         the builders for the 4 members of a delegate type :-)
19458
19459         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19460         type.
19461
19462         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19463
19464         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19465
19466 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19467
19468         * statement.cs (Break::Emit): Implement.   
19469         (Continue::Emit): Implement.
19470
19471         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19472         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19473         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19474         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19475         end loop
19476
19477         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19478         properties that track the label for the current loop (begin of the
19479         loop and end of the loop).
19480
19481 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19482
19483         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19484         use of emitting anything at all.
19485
19486         * class.cs, rootcontext.cs : Get rid of calls to the same.
19487
19488         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19489
19490         (Populate): Define the constructor correctly and set the implementation
19491         attributes.
19492
19493         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19494         have been defined.
19495
19496         (AddDelegateType): Implement.
19497
19498         (IsDelegateType): Implement helper method.
19499
19500         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19501
19502         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19503         and accordingly handle it.
19504
19505         * delegate.cs (Populate): Take TypeContainer argument.
19506         Implement bits to define the Invoke method. However, I still haven't figured out
19507         how to take care of the native int bit :-(
19508
19509         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19510         Qualify the name of the delegate, not its return type !
19511
19512         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19513         conversion.
19514
19515         (StandardConversionExists): Checking for array types turns out to be recursive.
19516
19517         (ConvertReferenceExplicit): Implement array conversion.
19518
19519         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19520
19521 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19522
19523         * cs-parser.jay (delegate_declaration): Store the fully qualified
19524         name as it is a type declaration.
19525
19526         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19527         readonly.
19528
19529         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19530         as TypeContainer::DefineType.
19531
19532         (Populate): Method in which all the definition of the various methods (Invoke)
19533         etc is done.
19534
19535         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19536         see.
19537
19538         (CloseDelegate): Finally creates the delegate.
19539
19540         * class.cs (TypeContainer::DefineType): Update to define delegates.
19541         (Populate, Emit and CloseType): Do the same thing here too.
19542
19543         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19544         delegates in all these operations.
19545
19546 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19547
19548         * expression.cs: LocalTemporary: a new expression used to
19549         reference a temporary that has been created.
19550
19551         * assign.cs: Handle PropertyAccess back here, so that we can
19552         provide the proper semantic access to properties.
19553
19554         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19555         a few more explicit conversions. 
19556
19557         * modifiers.cs: `NEW' modifier maps to HideBySig.
19558
19559         * expression.cs (PropertyExpr): Make this into an
19560         ExpressionStatement, and support the EmitStatement code path. 
19561
19562         Perform get/set error checking, clean up the interface.
19563
19564         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19565         them into toplevel access objects.
19566
19567 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19570         SRE.
19571
19572         * typemanager.cs: Keep track here of our PropertyBuilders again to
19573         work around lameness in SRE.
19574
19575 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19576
19577         * expression.cs (LValue::LValueResolve): New method in the
19578         interface, used to perform a second resolution pass for LValues. 
19579
19580         (This::DoResolve): Catch the use of this in static methods.
19581
19582         (This::LValueResolve): Implement.
19583
19584         (This::Store): Remove warning, assigning to `this' in structures
19585         is 
19586
19587         (Invocation::Emit): Deal with invocation of
19588         methods on value types.  We need to pass the address to structure
19589         methods rather than the object itself.  (The equivalent code to
19590         emit "this" for structures leaves the entire structure on the
19591         stack instead of a pointer to it). 
19592
19593         (ParameterReference::DoResolve): Compute the real index for the
19594         argument based on whether the method takes or not a `this' pointer
19595         (ie, the method is static).
19596
19597         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19598         value types returned from functions when we need to invoke a
19599         method on the sturcture.
19600
19601
19602 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19603
19604         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19605         defining the type in the Modulebuilder or Typebuilder. This is to take
19606         care of nested types which need to be defined on the TypeBuilder using
19607         DefineNestedMethod.
19608
19609         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19610         methods in RootContext, only ported to be part of TypeContainer.
19611
19612         (TypeContainer::GetInterfaceOrClass): Ditto.
19613
19614         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19615
19616         * interface.cs (Interface::DefineInterface): New method. Does exactly
19617         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19618         too.
19619
19620         (Interface::GetInterfaces): Move from RootContext here and port.
19621
19622         (Interface::GetInterfaceByName): Same here.
19623
19624         * rootcontext.cs (ResolveTree): Re-write.
19625
19626         (PopulateTypes): Re-write.
19627
19628         * class.cs (TypeContainer::Populate): Populate nested types too.
19629         (TypeContainer::Emit): Emit nested members too.
19630
19631         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19632         instead just use the name argument passed in as it is already fully
19633         qualified.
19634
19635         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19636         to TypeContainer mapping to see if a type is user-defined.
19637
19638         * class.cs (TypeContainer::CloseType): Implement. 
19639
19640         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19641         the default constructor.
19642
19643         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19644         twice.
19645
19646         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19647
19648         * interface.cs (CloseType): Create the type here.
19649
19650         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19651         the hierarchy.
19652
19653         Remove all the methods which are now in TypeContainer.
19654
19655 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19656
19657         * delegate.cs (Define): Re-write bits to define the delegate
19658         correctly.
19659
19660 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19661
19662         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19663
19664         * expression.cs (ImplicitReferenceConversion): handle null as well
19665         as a source to convert to any reference type.
19666
19667         * statement.cs (Return): Perform any implicit conversions to
19668         expected return type.  
19669
19670         Validate use of return statement.  
19671
19672         * codegen.cs (EmitContext): Pass the expected return type here.
19673
19674         * class.cs (Method, Constructor, Property): Pass expected return
19675         type to EmitContext.
19676
19677 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * expression.cs: Make DoResolve take an EmitContext instead of a
19680         TypeContainer.
19681
19682         Replaced `l' and `location' for `loc', for consistency.
19683
19684         (Error, Warning): Remove unneeded Tc argument.
19685
19686         * assign.cs, literal.cs, constant.cs: Update to new calling
19687         convention. 
19688
19689         * codegen.cs: EmitContext now contains a flag indicating whether
19690         code is being generated in a static method or not.
19691
19692         * cs-parser.jay: DecomposeQI, new function that replaces the old
19693         QualifiedIdentifier.  Now we always decompose the assembled
19694         strings from qualified_identifier productions into a group of
19695         memberaccesses.
19696
19697 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19698
19699         * rootcontext.cs: Deal with field-less struct types correctly now
19700         by passing the size option to Define Type.
19701
19702         * class.cs: Removed hack that created one static field. 
19703
19704 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19705
19706         * statement.cs: Moved most of the code generation here. 
19707
19708 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19709
19710         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19711         seem very right.
19712
19713         (ElementAccess): Remove useless bits for now - keep checks as the spec
19714         says.
19715
19716 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19717
19718         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19719         and start performing checks according to the spec.
19720
19721 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19722
19723         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19724         rank_specifiers instead.
19725
19726         (rank_specifiers): Change the order in which the rank specifiers are stored
19727
19728         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19729
19730         * expression.cs (ElementAccess): Implement the LValue interface too.
19731
19732 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19733
19734         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19735         except that user defined conversions are not included.
19736
19737         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19738         perform the conversion of the return type, if necessary.
19739
19740         (New::DoResolve): Check whether we are creating an array or an object
19741         and accordingly do the needful.
19742
19743         (New::Emit): Same here.
19744
19745         (New::DoResolve): Implement guts of array creation.
19746
19747         (New::FormLookupType): Helper function.
19748
19749 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * codegen.cs: Removed most of the code generation here, and move the
19752         corresponding code generation bits to the statement classes. 
19753
19754         Added support for try/catch/finalize and throw.
19755
19756         * cs-parser.jay: Added support for try/catch/finalize.
19757
19758         * class.cs: Catch static methods having the flags override,
19759         virtual or abstract.
19760
19761         * expression.cs (UserCast): This user cast was not really doing
19762         what it was supposed to do.  Which is to be born in fully resolved
19763         state.  Parts of the resolution were being performed at Emit time! 
19764
19765         Fixed this code.
19766
19767 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19768
19769         * expression.cs: Implicity convert the result from UserCast.
19770
19771 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19772
19773         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19774         prevented it from working correctly. 
19775
19776         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19777         merely ConvertImplicit.
19778
19779 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * typemanager.cs: Make the LookupTypeContainer function static,
19782         and not per-instance.  
19783
19784         * class.cs: Make static FindMembers (the one that takes a Type
19785         argument). 
19786
19787         * codegen.cs: Add EmitForeach here.
19788
19789         * cs-parser.jay: Make foreach a toplevel object instead of the
19790         inline expansion, as we need to perform semantic analysis on it. 
19791
19792 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19793
19794         * expression.cs (Expression::ImplicitUserConversion): Rename to
19795         UserDefinedConversion.
19796
19797         (Expression::UserDefinedConversion): Take an extra argument specifying 
19798         whether we look for explicit user conversions too.
19799
19800         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19801
19802         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19803
19804         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19805         with the appropriate arguments.
19806
19807         * cs-parser.jay (cast_expression): Record location too.
19808
19809         * expression.cs (Cast): Record location info.
19810
19811         (Expression::ConvertExplicit): Take location argument.
19812
19813         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19814         to determine if we are doing explicit conversions.
19815
19816         (UserCast::Emit): Update accordingly.
19817
19818         (Expression::ConvertExplicit): Report an error if everything fails.
19819
19820         * ../errors/cs0030.cs : Add.
19821
19822 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19825         virtual and newslot bits. 
19826
19827         * class.cs (TypeContainer::RegisterRequiredImplementations):
19828         Record methods we need.
19829
19830         (TypeContainer::MakeKey): Helper function to make keys for
19831         MethodBases, since the Methodbase key is useless.
19832
19833         (TypeContainer::Populate): Call RegisterRequiredImplementations
19834         before defining the methods.   
19835
19836         Create a mapping for method_builders_to_methods ahead of time
19837         instead of inside a tight loop.
19838
19839         (::RequireMethods):  Accept an object as the data to set into the
19840         hashtable so we can report interface vs abstract method mismatch.
19841
19842 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * report.cs: Make all of it static.
19845
19846         * rootcontext.cs: Drop object_type and value_type computations, as
19847         we have those in the TypeManager anyways.
19848
19849         Drop report instance variable too, now it is a global.
19850
19851         * driver.cs: Use try/catch on command line handling.
19852
19853         Add --probe option to debug the error reporting system with a test
19854         suite. 
19855
19856         * report.cs: Add support for exiting program when a probe
19857         condition is reached.
19858
19859 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19860
19861         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19862         we do a forcible conversion regardless of type, to check if 
19863         ForceConversion returns a null.
19864
19865         (Binary::error19): Use location to report error.
19866
19867         (Unary::error23): Use location here too.
19868
19869         * ../errors/cs0019.cs : Check in.
19870
19871         * ../errors/cs0023.cs : Check in.
19872
19873         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19874         case of a non-null MethodInfo object with a length of 0 !
19875
19876         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19877         an applicable member - according to the spec :-)
19878         Also fix logic to find members in base types.
19879
19880         (Unary::ResolveOperator): Same here.
19881
19882         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19883         as I was getting thoroughly confused between this and error19 :-)
19884
19885         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19886         (::FindMostEncompassedType): Implement.
19887         (::FindMostEncompassingType): Implement.
19888         (::StandardConversionExists): Implement.
19889
19890         (UserImplicitCast): Re-vamp. We now need info about most specific
19891         source and target types so that we can do the necessary conversions.
19892
19893         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19894         mathematical union with no duplicates.
19895
19896 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19897
19898         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19899         in order from base classes to child classes, so that we can in
19900         child classes look up in our parent for method names and
19901         attributes (required for handling abstract, virtual, new, override
19902         constructs: we need to instrospect our base class, and if we dont
19903         populate the classes in order, the introspection might be
19904         incorrect.  For example, a method could query its parent before
19905         the parent has any methods and would determine that the parent has
19906         no abstract methods (while it could have had them)).
19907
19908         (RootContext::CreateType): Record the order in which we define the
19909         classes.
19910
19911 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19912
19913         * class.cs (TypeContainer::Populate): Also method definitions can
19914         fail now, keep track of this.
19915
19916         (TypeContainer::FindMembers): Implement support for
19917         DeclaredOnly/noDeclaredOnly flag.
19918
19919         (Constructor::Emit) Return the ConstructorBuilder.
19920
19921         (Method::Emit) Return the MethodBuilder. 
19922         Check for abstract or virtual methods to be public.
19923
19924         * rootcontext.cs (RootContext::CreateType): Register all the
19925         abstract methods required for the class to be complete and the
19926         interface methods that must be implemented. 
19927
19928         * cs-parser.jay: Report error 501 (method requires body if it is
19929         not marked abstract or extern).
19930
19931         * expression.cs (TypeOf::Emit): Implement.
19932
19933         * typemanager.cs: runtime_handle_type, new global type.
19934
19935         * class.cs (Property::Emit): Generate code for properties.
19936
19937 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19938
19939         * expression.cs (Unary::ResolveOperator): Find operators on base type
19940         too - we now conform exactly to the spec.
19941
19942         (Binary::ResolveOperator): Same here.
19943
19944         * class.cs (Operator::Define): Fix minor quirk in the tests.
19945
19946         * ../errors/cs0215.cs : Added.
19947
19948         * ../errors/cs0556.cs : Added.
19949
19950         * ../errors/cs0555.cs : Added.
19951
19952 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19953
19954         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19955         single integer which is really efficient
19956
19957 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19958
19959         *  expression.cs (Expression::ImplicitUserConversion): Use location
19960         even in the case when we are examining True operators.
19961  
19962         * class.cs (Operator::Define): Perform extensive checks to conform
19963         with the rules for operator overloading in the spec.
19964
19965         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19966         some of the other conversions mentioned in the spec.
19967
19968         * typemanager.cs (array_type): New static member for the System.Array built-in
19969         type.
19970
19971         (cloneable_interface): For System.ICloneable interface.
19972
19973         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19974         we start resolving the tree and populating types.
19975
19976         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19977  
19978 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19979
19980         * expression.cs (Expression::ExprClassFromMemberInfo,
19981         Expression::Literalize): Create literal expressions from
19982         FieldInfos which are literals.
19983
19984         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19985         type casts, because they were wrong.  The test suite in tests
19986         caught these ones.
19987
19988         (ImplicitNumericConversion): ushort to ulong requires a widening
19989         cast. 
19990
19991         Int32 constant to long requires widening cast as well.
19992
19993         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19994         for integers because the type on the stack is not i4.
19995
19996 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19997
19998         * expression.cs (report118): require location argument. 
19999
20000         * parameter.cs: Do not dereference potential null value.
20001
20002         * class.cs: Catch methods that lack the `new' keyword when
20003         overriding a name.  Report warnings when `new' is used without
20004         anything being there to override.
20005
20006         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20007
20008         * class.cs: Only add constructor to hashtable if it is non-null
20009         (as now constructors can fail on define).
20010
20011         (TypeManager, Class, Struct): Take location arguments.
20012
20013         Catch field instance initialization in structs as errors.
20014
20015         accepting_filter: a new filter for FindMembers that is static so
20016         that we dont create an instance per invocation.
20017
20018         (Constructor::Define): Catch errors where a struct constructor is
20019         parameterless 
20020
20021         * cs-parser.jay: Pass location information for various new
20022         constructs. 
20023
20024         * delegate.cs (Delegate): take a location argument.
20025
20026         * driver.cs: Do not call EmitCode if there were problesm in the
20027         Definition of the types, as many Builders wont be there. 
20028
20029         * decl.cs (Decl::Decl): Require a location argument.
20030
20031         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20032         into integers, and find the most appropiate integer for it.
20033
20034         * literal.cs: Implement ULongLiteral.
20035
20036         * rootcontext.cs: Provide better information about the location of
20037         failure when CreateType fails.
20038
20039 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20040
20041         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20042         as well.
20043
20044         * expression.cs (Binary::CheckShiftArguments): Add missing type
20045         computation.
20046         (Binary::ResolveOperator): Add type to the logical and and logical
20047         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20048         before.
20049
20050         (Binary::DoNumericPromotions): In the case where either argument
20051         is ulong (and most signed types combined with ulong cause an
20052         error) perform implicit integer constant conversions as well.
20053
20054 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20055
20056         * expression.cs (UserImplicitCast): Method should always be
20057         non-null. 
20058         (Invocation::BetterConversion): Simplified test for IntLiteral.
20059
20060         (Expression::ImplicitNumericConversion): Split this routine out.
20061         Put the code that performs implicit constant integer conversions
20062         here. 
20063
20064         (Expression::Resolve): Become a wrapper around DoResolve so we can
20065         check eclass and type being set after resolve.
20066
20067         (Invocation::Badness): Remove this dead function
20068
20069         (Binary::ResolveOperator): Do not compute the expensive argumnets
20070         unless we have a union for it.
20071
20072         (Probe::Emit): Is needs to do an isinst and then
20073         compare against null.
20074
20075         (::CanConvert): Added Location argument.  If the Location argument
20076         is null (Location.Null), then we do not report errors.  This is
20077         used by the `probe' mechanism of the Explicit conversion.  We do
20078         not want to generate an error for something that the user
20079         explicitly requested to be casted.  But the pipeline for an
20080         explicit cast first tests for potential implicit casts.
20081
20082         So for now, if the Location is null, it means `Probe only' to
20083         avoid adding another argument.   Might have to revise this
20084         strategy later.
20085
20086         (ClassCast): New class used to type cast objects into arbitrary
20087         classes (used in Explicit Reference Conversions).
20088
20089         Implement `as' as well.
20090
20091         Reverted all the patches from Ravi below: they were broken:
20092
20093                 * The use of `level' as a mechanism to stop recursive
20094                   invocations is wrong.  That was there just to catch the
20095                   bug with a strack trace but not as a way of addressing
20096                   the problem.
20097
20098                   To fix the problem we have to *understand* what is going
20099                   on and the interactions and come up with a plan, not
20100                   just get things going.
20101
20102                 * The use of the type conversion cache that I proposed
20103                   last night had an open topic: How does this work across
20104                   protection domains.  A user defined conversion might not
20105                   be public in the location where we are applying the
20106                   conversion, a different conversion might be selected
20107                   (ie, private A->B (better) but public B->A (worse),
20108                   inside A, A->B applies, but outside it, B->A will
20109                   apply).
20110
20111                 * On top of that (ie, even if the above is solved),
20112                   conversions in a cache need to be abstract.  Ie, `To
20113                   convert from an Int to a Short use an OpcodeCast', not
20114                   `To convert from an Int to a Short use the OpcodeCast on
20115                   the variable 5' (which is what this patch was doing).
20116
20117 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20118
20119         * expression.cs (Invocation::ConversionExists): Re-write to use
20120         the conversion cache
20121
20122         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20123         cache all conversions done, not just user-defined ones.
20124
20125         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20126         to determine if a conversion exists instead of acutually trying to 
20127         perform the conversion. It's faster too.
20128
20129         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20130         and only then attempt the implicit conversion.
20131
20132 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20133
20134         * expression.cs (ConvertImplicit): Use a cache for conversions
20135         already found. Check level of recursion and bail out if necessary.
20136
20137 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20138
20139         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20140         Export standard methods that we expect for string operations.
20141
20142         * statement.cs (Block::UsageWarning): Track usage of variables and
20143         report the errors for not used variables.
20144
20145         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20146         operator. 
20147
20148 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20149
20150         * codegen.cs: remove unnneded code 
20151
20152         * expression.cs: Removed BuiltinTypeAccess class
20153
20154         Fix the order in which implicit conversions are
20155         done.  
20156
20157         The previous fixed dropped support for boxed conversions (adding a
20158         test to the test suite now)
20159
20160         (UserImplicitCast::CanConvert): Remove test for source being null,
20161         that code is broken.  We should not feed a null to begin with, if
20162         we do, then we should track the bug where the problem originates
20163         and not try to cover it up here.
20164
20165         Return a resolved expression of type UserImplicitCast on success
20166         rather than true/false.  Ravi: this is what I was talking about,
20167         the pattern is to use a static method as a "constructor" for
20168         objects. 
20169
20170         Also, do not create arguments until the very last minute,
20171         otherwise we always create the arguments even for lookups that
20172         will never be performed. 
20173
20174         (UserImplicitCast::Resolve): Eliminate, objects of type
20175         UserImplicitCast are born in a fully resolved state. 
20176
20177         * typemanager.cs (InitCoreTypes): Init also value_type
20178         (System.ValueType). 
20179
20180         * expression.cs (Cast::Resolve): First resolve the child expression.
20181
20182         (LValue): Add new method AddressOf to be used by
20183         the `&' operator.  
20184
20185         Change the argument of Store to take an EmitContext instead of an
20186         ILGenerator, because things like FieldExpr need to be able to call
20187         their children expression to generate the instance code. 
20188
20189         (Expression::Error, Expression::Warning): Sugar functions for
20190         reporting errors.
20191
20192         (Expression::MemberLookup): Accept a TypeContainer instead of a
20193         Report as the first argument.
20194
20195         (Expression::ResolvePrimary): Killed.  I still want to improve
20196         this as currently the code is just not right.
20197
20198         (Expression::ResolveMemberAccess): Simplify, but it is still
20199         wrong. 
20200
20201         (Unary::Resolve): Catch errors in AddressOf operators.
20202
20203         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20204         index to a byte for the short-version, or the compiler will choose
20205         the wrong Emit call, which generates the wrong data.
20206
20207         (ParameterReference::Emit, ::Store): same.
20208
20209         (FieldExpr::AddressOf): Implement.
20210
20211         * typemanager.cs: TypeManager: made public variable instead of
20212         property.
20213
20214         * driver.cs: document --fatal.
20215
20216         * report.cs (ErrorMessage, WarningMessage): new names for the old
20217         Error and Warning classes.
20218
20219         * cs-parser.jay (member_access): Turn built-in access to types
20220         into a normal simplename
20221
20222 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20223
20224         * expression.cs (Invocation::BetterConversion): Fix to cope
20225         with q being null, since this was introducing a bug.
20226
20227         * expression.cs (ConvertImplicit): Do built-in conversions first.
20228
20229 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20230
20231         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20232
20233 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20234
20235         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20236         I had introduced long ago (what's new ?).
20237
20238         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20239         the work of all the checking. 
20240         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20241         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20242
20243         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20244         that is the right way. 
20245
20246         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20247         overloading resolution. Use everywhere instead of cutting and pasting code.
20248
20249         (Binary::ResolveOperator): Use MakeUnionSet.
20250
20251         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20252         we have to convert to bool types. Not complete yet.
20253
20254 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20255
20256         * typemanager.cs (TypeManager::CSharpName): support ushort.
20257
20258         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20259         to provide an expression that performsn an implicit constant int
20260         conversion (section 6.1.6).
20261         (Expression::ConvertImplicitRequired): Reworked to include
20262         implicit constant expression conversions.
20263
20264         (Expression::ConvertNumericExplicit): Finished.
20265
20266         (Invocation::Emit): If InstanceExpression is null, then it means
20267         that we perform a call on this.
20268
20269 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * expression.cs (Unary::Emit): Remove some dead code.
20272         (Probe): Implement Resolve and Emit for `is'.
20273         (Expression::ConvertImplicitRequired): Attempt to do constant
20274         expression conversions here.  Maybe should be moved to
20275         ConvertImplicit, but I am not sure.
20276         (Expression::ImplicitLongConstantConversionPossible,
20277         Expression::ImplicitIntConstantConversionPossible): New functions
20278         that tell whether is it possible to apply an implicit constant
20279         expression conversion.
20280
20281         (ConvertNumericExplicit): Started work on explicit numeric
20282         conversions.
20283
20284         * cs-parser.jay: Update operator constants.
20285
20286         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20287         (Parameters::GetSignature): Hook up VerifyArgs here.
20288         (Parameters::VerifyArgs): Verifies that no two arguments have the
20289         same name. 
20290
20291         * class.cs (Operator): Update the operator names to reflect the
20292         ones that the spec expects (as we are just stringizing the
20293         operator names).
20294
20295         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20296         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20297         previous usage did only work for our methods.
20298         (Expression::ConvertImplicit): Handle decimal implicit numeric
20299         conversions as well.
20300         (Expression::InternalTypeConstructor): Used to invoke constructors
20301         on internal types for default promotions.
20302
20303         (Unary::Emit): Implement special handling for the pre/post
20304         increment/decrement for overloaded operators, as they need to have
20305         the same semantics as the other operators.
20306
20307         (Binary::ResolveOperator): ditto.
20308         (Invocation::ConversionExists): ditto.
20309         (UserImplicitCast::Resolve): ditto.
20310
20311 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20312
20313         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20314         operator, return after emitting body. Regression tests pass again !
20315
20316         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20317         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20318         (Invocation::OverloadResolve): Ditto.
20319         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20320
20321         * everywhere : update calls to the above methods accordingly.
20322
20323 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20324
20325         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20326
20327         * expression.cs (ExpressionStatement): New base class used for
20328         expressions that can appear in statements, so that we can provide
20329         an alternate path to generate expression that do not leave a value
20330         on the stack.
20331
20332         (Expression::Emit, and all the derivatives): We no longer return
20333         whether a value is left on the stack or not.  Every expression
20334         after being emitted leaves a single value on the stack.
20335
20336         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20337         facilties of ExpressionStatement if possible.
20338
20339         * cs-parser.jay: Update statement_expression.
20340
20341 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20342
20343         * driver.cs: Change the wording of message
20344
20345 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20346
20347         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20348         the type of the expression to the return type of the method if
20349         we have an overloaded operator match ! The regression tests pass again !
20350         (Unary::ResolveOperator): Ditto.
20351
20352         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20353         to find "op_Implicit", not "implicit" ;-)
20354         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20355         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20356
20357         * everywhere : Correct calls to the above accordingly.
20358
20359         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20360         (ConvertImplicit): Do user-defined conversion if it exists.
20361
20362 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20363
20364         * assign.cs: track location.
20365         (Resolve): Use implicit conversions on assignment.
20366
20367         * literal.cs: Oops.  Not good, Emit of short access values should
20368         pass (Bytes) or the wrong argument will be selected.
20369
20370         * expression.cs (Unary::Emit): Emit code for -expr.
20371
20372         (Unary::ResolveOperator): Handle `Substract' for non-constants
20373         (substract from zero from the non-constants).
20374         Deal with Doubles as well. 
20375
20376         (Expression::ConvertImplicitRequired): New routine that reports an
20377         error if no implicit conversion exists. 
20378
20379         (Invocation::OverloadResolve): Store the converted implicit
20380         expressions if we make them
20381
20382 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20383
20384         * class.cs (ConstructorInitializer): Take a Location argument.
20385         (ConstructorBaseInitializer): Same here.
20386         (ConstructorThisInitializer): Same here.
20387
20388         * cs-parser.jay : Update all calls accordingly.
20389
20390         * expression.cs (Unary, Binary, New): Take location argument.
20391         Update accordingly everywhere.
20392
20393         * cs-parser.jay : Update all calls to the above to take a location
20394         argument.
20395
20396         * class.cs : Ditto.
20397
20398 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20399
20400         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20401         (Invocation::BetterConversion): Same here
20402         (Invocation::ConversionExists): Ditto.
20403
20404         (Invocation::ConversionExists): Implement.
20405
20406 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20407
20408         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20409         Also take an additional TypeContainer argument.
20410
20411         * All over : Pass in TypeContainer as argument to OverloadResolve.
20412
20413         * typemanager.cs (CSharpName): Update to check for the string type and return
20414         that too.
20415
20416         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20417         a given method.
20418
20419 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20420
20421         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20422         (Invocation::BetterFunction): Implement.
20423         (Invocation::BetterConversion): Implement.
20424         (Invocation::ConversionExists): Skeleton, no implementation yet.
20425
20426         Okay, things work fine !
20427
20428 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20429
20430         * typemanager.cs: declare and load enum_type, delegate_type and
20431         void_type. 
20432
20433         * expression.cs (Expression::Emit): Now emit returns a value that
20434         tells whether a value is left on the stack or not.  This strategy
20435         might be reveted tomorrow with a mechanism that would address
20436         multiple assignments.
20437         (Expression::report118): Utility routine to report mismatches on
20438         the ExprClass.
20439
20440         (Unary::Report23): Report impossible type/operator combination
20441         utility function.
20442
20443         (Unary::IsIncrementableNumber): Whether the type can be
20444         incremented or decremented with add.
20445         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20446         complemented. 
20447         (Unary::ResolveOperator): Implement ++, !, ~,
20448
20449         (Invocation::Emit): Deal with new Emit convetion.
20450
20451         * All Expression derivatives: Updated their Emit method to return
20452         whether they leave values on the stack or not.
20453
20454         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20455         stack for expressions that are statements. 
20456
20457 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * expression.cs (LValue): New interface.  Must be implemented by
20460         LValue objects.
20461         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20462         LValue interface.
20463
20464         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20465         interface for generating code, simplifies the code.
20466
20467 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20468
20469         * expression.cs (everywhere): Comment out return statements in ::Resolve
20470         methods to avoid the warnings.
20471
20472 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20473
20474         * driver.cs (parse): Report error 2001 if we can not open the
20475         source file.
20476
20477         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20478         not resolve it.
20479
20480         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20481         object. 
20482
20483         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20484         otherwise nested blocks end up with the same index.
20485
20486         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20487
20488         * expression.cs:  Instead of having FIXMEs in the Resolve
20489         functions, throw exceptions so it is obvious that we are facing a
20490         bug. 
20491
20492         * cs-parser.jay (invocation_expression): Pass Location information.
20493
20494         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20495         Use a basename for those routines because .NET does not like paths
20496         on them. 
20497
20498         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20499         already defined.
20500
20501 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20502
20503         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20504         are loading the correct data types (throws an exception if not).
20505         (TypeManager::InitCoreTypes): Use CoreLookupType
20506
20507         * expression.cs (Unary::ResolveOperator): return the child
20508         expression for expressions which are just +expr.
20509         (Unary::ResolveOperator): Return negative literals for -LITERAL
20510         expressions (otherwise they are Unary {Literal}).
20511         (Invocation::Badness): Take into account `Implicit constant
20512         expression conversions'.
20513
20514         * literal.cs (LongLiteral): Implement long literal class.
20515         (IntLiteral): export the `Value' of the intliteral. 
20516
20517 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20518
20519         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20520
20521         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20522         instead of 'Operator'
20523
20524         * expression.cs (Binary::ResolveOperator): Update accordingly.
20525         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20526         and 'Minus'
20527
20528         * cs-parser.jay (unary_expression): Update to use the new names.
20529
20530         * gen-treedump.cs (GetUnary): Same here.
20531
20532         * expression.cs (Unary::Resolve): Implement.
20533         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20534         operators are found instead of making noise ;-)
20535         (Unary::ResolveOperator): New method to do precisely the same thing which
20536         Binary::ResolveOperator does for Binary expressions.
20537         (Unary.method, .Arguments): Add.
20538         (Unary::OperName): Implement.   
20539         (Unary::ForceConversion): Copy and Paste !
20540
20541         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20542         a unary operator.
20543
20544         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20545         for the inbuilt operators. Only overloading works for now ;-)
20546
20547 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20548
20549         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20550         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20551
20552         * expression.cs (This::Emit): Implement. 
20553         (This::Resolve): Implement.
20554         (TypeOf:Resolve): Implement.
20555         (Expression::ResolveSimpleName): Add an implicit this to instance
20556         field references. 
20557         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20558         Bind instance variable to Field expressions.
20559         (FieldExpr::Instance): New field used to track the expression that
20560         represents the object instance.
20561         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20562         binding 
20563         (FieldExpr::Emit): Implement.
20564
20565         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20566         the last instruction contains a return opcode to avoid generating
20567         the last `ret' instruction (this generates correct code, and it is
20568         nice to pass the peverify output).
20569
20570         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20571         initializer for static and instance variables.
20572         (Constructor::Emit): Allow initializer to be null in the case of
20573         static constructors.  Only emit initializer for instance
20574         constructors. 
20575
20576         (TypeContainer::FindMembers): Return a null array if there are no
20577         matches.
20578
20579         Also fix the code for the MemberTypes.Method branch, as it was not
20580         scanning that for operators (or tried to access null variables before).
20581
20582         * assign.cs (Assign::Emit): Handle instance and static fields. 
20583
20584         * TODO: Updated.
20585
20586         * driver.cs: Stop compilation if there are parse errors.
20587
20588         * cs-parser.jay (constructor_declaration): Provide default base
20589         initializer for non-static constructors.
20590         (constructor_declarator): Do not provide a default base
20591         initializers if none was specified.
20592         Catch the fact that constructors should not have parameters.
20593
20594         * class.cs: Do not emit parent class initializers for static
20595         constructors, that should be flagged as an error.
20596
20597 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20598
20599         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20600         Move back code into TypeContainer::Populate.
20601
20602 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20603
20604         * class.cs (TypeContainer::AddConstructor): Fix the check to
20605         compare against Name, not Basename. 
20606         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20607
20608         * cs-parser.jay : Update accordingly.
20609
20610         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20611         for methods, don't forget to look into the operators too.
20612         (RegisterMethodBuilder): Helper method to take care of this for
20613         methods, constructors and operators.
20614         (Operator::Define): Completely revamp.
20615         (Operator.OperatorMethod, MethodName): New fields.
20616         (TypeContainer::Populate): Move the registering of builders into
20617         RegisterMethodBuilder.
20618         (Operator::Emit): Re-write.
20619
20620         * expression.cs (Binary::Emit): Comment out code path to emit method
20621         invocation stuff for the case when we have a user defined operator. I am
20622         just not able to get it right !
20623
20624 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20625
20626         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20627         argument. 
20628
20629         (Expression::MemberLookup): Provide a version that allows to
20630         specify the MemberTypes and BindingFlags. 
20631
20632         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20633         so it was not fetching variable information from outer blocks.
20634
20635         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20636         Beforefieldinit as it was buggy.
20637
20638         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20639         that Ravi put here.  
20640
20641         * class.cs (Constructor::Emit): Only emit if block is not null.
20642         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20643         deal with this by semantically definining it as if the user had
20644         done it.
20645
20646         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20647         constructors as we now "emit" them at a higher level.
20648
20649         (TypeContainer::DefineDefaultConstructor): Used to define the
20650         default constructors if none was provided.
20651
20652         (ConstructorInitializer): Add methods Resolve and Emit. 
20653
20654         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20655
20656 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20657
20658         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20659         the default constructor builder with our hashtable for methodbuilders
20660         to methodcores.
20661
20662         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20663         and argument_count is 0 in which case we have a match.
20664         (Binary::ResolveOperator): More null checking and miscellaneous coding
20665         style cleanup.
20666
20667 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20668
20669         * rootcontext.cs (IsNameSpace): Compare against null.
20670
20671         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20672
20673         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20674         and Unary::Operator.
20675
20676         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20677         accordingly.
20678
20679         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20680         we have overloaded operators.
20681         (Binary::ResolveOperator): Implement the part which does the operator overload
20682         resolution.
20683
20684         * class.cs (Operator::Emit): Implement.
20685         (TypeContainer::Emit): Emit the operators we have too.
20686
20687         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20688         the case when we have a user-defined operator.
20689
20690 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20691
20692         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20693
20694 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20695
20696         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20697         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20698         (Constructor::Emit): Implement.
20699         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20700         if we have no work to do. 
20701         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20702         Emit method.
20703
20704         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20705         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20706
20707         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20708         of parent.parent.
20709
20710 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20711
20712         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20713         in the source.
20714         (Tree::RecordNamespace): Method to do what the name says ;-)
20715         (Tree::Namespaces): Property to get at the namespaces hashtable.
20716
20717         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20718         keep track.
20719
20720         * rootcontext.cs (IsNamespace): Fixed it :-)
20721
20722 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20723
20724         * class.cs (TypeContainer::FindMembers): Add support for
20725         constructors. 
20726         (MethodCore): New class that encapsulates both the shared aspects
20727         of a Constructor and a Method.  
20728         (Method, Constructor): Factored pieces into MethodCore.
20729
20730         * driver.cs: Added --fatal which makes errors throw exceptions.
20731         Load System assembly as well as part of the standard library.
20732
20733         * report.cs: Allow throwing exceptions on errors for debugging.
20734
20735         * modifiers.cs: Do not use `parent', instead use the real type
20736         container to evaluate permission settings.
20737
20738         * class.cs: Put Ravi's patch back in.  He is right, and we will
20739         have to cope with the
20740
20741 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20742
20743         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20744         FamORAssem, not FamANDAssem.
20745
20746 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20747
20748         * driver.cs: Added --parse option that only parses its input files
20749         and terminates.
20750
20751         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20752         incorrect.  IsTopLevel is not used to tell whether an object is
20753         root_types or not (that can be achieved by testing this ==
20754         root_types).  But to see if this is a top-level *class* (not
20755         necessarly our "toplevel" container). 
20756
20757 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20758
20759         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20760         parent instead of a direct call to GetType.
20761
20762 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20763
20764         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20765         Modifiers.TypeAttr. This should just be a call to that method.
20766
20767         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20768         object so that we can determine if we are top-level or not.
20769
20770         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20771         TypeContainer too.
20772
20773         * enum.cs (Enum::Define): Ditto.
20774
20775         * modifiers.cs (FieldAttr): Re-write.
20776
20777         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20778         (TypeContainer::HaveStaticConstructor): New property to provide access
20779         to precisely that info.
20780
20781         * modifiers.cs (MethodAttr): Re-write.
20782         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20783
20784         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20785         of top-level types as claimed.
20786
20787 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * expression.cs (MemberLookup): Fruitless attempt to lookup
20790         constructors.  Maybe I need to emit default constructors?  That
20791         might be it (currently .NET emits this for me automatically).
20792         (Invocation::OverloadResolve): Cope with Arguments == null.
20793         (Invocation::EmitArguments): new function, shared by the new
20794         constructor and us.
20795         (Invocation::Emit): Handle static and instance methods.  Emit
20796         proper call instruction for virtual or non-virtual invocations.
20797         (New::Emit): Implement.
20798         (New::Resolve): Implement.
20799         (MemberAccess:Resolve): Implement.
20800         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20801         to track instances.
20802         (FieldExpr::Resolve): Set type.
20803
20804         * support.cs: Handle empty arguments.
20805                 
20806         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20807         SimpleLookup): Auxiliary routines to help parse a qualifier
20808         identifier.  
20809
20810         Update qualifier_identifier rule.
20811
20812         * codegen.cs: Removed debugging messages.
20813
20814         * class.cs: Make this a global thing, this acts just as a "key" to
20815         objects that we might have around.
20816
20817         (Populate): Only initialize method_builders_to_methods once.
20818
20819         * expression.cs (PropertyExpr): Initialize type from the
20820         PropertyType. 
20821
20822         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20823         Resolve pattern.  Attempt to implicitly convert value to boolean.
20824         Emit code.
20825
20826         * expression.cs: Set the type for the int32/int32 argument case.
20827         (Binary::ResolveOperator): Set the return type to boolean for
20828         comparission operators
20829
20830         * typemanager.cs: Remove debugging print code.
20831
20832         (Invocation::Resolve): resolve type.
20833
20834         * class.cs: Allocate a MemberInfo of the correct size, as the code
20835         elsewhere depends on the test to reflect the correct contents.
20836
20837         (Method::) Keep track of parameters, due to System.Reflection holes
20838
20839         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20840         mapping here.
20841
20842         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20843         of the exact size and return that.
20844
20845         (Class::LookupMethodByBuilder): New function that maps
20846         MethodBuilders to its methods.  Required to locate the information
20847         on methods because System.Reflection bit us again.
20848
20849         * support.cs: New file, contains an interface ParameterData and
20850         two implementations: ReflectionParameters and InternalParameters
20851         used to access Parameter information.  We will need to grow this
20852         as required.
20853
20854         * expression.cs (Invocation::GetParameterData): implement a cache
20855         and a wrapper around the ParameterData creation for methods. 
20856         (Invocation::OverloadResolve): Use new code.
20857
20858 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20859
20860         * class.cs (TypeContainer::EmitField): Remove and move into 
20861         (Field::Define): here and modify accordingly.
20862         (Field.FieldBuilder): New member.
20863         (TypeContainer::Populate): Update accordingly.
20864         (TypeContainer::FindMembers): Implement.
20865
20866 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20867
20868         * statement.cs: (VariableInfo::VariableType): New field to be
20869         initialized with the full type once it is resolved. 
20870
20871 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20872
20873         * parameter.cs (GetParameterInfo): Use a type cache to compute
20874         things only once, and to reuse this information
20875
20876         * expression.cs (LocalVariableReference::Emit): Implement.
20877         (OpcodeCast::Emit): fix.
20878
20879         (ParameterReference::Resolve): Implement.
20880         (ParameterReference::Emit): Implement.
20881
20882         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20883         that are expressions need to stay as Expressions.
20884
20885         * typemanager.cs (CSharpName): Returns the C# name of a type if
20886         possible. 
20887
20888         * expression.cs (Expression::ConvertImplicit): New function that
20889         implements implicit type conversions.
20890
20891         (Expression::ImplicitReferenceConversion): Implements implicit
20892         reference conversions.
20893
20894         (EmptyCast): New type for transparent casts.
20895
20896         (OpcodeCast): New type for casts of types that are performed with
20897         a sequence of bytecodes.
20898
20899         (BoxedCast): New type used for casting value types into reference
20900         types.  Emits a box opcode.
20901
20902         (Binary::DoNumericPromotions): Implements numeric promotions of
20903         and computation of the Binary::Type.
20904
20905         (Binary::EmitBranchable): Optimization.
20906
20907         (Binary::Emit): Implement code emission for expressions.
20908
20909         * typemanager.cs (TypeManager): Added two new core types: sbyte
20910         and byte.
20911
20912 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20913
20914         * class.cs (TypeContainer::FindMembers): Method which does exactly
20915         what Type.FindMembers does, only we don't have to use reflection. No
20916         implementation yet.
20917
20918         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20919         typecontainer objects as we need to get at them.
20920         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20921
20922         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20923         typecontainer object.
20924
20925         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20926         of just a Report object.
20927
20928 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20929
20930         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20931         "remove_"
20932         (TypeContainer::Populate): Now define the delegates of the type too.
20933         (TypeContainer.Delegates): Property to access the list of delegates defined
20934         in the type.
20935
20936         * delegates.cs (Delegate::Define): Implement partially.
20937
20938         * modifiers.cs (TypeAttr): Handle more flags.
20939
20940 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20941
20942         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20943         and not <=
20944         (Operator::Define): Re-write logic to get types by using the LookupType method
20945         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20946         (Indexer::Define): Ditto.
20947         (Event::Define): Ditto.
20948         (Property::Define): Ditto.
20949
20950 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20951
20952         * class.cs (TypeContainer::Populate): Now define operators too. 
20953         (TypeContainer.Operators): New property to access the list of operators
20954         in a type.
20955         (Operator.OperatorMethodBuilder): New member to hold the method builder
20956         for the operator we are defining.
20957         (Operator::Define): Implement.
20958
20959 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20960
20961         * class.cs (Event::Define): Make the prefixes of the accessor methods
20962         addOn_ and removeOn_ 
20963
20964         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20965         of the location being passed in too. Ideally, this should go later since all
20966         error reporting should be done through the Report object.
20967
20968         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20969         (Populate): Iterate thru the indexers we have and define them too.
20970         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20971         for the get and set accessors.
20972         (Indexer::Define): Implement.
20973
20974 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20975
20976         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20977         my previous implementation, did not work.
20978
20979         * typemanager.cs: Add a couple of missing types (the longs).
20980
20981         * literal.cs: Use TypeManager.bool_type instead of getting it.
20982
20983         * expression.cs (EventExpr): New kind of expressions.
20984         (Expressio::ExprClassFromMemberInfo): finish
20985
20986 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * assign.cs: Emit stores to static fields differently.
20989
20990 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20991
20992         * Merge in changes and adjust code to tackle conflicts. Backed out my
20993         code in Assign::Resolve ;-) 
20994
20995 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20996
20997         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20998         instead Report.Error and also pass in the location.
20999         (CSharpParser::Lexer): New readonly property to return the reference
21000         to the Tokenizer object.
21001         (declare_local_variables): Use Report.Error with location instead of plain 
21002         old error.
21003         (CheckDef): Ditto.
21004
21005         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21006         (Operator.CheckBinaryOperator): Ditto.
21007
21008         * cs-parser.jay (operator_declarator): Update accordingly.
21009
21010         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21011         (CheckBinaryOperator): Same here.
21012
21013         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21014         on the name without any prefixes of namespace names etc. This is because we
21015         already might have something already fully qualified like 
21016         'System.Console.WriteLine'
21017
21018         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21019
21020 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21021
21022         * cs-tokenizer.cs (location): Return a string which also contains
21023         the file name.
21024
21025         * expression.cs (ElementAccess): New class for expressions of the
21026         type 'element access.'
21027         (BaseAccess): New class for expressions of the type 'base access.'
21028         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21029         respectively.
21030
21031         * cs-parser.jay (element_access): Implement action.
21032         (base_access): Implement actions.
21033         (checked_expression, unchecked_expression): Implement.
21034
21035         * cs-parser.jay (local_variable_type): Correct and implement.
21036         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21037
21038         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21039
21040         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21041         name and the specifiers.
21042
21043         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21044
21045         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21046         making them all public ;-)
21047
21048         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21049         class anyways.
21050
21051 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21052
21053         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21054         PropertyExprs.
21055         (FieldExpr, PropertyExprs): New resolved expressions.
21056         (SimpleName::MemberStaticCheck): Perform static checks for access
21057         to non-static fields on static methods. Maybe this should be
21058         generalized for MemberAccesses. 
21059         (SimpleName::ResolveSimpleName): More work on simple name
21060         resolution. 
21061
21062         * cs-parser.jay (primary_expression/qualified_identifier): track
21063         the parameter index.
21064
21065         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21066         (EmitContext::EmitBoolExpression): Chain to expression generation
21067         instead of temporary hack.
21068         (::EmitStatementExpression): Put generic expression code generation.
21069
21070         * assign.cs (Assign::Emit): Implement variable assignments to
21071         local variables, parameters and fields.
21072
21073 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21074
21075         * statement.cs (Block::GetVariableInfo): New method, returns the
21076         VariableInfo for a variable name in a block.
21077         (Block::GetVariableType): Implement in terms of GetVariableInfo
21078
21079         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21080         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21081
21082 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21083
21084         * cs-parser.jay (operator_declaration): Continue on my quest : update
21085         to take attributes argument.
21086         (event_declaration): Ditto.
21087         (enum_declaration): Ditto.
21088         (indexer_declaration): Ditto.
21089
21090         * class.cs (Operator::Operator): Update constructor accordingly.
21091         (Event::Event): Ditto.
21092
21093         * delegate.cs (Delegate::Delegate): Same here.
21094
21095         * enum.cs (Enum::Enum): Same here.
21096
21097 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21098
21099         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21100
21101         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21102
21103         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21104         being passed around as an arraylist.
21105         (Attributes::AddAttribute): Method to add attribute sections.
21106
21107         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21108         (struct_declaration): Update accordingly.
21109         (constant_declaration): Update.
21110         (field_declaration): Update.
21111         (method_header): Update.
21112         (fixed_parameter): Update.
21113         (parameter_array): Ditto.
21114         (property_declaration): Ditto.
21115         (destructor_declaration): Ditto.
21116
21117         * class.cs (Struct::Struct): Update constructors accordingly.
21118         (Class::Class): Ditto.
21119         (Field::Field): Ditto.
21120         (Method::Method): Ditto.
21121         (Property::Property): Ditto.
21122         (TypeContainer::OptAttribute): update property's return type.
21123
21124         * interface.cs (Interface.opt_attributes): New member.
21125         (Interface::Interface): Update to take the extra Attributes argument.
21126
21127         * parameter.cs (Parameter::Parameter): Ditto.
21128
21129         * constant.cs (Constant::Constant): Ditto.
21130
21131         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21132         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21133         the attributes as a parameter.
21134         (InterfaceProperty): Update constructor call.
21135         (InterfaceEvent): Ditto.
21136         (InterfaceMethod): Ditto.
21137         (InterfaceIndexer): Ditto.
21138
21139         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21140         pass the attributes too.
21141         (interface_event_declaration): Ditto.
21142         (interface_property_declaration): Ditto.
21143         (interface_method_declaration): Ditto.
21144         (interface_declaration): Ditto.
21145
21146 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21147
21148         * class.cs (Method::Define): Track the "static Main" definition to
21149         create an entry point. 
21150
21151         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21152         EntryPoint if we find it. 
21153
21154         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21155         (EmitContext::ig): Make this variable public.
21156
21157         * driver.cs: Make the default output file be the first file name
21158         with the .exe extension.  
21159
21160         Detect empty compilations
21161
21162         Handle various kinds of output targets.  Handle --target and
21163         rename -t to --dumper.
21164
21165         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21166         methods inherited from Expression return now an Expression.  This
21167         will is used during the tree rewriting as we resolve them during
21168         semantic analysis.
21169
21170         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21171         the spec.  Missing entirely is the information about
21172         accessability of elements of it.
21173
21174         (Expression::ExprClassFromMemberInfo): New constructor for
21175         Expressions that creates a fully initialized Expression based on
21176         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21177         a Type.
21178
21179         (Invocation::Resolve): Begin implementing resolution of invocations.
21180
21181         * literal.cs (StringLiteral):  Implement Emit.
21182
21183 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21184
21185         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21186         member.
21187
21188 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21189
21190         * cs-parser.jay (attribute_arguments): Implement actions.
21191         (attribute): Fix bug in production. Implement action.
21192         (attribute_list): Implement.
21193         (attribute_target): Implement.
21194         (attribute_target_specifier, opt_target_specifier): Implement
21195         (CheckAttributeTarget): New method to check if the attribute target
21196         is valid.
21197         (attribute_section): Implement.
21198         (opt_attributes): Implement.
21199
21200         * attribute.cs : New file to handle attributes.
21201         (Attribute): Class to hold attribute info.
21202
21203         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21204         (attribute_section): Modify production to use 2 different rules to 
21205         achieve the same thing. 1 s/r conflict down !
21206         Clean out commented, useless, non-reducing dimension_separator rules.
21207
21208         * class.cs (TypeContainer.attributes): New member to hold list
21209         of attributes for a type.
21210         (Struct::Struct): Modify to take one more argument, the attribute list.
21211         (Class::Class): Ditto.
21212         (Field::Field): Ditto.
21213         (Method::Method): Ditto.
21214         (Property::Property): Ditto.
21215
21216         * cs-parser.jay (struct_declaration): Update constructor call to
21217         pass in the attributes too.
21218         (class_declaration): Ditto.
21219         (constant_declaration): Ditto.
21220         (field_declaration): Ditto.
21221         (method_header): Ditto.
21222         (fixed_parameter): Ditto.
21223         (parameter_array): Ditto.
21224         (property_declaration): Ditto.
21225
21226         * constant.cs (Constant::Constant): Update constructor similarly.
21227         Use System.Collections.
21228
21229         * parameter.cs (Parameter::Parameter): Update as above.
21230
21231 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21232
21233         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21234         (TypeContainer.delegates): New member to hold list of delegates.
21235
21236         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21237         this time as I seem to be on crack ;-)
21238
21239 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21240
21241         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21242         tell whether an identifier represents a namespace.
21243
21244         * expression.cs (NamespaceExpr): A namespace expression, used only
21245         temporarly during expression resolution.
21246         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21247         utility functions to resolve names on expressions.
21248
21249 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21250
21251         * codegen.cs: Add hook for StatementExpressions. 
21252
21253         * class.cs: Fix inverted test for static flag in methods.
21254
21255 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21256
21257         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21258         to make it coincide with MS' number.
21259         (Operator::CheckBinaryOperator): Ditto.
21260
21261         * ../errors/errors.txt : Remove error numbers added earlier.
21262
21263         * ../errors/cs1019.cs : Test case for error # 1019
21264
21265         * ../errros/cs1020.cs : Test case for error # 1020
21266
21267         * cs-parser.jay : Clean out commented cruft.
21268         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21269         used anywhere - non-reducing rule.
21270         (namespace_declarations): Non-reducing rule - comment out.
21271
21272         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21273         with TypeContainer::AddEnum.
21274
21275         * delegate.cs : New file for delegate handling classes.
21276         (Delegate): Class for declaring delegates.
21277
21278         * makefile : Update.
21279
21280         * cs-parser.jay (delegate_declaration): Implement.
21281
21282 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21283
21284         * class.cs (Event::Define): Implement.
21285         (Event.EventBuilder): New member.
21286
21287         * class.cs (TypeContainer::Populate): Update to define all enums and events
21288         we have.
21289         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21290         readonly fields for all these cases ?
21291
21292 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21293
21294         * class.cs (Property): Revamp to use the convention of making fields readonly.
21295         Accordingly modify code elsewhere.
21296
21297         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21298         the Define method of the Property class.
21299
21300         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21301         trivial bug.
21302         (TypeContainer::Populate): Update to define all the properties we have. Also
21303         define all enumerations.
21304
21305         * enum.cs (Define): Implement.
21306
21307 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21308
21309         * cs-parser.jay (overloadable_operator): The semantic value is an
21310         enum of the Operator class.
21311         (operator_declarator): Implement actions.
21312         (operator_declaration): Implement.
21313
21314         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21315         validity of definitions.
21316         (Operator::CheckBinaryOperator): Static method to check for binary operators
21317         (TypeContainer::AddOperator): New method to add an operator to a type.
21318
21319         * cs-parser.jay (indexer_declaration): Added line to actually call the
21320         AddIndexer method so it gets added ;-)
21321
21322         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21323         already taken care of by the MS compiler ?  
21324
21325 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21326
21327         * class.cs (Operator): New class for operator declarations.
21328         (Operator::OpType): Enum for the various operators.
21329
21330 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21331
21332         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21333         ostensibly handle this in semantic analysis.
21334
21335         * cs-parser.jay (general_catch_clause): Comment out
21336         (specific_catch_clauses, specific_catch_clause): Ditto.
21337         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21338         (catch_args, opt_catch_args): New productions.
21339         (catch_clause): Rewrite to use the new productions above
21340         (catch_clauses): Modify accordingly.
21341         (opt_catch_clauses): New production to use in try_statement
21342         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21343         and re-write the code in the actions to extract the specific and
21344         general catch clauses by being a little smart ;-)
21345
21346         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21347         Hooray, try and catch statements parse fine !
21348
21349 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21350
21351         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21352         string from the hashtable of variables.
21353
21354         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21355         I end up making that mistake ;-)
21356         (catch_clauses): Fixed gross error which made Key and Value of the 
21357         DictionaryEntry the same : $1 !!
21358
21359 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21360
21361         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21362
21363         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21364         when the add and remove accessors are specified. 
21365
21366 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21367
21368         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21369         information about indexer_declarator.
21370         (indexer_declarator): Implement actions.
21371         (parsing_indexer): New local boolean used to keep track of whether
21372         we are parsing indexers or properties. This is necessary because 
21373         implicit_parameters come into picture even for the get accessor in the 
21374         case of an indexer.
21375         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21376
21377         * class.cs (Indexer): New class for indexer declarations.
21378         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21379         (TypeContainer::indexers): New member to hold list of indexers for the
21380         type.
21381
21382 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21383
21384         * cs-parser.jay (add_accessor_declaration): Implement action.
21385         (remove_accessor_declaration): Implement action.
21386         (event_accessors_declaration): Implement
21387         (variable_declarators): swap statements for first rule - trivial.
21388
21389         * class.cs (Event): New class to hold information about event
21390         declarations.
21391         (TypeContainer::AddEvent): New method to add an event to a type
21392         (TypeContainer::events): New member to hold list of events.
21393
21394         * cs-parser.jay (event_declaration): Implement actions.
21395
21396 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21397
21398         * cs-parser.jay (dim_separators): Implement. Make it a string
21399         concatenating all the commas together, just as they appear.
21400         (opt_dim_separators): Modify accordingly
21401         (rank_specifiers): Update accordingly. Basically do the same
21402         thing - instead, collect the brackets here.
21403         (opt_rank_sepcifiers): Modify accordingly.
21404         (array_type): Modify to actually return the complete type string
21405         instead of ignoring the rank_specifiers.
21406         (expression_list): Implement to collect the expressions
21407         (variable_initializer): Implement. We make it a list of expressions
21408         essentially so that we can handle the array_initializer case neatly too.
21409         (variable_initializer_list): Implement.
21410         (array_initializer): Make it a list of variable_initializers
21411         (opt_array_initializer): Modify accordingly.
21412
21413         * expression.cs (New::NType): Add enumeration to help us
21414         keep track of whether we have an object/delegate creation
21415         or an array creation.
21416         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21417         members to hold data about array creation.
21418         (New:New): Modify to update NewType
21419         (New:New): New Overloaded contructor for the array creation
21420         case.
21421
21422         * cs-parser.jay (array_creation_expression): Implement to call
21423         the overloaded New constructor.
21424
21425 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21426
21427         * class.cs (TypeContainer::Constructors): Return member
21428         constructors instead of returning null.
21429
21430 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21431
21432         * typemanager.cs (InitCoreTypes): Initialize the various core
21433         types after we have populated the type manager with the user
21434         defined types (this distinction will be important later while
21435         compiling corlib.dll)
21436
21437         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21438         on Expression Classification.  Now all expressions have a method
21439         `Resolve' and a method `Emit'.
21440
21441         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21442         generation from working.     Also add some temporary debugging
21443         code. 
21444
21445 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21446
21447         * codegen.cs: Lots of code generation pieces.  This is only the
21448         beginning, will continue tomorrow with more touches of polish.  We
21449         handle the fundamentals of if, while, do, for, return.  Others are
21450         trickier and I need to start working on invocations soon.
21451
21452         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21453         s.InitStatement. 
21454
21455         * codegen.cs (EmitContext): New struct, used during code
21456         emission to keep a context.   Most of the code generation will be
21457         here. 
21458
21459         * cs-parser.jay: Add embedded blocks to the list of statements of
21460         this block.  So code generation proceeds in a top down fashion.
21461
21462 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21463
21464         * statement.cs: Add support for multiple child blocks.
21465
21466 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * codegen.cs (EmitCode): New function, will emit the code for a
21469         Block of code given a TypeContainer and its ILGenerator. 
21470
21471         * statement.cs (Block): Standard public readonly optimization.
21472         (Block::Block constructors): Link children. 
21473         (Block::Child): Child Linker.
21474         (Block::EmitVariables): Emits IL variable declarations.
21475
21476         * class.cs: Drop support for MethodGroups here, delay until
21477         Semantic Analysis.
21478         (Method::): Applied the same simplification that I did before, and
21479         move from Properties to public readonly fields.
21480         (Method::ParameterTypes): Returns the parameter types for the
21481         function, and implements a cache that will be useful later when I
21482         do error checking and the semantic analysis on the methods is
21483         performed.
21484         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21485         and made a method, optional argument tells whether this is a class
21486         or a structure to apply the `has-this' bit.
21487         (Method::GetCallingConvention): Implement, returns the calling
21488         convention. 
21489         (Method::Define): Defines the type, a second pass is performed
21490         later to populate the methods.
21491
21492         (Constructor::ParameterTypes): implement a cache similar to the
21493         one on Method::ParameterTypes, useful later when we do semantic
21494         analysis. 
21495
21496         (TypeContainer::EmitMethod):  New method.  Emits methods.
21497
21498         * expression.cs: Removed MethodGroup class from here.
21499
21500         * parameter.cs (Parameters::GetCallingConvention): new method.
21501
21502 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * class.cs (TypeContainer::Populate): Drop RootContext from the
21505         argument. 
21506
21507         (Constructor::CallingConvention): Returns the calling convention.
21508         (Constructor::ParameterTypes): Returns the constructor parameter
21509         types. 
21510
21511         (TypeContainer::AddConstructor): Keep track of default constructor
21512         and the default static constructor.
21513
21514         (Constructor::) Another class that starts using `public readonly'
21515         instead of properties. 
21516
21517         (Constructor::IsDefault): Whether this is a default constructor. 
21518
21519         (Field::) use readonly public fields instead of properties also.
21520
21521         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21522         track of static constructors;  If none is used, turn on
21523         BeforeFieldInit in the TypeAttributes. 
21524
21525         * cs-parser.jay (opt_argument_list): now the return can be null
21526         for the cases where there are no arguments. 
21527
21528         (constructor_declarator): If there is no implicit `base' or
21529         `this', then invoke the default parent constructor. 
21530
21531         * modifiers.cs (MethodAttr): New static function maps a set of
21532         modifiers flags into a MethodAttributes enum
21533         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21534         MethodAttr, TypeAttr to represent the various mappings where the
21535         modifiers are used.
21536         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21537
21538 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21539
21540         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21541         method arguments.
21542
21543         * interface.cs (PopulateIndexer): Implemented the code generator
21544         for interface indexers.
21545
21546 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21547
21548         * interface.cs (InterfaceMemberBase): Now we track the new status
21549         here.  
21550
21551         (PopulateProperty): Implement property population.  Woohoo!  Got
21552         Methods and Properties going today. 
21553
21554         Removed all the properties for interfaces, and replaced them with
21555         `public readonly' fields. 
21556
21557 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21558
21559         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21560         initialize their hashtables/arraylists only when they are needed
21561         instead of doing this always.
21562
21563         * parameter.cs: Handle refs and out parameters.
21564
21565         * cs-parser.jay: Use an ArrayList to construct the arguments
21566         instead of the ParameterCollection, and then cast that to a
21567         Parameter[] array.
21568
21569         * parameter.cs: Drop the use of ParameterCollection and use
21570         instead arrays of Parameters.
21571
21572         (GetParameterInfo): Use the Type, not the Name when resolving
21573         types. 
21574
21575 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21576
21577         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21578         and instead use public readonly fields.
21579
21580         * class.cs: Put back walking code for type containers.
21581
21582 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21583
21584         * class.cs (MakeConstant): Code to define constants.
21585
21586         * rootcontext.cs (LookupType): New function.  Used to locate types 
21587
21588
21589 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21590
21591         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21592         this System.Reflection code is.  Kudos to Microsoft
21593
21594         * typemanager.cs: Implement a type cache and avoid loading all
21595         types at boot time.  Wrap in LookupType the internals.  This made
21596         the compiler so much faster.  Wow.  I rule!
21597
21598         * driver.cs: Make sure we always load mscorlib first (for
21599         debugging purposes, nothing really important).
21600
21601         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21602         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21603
21604         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21605         on namespaces that have been imported using the `using' keyword.
21606
21607         * class.cs (TypeContainer::TypeAttr): Virtualize.
21608         (Class::TypeAttr): Return attributes suitable for this bad boy.
21609         (Struct::TypeAttr): ditto.
21610         Handle nested classes.
21611         (TypeContainer::) Remove all the type visiting code, it is now
21612         replaced with the rootcontext.cs code
21613
21614         * rootcontext.cs (GetClassBases): Added support for structs. 
21615
21616 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21617
21618         * interface.cs, statement.cs, class.cs, parameter.cs,
21619         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21620         Drop use of TypeRefs, and use strings instead.
21621
21622 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21623
21624         * rootcontext.cs: 
21625
21626         * class.cs (Struct::Struct): set the SEALED flags after
21627         checking the modifiers.
21628         (TypeContainer::TypeAttr): new property, returns the
21629         TypeAttributes for a class.  
21630
21631         * cs-parser.jay (type_list): Oops, list production was creating a
21632         new list of base types.
21633
21634         * rootcontext.cs (StdLib): New property.
21635         (GetInterfaceTypeByName): returns an interface by type name, and
21636         encapsulates error handling here.
21637         (GetInterfaces): simplified.
21638         (ResolveTree): Encapsulated all the tree resolution here.
21639         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21640         types. 
21641
21642         * driver.cs: Add support for --nostdlib, to avoid loading the
21643         default assemblies.
21644         (Main): Do not put tree resolution here. 
21645
21646         * rootcontext.cs: Beginning of the class resolution.
21647
21648 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21649
21650         * rootcontext.cs: Provide better error reporting. 
21651
21652         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21653
21654         * rootcontext.cs (CreateInterface): Handle the case where there
21655         are no parent interfaces.
21656
21657         (CloseTypes): Routine to flush types at the end.
21658         (CreateInterface): Track types.
21659         (GetInterfaces): Returns an array of Types from the list of
21660         defined interfaces.
21661
21662         * typemanager.c (AddUserType): Mechanism to track user types (puts
21663         the type on the global type hash, and allows us to close it at the
21664         end). 
21665
21666 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21667
21668         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21669         RecordInterface instead.
21670
21671         * cs-parser.jay: Updated to reflect changes above.
21672
21673         * decl.cs (Definition): Keep track of the TypeBuilder type that
21674         represents this type here.  Not sure we will use it in the long
21675         run, but wont hurt for now.
21676
21677         * driver.cs: Smaller changes to accomodate the new code.
21678
21679         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21680         when done. 
21681
21682         * rootcontext.cs (CreateInterface):  New method, used to create
21683         the System.TypeBuilder type for interfaces.
21684         (ResolveInterfaces): new entry point to resolve the interface
21685         hierarchy. 
21686         (CodeGen): Property, used to keep track of the code generator.
21687
21688 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * cs-parser.jay: Add a second production for delegate_declaration
21691         with `VOID'.
21692
21693         (enum_body): Put an opt_comma here instead of putting it on
21694         enum_body or enum_member_declarations so we can handle trailing
21695         commas on enumeration members.  Gets rid of a shift/reduce.
21696
21697         (type_list): Need a COMMA in the middle.
21698
21699         (indexer_declaration): Tell tokenizer to recognize get/set
21700
21701         * Remove old targets.
21702
21703         * Re-add the parser target.
21704
21705 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21706
21707         * cs-parser.jay: Add precendence rules for a number of operators
21708         ot reduce the number of shift/reduce conflicts in the grammar.
21709
21710 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21711
21712         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21713         and put it here.
21714
21715         Get rid of old crufty code.
21716
21717         * rootcontext.cs: Use this to keep track of the parsed
21718         representation and the defined types available to the program. 
21719
21720         * gen-treedump.cs: adjust for new convention.
21721
21722         * type.cs: Split out the type manager, and the assembly builder
21723         from here. 
21724
21725         * typemanager.cs: the type manager will live here now.
21726
21727         * cil-codegen.cs: And the code generator here. 
21728
21729 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21730
21731         * makefile: Fixed up for easy making.
21732
21733 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21734
21735         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21736         the 
21737
21738         (unary_expression): Expand pre_increment_expression and
21739         post_decrement_expression to reduce a shift/reduce.
21740
21741 2001-07-11  Simon Cozens
21742
21743         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21744
21745         Improve allow_keyword_as_indent name.
21746
21747 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * Adjustments for Beta2. 
21750
21751 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21752
21753         * decl.cs: Added `Define' abstract method.
21754         (InTransit): new property, used to catch recursive definitions. 
21755
21756         * interface.cs: Implement `Define'. 
21757
21758         * modifiers.cs: Map Modifiers.constants to
21759         System.Reflection.TypeAttribute flags.
21760
21761         * class.cs: Keep track of types and user-defined types.
21762         (BuilderInit): New method for creating an assembly
21763         (ResolveType): New function to launch the resolution process, only
21764         used by interfaces for now.
21765
21766         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21767         that are inserted into the name space. 
21768
21769 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21770
21771         * ARGH.  I have screwed up my tree so many times due to the use of
21772         rsync rather than using CVS.  Going to fix this at once. 
21773
21774         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21775         load types.
21776
21777 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21778
21779         * Experiment successful: Use System.Type rather that our own
21780         version of Type.  
21781
21782 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21783
21784         * cs-parser.jay: Removed nsAliases from here.
21785
21786         Use new namespaces, handle `using XXX;' 
21787
21788         * namespace.cs: Reimplemented namespace handling, use a recursive
21789         definition of the class.  Now we can keep track of using clauses
21790         and catch invalid using clauses.
21791
21792 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21793
21794         * gen-treedump.cs: Adapted for all the renaming.
21795
21796         * expression.cs (Expression): this class now has a Type property
21797         which returns an expression Type.
21798
21799         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21800         `Type', as this has a different meaning now in the base
21801
21802 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21803
21804         * interface.cs, class.cs: Removed from all the sources the
21805         references to signature computation, as we can not do method
21806         signature computation during the parsing time, as we are not
21807         trying to solve at that point distinguishing:
21808
21809         class X {
21810                 void a (Blah x) {}
21811                 void a (NS.Blah x) {}
21812         }
21813
21814         Which depending on the context might be valid or not, as we do not
21815         know if Blah is the same thing as NS.Blah at that point.
21816
21817         * Redid everything so the code uses TypeRefs now instead of
21818         Types.  TypeRefs are just temporary type placeholders, that need
21819         to be resolved.  They initially have a pointer to a string and the
21820         current scope in which they are used.  This is used later by the
21821         compiler to resolve the reference to an actual Type. 
21822
21823         * DeclSpace is no longer a CIR.Type, and neither are
21824         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21825         are all DeclSpaces, but no Types. 
21826
21827         * type.cs (TypeRefManager): This implements the TypeRef manager,
21828         which keeps track of all the types that need to be resolved after
21829         the parsing has finished. 
21830
21831 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * ARGH.  We are going to have to store `foreach' as a class rather
21834         than resolving it, as we need to verify error 1579 after name
21835         resolution.   *OR* we could keep a flag that says `This request to
21836         IEnumerator comes from a foreach statement' which we can then use
21837         to generate the error.
21838
21839 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21840
21841         * class.cs (TypeContainer.AddMethod): we now add methods to the
21842         MethodGroup instead of the method hashtable.  
21843
21844         * expression.cs: Add MethodGroup abstraction, which gets us one
21845         step closer to the specification in the way we handle method
21846         declarations.  
21847
21848         * cs-parser.jay (primary_expression): qualified_identifier now
21849         tried to match up an identifier to a local variable reference or
21850         to a parameter reference.
21851
21852         current_local_parameters is now a parser global variable that
21853         points to the current parameters for the block, used during name
21854         lookup.
21855
21856         (property_declaration): Now creates an implicit `value' argument to
21857         the set accessor.
21858
21859 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21860
21861         * parameter.cs: Do not use `param' arguments as part of the
21862         signature, per the spec.
21863
21864 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21865
21866         * decl.cs: Base class for classes, structs and interfaces.  This
21867         is the "Declaration Space" 
21868
21869         * cs-parser.jay: Use CheckDef for checking declaration errors
21870         instead of having one on each function.
21871
21872         * class.cs: Factor out some code for handling error handling in
21873         accordance to the "Declarations" section in the "Basic Concepts"
21874         chapter in the ECMA C# spec.
21875
21876         * interface.cs: Make all interface member classes derive from
21877         InterfaceMemberBase.
21878
21879 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21880
21881         * Many things: all interfaces are parsed and generated in
21882         gen-treedump.  Support for member variables, constructors,
21883         destructors, properties, constants is there.
21884
21885         Beginning of the IL backend, but very little done, just there for
21886         testing purposes. 
21887
21888 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21889
21890         * cs-parser.jay: Fix labeled statement.
21891
21892         * cs-tokenizer.cs (escape): Escape " and ' always.
21893         ref_line, ref_name: keep track of the line/filename as instructed
21894         by #line by the compiler.
21895         Parse #line.
21896
21897 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21898
21899         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21900         to match the values in System.CodeDOM.
21901
21902         Divid renamed to Divide.
21903
21904         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21905         statements. 
21906         (Statements.set): remove.
21907
21908         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21909         statements. 
21910
21911         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21912         falseStatements always have valid values. 
21913
21914         * cs-parser.jay: Use System.CodeDOM now.
21915