In mcs:
[mono.git] / mcs / mcs / ChangeLog
1 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #75929.
4         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
6         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
7         (ExplicitConversion): Remove enum cases already handled by
8         implicit conversion.  Move implicit conversion check to the beginning.
9         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10         * expression.cs (ArrayCreation.EmitDynamicInitializers):
11         Don't treat System.Enum as a struct.
12
13 2005-08-30  Jb Evain  <jbevain@gmail.com>
14
15         * attribute.cs: handles as expression in parameters.
16
17 2005-08-30  Raja R Harinath  <rharinath@novell.com>
18
19         Fix #75802.
20         * class.cs (TypeContainer.VerifyClsName): Don't use a
21         PartialContainer when verifying CLS compliance.
22         (AbstractPropertyEventMethod): Set Parent here, ...
23         (PropertyMethod): ... not here.
24
25 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
26
27         * attribute.cs : escaped attribute name should not be allowed to be
28           resolved (e.g. @class as classAttribute). Fixed bug #75930.
29
30 2005-08-29  Raja R Harinath  <rharinath@novell.com>
31
32         Fix #75927.
33         * convert.cs (ImplicitStandardConversionExists): Allow zero also
34         when converting a long constant to unsigned long.
35         * expression.cs (Invocation.OverloadResolve): Add sanity check to
36         detect where IsApplicable and VerifyArgumentsCompat disagree.
37
38 2005-08-29  Raja R Harinath  <rharinath@novell.com>
39         and Carlos Alberto Cortez  <carlos@unixmexico.org>
40
41         Fix #75848.
42         * class.cs (TypeContainer.CanElideInitializer): New helper.
43         (TypeContainer.EmitFieldInitializers): Use it to determine if we
44         can safely emitting the initializer of a field.
45
46 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
47
48         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
49           allowed inside a switch (without loop). Fixed bug #75433.
50
51 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
52
53         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
54         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
55
56 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
57
58         * driver.cs : kinda reverting the default encoding changes (not exact 
59           revert since I noticed that "codepage:reset" might not work fine).
60
61 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
62
63         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
64           Location. Now getter and setter store location correctly.
65           (errors/cs0111-12.cs now reports the expected location.)
66
67 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
68
69         * driver.cs : Use default encoding on the environment.
70           Removed (now that) extra parameter for SeekableStreamReader.
71         * support.cs : (SeekableStreamReader) third .ctor() argument for
72           StreamReader is not required (always true). preamble size could
73           be acquired in simpler and safe way.
74
75 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
76
77         * cs-parser.jay: report CS0642 at warning level 3
78           and report CS0642 for an if else statement also
79           fixes bug #74745. Patch by John Luke (and a bit
80           modified by me).
81           Removed extra CS0642 warning check for "while",
82           "for" and "fixed".
83         * statement.cs: In Block.Resolve(), CS0642 check
84           is reimplemented to check a sequence of an empty
85           statement and a block.
86
87           Both fix bug #66777.
88
89 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
90
91         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
92         detection until I fix it.
93         
94         * cs-tokenizer.cs: Changed error message.
95         
96         * cs-parser.jay: Fixed 2 error locations.
97         
98         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
99         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
100         properties.
101         
102         * enum.cs (GetSignatureForError): Fixed.
103         
104         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
105         method detection.
106         
107         * class.cs,
108         * typemanager.cs (RegisterProperty): Removed.
109         
110         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
111
112 2005-08-24  Raja R Harinath  <rharinath@novell.com>
113
114         Fix #75874.
115         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
116         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
117
118 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
119
120         * expression.cs : tiny fix is required for not warning positive ulong.
121           See test-441.cs.
122
123 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
124
125         * expression.cs : add CS0652 check for constant and integral
126           expression. Fixed bug #53974.
127
128 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
129
130         * expression.cs : in DoNumericPromotions(), check if there is implicit
131           conversion overload for string (to check CS0034). Fixed bug #52492.
132
133 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
134
135         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
136
137 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
138
139         * ecore.cs : report location when it is *not* Null.
140
141 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
142
143         * codegen.cs,
144           ecore.cs,
145           flowanalysis.cs,
146           expression.cs:
147           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
148           correctly. Fixed bug #75721.
149
150 2005-08-23  Raja R Harinath  <rharinath@novell.com>
151
152         * support.cs (SeekableStreamReader.Position): Avoid an expensive
153         loop that performs 'min (pos, char_count)'.
154
155         Fix #75862.
156         * expression.cs (Unary.ResolveOperator): Don't discard implicit
157         converted value in Operator.OnesComplement.
158
159 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
160
161         * anonymous.cs: If the anon method is pulled into a helper class,
162         it needs to be `internal' not `private'. Fixes runtime behavior on
163         msft. bug #75704
164
165 2005-08-20  Martin Baulig  <martin@ximian.com>
166
167         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
168         scope if we don't already have it.
169
170         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
171         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
172         fixes #75867.
173
174 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
175
176         Fix #75803
177         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
178         is a partial class.
179
180 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
181
182         The big constants rewrite
183         Fix #75746, #75685 and more
184         As a side effect saved 1MB for MWF ;-)
185         
186         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
187         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
188         enum based for corlib compilation.
189         
190         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
191         subtractions.
192         
193         * class.cs (FixedField.Define): Use ResolveAsConstant.
194         
195         * const.cs (IConstant): Interface constants and enums.
196         (Const.ResolveValue): New method for constant resolvning.
197         (ExternalConstant): Constants from imported assemblies.
198         
199         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
200         conversion; like enums.
201         (Constant.ToType): Converts this constant to different type.
202         (Constant.Increment): Adds 1.
203         
204         * convert.cs (ImplicitConversionRequired): Simplified.
205         
206         * cs-parser.jay: Create EnumMember directly.
207         
208         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
209         
210         * doc.cs (GenerateEnumDocComment): Removed.
211         
212         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
213         (ConvertIntLiteral): Removed.
214         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
215         
216         * enum.cs (EnumMember): Implement IConstant.
217         (Enum.IsValidEnumConstant): Removed.
218         (Enum.GetNextDefaultValue): Removed.
219         (Enum.FindMembers): Updated.
220         (Enum.GenerateDocComment): Iterate enum members.
221         
222         * expression.cs (Cast.TryReduce): Handle enums correctly.
223         (New.Constantify): Made public.
224         (MemberAccess.DoResolve): Removed contant specific if(s).
225         
226         * literal.cs (NullLiteral): Implement new abstract methods.
227         
228         * statement.cs (GotoCase.Resolve): Use new constant methods.
229         (SwitchLabel.ResolveAndReduce): Use new constant methods.
230         
231         * typemanager.cs (LookupEnum): Removed.
232         (IsEnumType): Fixed to work with corlib.
233         (RegisterConstant): Removed.
234         (LookupConstant): Removed.
235         (GetConstant): Changed to work with IConstant.
236
237 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
238
239         * location.cs : Fixed overflown (>255) column number.
240
241 2005-08-03  Raja R Harinath  <rharinath@novell.com>
242
243         First cut of the qualified-alias-member feature.
244         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
245         token.
246         * cs-parser.jay (DOUBLE_COLON): New token.
247         (namespace_or_type_name): Add rule for recognizing
248         qualified-alias-members.
249         (primary_expression): Likewise.
250         (element_access): Allow QualifiedAliasMember as a possible
251         type-bearing expression.
252         (local_variable_type, local_variable_pointer_type): Likewise.
253         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
254         aliases in the current and enclosing namespace declarations.
255         (NamespaceEntry.UsingAlias): Add CS0440 warning.
256         * decl.cs (MemberName.is_double_colon): New.
257         (MemberName.MemberName): Add new constructor for alias-member.
258         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
259         * expression.cs (QualifiedAliasMember): New expression type.
260
261 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
262
263         * location.cs : it borked when no argument was specified.
264
265 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
266
267         * location.cs : tiny ToString() format fix.
268
269 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
270
271         * statement.cs : oops, it was missing.
272
273 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
274
275         A set of fixes for precise line/column location.
276
277         * location.cs :
278           "token" field now holds a file/line "delta", a line number offset 
279           from the segment, and a column number. See also:
280           http://lists.ximian.com/pipermail/mono-devel-list/2004-
281           December/009508.html
282           Removed static IsNull. Use instance IsNull property instead.
283         * cs-tokenizer.cs :
284           For some tokens it stores Location. For Identifier it stores
285           LocatedToken which is a pair of string name and location.
286           Column numbers are adjusted only at getChar().
287         * report.cs :
288           Use Location.ToString() for reporting (it now contains column).
289         * cs-parser.jay :
290           Largely modified to use LocatedToken instead of
291           string (IDENTIFIER), and to acquire Location from some tokens.
292         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
293           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
294           codegen.cs :
295           Now MemberName holds Location. DeclSpace.ctor() receives Location
296           as a parameter. Removed extra parameters to all derived classes.
297           Replaced Location.IsNull() with instance property.
298         * assign.cs, expression.cs :
299           Added .ctor() overload that omits Location.
300         * attribute.cs :
301           Added "nameEscaped" flag that indicates the identifier was escaped
302           in the source file. This fixes bug #57047.
303
304 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
305
306         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
307         New method, looking for lo-case imported cls type.
308
309         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
310         here.
311
312         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
313
314         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
315
316         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
317         all_imported_types.
318         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
319
320         Optimized to save 3.5 MB for SWF compilation.
321
322 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
323
324         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
325         (PartialContainer.Create): Moved logic AddToContainer.
326         (PartialContainer.MarkForDuplicationCheck): Shares name.
327         
328         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
329         place.
330         
331         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
332         initialization.
333         (Namespace.GetSignatureForError): New method.
334         
335         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
336         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
337
338 2005-08-01  Raja R Harinath  <rharinath@novell.com>
339
340         Fix #75669.
341         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
342         member lookup rather than qualifier_type, since qualifier_type can
343         be null.
344
345 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
346
347         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
348         enum member.
349
350 2005-07-31  Miguel de Icaza  <miguel@novell.com>
351
352         * statement.cs: Copy the local exception into the exception
353         captured local.  Fixes 75674
354
355 2005-07-31  Raja R Harinath  <harinath@gmail.com>
356
357         Fix #75658.
358         * expression.cs (Invocation.OverloadResolve): Don't report error
359         CS1501 if error CS1502 has been reported.
360         (New.DoResolve): Delegate CS1501 reporting to
361         Invocation.OverloadResolve.
362
363         Fix #75656.
364         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
365         invariant-meaning-in-block property in an enclosing block if
366         necessary.
367
368 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
369
370         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
371         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
372         (Switch.CheckSwitch): Just save 50kb for SWF.
373
374 2005-07-27  Martin Baulig  <martin@ximian.com>
375
376         * anonymous.cs (CaptureContext.AddField): Added
377         `AnonymousContainer am' argument; compute its toplevel scope if
378         it's not already computed.  Fixes #75649.
379
380 2005-07-26  Raja R Harinath  <rharinath@novell.com>
381
382         Fix #75628.
383         * class.cs (Constructor.Emit): Reset block to null if the block
384         resolve fails.
385
386 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
387
388         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
389
390 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
391
392         * class.cs (MethodData.Define): Check whether accessor implementing
393         interface is public.
394
395         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
396
397 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
398
399         Fix #57245
400         * namespace.cs (LookupType): Moved same type check to...
401         
402         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
403         with the same name.
404
405 2005-07-21  Raja R Harinath  <rharinath@novell.com>
406
407         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
408         already found a typebuilder.
409         * class.cs (MethodCore.IsDuplicateImplementation): Compare
410         MemberNames, not strings.
411
412         * const.cs (Error_ExpressionMustBeConst): 
413         Rename from Error_EpressionMustBeConst.
414         * const.cs, class.cs, statement.cd: Update.
415
416 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
417
418         Fix #65573
419
420         * const.cs (Const.LookupConstantValue): Report missing contant expression
421         everytime.
422         (Error_EpressionMustBeConstant): Only one error method.
423
424         * class.cs, statement.c: Updated.
425
426 2005-07-20  Raja R Harinath  <rharinath@novell.com>
427
428         * statement.cs (Block.Flags): Add back HasVarargs.
429         (Block.flags): Make protected.
430         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
431
432         * typemanager.cs (types, typecontainers, user_types): Remove.
433         (UserTypes, TypeContainers): Likewise.
434         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
435         (CleanUp, Reset): Update.
436         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
437         (GetNestedType): Use Type.GetNestedType.
438         (CoreLookupType): Take two arguments, the namespace and the
439         basename of the type.  Update to use the Namespace.Lookup
440         mechanism.
441         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
442         (RealMemberLookup): Use IsNestedChildOf instead of playing with
443         string concatenation and substring matches.
444         * class.cs, enum.cs, delegate.cs: Update to changes.
445
446 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
447
448         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
449         Expression and made virtual.
450
451         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
452         (ImplicitStandardConversionExists): Fixed `byte' typo ?
453
454         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
455
456         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
457         error message.
458
459         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
460         change.
461
462 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
463
464         Fix #57707
465         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
466         AssemblyCultureAttribute is not used on executable.
467
468         * rootcontext.cs,
469         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
470
471 2005-07-16  Raja R Harinath  <rharinath@novell.com>
472
473         Fix #60638.
474         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
475         New.  Reports CS0252/CS0253.
476         Mostly taken from preliminary patch by Duncak Mak.
477         (Binary.DoResolveOperator): Store results of operator lookup.
478         Use them to detect if we need to warn about unintended reference
479         comparisons.
480
481 2005-07-15  Raja R Harinath  <rharinath@novell.com>
482
483         Fix #72969.
484         * namespace.cs (Namespace.Lookup): Add back location parameter.
485         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
486         * delegate.cs, ecore.cs, expression.cs: Update to changes.
487
488         * codegen.cs (EmitContext.DeclSpace): Make readonly.
489         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
490         (Namespace.LookupType): ... this.
491         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
492         of namespaces.
493         * typemanager.cs (LookupTypeReflection): Remove buggy code that
494         purported to handle pointers.
495         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
496         CoreLookupType.
497
498 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
499
500         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
501         type as namespace.
502
503 2005-07-15  Raja R Harinath  <rharinath@novell.com>
504
505         * namespace.cs (Namespace.Lookup): Drop location parameter.
506         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
507         (NamespaceEntry.Lookup): ... this.
508         (NamespaceEntry.Error_AmbiguousTypeReference):
509         Move here from DeclSpace.
510         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
511         names ...
512         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
513         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
514         Move to NamespaceEntry.
515         * delegate.cs, expression.cs: Update to changes.
516
517 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
518
519         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
520         CheckAttributeType and refactored.
521         (Attribute.ResolvePossibleAttributeType): Changed to reuse
522         ResolveAsTypeTerminal error handling.
523         (ResolveAsTypeTerminal): Introduced because of global attributes extra
524         handling.
525         (GetSignatureForError): Print errors in same way.
526
527         * class.cs,
528         * codegen.cs: Reflect attribute GetSignatureForError change.
529
530         * ecore.cs,
531         * expression.cs: Add silent parameter to ResolveAsTypeStep.
532
533         * namespace.cs (UsingEntry): Refactored to make fields private.
534
535         * assign.cs,
536         statement.cs: Error_UnexpectedKind has extra parameter.
537
538 2005-07-14  Raja R Harinath  <rharinath@novell.com>
539
540         * ecore.cs (IAlias): Remove.
541         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
542         that implement the interface.
543         * namespace.cs (Namespace): Likewise.
544         (Namespace.declspaces): Renamed from 'defined_names'.
545         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
546         DeclSpace instead of an IAlias.
547         * tree.cs (Tree.AddDecl): Update.
548
549 2005-07-12  Raja R Harinath  <rharinath@novell.com>
550
551         * statement.cs (Block.Flags); Remove HasVarargs.
552         (Block.HasVarargs): Move to ToplevelBlock.
553         (Block.ThisVariable, Block.AddThisVariable): Likewise.
554         (Block.Variables): Make protected.  Initialize variable hashtable
555         if necessary.
556         (Block.AddVariable): Update.
557         (Block.Resolve): Update to changes.
558         (ToplevelBlock.HasVarargs): New boolean.
559         (ToplevelBlock.ThisVariable): Move here from Block.
560         (ToplevelBlock.AddThisVariable): Likewise.
561         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
562         * expression.cs (This.ResolveBase): Update to changes.
563         (ArglistAccess.DoResolve): Likewise.
564
565 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
566
567         Fix #75321
568         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
569
570         * class.cs (TypeContainer.VerifyMembers): Distinguish between
571         not used and not used & assigned.
572         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
573
574 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
575
576         Fix #75053
577         * expression.cs (Is.DoResolve): null is never provided type.
578
579 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
580
581         Fix #52496
582         * cs-parser.jay: Less strict event error rule to catch more errors.
583
584 2005-07-08  Martin Baulig  <martin@ximian.com>
585
586         Fix test-iter-10.cs - distinguish whether we `yield' in a property
587         gettter (allowed) or setter (not allowed).
588
589         * class.cs (Accessor): Implement IIteratorContainer.
590         (Accessor.Yields): New public field.
591         (PropertyBase.PropertyMethod.Define): Handle iterators on a
592         per-accessor basis.
593
594         * cs-parser.jay
595         (get_accessor_declaration, set_accessor_declaration): Set the
596         `yields' flag on the accessor, not the property.
597         (property_declaration): Do the iterators check on a per-accessor
598         basis and not for the whole property.
599
600 2005-07-08  Martin Baulig  <martin@ximian.com>
601
602         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
603         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
604
605 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
606
607         Fix #74975
608         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
609         (ExtractSecurityPermissionSet): Cope with self referencing security
610         attributes properly.
611
612         * driver.cs (SetOutputFile): Made public property OutputFile.
613
614 2005-07-07  Raja R Harinath  <rharinath@novell.com>
615
616         Fix #75486.
617         * class.cs (TypeContainer.first_nonstatic_field): Rename from
618         has_nonstatic_fields.  Make into a FieldBase pointer.
619         (TypeContainer.AddField): Add CS0282 check.
620         (TypeContainer.EmitType): Update.
621
622 2005-07-06  Miguel de Icaza  <miguel@novell.com>
623
624         * cs-tokenizer.cs (consume_identifier): Do not create strings to
625         compare if they start with __.
626
627 2005-07-06  Raja R Harinath  <rharinath@novell.com>
628
629         * statement.cs (Switch.SwitchGoverningType): Only look at
630         UserCasts that don't need implicit standard conversions to one of
631         the allowed switch types (Fixes test-322.cs).
632         (LocalInfo.Resolve): Re-enable sanity-test.
633
634 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
635
636         * cs-tokenizer.cs (consume_identifier): Detect double undescores
637         
638         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
639         
640         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
641
642 2005-07-06  Raja R Harinath  <rharinath@novell.com>
643
644         Fix #75472.
645         * ecore.cs (SimpleName.GetSignatureForError): Add.
646         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
647         (MemberAccess.GetSignatureForError): Add.
648
649 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
650  
651         The big error and warning messages review.
652         
653         * anonymous.cs,
654         * assign.cs,
655         * attribute.cs,
656         * class.cs,
657         * codegen.cs,
658         * convert.cs,
659         * cs-parser.jay,
660         * cs-tokenizer.cs,
661         * decl.cs,
662         * delegate.cs,
663         * doc.cs,
664         * driver.cs,
665         * ecore.cs,
666         * enum.cs,
667         * expression.cs,
668         * flowanalysis.cs,
669         * iterators.cs,
670         * literal.cs,
671         * location.cs,
672         * modifiers.cs,
673         * namespace.cs,
674         * parameter.cs,
675         * pending.cs,
676         * report.cs,
677         * rootcontext.cs,
678         * statement.cs,
679         * support.cs,
680         * tree.cs,
681         * typemanager.cs: Updated.
682         
683         * class.cs: (MethodCore.SetYields): Moved here to share.
684         (PropertyMethod.Define): Moved iterator setup here.
685         
686         * iterators.cs: Add orig_method to have full access to parent
687         container.
688
689 2005-07-05  Raja R Harinath  <rharinath@novell.com>
690
691         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
692         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
693         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
694         variable of struct type.
695         * expression.cs (Unary.ResolveOperator): Update to change.
696         (Indirection.VerifyFixed): Likewise.
697         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
698         (ParameterReference.VerifyFixed): Value parameters are fixed.
699         (This.VerifyFixed): Treat 'this' as a value parameter.
700         * statement.cs (LocalInfo.IsFixed): Remove.
701
702 2005-07-01  Martin Baulig  <martin@ximian.com>
703
704         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
705         `ec.EmitThis ()' to get the correct scope.
706
707 2005-07-01  Martin Baulig  <martin@ximian.com>
708
709         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
710         instance is a ParameterReference; fixes #75299.
711
712 2005-07-01  Martin Baulig  <martin@ximian.com>
713
714         Reverted Marek's latest patch (r46725):
715         - it contains structural changes which are neither mentioned in
716           the ChangeLog nor explained anywhere; for example the additional
717           argument of EmitContext's and Iterator's .ctor's and the
718           TypeContainer.DefineMembers() change.
719         - structural changes like this should go in in seperate patches
720           and not be hidden in a huge patch which just seems to affect
721           warnings and errors.
722           a big and hard to understand patch.
723         - it breaks iterators and causes regressions, for instance in
724           test-iter-03.cs.      
725
726 2005-06-30  Raja R Harinath  <rharinath@novell.com>
727
728         Fix #75412.
729         * expression.cs (Indexers.map): Remove.
730         (Indexers.Append): Filter out inaccessible setters and getters.
731         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
732
733         Fix #75283.
734         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
735         Refactored from ...
736         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
737         (FieldExpr.Emit, PropertyExpr.Emit): Update.
738         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
739         * expression.cs (Invocation.EmitCall): Add CS0120 check.
740
741 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
742
743         Fix #75322
744         * class.cs (FieldBase.GetInitializerExpression): One more field
745         for backup.
746
747 2005-06-28  Miguel de Icaza  <miguel@novell.com>
748
749         * pending.cs: Do not define a proxy if the base method is virtual,
750         it will be picked up by the runtime (bug 75270).
751
752 2005-06-08  Martin Baulig  <martin@ximian.com>
753
754         The big Iterators rewrite :-)
755
756         * iterators.cs: Rewrite this to use the anonymous methods framework.
757
758         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
759         before the TypeContainers; see 2test-21.cs.
760
761         * class.cs
762         (TypeContainer.DefineType): Don't create a new EmitContext if we
763         already have one (this only happens if we're an Iterator).
764         (TypeContainer.Define): Also call Define() on all our iterators.
765         (Method.CreateEmitContext): Added support for iterators.
766
767         * anonymous.cs
768         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
769         (AnonymousContainer.CreateMethodHost): Moved here from
770         AnonymousMethod and made abstract.
771         (AnonymousContainer.CreateScopeType): New abstract method.
772         (AnonymousContainer.IsIterator): New public property.
773         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
774         get the ScopeTypeBuilder rather than manually defining it here. 
775         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
776         iterators here.
777
778         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
779         before RootContext.DefineTypes().
780
781         * codegen.cs (EmitContext.RemapToProxy): Removed.
782         (EmitContext.CurrentAnonymousMethod): Changed type from
783         AnonymousMethod -> AnonymousContainer.
784         (EmitContext.ResolveTopBlock): Protect from being called twice.
785         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
786         (EmitContext.EmitThis): Removed the iterators hacks; use the
787         anonymous methods framework for that.
788
789         * statement.cs
790         (ToplevelBlock.Container): Make this a property, not a field.
791         (ToplevelBlock.ReParent): New public method; move the
792         ToplevelBlock into a new container.
793         (Foreach.TemporaryVariable): Simplify.
794
795 2005-06-05  Martin Baulig  <martin@ximian.com>
796
797         * statement.cs (LocalInfo.CompilerGenerated): New flag.
798         (Block.AddTemporaryVariable): New public method; creates a new
799         `LocalInfo' for a temporary variable.
800         (Block.EmitMeta): Create the LocalBuilders for all the temporary
801         variables here.
802         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
803         non-iterator variables.
804
805 2005-06-05  Martin Baulig  <martin@ximian.com>
806
807         * statement.cs (Foreach.TemporaryVariable): Create the
808         LocalBuilder in the Emit phase and not in Resolve since in some
809         situations, we don't have an ILGenerator during Resolve; see
810         2test-19.cs for an example.
811
812 2005-06-04  Martin Baulig  <martin@ximian.com>
813
814         **** Merged r45395 from GCS ****
815
816         The big Foreach rewrite - Part II.
817
818         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
819         with `PropertyInfo ienumerator_getcurrent'.
820
821         * codegen.cs (VariableStorage): Removed.
822
823         * statement.cs
824         (Foreach): Derive from Statement, not ExceptionStatement.
825         (Foreach.CollectionForeach): New nested class.  Moved all the code
826         dealing with collection foreach here.
827         (Foreach.ForeachHelperMethods): Removed.
828         (Foreach.TemporaryVariable): Implement IMemoryLocation.
829
830 2005-05-23  Martin Baulig  <martin@ximian.com>
831
832         * statement.cs (Try.DoResolve): Don't create a `finally' if we
833         don't need to.  Fix #75014.
834
835 2005-05-20  Martin Baulig  <martin@ximian.com>
836
837         Merged r44808 from GMCS.
838
839         * class.cs (TypeContainer.CircularDepException): Removed.
840         (TypeContainer.DefineType): Removed the `InTransit' stuff.
841         (TypeContainer.CheckRecursiveDefinition): Check for circular class
842         (CS0146) and interface (CS0529) dependencies here.
843
844 2005-06-21  Raja R Harinath  <rharinath@novell.com>
845
846         * expression.cs (Invocation.EmitCall): Fix initialization
847         'this_call' to reflect current behaviour.  Fix indentation.
848
849         * convert.cs (FindMostEncompassedType): Add two trivial special
850         cases (number_of_types == 0 || number_of_types == 1).
851         (FindMostEncompasingType): Likewise.
852
853 2005-06-17  Raja R Harinath  <rharinath@novell.com>
854
855         Some cleanups preparing for the fix of #75283.
856         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
857         error testing.
858         (EventExpr.InstanceResolve): Likewise.
859         (EventExpr.DoResolve): Remove redundant checks.
860
861 2005-06-10  Duncan Mak  <duncan@novell.com>
862
863         * cs-tokenizer.cs (process_directives): New flag for controlling
864         the processing of preprocessor directives.
865         (x_token): After seeing a '#', return Token.NONE instead of going
866         to handle_preprocessing_directive() when not processing
867         directives. This avoids unnecessary processing during the token peek in
868         is_punct().
869
870         This fixes #74939.
871
872         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
873         the existing error reporting methods instead of Report.Error.
874
875         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
876         after Raja's rewrite.
877
878 2005-06-08  Miguel de Icaza  <miguel@novell.com>
879
880         * class.cs: Small fix.
881
882 2005-06-08  Raja R Harinath  <rharinath@novell.com>
883
884         Fix #75160.
885         * class.cs (GetPartialBases): Fix return value check of
886         part.GetClassBases.
887
888 2005-06-07  Raja R Harinath  <rharinath@novell.com>
889
890         Ensure that partial classes are registered in their enclosing
891         namespace.  Initial part of fix of #75160.
892         * tree.cs (Tree.RecordDecl): Add new namespace argument.
893         Register declspace with namespace here, not in
894         DeclSpace.RecordDecl.
895         * cs-parser.jay: Pass namespace to RecordDecl.
896         * class.cs (PartialContainer.Create): Likewise.
897         (ClassPart.DefineType): New sanity-check.  Throws an exception if
898         called.
899         * decl.cs (Declspace.RecordDecl): Remove.
900         * namespace.cs (NamespaceEntry.DefineName): Remove.
901
902 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
903
904         * rootcontext.cs: Reset TargetExt as well.
905
906 2005-06-03  Raja R Harinath  <rharinath@novell.com>
907
908         * ecore.cs (Expression.Resolve): Emit CS0654 error when
909         -langversion:ISO-1.
910
911 2005-06-02  Raja R Harinath  <rharinath@novell.com>
912
913         Fix #75080, cs0119.cs.
914         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
915         of ...
916         (Expression.Resolve): ... this.  Use it.  Remove bogus code
917         allowing ExprClass.Type and ExprClass.Namespace for
918         ResolveFlags.VariableOrValue.
919         (Expression.Resolve) [1-argument variant]: Change default resolve
920         flags based on language version.
921         (Expression.Error_UnexpectedKind): Use a simple string array
922         rather than an ArrayList.
923         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
924         not ExprClass.Type.
925         (TypeOfVoid.DoResolve): Likewise.
926         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
927         flags argument -- it always has the same value.
928
929 2005-05-31  Raja R Harinath  <rharinath@novell.com>
930
931         Fix #75081.
932         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
933         Use it in the error message.
934         * assign.cs, expression.cs, statement.cs: Update.
935
936 2005-05-30  Raja R Harinath  <rharinath@novell.com>
937
938         Fix #75088.
939         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
940         the "almostMatchedMember" case too.
941         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
942         that failed the accessibility checks to 'almost_match'.
943
944 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
945
946         * attribute.cs: Use internal MethodBuilder methods to set
947         ExactSpelling and SetLastError on PInvoke methods, instead
948         of passing them via charset.  Fixes #75060.
949
950 2005-05-27  Raja R Harinath  <rharinath@novell.com>
951
952         * parameter.cs (Parameter): Remove TODO comment.
953         (Parameter.DefineParameter): Remove Location parameter.
954         (Parameters.LabelParameters): Likewise.
955         * class.cs (Constructor.Emit): Update to change.
956         (MethodData.Emit): Likewise.
957         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
958         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
959
960 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
961
962         * parameter.cs,
963           Removed Parameters.Location and added Parameter.Location instead.
964           Removed Location parameter from Emit() and GetSignature().
965         * anonymous.cs,
966           class.cs,
967           cs-parser.jay,
968           delegate.cs,
969           iterators.cs,
970           statement.cs :
971           Modified all related calls.
972
973 2005-05-26  Raja R Harinath  <rharinath@novell.com>
974
975         Improve user-defined conversion handling.
976         * convert.cs (GetConversionOperators): Rewrite.  Return only the
977         applicable operators.
978         (AddConversionOperators): New.  Helper for GetConversionOperators.
979         (FindMostEncompassedType, FindMostEncompassingType): Verify that
980         there is only one most encompassed/encompassing type.
981         (FindMostSpecificSource, FindMostSpecificTarget): Remove
982         "applicable operator" handling.
983         (UserConversion): Move cache here from GetConversionOperators.
984         Directly cache the chosen operator, rather than the whole
985         MethodGroup.
986         (ExplicitNumericConversion): Fix buggy implementation of Decimal
987         case.  Allow conversion of decimal to sbyte and byte too.
988         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
989         New static methods.  Used to avoid allocating EmptyExpressions in
990         convert.cs.
991
992 2005-05-24  Duncan Mak  <duncan@novell.com>
993
994         * ecore.cs (CastFromDecimal): New class for casting a decimal to
995         another class, used in Convert.ExplicitNumericConversion.
996         (CastToDecimal): New class, similar to above, but casts to
997         System.Decimal, used in Convert.ImplicitNumericConversion and also
998         in explicit convesion from double/float to decimal.
999
1000         * convert.cs (ImplicitNumericConversion): Handle implicit
1001         conversions to System.Decimal.
1002         (ExplicitNumericConversion): handle explicit conversions to
1003         System.Decimal.
1004
1005         This fixes #68711.
1006         
1007 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1008
1009         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1010         know the type at this stage, just break through.   Fixes #75008 
1011
1012 2005-05-19  Martin Baulig  <martin@ximian.com>
1013
1014         * delegate.cs
1015         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1016         to disable error reporting.
1017
1018         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1019         here since we don't want to report an error; see the new test-336.cs.
1020
1021 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1022
1023         * statement.cs (ToplevelBlock.GetParameterReference)
1024         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1025         Move here from class Block.
1026         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1027         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1028
1029 2005-05-18  Martin Baulig  <martin@ximian.com>
1030
1031         Fix #74978.
1032
1033         * flowanalysis.cs
1034         (FlowBranching.Reachability): Add non-static public And() and Or()
1035         methods.
1036         (FlowBranchingSwitch): New class; do the `break_origins' thing
1037         like in FlowBranchingLoop.
1038         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1039         reachability, not just locals and parameters.
1040         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1041         switch; MergeBreakOrigins() now takes care of that.
1042
1043 2005-05-18  Martin Baulig  <martin@ximian.com>
1044
1045         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1046         a loop and may leave it, reset the barrier; fixes #74974.
1047
1048 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1049         
1050         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1051         is back.
1052         
1053         * cs-parser.jay: Catch more lexical errors.
1054         
1055         * report.cs: Add one more Error method.
1056         
1057         * rootcontext.cs,
1058         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1059
1060 2005-05-17  Martin Baulig  <martin@ximian.com>
1061
1062         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1063         #70970. 
1064
1065 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1066
1067         Fix test-382.cs.  Emit values of decimal constants.
1068         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1069         Carved out of ...
1070         (TypeContainer.AddField): ... this.
1071         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1072         with initializers to include 'Const's.
1073         (ClassPart.RegisterFieldForInitialization): Forward to
1074         PartialContainer.
1075         * const.cs (Const.Const): Pass initializer to base class.
1076         (Const.Define): In case of decimal constants, register them for
1077         initialization in a static constructor.
1078
1079 2005-05-14  Martin Baulig  <martin@ximian.com>
1080
1081         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1082         do not call ResolveUnreachable() on unreachable statements in
1083         here, see the comment in the source code.
1084
1085 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1086
1087         Fix #74934.
1088         * expression.cs (BinaryResolveOperator): If one of the operands of
1089         an equality comparison is 'null' and the other is a pointer type,
1090         convert the null to a NullPointer.
1091         * convert.cs (ImplicitReferenceConversion): If the expression is a
1092         NullLiteral and the target type is a pointer type, return a
1093         NullPointer instead.
1094         (ImplicitConversionStandard): Likewise.
1095
1096 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1097         
1098         * cs-parser.jay: Set readonly context based on special constructs.
1099         
1100         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1101         readonly variable error handling.
1102         
1103         * rootcontext.cs (EmitCode): Don't verify members when error
1104         occurred.
1105         
1106         * statement.cs (LocalInfo): Add reaodnly context information.
1107         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1108
1109 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1110
1111         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1112         for #74041 to initialize 'resolved' to false only for explicit
1113         blocks.  Fixes #74873.
1114
1115 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1116
1117         Fix #74920.
1118         * typemanager.cs (unmanaged_enclosing_types): New.
1119         (IsUnmanagedType): Avoid infloops by using
1120         'unmanaged_enclosing_types' to talk with recursive invocations.
1121
1122 2005-05-13  Martin Baulig  <martin@ximian.com>
1123
1124         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1125         instance variable, not a local.  Fix #74873.
1126         (Block.ResolveUnreachable): Set it to true here.
1127
1128 2005-05-11  Duncan Mak  <duncan@novell.com>
1129
1130         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1131         continuing to process for 'arg'.
1132         (handle_preprocessing_directive): Check the argument of the #endif
1133         directive and report error CS1025 if there are any trailing
1134         characters.
1135
1136         According to the C# spec, having even whitespace after the #endif
1137         directive is illegal; however, because we call arg.TrimEnd ()
1138         beforehand, we have the same behavior as csc, allowing whitespace
1139         after the directive.
1140
1141         Fixes #74892.
1142
1143 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1144
1145         Fix #74863.
1146         
1147         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1148         (Constructor.GetObsoleteAttribute): Implemented correctly.
1149
1150 2005-05-10  Martin Baulig  <martin@ximian.com>
1151
1152         * support.cs (ReflectionParameters.ParameterModifier): Use
1153         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1154         and `ParameterAttributes.In'.  Fixes #74884.
1155
1156 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1157
1158         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1159         
1160         * expression.cs (Argument.GetParameterModifier): Turned to property.
1161         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1162         
1163         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1164         its C# equivalent.
1165         
1166 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1167
1168         Fix #74852.
1169         * decl.cs (MemberCache.AddMethods): Register override methods,
1170         rather than non-override methods.
1171         * typemanager.cs (RegisterOverride): New.
1172         (IsOverride): Update.
1173
1174 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1175
1176         Fix #73105.
1177         
1178         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1179         recursive declaration.
1180         
1181         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1182         
1183 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1184
1185         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1186         
1187         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1188
1189 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1190
1191         Fix #74797.
1192         * decl.cs (DeclSpace.FamilyAccessible): 
1193         Use TypeManager.IsNestedFamilyAccessible.
1194
1195         Fix reopened #64812.
1196         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1197         internal'.
1198
1199 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1200             Abin Thomas  <projectmonokochi@rediffmail.com>
1201             Anoob V E  <projectmonokochi@rediffmail.com>
1202             Harilal P R  <projectmonokochi@rediffmail.com>
1203
1204         Fix #64812.
1205         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1206         allow access to all static members.
1207
1208 2005-05-04  Martin Baulig  <martin@ximian.com>
1209
1210         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1211
1212 2005-05-04  Martin Baulig  <martin@ximian.com>
1213
1214         Fix #74655.
1215
1216         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1217         section at the end; make things work if `default' is not the last
1218         section.        
1219
1220 2005-05-04  Martin Baulig  <martin@ximian.com>
1221
1222         Fix #70400.
1223
1224         * statement.cs (Switch): Replaced the `got_default' field with a
1225         `default_section' one.
1226         (Switch.CheckSwitch): Set `default_section' here.
1227         (Switch.Resolve): If we're a constant switch and the constant is
1228         not found, use the default section.
1229
1230 2005-05-03  Martin Baulig  <martin@ximian.com>
1231
1232         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1233
1234         * statement.cs (Foreach.ArrayForeach): New nested class.
1235         (Foreach.TemporaryVariable): New nested class.
1236         (Foreach.EmitArrayForeach): Removed; this is now in the new
1237         ArrayForeach class.
1238
1239 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1240
1241         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1242         more conservative.
1243         (VerifyPendingMethods): Revert change below.
1244
1245         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1246         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1247         that used to trigger warning -28.  Remove warning -28.
1248         * expression.cs (Invocation.OverloadResolve): Use
1249         TypeManager.IsOverride to distinguish override methods.
1250
1251         Fix #74773.
1252         * pending.cs (VerifyPendingMethods): If a base type implements the
1253         requested interface, don't bother checking individual methods of
1254         the base type.  As a side-effect, this prevents the creation of
1255         unnecessary proxies.
1256
1257 2005-05-02  Martin Baulig  <martin@ximian.com>
1258
1259         Fix #70182.
1260
1261         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1262         Also `And' the locals if the old vector is null.
1263         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1264         null; in this case we basically reset all the variables.        
1265
1266 2005-05-02  Martin Baulig  <martin@ximian.com>
1267
1268         Fix #74529.
1269
1270         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1271         Added `FlowBranching branching' argument; always `and' the
1272         variables instead of `or'ing them unless we're an infinite loop.
1273
1274         * statement.cs (While.Resolve): Create a new sibling unless we're
1275         infinite.       
1276
1277 2005-05-02  Martin Baulig  <martin@ximian.com>
1278
1279         Fix #70140.
1280
1281         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1282         arguments; use it instead of creating a new TopLevelBlock.
1283         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1284         our ConstructorInitializer.
1285
1286         * statement.cs
1287         (TopLevelBlock.TopLevelBranching): New public property.
1288         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1289         and create our `TopLevelBranching'.
1290
1291         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1292         anonymous method host, use `block.TopLevelBranching' rather than
1293         creating a new branching.
1294
1295 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1296
1297         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1298         a ScopeInfo, if any of the current children is a child of the new
1299         entry, move those children there.
1300
1301 2005-04-30  Martin Baulig  <martin@ximian.com>
1302
1303         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1304         at the beginning of a SwitchSection.  Fix #73335.
1305
1306 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1307
1308         Fix #74378
1309         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1310         
1311         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1312         (FieldExpr.DoResolve): Obsolete members are ignored for field
1313         initializers.
1314         
1315 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1316
1317         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1318         of arrays detection.
1319
1320         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1321         verification.
1322         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1323
1324         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1325         arrays report.
1326
1327 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1328
1329         * cs-parser.jay: Use the prefered version of -unsafe in error
1330         message.
1331
1332 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1333
1334         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1335         circumstances.
1336
1337 2005-04-20  John Luke  <john.luke@gmail.com>
1338
1339         * driver.cs: fix typo in error message, --outout to --output
1340
1341 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1342
1343         * codegen.cs (InRefOutArgumentResolving): New field.
1344         
1345         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1346         fields outside contructor.
1347         
1348         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1349         
1350 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1351
1352         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1353         parameter code was not completed ever, so it was not as up-to-date
1354         as local variables.  Must finish it.
1355
1356         The bug fix was to compare the Toplevel of the block, not the
1357         current block.  Thanks for Ben for pointing this out. 
1358
1359 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1360
1361         * decl.cs (AddMethods): Use the declaring type of the problem
1362         method to determine if we want to squash a warning.
1363
1364 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1365
1366         * attribute.cs: Removed debug output.
1367
1368         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1369         
1370         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1371         Report.Stderr.
1372         
1373 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1374
1375         Fix #74481.
1376         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1377         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1378         all null comparisons against reference types.
1379
1380 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1381
1382         Fix# 74565
1383         * class.cs (TypeContainer.CircularDepException) New nested
1384         exception class.
1385         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1386         (TypeContainer.DefineType): Removed error, reset InTransit before
1387         exit.
1388         (Class.DefineType): Throw exception when is in Transit.
1389         Catch exception and report error.
1390         (Struct.DefineType): Throw exception when is in Transit.
1391         Catch exception and report error.
1392         (Interface.DefineType): Throw exception when is in Transit.
1393         Catch exception and report error.
1394
1395         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1396         handle nested exception handlers.
1397
1398         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1399         a catch.
1400
1401         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1402         InFinally and InCatch storage.
1403
1404         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1405         (Catch.Resolve): Set and Restore ec.InCatch.
1406         (Try.Resolve): Set and Restore ec.InFinally.
1407         (Try.HasCatch): True when try has catch.
1408
1409 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1410
1411         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1412           for the same event member, so exclude such cases from warning 419.
1413           Fixed bug #74633.
1414
1415 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1416
1417         * expression.cs (Binary.ResolveOperator): Apply patch from John
1418         Luke to fix bug 59864: operators &, | and ^ on enumerations
1419         require that the same enum type on both sides.
1420
1421         * driver.cs: Add warnings to old flag usage, this is to assist
1422         people who produce Makefiles and hope that the Makefiles will be
1423         used on Windows.
1424
1425         * class.cs (TypeContainer.EmitType): Moved the definition of the
1426         special $PRIVATE$ field from the resolve phase to the Emit phase.
1427         During resolve we do not know if we are a struct with
1428         HasExplicitLayout, we know this only after the attributes for the
1429         type are emitted.
1430
1431         Set the FieldOffset to zero on the dummy field that we create for
1432         the class.   Fixes 74590.
1433
1434 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1435
1436         Fix #73834.
1437         * ecore.cs (PropertyExpr.resolved): New.
1438         (DoResolve): Use it to handle a case of double resolution here.
1439         Handle a case of identical-name-and-type-name.
1440         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1441         resolution by storing the results of expression resolution back
1442         into the "probes" array.
1443
1444 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1445
1446         Fix cs0208-7.cs and cs0208-8.cs.
1447         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1448         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1449         error reporting to point out the reason a struct is not unmanaged.
1450
1451 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1452
1453         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1454           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1455
1456 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1457
1458         Fix #74528.
1459         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1460         IdenticalNameAndTypeName here.
1461         (EventExpr.InstanceResolve): Likewise.
1462
1463 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1464
1465         C# 2.0 DefaultCharSetAttribute implementation
1466         
1467         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1468         which allows us to set GlobalNamespace for every resolve.
1469         (Attribute.ResolveArguments): Cut from Resolve.
1470         (Attribute.GetCharSetValue): Returns CharSet named argument.
1471         (Attribute.DefinePInvokeMethod): Gets default charset from
1472         module settings.
1473         (GlobalAttribute.ResolveAsTypeStep): Override.
1474         (GlobalAttribute.ResolveArguments): Override.
1475         
1476         * class.cs (TypeAttr): Is protected.
1477         
1478         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1479         (ModuleClass.DefaultCharSetType): New memeber.
1480         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1481         
1482         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1483         charset from module.
1484         
1485         * delegate.cs (TypeAttr): Override.
1486         (Delegate.DefineType): Use this TypeAttr.
1487         
1488         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1489         at very early stage (before types are defined) to resolve model
1490         module attributes. It will probably not work with corlib but it
1491         should be ok.
1492         
1493         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1494         charset from module.
1495         
1496         * typemanager.cs (default_charset_type): New type.
1497
1498 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1499
1500         * decl.cs (MemberCache.AddMethods): Don't warn if
1501         System.Object.Finalize has buggy MethodAttributes.
1502
1503         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1504         removed below.
1505
1506 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1507
1508         * doc.cs : detect ambiguous reference to overloaded members.
1509           Fixed bug #71603. MS 1.1 csc does not detect it.
1510
1511 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1512
1513         * doc.cs : delegates must not be referenced with parameters.
1514           Fixed bug #71605.
1515
1516 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1517
1518         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1519
1520 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1521
1522         * driver.cs (MainDriver): Stop processing if the CLS stage found
1523         errors. 
1524
1525         (CompilerCallableEntryPoint.InvokeCompiler): Always
1526         reset after execution;   Take a TextWriter argument for the
1527         output.
1528
1529         * report.cs: Use the error stream instead of hardcoding stderr. 
1530
1531 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1532
1533         * class.cs: Reduce code paths to test, too small of an
1534         optimization to make it worth the extra testing.  Always perform
1535         it. 
1536
1537 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1538
1539         Fix #74510.
1540         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1541         operators that had errors reported on them.
1542
1543 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1544
1545         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1546         argument types.
1547         (Attribute.Resolve): Add named argument type checking.
1548         
1549         * class.cs (FixedField.Define): Use IsPrimitiveType
1550         
1551         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1552         
1553         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1554         unsafe parameter types.
1555         
1556         * statement.cs (Using.ResolveExpression): Add better error description.
1557         
1558         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1559         
1560 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1561
1562         Fix #74484.
1563         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1564         AttributeUsageAttribute in the emitcontext of the attribute class,
1565         not in the emitcontext of the attributable entity it was attached to.
1566         * cs-parser.jay: Use 'current_class', not 'current_container',
1567         when creating a GlobalAttribute.
1568
1569 2005-04-08  Alp Toker  <alp@atoker.com>
1570
1571         * pending.cs: The fix to #58413 failed to compile methods implementing
1572         interfaces with/without params modifiers and vice versa, even though
1573         params modifiers aren't part of the signature. Make the modifier check
1574         less strict as in csc.
1575
1576 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1577             Anoob V E  <projectmonokochi@rediffmail.com>
1578             Harilal P R  <projectmonokochi@rediffmail.com>
1579
1580         Fix #58413.
1581         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1582         modifiers of pending methods.
1583         (PendingImplementation.PendingImplementation): Initialize it.
1584         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1585         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1586         with ParameterData.  Add check for modifiers.
1587         * class.cs (MethodData.Define): Update to changes.
1588
1589 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1590
1591         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1592
1593 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1594
1595         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1596         property.
1597         
1598         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1599         
1600         * rootcontext.cs,
1601         * typemanager.cs: Registered RequiredAttributeAttribute.
1602         
1603 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1604
1605         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1606         Warning CS0169 is back at level 3.
1607         (IMethodData.SetMemberIsUsed): New method.
1608         
1609         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1610         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1611         
1612         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1613
1614         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1615         contants.
1616         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1617         is used.
1618         
1619         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1620         is used.
1621         
1622         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1623         to avoid the problems with nested types.
1624
1625 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1626             Anoob V.E  <projectmonokochi@rediffmail.com>
1627             Harilal P.R  <projectmonokochi@rediffmail.com>
1628             Raja R Harinath  <rharinath@novell.com>
1629
1630         Fix #73820.
1631         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1632         attribute.
1633         * typemanager (GetConstructor): Make public.
1634
1635 2005-04-05  John Luke  <john.luke@gmail.com>
1636             Raja R Harinath  <rharinath@novell.com>
1637
1638         Fix #62232.
1639         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1640         struct too.  Return false quicker in a few cases.
1641         (VerifyUnManaged): Use it.
1642
1643 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1644
1645         Fix #74041.
1646         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1647         not 'unreachable_seen'.
1648
1649 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1650
1651         * attribute.cs (Attribute.GetValue): Removed unused.
1652         
1653         * codegen.cs (CodeGen.TrimExt): Removed unused.
1654         
1655         * cs-parser.jay (output): Removed unused.
1656         
1657         * cs-tokenizer.cs (hex_digits): Removed unused.
1658         
1659         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1660         
1661         * expression.cs (Indirection.LoadExprValue): Removed unused.
1662         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1663         
1664         * iterators.cs (Iterator.param_types): Removed unused.
1665         
1666         * statement.cs (Goto.block): Removed unused.
1667         (ToplevelBlock.did): Removed unused.
1668         (Switch.ResolveConstantSwitch): Removed unused.
1669
1670 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1671
1672         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1673         resetting thingy.
1674
1675 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1676
1677         Fix #74232 and cs0208-3.cs.
1678         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1679         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1680         unmanaged type.  Don't use FieldBuilders when 't' is a
1681         TypeBuilder.  Use ModFlags and MemberType fields.
1682         * class.cs (MemberBase.member_type): Rename from MemberType.
1683         (MemberBase.MemberType): New property.  Determines member_type on
1684         demand.
1685         (MemberBase.DoDefine): Don't initialize MemberType here.
1686         (FieldMember.Define): Likewise.
1687
1688 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1689
1690         Fix #74241
1691         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1692         Attributes are emitted there.
1693         
1694 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1695
1696         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1697         keyword in 'partial enum' too.
1698         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1699         is not allowed).
1700         Report from Kamil Skalski <nazgul@omega.pl>.
1701
1702         Fix #74309.
1703         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1704         have partial containers too.
1705
1706         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1707         in block' checks to Block.CheckInvariantMeaningInBlock.
1708         * statement.cs (Block.GetKnownVariableInfo): Make private.
1709         (Block.IsVariableUsedInChildBlock): Remove.
1710         (Block.IsVariableUsedInBlock): Likewise.
1711         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1712         conflicting declaration.
1713         (Block.AddVariable): Make error messages less long-winded and more
1714         specific.  Show location of conflicting declaration.
1715         * parameter.cs (Parameters.Location): New readonly property.
1716
1717 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1718
1719         Clean up semantics of invoking ResolveMemberAccess.
1720         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1721         can have an instance, ensure that we pass in a non-TypeExpression
1722         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1723         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1724         argument.  Update to changes and simplify.
1725         (FieldExpr.Emitinstance): Remove CS0120 check.
1726         (PropertyExpr.EmitInstance): Likewise.
1727         * expression.cs (Argument.Resolve): Likewise.
1728         (Invocation.DoResolve): Update to changes in semantics of
1729         InstanceExpression.
1730
1731 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1732
1733         Fix #74241
1734         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1735         customization.
1736         
1737         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1738
1739 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1740
1741         Fix difference in behaviour with commandline invocation.
1742         * driver.cs (Driver.Reset): New.
1743         (CompilerCallableEntryPoint): Call it.
1744
1745         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1746         variable" warnings if the boolean expression failed to resolve.
1747
1748 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1749
1750         * attribute.cs: Fix the union of several permissions when some of them
1751         are unrestricted (so the result isn't an unrestricted permission set).
1752         Fix #74036.
1753
1754 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1755
1756         * ecore.cs (MemberExpr): New class.  Convert from interface
1757         IMemberExpr.
1758         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1759         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1760         error checks.
1761         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1762         (MethodGroupExpr.IsExplicitImpl): Remove.
1763         (Expression.GetFieldFromEvent): Remove.
1764         (SimpleName.MemberStaticCheck): Remove.
1765         (SimpleName.DoSimpleNameResolve): Update to changes.
1766         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1767         (MemberAccess.IdenticalNameAndTypeName): Remove.
1768         (MemberAccess.error176): Move to MemberExpr.
1769         (MemberAccess.DoResolve): Update to changes.
1770         (BaseAccess.DoResolve): Likewise.
1771
1772 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1773
1774         C# 2.0 Conditional attribute class implementation
1775         
1776         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1777         Analyzes class whether it has attribute which has ConditionalAttribute
1778         and its condition is not defined.
1779         
1780         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1781         (Class.IsExcluded): New method. Search for at least one defined
1782         condition in ConditionalAttribute of attribute class.
1783
1784 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1785
1786         * ecore.cs (PropertyExpr): Derive from Expression, not
1787         ExpressionStatement.
1788         (PropertyExpr.EmitStatement): Remove.
1789
1790 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1791
1792         Fix #74060.
1793         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1794         internal field "value__" of an enum be private.  The examples for
1795         "value__" that I found on MSDN all used FieldAttributes.Private.
1796
1797         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1798         Don't mention IL method attribute names.
1799
1800         Fix #47991.  Remove a TODO.
1801         * statement.cs (Block.Toplevel): Make into a field.
1802         (Block.Parameters): Move into ToplevelBlock.
1803         (Block.known_variables): Rename from child_variable_names.
1804         (Block.Block): Remove variants that take Parameters.  Initialize
1805         'Toplevel' with the immediately surrounding toplevel block.
1806         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1807         LocalInfo parameter.
1808         (Block.GetKnownVariableInfo): New.
1809         (Block.IsVariableNameUsedInChildBlock): Update.
1810         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1811         the block, even though it may not be in scope.
1812         (Block.AddVariable): Remove Parameters parameter.  Use
1813         Toplevel.Parameters instead.
1814         (Block.AddConstant): Remove Parameters parameter.
1815         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1816         (Block.IsParamaterReference): Likewise.
1817         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1818         (ToplevelBlock.Parameters): New.  Moved from Block.
1819         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1820         initialize Parameters to a non-null value.
1821         * cs-parser.jay: Update to changes.
1822         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1823         simple names that mean different things in the same block.  Use
1824         Block.IsVariableNameUsedInBlock.
1825
1826 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1827
1828         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1829         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1830         GetTypeHandle.  It is possible for a reflected type to derive from
1831         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1832         System.Array during mscorlib compilation).
1833         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1834         contain a method_hash, don't create one either.  Don't create a
1835         deep copy of the base cache's method_hash.
1836         (MemberCache.SetupCache): Rename back from DeepCopy.
1837         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1838         already initialized.  If we see an override function, add its
1839         underlying base virtual function to the member_hash too.
1840
1841         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1842
1843 2005-03-26  Raja R Harinath  <harinath@acm.org>
1844
1845         Fix #73038.
1846         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1847         fails to resolve, ensure that the LHS is still resolved as an
1848         lvalue.
1849
1850 2005-03-25  Raja R Harinath  <harinath@acm.org>
1851
1852         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1853         ec.ContainerType.
1854         (Enum.current_ec): Remove.
1855         (Enum.LookupEnumValue): Remove EmitContext argument.
1856         Just uses the one created during DefineType.
1857         (Enum.FindMembers): Update.
1858         * expression.cs (MemberAccess.DoResolve): Update.
1859
1860 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1861
1862         * assign.cs (Assign.DoResolve): Check for CS1717 when
1863         source and target are same (uses Equals).
1864
1865         * expression.cs (LocalVariableReference, ParameterReference,
1866         This): Implemented Equals, GetHashCode.
1867
1868         * statement.cs (Block.GetParameterReference): Removed useless
1869         local variable.
1870
1871 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1872
1873         Fix cs0128.cs
1874         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1875         blocks before deciding whether the error is cs0136 or cs0128.
1876
1877         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1878         (using_alias_directive, using_namespace_directive): Pass
1879         MemberName, not an expression to Namespace.UsingAlias and
1880         Namespace.Using.
1881         (MakeName): Use the MemberName of the namespace.
1882         * namespace.cs (Namespace.MemberName): New.
1883         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1884         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1885         Likewise.
1886         * decl.cs (MemberName.Name): Make readonly.
1887         (MemberName.FromDotted): New "constructor".
1888         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1889         (MemberCore.Name): Compute from MemberName on demand.
1890         (MemberCore.SetMemberName): Provide a way to change the
1891         MemberName.
1892         (MemberCore.AddToContainer): Don't take a fullname parameter.
1893         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1894         fully qualified name of the container to the member name.
1895         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1896         only if the type is a member of the root container.
1897         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1898         MemberName.Left rather than searching for an embedded ".".
1899         (PartialContainer.CreatePart): Update to changes in RootContext.
1900         (MemberBase.ShortName): Turn into a property.  Use
1901         MemberCore.SetMemberName.
1902         (MemberBase.ExplicitInterfaceName): Remove.
1903         (MemberBase.UpdateMemberName): Remove.
1904         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1905         (PropertyBase.SetMemberName): New override.
1906         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1907         (Tree.GetDecl): New.
1908         (Tree.AllDecls): Rename from Decls.
1909         * attribute.cs, enum.cs, report.cs: Update to changes.
1910         * driver.cs (MainDriver): Use MemberName.FromDotted on
1911         RootContext.MainClass.
1912
1913 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1914
1915         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1916         checks.
1917
1918         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1919
1920 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1921
1922         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1923         property accessor modifiers.
1924
1925         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1926         fixed buffer attribute (CS1716).
1927         (PropertyMethod.HasCustomAccessModifier): When property accessor
1928         has custom modifier.
1929
1930         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1931         modifiers.
1932         (PropertyExpr.DoResolveLValue): Add CS0272.
1933
1934 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1935
1936         * convert.cs: When converting to a pointer, use the proper Conv.U
1937         or Conv.I depending on the source data type.
1938
1939         * cs-tokenizer.cs: Make the size for large decimal constants,
1940         fixes #72957.
1941
1942 2005-03-17  Martin Baulig  <martin@ximian.com>
1943
1944         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1945         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1946
1947 2005-03-17  Martin Baulig  <martin@ximian.com>
1948
1949         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1950         to bool so we can return an error condition.
1951         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1952         returned an error.
1953
1954 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1955
1956         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1957         attributes.
1958
1959 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1960
1961         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1962         Refactor to avoid traversing the list of assemblies, and to avoid
1963         string concatenation.
1964         * typemanager.cs (guid_attr_type): Remove.
1965         (negative_hits, pointers, references): Remove hashes.
1966         (type_hash): New.
1967         (GetConstructedType): New.  Uses type_hash to handle constructed
1968         types (arrays, references, pointers).
1969         (GetReferenceType, GetPointerType): Use it.
1970         (GetNestedType): New.  Uses type_hash to handle nested types of
1971         reflected types.
1972         (LookupType, LookupTypeDirect): Remove.
1973         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1974         'types' hash and LookupTypeReflection directly.
1975         (params_string, params_object): Use GetConstructedType.
1976         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1977         top-level types.
1978         (Namespace.Lookup): Use cached_types.
1979         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1980         provided by old TypeManager.LookupType.
1981         * rootcontext.cs (MakeFQN): Remove.
1982         * decl.cs (DeclSpace.MakeFQN): Likewise.
1983         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1984         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1985         TypeManager.GetConstructedType.
1986         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1987
1988 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1989
1990         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1991         indexers.
1992
1993         * cs-parser.jay: Reports CS1527 for any namespace element.
1994
1995         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1996         Added CS0407.
1997
1998         * expression.cs (ParameterReference.IsAssigned): Changed error to
1999         CS0269.
2000         (Error_WrongNumArguments): Moved CS0245 detection here.
2001
2002         * statement.cs (Return.Resolve): Add CS1622 report.
2003
2004 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2005
2006         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2007
2008 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2009
2010         * attribute.cs expression.cs: Get rid of some allocations.
2011
2012 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2013
2014         * doc.cs : just eliminate the latest change.
2015
2016 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2017
2018         * doc.cs : commented out the latest change. It breaks xml-030.cs
2019
2020 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2021
2022         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2023           fail. So invoke CreateType() in FindDocumentedType().
2024
2025 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2026
2027         * cs-tokenizer.cs : added IsKeyword().
2028         * doc.cs : Detect keyword incorrectly used as identifier.
2029           Allow identifiers prefixed by @.
2030
2031 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2032
2033         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2034         It caused exception in namespace resolving (again!).
2035         
2036         * class.cs (Class.ctor): Removed exit.
2037         (PropertyMethod.ctor): ditto.
2038         
2039         * codegen.cs (Codegen.Reset): Reset static data.
2040         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2041         
2042         * cs-tokenizer.cs (Cleanup): Removed.
2043         
2044         * driver.cs (GetSystemDir): Rewrote to one line command.
2045         It caused problem with unloaded dynamic modules.
2046         (UnixParseOption): Removed Exit.
2047         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2048         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2049         Now can be mcs used as library.
2050         
2051         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2052         empty location.
2053         
2054         * location.cs (Reset): Reset static data.
2055         
2056         * namespace.cs (Reset): Reset static data.
2057         
2058         * report.cs (Report.Reset): Reset static data.
2059         
2060         * rootcontext.cs (RootContext.Reset): Reset static data.
2061         
2062         * tree.cs (RootTypes.ctor): Use Location.Null
2063         
2064         * typemanager.cs (TypeManager.Reset): Reset static data.
2065         (CoreLookupType): Removed Exit.
2066         (TypeHandle.Reset): Reset static data.
2067         
2068 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2069
2070         Fix #73516.
2071         * typemanager.cs (ComputeNamespaces): Import namespaces from
2072         referenced modules too.
2073
2074 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2075
2076         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2077         than '.'.
2078
2079 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2080
2081         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2082         enclosing DeclSpace.  This ensures that a name-lookup populates
2083         more caches and there are fewer 'TypeExpression's.  Carve out
2084         nested type lookup into ...
2085         (LookupNestedTypeInHierarchy): ... this.
2086
2087 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2088
2089         Clean up a few partial-class semantics.  
2090         Fixes test-357.cs and cs1618-2.cs.
2091         * cs-parser.jay (struct_declaration): Use 'current_class' as
2092         parent of newly-created struct.  Remove call to Register ().
2093         Use 'pop_current_class' to complete handing the current struct.
2094         (interface_declaration): Likewise.
2095         (class_declaration): Likewise.
2096         (enum_declaration): Use 'current_class' as parent of newly created
2097         enum.
2098         (delegate_declaration): Likewise.
2099         (pop_current_class): New function.  This is used to handle closing
2100         up the 'current_class' and 'current_container', and pointing them
2101         to the enclosing class/container.
2102         (CSharpParser): Initialize 'current_class' too.
2103         * decl.cs (MemberCore): Add check for invariant: a partial
2104         container is not a parsed entity, and thus does not enclose any
2105         parsed members.
2106         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2107         (DeclSpace.BaseTypeExpr): Use it.
2108         (DeclSpace.LookupType): Add check for invariant.
2109         * class.cs (TypeContainer): Add check for invariant: a nested
2110         class should have the same NamespaceEntry as its enclosing class.
2111         (TypeContainer.EmitFieldInitializers): Make virtual.
2112         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2113         MemberCore.
2114         (TypeContainer.Register): Remove.
2115         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2116         null.  Use TypeResolveEmitContext for resolving base types and
2117         interfaces.  Move initialization of Parts.TypeBuilder here from
2118         ...
2119         (TypeContainer.DefineNestedTypes): ... here.
2120         (PartialContainer): Take a Namespace not a NamespaceEntry.
2121         (PartialContainer.Create): Don't use Register.  Call the
2122         appropriate Add... function directly.
2123         (ClassPart): Take both the PartialContainer and the enclosing
2124         class as constructor arguments.
2125         (ClassPart.EmitFieldInitializers): Override.
2126         (ClassPart.PartFindNestedTypes): Remove.
2127         (FieldBase.GetInitializerExpression): Resolve the initializer
2128         expression in the emit context of the enclosing class.
2129         * tree.cs (RootTypes): Remove Register ().
2130         
2131 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2132
2133         * cs-parser.jay: Removed CS0134.
2134         
2135         * driver.cs: Removed CS1901.
2136         
2137         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2138         for predefined types.
2139
2140 2005-03-07  Duncan Mak  <duncan@novell.com>
2141
2142         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2143         well. Fixes bug #73454.
2144
2145 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2146
2147         * cs-tokenizer.cs (xtoken): Add CS1035.
2148         
2149         * class.cs (MethodData.Define): Add CS0683.
2150         (FieldMember.ctor): Add CS0681.
2151
2152 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2153
2154         * ecore.cs (SimpleName.DoResolve): Rename from
2155         SimpleName.DoResolveAllowStatic.
2156         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2157         Pass 'intermediate' flag to MemberStaticCheck.
2158         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2159         of "intermediate" lookups via MemberAccess.
2160         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2161         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2162
2163 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2164
2165         Fix #73394.
2166         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2167         slipped in because of variable names that are identical to a
2168         builtin type's BCL equivalent ('string String;', 'int Int32;').
2169         (PropertyExpr.EmitInstance): Likewise.
2170
2171 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2172
2173         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2174         
2175         * report.cs (warning_ignore_table): Made public.
2176
2177 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2178
2179         Fix #73282.
2180         * class.cs (MethodData.Emit): Pass 'container' to
2181         container.GetObsoleteAttribute instead of 'container.Parent'.
2182
2183 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2184
2185         * cs-parser.jay: Add 1534 error test.
2186
2187         * iterators.cs (Yield.CheckContext): Add error 1629.
2188         (Iterator.ctor): Save unsafe modifier.
2189         (MoveNextMethod.DoEmit): Restore unsafe context.
2190
2191         * namespace.cs (UsingAlias): Better error message.
2192
2193 2005-03-03  Dan Winship  <danw@novell.com>
2194
2195         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2196         the warning message [#73219]
2197
2198 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2199
2200         Fix compile with MCS 1.0.0.0.
2201         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2202         w_restore to not depend on string constant folding.
2203
2204 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2205
2206         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2207         CS0246 check to users who passed 'silent = false'.
2208         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2209         check.
2210         (SimpleName.SimpleNameResolve): Update.
2211         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2212         (MemberAccess.IdenticalNameAndTypeName): Update.
2213         * doc.cs (FindDocumentedTypeNonArray): Update.
2214
2215 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2216
2217         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2218         * parameters.cs (ComputeAndDefineParameters): Remove.
2219         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2220         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2221         Use GetParameterInfo.
2222
2223 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2224
2225         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2226
2227 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2228
2229         Unify DeclSpace.LookupType and DeclSpace.FindType.
2230         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2231         is in charge of defining nested types on demand.
2232         (DeclSpace.LookupType): Use it when the current_type is a
2233         TypeBuilder.  Use LookupTypeDirect for reflected types.
2234         (DeclSpace.FindType): Remove.
2235         (DeclSpace.LookupInterfaceOrClass): Likewise.
2236         (DeclSpace.DefineTypeAndParents): Likewise.
2237         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2238         DeclSpace.LookupType.
2239         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2240         * typemanager.cs (LookupType): Simplify.
2241         (AddUserType): Remove type from negative_hits.
2242         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2243         * class.cs (TypeContainer.FindMembers): Move handling of nested
2244         types ...
2245         (TypeContainer.FindMembers_NestedTypes): ... here.
2246         (TypeContainer.FindNestedType): Implement override.
2247         (ClassPart.FindNestedType): Delegate to PartialContainer.
2248         (ClassPart.PartFindNestedType): Looks up the nested types of the
2249         part alone.
2250
2251 2005-03-02  Martin Baulig  <martin@ximian.com>
2252
2253         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2254         static constructor in static classes.
2255
2256 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2257
2258         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2259         sizeParamIndex is not specified.
2260
2261 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2262
2263         Fix #73117
2264         * report.cs (WarningMessage.IsEnabled): Missing null check.
2265
2266 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2267
2268         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2269         in the fields and not in the properties.
2270
2271 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2272
2273         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2274         fields as well.
2275
2276 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2277
2278         * attribute.cs: Small refactoring (improved robustness).
2279         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2280         (ValidateGuid): Removed.
2281         (Resolve): Removed referenced to above mentioned.
2282         (GetAttributeUsage): Made private and changed to work without
2283         class assistance.
2284         (GetIndexerAttributeValue): Don't crash.
2285         (GetConditionalAttributeValue): Ditto.
2286         (GetClsCompliantAttributeValue): Ditto.
2287         (ExtractSecurityPermissionSet): All attributes exceptions are
2288         error 648.
2289         (GetPropertyValue): New helper.
2290         (GetMethodImplOptions): New method.
2291         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2292         some missing properties.
2293         
2294         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2295         (Method.ApplyAttributeBuilder): Updated.
2296         
2297         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2298         exception.
2299
2300 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2301
2302         Fix #73052.
2303         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2304         non-simple types (array, pointer, reference).
2305
2306 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2307
2308         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2309
2310         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2311         for operators.
2312         (Method.CheckBase): Catch wrong destructor here.
2313         (MethodData.Define): Add errors 550, 668.
2314
2315         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2316
2317         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2318
2319         * pending.cs (VerifyPendingMethods): Add error 551.
2320
2321         * typemanager.cs (CSharpName): Next error report helper.
2322
2323 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2324
2325         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2326         attributes. Removed useless attribute double check.
2327         It saves almost 2MBs for corlib.
2328
2329 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2330
2331         Fix #72924.
2332         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2333         called twice in case of error.
2334
2335 2005-02-23  Chris Toshok  <toshok@ximian.com>
2336
2337         Fix compiler portions of #72827.
2338         * statement.cs (Block.Emit): call Begin/EndScope on the
2339         EmitContext instead of the ILGenerator.
2340
2341         * codegen.cs (EmitContext.BeginScope): new method, call
2342         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2343         we have one.)
2344         (EmitContext.BeginScope): same, but EndScope and CloseScope
2345
2346         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2347         offset and call the superclass's OpenScope(int) with it.
2348         (SymbolWriter.CloseScope): get the current il
2349         offset and call superclass's CloseScope(int) with it.
2350
2351 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2352
2353         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2354         CS1677 for out and ref as well.
2355
2356         * class.cs (Method.Define): Add error CS1599 detection.
2357         
2358         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2359         
2360         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2361         
2362         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2363         
2364         * support.cs.cs (ModifierDesc): New helper method.
2365
2366 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2367             Abin Thomas  <projectmonokochi@rediffmail.com>
2368             Anoob V E  <projectmonokochi@rediffmail.com>
2369             Harilal P R  <projectmonokochi@rediffmail.com>
2370
2371         Fix #57851, #72718.
2372         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2373         MemberLookup (used for error reporting) actually returns a result.
2374         Fix error report number (122, not 112).
2375
2376 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2377             Anoob V E  <projectmonokochi@rediffmail.com>
2378             Harilal P R  <projectmonokochi@rediffmail.com>
2379
2380         Fix #71134.
2381         * pending.cs (PendingImplementation.GetAbstractMethods):
2382         Find NonPublic members too.
2383
2384 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2385
2386         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2387         Fixed error 217.
2388         
2389         * class.cs (MethodCore.CheckMethodAgainstBase):
2390         Add error 239 report.
2391
2392 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2393
2394         Fix #68955.
2395         * expression.cs (Invocation.IsApplicable): Make public.
2396         (Invocation.IsParamsMethodApplicable): Likewise.
2397         * delegate.cs (Delegate.VerifyApplicability): Don't use
2398         Invocation.VerifyArgumentCompat for parameter applicability
2399         testing.  Use Invocation.IsApplicable and
2400         Invocation.IsParamsMethodApplicable.
2401
2402 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2403
2404         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2405         
2406         * class.cs (Operator.Define): Add error 217 report.
2407         
2408 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2409
2410         * namespace.cs (UsingEntry.Resolve): Undo change below.
2411
2412 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2413
2414         Fix #72756.
2415         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2416         disable the error message when the extended MemberLookup also
2417         fails.
2418         (Expression.MemberLookupFinal): Update.
2419         (SimpleName.DoSimpleNameResolve): Update.
2420         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2421         Don't use MemberLookupFinal.
2422         (New.DoResolve): Update.
2423         (BaseAccess.CommonResolve): Update.
2424
2425 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2426
2427         Fix #72732.
2428         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2429         occured previously, don't resolve again.
2430
2431 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2432
2433         Fix #69949
2434         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2435         argument. Call ResolveAttributeUsage for unresolved.
2436         when types doesn't match ctor arguments.
2437         
2438         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2439         for nested attribute classes.
2440         (Class.attribute_usage): Removed.
2441         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2442         for attribute class.
2443         
2444         * ecore.cs (IsAttribute): Removed.
2445         
2446         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2447         
2448         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2449         now normal types.
2450         (attribute_types): Removed.
2451         (EmitCode): Global attributes are emited as the latest.
2452
2453 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2454
2455         * class.cs (EmitFieldInitializers): Don't emit field initializer
2456         for default values when optimilization is on.
2457         
2458         * constant.cs (Constant.IsDefaultValue): New property.
2459         
2460         * driver.cs: Add /optimize handling.
2461         
2462         * constant.cs,
2463         * ecore.cs,
2464         * literal.cs: Implement new IsDefaultValue property.
2465         
2466         * rootcontext.cs (Optimize): New field, holds /optimize option.
2467
2468 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2469
2470         Fix crasher in re-opened #72347.
2471         * namespace.cs (Namespace.Lookup): Return null if
2472         DeclSpace.DefineType returns null.
2473
2474         Fix #72678.
2475         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2476
2477 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2478
2479         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2480         now returns null if it cannot resolve to an lvalue.
2481         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2482         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2483         returned null.  Remove check for SimpleName.
2484         (EventExpr.DoResolveLValue): New.
2485         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2486         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2487         error from ...
2488         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2489         avoid CS0131 error.
2490         (Unary.ResolveOperator): Move CS0211 check ...
2491         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2492         CS0131 error.
2493         (Unary.DoResolveLValue): Simplify.
2494         (AddressOf.DoResolveLValue): New.
2495         (ArrayAccess.DoResolveLValue): New.
2496
2497 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2498
2499         * attribute.cs (Attribute.Resolve): Add arguments casting for
2500         when types doesn't match ctor arguments.
2501
2502 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2503
2504         Fix parts of #63202.
2505         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2506         lookup of operator in base type.  Ensure that all checks happen
2507         when the operator resolves to an "op_..." method.
2508
2509 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2510
2511         Fix #71992.
2512         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2513         'ignore_cs0104' parameter.  Pass it to ...
2514         (NamespaceEntry.Lookup): ... this.
2515         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2516         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2517         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2518         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2519         Update.  Request that cs0104 errors be ignored.
2520         (ComposedCast.ResolveAsTypeStep): Update.
2521
2522 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2523
2524         Fix #59209.
2525         * expression.cs (Invocation.BetterFunction): Remove support for
2526         comparing virtual functions and their overrides.
2527         (Invocation.IsOverride): New.
2528         (Invocation.OverloadResolve): Don't consider 'override' functions
2529         during candidate selection.  Store them in a lookaside list.
2530         If the selected method is a 'virtual' function, use the list to
2531         find any overrides that are closer to the LHS type.
2532
2533 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2534
2535         * expression.cs (New.DoResolve): Add complex core type reduction.
2536         (New.Constantify): Converts complex core type syntax like 'new int ()'
2537         to simple constant.
2538         
2539 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2540
2541         * decl.cs (EntryType.EntryType): New constructor to create an
2542         updated copy of a cache entry.
2543         (MemberCache.AddMethods): Use it.
2544         (MemberCache.ClearDeclaredOnly): Remove.
2545         (MemberCache.MemberCache): Update.
2546
2547 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2548
2549         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2550         variable.  This one is represents the actual low-level declaration
2551         of the method, as opposed to the semantic level `IsStatic'.   
2552
2553         An anonymous method which is hosted into a static method might be
2554         actually an instance method.  IsStatic would reflect the
2555         container, while MethodIsStatic represents the actual code
2556         generated.
2557
2558         * expression.cs (ParameterReference): Use the new MethodIsStatic
2559         instead of IsStatic.
2560
2561         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2562         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2563         set on the current EmitContext. 
2564
2565         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2566         resolve our casted expression as an LValue.  This triggers the
2567         proper LValue processing that is later required by Assign.
2568
2569         This fixes 72347.
2570
2571         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2572
2573 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2574
2575         C# 2.0 Fixed buffer implementation
2576
2577         * anonymous.cs: Update after RegisterHelperClass renaming.
2578
2579         * attribute.cs (AttributeTester.fixed_buffer_cache):
2580         Cache of external fixed buffers.
2581         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2582         implementation if field is fixed buffer else null.
2583
2584         * class.cs
2585         (TypeContainer.AddField): Accept FieldMember instead of Field.
2586         (FieldBase.IsFieldClsCompliant): Extracted code from
2587         VerifyClsCompliance descendant customization.
2588         (FixedField): New class handles fixed buffer fields.
2589         (FixedFieldExternal): Keeps information about imported fixed
2590         buffer.
2591         (IFixedField): Make access to internal or external fixed buffer
2592         same.
2593
2594         * cs-parser.jay: Add fixed buffer parsing.
2595
2596         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2597         buffer.
2598
2599         * expression.cs (Indirection): Extended implementation to accept
2600         fixed buffer field.
2601         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2602         (ElementAccess.MakePointerAccess): Get type as parameter.
2603         (DoResolve): Add fixed buffer field expression conversion.
2604         (DoResolveLValue): Ditto.
2605         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2606         (ArrayPtr): Derives from FixedBufferPtr.
2607         (ArrayPtr.Emit): Add extra emit for array elements.
2608
2609         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2610
2611         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2612         for compiler generated types.
2613         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2614
2615         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2616         and consume less memory.
2617         (Fixed.Resolve): Add fixed buffer case.
2618
2619         * typemanager.cs (compiler_generated_attr_ctor,
2620         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2621         (HasElementType): Add our own implementation to work on every
2622         runtime.
2623
2624 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2625
2626         * anonymous.cs (CaptureContext): Track whether `this' has been
2627         referenced.   
2628
2629         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2630         only captured `this' if it was implicitly done (instance
2631         methods/variables were used). 
2632
2633         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2634         `this' must be captured.
2635
2636 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2637  
2638         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2639         is null it means that there has been no need to capture anything,
2640         so we just create a sibling.
2641
2642         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2643
2644         Just a partial fix.  The other half is fairly elusive.
2645         
2646 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2647
2648         Fix #52586, cs0121-4.cs.
2649         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2650         and return a hashtable.
2651         (MemberCache.ClearDeclaredOnly): New.
2652         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2653         the method_hash of a base type too.
2654         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2655         type methods.  Overwrite entries with the same MethodHandle so
2656         that the ReflectedType is correct.  The process leaves in base
2657         virtual functions and their overrides as distinct entries.
2658         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2659         matters since it was boxed in a ArrayList before.
2660         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2661         modifier.
2662         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2663         case of a virtual function and its override (choose the overload
2664         as better).
2665         (Invocation.OverloadResolve): Avoid 'override' members during
2666         'applicable_type' calculation.
2667
2668 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2669
2670         Combine two near-redundant caches.
2671         * typemanager.cs (method_params): Rename from method_internal_params.
2672         (TypeManager.GetParameterData): New.  Replace
2673         Invocation.GetParameterData.
2674         (TypeManager.LookupParametersByBuilder): Remove.
2675         * expression.cs (Invocation.method_parameter_cache): Remove.
2676         (Invocation.GetParameterData): Remove.
2677         Update to changes.
2678         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2679         Update to changes.
2680
2681 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2682
2683         Fix #72015.
2684         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2685         TypeManager.multicast_delegate_type is null, resolve it by looking
2686         up "System.MulticastDelegate".
2687         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2688
2689 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2690             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2691             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2692
2693         Fix cs0164.cs.
2694         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2695         (LabeledStatement.AddReference): New.  Set 'referenced'.
2696         (Goto.Resolve): Use it.
2697
2698 2005-02-05  John Luke  <john.luke@gmail.com>
2699
2700         * driver.cs: remove duplicate -doc line in Usage ()
2701
2702 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2703
2704         * location.cs (Location.AddFile): Fix CS2002 error report.
2705
2706 2005-02-02  Martin Baulig  <martin@ximian.com>
2707
2708         * delegate.cs (Delegate.DefineType): Report an internal error if
2709         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2710         details.        
2711
2712 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2713
2714         Fix a crasher in a variant of #31984.
2715         * const.cs (Constant.CheckBase): New override that defers the
2716         new-or-override check in case the base type hasn't been populated
2717         yet.
2718         (Constant.Define): Ensure the new-or-override check is performed.
2719
2720 2005-02-01  Duncan Mak  <duncan@ximian.com>
2721
2722         * const.cs (LookupConstantValue): Check that `ce' is not null
2723         before calling GetValue ().
2724
2725 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2726
2727         Fix test-334.cs (#69519).
2728         * cs-parser.jay (using_alias_directive): Pass in an expression to
2729         NamespaceEntry.UsingAlias.
2730         (using_namespace_directive): Pass in an expression to
2731         NamespaceEntry.Using.
2732         (namespace_name): Don't flatten to a string.
2733         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2734         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2735         ResolveAsTypeStep.
2736         (NamespaceEntry.UsingEntry): Likewise.
2737         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2738         changes.
2739         (NamespaceEntry.LookupForUsing): Remove.
2740         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2741         names.
2742         (NamespaceEntry.Lookup): Remove support for dotted names.
2743
2744 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2745
2746         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2747         split into two.
2748         (NamespaceEntry.ImplicitParent): Compute on demand.
2749         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2750         parallels the current.
2751         (NamespaceEntry.LookupForUsing): Use it.
2752         (NamespaceEntry.Lookup): If the current namespace-entry is
2753         implicit, don't search aliases and using tables.
2754
2755 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2756
2757         Fix #31984.
2758         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2759         BaseCache here.
2760         (TypeContainer.BaseCache): Compute on demand.
2761         (TypeContainer.FindMembers): Define constants and types if they're
2762         not already created.
2763         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2764         check.
2765         * const.cs (Constant.Define): Make idempotent.
2766
2767 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2768
2769         * pending.cs: Produce better code (no nops produced by using Ldarg
2770         + value).
2771         
2772         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2773         i - 1' it should be arg + 1.
2774
2775         Fixes bug #71819.
2776
2777 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2778
2779         * attribute.cs (Attribute.CheckAttributeType): Make private
2780         non-virtual.
2781         (Attribute.ResolveType): Make virtual.
2782         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2783         handling of RootContext.Tree.Types.
2784
2785 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2786
2787         Update attribute-handling to use the SimpleName/MemberAccess
2788         mechanisms.
2789         * cs-parser.jay (attribute): Pass in an expression to the
2790         constructors of Attribute and GlobalAttribute.
2791         * attribute.cs (Attribute): Take an expression for the name.
2792         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2793         passed in attribute name expression.
2794         (Attribute.CheckAttributeType): Use it.
2795         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2796         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2797         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2798         argument to prevent error messages if the lookup fails.
2799
2800 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2801
2802         * expression.cs (Indirection): Implemented IVariable interface
2803         to support indirection in AddressOf operator.
2804         (PointerArithmetic.Emit): Add optimalization for case where
2805         result can be precomputed.
2806
2807 2005-01-26  Martin Baulig  <martin@ximian.com>
2808
2809         * class.cs (TypeContainer.AttributeTargets): Return the correct
2810         AttributeTargets depending on our `Kind' instead of throwing an
2811         exception; fixes #71632.
2812
2813 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2814
2815         Fix #71257
2816         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2817         constant members.
2818
2819 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2820
2821         Fix #71602.
2822         * expression.cs (MemberAccess.DoResolve): Don't complain with
2823         cs0572 when the LHS of a member access has identical name and type
2824         name.
2825
2826 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2827
2828         Fix #71651, #71675
2829         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2830         CreatePermission.
2831         Create custom PermissionSet only for PermissionSetAttribute.
2832
2833 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2834
2835         Fix #71649
2836         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2837         delegates in static class.
2838
2839 2005-01-24  Martin Baulig  <martin@ximian.com>
2840
2841         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2842         merging an implicit block, just use its reachability.
2843
2844         * statement.cs (Block.Resolve): Make the unreachable code check
2845         work wrt. implicit blocks; see test-337 from #63842.
2846
2847 2005-01-21  Alp Toker  <alp@atoker.com>
2848  
2849         * cs-parser.jay: destructor_declaration's container is PartialContainer
2850         not Class when partial types are used, so use Kind prop instead of
2851         'is'.
2852         
2853 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2854
2855         * cs-parser.jay: Improve error reporting when an interface
2856         declares new types.
2857
2858 2005-01-20  Dick Porter  <dick@ximian.com>
2859
2860         * support.cs: SeekableStreamReader fix from Sandor Dobos
2861         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2862         chars are read.  Fixes bug 70369.
2863
2864 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2865
2866         * cs-parser.jay (catch_clause): Simplify current_block handling
2867         somewhat.
2868
2869 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2870
2871         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2872         code with ImplicitStandardConversion to handle the implicit
2873         conversion of method groups into valid delegate invocations. 
2874
2875         The problem is that in parameter handling we were using this code
2876         path.  Fixes bug #64698
2877
2878 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2879
2880         * cs-parser.jay: Fix several infelicities.
2881         - Avoid assigning to the parser value stack.  Code like 
2882           '$3 = null' is unclean.  Synthesize a value for the code block
2883           instead. 
2884         - Avoid using oob_stack for storing location information.  Use ...
2885         (_mark_): ... this.  New (empty) rule.  Saves the current location
2886         in $$.
2887         (foreach_statement): Avoid using oob_stack for current_block
2888         handling.  Use technique used in for_statement and
2889         using_statement.  Synthesize a value for the code block to store
2890         additional intermediate information.
2891
2892 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2893
2894         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2895         of a different type is only allowed to private fields of a
2896         containing type, not on fields of a base class.
2897
2898         See test-174.cs and error cs0122-9.cs
2899
2900 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2901
2902         Fix test-335.cs (bug #58126).
2903         * cs-parser.jay (argument): Split out non-expression parts of the
2904         rule into 'non_simple_argument'.
2905         (invocation_expression): Support parenthesized invocations with
2906         multiple arguments, and with single non-simple arguments.
2907
2908 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2909
2910         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2911         places.
2912
2913 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2914
2915         Fix cs0038-1.cs, cs1640-6.cs.
2916         * ecore.cs (Expression.Resolve): Remove special-case for
2917         SimpleName in error-handling.
2918         (Expression.almostMatchedMembers): Relax access permission to
2919         protected.
2920         (Expression.MemberLookupFailed): Handle duplicates in
2921         almostMatchedMembers list.
2922         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2923         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2924         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2925         overload if the passed in MemberInfo is a MethodBase.
2926
2927 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2928
2929         Fix #70749
2930         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2931         for non-CAS & merge permission sets properly.
2932
2933 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2934
2935         Improve standard-compliance of simple name and member access 
2936         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2937         * ecore.cs (FullNamedExpression): New abstract base class 
2938         for Namespaces and TypeExpressions.
2939         (ResolveFlags.SimpleName): Remove.
2940         (SimpleName): Remove support for dotted names.
2941         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2942         DeclSpace.FindType and DeclSpace.LookupType.
2943         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2944         (Expression.ExprClassName): Make member function.
2945         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2946         a namespace.  Remove creation of dotted "SimpleName"s.
2947         (MemberAccess.DoResolve): Likewise.
2948         * decl.cs (DeclSpace.Cache): Make private.
2949         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2950         (DeclSpace.FindType): Update.
2951         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2952         FullNamedExpression.
2953         * namespace.cs (Namespace): Derive from FullNamedExpression
2954         so that it can be part of expression resolution.
2955         (Namespace.Lookup): Return an FullNamedExpression.
2956         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2957         namespace.
2958         * rootcontext.cs (NamespaceLookup): Remove.
2959         (LookupType): Move to DeclSpace.
2960         * attribute.cs (CheckAttributeType): Update.
2961         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2962         (FindDocumentedTypeNonArray): Likewise.
2963
2964 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2965
2966         Fix cs0509.cs, cs1632.cs.
2967         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2968         is the same as IsInterface.
2969         (TypeContainer.GetClassBases): Likewise.
2970         * statement.cs (LabeledStatement.ig): New field.
2971         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2972         label.
2973         (LabeledStatement.DoEmit): Check that the label was created with
2974         the same ILGenerator.
2975
2976 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2977
2978         Fix #71058
2979         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2980         accessors to its properties.
2981
2982         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2983         from accessors to property.
2984         
2985 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2986
2987         Fix #70722
2988         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2989         only for overrides.
2990         
2991 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2992
2993         * attribute.cs: Check for null and empty strings.  
2994
2995         I have lost another battle to Paolo.
2996
2997 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2998
2999         Fix #70942
3000         * class.cs (PropertyMethod): Set Parent field in ctors.
3001         (SetMethod.InternalParameters): Add unsafe switch hack.
3002         Override MarkForDuplicationCheck where it is appropriate.
3003
3004         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3005         It says whether container allows members with the same name.
3006         Base default is no.
3007         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3008         Removed is_method parameter.
3009
3010 2005-01-06  Duncan Mak  <duncan@ximian.com>
3011
3012         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3013         because the previous change led to incorrect reporting of CS1032
3014         ("Cannot define/undefine preprocessor symbols after first token in
3015         file"). Instead of using `tokens_seen' as the only flag that
3016         triggers CS1040, introduce `comments_seen'. This new flag is used
3017         to signify having seen comments on the current line, so it is
3018         unset after a newline.
3019
3020 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3021
3022         * doc.cs : When searching for a type, find nested type too.
3023           This fixes bug #71040.
3024
3025 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3026
3027         * doc.cs :
3028           - Warn missing member comment on those classes which also does not
3029             have doc comments. Fixed bug #71041.
3030           - Don't warn missing doc comment on default constructor.
3031             Fixed bug #71042.
3032
3033 2005-01-06  Duncan Mak  <duncan@ximian.com>
3034
3035         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3036         comments, set `tokens_seen' to true. This allows us to detect
3037         misplaced preprocessor directives (i.e. not at the beginning of
3038         the a line, nor after whitespaces). In that case, report error
3039         CS1040. This fixes bug #56460.
3040
3041         * cs-parser.jay (interface_member_declaration): Add checks for
3042         IsExplicitImpl, and report CS0541 error if an interface member is
3043         defined as an explicit interface declaration.
3044
3045 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3046
3047         Fix #70817
3048         * class.cs (PropertyMethod): Set Parent field in ctors.
3049         (SetMethod.InternalParameters): Add unsafe switch hack.
3050         
3051         * decl.cs (MemberCore.Parent): Cannot be readonly.
3052
3053 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3054
3055         * decl.cs (DeclSpace.ResolveType): Remove.
3056         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3057         Merge in code from ...
3058         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3059         * class.cs, enum.cs: Update to changes.
3060
3061 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3062
3063         * anonymous.cs: Ensure that we init the scope of our parent if it
3064         has not been initialized yet.
3065
3066 2004-12-30  Duncan Mak  <duncan@ximian.com>
3067
3068         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3069         if field.FieldBuilder is null. Fixes #70758.
3070
3071         * convert.cs: Fixed some typos and updated some of the comments.
3072         (ImplicitStandardConversionExists):
3073         (TryImplicitIntConversion): If `target_type' is an interface and
3074         the type of `ic' implements this interface, return true or a new
3075         BoxedCast instead of null. This fixes #70468.
3076
3077 2004-12-29  Duncan Mak  <duncan@ximian.com>
3078
3079         * expression.cs (Argument.Emit): Check that Expr is
3080         IMemoryLocation before casting to it, and report CS1510 otherwise.
3081
3082         This fixes #70402.
3083
3084 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3085
3086         * statement.cs (Block.ThisVariable): remove the recursion here, to
3087         make the --profile more sane.
3088
3089 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3090
3091         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3092         assembly, by JB Evain.
3093
3094 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3095
3096         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3097           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3098         "parent" refers to enclosing type/class.  "base" refers to superclass.
3099
3100 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3101
3102         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3103         Ensure that we only have GlobalAttributes.
3104         * attribute.cs (Attribute.Emit): Make non-virtual.
3105         (GlobalAttribute.Emit): Remove.
3106         (Attribute.Resolve): Make virtual.
3107         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3108         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3109         the argument. Don't create one.
3110         (Attribute.GetObsoleteAttribute): Likewise.
3111         (Attribute.GetClsCompliantAttributeValue): Likewise.
3112         * class.cs, decl.cs: Update to changes.
3113
3114 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3115
3116         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3117         
3118         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3119         
3120         * statement.cs (Foreach.Resolve): Add error 186 report.
3121
3122 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3123
3124         * expression.cs (Conditional.DoResolve): Add warning 429.
3125         
3126         * statement.cs (If.Resolve): Add warning 665.
3127
3128 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3129
3130         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3131         except when in the parser, and in GlobalAttribute.
3132         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3133         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3134         RootContext.Tree.Types.NamespaceEntry once work is done.
3135         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3136         and resets RootContext.Tree.Types.NamespaceEntry.
3137
3138 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3139
3140         * cs-parser.jay: Don't create a block for every variable.
3141
3142 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3143
3144         * location.cs: Provide extra information.
3145
3146         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3147         variables from the captured environment, it is the ldarg_0.
3148
3149 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3150
3151         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3152         find a conclusion.
3153         
3154         * class.cs: Changed warning level for 169 to avoid developer
3155         displeasure from warning flooding. It will be changed back when they
3156         fix most of current BCL warnings.
3157         
3158         * RootContext.cs: Pushed default WarningLevel to 3.
3159         
3160         * statement.cs: Removed unused variable.
3161
3162 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3163
3164         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3165         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3166         Add error 502 report.
3167         (StaticClass.DefineType): Add error 441 report.
3168         (Class.AllowedModifiersProp): New virtual property as temporary
3169         extension to AllowedModifiers.
3170         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3171         to share implementation with StaticClass and don't call virtual
3172         methods from ctor.
3173         
3174         * driver.cs (MainDriver): Add error 1558 test.
3175
3176         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3177         report. Moved error 36 test here.
3178
3179         * statement.cs (Throw.Resolve): Add error 724 report.
3180
3181         * typemanager.cs: Add out_attribute_type core type.
3182         
3183 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3184
3185         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3186         3018 report.
3187         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3188
3189         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3190         3017 report.
3191         
3192         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3193
3194         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3195         Add error 3023 report.
3196         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3197
3198         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3199         implementation.
3200
3201 2004-12-12  John Luke  <john.luke@gmail.com>
3202
3203         * driver.cs (AddArgs): take -- into account when
3204         adding arguments, fixes bug 65710 
3205
3206 2004-12-12  Martin Baulig  <martin@ximian.com>
3207
3208         * expression.cs (Unary.TryReduceNegative): Added support for
3209         SByteConstant and ByteConstant.
3210         (Unary.Reduce): Check error values from TryReduceNegative().
3211
3212 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3215         and report exception as error 182.
3216
3217 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3218
3219         * driver.cs (Main): Fix message when there are warnings.
3220
3221 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3222
3223         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3224
3225 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3226
3227         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3228         Reduced number of warnings.
3229         
3230         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3231
3232 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3233
3234         * driver.cs: Removed message.
3235
3236         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3237
3238 2004-12-08    <vargaz@freemail.hu>
3239
3240         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3241
3242 2004-12-08  Martin Baulig  <martin@ximian.com>
3243
3244         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3245         instead of a CS3002 for properties and indexer.
3246
3247 2004-12-08  Martin Baulig  <martin@ximian.com>
3248
3249         * decl.cs (MemberName.ToString): Make this work again.
3250
3251 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3252
3253         * attribute.cs (Resolve): Add error 591 detection.
3254
3255         * class.cs (FieldMember.Define): Add error 1547 detection.
3256         (Indexer.Define): Add error 620 detection.
3257         (Operator.Define): Add error 590 detection.
3258
3259         * ecore.cs: Missing argument for error 79.
3260
3261         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3262         detection.
3263
3264 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3265
3266         Fix #70106
3267         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3268         only.
3269
3270 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3271
3272         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3273           Some operator comments were suppressed.
3274         * doc.cs : Implicit/explicit operator name in doc comments are like
3275           "op_Explicit(type)~returnType", so added suffix handling.
3276
3277 2004-12-07  Martin Baulig  <martin@ximian.com>
3278
3279         * decl.cs
3280         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3281         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3282         (DeclSpace.ec): New protected field; store the EmitContext here.
3283         (DeclSpace.EmitContext): New public property; moved here from
3284         `TypeContainer'.
3285         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3286         EmitContext.
3287
3288         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3289         (Enum.Emit): Don't create a new EmitContext.
3290
3291         * delegate.cs (Delegate.DefineType): Always create the
3292         EmitContext.
3293
3294         * iterators.cs (Iterators.DefineIterator): Create a new
3295         EmitContext and store it in `ec'.
3296
3297 2004-08-24  Martin Baulig  <martin@ximian.com>
3298
3299         * typemanager.cs
3300         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3301         this for accessibility checks.
3302         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3303         IsNestedFamilyAccessible.
3304         (TypeManager.IsSubclassOf): New method, do what the name actually
3305         says.   
3306
3307 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3308
3309         Fix crash on cs0657-17.cs.
3310         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3311         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3312         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3313         the case where the NamespaceEntry gets overwritten.
3314
3315 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3316
3317         Fixed #69195, #56821
3318         * ecore.cs (ResolveBoolean): Tiny refactoring.
3319
3320         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3321         of right expression resolving when left is false constant and
3322         operator is LogicalAnd OR true constant and operator is LogicalOr.
3323
3324         * statement.cs (ResolveUnreachable): Always reports warning.
3325
3326 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3327
3328         * class.cs: Distinguish between 1721 and 1722 (just a little help
3329         for the programmer).
3330
3331 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3332
3333         * delegate.cs: Only allow this on new versions of the language. 
3334
3335 2004-12-02  Duncan Mak  <duncan@ximian.com>
3336
3337         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3338         Expression class.
3339         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3340         here as a static method. Take an additional bool out parameter
3341         `must_do_cs1540_check' for signaling to InstanceResolve.
3342         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3343         member field from PropertyExpr class and made it an argument of
3344         the method instead.
3345         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3346         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3347         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3348         and `remove_accessor' as well as InstanceResolve: report CS0122
3349         where applicable.
3350
3351         Fixes #70129.
3352
3353 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3354
3355         Fix test-327.cs, test-328.cs, and put in early infrastructure
3356         for eventually fixing #52697.
3357         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3358         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3359         from other methods.
3360         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3361         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3362         (VerifyUsing, error246): Update.
3363         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3364         'NamespaceEntry.LookupNamespaceOrType'.
3365
3366 2004-12-03  Martin Baulig  <martin@ximian.com>
3367
3368         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3369         method as our child, call AnonymousMethod.Compatible() on it.
3370
3371 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3372
3373         Disable XML documentation support in 'basic' profile.
3374         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3375         Redirect XmlElement to System.Object.
3376         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3377         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3378         * mcs.exe.sources: Add doc-bootstrap.cs.
3379         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3380         of doc.cs.
3381
3382 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3383
3384         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3385           comments are allowed.
3386
3387 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3388
3389         * delegate.cs: Add checks for subtypes in paramaters and return values
3390         in VerifyMethod () to add support for Covariance/Contravariance
3391         in delegates.
3392         
3393 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3394
3395         * report.cs: Remove extra closing parenthesis.
3396
3397         * convert.cs (Error_CannotImplicitConversion): If the name of the
3398         types are the same, provide some extra information.
3399
3400         * class.cs (FieldBase): Use an unused bit field from the field to
3401         encode the `has_offset' property from the FieldMember.  This saves
3402         a couple of Ks on bootstrap compilation.
3403
3404         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3405         method as our child, return the AnonymousMethod resolved
3406         expression.
3407
3408         * expression.cs (New.DoResolve): Allow return values from
3409         NewDelegate to also include AnonymousMethods.
3410
3411         Fixes #70150.
3412
3413 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3414
3415         Fix bug #70102
3416         * attribute.cs (Resolve): Improved implementation of params
3417         attribute arguments.
3418
3419         * support.cs (ParameterData): Add HasParams to be faster.
3420
3421 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3422
3423         all things are for /doc support:
3424
3425         * doc.cs: new file that supports XML documentation generation.
3426         * mcs.exe.sources: added doc.cs.
3427         * driver.cs:
3428           Handle /doc command line option.
3429           Report error 2006 instead of 5 for missing file name for /doc.
3430           Generate XML documentation when required, after type resolution.
3431         * cs-tokenizer.cs:
3432           Added support for picking up documentation (/// and /** ... */),
3433           including a new XmlCommentState enumeration.
3434         * cs-parser.jay:
3435           Added lines to fill Documentation element for field, constant,
3436           property, indexer, method, constructor, destructor, operator, event
3437           and class, struct, interface, delegate, enum.
3438           Added lines to warn incorrect comment.
3439         * rootcontext.cs :
3440           Added Documentation field (passed only when /doc was specified).
3441         * decl.cs:
3442           Added DocComment, DocCommentHeader, GenerateDocComment() and
3443           OnGenerateDocComment() and some supporting private members for
3444           /doc feature to MemberCore.
3445         * class.cs:
3446           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3447         * delegate.cs:
3448           Added overriden DocCommentHeader.
3449         * enum.cs:
3450           Added overriden DocCommentHeader and GenerateDocComment().
3451
3452 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3453
3454         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3455         unwrapping the enumeration values, chain to
3456         DoConstantNumericPromotions again, so we can promote things to the
3457         fundamental types (takes care of enums that are bytes, sbytes).
3458
3459         Fixes bug #62054.
3460
3461 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3462
3463         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3464         Fix long-standing bug in type-lookup.  Use FindType instead of
3465         LookupType when ec.ResolvingTypeTree.
3466         (Attribute.ResolveType, Attribute.Resolve)
3467         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3468         Update to changes.
3469         (Attributes.Search): Remove internal version.  Update.
3470         (Attributes.SearchMulti): Update.
3471         (Attributes.GetClsCompliantAttribute): Remove.
3472         (Attributes.GetIndexerNameAttribute): Remove.
3473         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3474         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3475         * class.cs (Indexer.Define): Likewise.
3476
3477 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3478
3479         Fix bug #68790
3480         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3481         MarshallByReference members access.
3482
3483         * expression.cs: Use CheckMarshallByRefAccess;
3484         Better error CS0197 message.
3485
3486         * report.cs: Print whole related error message.
3487
3488 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3489
3490         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3491         the current directory to help debugging.
3492
3493 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3494
3495         * class (GetClassBases): Better error 60 report.
3496         (EventProperty): Disabled warning 67 detection.
3497
3498 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3499
3500         Fix bug #60324
3501         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3502
3503         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3504         precise values.
3505
3506 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3507
3508         Fix bug #49488
3509         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3510
3511         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3512
3513 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3514
3515         * attribute.cs (Attribute.Resolve): Refine error reporting and
3516         report a cs0117 if the identifier does not exist, to distinguish
3517         from 0617 which is a miss-use of the actual identifier.
3518
3519         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3520         between cs0070 and cs0079.
3521
3522         * class.cs (MemberBase.DoDefine): When reporting a wrong
3523         accessibility level, we use MethodCore to compare instead of
3524         Method (this was a regression in some refactoring effort).
3525
3526         So now we correctly report cs0056 again.
3527
3528         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3529         testing the target_type (which was known to be object_type) and
3530         not the source type (which is anonymous_method).
3531
3532         Fixed reporting of error cs1660.
3533
3534         * expression.cs (UserCast.Source): Expose the underlying cast.
3535
3536         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3537         allowed types to find a match to int32 first (most common).
3538
3539         In addition, it ignores any ImplicitUserConversions that did an
3540         internal implicit conversion (as the switch statement allows only
3541         one integral conversion to exist).
3542
3543         * class.cs (PartialContainer.Create): rename `name' to
3544         `member_name' for clarity.  Then replace the string calls with a
3545         call to MemberName.GetPartialName, as now using
3546         MemberName.ToString is an error (this is due to the side effects
3547         it had, that were fixed in the past).
3548
3549         This will restore the error reporting on a number of partial class
3550         errors that were missusing this (and getting an exception as a
3551         results, which is now just a plain textual warning, because
3552         yyparse debug output would crash otherwise).
3553
3554 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3555
3556         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3557
3558 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3559
3560         * rootcontext.cs (LookupType): Make sure to cache lookups that
3561         don't give us a negative result. This saves about 5% of corlib
3562         compilation time.
3563
3564 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3565
3566         * report.cs (AbstractMessage.Print): messages are sent to stderr
3567
3568         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3569         non-interface in the list of interfaces (at this point, either
3570         parent was properly set, or a base class is being listed in the
3571         interfaces section).
3572
3573         This flags error 1722, and resolves the crash from bug 69259.
3574
3575 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3576
3577         * statement.cs (Using.EmitExpressionFinally): make this work right
3578         for valuetypes. Fixes 69926.
3579
3580 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3581
3582         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3583         converted to an enum" here, before we try to change the underlying
3584         type.  This code exists, but it is a different code path than the
3585         one used while encoding constants.
3586
3587         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3588         old bug: when converting from the null literal to a pointer,
3589         return an EmptyCast, not the NullLiteral.
3590
3591         This fixes #69921, the recent null_type changes probably made this
3592         bug more prominent.
3593
3594         (ImplicitReferenceConversionExists): In addition, resynchronized
3595         the code here, so it matches the same code in
3596         ImplicitReferenceConversionExists for the `from any class-type S
3597         to any interface-type T'.
3598         
3599
3600 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3601
3602         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3603
3604 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3605
3606         * cs-parser.jay: Use verbosity accordingly. 
3607
3608 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3609
3610         * expression.cs (Unary.ResolveOperator): Do not report warning;
3611         AddressOf reads from variable.
3612         
3613         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3614
3615 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3616
3617         Fix bug #69462
3618
3619         * attribute.cs (Attributable): Removed CheckTargets.
3620         (Attributes.Emit): Explicit attribute targets are tested here.
3621
3622         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3623         not enabled for interfaces.
3624
3625         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3626         (GetAssemblyName): Ouch next bug there.
3627
3628 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3629
3630         * expression.cs: Error 275 added.
3631         
3632 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3633
3634         Fix bug #69177 (Implemented decimal constant support)
3635
3636         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3637         (BinaryFold): Add DecimalConstant.
3638
3639         * const.cs (Define): Decimal constant 
3640         (is not constant.
3641         (ChangeType): Add decimal type handling.
3642         (LookupConstantValue): Don't set value for decimal type but
3643         emit DecimalConstantAttribute. Needed for constant optimization.
3644
3645         * constant.cs (ToDecimal): New method.
3646         (ConvertToDecimal): New method.
3647         (IntConstant): Implemented ConvertToDecimal.
3648         (DecimalConstant.Emit): Emit optimized version for decimals in
3649         int range.
3650
3651         * expression.cs (ResolveOperator): Changed order of constant
3652         reduction to work correctly with native types which have
3653         overloaded operators.
3654         (ResolveMemberAccess): Extract constant value from attribute
3655         for decimal type.
3656
3657         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3658
3659         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3660         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3661         (ChangeType): Decimal is special.
3662         (TypeToCoreType): Add decimal type.
3663
3664 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3665
3666         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3667         decimal types.
3668
3669 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3670
3671         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3672         test cs1667-5.cs.
3673
3674 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3675
3676         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3677
3678         * pending.cs (PendingImplementation): Grab only interfaces.
3679
3680 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3681
3682         * statement.cs (ForeachHelperMethods): Add location member and
3683         error 202 detection.
3684
3685 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3686
3687         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3688         automatically handled by executable.make.
3689         (PROGRAM): Make profile-specific.
3690
3691 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3692
3693         * expression.cs (DoResolveBase): Fixed wrong warning for out
3694         variables.
3695
3696 2004-11-18  Martin Baulig  <martin@ximian.com>
3697
3698         Merged latest changes into gmcs.  Please keep this comment in
3699         here, it makes it easier for me to see what changed in MCS since
3700         the last time I merged.
3701
3702 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3703
3704         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3705         (TypeHandle.GetMemberCache): New.
3706         (TypeHandle.TypeHandle): Update.
3707         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3708         (TypeManager.LookupParentInterfacesCache):
3709         Rename from LookupInterfaceCache.  Optimize slightly.
3710         (TypeManager.MemberLookup_FindMembers): Update.
3711         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3712         multi-type variant.
3713         (AddCacheContents): Rename from AddHashtable.
3714         * class.cs (TypeContainer.parent_container): Remove.
3715         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3716         (TypeContainer.DoDefineMembers): Don't initialize it.
3717         Update to name changes.
3718         
3719 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3720
3721         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3722         that factors the code to check access modifiers on override.  
3723
3724         (PropertyBase): Use the code here.
3725
3726         Patch from Lluis S'anchez, fixes bug #69361.
3727
3728 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3729
3730         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3731         routine that is used to report the use of a captured variable
3732         whose address has been taken.
3733
3734         There are two checks: one when variables are being captured and
3735         the other check is when the address of a variable is taken. 
3736         
3737         (because an anonymous methods might be resolved before *or* after
3738         the address has been taken) and 
3739
3740         * expression.cs (Conditional.DoResolve): Remove the special
3741         casing that Martin added to trueExpr and falseExpr being both
3742         NullLiteral.  We get the right behavior now just by introducing
3743         the null_type into the compiler. 
3744
3745         * convert.cs (ExplicitConversion): Change the code to use
3746         null_type instead of testing `expr is NullLiteral'.
3747         (ImplicitConversionStandard): use null_type too.
3748         (ImplicitReferenceConversionExists): use null_type too.
3749         (ImplicitReferenceConversion): use null_type too.
3750
3751         * literal.cs: The type of `NullLiteral' is now null_type instead
3752         of object_type. 
3753         (Resolve): Set the type here.
3754
3755         * typemanager.cs: Introduce null_type.
3756
3757 2004-11-17  Martin Baulig  <martin@ximian.com>
3758
3759         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3760         direction, like FindMembers() does.  Fixes #69546, testcase is in
3761         test-315.cs.    
3762
3763 2004-11-16  Martin Baulig  <martin@ximian.com>
3764
3765         This is based on a patch from Marek Safar, see bug #69082.
3766         Fixes bugs #63705 and #67130.
3767
3768         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3769         method; create a MemberCache for an interface type and cache the
3770         result.
3771
3772         * decl.cs (IMemberContainer.ParentContainer): Removed.
3773         (IMemberContainer.ParentCache): New property.
3774         (MemberCache.SetupCacheForInterface): Removed.
3775         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3776         to create a cache for an interface's "parent".
3777
3778         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3779         interfaces too.
3780
3781 2004-11-16  Martin Baulig  <martin@ximian.com>
3782
3783         Merged back from gmcs; these changes already went into gmcs a
3784         couple of weeks ago.
3785
3786         * typemanager.cs
3787         (TypeManager.AddUserType): Removed the `ifaces' argument.
3788         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3789         `TypeExpr []'.
3790         (TypeManager.AddUserInterface): Removed.
3791         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3792         `TypeExpr []'.
3793         (TypeManager.GetInterfaces): Likewise.
3794         (TypeManager.GetExplicitInterfaces): Likewise.
3795
3796         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3797
3798         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3799         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3800
3801 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3802
3803         * statement.cs: Avoid adding bools to a hashtable.
3804
3805 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3806
3807         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3808         calling an unsafe method from a safe location.
3809
3810 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3811
3812         Fix #69167
3813         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3814
3815 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3816
3817         * namespace.cs (VerifyUsing): use GetPartialName instead of
3818         ToString. 
3819
3820 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3821
3822         * statement.cs (Return.Resolve): Fix regression in typo: if
3823         `in_exc', we have to request a NeedReturnLabel, this was a typo
3824         introduced in the anonymous method check-in.  Fixes #69131.
3825
3826         * Indexers were using the ShortName when defining themselves,
3827         causing a regression in the compiler bootstrap when applying the
3828         patch from 2004-11-02 (first part), now they use their full name
3829         and the bug is gone.
3830
3831 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3832
3833         * driver.cs: Strip the path from the names of embedded resources. Fixes
3834         #68519.
3835
3836 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3837
3838         Fix error message regression: cs0104-2.cs.
3839         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3840         (AliasEntry.Resolve): Update.
3841         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3842         'silent' flag.
3843         (RootContext.LookupType): Update.
3844
3845 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3846
3847         * cs-parser.jay: Add support for handling accessor modifiers
3848         * class: Add support port accessor modifiers and error checking,
3849         define PropertyMethod.Define as virtual (not abstract anymore)
3850         * ecore.cs: Add checking for proeprties access with access modifiers
3851         * iterators.cs: Modify Accessor constructor call based in the modified
3852         constructor
3853 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3854
3855         * expression.cs (StringConcat): Handle being called twice,
3856         as when we have a concat in a field init with more than two
3857         ctors in the class
3858
3859 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3860
3861         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3862         special case explicit implementations, we should always produce
3863         the .property or .event declaration.
3864         
3865         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3866         since it will not return correct data if people use this
3867         unresolved in the presence of using statements (see test-313).
3868
3869         * class.cs (MethodData.Define): If we are an explicit interface
3870         implementation, set the method name to the full name of the
3871         interface plus the name of the method.  
3872
3873         Notice that using the method.MethodName.GetFullName() does not
3874         work, as it will only contain the name as declared on the source
3875         file (it can be a shorthand in the presence of using statements)
3876         and not the fully qualifed type name, for example:
3877
3878         using System;
3879
3880         class D : ICloneable {
3881                 object ICloneable.Clone ()  {
3882                 }
3883         }
3884
3885         Would produce a method called `ICloneable.Clone' instead of
3886         `System.ICloneable.Clone'.
3887
3888         * namespace.cs (Alias.Resolve): Use GetPartialName.
3889         
3890 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3891
3892         * cs-parser.jay: Add error 1055 report.
3893
3894 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3895
3896         * assign.cs (Assign.DoResolve): Only do the transform of
3897         assignment into a New if the types are compatible, if not, fall
3898         through and let the implicit code deal with the errors and with
3899         the necessary conversions. 
3900
3901 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3902
3903         * cs-parser.jay: Add error 1031 report.
3904
3905         * cs-tokenizer.cs: Add location for error 1038.
3906
3907 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3908
3909         * cs-parser.jay: Add error 1016 report.
3910
3911 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3912
3913         * cs-parser.jay: Add errors 1575,1611 report.
3914
3915 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3916
3917         * cs-parser.jay: Add error 1001 report.
3918
3919 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3920
3921         Fix #68850
3922         * attribute.cs (GetMarshal): Add method argument for
3923         caller identification.
3924
3925         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3926         agument for GetMarshal and RuntimeMissingSupport.
3927
3928 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3929
3930         * attribute.cs (ExtractSecurityPermissionSet): Removed
3931         TypeManager.code_access_permission_type.
3932
3933         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3934
3935 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3936
3937         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3938         for obsolete use of a variable here.   Fixes regression on errors
3939         cs0619-25 and cs0619-26.
3940
3941 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3942
3943         Fix #62358, implemented security attribute encoding.
3944
3945         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3946         Tests permitted SecurityAction for assembly or other types.
3947         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3948         data from SecurityPermissionAttribute to PermisionSet class.
3949
3950         * class.cs (ApplyAttributeBuilder): Added special handling
3951         for System.Security.Permissions.SecurityAttribute based types.
3952
3953         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3954         special handling for System.Security.Permissions.SecurityAttribute
3955         based types.
3956
3957         * enum.cs (ApplyAttributeBuilder): Added special handling
3958         for System.Security.Permissions.SecurityAttribute based types.
3959
3960         * parameter.cs (ApplyAttributeBuilder): Added special handling
3961         for System.Security.Permissions.SecurityAttribute based types.
3962
3963         * rootcontext.cs: Next 2 core types.
3964
3965         * typemanager.cs (TypeManager.security_permission_attr_type):
3966         Built in type for the SecurityPermission Attribute.
3967         (code_access_permission_type): Build in type.
3968
3969 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3970
3971         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3972         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3973         all of this information into
3974         EmitContext.EmitCapturedVariableInstance.
3975         
3976         * codegen.cs (EmitCapturedVariableInstance): move here the
3977         funcionality of emitting an ldarg.0 in the presence of a
3978         remapping.   This centralizes the instance emit code.
3979
3980         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3981         then emit a load of this: it means that we have reached the
3982         topmost ScopeInfo: the one that contains the pointer to the
3983         instance of the class hosting the anonymous method.
3984
3985         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3986         captures to the topmost CaptureContext.
3987
3988 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3989
3990         * expression.cs (LocalVariableReference): Move the knowledge about
3991         the iterators into codegen's EmitCapturedVariableInstance.
3992
3993 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3994
3995         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3996         all code paths return a value from an anonymous method (it is the
3997         same as the 161 error, but for anonymous methods).
3998
3999 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4000
4001         The introduction of anonymous methods in the compiler changed
4002         various ways of doing things in the compiler.  The most
4003         significant one is the hard split between the resolution phase
4004         and the emission phases of the compiler.
4005
4006         For instance, routines that referenced local variables no
4007         longer can safely create temporary variables during the
4008         resolution phase: they must do so from the emission phase,
4009         since the variable might have been "captured", hence access to
4010         it can not be done with the local-variable operations from the runtime.
4011         
4012         * statement.cs 
4013
4014         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4015         is a toplevel block.
4016
4017         (ToplevelBlock): A new kind of Block, these are the blocks that
4018         are created by the parser for all toplevel method bodies.  These
4019         include methods, accessors and anonymous methods.
4020
4021         These contain some extra information not found in regular blocks:
4022         A pointer to an optional CaptureContext (for tracking captured
4023         local variables and parameters).  A pointer to the parent
4024         ToplevelBlock.
4025         
4026         (Return.Resolve): Catch missmatches when returning a value from an
4027         anonymous method (error 1662).
4028         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4029         phase.
4030
4031         (Break.Resolve): ditto.
4032
4033         (SwitchLabel): instead of defining the labels during the
4034         resolution phase, we now turned the public ILLabel and ILLabelCode
4035         labels into methods called GetILLabelCode() and GetILLabel() that
4036         only define the label during the Emit phase.
4037
4038         (GotoCase): Track the SwitchLabel instead of the computed label
4039         (its contained therein).  Emit the code by using
4040         SwitchLabel.GetILLabelCode ().
4041
4042         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4043         whether the Local has been captured or not.
4044
4045         (LocalInfo.IsCaptured): New property, used to tell whether the
4046         local has been captured.
4047         
4048         * anonymous.cs: Vastly updated to contain the anonymous method
4049         support.
4050
4051         The main classes here are: CaptureContext which tracks any
4052         captured information for a toplevel block and ScopeInfo used to
4053         track the activation frames for various local variables.   
4054
4055         Each toplevel block has an optional capture context associated
4056         with it.  When a method contains an anonymous method both the
4057         toplevel method and the anonymous method will create a capture
4058         context.   When variables or parameters are captured, they are
4059         recorded on the CaptureContext that owns them, for example:
4060
4061         void Demo () {
4062              int a;
4063              MyDelegate d = delegate {
4064                  a = 1;
4065              }
4066         }
4067
4068         Here `a' will be recorded as captured on the toplevel
4069         CapturedContext, the inner captured context will not have anything
4070         (it will only have data if local variables or parameters from it
4071         are captured in a nested anonymous method.
4072
4073         The ScopeInfo is used to track the activation frames for local
4074         variables, for example:
4075
4076         for (int i = 0; i < 10; i++)
4077                 for (int j = 0; j < 10; j++){
4078                    MyDelegate d = delegate {
4079                         call (i, j);
4080                    }
4081                 }
4082
4083         At runtime this captures a single captured variable `i', but it
4084         captures 10 different versions of the variable `j'.  The variable
4085         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4086         recorded on a child.  
4087
4088         The toplevel ScopeInfo will also track information like the `this'
4089         pointer if instance variables were referenced (this is necessary
4090         as the anonymous method lives inside a nested class in the host
4091         type of the method). 
4092
4093         (AnonymousMethod): Expanded to track the Toplevel, implement
4094         `AnonymousMethod.Compatible' to tell whether an anonymous method
4095         can be converted to a target delegate type. 
4096
4097         The routine now also produces the anonymous method content
4098
4099         (AnonymousDelegate): A helper class that derives from
4100         DelegateCreation, this is used to generate the code necessary to
4101         produce the delegate for the anonymous method that was created. 
4102
4103         * assign.cs: API adjustments for new changes in
4104         Convert.ImplicitStandardConversionExists.
4105
4106         * class.cs: Adjustments to cope with the fact that now toplevel
4107         blocks are of type `ToplevelBlock'. 
4108
4109         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4110         insteda of standard blocks.
4111
4112         Flag errors if params arguments are passed to anonymous methods.
4113
4114         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4115         `CurrentAnonymousMethod' which points to the current Anonymous
4116         Method.  The variable points to the AnonymousMethod class that
4117         holds the code being compiled.  It is set in the new EmitContext
4118         created for the anonymous method.
4119
4120         (EmitContext.Phase): Introduce a variable and an enumeration to
4121         assist in enforcing some rules about when and where we are allowed
4122         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4123         only one that enfonces this right now).
4124
4125         (EmitContext.HaveCaptureInfo): new helper method that returns
4126         whether we have a CapturedContext initialized.
4127
4128         (EmitContext.CaptureVariable): New method used to register that a
4129         LocalInfo must be flagged for capturing. 
4130
4131         (EmitContext.CapturedParameter): New method used to register that a
4132         parameters must be flagged for capturing. 
4133         
4134         (EmitContext.CapturedField): New method used to register that a
4135         field must be flagged for capturing. 
4136
4137         (EmitContext.HaveCapturedVariables,
4138         EmitContext.HaveCapturedFields): Return whether there are captured
4139         variables or fields. 
4140
4141         (EmitContext.EmitMethodHostInstance): This is used to emit the
4142         instance for the anonymous method.  The instance might be null
4143         (static methods), this (for anonymous methods that capture nothing
4144         and happen to live side-by-side with the current method body) or a
4145         more complicated expression if the method has a CaptureContext.
4146
4147         (EmitContext.EmitTopBlock): Routine that drives the emission of
4148         code: it will first resolve the top block, then emit any metadata
4149         and then emit the code.  The split is done so that we can extract
4150         any anonymous methods and flag any captured variables/parameters.
4151         
4152         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4153         during this phase, the ILGenerator should not be used as labels
4154         and local variables declared here might not be accessible to any
4155         code that is part of an anonymous method.  
4156
4157         Exceptions to this include the temporary variables that are
4158         created by some statements internally for holding temporary
4159         variables. 
4160         
4161         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4162         metadata for a cb
4163
4164         (EmitContext.TemporaryReturn): This method is typically called
4165         from the Emit phase, and its the only place where we allow the
4166         ReturnLabel to be defined other than the EmitMeta.  The reason is
4167         that otherwise we would have to duplicate a lot of logic in the
4168         Resolve phases of various methods that today is on the Emit
4169         phase. 
4170
4171         (EmitContext.NeedReturnLabel): This no longer creates the label,
4172         as the ILGenerator is not valid during the resolve phase.
4173
4174         (EmitContext.EmitThis): Extended the knowledge in this class to
4175         work in anonymous methods in addition to iterators. 
4176
4177         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4178         code is necessary on the stack to access the instance to a local
4179         variable (the variable will be accessed as a field).
4180
4181         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4182         EmitContext.EmitAddressOfParameter): Routines to support
4183         parameters (not completed at this point). 
4184         
4185         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4186         will also remove the parameters.
4187
4188         * convert.cs (Convert): Define a `ConstantEC' which points to a
4189         null.  This is just to prefity some code that uses
4190         ImplicitStandardConversion code and do not have an EmitContext
4191         handy.
4192
4193         The idea is to flag explicitly that at that point in time, it is
4194         known that the conversion will not trigger the delegate checking
4195         code in implicit conversions (which requires a valid
4196         EmitContext). 
4197
4198         Everywhere: pass new EmitContext parameter since
4199         ImplicitStandardConversionExists now requires it to check for
4200         anonymous method conversions. 
4201
4202         (Convert.ImplicitStandardConversionExists): If the type of an
4203         expression is the anonymous_method_type, and the type is a
4204         delegate, we invoke the AnonymousMethod.Compatible method to check
4205         whether an implicit conversion is possible. 
4206
4207         (Convert.ImplicitConversionStandard): Only do implicit method
4208         group conversions if the language level is not ISO_1.
4209
4210         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4211         MethodInfo for the Invoke method.  used by Delegate and
4212         AnonymousDelegate.
4213
4214         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4215         method conversions if the target type is a delegate.
4216
4217         Removed extra debugging nops.
4218
4219         (LocalVariableReference): Turn the `local_info' into a public
4220         field. 
4221
4222         Add `prepared' field, the same hack used for FieldExprs to cope
4223         with composed assignments, as Local variables do not necessarily
4224         operate purely on the stack as they used to: they can be captured
4225         fields. 
4226
4227         Add `temp' for a temporary result, like fields.
4228
4229         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4230
4231         It now copes with Local variables that are captured and emits the
4232         proper instance variable to load it from a field in the captured
4233         case. 
4234
4235         (ParameterReference.DoResolveBase): During the resolve phase,
4236         capture parameters if we are in an anonymous method.
4237
4238         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4239         anonymous method, use the EmitContext helper routines to emit the
4240         parameter reference.
4241
4242         * iterators.cs: Set RemapToProxy to true/false during the
4243         EmitDispose class.
4244
4245         * parameters.cs (GetParameterByName): New helper method. 
4246
4247         * typemanager.cs (anonymous_method_type) a new type that
4248         represents an anonyous method.  This is always an internal type,
4249         used as a fencepost to test against the anonymous-methodness of an
4250         expression. 
4251         
4252 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4253
4254         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4255         561 report.
4256         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4257
4258 2004-10-18  Martin Baulig  <martin@ximian.com>
4259
4260         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4261         `Type' directly, but call ResolveType() on it.
4262         (Catch.Resolve): Likewise.
4263         (Foreach.Resolve): Likewise.
4264
4265 2004-10-18  Martin Baulig  <martin@ximian.com>
4266
4267         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4268         `Type' directly, but call ResolveType() on it.
4269         (Probe.DoResolve): Likewise.
4270         (ArrayCreation.LookupType): Likewise.
4271         (TypeOf.DoResolve): Likewise.
4272         (SizeOf.DoResolve): Likewise.
4273
4274 2004-10-18  Martin Baulig  <martin@ximian.com>
4275
4276         * expression.cs (Invocation.BetterFunction): Put back
4277         TypeManager.TypeToCoreType().
4278
4279 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4280
4281         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4282         the ResolveType.
4283
4284 2004-10-18  Martin Baulig  <martin@ximian.com>
4285
4286         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4287         `Type' directly, but call ResolveType() on it.
4288
4289 2004-10-18  Martin Baulig  <martin@ximian.com>
4290
4291         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4292         `Type' directly, but call ResolveType() on it.
4293         (MemberBase.DoDefine): Likewise.
4294
4295         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4296         `Type' directly, but call ResolveType() on it.
4297         (ComposedCast.DoResolveAsTypeStep): Likewise.
4298
4299         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4300         `Type' directly, but call ResolveType() on it.
4301
4302 2004-10-17  John Luke  <john.luke@gmail.com>
4303
4304         * class.cs (Operator.GetSignatureForError): use CSharpName
4305
4306         * parameter.cs (Parameter.GetSignatureForError): Returns
4307         correct name even if was not defined.
4308
4309 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4310
4311         Fix #65816.
4312         * class.cs (TypeContainer.EmitContext): New property.
4313         (DefineNestedTypes): Create an emitcontext for each part.
4314         (MethodCore.DoDefineParameters): Use container's emitcontext.
4315         Pass type array to InternalParameters.
4316         (MemberBase.DoDefine): Use container's emitcontext.
4317         (FieldMember.Define): Likewise.
4318         (Event.Define): Likewise.
4319         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4320         Pass type array to InternalParameters.
4321         (SetIndexerMethod.GetParameterInfo): Likewise.
4322         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4323         * delegate.cs (Define): Pass emitcontext to
4324         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4325         array to InternalParameters.
4326         * expression.cs (ParameterReference.DoResolveBase): Pass
4327         emitcontext to GetParameterInfo.
4328         (ComposedCast.DoResolveAsTypeStep): Remove check on
4329         ec.ResolvingTypeTree.
4330         * parameter.cs (Parameter.Resolve): Change argument to
4331         EmitContext.  Use ResolveAsTypeTerminal.
4332         (Parameter.GetSignature): Change argument to EmitContext.
4333         (Parameters.ComputeSignature): Likewise.
4334         (Parameters.ComputeParameterTypes): Likewise.
4335         (Parameters.GetParameterInfo): Likewise.
4336         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4337         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4338         * support.cs (InternalParameters..ctor): Remove variant that takes
4339         a DeclSpace.
4340         * typemanager.cs (system_intptr_expr): New.
4341         (InitExpressionTypes): Initialize it.
4342
4343 2004-10-12  Chris Toshok  <toshok@ximian.com>
4344
4345         * cs-parser.jay: fix location for try_statement and catch_clause.
4346
4347 2004-10-11  Martin Baulig  <martin@ximian.com>
4348
4349         * report.cs: Don't make --fatal abort on warnings, we have
4350         -warnaserror for that.
4351
4352 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4353
4354         More DeclSpace.ResolveType avoidance.
4355         * decl.cs (MemberCore.InUnsafe): New property.
4356         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4357         with newly created EmitContext.
4358         (FieldMember.Define): Likewise.
4359         * delegate.cs (Delegate.Define): Likewise.
4360         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4361         only if normal name-lookup fails.
4362         (TypeExpr.DoResolve): Enable error-checking.
4363         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4364         (SizeOf.DoResolve): Likewise.
4365         (ComposedCast.DoResolveAsTypeStep): Likewise.
4366         (StackAlloc.DoResolve): Likewise.
4367         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4368         (Block.Unsafe): New property.
4369         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4370         (Unsafe): Set 'unsafe' flag of contained block.
4371         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4372         (Fixed.Resolve): Likewise.
4373         (Catch.Resolve): Likewise.
4374         (Using.ResolveLocalVariableDecls): Likewise.
4375         (Foreach.Resolve): Likewise.
4376
4377 2004-10-05  John Luke <john.luke@gmail.com>
4378
4379         * cs-parser.jay: add location to error CS0175
4380
4381 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4382
4383         * ecore.cs (Expression.Constantity): Add support for turning null
4384         into a constant.
4385
4386         * const.cs (Const.Define): Allow constants to be reference types
4387         as long as the value is Null.
4388
4389 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4390
4391         * namespace.cs (NamespaceEntry.Using): No matter which warning
4392         level is set, check if this namespace name has already been added.
4393
4394 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4395
4396         * expression.cs: reftype [!=]= null should always use br[true,false].
4397         # 67410
4398
4399 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4400
4401         Fix #67108
4402         * attribute.cs: Enum conversion moved to 
4403         GetAttributeArgumentExpression to be applied to the all
4404         expressions.
4405
4406 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4407
4408         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4409         * class.c (TypeContainer.DefineType): Flag error if
4410         base types aren't accessible due to access permissions.
4411         * decl.cs (DeclSpace.ResolveType): Move logic to
4412         Expression.ResolveAsTypeTerminal.
4413         (DeclSpace.ResolveTypeExpr): Thin layer over
4414         Expression.ResolveAsTypeTerminal.
4415         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4416         Refactor code into NestedAccess.  Use it.
4417         (DeclSpace.NestedAccess): New.
4418         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4419         argument to silence errors.  Check access permissions.
4420         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4421         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4422         (Cast.DoResolve): Likewise.
4423         (New.DoResolve): Likewise.
4424         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4425         (TypeOf.DoResolve): Likewise.
4426
4427         * expression.cs (Invocation.BetterConversion): Return the Type of
4428         the better conversion.  Implement section 14.4.2.3 more faithfully.
4429         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4430         section 14.4.2.2 explicit.
4431         (Invocation.OverloadResolve): Update.
4432         (Invocation): Remove is_base field.
4433         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4434         (Invocation.Emit): Likewise.
4435
4436 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4437
4438         * README: Update to changes.
4439
4440 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4441
4442         * cs-parser.jay: Reverted 642 warning fix.
4443
4444 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4445
4446         Fix bug #66615
4447         * decl.cs (FindMemberWithSameName): Indexer can have more than
4448         1 argument.
4449
4450 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4451
4452         * expression.cs (LocalVariableReference.DoResolveLValue):
4453         Do not report warning 219 for out values.
4454         (EmptyExpression.Null): New member to avoid extra allocations.
4455
4456 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4457
4458         * cs-parser.jay: Fix wrong warning 642 report.
4459
4460         * cs-tokenizer.cs (CheckNextToken): New helper;
4461         Inspect next character if is same as expected.
4462
4463 2004-09-23  Martin Baulig  <martin@ximian.com>
4464
4465         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4466         (Convert.ImplicitReferenceConversionExists): Likewise.
4467
4468 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4469
4470         * class.cs (Operator.Define): Add error 448 and 559 report.
4471
4472 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4473
4474         * class.cs (MemberBase.IsTypePermitted): New protected
4475         method for checking error CS0610.
4476
4477 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4478
4479         * class.cs (TypeContainer.HasExplicitLayout): New property
4480         Returns whether container has StructLayout attribute set Explicit.
4481         (FieldMember): New abstract class for consts and fields.
4482         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4483         (Field): Reuse FieldMember.
4484
4485         * const.cs (Const): Reuse FieldMember.
4486
4487         * rootcontext.cs: EmitConstants call moved to class.
4488
4489 2004-09-22  Martin Baulig  <martin@ximian.com>
4490
4491         Thanks to Peter Sestoft for this bug report.
4492
4493         * expression.cs (Conditional): If both the `trueExpr' and the
4494         `falseExpr' is a NullLiteral, return a NullLiteral.
4495
4496 2004-09-22  Martin Baulig  <martin@ximian.com>
4497
4498         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4499         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4500         for the "get_Current" call.
4501
4502 2004-09-22  Martin Baulig  <martin@ximian.com>
4503
4504         Marek and me just fixed one of our oldest bugs: #28562 :-)
4505
4506         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4507
4508         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4509         we're an EnumConstant, just return that.
4510         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4511         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4512         to get the value which'll actually be written into the attribute.
4513         However, we have to use GetValue() to access the attribute's value
4514         in the compiler.        
4515
4516 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4517
4518         * constant.cs (Constant.IsNegative): New abstract property
4519         IsNegative.
4520
4521         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4522         (StackAlloc.DoResolve): Reused IsNegative.
4523
4524 2004-09-21  Martin Baulig  <martin@ximian.com>
4525
4526         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4527         if we're used in an iterator, we may be called from different
4528         methods.
4529
4530         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4531         we actually have an exception block.
4532
4533 2004-09-20  John Luke <jluke@cfl.rr.com>
4534
4535         * class.cs, cs-parser.jay: Improve the error report for 1520:
4536         report the actual line where the error happens, not where the
4537         class was declared.
4538
4539         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4540         Pass location information that was available elsewhere.
4541
4542 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4543
4544         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4545         runtime to delay sign assemblies.
4546
4547 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4548
4549         * cs-parser.jay: Do not report the stack trace, this is barely
4550         used nowadays.
4551
4552 2004-08-22  John Luke  <john.luke@gmail.com>
4553  
4554         * driver.cs : check that a resource id is not already used
4555         before adding it, report CS1508 if it is, bug #63637
4556
4557 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4558
4559         * ecore.cs: Removed dead code.
4560
4561 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4562
4563         * class.cs: Do not report warning CS0067 on the interfaces.
4564
4565 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4566
4567         * cs-parser.jay: Add error 504 report.
4568
4569 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4570
4571         * rootcontext.cs: WarningLevel is 4 by default now.
4572
4573         * statement.cs (Fixed.Resolve): Do not null
4574         VariableInfo.
4575
4576 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4577
4578         Fixed bug #55780
4579         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4580         deep search when property is not virtual.
4581         (PropertyExpr.ResolveAccessors): Make one call for both
4582         accessors.
4583
4584 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4585
4586         Fixed bug #65766
4587         * statement.cs: Error 152 report constains also location.
4588
4589 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4590
4591         Fixed bug #65766
4592         * const.cs: Explicitly set constant as static.
4593
4594 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4595
4596         Fixed bug #64226
4597         * cs-parser.jay: Add error 1017 report.
4598
4599 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4600
4601         Fixed bug #59980, #64224
4602         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4603
4604         * typemanager.cs (IsSpecialMethod): Simplified
4605
4606 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4607
4608         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4609         condition with better params.
4610
4611 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4612
4613         Fixed bug #65238
4614         * attribute.cs (Resolve): Property has to have both
4615         accessors.
4616
4617 2004-09-14  Martin Baulig  <martin@ximian.com>
4618
4619         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4620
4621 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4622
4623         Fixed bug #61902
4624         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4625         called and is obsolete then this member suppress message
4626         when call is inside next [Obsolete] method or type.
4627
4628         * expression.cs: Use TestObsoleteMethodUsage member.
4629
4630 2004-09-14  Martin Baulig  <martin@ximian.com>
4631
4632         * cs-parser.jay: Sync a bit with the GMCS version.
4633
4634 2004-09-14  Martin Baulig  <martin@ximian.com>
4635
4636         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4637         (CSharpParser.yacc_verbose_flag): New public field.
4638
4639         * genericparser.cs: Removed.
4640
4641 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4642
4643         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4644
4645 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4646
4647         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4648
4649 2004-09-10  Martin Baulig  <martin@ximian.com>
4650
4651         Backported my MemberName changes from GMCS into MCS.
4652
4653         - we are now using a special `MemberName' class instead of using
4654         strings; in GMCS, the `MemberName' also contains the type
4655         arguments.
4656
4657         - changed the grammar rules a bit:
4658           * the old `member_name' is now a `namespace_or_type_name':
4659             The rule is that we use `namespace_or_type_name' everywhere
4660             where we expect either a "member name" (GetEnumerator) or a
4661             "member name" with an explicit interface name
4662             (IEnumerable.GetEnumerator).
4663             In GMCS, the explicit interface name may include type arguments
4664             (IEnumerable<T>.GetEnumerator).
4665           * we use `member_name' instead of just `IDENTIFIER' for
4666             "member names":
4667             The rule is that we use `member_name' wherever a member may
4668             have type parameters in GMCS.       
4669
4670         * decl.cs (MemberName): New public class.
4671         (MemberCore.MemberName): New public readonly field.
4672         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4673         (DeclSpace): Likewise.
4674
4675         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4676         * enum.cs (Enum.ctor): Likewise.
4677
4678         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4679         MemberName.     
4680         (AliasEntry.ctor): Take a MemberName, not an Expression.
4681         (AliasEntry.UsingAlias): Likewise.
4682
4683         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4684         (IMethodData.MemberName): Changed type from string to MemberName.
4685         (MemberBase.ExplicitInterfaceName): Likewise.
4686         (AbstractPropertyEventMethod.SetupName): Make this private.
4687         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4688         argument; compute the member name here.
4689         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4690         on the `member.MemberName' and the `prefix'.
4691
4692         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4693         not `type_name'.
4694         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4695         thus, we get a `MemberName' instead of a `string'.  These
4696         declarations may have type parameters in GMCS.
4697         (interface_method_declaration, delegate_declaration): Likewise.
4698         (class_declaration, interface_declaration): Likewise.
4699         (method_header): Use `namespace_or_type_name' instead of
4700         `member_name'.  We may be an explicit interface implementation.
4701         (property_declaration, event_declaration): Likewise.
4702         (member_name): This is now just an `IDENTIFIER', not a
4703         `namespace_or_type_name'.
4704         (type_name, interface_type): Removed.
4705         (namespace_or_type_name): Return a MemberName, not an Expression.
4706         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4707         call GetTypeExpression() on the MemberName to get an expression.
4708         (IndexerDeclaration.interface_type): Changed type from string to
4709         MemberName.
4710         (MakeName): Operate on MemberName's instead of string's.
4711
4712 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4713
4714         Fix bug #55770.
4715         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4716         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4717         lookup to avoid symbols introduced by 'using'.
4718         * rootcontext.cs (NamespaceLookup): Update.
4719
4720 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4721
4722         * class.cs (TypeContainer.DoDefineMembers): Do not call
4723         DefineDefaultConstructor for static classes.
4724
4725 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4726
4727         * attribute.cs (Attribute.Resolve): Add error 653 report.
4728
4729         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4730         report.
4731         (Method.ApplyAttributeBuilder): Add error 685 report.
4732         (Operator.Define): Add error 564 report.
4733
4734         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4735
4736         * expression.cs (Invocation.DoResolve): Add error
4737         245 and 250 report.
4738
4739         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4740         error 674 report.
4741
4742 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4743
4744         * class.cs (ConstructorInitializer.Resolve):
4745         Wrong error number (515->516).
4746
4747 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4748
4749         * class.cs (Indexer.Define): Add error 631 report.
4750
4751 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4752
4753         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4754
4755 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4756
4757         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4758
4759 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4760
4761         * cs-parser.jay: Added error CS0241 report.
4762
4763 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4764
4765         * cs-parser.jay (fixed_statement): Introduce a scope for the
4766         declaration in the 'fixed' statement.
4767
4768 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4769
4770         * cs-parser.jay: Added CS0230 error report.
4771
4772 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4773
4774         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4775
4776 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4777
4778         * expression.cs (Argument.Resolve): Added error CS0192 and
4779         CS0199 report.
4780
4781 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4782
4783         C# 2.0 #pragma warning feature
4784
4785         * cs-tokenizer.cs (PreProcessPragma): New method; 
4786         Handles #pragma directive.
4787
4788         * report.cs (WarningRegions): New class; Support
4789         class for #pragma warning directive. It tests whether
4790         warning is enabled for a given line.
4791
4792 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4793
4794         * const.cs: Add more descriptive error report, tahnks to
4795         Sebastien. 
4796
4797 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4800
4801 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4802
4803         * expression.cs: Apply patch from Ben: Remove dead code from
4804         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4805         as that code just threw an exception anwyays.
4806
4807         * const.cs: Remove the call to the turnintoconstant, for details
4808         see bug: #63144
4809         
4810         * literal.cs: The type of the null-literal is the null type;  So
4811         we use a placeholder type (literal.cs:System.Null, defined here)
4812         for it.
4813
4814         * expression.cs (Conditional.DoResolve): Remove some old code that
4815         is no longer needed, conversions have been fixed.
4816
4817         (ArrayCreationExpression.DoResolve): Return false if we fail to
4818         resolve the inner expression.
4819
4820 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4821
4822         Fix test-290.cs.
4823         * cs-parser.jay (delegate_declaration): Record a delegate
4824         declaration as a type declaration.
4825         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4826
4827 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4828
4829         * parameter.cs: Do not crash if the type can not be resolved. 
4830
4831         * expression.cs: Report errors with unsafe pointers, fixes #64896
4832
4833 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4834
4835         * expression.cs: Pointer arith always needs to do a conv.i
4836         if the operand is a long. fix 65320
4837
4838 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4839
4840         Fixed cs0619-37.cs, cs0619-38.cs
4841
4842         * enum.cs (GetObsoleteAttribute): Removed.
4843
4844         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4845         on Enum member is double staged. The first is tested member
4846         and then enum.
4847
4848 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4849
4850         Fixed #56986, #63631, #65231
4851
4852         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4853         adds member to name container.
4854         (TypeContainer.AddToTypeContainer): New method, adds type to
4855         name container.
4856         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4857         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4858         AddOperator): Simplified by reusing AddToMemberContainer.
4859         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4860         instead of field.
4861         (Method.CheckForDuplications): Fixed implementation to test all
4862         possibilities.
4863         (MemberBase): Detection whether member is explicit interface
4864         implementation is now in constructor.
4865         (MemberBase.UpdateMemberName): Handles IndexerName.
4866         (Accessor): Changed to keep also location information.
4867         (AbstractPropertyEventMethod): Is derived from MemberCore.
4868         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4869         will be emited or not.
4870         (PropertyBase.AreAccessorsDuplicateImplementation):
4871         Tests whether accessors are not in collision with some method.
4872         (Operator): Is derived from MethodCore to simplify common
4873         operations.
4874
4875         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4876         must be performed.
4877         (DeclSpace.AddToContainer): Adds the member to defined_names
4878         table. It tests for duplications and enclosing name conflicts.
4879
4880         * enum.cs (EnumMember): Clean up to reuse the base structures
4881
4882 2004-09-03  Martin Baulig  <martin@ximian.com>
4883
4884         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4885         into TypeContainer, to make partial classes work again.
4886
4887 2004-09-03  Martin Baulig  <martin@ximian.com>
4888
4889         * rootcontext.cs (RootContext.V2): Removed.
4890
4891 2004-03-23  Martin Baulig  <martin@ximian.com>
4892
4893         * expression.cs (Invocation.OverloadResolve): Added `bool
4894         may_fail' argument and use it instead of the Location.IsNull() hack.
4895
4896 2004-09-03  Martin Baulig  <martin@ximian.com>
4897
4898         Merged latest changes into gmcs.  Please keep this comment in
4899         here, it makes it easier for me to see what changed in MCS since
4900         the last time I merged.
4901
4902 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4903
4904         Fix #61128.
4905         * expression.cs (BetterConversion): Don't allow either conversion 
4906         to be null.  Remove redundant implicit conversion test when 'q ==
4907         null' -- when this function is invoked, we already know that the
4908         implicit conversion exists.
4909         (BetterFunction): Assume that 'best' is non-null.  Remove
4910         redundant reimplementation of IsApplicable when 'best' is null.
4911         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4912         number of arguments.
4913         (IsAncestralType): Extract from OverloadResolve.
4914         (OverloadResolve): Make robust to the MethodGroupExpr being
4915         unsorted.  Implement all the logic of Section 14.5.5.1, and
4916         support overloading of methods from multiple applicable types.
4917         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4918
4919         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4920         (RealError, Warning): Append type of report to related symbol.
4921
4922 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4923
4924         * enum.cs: Fixed CLS-Compliance checks for enum members.
4925         Error tests cs3008-8.cs, cs3014-8.cs
4926
4927 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4928
4929         Fixed bug #62342, #63102
4930         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4931         like ImplementMethod.
4932
4933 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4934
4935         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4936         Fixed bug #65170.
4937
4938 2004-09-02  Martin Baulig  <martin@ximian.com>
4939
4940         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4941         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4942         on the MethodBase.
4943
4944 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4945
4946         C# 2.0 Static classes implemented
4947
4948         * class.cs (TypeContainer): instance_constructors,
4949         initialized_fields, initialized_static_fields,
4950         default_constructor, base_inteface_types are protected to be
4951         accessible from StaticClass.
4952         (TypeContainer.DefineDefaultConstructor): New virtual method
4953         for custom default constructor generating
4954         (StaticClass): New class to handle "Static classes" feature.
4955
4956         * cs-parser.jay: Handle static keyword on class like instance
4957         of StaticClass.
4958
4959         * driver.cs: Added "/langversion" command line switch with two
4960         options (iso-1, default).
4961
4962 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4963
4964         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4965
4966 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4967
4968         * delegate.cs: Style.
4969
4970 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4971
4972         * delegate.cs: Add seperate instance expr field for miguel.
4973
4974 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4975
4976         * PointerArithmetic (Resolve): make sure we are not doing
4977         pointer arith on void*. Also, make sure we are resolved
4978         by not setting eclass until resolve.
4979
4980         All callers: Make sure that PointerArithmetic gets resolved.
4981
4982 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4983
4984         * ArrayCreation (LookupType): If the type does not resolve 
4985         to an array, give an error.
4986
4987 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4988
4989         * statement.cs (Try.Resolve): Fixed bug #64222
4990
4991 2004-08-27  Martin Baulig  <martin@ximian.com>
4992
4993         * class.cs
4994         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4995         crash here.     
4996
4997 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4998
4999         * ecore.cs (Constantify): Get underlying type via
5000         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5001         Windows in special cases.
5002
5003 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5004
5005         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5006         for obtaining also private methods.
5007         (GetRemoveMethod): Used GetRemoveMethod (true)
5008         for obtaining also private methods.
5009
5010 2004-08-24  Martin Baulig  <martin@ximian.com>
5011
5012         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5013         MethodAttributes.HideBySig for operators.
5014
5015 2004-08-23  Martin Baulig  <martin@ximian.com>
5016
5017         Back to the old error reporting system :-)
5018
5019         * report.cs (Message): Removed.
5020         (Report.MessageData, ErrorData, WarningData): Removed.
5021         (Report.Error, Warning): Back to the old system.
5022
5023 2004-08-23  Martin Baulig  <martin@ximian.com>
5024
5025         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5026
5027         * class.cs (TypeContainer.ParentContainer): New public virtual
5028         method; replaces the explicit interface implementation.
5029         (ClassPart.ParentContainer): Override.
5030
5031 2004-08-23  Martin Baulig  <martin@ximian.com>
5032
5033         * statement.cs (Switch): Added support for constant switches; see
5034         #59428 or test-285.cs.
5035
5036 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5037
5038         Fixed bug #62740.
5039         * statement.cs (GetEnumeratorFilter): Removed useless
5040         logic because C# specs is strict. GetEnumerator must be
5041         public.
5042
5043 2004-08-22  Martin Baulig  <martin@ximian.com>
5044
5045         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5046         a switch and may break, reset the barrier.  Fixes #59867.
5047
5048 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5049
5050         CLS-Compliance speed up (~5% for corlib)
5051
5052         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5053         New method. Tests container for CLS-Compliant names
5054
5055         * class.cs (TypeContainer.VerifyClsName): New method.
5056         Checks whether container name is CLS Compliant.
5057         (Constructor): Implements IMethodData.
5058
5059         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5060         low-case table for CLS Compliance test.
5061         (MemberCache.VerifyClsParameterConflict): New method.
5062         Checks method parameters for CS3006 error.
5063
5064         * enum.cs (EnumMember): Is derived from MemberCore.
5065         (Enum.VerifyClsName): Optimized for better performance.
5066
5067 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5068
5069         * report.cs: Renamed Error_T to Error and changed all
5070         references.
5071
5072 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * class.cs (TypeContainer.IndexerArrayList): New inner class
5075         container for indexers.
5076         (TypeContainer.DefaultIndexerName): New constant for default
5077         indexer name. Replaced all "Item" with this constant.
5078         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5079
5080         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5081         DefaultMemberAttribute constructor.
5082
5083 2004-08-05  Martin Baulig  <martin@ximian.com>
5084
5085         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5086         Fix bug #59429.
5087
5088 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5089
5090         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5091         multi platforms problem.
5092
5093         * compiler.csproj: Included shared files.
5094
5095 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5096
5097         Fix bug 60333, 55971 in the more general way
5098         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5099         Added arg_type argument for constant conversion.
5100         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5101
5102 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5103
5104         Fix bug #59760
5105         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5106         OperatorArrayList, MethodCoreArrayList for typecontainer
5107         containers. Changed class member types to these new types.
5108         (MethodArrayList.DefineMembers): Added test for CS0659.
5109
5110 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5111
5112         * cfold.cs: Synchronize the folding with the code in expression.cs
5113         Binary.DoNumericPromotions for uint operands.
5114
5115         * attribute.cs: Revert patch from Raja, it introduced a regression
5116         while building Blam-1.2.1 (hard to isolate a test case).
5117
5118 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5119
5120         Fix for #55382
5121         * class.cs:
5122         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5123         name collision.
5124         (MethodCore.parent_method): New member. The method we're overriding
5125         if this is an override method.
5126         (MethodCore.CheckBase): Moved from Method class and made common.
5127         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5128         private.
5129         (MethodCore.CheckForDuplications): New abstract method. For custom
5130         member duplication search in a container
5131         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5132         method and its return type.
5133         (Event.conflict_symbol): New member. Symbol with same name in the
5134         parent class.
5135
5136         * decl.cs:
5137         (MemberCache.FindMemberWithSameName): New method. The method
5138         is looking for conflict with inherited symbols.
5139
5140 2004-08-04  Martin Baulig  <martin@ximian.com>
5141
5142         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5143
5144         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5145
5146 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5147
5148         * report.cs (Message): New enum for better error, warning reference in
5149         the code.
5150         (MessageData): New inner abstract class. It generally handles printing of
5151         error and warning messages.
5152         Removed unused Error, Warning, Message methods.
5153
5154 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5155
5156         Fix for cs0592-8.cs test
5157         * attribute.cs
5158         (Attributable.ValidAttributeTargets): Made public.
5159         (Attribute.ExplicitTarget): New member for explicit target value.
5160         (Attribute.CheckTargets): Now we translate explicit attribute
5161         target to Target here.
5162
5163 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5164
5165         * ecore.cs (MethodGroupExpr): new IsBase property.
5166
5167         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5168
5169         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5170         rather than an instance expr.
5171
5172         (DelegateCreation.Emit): Use the method group rather than
5173         the instance expression. Also, if you have base.Foo as the
5174         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5175
5176         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5177
5178         (NewDelegate.DoResolve): Only check for the existance of Invoke
5179         if the method is going to be needed. Use MethodGroupExpr.
5180
5181         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5182
5183         * expression.cs: For pointer arith., make sure to use
5184         the size of the type, not the size of the pointer to
5185         the type.
5186
5187 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5188
5189         Fix for #60722
5190         * class.cs (Class): Added error CS0502 test.
5191
5192 2004-08-03  John Luke  <jluke@cfl.rr.com>
5193             Raja R Harinath  <rharinath@novell.com>
5194
5195         Fix for #60997.
5196         * attribute.cs (Attribute.complained_before): New flag.
5197         (Attribute.ResolveType, Attribute.Resolve),
5198         (Attribute.DefinePInvokeMethod): Set it.
5199         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5200         
5201 2004-08-03  Martin Baulig  <martin@ximian.com>
5202
5203         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5204         use a user-defined operator; we still need to do numeric
5205         promotions in case one argument is a builtin type and the other
5206         one has an implicit conversion to that type.  Fixes #62322.
5207
5208 2004-08-02  Martin Baulig  <martin@ximian.com>
5209
5210         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5211         (LocalInfo.IsThis): New public property.
5212         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5213
5214 2004-08-01  Martin Baulig  <martin@ximian.com>
5215
5216         * class.cs (TypeContainer.GetClassBases): Don't set the default
5217         here since we may get called from GetPartialBases().
5218         (TypeContainer.DefineType): If GetClassBases() didn't return a
5219         parent, use the default one.
5220
5221 2004-07-30  Duncan Mak  <duncan@ximian.com>
5222
5223         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5224
5225 2004-07-30  Martin Baulig  <martin@ximian.com>
5226
5227         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5228
5229         * class.cs (SourceMethod): New public class, derive from the
5230         symbol writer's ISourceMethod.
5231         (Method): Use the new symbol writer API.
5232
5233         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5234         as argument and use the new symbol writer.
5235
5236         * location.cs
5237         (SourceFile): Implement the symbol writer's ISourceFile.
5238         (Location.SymbolDocument): Removed.
5239         (Location.SourceFile): New public property.
5240
5241         * symbolwriter.cs: Use the new symbol writer API.
5242
5243 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5244
5245         * Makefile (install-local): Remove.  Functionality moved to
5246         executable.make.
5247
5248 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5249
5250         * Makefile: Install mcs.exe.config file together with mcs.exe.
5251         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5252         correct runtime version.
5253         
5254 2004-07-25  Martin Baulig  <martin@ximian.com>
5255
5256         * class.cs
5257         (TypeContainer.RegisterOrder): Removed, this was unused.
5258         (TypeContainer, interface_order): Removed.
5259         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5260         TypeContainer as argument since we can also be called with a
5261         `PartialContainer' for a partial class/struct/interface.
5262         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5263         of checking whether we're an `Interface' - we could be a
5264         `PartialContainer'.
5265         (PartialContainer.Register): Override; call
5266         AddClass()/AddStruct()/AddInterface() on our parent.
5267
5268         * cs-parser.jay (interface_member_declaration): Add things to the
5269         `current_container', not the `current_class'.
5270
5271         * rootcontext.cs (RegisterOrder): The overloaded version which
5272         takes an `Interface' was unused, removed.
5273
5274         * typemanager.cs (TypeManager.LookupInterface): Return a
5275         `TypeContainer', not an `Interface'.
5276         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5277         contain a `PartialContainer' for an interface, so check it's
5278         `Kind' to figure out what it is.
5279
5280 2004-07-25  Martin Baulig  <martin@ximian.com>
5281
5282         * class.cs (Class.DefaultTypeAttributes): New public constant.
5283         (Struct.DefaultTypeAttributes): Likewise.
5284         (Interface.DefaultTypeAttributes): Likewise.
5285         (PartialContainer.TypeAttr): Override this and add the
5286         DefaultTypeAttributes.
5287
5288 2004-07-25  Martin Baulig  <martin@ximian.com>
5289
5290         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5291         we can just use the `Parent' field instead.
5292
5293 2004-07-25  Martin Baulig  <martin@ximian.com>
5294
5295         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5296
5297 2004-07-25  Martin Baulig  <martin@ximian.com>
5298
5299         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5300         our parts before defining any methods.
5301         (TypeContainer.VerifyImplements): Make this virtual.
5302         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5303         on our PartialContainer.
5304
5305 2004-07-25  Martin Baulig  <martin@ximian.com>
5306
5307         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5308
5309         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5310         argument, we can just use the `Parent' field instead.
5311
5312         * class.cs
5313         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5314         (MemberBase.DoDefine): Likewise.
5315
5316 2004-07-24  Martin Baulig  <martin@ximian.com>
5317
5318         * decl.cs (MemberCore.Parent): New public field.
5319         (DeclSpace.Parent): Moved to MemberCore.
5320
5321         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5322         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5323         parent's .ctor.
5324         (FieldBase, Field, Operator): Likewise.
5325         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5326         (EventField, Event): Likewise.
5327
5328 2004-07-23  Martin Baulig  <martin@ximian.com>
5329
5330         * class.cs (PartialContainer): New public class.
5331         (ClassPart): New public class.
5332         (TypeContainer): Added support for partial classes.
5333         (TypeContainer.GetClassBases): Splitted some of the functionality
5334         out into GetNormalBases() and GetPartialBases().
5335
5336         * cs-tokenizer.cs (Token.PARTIAL): New token.
5337         (Tokenizer.consume_identifier): Added some hacks to recognize
5338         `partial', but only if it's immediately followed by `class',
5339         `struct' or `interface'.
5340
5341         * cs-parser.jay: Added support for partial clases.
5342
5343 2004-07-23  Martin Baulig  <martin@ximian.com>
5344
5345         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5346         a `DeclSpace' and also made it readonly.
5347         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5348         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5349         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5350
5351         * cs-parser.jay: Pass the `current_class', not the
5352         `current_container' (at the moment, this is still the same thing)
5353         to a new Method, Property, Event, Indexer or Constructor.
5354
5355 2004-07-23  Martin Baulig  <martin@ximian.com>
5356
5357         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5358         and removed the `current_interface' one.
5359         (struct_declaration, class_declaration, interface_declaration):
5360         Set `current_class' to the newly created class/struct/interface;
5361         set their `Bases' and call Register() before parsing their body.
5362
5363 2004-07-23  Martin Baulig  <martin@ximian.com>
5364
5365         * class.cs (Kind): New public enum.
5366         (TypeContainer): Made this class abstract.
5367         (TypeContainer.Kind): New public readonly field.
5368         (TypeContainer.CheckDef): New public method; moved here from
5369         cs-parser.jay.
5370         (TypeContainer.Register): New public abstract method.
5371         (TypeContainer.GetPendingImplementations): New public abstract
5372         method.
5373         (TypeContainer.GetClassBases): Removed the `is_class' and
5374         `is_iface' parameters.
5375         (TypeContainer.DefineNestedTypes): Formerly known as
5376         DoDefineType().
5377         (ClassOrStruct): Made this class abstract.
5378
5379         * tree.cs (RootTypes): New public type. 
5380
5381 2004-07-20  Martin Baulig  <martin@ximian.com>
5382
5383         * tree.cs (Tree.RecordNamespace): Removed.
5384         (Tree.Namespaces): Removed.
5385
5386         * rootcontext.cs (RootContext.IsNamespace): Removed.
5387
5388         * cs-parser.jay (namespace_declaration): Just create a new
5389         NamespaceEntry here.
5390
5391 2004-07-20  Martin Baulig  <martin@ximian.com>
5392
5393         * statement.cs (ExceptionStatement): New abstract class.  This is
5394         now used as a base class for everyone who's using `finally'.
5395         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5396         our local variables before using them.
5397
5398         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5399         virtual method.  This is used by Yield.Resolve() to "steal" an
5400         outer block's `finally' clauses.
5401         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5402         argument.
5403
5404         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5405         version which takes an ExceptionStatement.  This version must be
5406         used to create exception branchings.
5407
5408         * iterator.cs
5409         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5410         (Iterator.EmitMoveNext): Added exception support; protect the
5411         block with a `fault' clause, properly handle 'finally' clauses.
5412         (Iterator.EmitDispose): Run all the `finally' clauses here.
5413
5414 2004-07-20  Martin Baulig  <martin@ximian.com>
5415
5416         * iterator.cs: This is the first of a set of changes in the
5417         iterator code.  Match the spec more closely: if we're an
5418         IEnumerable, then GetEnumerator() must be called.  The first time
5419         GetEnumerator() is called, it returns the current instance; all
5420         subsequent invocations (if any) must create a copy.
5421
5422 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5423
5424         * expression.cs: Resolve the constant expression before returning
5425         it. 
5426
5427 2004-07-19  Martin Baulig  <martin@ximian.com>
5428
5429         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5430         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5431         the return type of the new EmitContext.
5432
5433 2004-07-18  Martin Baulig  <martin@ximian.com>
5434
5435         * class.cs (Property.Define): Fix iterators.
5436
5437         * iterators.cs (Iterator.Define): Moved the
5438         `container.AddInterator (this)' call here from the .ctor; only do
5439         it if we resolved successfully.
5440
5441 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5442
5443         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5444         `true' for preprocessing directives that we parse.  The return
5445         value indicates whether we should return to regular tokenizing or
5446         not, not whether it was parsed successfully.
5447
5448         In the past if we were in: #if false ... #line #endif, we would
5449         resume parsing after `#line'.  See bug 61604.
5450
5451         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5452         building: IsEnumType should return true only for enums, not for
5453         enums or System.Enum itself.  This fixes #61593.
5454
5455         Likely what happened is that corlib was wrong: mcs depended on
5456         this bug in some places.  The bug got fixed, we had to add the
5457         hack, which caused bug 61593.
5458
5459         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5460         that was a workaround for the older conditions.
5461
5462 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5463
5464         * assign.cs: IAssignMethod has a new interface, as documented
5465         inline. All assignment code now uses this new api.
5466
5467         * ecore.cs, expression.cs: All classes which implement
5468         IAssignMethod now use the new interface.
5469
5470         * expression.cs (Invocation): add a hack to EmitCall so that
5471         IndexerAccess can be the target of a compound assignment without
5472         evaluating its arguments twice.
5473
5474         * statement.cs: Handle changes in Invocation api.
5475
5476 2004-07-16  Martin Baulig  <martin@ximian.com>
5477
5478         * iterators.cs: Rewrote this.  We're now using one single Proxy
5479         class for both the IEnumerable and the IEnumerator interface and
5480         `Iterator' derives from Class so we can use the high-level API.
5481
5482         * class.cs (TypeContainer.AddIterator): New method.
5483         (TypeContainer.DoDefineType): New protected virtual method, which
5484         is called from DefineType().
5485         (TypeContainer.DoDefineMembers): Call DefineType() and
5486         DefineMembers() on all our iterators.
5487         (TypeContainer.Emit): Call Emit() on all our iterators.
5488         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5489
5490         * codegen.cs (EmitContext.CurrentIterator): New public field.
5491
5492 2004-07-15  Martin Baulig  <martin@ximian.com>
5493
5494         * typemanager.cs
5495         (TypeManager.not_supported_exception_type): New type.   
5496
5497 2004-07-14  Martin Baulig  <martin@ximian.com>
5498
5499         * iterators.cs: Use real error numbers.
5500
5501 2004-07-14  Martin Baulig  <martin@ximian.com>
5502
5503         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5504         requires this to be a System.Collection.IEnumerable and not a
5505         class implementing that interface.
5506         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5507
5508 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5509
5510         * class.cs: Fixed previous fix, it broke some error tests.
5511
5512 2004-07-12  Martin Baulig  <martin@ximian.com>
5513
5514         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5515         Fixes #61293.
5516
5517 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5518
5519         * assign.cs (LocalTemporary): Add new argument: is_address,If
5520         `is_address' is true, then the value that we store is the address
5521         to the real value, and not the value itself.
5522         
5523         * ecore.cs (PropertyExpr): use the new local temporary
5524         stuff to allow us to handle X.Y += z (where X is a struct)
5525
5526 2004-07-08  Martin Baulig  <martin@ximian.com>
5527
5528         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5529         not always return, just like we're doing in Using.Resolve().
5530
5531 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5532
5533         * cs-parser.jay (fixed_statement): flag this as Pinned.
5534
5535 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5536
5537         * typemanager.cs (TypeManager): Removed MakePinned method, this
5538         mechanism is replaced with the .NET 2.x compatible mechanism of
5539         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5540
5541         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5542         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5543         `IsFixed' property which has a different meaning.
5544
5545 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5546
5547         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5548         visible from inside a nested class, not just the names of the
5549         immediately enclosing class.
5550         Fix for bug #60730.
5551
5552 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5553
5554         * expression.cs (BetterConversion): Remove buggy special-case
5555         handling of "implicit constant expression conversions".  At this
5556         point, we already know that the conversion is possible -- we're
5557         only checking to see which is better.
5558
5559 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5560
5561         * cs-parser.jay: Added error CS0210 test.
5562
5563 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5564
5565         * cs-parser.jay: Added error CS0134 test.
5566
5567 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5568
5569         Fix bug #52507
5570         * cs-parser.jay: Added error CS0145 test.
5571
5572 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5573
5574         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5575
5576 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5577         
5578         * expression.cs (StackAlloc.Resolve): The argument may not
5579         be a constant; deal with this case.
5580         
5581 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5582
5583         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5584         GetIndexerAttributeValue.
5585         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5586
5587         * class.cs (Indexer.Define): Added error tests for CS0415,
5588         CS0609.
5589
5590 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5591
5592         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5593         property code.
5594
5595 2004-06-23  Martin Baulig  <martin@ximian.com>
5596
5597         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5598         neither return nor throw, reset the barrier as well.  Fixes #60457.
5599
5600 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5601
5602         * class.cs : EventAttributes is now set to None by default.
5603           This fixes bug #60459.
5604
5605 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5606
5607         Fix bug #60219
5608         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5609         Don't throw exception but return null (it's sufficient now).
5610
5611 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5612
5613         * typemanager.cs (GetArgumentTypes): Faster implementation.
5614
5615 2004-06-18  Martin Baulig  <martin@ximian.com>
5616
5617         * attribute.cs (Attribute.Resolve): Check whether we're an
5618         EmptyCast which a Constant child.  Fixes #60333.
5619
5620 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5621
5622         * statement.cs (EmitCollectionForeach): Account for the fact that
5623         not all valuetypes are in areas which we can take the address of.
5624         For these variables, we store to a temporary variable. Also, make
5625         sure that we dont emit a `callvirt' on a valuetype method.
5626
5627 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5628
5629         * expression.cs (StackAlloc.DoReSolve): Added test for
5630         negative parameter (CS0247).
5631
5632 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5633
5634         Fix bug #59792
5635         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5636
5637 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5638
5639         Fix bug #59781
5640         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5641         ulong.
5642
5643 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5644
5645         Fix bug #58254 & cs1555.cs, cs1556.cs
5646         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5647
5648 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5649
5650         * cs-parser.jay: Added error CS1669 test for indexers.
5651
5652 2004-06-11  Martin Baulig  <martin@ximian.com>
5653
5654         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5655         call this twice: for params and varargs methods.
5656
5657 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5658
5659         * class.cs:
5660         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5661
5662 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * attribute.cs (Attribute.GetValidTargets): Made public.
5665
5666         * class.cs: 
5667         (AbstractPropertyEventMethod): New class for better code sharing.
5668         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5669         CS1667 report.
5670         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5671
5672 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5673
5674         Fix bug #59477.
5675         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5676         that the call to Resolve is part of a MemberAccess.
5677         (Expression.Resolve): Use it for SimpleName resolution.
5678         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5679         Add 'intermediate' boolean argument.
5680         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5681         error message when the SimpleName can be resolved ambiguously
5682         between an expression and a type.
5683         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5684         public.
5685         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5686         call on the left-side.
5687
5688 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5689
5690         * class.cs:
5691         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5692
5693 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5694
5695         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5696
5697 2004-06-11  Martin Baulig  <martin@ximian.com>
5698
5699         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5700         varargs methods if applicable.
5701
5702 2004-06-11  Martin Baulig  <martin@ximian.com>
5703
5704         * expression.cs (Invocation.EmitCall): Don't use
5705         `method.CallingConvention == CallingConventions.VarArgs' since the
5706         method could also have `CallingConventions.HasThis'.
5707
5708 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5709
5710         * class.cs (Event.GetSignatureForError): Implemented.
5711         Fixed crash in error test cs3010.cs
5712
5713 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5714
5715         * cs-tokenizer.cs: Change the way we track __arglist to be
5716         consistent with the other keywords.
5717
5718 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5719
5720         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5721         tomorrow.
5722
5723 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5724
5725         * codegen.cs: Check that all referenced assemblies have a strongname
5726         before strongnaming the compiled assembly. If not report error CS1577.
5727         Fix bug #56563. Patch by Jackson Harper.
5728         * typemanager.cs: Added a method to return all referenced assemblies.
5729         Fix bug #56563. Patch by Jackson Harper.
5730
5731 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5732
5733         * class.cs:
5734         (Method.ApplyAttributeBuilder): Moved and added conditional
5735         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5736
5737         * delegate.cs:
5738         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5739
5740 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5741
5742         Fixed #59640
5743         * class.cs: (EventField.attribute_targets): Changed default target.
5744
5745 2004-06-08  Martin Baulig  <martin@ximian.com>
5746
5747         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5748
5749 2004-06-08  Martin Baulig  <martin@ximian.com>
5750
5751         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5752
5753 2004-06-07  Martin Baulig  <martin@ximian.com>
5754
5755         Added support for varargs methods.
5756
5757         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5758         keyword.
5759
5760         * cs-parser.jay: Added support for `__arglist'.
5761
5762         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5763
5764         * expression.cs (Argument.AType): Added `ArgList'.
5765         (Invocation): Added support for varargs methods.
5766         (ArglistAccess): New public class.
5767         (Arglist): New public class.
5768
5769         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5770
5771         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5772         a method's top-level block if the method has varargs.
5773
5774         * support.cs (ReflectionParameters, InternalParameters): Added
5775         support for varargs methods.    
5776
5777 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5778
5779         * class.cs: Provide location in indexer error report.
5780
5781         * driver.cs: Use standard names.
5782
5783         * namespace.cs: Catch the use of using after a namespace has been
5784         declared also on using aliases.
5785
5786 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5787
5788         Bug #50820.
5789         * typemanager.cs (closure_private_ok, closure_invocation_type)
5790         (closure_qualifier_type, closure_invocation_assembly)
5791         (FilterWithClosure): Move to ...
5792         (Closure): New internal nested class.
5793         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5794         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5795         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5796         (MemberLookup, MemberLookupFailed): Use it.
5797         * expression.cs (New.DoResolve): Treat the lookup for the
5798         constructor as being qualified by the 'new'ed type.
5799         (Indexers.GetIndexersForTypeOrInterface): Update.
5800
5801 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5802
5803         * attribute.cs
5804         (GetConditionalAttributeValue): New method. Returns
5805         condition of ConditionalAttribute.
5806         (SearchMulti): New method.  Returns all attributes of type 't'.
5807         Use it when attribute is AllowMultiple = true.
5808         (IsConditionalMethodExcluded): New method.
5809
5810         * class.cs
5811         (Method.IsExcluded): Implemented. Returns true if method has conditional
5812         attribute and the conditions is not defined (method is excluded).
5813         (IMethodData): Extended interface for ConditionalAttribute support.
5814         (PropertyMethod.IsExcluded): Implemented.
5815
5816         * decl.cs
5817         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5818
5819         * expression.cs
5820         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5821         on the method.
5822
5823 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5824
5825         * expression.cs (ArrayCreationExpression): Make this just an
5826         `expression'. It can't be a statement, so the code here was
5827         dead.
5828
5829 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5830
5831         Fixed #59072
5832         * typemanager.cs (GetFullNameSignature): New method for
5833         MethodBase types.
5834
5835 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5836
5837         Fixed #56452
5838         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5839         Use this method when MethodBuilder is null.
5840         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5841         Added test for error CS0626 (MONO reports error for this situation).
5842         (IMethodData.GetSignatureForError): Extended interface.
5843
5844 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5845
5846         * attribute.cs
5847         (AttributeTester.GetObsoleteAttribute): Returns instance of
5848         ObsoleteAttribute when type is obsolete.
5849
5850         * class.cs
5851         (TypeContainer.VerifyObsoleteAttribute): Override.
5852         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5853         (MethodCode.VerifyObsoleteAttribute): Override.
5854         (MemberBase.VerifyObsoleteAttribute): Override.
5855
5856         * decl.cs
5857         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5858         and report proper error.
5859
5860         *delegate.cs
5861         Delegate.VerifyObsoleteAttribute): Override.
5862
5863         * ecore.cs
5864         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5865         and report proper error.
5866         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5867
5868         * enum.cs
5869         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5870         and enum member.
5871
5872         * expression.cs
5873         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5874         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5875         Added test for ObsoleteAttribute.
5876
5877         * statement.cs
5878         (Catch): Derived from Statement.
5879
5880 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5881  
5882         Fixed bug #59071 & cs0160.cs
5883  
5884         * statement.cs (Try.Resolve): Check here whether order of catch
5885         clauses matches their dependencies.
5886
5887 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5888
5889         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5890         caused a regression: #59343.  Referencing nested classes from an
5891         assembly stopped working.
5892
5893 2004-05-31  Martin Baulig  <martin@ximian.com>
5894
5895         MCS is now frozen for beta 2.
5896
5897 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5898
5899         * convert.cs: add a trivial cache for overload operator resolution.
5900
5901 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5902
5903         * decl.cs: If possible, use lookuptypedirect here. We can only do
5904         this if there is no `.' after the namespace. Avoids using
5905         LookupType, which does lots of slow processing.
5906         (FindNestedType) New method, does what it says :-).
5907         * namespace.cs: use LookupTypeDirect.
5908         * rootcontext.cs: use membercache, if possible.
5909         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5910
5911 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5912
5913         * expression.cs:
5914         According to the spec, 
5915
5916         In a member access of the form E.I, if E is a single identifier,
5917         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5918         field, property, localvariable, or parameter with the same type as
5919         the meaning of E as a type-name (§3.8), then both possible
5920         meanings of E are permitted.
5921
5922         We did not check that E as a simple-name had the same type as E as
5923         a type name.
5924
5925         This trivial check gives us 5-7% on bootstrap time.
5926
5927 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5928
5929         * expression.cs (Invocation.OverloadResolve): Avoid the
5930         use of hashtables and boxing here by allocating on demand.
5931
5932 2004-05-30  Martin Baulig  <martin@ximian.com>
5933
5934         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5935         we're doing a silent lookup.  Don't try to lookup nested types in
5936         TypeManager.object_type (thanks to Ben Maurer).
5937
5938 2004-05-30  Martin Baulig  <martin@ximian.com>
5939
5940         Committing a patch from Ben Maurer.
5941
5942         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5943
5944 2004-05-29  Martin Baulig  <martin@ximian.com>
5945
5946         * class.cs (IMethodData.ShouldIgnore): New method.
5947
5948         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5949         `Location' argument, we don't need it anywhere.  Use
5950         `IMethodData.ShouldIgnore ()' instead of
5951         `MethodData.GetMethodFlags ()'.
5952         (TypeManager.AddMethod): Removed.
5953         (TypeManager.AddMethod2): Renamed to AddMethod.
5954
5955 2004-05-29  Martin Baulig  <martin@ximian.com>
5956
5957         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5958
5959         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5960         converting from a class type S to an interface type and we already
5961         have an object on the stack, don't box it again.  Fixes #52578.
5962
5963 2004-05-29  Martin Baulig  <martin@ximian.com>
5964
5965         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5966         Added support for `params' parameters.  Fixes #59267.
5967
5968 2004-05-29  Martin Baulig  <martin@ximian.com>
5969
5970         * literal.cs (NullPointer): Provide a private .ctor which sets
5971         `type' to TypeManager.object_type.  Fixes #59048.
5972
5973 2004-05-29  Martin Baulig  <martin@ximian.com>
5974
5975         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5976         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5977
5978         * ecore.cs (EventExpr.instance_expr): Make the field private.
5979
5980 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5981
5982         Fixed bug #50080 & cs0214-2.cs
5983         * expression.cs (Cast.DoResolve): Check unsafe context here.
5984         
5985         * statement.cs (Resolve.DoResolve): Likewise.
5986
5987 2004-05-26  Martin Baulig  <martin@ximian.com>
5988
5989         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5990
5991         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5992         (RootContext.LookupType): Pass down the `silent' flag.
5993
5994 2004-05-25  Martin Baulig  <martin@ximian.com>
5995
5996         * expression.cs
5997         (MethodGroupExpr.IdenticalTypeName): New public property.
5998         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5999         expression actually refers to a type.
6000
6001 2004-05-25  Martin Baulig  <martin@ximian.com>
6002
6003         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6004         for #56176 and made it actually work.
6005
6006 2004-05-25  Martin Baulig  <martin@ximian.com>
6007
6008         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6009         (FieldExpr, PropertyExpr): Override and implement
6010         CacheTemporaries.  Fixes #52279.
6011
6012 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6013
6014         * location.cs: In the new compiler listing a file twice is a
6015         warning, not an error.
6016
6017 2004-05-24  Martin Baulig  <martin@ximian.com>
6018
6019         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6020         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6021
6022 2004-05-24  Martin Baulig  <martin@ximian.com>
6023
6024         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6025         walking the `using' list.  Fixes #53921.
6026
6027 2004-05-24  Martin Baulig  <martin@ximian.com>
6028
6029         * const.cs (Const.LookupConstantValue): Added support for
6030         EmptyCast's; fixes #55251.
6031
6032 2004-05-24  Martin Baulig  <martin@ximian.com>
6033
6034         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6035         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6036         which does the CS0135 check.  The reason is that we first need to
6037         check whether the variable actually exists.
6038
6039 2004-05-24  Martin Baulig  <martin@ximian.com>
6040
6041         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6042         than RootContext.LookupType() to find the explicit interface
6043         type.  Fixes #58584.
6044
6045 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6046
6047         * Makefile: Simplify.  Use executable.make.
6048         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6049
6050 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6051
6052         * decl.cs:
6053         * enum.cs:
6054         Use the invariant culture when doing String.Compare for CLS case
6055         sensitivity.
6056         
6057 2004-05-23  Martin Baulig  <martin@ximian.com>
6058
6059         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6060         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6061
6062         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6063         
6064 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6065
6066         * class.cs (MemberBase.Define): Reuse MemberType member for 
6067         resolved type. Other methods can use it too.
6068
6069 2004-05-23  Martin Baulig  <martin@ximian.com>
6070
6071         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6072         the variable also exists in the current block (otherwise, we need
6073         to report a CS0103).  Fixes #58670.
6074
6075 2004-05-23  Martin Baulig  <martin@ximian.com>
6076
6077         * flowanalysis.cs (Reachability.Reachable): Compute this
6078         on-the-fly rather than storing it as a field.
6079
6080 2004-05-23  Martin Baulig  <martin@ximian.com>
6081
6082         * flowanalysis.cs (Reachability.And): Manually compute the
6083         resulting `barrier' from the reachability.      
6084        
6085 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6086
6087         Fix bug #57835
6088         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6089         instance of ObsoleteAttribute when symbol is obsolete.
6090
6091         * class.cs
6092         (IMethodData): Extended interface for ObsoleteAttribute support.
6093
6094 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6095
6096         * attribute.cs: Fix bug #55970
6097
6098 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6099
6100         Fix bug #52705
6101         * attribute.cs
6102         (GetObsoleteAttribute): New method. Creates the instance of
6103         ObsoleteAttribute.
6104         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6105         ObsoleteAttribute when member is obsolete.
6106         (AttributeTester.Report_ObsoleteMessage): Common method for
6107         Obsolete error/warning reporting.
6108
6109         * class.cs
6110         (TypeContainer.base_classs_type): New member for storing parent type.
6111
6112         * decl.cs
6113         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6114         for this MemberCore.
6115
6116 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6117
6118         * attribute.cs, const.cs: Fix bug #58590
6119
6120 2004-05-21  Martin Baulig  <martin@ximian.com>
6121
6122         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6123         out parameters if the end of the method is unreachable.  Fixes
6124         #58098. 
6125
6126 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6127
6128         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6129         Hari was right, why extra method.
6130
6131 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6132
6133         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6134
6135 2004-05-20  Martin Baulig  <martin@ximian.com>
6136
6137         Merged this back from gmcs to keep the differences to a minumum.
6138
6139         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6140         instead of a Declspace.
6141         (Attribute.ResolveType): Likewise.
6142         (Attributes.Search): Likewise.
6143         (Attributes.Contains): Likewise.
6144         (Attributes.GetClsCompliantAttribute): Likewise.
6145
6146         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6147         argument.
6148         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6149         DeclSpace.
6150
6151 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6152
6153         Fix bug #58688 (MCS does not report error when the same attribute
6154         is assigned twice)
6155
6156         * attribute.cs (Attribute.Emit): Distinction between null and default.
6157
6158 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6159
6160         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6161         of a top-level attribute without an attribute target.
6162         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6163         Make non-static.
6164         (Attribute.Conditional_GetConditionName), 
6165         (Attribute.Obsolete_GetObsoleteMessage): Update.
6166         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6167         part of ScanForIndexerName.
6168         (Attribute.CanIgnoreInvalidAttribute): New function.
6169         (Attribute.ScanForIndexerName): Move to ...
6170         (Attributes.ScanForIndexerName): ... here.
6171         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6172         (Attributes.Search): New internal variant that can choose not to
6173         complain if types aren't resolved.  The original signature now
6174         complains.
6175         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6176         complaints suppressed.
6177         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6178         only if it not useful.
6179         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6180         top-level for attributes that are shared between the assembly
6181         and a top-level class.
6182         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6183         * class.cs: Update to reflect changes.
6184         (DefineIndexers): Fuse loops.
6185         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6186         a couple more variants of attribute names.
6187
6188 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6189
6190         Fix bug #52585 (Implemented explicit attribute declaration)
6191
6192         * attribute.cs:
6193         (Attributable.ValidAttributeTargets): New abstract method. It gets
6194         list of valid attribute targets for explicit target declaration.
6195         (Attribute.Target): It holds target itself.
6196         (AttributeSection): Removed.
6197         (Attribute.CheckTargets): New method. It checks whether attribute
6198         target is valid for the current element.
6199
6200         * class.cs:
6201         (EventProperty): New class. For events that are declared like
6202         property (with add and remove accessors).
6203         (EventField): New class. For events that are declared like field.
6204         class.cs
6205
6206         * cs-parser.jay: Implemented explicit attribute target declaration.
6207
6208         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6209         Override ValidAttributeTargets.
6210
6211         * parameter.cs:
6212         (ReturnParameter): Class for applying custom attributes on 
6213         the return type.
6214         (ParameterAtribute): New class. Class for applying custom
6215         attributes on the parameter type.
6216
6217 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6218
6219         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6220         definitions. 
6221
6222         (Method): Allow UNSAFE here.
6223
6224         * modifiers.cs: Support unsafe reporting.
6225
6226 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6227
6228         * decl.cs: Fix bug #58478.
6229
6230 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6231
6232         * statement.cs: When checking for unreachable code on an EmptyStatement,
6233         set the location. Fixes bug #58488.
6234
6235 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6236
6237         * driver.cs: Add -pkg handling.
6238
6239         From Gonzalo: UseShelLExecute=false
6240
6241 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6242
6243         * attribute.cs:
6244         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6245         for attribute.
6246         (Attribute.IsClsCompliaceRequired): Moved to base for better
6247         accesibility.
6248         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6249         when attribute is AttributeUsageAttribute.
6250         (Attribute.GetValidTargets): Simplified.
6251         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6252         attribute for this type.
6253         (Attribute.ApplyAttributes): Method renamed to Emit and make
6254         non-static.
6255         (GlobalAttributeSection): New class for special handling of global
6256         attributes (assembly, module).
6257         (AttributeSection.Emit): New method.
6258
6259         * class.cs: Implemented Attributable abstract methods.
6260         (MethodCore.LabelParameters): Moved to Parameter class.
6261         (Accessor): Is back simple class.
6262         (PropertyMethod): Implemented Attributable abstract class.
6263         (DelegateMethod): Implemented Attributable abstract class.
6264         (Event): New constructor for disctintion between normal Event
6265         and Event with accessors.
6266
6267         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6268
6269         * codegen.cs, const.cs, decl.cs, delegate.cs:
6270         (CommonAssemblyModulClass): Implemented Attributable abstract class
6271         and simplified.
6272
6273         * enum.cs: Implement IAttributeSupport interface.
6274         (EnumMember): New class for emum members. Implemented Attributable
6275         abstract class
6276
6277         * parameter.cs:
6278         (ParameterBase): Is abstract.
6279         (ReturnParameter): New class for easier [return:] attribute handling.
6280
6281         * typemanager.cs: Removed builder_to_attr.
6282
6283 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6284
6285         Fix bug #57151.
6286         * attribute.cs (Attribute.GetPositionalValue): New function.
6287         * class.cs (TypeContainer.VerifyMembers): New function.
6288         (TypeContainer.Emit): Use it.
6289         (ClassOrStruct): New base class for Class and Struct.
6290         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6291         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6292         class.
6293         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6294         then each non-static field should have a FieldOffset attribute.
6295         Otherwise, none of the fields should have a FieldOffset attribute.
6296         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6297         and FieldOffset attributes.
6298         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6299         (TypeManager.field_offset_attribute_type): New core types.
6300         (TypeManager.InitCoreTypes): Initialize them.
6301
6302 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6303
6304         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6305         Return correct type.
6306         From bug #58270.
6307
6308 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6309
6310         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6311         be implicitly converted to ulong.
6312         
6313         * expression.cs: The logic for allowing operator &, | and ^ worked
6314         was wrong, it worked before because we did not report an error in
6315         an else branch.  Fixes 57895.
6316
6317         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6318         allow volatile fields to be reference types.
6319
6320 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6321
6322         * driver.cs: Add support for /debug-
6323
6324 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6325
6326         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6327         Add a 'complain' parameter to silence errors.
6328         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6329         silently overlooked type-resolutions.
6330         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6331         to reflect changes.
6332         (Attributes.Search): New function.
6333         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6334         (Attributes.GetAttributeFullName): Remove hack.
6335         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6336         Update to reflect changes.
6337         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6338         Use Attributes.Search instead of nested loops.
6339
6340 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6341
6342         * decl.cs:
6343         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6344         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6345         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6346
6347         * report.cs: (Report.Warning): Renamed to Warning_T because of
6348         parameter collision.
6349
6350 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6351
6352         * expression.cs (MemberAccess.ResolveMemberAccess):
6353         Exit with non-zero status after Report.Error.
6354         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6355         Likewise.
6356         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6357
6358 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6359
6360         * support.cs: Don't hang when the file is empty.
6361
6362 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6363
6364         * support.cs: In SeekableStreamReader, compute the preamble size of the
6365           underlying stream. Position changes should take into account that initial
6366           count of bytes.
6367
6368 2004-05-03  Todd Berman  <tberman@sevenl.net>
6369
6370         * driver.cs: remove unused GetSysVersion function.
6371
6372 2004-05-03  Todd Berman  <tberman@sevenl.net>
6373
6374         * driver.cs: Remove the hack from saturday, as well as the hack
6375         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6376         link_paths to get that bit proper.
6377
6378 2004-05-01  Todd Berman  <tberman@sevenl.net>
6379
6380         * driver.cs: Try a LoadFrom before a Load, this checks the current
6381         path. This is currently a bug in mono that is be fixed, however, this
6382         provides a workaround for now. This will be removed when the bug
6383         is fixed.
6384
6385 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6386
6387         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6388         incomplete key pairs (#57941).
6389
6390 2004-05-01  Todd Berman  <tberman@sevenl.net>
6391
6392         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6393         from the GAC
6394
6395 2004-04-30  Jackson Harper  <jackson@ximian.com>
6396
6397         * codegen.cs: Open keys readonly.
6398         
6399 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6400
6401         * typemanager.cs: don't report cyclic struct layout when a struct
6402         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6403         which has 2 Pango.Rectangle fields.
6404
6405 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6406
6407         * expression.cs: Handle IntPtr comparisons with IL code
6408         rather than a method call.
6409
6410 2004-04-29  Martin Baulig  <martin@ximian.com>
6411
6412         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6413         the list of PropertyInfo's in class hierarchy and find the
6414         accessor.  Fixes #56013.
6415
6416 2004-04-29  Martin Baulig  <martin@ximian.com>
6417
6418         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6419
6420 2004-04-29  Martin Baulig  <martin@ximian.com>
6421
6422         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6423
6424         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6425
6426 2004-04-29  Martin Baulig  <martin@ximian.com>
6427
6428         * class.cs (ConstructorInitializer.Resolve): Check whether the
6429         parent .ctor is accessible.  Fixes #52146.
6430
6431 2004-04-29  Martin Baulig  <martin@ximian.com>
6432
6433         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6434
6435         * statement.cs (Using.EmitLocalVariableDecls): Use
6436         TypeManager.idisposable_type, not typeof (IDisposable).
6437         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6438
6439 2004-04-29  Martin Baulig  <martin@ximian.com>
6440
6441         * class.cs (Event.Define): Don't emit the field and don't set
6442         RTSpecialName and SpecialName for events on interfaces.  Fixes
6443         #57703. 
6444
6445 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6446
6447         Refactor Attribute.ApplyAttributes.
6448         * attribute.cs (Attributable): New base class for objects that can
6449         have Attributes applied on them.
6450         (Attribute): Make AttributeUsage fields public.
6451         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6452         (Attribute.IsInternalCall): New property.
6453         (Attribute.UsageAttr): Convert to a public read-only property.
6454         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6455         (Attribute.ResolveType, Attribute.Resolve)
6456         (Attribute.ScanForIndexerName): Update to reflect changes.
6457         (Attribute.CheckAttributeTarget): Re-format.
6458         (Attribute.ApplyAttributes): Refactor, to various
6459         Attributable.ApplyAttributeBuilder methods.
6460         * decl.cs (MemberCore): Make Attributable.
6461         * class.cs (Accessor): Make Attributable.
6462         (MethodData.ApplyAttributes): Use proper attribute types, not
6463         attribute names.
6464         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6465         (TypeContainer.ApplyAttributeBuilder)
6466         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6467         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6468         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6469         (Operator.ApplyAttributeBuilder): New factored-out methods.
6470         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6471         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6472         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6473         * parameter.cs (ParameterBase): New Attributable base class
6474         that can also represent Return types.
6475         (Parameter): Update to the changes.
6476
6477 2004-04-29  Jackson Harper  <jackson@ximian.com>
6478
6479         * driver.cs: Prefer the corlib system version when looking for
6480         assemblies in the GAC. This is still a hack, but its a better hack
6481         now.
6482         
6483 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6484
6485         * decl.cs, enum.cs: Improved error 3005 reporting.
6486   
6487         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6488         (related_symbols): New private member for list of symbols
6489         related to reported error/warning.
6490         
6491         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6492
6493 2004-04-29  Martin Baulig  <martin@ximian.com>
6494
6495         * ecore.cs (Expression.Constantify): If we're an enum and
6496         TypeManager.TypeToCoreType() doesn't give us another type, use
6497         t.UnderlyingSystemType.  Fixes #56178.  
6498
6499 2004-04-29  Martin Baulig  <martin@ximian.com>
6500
6501         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6502         interfaces and for each interface, only add members directly
6503         declared in that interface.  Fixes #53255.
6504
6505 2004-04-28  Martin Baulig  <martin@ximian.com>
6506
6507         * expression.cs (ConditionalLogicalOperator): Use a temporary
6508         variable for `left' to avoid that we evaluate it more than once;
6509         bug #52588.
6510
6511 2004-04-28  Martin Baulig  <martin@ximian.com>
6512
6513         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6514         `void[]' (CS1547).
6515
6516 2004-04-28  Martin Baulig  <martin@ximian.com>
6517
6518         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6519         void (CS1547).
6520
6521         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6522         whether the type is not void (CS1547).
6523
6524 2004-04-28  Martin Baulig  <martin@ximian.com>
6525
6526         * expression.cs (Unary.DoResolveLValue): Override this and report
6527         CS0131 for anything but Operator.Indirection.
6528
6529 2004-04-28  Martin Baulig  <martin@ximian.com>
6530
6531         Committing a patch from Ben Maurer; see bug #50820.
6532
6533         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6534         check for classes.
6535
6536         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6537         classes.        
6538
6539 2004-04-28  Martin Baulig  <martin@ximian.com>
6540
6541         Committing a patch from Ben Maurer; see bug #50820.
6542
6543         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6544         check for classes.
6545
6546         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6547         classes.        
6548
6549 2004-04-28  Martin Baulig  <martin@ximian.com>
6550
6551         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6552         (Block.AddLabel): Call DoLookupLabel() to only search in the
6553         current block.
6554
6555 2004-04-28  Martin Baulig  <martin@ximian.com>
6556
6557         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6558         comparing StringConstants and NullLiterals in Equality and Inequality.
6559
6560 2004-04-28  Jackson Harper  <jackson@ximian.com>
6561
6562         * driver.cs: Attempt to load referenced assemblies from the
6563         GAC. This is the quick and dirty version of this method that
6564         doesnt take into account versions and just takes the first
6565         canidate found. Will be good enough for now as we will not have more
6566         then one version installed into the GAC until I update this method.
6567
6568 2004-04-28  Martin Baulig  <martin@ximian.com>
6569
6570         * typemanager.cs (TypeManager.CheckStructCycles): New public
6571         static method to check for cycles in the struct layout.
6572
6573         * rootcontext.cs (RootContext.PopulateTypes): Call
6574         TypeManager.CheckStructCycles() for each TypeContainer.
6575         [Note: We only need to visit each type once.]
6576
6577 2004-04-28  Martin Baulig  <martin@ximian.com>
6578
6579         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6580
6581         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6582         success and added `out object value'.  Use a `bool resolved' field
6583         to check whether we've already been called rather than
6584         `ConstantValue != null' since this breaks for NullLiterals.
6585
6586 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6587
6588         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6589         setting of this flag, since the 'set' method may be non-public.
6590
6591 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6592
6593         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6594         check on current_vector.Block.
6595
6596 2004-04-27  Martin Baulig  <martin@ximian.com>
6597
6598         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6599         a field initializer.  Fixes #56459.
6600
6601 2004-04-27  Martin Baulig  <martin@ximian.com>
6602
6603         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6604         we're not attempting to use an indexer.  Fixes #52154.
6605
6606 2004-04-27  Martin Baulig  <martin@ximian.com>
6607
6608         * statement.cs (Return): Don't create a return label if we don't
6609         need it; reverts my change from January 20th.  Thanks to Ben
6610         Maurer for this.
6611
6612 2004-04-27  Martin Baulig  <martin@ximian.com>
6613
6614         According to the spec, `goto' can only leave a nested scope, but
6615         never enter it.
6616
6617         * statement.cs (Block.LookupLabel): Only lookup in the current
6618         block, don't recurse into parent or child blocks.
6619         (Block.AddLabel): Check in parent and child blocks, report
6620         CS0140/CS0158 if we find a duplicate.
6621         (Block): Removed this indexer for label lookups.
6622         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6623         this already does the error reporting for us.
6624
6625         * flowanalysis.cs
6626         (FlowBranching.UsageVector.Block): New public variable; may be null.
6627         (FlowBranching.CreateSibling): Added `Block' argument.
6628         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6629         label for the target of a `goto' and check whether we're not
6630         leaving a `finally'.
6631
6632 2004-04-27  Martin Baulig  <martin@ximian.com>
6633
6634         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6635         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6636         just for returns).
6637
6638 2004-04-27  Martin Baulig  <martin@ximian.com>
6639
6640         * statement.cs (Block.AddLabel): Also check for implicit blocks
6641         and added a CS0158 check.
6642
6643 2004-04-27  Martin Baulig  <martin@ximian.com>
6644
6645         * flowanalysis.cs (FlowBranchingLoop): New class.
6646         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6647         UsageVector's instead of an ArrayList.
6648         (FlowBranching.Label): Likewise.
6649         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6650         (FlowBranching.AddBreakVector): New method.
6651
6652 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6653
6654         * attribute.cs: Small regression fix: only convert the type if we
6655         the type is different, fixes System.Drawing build.
6656
6657 2004-04-27  Martin Baulig  <martin@ximian.com>
6658
6659         * attribute.cs (Attribute.Resolve): If we have a constant value
6660         for a named field or property, implicity convert it to the correct
6661         type.
6662
6663 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6664
6665         * statement.cs (Block.Block): Implicit blocks share
6666         'child_variable_names' fields with parent blocks.
6667         (Block.AddChildVariableNames): Remove.
6668         (Block.AddVariable): Mark variable as "used by a child block" in
6669         every surrounding block.
6670         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6671         been used in a child block, complain about violation of "Invariant
6672         meaning in blocks" rule.
6673         * cs-parser.jay (declare_local_variables): Don't use
6674         AddChildVariableNames.
6675         (foreach_statement): Don't create an implicit block: 'foreach'
6676         introduces a scope.
6677
6678 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6679
6680         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6681         converting from 0L to ulong.  Fixes 57522.
6682
6683 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6684
6685         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6686         derived class hides via 'new' keyword field from base class (test-242.cs).
6687         TODO: Handle this in the more general way.
6688         
6689         * class.cs (CheckBase): Ditto.
6690
6691 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6692
6693         * decl.cs (caching_flags): New member for storing cached values
6694         as bit flags.
6695         (MemberCore.Flags): New enum where bit flags for caching_flags
6696         are defined.
6697         (MemberCore.cls_compliance): Moved to caching_flags.
6698         (DeclSpace.Created): Moved to caching_flags.
6699
6700         * class.cs: Use caching_flags instead of DeclSpace.Created
6701         
6702 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6703
6704         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6705         if we are only a derived class, not a nested class.
6706
6707         * typemanager.cs: Same as above, but do this at the MemberLookup
6708         level (used by field and methods, properties are handled in
6709         PropertyExpr).   Allow for the qualified access if we are a nested
6710         method. 
6711
6712 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6713
6714         * class.cs: Refactoring.
6715         (IMethodData): New inteface; Holds links to parent members
6716         to avoid member duplication (reduced memory allocation).
6717         (Method): Implemented IMethodData interface.
6718         (PropertyBase): New inner classes for get/set methods.
6719         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6720         (Event): New inner classes for add/remove methods.
6721         (Event.DelegateMethod): Implemented IMethodData interface.
6722
6723         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6724         EmitContext (related to class.cs refactoring).
6725
6726 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6727
6728         * delegate.cs (Delegate.VerifyApplicability): If the number of
6729         arguments are the same as the number of parameters, first try to
6730         verify applicability ignoring  any 'params' modifier on the last
6731         parameter.
6732         Fixes #56442.
6733
6734 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6735
6736         * class.cs (TypeContainer.AddIndexer): Use
6737         'ExplicitInterfaceName' to determine if interface name was
6738         explicitly specified.  'InterfaceType' is not initialized at this time.
6739         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6740         Indexers array is already in the required order.  Initialize
6741         'IndexerName' only if there are normal indexers.
6742         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6743         (TypeContainer.Emit): Emit DefaultMember attribute only if
6744         IndexerName is initialized.
6745         Fixes #56300.
6746
6747 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6748
6749         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6750         Fixes #57007
6751
6752 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6753
6754         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6755         attributes.
6756         Fix for #56456.
6757
6758         * attribute.cs (Attribute.Resolve): Check for duplicate named
6759         attributes.
6760         Fix for #56463.
6761
6762 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6763
6764         * iterators.cs (MarkYield): track whether we are in an exception,
6765         and generate code accordingly.  Use a temporary value to store the
6766         result for our state.
6767
6768         I had ignored a bit the interaction of try/catch with iterators
6769         since their behavior was not entirely obvious, but now it is
6770         possible to verify that our behavior is the same as MS .NET 2.0
6771
6772         Fixes 54814
6773
6774 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6775
6776         * iterators.cs: Avoid creating temporaries if there is no work to
6777         do. 
6778
6779         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6780         Enumerations, use TypeManager.EnumToUnderlying and call
6781         recursively. 
6782
6783         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6784         bug #57013
6785
6786         (This.Emit): Use EmitContext.EmitThis to emit our
6787         instance variable.
6788
6789         (This.EmitAssign): Ditto.
6790
6791         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6792         codepaths, we will move all the functionality into
6793         Mono.CSharp.This 
6794
6795         (FieldExpr.EmitAssign): Ditto.
6796
6797         This fixes several hidden bugs that I uncovered while doing a code
6798         review of this today.
6799
6800         * codegen.cs (EmitThis): reworked so the semantics are more clear
6801         and also support value types "this" instances.
6802
6803         * iterators.cs: Changed so that for iterators in value types, we
6804         do not pass the value type as a parameter.  
6805
6806         Initialization of the enumerator helpers is now done in the caller
6807         instead of passing the parameters to the constructors and having
6808         the constructor set the fields.
6809
6810         The fields have now `assembly' visibility instead of private.
6811
6812 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6813
6814         * expression.cs (Argument.Resolve): Check if fields passed as ref
6815         or out are contained in a MarshalByRefObject.
6816
6817         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6818         another compiler type.
6819
6820 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6821
6822         * class.cs (Indexer.Define): use the new name checking method.
6823         Also, return false on an error.
6824         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6825         (is_identifier_[start/part]_character): make static.
6826
6827 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6828
6829         * expression.cs (Binary.ResolveOperator): Do no append strings
6830         twice: since we can be invoked more than once (array evaluation)
6831         on the same concatenation, take care of this here.  Based on a fix
6832         from Ben (bug #56454)
6833
6834 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6835
6836         * codegen.cs: Fix another case where CS1548 must be reported (when 
6837         delay-sign isn't specified and no private is available #56564). Fix
6838         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6839         error when MCS is used on the MS runtime and we need to delay-sign 
6840         (which seems unsupported by AssemblyBuilder - see #56621).
6841
6842 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6843
6844         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6845         (TypeManager.ComputeNamespaces): Faster implementation for
6846         Microsoft runtime.
6847
6848         * compiler.csproj: Updated AssemblyName to mcs.
6849
6850 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6851
6852         * rootcontext.cs: Add new types to the boot resolution.
6853
6854         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6855         MulticastDelegate is not allowed.
6856
6857         * typemanager.cs: Add new types to lookup: System.TypedReference
6858         and ArgIterator.
6859
6860         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6861         check for TypedReference or ArgIterator, they are not allowed. 
6862
6863         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6864         makes us properly catch 1510 in some conditions (see bug 56016 for
6865         details). 
6866
6867 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6868
6869         * CryptoConvert.cs: update from corlib version
6870         with endian fixes.
6871
6872 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6873
6874         * class.cs (Indexer.Define): Check indexername declaration
6875
6876 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6877
6878         * attribute.cs (IsClsCompliant): Fixed problem with handling
6879         all three states (compliant, not-compliant, undetected).
6880
6881 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6882
6883         * attribute.cs (Attribute): Location is now public.
6884         (Resolve): Store resolved arguments (pos_values) in attribute class.
6885         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6886         (GetClsCompliantAttributeValue): New method that gets
6887         CLSCompliantAttribute value.
6888         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6889         if exists else null.
6890         (AttributeTester): New class for CLS-Compliant verification routines.
6891
6892         * class.cs (Emit): Add CLS-Compliant verification.
6893         (Method.GetSignatureForError): Implemented.
6894         (Constructor.GetSignatureForError): Implemented
6895         (Constructor.HasCompliantArgs): Returns if constructor has
6896         CLS-Compliant arguments.
6897         (Constructor.Emit): Override.
6898         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6899         is needed to test only parameters.
6900         (FieldBase.GetSignatureForError): Implemented.
6901         (TypeContainer): New member for storing base interfaces.
6902         (TypeContainer.FindMembers): Search in base interfaces too.
6903
6904         * codegen.cs (GetClsComplianceAttribute): New method that gets
6905         assembly or module CLSCompliantAttribute value.
6906         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6907         for assembly.
6908         (ModuleClass.Emit): Add error 3012 test.
6909
6910         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6911
6912         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6913         state for all decl types.
6914         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6915         if CLS-Compliant tests are required.
6916         (IsClsCompliaceRequired): New method. Analyze whether code
6917         must be CLS-Compliant.
6918         (IsExposedFromAssembly): New method. Returns true when MemberCore
6919         is exposed from assembly.
6920         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6921         value or gets cached value.
6922         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6923         is explicitly marked with CLSCompliantAttribute.
6924         (IsIdentifierClsCompliant): New abstract method. This method is
6925         used to testing error 3005.
6926         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6927         for identifier and parameters CLS-Compliant testing.
6928         (VerifyClsCompliance): New method. The main virtual method for
6929         CLS-Compliant verifications.
6930         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6931         null. I don't know why is null (too many public members !).
6932         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6933         and get value of first CLSCompliantAttribute that found.
6934
6935         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6936         (VerifyClsCompliance): Override and add extra tests.
6937
6938         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6939         clscheck- disable CLS-Compliant verification event if assembly is has
6940         CLSCompliantAttribute(true).
6941
6942         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6943         ApllyAttribute is now called in emit section as in the other cases.
6944         Possible future Emit integration.
6945         (IsIdentifierClsCompliant): New override.
6946         (VerifyClsCompliance): New override.
6947         (GetEnumeratorName): Returns full enum name.
6948
6949         * parameter.cs (GetSignatureForError): Implemented.
6950
6951         * report.cs (WarningData): New struct for Warning message information.
6952         (LocationOfPreviousError): New method.
6953         (Warning): New method. Reports warning based on the warning table.
6954         (Error_T): New method. Reports error based on the error table.
6955
6956         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6957         verifications are done here.
6958
6959         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6960
6961         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6962         CLSCompliantAttribute.
6963         (all_imported_types): New member holds all imported types from other
6964         assemblies.
6965         (LoadAllImportedTypes): New method fills static table with exported types
6966         from all referenced assemblies.
6967         (Modules): New property returns all assembly modules.
6968
6969 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6970
6971         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6972         throwing a parser error.
6973
6974         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6975         which removes the hardcoded get_/set_ prefixes for properties, as
6976         IL allows for the properties to be named something else.  
6977
6978         Bug #56013
6979
6980         * expression.cs: Do not override operand before we know if it is
6981         non-null.  Fix 56207
6982
6983 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6984
6985         * typemanager.cs: support for pinned variables.
6986
6987 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6988
6989         * decl.cs, typemanager.cs: Avoid using an arraylist
6990         as a buffer if there is only one result set.
6991
6992 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6993
6994         * expression.cs: Make sure you cant call a static method
6995         with an instance expression, bug #56174.
6996
6997 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6998
6999         * class.cs (IsDuplicateImplementation): Improve error reporting to
7000         flag 663 (method only differs in parameter modifier).
7001
7002         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7003         in preprocessor directives.
7004
7005         * location.cs (LookupFile): Allow for the empty path.
7006
7007         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7008         better approach for some of that patch, but its failing with the
7009         CharSet enumeration.  For now try/catch will do.
7010
7011         * typemanager.cs: Do not crash if a struct does not have fields.
7012         Fixes 56150.
7013
7014 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7015
7016         * expression.cs: cs0213, cant fix a fixed expression.
7017         fixes 50231.
7018
7019 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7020
7021         * cs-parser.jay: detect invalid embeded statements gracefully.
7022         bug #51113.
7023
7024 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7025
7026         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7027         As a regex:
7028         s/
7029         the invocation type may not be a subclass of the tye of the item/
7030         The type of the item must be a subclass of the invocation item.
7031         /g
7032
7033         Fixes bug #50820.
7034
7035 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7036
7037         * attribute.cs: Added methods to get a string and a bool from an
7038         attribute. Required to information from AssemblyKeyFileAttribute,
7039         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7040         * codegen.cs: Modified AssemblyName creation to include support for
7041         strongnames. Catch additional exceptions to report them as CS1548.
7042         * compiler.csproj: Updated include CryptoConvert.cs.
7043         * compiler.csproj.user: Removed file - user specific configuration.
7044         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7045         Mono.Security assembly. The original class is maintained and tested in
7046         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7047         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7048         like CSC 8.0 (C# v2) supports.
7049         * Makefile: Added CryptoConvert.cs to mcs sources.
7050         * rootcontext.cs: Added new options for strongnames.
7051
7052 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7053
7054         * driver.cs: For --expect-error, report error code `2'
7055         if the program compiled with no errors, error code `1' if
7056         it compiled with an error other than the one expected.
7057
7058 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7059
7060         * compiler.csproj: Updated for Visual Studio .NET 2003.
7061         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7062         * compiler.sln: Updated for Visual Studio .NET 2003.
7063
7064 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7065
7066         * expression.cs: Fix bug #47234. We basically need to apply the
7067         rule that we prefer the conversion of null to a reference type
7068         when faced with a conversion to 'object' (csc behaviour).
7069
7070 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7071
7072         * statement.cs: Shorter form for foreach, eliminates
7073         a local variable. r=Martin.
7074
7075 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7076
7077         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7078         checks if we can use brtrue/brfalse to test for 0.
7079         * expression.cs: use the above in the test for using brtrue/brfalse.
7080         cleanup code a bit.
7081
7082 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7083
7084         * expression.cs: Rewrite string concat stuff. Benefits:
7085
7086         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7087         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7088         rather than a concat chain.
7089
7090         * typemanager.cs: Add lookups for more concat overloads.
7091
7092 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7093
7094         * expression.cs: Emit shorter il code for array init.
7095
7096         newarr
7097         dup
7098         // set 1
7099
7100         // set 2
7101
7102         newarr
7103         stloc.x
7104
7105         ldloc.x
7106         // set 1
7107
7108         ldloc.x
7109         // set 2
7110
7111 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7112
7113         * statement.cs: Before, two switch blocks would be merged if the
7114         total size of the blocks (end_item - begin_item + 1) was less than
7115         two times the combined sizes of the blocks.
7116
7117         Now, it will only merge if after the merge at least half of the
7118         slots are filled.
7119
7120         fixes 55885.
7121
7122 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7123
7124         * class.cs : csc build fix for GetMethods(). See bug #52503.
7125
7126 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7127
7128         * expression.cs: Make sure fp comparisons work with NaN.
7129         This fixes bug #54303. Mig approved this patch a long
7130         time ago, but we were not able to test b/c the runtime
7131         had a related bug.
7132
7133 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7134
7135         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7136
7137 2004-03-19  Martin Baulig  <martin@ximian.com>
7138
7139         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7140         error here and not in our caller.
7141
7142 2004-03-19  Martin Baulig  <martin@ximian.com>
7143
7144         * interface.cs: Completely killed this file.
7145         (Interface): We're now a TypeContainer and live in class.cs.
7146
7147         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7148         argument; we're now also called for interfaces.
7149         (TypeContainer.DefineMembers): Allow this method being called
7150         multiple times.
7151         (TypeContainer.GetMethods): New public method; formerly known as
7152         Interface.GetMethod().  This is used by PendingImplementation.
7153         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7154         it's now private and non-static.
7155         (Interface): Moved this here; it's now implemented similar to
7156         Class and Struct.
7157         (Method, Property, Event, Indexer): Added `bool is_interface'
7158         argument to their .ctor's.
7159         (MemberBase.IsInterface): New public field.
7160
7161         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7162         instances instead of InterfaceMethod, InterfaceProperty, etc.
7163         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7164         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7165
7166 2004-03-19  Martin Baulig  <martin@ximian.com>
7167
7168         * class.cs (MethodCore.IsDuplicateImplementation): New private
7169         method which does the CS0111 checking.
7170         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7171         Use IsDuplicateImplementation().
7172
7173 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7174
7175         * decl.cs (FindMemberToOverride): New method to find the correct
7176         method or property to override in the base class.
7177         * class.cs
7178             - Make Method/Property use the above method to find the
7179               version in the base class.
7180             - Remove the InheritableMemberSignatureCompare as it is now
7181               dead code.
7182
7183         This patch makes large code bases much faster to compile, as it is
7184         O(n) rather than O(n^2) to do this validation.
7185
7186         Also, it fixes bug 52458 which is that nested classes are not
7187         taken into account when finding the base class member.
7188
7189         Reviewed/Approved by Martin.
7190
7191 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7192
7193         * interface.cs: In all interface classes removed redundant
7194         member initialization.
7195
7196 2004-03-16  Martin Baulig  <martin@ximian.com>
7197
7198         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7199
7200 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7201
7202         * decl.cs (DefineTypeAndParents): New helper method to define a
7203         type's containers before the type itself is defined;  This is a
7204         bug exposed by the recent changes to Windows.Forms when an
7205         implemented interface was defined inside a class that had not been
7206         built yet.   
7207
7208         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7209
7210         (Check): Loop correctly to report errors modifiers
7211         (UNSAFE was not in the loop, since it was the same as TOP).
7212
7213         * interface.cs: Every interface member now takes a ModFlags,
7214         instead of a "is_new" bool, which we set on the base MemberCore. 
7215
7216         Every place where we called "UnsafeOk" in the interface, now we
7217         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7218         the unsafe settings from the member declaration instead of the
7219         container interface. 
7220
7221         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7222
7223         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7224         `set_indexer_name' to the pending bits (one per type).
7225
7226         We fixed a bug today that was picking the wrong method to
7227         override, since for properties the existing InterfaceMethod code
7228         basically ignored the method name.  Now we make sure that the
7229         method name is one of the valid indexer names.
7230
7231 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7232  
7233         * support.cs (SeekableStreamReader): Keep track of stream byte
7234         positions and don't mix them with character offsets to the buffer.
7235
7236         Patch from Gustavo Giráldez
7237
7238 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7239
7240         * interface.cs (InterfaceSetGetBase): Removed double member
7241         initialization, base class does it as well.
7242
7243 2004-03-13  Martin Baulig  <martin@ximian.com>
7244
7245         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7246         when compiling corlib.
7247
7248 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7249
7250         * convert.cs (ExplicitConversion): We were reporting an error on
7251         certain conversions (object_type source to a value type, when the
7252         expression was `null') before we had a chance to pass it through
7253         the user defined conversions.
7254
7255         * driver.cs: Replace / and \ in resource specifications to dots.
7256         Fixes 50752
7257
7258         * class.cs: Add check for duplicate operators.  Fixes 52477
7259
7260 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7261
7262         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7263         that are in the middle of the statements, not only at the end.
7264         Fixes #54987
7265
7266         * class.cs (TypeContainer.AddField): No longer set the
7267         `HaveStaticConstructor' flag, now we call it
7268         `UserDefineStaticConstructor' to diferentiate the slightly
7269         semantic difference.
7270
7271         The situation is that we were not adding BeforeFieldInit (from
7272         Modifiers.TypeAttr) to classes that could have it.
7273         BeforeFieldInit should be set to classes that have no static
7274         constructor. 
7275
7276         See:
7277
7278         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7279
7280         And most importantly Zoltan's comment:
7281
7282         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7283
7284         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7285          before its static fields are used', i.e. initialization does not need
7286          to be triggered by the first access to the type. Setting this flag
7287          helps the JIT to compile better code, since it can run the static
7288          constructor at JIT time, and does not need to generate code to call it
7289          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7290          this flag for lots of classes like String. 
7291          
7292          csc sets this flag if the type does not have an explicit static 
7293          constructor. The reasoning seems to be that if there are only static
7294          initalizers for a type, and no static constructor, then the programmer
7295          does not care when this initialization happens, so beforefieldinit
7296          can be used.
7297          
7298          This bug prevents the AOT compiler from being usable, since it 
7299          generates so many calls to mono_runtime_class_init that the AOT code
7300          is much slower than the JITted code. The JITted code is faster, 
7301          because it does not generate these calls if the vtable is type is
7302          already initialized, which is true in the majority of cases. But the
7303          AOT compiler can't do this."
7304
7305 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7306
7307         * class.cs (MethodData.Emit): Refactor the code so symbolic
7308         information is generated for destructors;  For some reasons we
7309         were taking a code path that did not generate symbolic information
7310         before. 
7311
7312 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7313
7314         * class.cs: Create a Constructor.CheckBase method that
7315         takes care of all validation type code. The method
7316         contains some code that was moved from Define.
7317
7318         It also includes new code that checks for duplicate ctors.
7319         This fixes bug #55148.
7320
7321 2004-03-09  Joshua Tauberer <tauberer@for.net>
7322
7323         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7324         a { ... }-style array creation invokes EmitStaticInitializers
7325         which is not good for reference-type arrays.  String, decimal
7326         and now null constants (NullCast) are not counted toward
7327         static initializers.
7328
7329 2004-03-05  Martin Baulig  <martin@ximian.com>
7330
7331         * location.cs (SourceFile.HasLineDirective): New public field;
7332         specifies whether the file contains or is referenced by a "#line"
7333         directive.
7334         (Location.DefineSymbolDocuments): Ignore source files which
7335         either contain or are referenced by a "#line" directive.        
7336
7337 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7338
7339         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7340         direct access to our parent, so check the method inline there.
7341
7342 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7343
7344         * expression.cs (Invocation.EmitCall): Miguel's last commit
7345         caused a regression. If you had:
7346
7347             T t = null;
7348             t.Foo ();
7349
7350         In Foo the implict this would be null.
7351
7352 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7353
7354         * expression.cs (Invocation.EmitCall): If the method is not
7355         virtual, do not emit a CallVirt to it, use Call.
7356
7357         * typemanager.cs (GetFullNameSignature): Improve the method to
7358         cope with ".ctor" and replace it with the type name.
7359
7360         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7361         as an argument the ConstructorBuilder where it is being defined,
7362         to catch the recursive constructor invocations.
7363
7364 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7365
7366         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7367         routines to check if a type is an enumerable/enumerator allow
7368         classes that implement the IEnumerable or IEnumerator interfaces.
7369
7370         * class.cs (Property, Operator): Implement IIteratorContainer, and
7371         implement SetYields.
7372
7373         (Property.Define): Do the block swapping for get_methods in the
7374         context of iterators.   We need to check if Properties also
7375         include indexers or not.
7376
7377         (Operator): Assign the Block before invoking the
7378         OperatorMethod.Define, so we can trigger the Iterator code
7379         replacement. 
7380
7381         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7382         Property and Operator classes are not created when we parse the
7383         declarator but until we have the block completed, so we use a
7384         singleton SimpleIteratorContainer.Simple to flag whether the
7385         SetYields has been invoked.
7386
7387         We propagate this setting then to the Property or the Operator to
7388         allow the `yield' to function.
7389
7390 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7391
7392         * codegen.cs: Implemented attribute support for modules.
7393         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7394         Assembly/Module functionality.
7395
7396         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7397         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7398         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7399
7400 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7401
7402         * interface.cs (FindMembers): The operation is performed on all base
7403         interfaces and not only on the first. It is required for future CLS Compliance patch.
7404
7405 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7406
7407         * statement.cs, codegen.cs:
7408         This patch deals with patterns such as:
7409
7410         public class List : IEnumerable {
7411
7412                 public MyEnumerator GetEnumerator () {
7413                         return new MyEnumerator(this);
7414                 }
7415
7416                 IEnumerator IEnumerable.GetEnumerator () {
7417                         ...
7418                 }
7419                 
7420                 public struct MyEnumerator : IEnumerator {
7421                         ...
7422                 }
7423         }
7424
7425         Before, there were a few things we did wrong:
7426         1) we would emit callvirt on a struct, which is illegal
7427         2) we emited ldarg when we needed to emit ldarga
7428         3) we would mistakenly call the interface methods on an enumerator
7429         type that derived from IEnumerator and was in another assembly. For example:
7430
7431         public class MyEnumerator : IEnumerator
7432
7433         Would have the interface methods called, even if there were public impls of the
7434         method. In a struct, this lead to invalid IL code.
7435
7436 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7437
7438         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7439           renamed to Emit.
7440
7441         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7442
7443 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7444
7445         * cs-parser.jay: Fix small regression: we were not testing V2
7446         compiler features correctly.
7447
7448         * interface.cs: If the emit context is null, then create one
7449
7450 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7451
7452         * decl.cs (GetSignatureForError): New virtual method to get full name
7453           for error messages.
7454
7455         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7456           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7457
7458         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7459           Duplicated members and code in these classes has been removed.
7460           Better encapsulation in these classes.
7461
7462 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7463
7464         * assign.cs (Assign.DoResolve): When dealing with compound
7465         assignments, there is a new rule in ECMA C# 2.4 (might have been
7466         there before, but it is documented here) that states that in:
7467
7468         a op= b;
7469
7470         If b is of type int, and the `op' is a shift-operator, then the
7471         above is evaluated as:
7472
7473         a = (int) a op b 
7474
7475         * expression.cs (Binary.ResolveOperator): Instead of testing for
7476         int/uint/long/ulong, try to implicitly convert to any of those
7477         types and use that in pointer arithmetic.
7478
7479         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7480         method to print information for from the type, not from the
7481         null-method we were given.
7482
7483 2004-02-01  Duncan Mak  <duncan@ximian.com>
7484
7485         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7486         parsing for cmd, fixes bug #53694.
7487
7488 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7489
7490         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7491         in the member name duplication tests. Property and operator name duplication
7492         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7493
7494 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7495
7496         * interface.cs (PopulateMethod): Fixed crash when interface method
7497         returns not existing type (error test cs0246-3.cs).
7498
7499 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7500
7501         * cs-parser.jay (interface_accessors): Re-write actions to also
7502         store attributes attached to get and set methods. Fix spelling
7503         while at it.
7504
7505         (inteface_property_declaration): Modify accordingly.
7506
7507         (InterfaceAccessorInfo): New helper class to store information to pass
7508         around between rules that use interface_accessors.
7509
7510         * interface.cs (Emit): Apply attributes on the get and set
7511         accessors of properties and indexers too.
7512
7513         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7514         right MethodBuilder when applying attributes to the get and set accessors.
7515
7516 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7517
7518         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7519
7520 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7521
7522         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7523
7524 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7525
7526         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7527         changes that treat `yield' specially when present before `break'
7528         or `return' tokens.
7529
7530         * cs-tokenizer.cs: yield is no longer a keyword.
7531
7532 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7533
7534         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7535         setting for default constructors.
7536         For default constructors are almost every time set wrong Modifier. The
7537         generated IL code has been alright. But inside mcs this values was
7538         wrong and this was reason why several of my CLS Compliance tests
7539         failed.
7540
7541 2004-01-22  Martin Baulig  <martin@ximian.com>
7542
7543         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7544         not a QualifiedIdentifier.  This is what `type_name_expression'
7545         was previously doing.
7546         (type_name_expression): Removed; the code is now in
7547         `namespace_or_type_name'.
7548         (qualified_identifier): Removed, use `namespace_or_type_name'
7549         instead.
7550         (QualifiedIdentifier): Removed this class.      
7551
7552 2004-01-22  Martin Baulig  <martin@ximian.com>
7553
7554         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7555         not a string as alias name.
7556
7557 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7558
7559         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7560         #52730 bug, and instead compute correctly the need to use a
7561         temporary variable when requesting an address based on the
7562         static/instace modified of the field and the constructor.
7563  
7564 2004-01-21  Martin Baulig  <martin@ximian.com>
7565
7566         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7567         class and namespace before looking up aliases.  Fixes #52517.
7568
7569 2004-01-21  Martin Baulig  <martin@ximian.com>
7570
7571         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7572         assinged in a 'try'; fixes exception4.cs.
7573
7574 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7575         * class.cs : Implemented parameter-less constructor for TypeContainer
7576
7577         * decl.cs: Attributes are now stored here. New property OptAttributes
7578
7579         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7580
7581         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7582
7583 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7584
7585         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7586           (CSharpSignature): New method for indexer and property signature.
7587
7588 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7589
7590         * pending.cs (IsVirtualFilter): Faster implementation.
7591
7592 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * typemanager.cs: Avoid inclusion of same assembly more than once.
7595
7596 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7597
7598         * cs-parser.jay: Fixed problem where the last assembly attribute
7599           has been applied also to following declaration (class, struct, etc.)
7600           
7601 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * class.cs: Added error CS0538, CS0539 reporting.
7604         Fixed crash on Microsoft runtime when field type is void.
7605
7606         * cs-parser.jay: Added error CS0537 reporting.
7607
7608         * pending.cs: Added error CS0535 reporting.
7609         Improved error report for errors CS0536, CS0534.
7610
7611 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7612
7613         Merge a few bits from the Anonymous Method MCS tree.
7614
7615         * statement.cs (ToplevelBlock): New class for toplevel methods,
7616         will hold anonymous methods, lifted variables.
7617
7618         * cs-parser.jay: Create toplevel blocks for delegates and for
7619         regular blocks of code. 
7620
7621 2004-01-20  Martin Baulig  <martin@ximian.com>
7622
7623         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7624         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7625         and `NeedExplicitReturn'; added `IsLastStatement'.
7626         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7627         have a `ReturnLabel' or we're not unreachable.
7628
7629         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7630         child's reachability; don't just override ours with it.  Fixes
7631         #58058 (lluis's example).
7632         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7633         InFinally(), InLoop(), InSwitch() and
7634         BreakCrossesTryCatchBoundary() methods.
7635
7636         * statement.cs (Return): Do all error checking in Resolve().
7637         Unless we are the last statement in a top-level block, always
7638         create a return label and jump to it.
7639         (Break, Continue): Do all error checking in Resolve(); also make
7640         sure we aren't leaving a `finally'.
7641         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7642         statement in a top-level block.
7643         (Block.Flags): Added `IsDestructor'.
7644         (Block.IsDestructor): New public property.
7645
7646 2004-01-20  Martin Baulig  <martin@ximian.com>
7647
7648         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7649
7650 2004-01-20  Martin Baulig  <martin@ximian.com>
7651
7652         * statement.cs (Statement.ResolveUnreachable): New public method.
7653         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7654         (Block.Resolve): Resolve unreachable statements.
7655
7656 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7657
7658         * expression.cs: We need to fix the case where we do
7659         not have a temp variable here.
7660
7661         * assign.cs: Only expression compound assignments need
7662         temporary variables.
7663
7664 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7665
7666         * flowanalysis.cs: Reduce memory allocation in a few ways:
7667           - A block with no variables should not allocate a bit
7668             vector for itself.
7669           - A method with no out parameters does not need any tracking
7670             for assignment of the parameters, so we need not allocate
7671             any data for it.
7672           - The arrays:
7673                 public readonly Type[] VariableTypes;
7674                 public readonly string[] VariableNames;
7675             Are redundant. The data is already stored in the variable
7676             map, so we need not allocate another array for it.
7677           - We need to add alot of checks for if (params | locals) == null
7678             due to the first two changes.
7679
7680 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7681
7682         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7683         implement IMemoryLocation, we store a copy on a local variable and
7684         take the address of it.  Patch from Benjamin Jemlich
7685
7686         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7687         to use a special "type_name_expression" rule which reduces the
7688         number of "QualifiedIdentifier" classes created, and instead
7689         directly creates MemberAccess expressions.
7690
7691 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7692
7693         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7694         that fixes #52853.  Null literal assignment to ValueType
7695
7696         * class.cs (MethodData.Emit): Instead of checking the name of the
7697         method to determine if its a destructor, create a new derived
7698         class from Method called Destructor, and test for that.  
7699
7700         * cs-parser.jay: Create a Destructor object instead of a Method.  
7701
7702         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7703
7704         Fixes: 52933
7705
7706 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7707
7708         * expression.cs (Binary.ResolveOperator): Perform an implicit
7709         conversion from MethodGroups to their delegate types on the
7710         Addition operation.
7711
7712         * delegate.cs: Introduce a new class DelegateCreation that is the
7713         base class for `NewDelegate' and `ImplicitDelegateCreation',
7714         factor some code in here.
7715
7716         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7717         conversion from MethodGroups to compatible delegate types. 
7718
7719         * ecore.cs (Expression.Resolve): Do not flag error 654
7720         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7721         we allow conversions from MethodGroups to delegate types now.
7722
7723         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7724         assignments in v2 either.
7725
7726 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7727
7728         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7729         static read-only fields in ctors.
7730
7731         Applied patch from Benjamin Jemlich 
7732
7733         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7734
7735 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7736
7737         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7738         here to return true, as they can be used like this:
7739
7740                 (XXX) int.MEMBER ()
7741
7742         Fixed 49836 and all the other dups
7743
7744 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7745
7746         * driver.cs: Implement /win32res and /win32icon.
7747
7748 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7749
7750         * cs-parser.jay: Add a rule to improve error handling for the
7751         common mistake of placing modifiers after the type.
7752
7753 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7754
7755         * cs-parser.jay (interface_event_declaration): Catch
7756         initialization of events on interfaces, and report cs0068
7757
7758         * cs-parser.jay (interface_event_declaration): Catch
7759         initialization of events. 
7760
7761         * ecore.cs: Better report missing constructors.
7762
7763         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7764         the error reporting done in the wrong place.  Fix.
7765
7766         * expression.cs (Binary.ResolveOperator): Catch the 
7767         operator + (E x, E y) error earlier, and later allow for implicit
7768         conversions in operator +/- (E e, U x) from U to the underlying
7769         type of E.
7770
7771         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7772         52596, if the container class is abstract, the default constructor
7773         is protected otherwise its public (before, we were always public).
7774
7775         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7776         fixed statement.
7777
7778         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7779         Jemlich that fixes bug #52597, MCS was generating invalid code for
7780         idisposable structs.   Thanks to Ben for following up with this
7781         bug as well.
7782
7783 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7784
7785         * driver.cs: Allow assemblies without code to be generated, fixes
7786         52230.
7787
7788 2004-01-07  Nick Drochak <ndrochak@gol.com>
7789
7790         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7791
7792 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7793
7794         * cs-parser.jay: Add rules to improve error reporting if fields or
7795         methods are declared at the namespace level (error 116)
7796
7797         * Add rules to catch event add/remove
7798
7799 2004-01-04  David Sheldon <dave-mono@earth.li>
7800
7801   * expression.cs: Added matching ")" to error message for 
7802   CS0077
7803
7804 2004-01-03 Todd Berman <tberman@gentoo.org>
7805
7806         * ecore.cs, attribute.cs:
7807         Applying fix from #52429.
7808
7809 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7810
7811         * ecore.cs, expression.cs, statement.cs:
7812         Total rewrite of how we handle branching. We
7813         now handle complex boolean expressions with fewer
7814         jumps. As well if (x == 0) no longer emits a ceq.
7815
7816         if (x is Foo) is much faster now, because we generate
7817         better code.
7818
7819         Overall, we get a pretty big improvement on our benchmark
7820         tests. The code we generate is smaller and more readable.
7821
7822         I did a full two-stage bootstrap. The patch was reviewed
7823         by Martin and Miguel.
7824
7825 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7826
7827         * cs-parser.jay: Make primary_expression not take a QI.
7828         we dont need this because the member_access rule covers
7829         us here. So we replace the rule with just IDENTIFIER.
7830
7831         This has two good effects. First, we remove a s/r conflict.
7832         Second, we allocate many fewer QualifiedIdentifier objects.
7833
7834 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7835
7836         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7837         set the correct information via SRE. This prevents
7838         hanging on the MS runtime. Fixes #29374.
7839
7840 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7841
7842         * convert.cs: correctly handle conversions to value types
7843         from Enum and ValueType as unboxing conversions.
7844
7845         Fixes bug #52569. Patch by Benjamin Jemlich.
7846
7847 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7848
7849         * expression.cs (BetterConversion): Prefer int -> uint
7850         over int -> ulong (csc's behaviour). This fixed bug #52046.
7851
7852 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7853
7854         * decl.cs (MemberCache.FindMembers): now returns a
7855         MemberInfo [].
7856
7857         * typemanager.cs: In general, go with with ^^.
7858         (CopyNewMethods): take an IList.
7859         (RealMemberLookup): Only allocate an arraylist
7860         if we copy from two sets of methods.
7861
7862         This change basically does two things:
7863         1) Fewer array lists allocated due to CopyNewMethods.
7864         2) the explicit cast in MemberList costed ALOT.
7865
7866 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7867
7868         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7869         a hashtable to avoid needless string allocations when an identifier is
7870         used more than once (the common case).
7871
7872 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7873
7874         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7875         is broken, it will not return anything. So, we
7876         have to use the information we have in mcs to
7877         do the task.
7878
7879         * typemanager.cs: Add a cache for GetInterfaces,
7880         since this will now be used more often (due to ^^)
7881
7882         (GetExplicitInterfaces) New method that gets the
7883         declared, not effective, interfaces on a type
7884         builder (eg, if you have interface IFoo, interface
7885         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7886         { IBar }.
7887
7888         This patch makes MCS able to bootstrap itself on
7889         Windows again.
7890
7891 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7892
7893         * expression.cs: Remove the Nop's that Miguel put
7894         in by mistake.
7895
7896 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7897
7898         * report.cs, codegen.cs: Give the real stack trace to
7899         the error when an exception is thrown.
7900
7901 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7902
7903         * decl.cs: only allocate hashtables for ifaces if 
7904         it is an iface!
7905
7906 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7907
7908         * expression.cs: fix the error from cs0121-2.cs
7909         (a parent interface has two child interfaces that
7910         have a function with the same name and 0 params
7911         and the function is called through the parent).
7912
7913 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7914
7915         * class.cs, rootcontext.cs, typmanager.cs: do not
7916         leak pointers.
7917
7918 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7919
7920         * codegen.cs: remove stack for the ec flow branching.
7921         It is already a linked list, so no need.
7922
7923 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7924
7925         * Makefile: Allow custom profiler here.
7926
7927 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7928
7929         * typemanager.cs (LookupType):
7930           - Use a static char [], because split takes
7931             a param array for args, so it was allocating
7932             every time.
7933           - Do not store true in a hashtable, it boxes.
7934
7935 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7936
7937         * flowanalysis.cs: bytify common enums.
7938
7939 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7940
7941         * modifiers.cs: Add a new set of flags for the
7942         flags allowed on explicit interface impls.
7943         * cs-parser.jay: catch the use of modifiers in
7944         interfaces correctly.
7945         * class.cs: catch private void IFoo.Blah ().
7946
7947         All related to bug #50572.
7948
7949 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7950
7951         * decl.cs: Rewrite the consistant accessability checking.
7952         Accessability is not linear, it must be implemented in
7953         a tableish way. Fixes #49704.
7954
7955 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7956
7957         * expression.cs: Handle negation in a checked context.
7958         We must use subtraction from zero. Fixes #38674.
7959
7960 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7961
7962         * class.cs: Ignore static void main in DLLs.
7963         * rootcontext.cs: Handle the target type here,
7964         since we are have to access it from class.cs
7965         * driver.cs: account for the above.
7966
7967 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7968
7969         * report.cs: Give line numbers and files if available.
7970
7971 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7972
7973         * driver.cs: Implement /addmodule.
7974
7975         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7976         ModuleBuilders.
7977
7978 2003-12-20  Martin Baulig  <martin@ximian.com>
7979
7980         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7981         (FieldBase.IsAssigned): Removed this field.
7982         (FieldBase.SetAssigned): New public method.
7983         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7984
7985 2003-12-20  Martin Baulig  <martin@ximian.com>
7986
7987         * expression.cs (LocalVariableReference.DoResolve): Don't set
7988         `vi.Used' if we're called from DoResolveLValue().
7989
7990         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7991         returns the usage vector it just merged into the current one -
7992         pass this one to UsageWarning().
7993         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7994         of the `EmitContext', don't call this recursively on our children.
7995
7996 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7997
7998         * driver.cs: Implement /target:module.
7999
8000 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8001
8002         * support.cs (CharArrayHashtable): New helper class.
8003
8004         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8005         char arrays, not strings, so we can avoid creating a string in
8006         consume_identifier if the identifier is a keyword.
8007
8008 2003-12-16  Martin Baulig  <martin@ximian.com>
8009
8010         * statement.cs (LocalInfo.Assigned): Removed this property.
8011         (LocalInfo.Flags): Removed `Assigned'.
8012         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8013         and uses flow analysis.
8014         (Block.UsageWarning): Made this method private.
8015         (Block.Resolve): Call UsageWarning() if appropriate.
8016
8017         * expression.cs (LocalVariableReference.DoResolve): Always set
8018         LocalInfo.Used here.
8019
8020 2003-12-13  Martin Baulig  <martin@ximian.com>
8021
8022         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8023         any value here; we're now using flow analysis to figure out
8024         whether a statement/block returns a value.
8025
8026 2003-12-13  Martin Baulig  <martin@ximian.com>
8027
8028         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8029         working again.
8030         (FlowBranching.MergeFinally): Don't call
8031         `branching.CheckOutParameters()' here, this is called in
8032         MergeTopBlock().
8033         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8034         when adding the `finally' vector.       
8035
8036 2003-12-13  Martin Baulig  <martin@ximian.com>
8037
8038         * flowanalysis.cs
8039         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8040         actually work and also fix #48962.
8041
8042 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8043
8044         * decl.cs: Do not check System.Object for nested types,
8045         since we know it does not have any. Big bang for buck:
8046
8047         BEFORE:
8048            Run 1:   8.35 seconds
8049            Run 2:   8.32 seconds
8050            corlib:  17.99 seconds
8051         AFTER:
8052            Run 1:   8.17 seconds
8053            Run 2:   8.17 seconds
8054            corlib:  17.39 seconds
8055
8056 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8057
8058         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8059         time we are returning 0 members, so we save alot here.
8060
8061 2003-12-11  Martin Baulig  <martin@ximian.com>
8062
8063         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8064         `MergeChild()', also just take the `FlowBranching' as argument;
8065         call Merge() on it and return the result.
8066         (FlowBranching.Merge): We don't need to do anything if we just
8067         have one sibling.
8068
8069 2003-12-11  Martin Baulig  <martin@ximian.com>
8070
8071         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8072         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8073         Maurer for this idea.
8074
8075 2003-12-11  Martin Baulig  <martin@ximian.com>
8076
8077         * flowanalysis.cs (MergeResult): This class is now gone; we now
8078         use the `UsageVector' for this.  The reason for this is that if a
8079         branching just has one sibling, we don't need to "merge" them at
8080         all - that's the next step to do.
8081         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8082         `MergeResult'.
8083
8084 2003-12-11  Martin Baulig  <martin@ximian.com>
8085
8086         Reworked flow analyis and made it more precise and bug-free.  The
8087         most important change is that we're now using a special `Reachability'
8088         class instead of having "magic" meanings of `FlowReturns'.  I'll
8089         do some more cleanups and optimizations and also add some more
8090         documentation this week.
8091
8092         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8093         largely reworked this class.
8094         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8095         the new `Reachability' class instead of having "magic" values here.
8096         (FlowBranching): We're now using an instance of `Reachability'
8097         instead of having separate `Returns', `Breaks' etc. fields.
8098
8099         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8100         based on flow analysis; ignore the return value of block.Emit ().
8101
8102 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8103
8104         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8105         if they are private.
8106
8107 2003-12-09  Martin Baulig  <martin@ximian.com>
8108
8109         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8110         call them directly on the UsageVector.
8111
8112 2003-12-09  Martin Baulig  <martin@ximian.com>
8113
8114         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8115         Changed return type from `FlowReturns' to `Reachability'.
8116
8117 2003-12-09  Martin Baulig  <martin@ximian.com>
8118
8119         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8120         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8121         `Reachable' fields with a single `Reachability' one.
8122
8123 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8124
8125         * class.cs (FindMembers): Remove foreach's.
8126
8127         Bootstrap times:
8128
8129         BEFORE
8130                 Run 1:   8.74 seconds
8131                 Run 2:   8.71 seconds
8132
8133         AFTER
8134                 Run 1:   8.64 seconds
8135                 Run 2:   8.58 seconds
8136
8137
8138 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8139
8140         * cs-parser.jay:
8141         * gen-treedump.cs:
8142         * statement.cs:
8143         This patch does a few things:
8144                 1. EmptyStatement is now a singleton, so it is never reallocated.
8145                 2. All blah is EmptyStatement constructs have been changed to
8146                    blah == EmptyStatement.Value, which is much faster and valid
8147                    now that EmptyStatement is a singleton.
8148                 3. When resolving a block, rather than allocating a new array for
8149                    the non-empty statements, empty statements are replaced with
8150                    EmptyStatement.Value
8151                 4. Some recursive functions have been made non-recursive.
8152         Mainly the performance impact is from (3), however (1) and (2) are needed for
8153         this to work. (4) does not make a big difference in normal situations, however
8154         it makes the profile look saner.
8155
8156         Bootstrap times:
8157
8158         BEFORE
8159         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8160         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8161         Total memory allocated: 56397 KB
8162
8163         AFTER
8164         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8165         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8166         Total memory allocated: 55666 KB
8167
8168 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8169
8170         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8171         than the hashtable in a hashtable version
8172
8173         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8174         we always end up concating a string. This results in a huge perf
8175         loss, because many strings have to be tracked by the GC. In this
8176         patch, we first use a hashtable that works with two keys, so that
8177         the strings do not need to be concat'ed.
8178
8179         Bootstrap times:
8180         BEFORE
8181                 Run 1:   8.74 seconds
8182                 Run 2:   8.71 seconds
8183
8184         AFTER
8185                 Run 1:   8.65 seconds
8186                 Run 2:   8.56 seconds
8187
8188 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8189
8190         * Makefile: Add a new target `do-time' that does a quick and simple
8191         profile, leaving easy to parse output.
8192
8193 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8194
8195         * codegen.cs (Init): Create the dynamic assembly with 
8196         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8197
8198 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8199
8200         * support.cs: Make the PtrHashtable use only one
8201         instance of its comparer.
8202
8203 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8204
8205         * typemanager.cs: Fix lookup of GetNamespaces.
8206
8207 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8208
8209         * expression.cs: Removed redundant line.
8210
8211         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8212         ArrayLists, use for loops with bounds.  
8213
8214         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8215         arraylist.
8216
8217         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8218         arraylists, use for loop with bounds.
8219
8220         The above three changes give us a 0.071 second performance
8221         improvement out of 3.294 seconds down to 3.223.  On my machine
8222         the above changes reduced the memory usage by 1,387 KB during
8223         compiler bootstrap.
8224
8225         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8226         QualifiedIdentifiers.  Before we created a new string through
8227         concatenation, and mostly later on, the result would be
8228         manipulated by DecomposeQI through string manipulation.
8229
8230         This reduced the compiler memory usage for bootstrapping from
8231         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8232         compile times in 0.05 seconds.
8233
8234 2003-11-28  Dick Porter  <dick@ximian.com>
8235
8236         * support.cs: Do string compares with the Invariant culture.
8237
8238         * rootcontext.cs: 
8239         * gen-treedump.cs: 
8240         * expression.cs: 
8241         * driver.cs: 
8242         * decl.cs: 
8243         * codegen.cs: 
8244         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8245         the comparison is done with the Invariant culture.
8246
8247 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8248
8249         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8250         GetEnumerator method.
8251
8252         (ProbeCollectionType): Iterate starting at the most specific type
8253         upwards looking for a GetEnumerator
8254
8255         * expression.cs: Shift count can be up to 31 for int/uint and 63
8256         for long/ulong.
8257
8258 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8259
8260         * statement.cs (Block.LookupLabel): Also look for the label on the
8261         children blocks.  Use a hash table to keep track of visited
8262         nodes. 
8263
8264         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8265         we actually did transform the other operand, otherwise fall back
8266         to the common codepath that casts to long.
8267
8268         * cs-tokenizer.cs: Use the same code pattern as the int case.
8269         Maybe I should do the parsing myself, and avoid depending on the
8270         Parse routines to get this done.
8271
8272 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8273
8274         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8275         which fixes bug 51347.  This time test it.
8276
8277         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8278         attributes for example can not tell the difference between these.
8279         The difference was only a syntax feature of the language. 
8280
8281         * attribute.cs: Apply attributes to delegates.
8282
8283         * delegate.cs: Call the apply attributes method.
8284
8285 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8286
8287         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8288         comparing 0 vs Byte.MinValue, not the value
8289
8290         (ImplicitConversionRequired): When reporting a conversion error,
8291         use error 31 to print out the constant error instead of the
8292         simpler 29.
8293
8294         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8295         which fixes bug 51347.
8296
8297 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8298
8299         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8300         which fixes the -warnaserror command line option.
8301
8302 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8303
8304         * cfold.cs (DoNumericPromotions): During constant folding of
8305         additions on UIntConstant, special case intconstants with
8306         IntConstants like we do on the expression binary operator. 
8307
8308 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8309
8310         * convert.cs (ImplicitReferenceConversion): We were missing a case
8311         (System.Enum are not value types or class types, so we need to
8312         classify them separatedly).
8313
8314         * driver.cs: We do not support error 2007.
8315
8316 2003-11-12 Jackson Harper <jackson@ximian.com>
8317
8318         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8319         system directory. Also use the full file name so users can
8320         libraries names mscorlib-o-tron.dll in a non system dir.
8321
8322 2003-11-10  Martin Baulig  <martin@ximian.com>
8323
8324         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8325         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8326         calling `ResolveType()' on them, directly assign their `Type'.
8327
8328 2003-11-08  Martin Baulig  <martin@ximian.com>
8329
8330         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8331         return value and the `out parent' parameter.
8332         (TypeContainer.DefineType): Moved the CS0644 check into
8333         GetClassBases().  Don't pass the interface types to the
8334         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8335         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8336
8337         * ecore.cs (TypeExpr.IsAttribute): New property.
8338         (TypeExpr.GetInterfaces): New method.
8339
8340         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8341         TypeExpr instead of a Type.
8342         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8343         (Interface.DefineType): Don't pass the interface types to the
8344         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8345         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8346
8347         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8348         instead of a `Type[]'.
8349         (TypeManager.RegisterBuilder): Likewise.
8350         (TypeManager.AddUserInterface): Likewise.
8351         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8352         `Type[]' and also return a `TypeExpr[]'.
8353         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8354
8355 2003-11-08  Martin Baulig  <martin@ximian.com>
8356
8357         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8358         Expression.     
8359
8360 2003-11-08  Martin Baulig  <martin@ximian.com>
8361
8362         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8363         TypeManager.ResolveExpressionTypes().
8364
8365         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8366         instead of an Expression.
8367         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8368         (TypeExpression): New public class; formerly known as `TypeExpr'.
8369
8370         * expression.cs (ComposedCast): Derive from TypeExpr.
8371
8372         * typemanager.cs (TypeManager.system_*_expr): These are now
8373         TypExpr's instead of Expression's.
8374         (TypeManager.ResolveExpressionTypes): New public static function;
8375         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8376         of them.        
8377
8378 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8379
8380         * expression.cs (New.DoResolve): Do not dereference value that
8381         might be a null return.
8382
8383         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8384         sure that the constant value has the right type.  Fixes an
8385         unreported bug, similar to 50425.
8386
8387         * const.cs (Const.LookupConstantValue): Call
8388         ImplicitStandardConversionExists before doing a conversion to
8389         avoid havng the TypeManager.ChangeType do conversions.
8390
8391         Reduced the number of casts used
8392
8393         (Const.ChangeType): New routine to enable reuse of the constant
8394         type changing code from statement.
8395
8396         * typemanager.cs (ChangeType): Move common initialization to
8397         static global variables.
8398
8399         Fixes #50425.
8400
8401         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8402         every value type to go through, even if it was void.  Fix that. 
8403
8404         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8405         character of the define, and the is_identifier_part_character for
8406         the rest of the string.
8407
8408 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8409
8410         * expression.cs (UnaryMutator.EmitCode): When I updated
8411         LocalVariableReference.DoResolve, I overdid it, and dropped an
8412         optimization done on local variable references.
8413
8414 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8415
8416         * ecore.cs: Convert the return from Ldlen into an int.
8417
8418 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8419
8420         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8421         the accessibility, this is a special case for toplevel non-public
8422         classes (internal for instance).
8423
8424 2003-10-20  Nick Drochak <ndrochak@gol.com>
8425
8426         * ecore.cs: Fix typo and build.  Needed another right paren.
8427
8428 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8429
8430         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8431         `internal' case regular and protected, but not allowing protected
8432         to be evaluated later.  Bug 49840
8433
8434 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8435
8436         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8437         to kb.Nlast, and not the kb.nFirst to isolate the switch
8438         statement.
8439
8440         Extract the underlying type, so enumerations of long/ulong are
8441         treated like long/ulong.
8442
8443 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8444
8445         * expression.cs (New): Overload the meaning of RequestedType to
8446         track the possible creation of the NewDelegate type, since
8447         DoResolve is invoked more than once for new constructors on field
8448         initialization.
8449
8450         See bugs: #48800 and #37014
8451
8452         * cs-parser.jay (declare_local_constants): Take an arraylist
8453         instead of a single constant.
8454
8455         (local_constant_declaration): It should take a
8456         constant_declarators, not a constant_declarator.  Fixes 49487
8457
8458         * convert.cs: Fix error report.
8459
8460 2003-10-13 Jackson Harper <jackson@ximian.com>
8461
8462         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8463         bug #49611
8464
8465 2003-10-09  Martin Baulig  <martin@ximian.com>
8466
8467         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8468         to the .ctor.
8469         (MethodCore.DoDefineParameters): Removed the TypeContainer
8470         argument; use the DeclSpace which was passed to the .ctor instead.
8471         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8472         TypeContainer; we only need a DeclSpace here.
8473
8474 2003-10-09  Martin Baulig  <martin@ximian.com>
8475
8476         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8477         to the .ctor.
8478         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8479         EmitContext's .ctor.    
8480
8481 2003-10-09  Martin Baulig  <martin@ximian.com>
8482
8483         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8484         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8485         AsAccessible(), moved them as well.
8486
8487         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8488
8489 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8490
8491         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8492
8493 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8494
8495         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8496         generation for >=, as spotted by Paolo, bug 48679.  
8497         Patch from David Waite.
8498
8499         * cs-tokenizer.cs: Add handling for #pragma.
8500
8501         * cs-parser.jay: Allow for both yield and yield return in the
8502         syntax.  The anti-cobolization of C# fight will go on!
8503
8504         * class.cs (TypeBuilder.DefineType): Catch error condition here
8505         (Parent.DefineType erroring out and returning null).
8506
8507         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8508         coping with enumerations variables, we were mistakenly processing
8509         them as a regular value type instead of built-in types.  Fixes the
8510         bug #48063
8511
8512         * typemanager.cs (IsBuiltinOrEnum): New method.
8513
8514 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8515
8516         * cs-parser.jay: Upgrade: yield now needs the return clause.
8517
8518 2003-09-19  Martin Baulig  <martin@ximian.com>
8519
8520         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8521         `MemberCache parent' argument.  Normally, an interface doesn't
8522         have a parent type except System.Object, but we use this in gmcs
8523         for generic type parameters.
8524
8525 2003-09-18  Martin Baulig  <martin@ximian.com>
8526
8527         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8528         on `type.IsInterface'; don't check whether the type has a parent
8529         to determine whether it's an interface.
8530
8531 2003-09-15  Martin Baulig  <martin@ximian.com>
8532
8533         * class.cs (TypeContainer.DefineType): Added an error flag to
8534         avoid reporting duplicate CS0146's ("class definition is
8535         circular.").
8536
8537         * driver.cs (Driver.MainDriver): Abort if
8538         RootContext.ResolveTree() reported any errors.
8539
8540 2003-09-07  Martin Baulig  <martin@ximian.com>
8541
8542         * report.cs (Error, Warning): Added overloaded versions which take
8543         a `params object[] args' and call String.Format().
8544
8545 2003-09-07  Martin Baulig  <martin@ximian.com>
8546
8547         * decl.cs (DeclSpace..ctor): Don't call
8548         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8549         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8550         (DeclSpace.RecordDecl): New method.
8551
8552         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8553
8554 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8555
8556         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8557         value attributes to be applied to ParameterBuilders.
8558
8559         * class.cs (MethodCore.LabelParameters): Make static and more
8560         generic so that it can be used from other places - like interface
8561         methods, for instance.
8562
8563         * interface.cs (Interface.Emit): Call LabelParameters before
8564         emitting attributes on the InterfaceMethod.
8565
8566 2003-08-26  Martin Baulig  <martin@ximian.com>
8567
8568         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8569         resolving aliases; fixes #47927.
8570
8571 2003-08-26  Martin Baulig  <martin@ximian.com>
8572
8573         * statement.cs (Using.DoResolve): This is internally emitting a
8574         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8575         do not always return.  Fixes #47681.
8576
8577 2003-08-26  Martin Baulig  <martin@ximian.com>
8578
8579         * decl.cs (MemberCore): Moved WarningNotHiding(),
8580         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8581         into MemberBase.
8582         (AdditionResult): Make this nested in DeclSpace.
8583         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8584         argument; call NamespaceEntry.Define() unless we're nested in a
8585         class or struct.
8586
8587         * namespace.cs (Namespace.DefineName): New public function.  This
8588         is called from DeclSpace's .ctor to add 
8589         (Namespace.Lookup): Include DeclSpaces in the lookup.
8590
8591         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8592
8593         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8594
8595 2003-08-25  Martin Baulig  <martin@ximian.com>
8596
8597         * convert.cs (Convert.ExplicitReferenceConversion): When
8598         converting from an interface type to a class, unbox if the target
8599         type is a struct type.  Fixes #47822.
8600
8601 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8602
8603         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8604         #47854.
8605
8606 2003-08-22  Martin Baulig  <martin@ximian.com>
8607
8608         * class.cs (TypeManager.DefineType): When defining a nested type,
8609         call DefineType() on our parent; fixes #47801.
8610
8611 2003-08-22  Martin Baulig  <martin@ximian.com>
8612
8613         * class.cs (MethodData.Define): While checking if a method is an
8614         interface implementation, improve the test a bit more to fix #47654.
8615
8616 2003-08-22  Martin Baulig  <martin@ximian.com>
8617
8618         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8619         correctly; fixes #47722.
8620
8621 2003-08-22  Martin Baulig  <martin@ximian.com>
8622
8623         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8624         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8625
8626         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8627
8628 2003-08-22  Martin Baulig  <martin@ximian.com>
8629
8630         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8631         can only be assigned in static constructors.  Fixes #47161.
8632
8633 2003-08-22  Martin Baulig  <martin@ximian.com>
8634
8635         Rewrote and improved the flow analysis code.
8636
8637         * flowbranching.cs (FlowBranching): Make this class abstract.
8638         (FlowBranching.CreateBranching): New static function to create a
8639         new flow branching.
8640         (FlowBranchingBlock, FlowBranchingException): New classes.
8641         (FlowBranching.UsageVector.Type): New public readonly field.
8642         (FlowBranching.UsageVector.Breaks): Removed the setter.
8643         (FlowBranching.UsageVector.Returns): Removed the setter.
8644         (FlowBranching.UsageVector): Added Break(), Return(),
8645         NeverReachable() and Throw() methods to modify the reachability.
8646         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8647         done by FlowBranching.Merge().
8648         (FlowBranching.UsageVector.MergeChild): New method; merges the
8649         merge result into the current vector.
8650         (FlowBranching.Merge): New abstract method to merge a branching.
8651
8652 2003-08-12  Martin Baulig  <martin@ximian.com>
8653
8654         * expression.cs (Indirection.CacheTemporaries): Create the
8655         LocalTemporary with the pointer type, not its element type.
8656
8657 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8658
8659         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8660         token was a keyword or not.
8661
8662         Add `error' options where an IDENTIFIER was expected;  Provide
8663         CheckToken and CheckIdentifierToken convenience error reporting
8664         functions. 
8665
8666         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8667
8668         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8669         NameSpaceEntry NameSpaceEntry.
8670
8671         (LookupInterfaceOrClass): Avoid creating a full qualified name
8672         from namespace and name: avoid doing lookups when we know the
8673         namespace is non-existant.   Use new Tree.LookupByNamespace which
8674         looks up DeclSpaces based on their namespace, name pair.
8675
8676         * driver.cs: Provide a new `parser verbose' to display the
8677         exception thrown during parsing.  This is turned off by default
8678         now, so the output of a failure from mcs is more graceful.
8679
8680         * namespace.cs: Track all the namespaces defined in a hashtable
8681         for quick lookup.
8682
8683         (IsNamespace): New method
8684
8685 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8686
8687         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8688         we know that we need to concatenate (full typename can never be
8689         null). 
8690
8691         * class.cs: ditto.
8692
8693         * statement.cs: Use a bitfield;  Do not initialize to null things
8694         which are done by the constructor by default.
8695
8696         * cs-parser.jay: bug fix, parameter was 4, not 3.
8697
8698         * expression.cs: Just use the property;
8699
8700         * statement.cs: No need for GetVariableInfo method.
8701
8702 2003-08-08  Martin Baulig  <martin@ximian.com>
8703
8704         * flowanalysis.cs (FlowReturns): This is now nested in the
8705         `FlowBranching' class.
8706         (MyBitVector): Moved this here from statement.cs.
8707         (FlowBranching.SiblingType): New enum type.
8708         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8709
8710 2003-08-07  Martin Baulig  <martin@ximian.com>
8711
8712         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8713         `FlowBranching' class and called `BranchingType'.
8714
8715 2003-08-07  Martin Baulig  <martin@ximian.com>
8716
8717         * flowanalysis.cs: Moved all the control flow analysis code into
8718         its own file.
8719
8720 2003-08-07  Martin Baulig  <martin@ximian.com>
8721
8722         * assign.cs (Assign.DoResolve): `target' must either be an
8723         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8724         #37319.
8725
8726 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8727
8728         * expression.cs (BinaryMethod): This kind of expression is created by the
8729         Binary class if it determines that the operator has to be handled
8730         by a method.
8731
8732         (BinaryDelegate): This kind of expression is created if we are
8733         dealing with a + or - operator on delegates.
8734
8735         (Binary): remove method, argumetns, and DelegateOperator: when
8736         dealing with methods, 
8737
8738         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8739
8740         * statement.cs (Block): use bitfields for the three extra booleans
8741         we had in use.   Remove unused topblock parameter.
8742
8743         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8744
8745         * assign.cs: Drop extra unneeded tests.
8746
8747 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8748
8749         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8750
8751         * statement.cs (Foreach): Use VariableStorage instead of
8752         LocalBuilders.   
8753
8754         * codegen.cs (VariableStorage): New class used by clients that
8755         require a variable stored: locals or fields for variables that
8756         need to live across yield.
8757
8758         Maybe provide a convenience api for EmitThis+EmitLoad?
8759
8760         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8761         these bad boys.
8762
8763 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8764
8765         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8766         RemapParameterLValue): New methods that are used to turn a
8767         precomputed FieldInfo into an expression like this:
8768
8769                 instance.FieldInfo
8770
8771         The idea is to use this instead of making LocalVariableReference
8772         have more than one meaning.
8773
8774         * cs-parser.jay: Add error production to BASE.
8775
8776         * ecore.cs: Deal with TypeManager.GetField returning null, which
8777         is now a valid return value.
8778
8779         (FieldExprNoAddress): New expression for Fields whose address can
8780         not be taken.
8781
8782         * expression.cs (LocalVariableReference): During the resolve
8783         phases, create new expressions if we are in a remapping context.
8784         Remove code that dealt with remapping here.
8785
8786         (ParameterReference): same.
8787
8788         (ProxyInstance): New expression, like the `This' expression, but
8789         it is born fully resolved.  We know what we are doing, so remove
8790         the errors that are targeted to user-provided uses of `this'.
8791
8792         * statement.cs (Foreach): our variable is now stored as an
8793         Expression;  During resolution, follow the protocol, dont just
8794         assume it will return this.
8795
8796 2003-08-06  Martin Baulig  <martin@ximian.com>
8797
8798         * support.cs (SeekableStreamReader.cs): New public class.
8799
8800         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8801         SeekableStreamReader instead of the normal StreamReader.
8802
8803 2003-08-04  Martin Baulig  <martin@ximian.com>
8804
8805         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8806         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8807         deambiguate casts and delegate invocations.
8808         (parenthesized_expression): Use the new tokens to ensure this is
8809         not a cast of method invocation.
8810
8811         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8812         when reading a `)' and Deambiguate_CloseParens () was previously
8813         called.
8814
8815         * expression.cs (ParenthesizedExpression): New class.  This is
8816         just used for the CS0075 test.
8817         (Binary.DoResolve): Check for CS0075.   
8818
8819 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8820
8821         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8822         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8823         reference comparison.
8824
8825         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8826         examine the ReturnType for equality - this is necessary in the
8827         cases of implicit and explicit operators whose signature also
8828         includes the return type.
8829
8830 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8831
8832         * namespace.cs: Cache the result of the namespace computation,
8833         instead of computing it every time.
8834
8835 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8836
8837         * decl.cs: Use a global arraylist that we reuse over invocations
8838         to avoid excesive memory consumption.  Reduces memory usage on an
8839         mcs compile by one meg (45 average).
8840
8841         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8842         private, work around that.
8843
8844 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * literal.cs (IntLiteral): Define Zero and One static literals. 
8847
8848         * cs-parser.jay (integer_literal): use static literals to reduce
8849         memory usage for the most used literals (0, 1 and -1).  211kb
8850         reduced in memory usage.
8851
8852         Replace all calls to `new ArrayList' with `new
8853         ArrayList(4)' which is a good average number for most allocations,
8854         and also requires only 16 bytes of memory for its buffer by
8855         default. 
8856
8857         This reduced MCS memory usage in seven megabytes for the RSS after
8858         bootstrapping.
8859
8860 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8861
8862         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8863         handle params methods the correct way by forming only one
8864         applicable set with params and normal methods in them. Earlier we
8865         were looking at params methods only if we found no normal methods
8866         which was not the correct thing to do.
8867
8868         (Invocation.BetterFunction): Take separate arguments indicating
8869         when candidate and the best method are params methods in their
8870         expanded form.
8871
8872         This fixes bugs #43367 and #46199.
8873
8874         * attribute.cs: Documentation updates.
8875
8876         (CheckAttribute): Rename to CheckAttributeTarget.
8877         (GetValidPlaces): Rename to GetValidTargets.
8878
8879         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8880         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8881
8882         Fixes bug #44468.
8883
8884 2003-07-28  Martin Baulig  <martin@ximian.com>
8885
8886         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8887         name when looking up the base class of a nested class.  Fixes #46977.
8888
8889 2003-07-26  Martin Baulig  <martin@ximian.com>
8890
8891         * expression.cs (Indexers.Indexer): New nested struct; contains
8892         getter, setter and the indexer's type.
8893         (Indexers.Properties): This is now an ArrayList of
8894         Indexers.Indexer's.
8895         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8896         indexer doesn't have any getters.
8897
8898         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8899         for embedded property and indexer assignments.
8900
8901 2003-07-26  Martin Baulig  <martin@ximian.com>
8902
8903         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8904         preprocessor directive is not the first non-whitespace character
8905         on a line.
8906
8907 2003-07-26  Martin Baulig  <martin@ximian.com>
8908
8909         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8910         namespace parsing, follow the spec more closely.
8911
8912         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8913         NamespaceEntry.Lookup().
8914
8915 2003-07-25  Martin Baulig  <martin@ximian.com>
8916
8917         * MethodCore.cs (OverridesSomething): New public field; it's set
8918         from TypeContainer.DefineMembers if this method overrides
8919         something (which doesn't need to be a method).  Fix #39462.
8920
8921 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8922
8923         * typemanager.cs (GetMembers): Ensure that the list of members is
8924         reversed. This keeps things in sync.
8925
8926         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8927         find an AttributeUsage attribute.
8928
8929         * expression.cs (Invocation.OverloadResolve): Perform the check
8930         which disallows Invoke to be directly called on a Delegate.
8931
8932         (Error_InvokeOnDelegate): Report error cs1533.
8933
8934 2003-07-25  Martin Baulig  <martin@ximian.com>
8935
8936         * expression.cs (Indexers.GetIndexersForType): Only look in the
8937         interface hierarchy if the requested type is already an
8938         interface.  Fixes #46788 while keeping #46502 fixed.
8939
8940 2003-07-25  Martin Baulig  <martin@ximian.com>
8941
8942         * class.cs (TypeContainer.DefineMembers): Check whether all
8943         readonly fields have been assigned and report warning CS0649 if
8944         not.
8945
8946         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8947         a valuetype.
8948
8949 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8950
8951         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8952         returned from GetMethods to make things consistent with the
8953         assumptions MCS makes about ordering of methods.
8954
8955         This should comprehensively fix bug #45127 and it does :-)
8956
8957         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8958         ordering is actually reverse.
8959
8960         * Clean up some debug messages I left lying around.
8961
8962         * interface.cs (Populate*): Get rid of code which emits attributes
8963         since the stage in which we emit attributes is the 'Emit' stage,
8964         not the define stage.
8965
8966         (Emit): Move attribute emission for interface members here.
8967
8968 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8969
8970         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8971         closely: we eliminate methods in base types when we have an
8972         applicable method in a top-level type.
8973
8974         Please see section 14.5.5.1 for an exact description of what goes
8975         on. 
8976
8977         This fixes bug #45127 and a host of other related to corlib compilation.
8978
8979         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8980         array is the method corresponding to the top-level type (this is
8981         because of the changes made to icall.c) so we change this
8982         accordingly.
8983
8984         (MethodGroupExpr.Name): This too.
8985
8986         * typemanager.cs (GetElementType): New method which does the right
8987         thing when compiling corlib. 
8988
8989         * everywhere: Make use of the above in the relevant places.
8990
8991 2003-07-22  Martin Baulig  <martin@ximian.com>
8992
8993         * cs-parser.jay (invocation_expression): Moved
8994         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8995         `cast_expression', but create a InvocationOrCast which later
8996         resolves to either an Invocation or a Cast.
8997
8998         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8999         method; call this before EmitStatement() to make sure that this
9000         expression can be used as a statement.
9001
9002         * expression.cs (InvocationOrCast): New class; resolves to either
9003         an Invocation or a Cast.
9004
9005         * statement.cs (StatementExpression): Call ResolveStatement() on
9006         the ExpressionStatement before emitting it.
9007
9008 2003-07-21  Martin Baulig  <martin@ximian.com>
9009
9010         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9011         `ref' and `out' attributes match; fixes #46220.
9012         (MemberAccess.ResolveMemberAccess): You can't reference a type
9013         through an expression; fixes #33180.
9014         (Indexers.GetIndexersForType): Don't return the indexers from
9015         interfaces the class implements; fixes #46502.
9016
9017 2003-07-21  Martin Baulig  <martin@ximian.com>
9018
9019         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9020         CS0661 checks; fixes bug #30442.
9021
9022 2003-07-21  Martin Baulig  <martin@ximian.com>
9023
9024         * decl.cs (AdditionResult): Added `Error'.
9025
9026         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9027
9028         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9029         makes cs0031.cs actually work.
9030
9031 2003-07-20  Martin Baulig  <martin@ximian.com>
9032
9033         * namespace.cs: Fixed that bug which caused a crash when compiling
9034         the debugger's GUI.
9035
9036 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * typemanager.cs (LookupTypeReflection): Never expose types which
9039         are NotPublic, NestedPrivate, NestedAssembly, or
9040         NestedFamANDAssem.  We used to return these, and later do a check
9041         that would report a meaningful error, but the problem is that we
9042         would not get the real match, if there was a name override.
9043
9044 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9045
9046         * namespace.cs (Namespace, Name): Do not compute the namespace
9047         name dynamically, compute it in the constructor.  This reduced
9048         memory usage by 1697 KB.
9049
9050         * driver.cs: Use --pause to pause at the end.
9051
9052 2003-07-17  Peter Williams  <peter@newton.cx>
9053
9054         * Makefile: Change the name of the test target so that it doesn't
9055         conflict with the recursive test target.
9056
9057 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9058
9059         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9060         AddressOf): Do not use EmitThis, that was wrong, use the actual
9061         this pointer.
9062
9063 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9064
9065         * class.cs (MethodData.Define): While checking if a method is an
9066         interface implementation, improve the test: If we are not public
9067         (use new test here: use the computed MethodAttributes directly,
9068         instead of the parsed modifier flags) check if the `implementing'
9069         method comes from an interface or not.
9070
9071         * pending.cs (VerifyPendingMethods): Slightly better error
9072         message.
9073
9074         * makefile: add test target that does the mcs bootstrap.
9075
9076 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9077
9078         * interface.cs (Define): Do nothing here since there are no
9079         members to populate etc. Move the attribute emission out of here
9080         since this was just totally the wrong place to put it. Attribute
9081         application happens during the 'Emit' phase, not in the 'Define'
9082         phase.
9083
9084         (Emit): Add this method and move the attribute emission here
9085
9086         * rootcontext.cs (EmitCode): Call the Emit method on interface
9087         types too.
9088
9089 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9090
9091         * expression.cs (OverloadResolve): Report error only if Location
9092         is not 'Null' which means that there was a probe going on.
9093
9094 2003-07-14  Martin Baulig  <martin@ximian.com>
9095
9096         * expression.cs (ConditionalLogicalOperator): New public class to
9097         implement user defined conditional logical operators.
9098         This is section 14.11.2 in the spec and bug #40505.
9099
9100 2003-07-14  Martin Baulig  <martin@ximian.com>
9101
9102         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9103
9104 2003-07-14  Martin Baulig  <martin@ximian.com>
9105
9106         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9107
9108         * ecore.cs (IVariable.VerifyFixed): New interface method.
9109
9110         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9111         operator, check whether the variable is actually fixed.  Fixes bug
9112         #36055.  Set a variable definitely assigned when taking its
9113         address as required by the spec.
9114
9115         * statement.cs (LocalInfo.IsFixed): New field.
9116         (LocalInfo.MakePinned): Set `IsFixed' to true.
9117
9118 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9119
9120         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9121         for .ctors, ensure that we only ask for members declared in the
9122         attribute type (BindingFlags.DeclaredOnly).
9123
9124         Fixes bug #43632.
9125
9126         * expression.cs (Error_WrongNumArguments): Report error 1501
9127         correctly the way CSC does.
9128
9129 2003-07-13  Martin Baulig  <martin@ximian.com>
9130
9131         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9132         lookup on the fully qualified name, to make things like "X.X" work
9133         where "X.X" is a fully qualified type name, but we also have a
9134         namespace "X" in the using list.  Fixes #41975.
9135
9136 2003-07-13  Martin Baulig  <martin@ximian.com>
9137
9138         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9139         function. If we're a CompoundAssign, we need to create an embedded
9140         CompoundAssign, not an embedded Assign.
9141         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9142         Fixes #45854.
9143
9144 2003-07-13  Martin Baulig  <martin@ximian.com>
9145
9146         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9147         work to fix bug #46088.
9148
9149 2003-07-13  Ravi Pratap <ravi@ximian.com>
9150
9151         * class.cs (Operator.Emit): Do not emit attributes here - it is
9152         taken care of by the Method class that we delegate too. This takes
9153         care of bug #45876.
9154
9155 2003-07-10  Martin Baulig  <martin@ximian.com>
9156
9157         * expression.cs (TypeOfVoid): New class.
9158         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9159
9160 2003-07-10  Martin Baulig  <martin@ximian.com>
9161
9162         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9163         bug #35957.
9164
9165 2003-07-10  Martin Baulig  <martin@ximian.com>
9166
9167         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9168         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9169
9170         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9171
9172         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9173
9174 2003-07-10  Martin Baulig  <martin@ximian.com>
9175
9176         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9177         of decimal.  Fixes #42850.
9178
9179         NOTE: I also fixed the created byte blob, but this doesn't work on
9180         the MS runtime and csc never produces any byte blobs for decimal
9181         arrays.
9182
9183 2003-07-10  Martin Baulig  <martin@ximian.com>
9184
9185         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9186         structs; fixes #32068.
9187         (Block.AddChildVariableNames): Fixed #44302.
9188
9189 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9190
9191         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9192
9193 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9194
9195         * attribute.cs: And this test is onger needed.
9196
9197 2003-07-08  Martin Baulig  <martin@ximian.com>
9198
9199         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9200         inaccessible types.  Fixes #36313.
9201
9202         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9203
9204         * namespace.cs (NamespaceEntry): Create implicit entries for all
9205         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9206         implicit entries for N1.N2 and N1.
9207
9208 2003-07-08  Martin Baulig  <martin@ximian.com>
9209
9210         Rewrote the handling of namespaces to fix a lot of the issues
9211         wrt. `using' aliases etc.
9212
9213         * namespace.cs (Namespace): Splitted this class into a
9214         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9215
9216         * typemanager.cs (TypeManager.IsNamespace): Removed.
9217         (TypeManager.ComputeNamespaces): Only compute namespaces from
9218         loaded assemblies here, not the namespaces from the assembly we're
9219         currently compiling.
9220
9221 2003-07-08  Martin Baulig  <martin@ximian.com>
9222
9223         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9224
9225 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9226
9227         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9228         already fixed it.  
9229
9230         I thought about the memory savings here, but LookupTypeReflection
9231         is used under already very constrained scenarios.  Compiling
9232         corlib or mcs only exposes one hit, so it would not really reduce
9233         any memory consumption.
9234
9235 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9236
9237         * typemanager.cs: fixes bug #45889 by only adding public types from
9238         other assemblies to the list of known types.
9239
9240 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9241
9242         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9243         on the type we resolved.
9244
9245 2003-07-05  Martin Baulig  <martin@ximian.com>
9246
9247         * pending.cs (PendingImplementation.ParentImplements): Don't
9248         create the proxy if the parent is abstract.
9249
9250         * class.cs (TypeContainer.DefineIndexers): Process explicit
9251         interface implementations first.  Fixes #37714.
9252
9253 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9254
9255         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9256         defined recursively;  but since we modify the input parameters
9257         (left is set to `this' temporarily), we reset this value if the
9258         left_is_explicit is false, which gives the original semantics to
9259         the code.  
9260
9261         * literal.cs (NullPointer): new class used to represent a null
9262         literal in a pointer context.
9263
9264         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9265         type is a pointer, use a NullPointer object instead of a
9266         NullLiteral.   Closes 43687
9267
9268         (ExplicitConversion): Convert pointer values using
9269         the conv opcode to the proper type.
9270
9271         * ecore.cs (New): change ValueTypeVariable property into a method,
9272         that returns whether the valuetype is suitable for being used.
9273
9274         * expression.cs (Binary.DoNumericPromotions): Only return if we
9275         the int constant was a valid uint, and we can return both left and
9276         right as uints.  If not, we continue processing, to trigger the
9277         type conversion.  This fixes 39018.
9278
9279         * statement.cs (Block.EmitMeta): During constant resolution, set
9280         the CurrentBlock property on the emitcontext, so that we resolve
9281         constants propertly.
9282
9283 2003-07-02  Martin Baulig  <martin@ximian.com>
9284
9285         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9286         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9287
9288         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9289         than emitting it here.
9290
9291         * statement.cs: Fixed some more flow analysis bugs.
9292
9293 2003-07-02  Martin Baulig  <martin@ximian.com>
9294
9295         * class.cs (MethodData.Define): When implementing interface
9296         methods, set Final unless we're Virtual.
9297
9298         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9299         check work for interface methods.
9300
9301 2003-07-01  Martin Baulig  <martin@ximian.com>
9302
9303         * ecore.cs (EmitContext.This): Replaced this property with a
9304         GetThis() method which takes a Location argument.  This ensures
9305         that we get the correct error location for a CS0188.
9306
9307 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9308
9309         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9310         ImplicitStandardConversion.
9311
9312         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9313
9314 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9315
9316         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9317         optimization.
9318
9319 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9320
9321         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9322         constructors.
9323
9324         (MethodData.Define): Turn off initlocals for unsafe methods.
9325
9326 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9329         complete;  Fixes #37521.
9330
9331         * delegate.cs: Use Modifiers.TypeAttr to compute the
9332         TypeAttributes, instead of rolling our own.  This makes the flags
9333         correct for the delegates.
9334
9335 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * class.cs (Constructor.Define): Set the private flag for static
9338         constructors as well.
9339
9340         * cs-parser.jay (statement_expression): Set the return value to
9341         null, to avoid a crash when we catch an error.
9342
9343 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * cs-parser.jay: Applied patch from Jackson that adds support for
9346         extern and unsafe modifiers to destructor declarations.
9347
9348         * expression.cs: Report error 21 if the user is trying to index a
9349         System.Array.
9350
9351         * driver.cs: Add an error message, suggested by the bug report.
9352
9353         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9354         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9355
9356 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9357
9358         * namespace.cs: Add some information to reduce FAQs.
9359
9360 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9361
9362         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9363         underlying enumeration types.  Fixes #43915.
9364
9365         * expression.cs: Treat ushort/short as legal values to be used in
9366         bitwise operations.
9367
9368 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9369
9370         * delegate.cs: transfer custom attributes for paramenters from
9371         the delegate declaration to Invoke and BeginInvoke.
9372
9373 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9374
9375         * attribute.cs: handle custom marshalers and emit marshal info
9376         for fields, too.
9377
9378 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9379
9380         * makefile.gnu: Added anonymous.cs to the compiler sources.
9381
9382 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9383
9384         * iterators.cs: Change the name of the proxy class to include two
9385         underscores.
9386
9387         * cs-parser.jay: Update grammar to include anonymous methods.
9388
9389         * anonymous.cs: new file.
9390
9391 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9392
9393         * class.cs (Field.Define): Add missing test for pointers and
9394         safety. 
9395
9396 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9397
9398         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9399         we use the stobj opcode.
9400
9401         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9402         since it wasn't the correct fix. 
9403
9404         It still is puzzling that we are required to use stobj for IntPtr
9405         which seems to be a ValueType.
9406
9407 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9408
9409         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9410         during regular simple name resolution.   Now, the trick is that
9411         instead of returning for processing the simplename, we do a
9412         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9413         contextual lookup type).   If a match is found, return that, if
9414         not, return for further composition.
9415
9416         This fixes long-standing 30485.
9417
9418         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9419         using the address to initialize an object, do an Stobj instead of
9420         using the regular Stelem.
9421
9422         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9423         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9424         Because if we are a BaseIndexerAccess that value will be true.
9425         Fixes 43643.
9426
9427         * statement.cs (GotoCase.Resolve): Return after reporting an
9428         error, do not attempt to continue. 
9429
9430         * expression.cs (PointerArithmetic.Emit): If our operand is a
9431         long, convert our constants to match the operand before
9432         multiplying.  Convert to I type before adding.   Fixes 43670.
9433
9434 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9435
9436         * enum.cs (ImplicitConversionExists) : Rename to
9437         ImplicitEnumConversionExists to remove ambiguity. 
9438
9439         * ecore.cs (NullCast): New type of cast expression class which
9440         basically is very similar to EmptyCast with the difference being
9441         it still is a constant since it is used only to cast a null to
9442         something else
9443         (eg. (string) null)
9444
9445         * convert.cs (ImplicitReferenceConversion): When casting a null
9446         literal, we return a NullCast.
9447
9448         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9449         should be around anymore.
9450
9451         The renaming (reported was slightly wrong). Corrections:
9452
9453         ConvertImplicitStandard -> ImplicitConversionStandard
9454         ConvertExplicitStandard -> ExplicitConversionStandard
9455
9456         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9457         before passing them in !
9458
9459         * convert.cs (ImplicitConversionStandard): When comparing for
9460         equal expr and target types, ensure that expr is not a
9461         NullLiteral.
9462
9463         In general, we must not be checking (expr_type ==
9464         target_type) in the top level conversion methods
9465         (ImplicitConversion, ExplicitConversion etc). This checking is
9466         done in the methods that they delegate to.
9467
9468 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9469
9470         * convert.cs: Move Error_CannotConvertType,
9471         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9472         ImplicitNumericConversion, ImplicitConversionExists,
9473         ImplicitUserConversionExists, StandardConversionExists,
9474         FindMostEncompassedType, FindMostSpecificSource,
9475         FindMostSpecificTarget, ImplicitUserConversion,
9476         ExplicitUserConversion, GetConversionOperators,
9477         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9478         TryImplicitIntConversion, Error_CannotConvertImplicit,
9479         ConvertImplicitRequired, ConvertNumericExplicit,
9480         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9481         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9482         its own file.
9483
9484         Perform the following renames:
9485
9486         StandardConversionExists -> ImplicitStandardConversionExists
9487         ConvertImplicit -> ImplicitConversion
9488         ConvertImplicitStandard -> ImplicitStandardConversion
9489         TryImplicitIntConversion -> ImplicitIntConversion
9490         ConvertImplicitRequired -> ImplicitConversionRequired
9491         ConvertNumericExplicit -> ExplicitNumericConversion
9492         ConvertReferenceExplicit -> ExplicitReferenceConversion
9493         ConvertExplicit -> ExplicitConversion
9494         ConvertExplicitStandard -> ExplicitStandardConversion
9495
9496 2003-05-19  Martin Baulig  <martin@ximian.com>
9497
9498         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9499         (TypeInfo): Added support for structs having structs as fields.
9500
9501         * ecore.cs (FieldExpr): Implement IVariable.
9502         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9503         VariableInfo for the field.
9504
9505 2003-05-18  Martin Baulig  <martin@ximian.com>
9506
9507         * expression.cs (This.DoResolve): Report a CS0027 if we're
9508         emitting a field initializer.
9509
9510 2003-05-18  Martin Baulig  <martin@ximian.com>
9511
9512         * expression.cs (This.ResolveBase): New public function.
9513         (This.DoResolve): Check for CS0188.
9514
9515         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9516         This.Resolve().
9517
9518         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9519         `instance_expression' to null if we don't have any non-static
9520         methods.
9521
9522 2003-05-18  Martin Baulig  <martin@ximian.com>
9523
9524         Reworked the way how local variables and parameters are handled by
9525         the flow analysis code.
9526
9527         * statement.cs (TypeInfo, VariableMap): New public classes.
9528         (VariableInfo): New public class.  This is now responsible for
9529         checking whether a variable has been assigned.  It is used for
9530         parameters and local variables.
9531         (Block.EmitMeta): Take the InternalParameters as argument; compute
9532         the layout of the flow vectors here.
9533         (Block.LocalMap, Block.ParameterMap): New public properties.
9534         (FlowBranching): The .ctor doesn't get the InternalParameters
9535         anymore since Block.EmitMeta() now computes the layout of the flow
9536         vector.
9537         (MyStructInfo): This class is now known as `StructInfo' and nested
9538         in `TypeInfo'; we don't access this directly anymore.
9539
9540         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9541         property and removed IsAssigned(), IsFieldAssigned(),
9542         SetAssigned() and SetFieldAssigned(); we now call them on the
9543         VariableInfo so we don't need to duplicate this code everywhere.
9544
9545         * expression.cs (ParameterReference): Added `Block block' argument
9546         to the .ctor.
9547         (LocalVariableReference, ParameterReference, This): The new
9548         VariableInfo class is now responsible for all the definite
9549         assignment stuff.
9550
9551         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9552         IsParameterAssigned, SetParameterAssigned): Removed.
9553
9554 2003-05-18  Martin Baulig  <martin@ximian.com>
9555
9556         * typemanager.cs (InitCoreTypes): Try calling
9557         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9558         the 3-args-version.  Corlib now also needs our `void_type'.
9559         (GetMethod): Added overloaded version which takes an optional
9560         `bool report_errors' to allow lookups of optional methods.
9561
9562 2003-05-12  Martin Baulig  <martin@ximian.com>
9563
9564         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9565         only used for locals and not for parameters.
9566
9567 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9568
9569         * support.cs (InternalParameters.ParameterType): Return the
9570         ExternalType of the parameter.
9571
9572         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9573         they were unused.
9574
9575 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9576
9577         * class.cs (MethodData.Define): Do not set the `newslot' on
9578         interface members, if they are also flagged as "override".
9579
9580         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9581         better code for ++i and i++.  This only works for static fields
9582         and local variables.
9583
9584         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9585         want to pull the DeclSpace out of the builder_to_declspace instead
9586         of the TypeBuilder (like in TypeContainer.FindMembers).
9587
9588         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9589         instead of LookupTypeContainer.  Fixes the crash on .NET for
9590         looking up interface members.
9591
9592         * const.cs: Create our own emit context during the Definition
9593         stage, so that constants are evaluated in the proper context, when
9594         a recursive definition happens.
9595
9596 2003-05-11  Martin Baulig  <martin@ximian.com>
9597
9598         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9599         new block for a switch section.
9600         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9601         the adding/lookup in the switch block.  Fixes #39828.
9602
9603 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9604
9605         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9606         functionality: I needed to convert the data after I had performed
9607         the add/sub operation into the operands type size.
9608
9609         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9610         pass the type for the box operation, otherwise the resulting
9611         object would have been of type object.
9612
9613         (BoxedCast): Add constructor to specify the type to box as.
9614
9615 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9616
9617         * iterators.cs: I was reusing the `count' variable inadvertently,
9618         take steps to not allow this to happen.
9619
9620 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9621
9622         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9623         by creating an array at the point where the params starts and
9624         putting all those arguments there, then adjusting the size of the
9625         array.
9626
9627 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * expression.cs (New.AddressOf): Implement interface
9630         IMemoryLocation.  This is used when the `new' operator is used in
9631         the context of an invocation to a method on a value type.
9632
9633         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9634         example. 
9635
9636         * namespace.cs: Also check the using aliases here.
9637
9638         * driver.cs: Move the test for using validity after the types have
9639         been entered, so we do a single pass that also includes the using
9640         aliases. 
9641
9642         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9643         in the regular case.   CreateSiblingForFinally is doing extra
9644         error checking.
9645
9646         * attribute.cs (GetAttributeArgumentExpression): Store the result
9647         on an out value, and use the return value to indicate failure
9648         instead of using null (which is a valid return for Constant.GetValue).
9649
9650         * statement.cs: Perform the analysis flow for the increment
9651         portion after the statement, because this will be the real flow of
9652         execution.  Fixes #42385
9653
9654         * codegen.cs (EmitContext.EmitArgument,
9655         EmitContext.EmitStoreArgument): New helper functions when the
9656         RemapToProxy flag is set.
9657
9658         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9659         function.
9660
9661         Add support for remapping parameters. 
9662
9663         * iterators.cs: Propagate parameter values;  Store parameter
9664         values in the proxy classes.
9665
9666 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9667
9668         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9669         need a proxy reference;  I do not know what I was thinking
9670
9671         * cs-parser.jay (constructor_initializer): catch another error,
9672         and display nice message.
9673
9674         (field_declaration): catch void field declaration
9675         to flag a better error. 
9676
9677         * class.cs (MemberBase.CheckBase): Report an error instead of a
9678         warning if a new protected member is declared in a struct. 
9679         (Field.Define): catch the error of readonly/volatile.
9680
9681         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9682
9683         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9684         volatile variable is taken
9685
9686 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9687
9688         * statement.cs (Fixed.Resolve): Report an error if we are not in
9689         an unsafe context.
9690
9691 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9692
9693         * typemanager.cs: reuse the code that handles type clashes for
9694         delegates and enumerations.
9695
9696         * class.cs (Report28): Always report.
9697
9698         * expression.cs (EncodeAsAttribute): Allow nulls here.
9699
9700 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9701
9702         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9703         the functionality for testing whether an expression is valid for
9704         an attribute here.  Also handle the case of arrays of elements
9705         being stored. 
9706
9707         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9708         encoding a linear array into an array of objects that are suitable
9709         to be passed to an CustomAttributeBuilder.
9710
9711         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9712
9713         * ecore.cs: (FieldExpr): Handle field remapping here.
9714
9715         * iteratators.cs: Pass the instance variable (if the method is an
9716         instance method) to the constructors, so we can access the field
9717         variables on the class.
9718
9719         TODO: Test this with structs.  I think the THIS variable on
9720         structs might have to be a pointer, and not a refenrece
9721
9722 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9723
9724         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9725         local variables to fields in a proxy class.
9726
9727         * iterators.cs (PopulateProxy): Rename our internal fields to
9728         <XXX>.  
9729         Create a <THIS> field if we are an instance method, so we can
9730         reference our parent container variables.
9731         (MapVariable): Called back from the EmitContext code to enter a
9732         new variable to field mapping into the proxy class (we just create
9733         a FieldBuilder).
9734
9735         * expression.cs
9736         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9737         for using the remapped locals to fields.
9738
9739         I placed the code here, because that gives the same semantics to
9740         local variables, and only changes the Emit code.
9741
9742         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9743         statements inside iterators.
9744         (VariableInfo): Add a FieldBuilder for the cases when we are
9745         remapping local variables to fields in a proxy class
9746
9747         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9748         current_block != null.
9749
9750         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9751         not cope with strings, as it has been moved to the
9752         TableSwitchEmit.  Fixed bug in switch generation.
9753
9754         * expression.cs (New.DoResolve): Provide more context for the user
9755         when reporting an error.
9756
9757         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9758         pointers. 
9759
9760         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9761         check the permissions for it.  Note than in a type-resolution
9762         context the check was already present in DeclSpace.ResolveType,
9763         but was missing from the MemberAccess.
9764
9765         (ArrayCreation.CheckIndices): warn if the user has
9766         more nested levels of expressions, but there are no more
9767         dimensions specified.  Avoids crash on bug 41906.
9768
9769 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9770
9771         * statement.cs (Block): replace Implicit bool, for a generic
9772         flags.   
9773         New flag: `Unchecked'.  This is used during the EmitMeta phase
9774         (which is out-of-line with the regular Resolve/Emit process for a
9775         statement, as this is done ahead of time, but still gets a chance
9776         to call constant resolve).
9777
9778         (Block.Flags): new enum for adding a new flag.
9779
9780         (Block.EmitMeta): track the state of unchecked.
9781
9782         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9783         to enable constant resolution to work there as well.
9784
9785 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9786
9787         * typemanager.cs (ienumerable_type): Also look up
9788         System.Collections.IEnumerable. 
9789
9790 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9791
9792         TODO: Test more than one conditional per method.
9793
9794         * class.cs (Indexer.Define): Report the location where the user is
9795         referencing the unsupported feature.
9796
9797         (MethodData): Overload the use of `conditionals' to
9798         minimize the creation of needless ArrayLists.   This saves roughly
9799         212kb on my machine.
9800
9801         (Method): Implement the new IIteratorContainer interface.
9802         (Method.SetYields): Implement the method by setting the ModFlags
9803         to contain METHOD_YIELDS.
9804
9805         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9806         which just got set to null.
9807
9808         * iterators.cs: New file.
9809
9810         (Yield, YieldBreak): New statements.
9811
9812         * statement.cs (Return.Resolve): Flag an error if we are used in
9813         an iterator method.
9814
9815         * codegen.cs (InIterator): New flag set if the code is being
9816         compiled in an iterator method.
9817
9818         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9819         internal modifier, and we just use it to avoid adding extra
9820         fields, as this is seldom used.  
9821
9822         * cs-parser.jay: Add yield_statement (yield and yield break).
9823
9824         * driver.cs: New flag -v2 to turn on version 2 features. 
9825
9826         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9827         hashtable when v2 is enabled.
9828
9829 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9830
9831         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9832         there is already a namespace defined with this name.
9833
9834         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9835         people upgraded their corlibs.
9836
9837         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9838         always use fully qualified types, no need to use the compiler
9839         front end.
9840
9841         (TypeManager.IsNamespace): Use binarysearch.
9842
9843         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9844         AddDelegate): I did not quite use the new IsValid API properly: I
9845         have to pass the short-name and the fullname.  I was passing only
9846         the basename instead of the fullname sometimes. 
9847
9848         (TypeContainer.DefineType): call NamespaceClash.
9849
9850         * interface.cs (Interface.DefineType): use NamespaceClash before
9851         defining the type.
9852
9853         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9854         defining the type.
9855
9856         * enum.cs: (Enum.DefineType): use NamespaceClash before
9857         defining the type.
9858
9859         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9860         speed increase.  First, use the negative_hits cache when we get a
9861         negative.  Second, add the type with its full original name
9862         instead of the new . and + encoded name (reflection uses + to
9863         separate type from a nested type).  Use LookupTypeReflection
9864         directly which bypasses the type->name hashtable (that we already
9865         know does not contain the type.
9866
9867         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9868         location/container type. 
9869
9870         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9871
9872 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9873
9874         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9875
9876         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9877         method is being referenced in the method group from a static
9878         context, and report error 120 if so.
9879
9880         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9881         Error118. 
9882
9883         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9884         is created, we create the A namespace).
9885
9886         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9887         Fixes #41591
9888
9889 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9890
9891         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9892         invocation to ModuleBuilder.GetType with the same values will
9893         return a new type instance, so we need to cache its return
9894         values. 
9895
9896         * expression.cs (Binary.ResolveOperator): Only allow the compare
9897         operators on enums if they are of the same type.
9898
9899         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9900         types of ValueType on their own case.  Before we were giving them
9901         the same treatment as objects.
9902
9903         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9904         fullname.  Short name is used to compare against container name.
9905         Fullname is used to check against defined namespace names.
9906
9907         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9908         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9909
9910         (Method.CheckBase): Call parent.
9911         (MemberBase.CheckBase): Check for protected members on sealed
9912         classes.
9913         (PropertyBase.CheckBase): Call parent.
9914         (Field.Define): Call parent.
9915
9916         * report.cs: Negative error codes are now mapped to 8000 - code,
9917         so that the display is render more nicely.
9918
9919         * typemanager.cs: Do not use try/catch, instead report a regular
9920         error. 
9921
9922         (GetPointerType, GetReferenceType): These methods provide
9923         mechanisms to obtain the T* and T& from a T.  We had the code
9924         previously scattered around the code base, and it also used
9925         TypeManager.LookupType that would go through plenty of caches.
9926         This one goes directly to the type source.
9927
9928         In some places we did the Type.GetType followed by
9929         ModuleBuilder.GetType, but not in others, so this unifies the
9930         processing as well.
9931
9932         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9933         statements now that we have namespace information.
9934
9935         * typemanager.cs (IsNamespace): New method, returns whether the
9936         string presented is a namespace or not.
9937
9938         (ComputeNamespaces): New public entry point, computes the list of
9939         available namespaces, using the GetNamespaces API call in Mono, or
9940         the slower version in MS.NET.   
9941
9942         Now before we start the semantic analysis phase, we have a
9943         complete list of namespaces including everything that the user has
9944         provided.
9945
9946         Deleted old code to cache namespaces in .nsc files.
9947
9948 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9949
9950         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9951         class/struct location definition Location for the implicit
9952         constructor location.
9953
9954         (Operator.Define): Use the location of the operator for the
9955         implicit Method definition.
9956
9957         (Constructor.Emit): use the constructor location for the implicit
9958         base initializer constructor.
9959
9960         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9961         and the Expression class now contains two new methods:
9962
9963         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9964         isolate type lookup from the rest of the resolution process.
9965
9966         Since we use Expressions to hold type definitions due to the way
9967         we parse the input we have historically overloaded Resolve to
9968         perform the Type lookups if a special flag is passed.  Now this is
9969         eliminated and two methods take their place. 
9970
9971         The differences in the two methods between xStep and xTerminal is
9972         that xStep is involved in our current lookup system that uses
9973         SimpleNames to compose a name, while xTerminal is used just to
9974         catch the case where the simplename lookup failed.
9975
9976 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9977
9978         * expression.cs (ResolveMemberAccess): Remove redundant code.
9979         TypeExpr expressions are always born fully resolved.
9980
9981         * interface.cs (PopulateMethod): Do not lookup the types twice.
9982         We were doing it once during SemanticAnalysis and once during
9983         PopulateMethod.
9984
9985         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9986         in local variable type definitions, were being returned as a
9987         SimpleName (we decomposed everything into a string), that is
9988         because primary_expression was being used instead of a type in the
9989         grammar (reduce/reduce conflicts).
9990
9991         The part that was wrong is that we converted the expression into a
9992         string (an oversimplification in one hand, compounded with primary
9993         expressions doing string concatenation).
9994
9995         So things like:
9996
9997         A.B.C [] x;
9998
9999         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10000         using clauses from working on this particular context.  And a type
10001         was being matched directly against "A.B.C[]".
10002
10003         We now use the correct approach, and allow for ComposedCast to be
10004         part of the unary expression.  So the "A.B.C []" become a composed
10005         cast of "A.B.C" (as a nested group of MemberAccess with a
10006         SimpleName at the end) plus the rank composition "[]". 
10007
10008         Also fixes 35567
10009
10010 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10011
10012         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10013         for the access level checking.
10014
10015         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10016         `TypeContainer container', because I kept getting confused when I
10017         was debugging this code.
10018
10019         * expression.cs (Indexers): Instead of tracking getters/setters,
10020         we now track them in parallel.  We create one arraylist less, but
10021         most importantly it is possible now for the LValue code to find a
10022         matching get for a set.
10023
10024         (IndexerAccess.DoResolveLValue): Update the code.
10025         GetIndexersForType has been modified already to extract all the
10026         indexers from a type.  The code assumed it did not.
10027
10028         Also make the code set the correct return type for the indexer.
10029         This was fixed a long time ago for properties, but was missing for
10030         indexers.  It used to be void_type.
10031
10032         (Binary.Emit): Test first for doubles instead of
10033         floats, as they are more common.
10034
10035         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10036         when dealing with floats and the <=, >= operators.  This fixes bug
10037         #39314 
10038
10039         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10040         to load the array value by emitting a load on the foreach variable
10041         type.  This was incorrect.  
10042
10043         We now emit the code to load an element using the the array
10044         variable type, and then we emit the conversion operator.
10045
10046         Fixed #40176
10047
10048 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10049
10050         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10051
10052 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10053
10054         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10055         test for protection before we test for signatures. 
10056
10057         (MethodSignature.ToString): implement.
10058
10059         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10060         to the case where we reduced into a LongConstant.
10061
10062         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10063         depend on whether the information is acurrate, because the
10064         Microsoft runtime will always claim that the array type is public,
10065         regardless of the real state.
10066
10067         If the type is a pointer, another problem happens: the type is
10068         reported as non-public in Microsoft.  
10069
10070         In both cases we have to call CheckAccessLevel recursively with
10071         the underlying type as the argument to be tested.
10072
10073 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10074
10075         * assign.cs (Assign.Emit): If we are dealing with a compound
10076         assignment expression, we should use the code path that stores the
10077         intermediate result in a temporary value.  This fixes #40903.
10078
10079         *expression.cs (Indirection.ToString): Provide ToString method for
10080         debugging. 
10081
10082 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10083
10084         * class.cs: Null out fields holding references to Block objects so
10085         they can be garbage collected.
10086
10087         * expression.cs (OverloadResolve): Remove unused local.
10088
10089 2003-04-07  Martin Baulig  <martin@ximian.com>
10090
10091         * codegen.cs (EmitContext.CurrentFile): New public field.
10092         (EmitContext.Mark): Use the CurrentFile to check whether the
10093         location is in the correct file.
10094         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10095
10096 2003-04-07  Martin Baulig  <martin@ximian.com>
10097
10098         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10099
10100         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10101         location.  [FIXME: The location argument which gets passed to this
10102         method is sometimes wrong!]
10103
10104 2003-04-07  Nick Drochak <ndrochak@gol.com>
10105
10106         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10107
10108 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10109
10110         * expression.cs (Indirection.EmitAssign): We were using the
10111         temporary, but returning immediately instead of continuing the
10112         EmitAssing flow.
10113
10114 2003-04-06  Martin Baulig  <martin@ximian.com>
10115
10116         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10117         if it's a nested child, but also deriving from the outer class.
10118         See test 190.cs.
10119
10120         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10121         nested child, but also deriving from the outer class.  See
10122         test-190.cs.
10123         (FilterWithClosure): We may access private members of the outer
10124         class if we're a nested child and deriving from the outer class.
10125         (RealMemberLookup): Only set `closure_private_ok' if the
10126         `original_bf' contained BindingFlags.NonPublic.
10127
10128 2003-04-05  Martin Baulig  <martin@ximian.com>
10129
10130         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10131
10132 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10133
10134         * class.cs (Event.Define): Do not allow abstract events to have
10135         initializers. 
10136
10137 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10138
10139         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10140         block in event declarations.
10141
10142         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10143         value type, get its address.
10144
10145         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10146         leaving a class on the stack instead of a boolean value (int
10147         0/1).  Change the code so we compare against null, and then the
10148         result against zero.
10149
10150         * class.cs (TypeContainer.GetClassBases): We were checking for the
10151         parent class being sealed too late.
10152
10153         * expression.cs (Binary.Emit): For <= and >= when dealing with
10154         floating point values, use cgt.un and clt.un instead of cgt and
10155         clt alone.
10156
10157 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10158
10159         * statement.cs: Apply the same optimization as MS: skip the 
10160         GetEnumerator returning an IEnumerator, and use the one returning a 
10161         CharEnumerator instead. This allows us to avoid the try-finally block 
10162         and the boxing.
10163
10164 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10165
10166         * cs-parser.jay: Attributes cannot be applied to
10167                          namespaces. Fixes #40473
10168
10169 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10170
10171         * class.cs:
10172         (Add*): check if the name is valid using the full name for constants,
10173         fields, properties and events.
10174
10175 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10176
10177         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10178         char constants to be part of the enumeration.
10179
10180         * expression.cs (Conditional.DoResolve): Add support for operator
10181         true. Implements the missing functionality from 14.12
10182
10183         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10184         operator true/false as required by the spec.
10185
10186         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10187         implicit conversion to boolean.
10188
10189         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10190         also one where the type implements `operator true'. 
10191
10192         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10193         get an expression that will invoke operator true based on an
10194         expression.  
10195
10196         (GetConversionOperators): Removed the hack that called op_True
10197         here.  
10198
10199         (Expression.ResolveBoolean): Move this from Statement.
10200
10201 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10202
10203         * ecore.cs (FieldExpr): do not allow initialization of initonly
10204         fields on derived classes
10205
10206 2003-03-13  Martin Baulig  <martin@ximian.com>
10207
10208         * statement.cs (Block.Emit): Call ig.BeginScope() and
10209         ig.EndScope() when compiling with debugging info; call
10210         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10211
10212 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10213
10214         * expression.cs (Indexers): Do not construct immediately, allow
10215         for new members to be appended as we go.  Fixes 38143
10216
10217 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10218
10219         * expression.cs: save/restore context when resolving an unchecked
10220         expression.
10221
10222 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10223
10224         * cfold.cs: Catch division by zero in modulus operator during
10225         constant folding.
10226
10227 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * interface.cs (Interface.DefineMembers): Avoid defining members
10230         twice. 
10231
10232 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10233
10234         * driver.cs: handle the +/- options for -noconfig
10235
10236         * statement.cs (Unckeched.Resolve): Also track the state of
10237         unchecked in the Resolve phase.
10238
10239 2003-02-27  Martin Baulig  <martin@ximian.com>
10240
10241         * ecore.cs (Expression.MemberLookup): Don't create a
10242         MethodGroupExpr for something which is not a method.  Fixes #38291.
10243
10244 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10245
10246         * class.cs (MemberBase.CheckParameters): Also check that the type
10247         is unmanaged if it is a pointer.
10248
10249         * expression.cs (SizeOf.Resolve): Add location information.
10250
10251         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10252         a managed type is declared.
10253
10254         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10255         parameter modifiers as well.  Fixes bug 38606
10256
10257         * class.cs: Very sad.  Am backing out the speed up changes
10258         introduced by the ArrayList -> Array in the TypeContainer, as they
10259         were not actually that much faster, and introduced a bug (no error
10260         reports on duplicated methods).
10261
10262         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10263         source first, this will guarantee that we have a valid expression
10264         before calling in lower levels functions that will require a
10265         resolved object.  Then use this original_source in the
10266         target.ResolveLValue instead of the original source that was
10267         passed to us.
10268
10269         Another change.  Use target.Resolve instead of LValueResolve.
10270         Although we are resolving for LValues, we will let the Assign code
10271         take care of that (it will be called again from Resolve).  This
10272         basically allows code like this:
10273
10274         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10275         class Y { void A (X x) { x [0] += o; }
10276
10277         The problem was that the indexer was trying to resolve for
10278         set_Item (idx, object o) and never finding one.  The real set_Item
10279         was set_Item (idx, X).  By delaying the process we get the right
10280         semantics. 
10281
10282         Fixes bug 36505
10283
10284 2003-02-23  Martin Baulig  <martin@ximian.com>
10285
10286         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10287         while calling DoEmit ().
10288
10289         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10290         source files; if you use the #line directive inside a method, the
10291         compiler stops emitting line numbers for the debugger until it
10292         reaches the end of the method or another #line directive which
10293         restores the original file.
10294
10295 2003-02-23  Martin Baulig  <martin@ximian.com>
10296
10297         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10298
10299 2003-02-23  Martin Baulig  <martin@ximian.com>
10300
10301         * statement.cs (Block.AddChildVariableNames): We need to call this
10302         recursively, not just for our immediate children.
10303
10304 2003-02-23  Martin Baulig  <martin@ximian.com>
10305
10306         * class.cs (Event.Define): Always make the field private, like csc does.
10307
10308         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10309         actually work, fixes bug #37521.
10310
10311 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10312
10313         * delegate.cs: When creating the various temporary "Parameters"
10314         classes, make sure that we call the ComputeAndDefineParameterTypes
10315         on those new parameters (just like we do with the formal ones), to
10316         allow them to be resolved in the context of the DeclSpace.
10317
10318         This fixes the bug that Dick observed in Bugzilla #38530.
10319
10320 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10321
10322         * expression.cs (ResolveMemberAccess): When resolving a constant,
10323         do not attempt to pull a constant if the value was not able to
10324         generate a valid constant.
10325
10326         * const.cs (LookupConstantValue): Do not report more errors than required.
10327
10328 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10329
10330         * expression.cs: fixes bug #38328.
10331
10332 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10333
10334         * class.cs: Changed all the various members that can be part of a
10335         class from being an ArrayList to be an Array of the right type.
10336         During the DefineType type_list, interface_list, delegate_list and
10337         enum_list are turned into types, interfaces, delegates and enums
10338         arrays.  
10339
10340         And during the member population, indexer_list, event_list,
10341         constant_list, field_list, instance_constructor_list, method_list,
10342         operator_list and property_list are turned into their real arrays.
10343
10344         Although we could probably perform this operation earlier, for
10345         good error reporting we need to keep the lists and remove the
10346         lists for longer than required.
10347
10348         This optimization was triggered by Paolo profiling the compiler
10349         speed on the output of `gen-sample-program.pl' perl script. 
10350
10351         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10352         not crash in methods like MemberLookupFailed that use this field.  
10353
10354         This problem arises when the compiler fails to resolve a type
10355         during interface type definition for example.
10356
10357 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10358
10359         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10360         inherit from System.Object, so we have to stop at null, not only
10361         when reaching System.Object.
10362
10363 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10364
10365         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10366         DeclaredOnly because the parent indexer might have had a different
10367         name, but did not loop until the top of the hierarchy was reached.
10368
10369         The problem this one fixes is 35492: when a class implemented an
10370         indexer from an interface, we were getting the interface method
10371         (which was abstract) and we were flagging an error (can not invoke
10372         abstract method).
10373
10374         This also keeps bug 33089 functioning, and test-148 functioning.
10375
10376         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10377         out if a method is special is to see if it is declared in a
10378         property or event, or whether it is one of the predefined operator
10379         names.   This should fix correctly #36804.
10380
10381 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10382
10383         The goal here is to remove the dependency on EmptyCast.Peel ().
10384         Killing it completely.
10385
10386         The problem is that currently in a number of places where
10387         constants are expected, we have to "probe" for an EmptyCast, and
10388         Peel, which is not the correct thing to do, as this will be
10389         repetitive and will likely lead to errors. 
10390
10391         The idea is to remove any EmptyCasts that are used in casts that
10392         can be reduced to constants, so we only have to cope with
10393         constants. 
10394
10395         This bug hunt was triggered by Bug 37363 and the desire to remove
10396         the duplicate pattern where we were "peeling" emptycasts to check
10397         whether they were constants.  Now constants will always be
10398         constants.
10399
10400         * ecore.cs: Use an enumconstant here instead of wrapping with
10401         EmptyCast.  
10402
10403         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10404         throwing me off.  By handling this we can get rid of a few hacks.
10405
10406         * statement.cs (Switch): Removed Peel() code.
10407
10408 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10409
10410         * class.cs: Location information for error 508
10411
10412         * expression.cs (New.DoResolve): Add a guard against double
10413         resolution of an expression.  
10414
10415         The New DoResolve might be called twice when initializing field
10416         expressions (see EmitFieldInitializers, the call to
10417         GetInitializerExpression will perform a resolve on the expression,
10418         and later the assign will trigger another resolution
10419
10420         This leads to bugs (#37014)
10421
10422         * delegate.cs: The signature for EndInvoke should contain any ref
10423         or out parameters as well.  We were not doing this in the past. 
10424
10425         * class.cs (Field.Define): Do not overwrite the type definition
10426         inside the `volatile' group.  Turns out that volatile enumerations
10427         were changing the type here to perform a validity test, which
10428         broke conversions. 
10429
10430 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10431
10432         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10433         and structs, we do not want to load the instance variable
10434
10435         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10436         enum_type has to be handled like an object reference (implicit
10437         conversions exists from this to object), but the regular IsClass
10438         and IsValueType tests will never return true for this one.
10439
10440         Also we use TypeManager.IsValueType instead of type.IsValueType,
10441         just for consistency with the rest of the code (this is only
10442         needed if we ever use the construct exposed by test-180.cs inside
10443         corlib, which we dont today).
10444
10445 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10446
10447         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10448         just InternalCall.
10449
10450 2003-02-09  Martin Baulig  <martin@ximian.com>
10451
10452         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10453         (Namespace.DefineNamespaces): New static public method; this is
10454         called when we're compiling with debugging to add all namespaces
10455         to the symbol file.
10456
10457         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10458         pass it to the Namespace's .ctor.
10459
10460         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10461         and MethodBase arguments; pass the namespace ID to the symwriter;
10462         pass the MethodBase instead of the token to the symwriter.
10463         (SymbolWriter.DefineNamespace): New method to add a namespace to
10464         the symbol file.
10465
10466 2003-02-09  Martin Baulig  <martin@ximian.com>
10467
10468         * symbolwriter.cs: New file.  This is a wrapper around
10469         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10470         methods here in near future.
10471
10472 2003-02-09  Martin Baulig  <martin@ximian.com>
10473
10474         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10475         ILGenerator.MarkSequencePoint() which are actually used by the
10476         symbol writer.
10477
10478 2003-02-09  Martin Baulig  <martin@ximian.com>
10479
10480         * location.cs (SourceFile): New public sealed class.  This
10481         contains the name and an index which is used in the location's token.
10482         (Location): Reserve an appropriate number of bits in the token for
10483         the source file instead of walking over that list, this gives us a
10484         really huge performance improvement when compiling with debugging.
10485
10486         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10487         `SourceFile' argument instead of a string.
10488         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10489         but don't parse/tokenize here, we need to generate the list of all
10490         source files before we do that.
10491         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10492         the files.
10493
10494         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10495         instead of a string.
10496
10497         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10498         of a string.
10499
10500 2003-02-09  Martin Baulig  <martin@ximian.com>
10501
10502         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10503         filename on `#line default'.
10504
10505 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10506
10507         * statement.cs: don't clear the pinned var when the fixed statement
10508         returns from the method (fixes bug#37752).
10509
10510 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10511
10512         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10513         to IsValueType.
10514
10515 2003-02-07  Martin Baulig  <martin@ximian.com>
10516
10517         * driver.cs: Removed the `--debug-args' command line argument.
10518
10519         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10520         automatically by the AsssemblyBuilder.
10521         (CodeGen.InitializeSymbolWriter): We don't need to call any
10522         initialization function on the symbol writer anymore.  This method
10523         doesn't take any arguments.
10524
10525 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10526
10527         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10528         from referenced assemblies as well.
10529
10530 2003-02-02  Martin Baulig  <martin@ximian.com>
10531
10532         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10533
10534 2003-02-02  Martin Baulig  <martin@ximian.com>
10535
10536         * class.cs (Constructor.Emit): Open the symbol writer before
10537         emitting the constructor initializer.
10538         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10539         single-stepping through constructor initializers.
10540
10541 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10542
10543         * class.cs: Handle error 549: do not allow virtual methods in
10544         sealed classes. 
10545
10546 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10547
10548         * decl.cs: Check access levels when resolving types
10549
10550 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10551
10552         * statement.cs: Add parameters and locals set in catch blocks that might 
10553         return to set vector
10554
10555 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10556
10557         * class.cs (Operator): Set the SpecialName flags for operators.
10558
10559         * expression.cs (Invocation.DoResolve): Only block calls to
10560         accessors and operators on SpecialName methods.
10561
10562         (Cast.TryReduce): Handle conversions from char constants.
10563
10564
10565 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10566
10567         * statement.cs: small memory and time optimization in FlowBranching.
10568
10569 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10570
10571         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10572         problem that the last fix but in the other sid (Set).
10573
10574         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10575         access when there is no indexer in the hierarchy.
10576
10577 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10578
10579         * class.cs: Combine some if statements.
10580
10581 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10582
10583         * driver.cs: fixed bug #37187.
10584
10585 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10586
10587         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10588         any indexer, it's needed to build a list with all the indexers in the
10589         hierarchy (AllGetters), else we have problems. Fixes #35653.
10590
10591 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10592
10593         * class.cs (MethodData.Define): It is wrong for an interface
10594         implementation to be static in both cases: explicit and implicit.
10595         We were only handling this in one case.
10596
10597         Improve the if situation there to not have negations.
10598
10599         * class.cs (Field.Define): Turns out that we do not need to check
10600         the unsafe bit on field definition, only on usage.  Remove the test.
10601
10602 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10603
10604         * driver.cs: use assembly.Location instead of Codebase (the latest
10605         patch made mcs fail when using MS assemblies).
10606
10607 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10608
10609         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10610         get the path to *corlib.dll.
10611
10612 2003-01-21  Nick Drochak <ndrochak@gol.com>
10613
10614         * cs-tokenizer.cs:
10615         * pending.cs:
10616         * typemanager.cs: Remove compiler warnings
10617
10618 2003-01-20  Duncan Mak  <duncan@ximian.com>
10619
10620         * AssemblyInfo.cs: Bump the version number to 0.19.
10621
10622 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10623
10624         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10625
10626 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10627
10628         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10629
10630 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10631
10632         * cs-parser.jay: Small fix: we were not comparing the constructor
10633         name correctly.   Thanks to Zoltan for the initial pointer.
10634
10635 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10636
10637         * cs-tokenizer.cs: Set file name when specified with #line
10638
10639 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10640
10641         * cs-parser.jay: Only perform the constructor checks here if we
10642         are named like the class;  This will help provider a better
10643         error.  The constructor path is taken when a type definition is
10644         not found, but most likely the user forgot to add the type, so
10645         report that rather than the constructor error.
10646
10647 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10648
10649         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10650         allocations.
10651
10652 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10653
10654         * cs-parser.jay: Add cleanup call.
10655
10656 2003-01-13  Duncan Mak  <duncan@ximian.com>
10657
10658         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10659         consistent with other methods.
10660
10661 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10662
10663         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10664
10665 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10666
10667         * attribute.cs: only set GuidAttr to true when we have a
10668         GuidAttribute.
10669
10670 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10671
10672         * ecore.cs:
10673         * expression.cs:
10674         * typemanager.cs: fixes to allow mcs compile corlib with the new
10675         Type.IsSubclassOf fix.
10676
10677 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * expression.cs (LocalVariableReference.DoResolve): Classify a
10680         constant as a value, not as a variable.   Also, set the type for
10681         the variable.
10682
10683         * cs-parser.jay (fixed_statement): take a type instead of a
10684         pointer_type, so we can produce a better error message later.
10685
10686         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10687         as an error.  
10688
10689         (For.DoEmit): Make inifinite loops have a
10690         non-conditional branch back.
10691
10692         (Fixed.DoEmit): First populate the pinned variables, then emit the
10693         statement, then clear the variables.  Before I was emitting the
10694         code once for each fixed piece.
10695
10696
10697 2003-01-08  Martin Baulig  <martin@ximian.com>
10698
10699         * statement.cs (FlowBranching.MergeChild): A break in a
10700         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10701
10702 2003-01-08  Martin Baulig  <martin@ximian.com>
10703
10704         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10705         lives in the same number space than `param_map'.  Fixes #36154.
10706
10707 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10708
10709         * cs-parser.jay (constructor_declaration): Set the
10710         Constructor.ModFlags before probing for it.  This makes the
10711         compiler report 514, 515 and 132 (the code was there, but got
10712         broken). 
10713
10714         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10715         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10716         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10717
10718 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10719
10720         * enum.cs: create the enum static fields using the enum type.
10721
10722 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10723
10724         * class.cs: don't try to create the ParamBuilder for the return
10725         type if it's not needed (and handle it breaking for the ms runtime
10726         anyway).
10727
10728 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10729
10730         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10731
10732 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10733
10734         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10735         the command.   This showed up while compiling the JANET source
10736         code, which used \r as its only newline separator.
10737
10738 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * class.cs (Method.Define): If we are an operator (because it
10741         reuses our code), then set the SpecialName and HideBySig.  #36128
10742
10743 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10746         exception, report error 120 `object reference required'.
10747
10748         * driver.cs: Add --pause option, used during to measure the size
10749         of the process as it goes with --timestamp.
10750
10751         * expression.cs (Invocation.DoResolve): Do not allow methods with
10752         SpecialName to be invoked.
10753
10754 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10755
10756         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10757         number before adding it.
10758
10759 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10760
10761         * ecore.cs (StandardImplicitConversion): When in an unsafe
10762         context, we allow conversion between void * to any other pointer
10763         type. This fixes bug #35973.
10764
10765 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10766
10767         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10768         is not thrown when extensionless outputs are used 
10769
10770 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10771
10772         * rootcontext.cs: fixed compilation of corlib.
10773
10774 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * attribute.cs (Attributes.Contains): Add new method.
10777
10778         * class.cs (MethodCore.LabelParameters): if the parameter is an
10779         `out' parameter, check that no attribute `[In]' has been passed.
10780
10781         * enum.cs: Handle the `value__' name in an enumeration.
10782
10783 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10784
10785         * decl.cs: Added special case to allow overrides on "protected
10786         internal" methods
10787
10788 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10789
10790         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10791         since it makes much more sense.
10792
10793         (Attributes.ctor): Don't require a Location parameter.
10794
10795         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10796
10797         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10798         since we already have that information per attribute.
10799
10800         * everywhere : make appropriate changes.
10801
10802         * class.cs (LabelParameters): Write the code which actually
10803         applies attributes to the return type. We can't do this on the MS
10804         .NET runtime so we flag a warning in the case an exception is
10805         thrown.
10806
10807 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10808
10809         * const.cs: Handle implicit null conversions here too.
10810
10811 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10812
10813         * class.cs (MethodCore.LabelParameters): Remove the extra
10814         Type [] parameter since it is completely unnecessary. Instead
10815         pass in the method's attributes so that we can extract
10816         the "return" attribute.
10817
10818 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10819
10820         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10821         of ignoring it and letting the compile continue.
10822
10823         * typemanager.cs (ChangeType): use an extra argument to return an
10824         error condition instead of throwing an exception.
10825
10826 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10827
10828         * expression.cs (Unary.TryReduce): mimic the code for the regular
10829         code path.  Perform an implicit cast in the cases where we can
10830         implicitly convert to one of the integral types, and then reduce
10831         based on that constant.   This fixes bug #35483.
10832
10833 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10834
10835         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10836
10837 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10838
10839         * namespace.cs: fixed bug #35489.
10840
10841 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10842
10843         * class.cs: Remove some dead code.
10844
10845         * cs-parser.jay: Estimate the number of methods needed
10846         (RootContext.MethodCount);
10847
10848         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10849         numbers instead of StringBuilders.
10850
10851         * support.cs (PtrHashtable): Add constructor with initial size;
10852         We can now reduce reallocations of the method table.
10853
10854 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10855
10856         * attribute.cs (ApplyAttributes): Keep track of the emitted
10857         attributes on a per-target basis. This fixes bug #35413.
10858
10859 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10860
10861         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10862         default to the Windows 1252 encoding.
10863
10864         (UnixParseOption): Support version, thanks to Alp for the missing
10865         pointer. 
10866
10867         * AssemblyInfo.cs: Add nice assembly information.
10868
10869         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10870         (bug 35169).
10871
10872         * cs-parser.jay: Allow a trailing comma before the close bracked
10873         in the attribute_section production.
10874
10875         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10876         address of the instance was being taken, I will take this out,
10877         because we take the address of the object immediately here.
10878
10879 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10880
10881         * typemanager.cs (AreMultipleAllowed): Take care of the most
10882         obvious case where attribute type is not in the current assembly -
10883         stupid me ;-)
10884
10885 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10886
10887         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10888         definitions, instead of doing that afterwards.  
10889
10890         Also we use a nice little hack, depending on the constructor, we
10891         know if we are a "composed" name or a simple name.  Hence, we
10892         avoid the IndexOf test, and we avoid 
10893
10894         * codegen.cs: Add code to assist in a bug reporter to track down
10895         the source of a compiler crash. 
10896
10897 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10898
10899         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10900         types have been emitted for a given element and flag an error
10901         if something which does not have AllowMultiple set is used more
10902         than once.
10903
10904         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10905         attribute types and their corresponding AllowMultiple properties
10906
10907         (AreMultipleAllowed): Check the property for a given type.
10908
10909         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10910         property in the case we have a TypeContainer.
10911
10912         (Attributes.AddAttribute): Detect duplicates and just skip on
10913         adding them. This trivial fix catches a pretty gross error in our
10914         attribute emission - global attributes were being emitted twice!
10915
10916         Bugzilla bug #33187 is now fixed.
10917
10918 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10919
10920         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10921         instead of pp_and).
10922
10923         * expression.cs (Binary.ResolveOperator): I can only use the
10924         Concat (string, string, string) and Concat (string, string,
10925         string, string) if the child is actually a concatenation of
10926         strings. 
10927
10928 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10929
10930         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10931         context where we need a 2-character lookahead.
10932
10933         * pending.cs (PendingImplementation): Rework so we can keep track
10934         of interface types all the time, and flag those which were
10935         implemented by parents as optional.
10936
10937 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10938
10939         * expression.cs (Binary.ResolveOperator): Use
10940         String.Concat(string,string,string) or
10941         String.Concat(string,string,string,string) when possible. 
10942
10943         * typemanager: More helper methods.
10944
10945
10946 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10947
10948         * pending.cs: remove the bogus return from GetMissingInterfaces()
10949         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10950
10951 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10952
10953         * namespace.cs: avoid duplicated 'using xxx' being added to
10954         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10955         when we get more than one 'using' statement for the same namespace.
10956         Report a CS0105 warning for it.
10957
10958 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10959
10960         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10961         of calling getChar/putback, uses internal knowledge of it.    
10962
10963         (xtoken): Reorder tokenizer so most common patterns are checked
10964         first.  This reduces the compilation time in another 5% (from 8.11s
10965         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10966
10967         The parsing time is 22% of the compilation in mcs, and from that
10968         64% is spent on the tokenization process.  
10969
10970         I tried using a binary search for keywords, but this is slower
10971         than the hashtable.  Another option would be to do a couple of
10972         things:
10973
10974                 * Not use a StringBuilder, instead use an array of chars,
10975                   with a set value.  Notice that this way we could catch
10976                   the 645 error without having to do it *afterwards*.
10977
10978                 * We could write a hand-parser to avoid the hashtable
10979                   compares altogether.
10980
10981         The identifier consumption process takes 37% of the tokenization
10982         time.  Another 15% is spent on is_number.  56% of the time spent
10983         on is_number is spent on Int64.Parse:
10984
10985                 * We could probably choose based on the string length to
10986                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10987                   computations. 
10988
10989         Another 3% is spend on wrapping `xtoken' in the `token' function.
10990
10991         Handle 0xa0 as whitespace (#34752)
10992
10993 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10994
10995         * typemanager.cs (IsCLRType): New routine to tell whether a type
10996         is one of the builtin types.  
10997
10998         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10999         typecode in more places instead of doing pointer comparissions.
11000         We could leverage some knowledge about the way the typecodes are
11001         laid out.
11002
11003         New code to cache namespaces in assemblies, it is currently not
11004         invoked, to be used soon.
11005
11006         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11007
11008         * expression.cs (Binary.ResolveOperator): specially handle
11009         strings, and do not perform user-defined operator overloading for
11010         built-in types.
11011
11012 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11013
11014         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11015         internalcall as it is a pretty simple operation;  Avoid whenever
11016         possible to call Char.IsLetter.
11017
11018         (consume_identifier): Cut by half the number of
11019         hashtable calls by merging the is_keyword and GetKeyword behavior.
11020
11021         Do not short-circuit, because if we do, we
11022         report errors (ie, #if false && true would produce an invalid
11023         directive error);
11024
11025
11026 2002-11-24  Martin Baulig  <martin@ximian.com>
11027
11028         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11029         check constant ranges and report a CS0221.  Fixes #33186.
11030
11031 2002-11-24  Martin Baulig  <martin@ximian.com>
11032
11033         * cs-parser.jay: Make this work for uninitialized variable
11034         declarations in the `for' initializer.  Fixes #32416.
11035
11036 2002-11-24  Martin Baulig  <martin@ximian.com>
11037
11038         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11039         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11040
11041 2002-11-24  Martin Baulig  <martin@ximian.com>
11042
11043         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11044         argument; if true, we also check for user-defined conversions.
11045         This is only needed if both arguments are of a user-defined type.
11046         Fixes #30443, added test-175.cs.
11047         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11048
11049         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11050
11051 2002-11-24  Martin Baulig  <martin@ximian.com>
11052
11053         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11054         function to get the store opcode.
11055         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11056         only emit the Ldelema if the store opcode is Stobj.  You must run
11057         both test-34 and test-167 to test this.  Fixes #34529.
11058
11059 2002-11-23  Martin Baulig  <martin@ximian.com>
11060
11061         * ecore.cs (Expression.MemberLookup): Added additional
11062         `qualifier_type' argument which is used when we're being called
11063         from MemberAccess.DoResolve() and null if we're called from a
11064         SimpleName lookup.
11065         (Expression.MemberLookupFailed): New method to report errors; this
11066         does the CS1540 check and reports the correct error message.
11067
11068         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11069         argument for the CS1540 check and redone the way how we're dealing
11070         with private members.  See the comment in the source code for details.
11071         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11072         `closure_start_type' to `closure_qualifier_type' and check whether
11073         it's not null.  It was not this filter being broken, it was just
11074         being called with the wrong arguments.
11075
11076         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11077         and pass it the correct `qualifier_type'; this also does the error
11078         handling for us.
11079
11080 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11081
11082         * expression.cs (Invocation.EmitParams): If the we are dealing
11083         with a non-built-in value type, load its address as well.
11084
11085         (ArrayCreation): Use a a pretty constant instead
11086         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11087         static initializers.  
11088
11089         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11090         because they are not really value types, just glorified integers. 
11091
11092         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11093
11094         * ecore.cs: Remove redundant code for enumerations, make them use
11095         the same code path as everything else, fixes the casting issue
11096         with enumerations in Windows.Forms.
11097
11098         * attribute.cs: Do only cast to string if it is a string, the
11099         validation happens later.
11100
11101         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11102         people upgrade their corlibs.
11103
11104         * ecore.cs: Oops, enumerations were not following the entire code path
11105
11106 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11107
11108         * typemanager.cs (FilterWithClosure): Commented out the test for
11109         1540 in typemanager.cs, as it has problems when accessing
11110         protected methods from a parent class (see test-174.cs). 
11111
11112         * attribute.cs (Attribute.ValidateGuid): new method.
11113         (Attribute.Resolve): Use above.
11114
11115 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11116
11117         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11118
11119         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11120         handling for enumerations, as we only needed the TypeContainer
11121         functionality to begin with (this is required for the fix below to
11122         work for enums that reference constants in a container class for
11123         example). 
11124
11125         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11126
11127         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11128         a valid TypeBuilder to perform lookups on.o
11129
11130         * class.cs (InheritableMemberSignatureCompare): Use true in the
11131         call to GetGetMethod and GetSetMethod, because we are comparing
11132         the signature, and we need to get the methods *even* if they are
11133         private. 
11134
11135         (PropertyBase.CheckBase): ditto.
11136
11137         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11138         GotoCase.Resolve): Use Peel on EmpytCasts.
11139
11140         * ecore.cs (EmptyCast): drop child, add Peel method.
11141
11142 2002-11-17  Martin Baulig  <martin@ximian.com>
11143
11144         * ecore.cs (EmptyCast.Child): New public property.
11145
11146         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11147         label resolved to an EmptyCast.  Fixes #34162.
11148         (GotoCase.Resolve): Likewise.
11149         (Block.EmitMeta): Likewise.
11150
11151 2002-11-17  Martin Baulig  <martin@ximian.com>
11152
11153         * expression.cs (Invocation.BetterConversion): Prefer int over
11154         uint; short over ushort; long over ulong for integer literals.
11155         Use ImplicitConversionExists instead of StandardConversionExists
11156         since we also need to check for user-defined implicit conversions.
11157         Fixes #34165.  Added test-173.cs.
11158
11159 2002-11-16  Martin Baulig  <martin@ximian.com>
11160
11161         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11162         with the `true' and `false' literals.  Fixes #33151.
11163
11164 2002-11-16  Martin Baulig  <martin@ximian.com>
11165
11166         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11167         October 22nd; don't do the cs1540 check for static members.
11168
11169         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11170         now using our own filter here and doing the cs1540 check again.
11171
11172 2002-11-16  Martin Baulig  <martin@ximian.com>
11173
11174         * support.cs (InternalParameters): Don't crash if we don't have
11175         any fixed parameters.  Fixes #33532.
11176
11177 2002-11-16  Martin Baulig  <martin@ximian.com>
11178
11179         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11180         when looking up static methods to make this work on Windows.
11181         Fixes #33773.
11182
11183 2002-11-16  Martin Baulig  <martin@ximian.com>
11184
11185         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11186         a setter rather than using PropertyInfo.CanWrite.
11187
11188 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11189
11190         * class.cs: Allow acces to block member by subclasses. Fixes build
11191         breaker.
11192
11193 2002-11-14  Martin Baulig  <martin@ximian.com>
11194
11195         * class.cs (Constructor.Emit): Added the extern/block check.
11196         Fixes bug #33678.
11197
11198 2002-11-14  Martin Baulig  <martin@ximian.com>
11199
11200         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11201         iteration while looking for indexers, this is needed because the
11202         indexer may have a different name in our base classes.  Fixed the
11203         error reporting (no indexers at all, not get accessor, no
11204         overloaded match).  Fixes bug #33089.
11205         (IndexerAccess.DoResolveLValue): Likewise.
11206
11207 2002-11-14  Martin Baulig  <martin@ximian.com>
11208
11209         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11210         indexers.  Fixes the first part of bug #33089.
11211         (MethodSignature.InheritableMemberSignatureCompare): Added support
11212         for properties.
11213
11214 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11215
11216         * attribute.cs (Attribute.Resolve): Catch the
11217         NullReferenceException and report it since it isn't supposed to
11218         happen. 
11219
11220 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11221
11222         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11223         LogicalOr and LogicalAnd that can benefit from recursively
11224         handling EmitBranchable.  The code now should be nice for Paolo.
11225
11226 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11227
11228         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11229         the Type lookups, as we perform quite a number of lookups on
11230         non-Types.  This can be removed once we can deterministically tell
11231         whether we have a type or a namespace in advance.
11232
11233         But this might require special hacks from our corlib.
11234
11235         * TODO: updated.
11236
11237         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11238         and double which avoids a conversion from an integer to a double.
11239
11240         * expression.cs: tiny optimization, avoid calling IsConstant,
11241         because it effectively performs the lookup twice.
11242
11243 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11244
11245         But a bogus return here to keep the semantics of the old code
11246         until the Mono runtime is fixed.
11247
11248         * pending.cs (GetMissingInterfaces): New method used to remove all
11249         the interfaces that are already implemented by our parent
11250         classes from the list of pending methods. 
11251
11252         * interface.cs: Add checks for calls after ResolveTypeExpr.
11253
11254 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11255
11256         * class.cs (Class.Emit): Report warning 67: event not used if the
11257         warning level is beyond 3.
11258
11259         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11260         being a NullLiteral.
11261
11262         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11263         specifiers. 
11264
11265         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11266         path that might fail if a type can not be resolved.
11267
11268         * expression.cs (Binary.Emit): Emit unsigned versions of the
11269         operators. 
11270
11271         * driver.cs: use error 5.
11272
11273 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11274
11275         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11276
11277 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11278
11279         * cs-parser.jay (switch_section): A beautiful patch from Martin
11280         Baulig that fixed 33094.
11281
11282 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11283
11284         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11285         Check whether the base is abstract and report an error if so.
11286
11287         * expression.cs (IndexerAccess.DoResolveLValue,
11288         IndexerAccess.DoResolve): ditto. 
11289
11290         (Invocation.DoResolve): ditto.
11291
11292         (Invocation.FullMethodDesc): Improve the report string.
11293
11294         * statement.cs (Block): Eliminate IsVariableDefined as it is
11295         basically just a wrapper for GetVariableInfo.
11296
11297         * ecore.cs (SimpleName): Use new 
11298
11299         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11300         type, as we return the actual parameter ref/unref state on a
11301         different call.
11302
11303 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11304
11305         * support.cs: Return proper flags REF/OUT fixing the previous
11306         commit.  
11307
11308         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11309         not used to mean `ref' but `ref or out' in ParameterReference
11310
11311         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11312         full type signature instead of calling TypeManger.CSharpName
11313         ourselves. 
11314
11315         * support.cs (InternalParameters.ParameterDesc): Do not compare
11316         directly to the modflags, because REF/OUT will actually be bitsets
11317         if set. 
11318
11319         * delegate.cs (VerifyMethod): Check also the modifiers.
11320
11321         * cs-tokenizer.cs: Fix bug where floating point values with an
11322         exponent where a sign was missing was ignored.
11323
11324         * driver.cs: Allow multiple assemblies to be specified in a single
11325         /r: argument
11326
11327 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11328
11329         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11330         because identifiers after a parenthesis would end up in this kind
11331         of production, and we needed to desamiguate it for having casts
11332         like:
11333
11334                 (UserDefinedType *) xxx
11335
11336 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11337
11338         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11339         we should set on the Bindingflags.NonPublic, but not turn on
11340         private_ok.  private_ok controls whether a Private member is
11341         returned (this is chekced on the filter routine), while the
11342         BindingFlags.NonPublic just controls whether private/protected
11343         will be allowed.   This fixes the problem part of the problem of
11344         private properties being allowed to be used in derived classes.
11345
11346         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11347         so we can call the children DoResolveLValue method (this will
11348         properly signal errors on lvalue assignments to base properties)
11349
11350         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11351         getter are null, and we have a property info, we know that this
11352         happened because the lookup failed, so we report an error 122 for
11353         protection level violation.
11354
11355         We also silently return if setter and getter are null in the
11356         resolve functions, this condition only happens if we have flagged
11357         the error before.  This is the other half of the problem. 
11358
11359         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11360         not have accessibility information, that is why we were returning
11361         true in the filter function in typemanager.cs.
11362
11363         To properly report 122 (property is inaccessible because of its
11364         protection level) correctly, we report this error in ResolveAccess
11365         by failing if both the setter and the getter are lacking (ie, the
11366         lookup failed). 
11367
11368         DoResolve and DoLResolve have been modified to check for both
11369         setter/getter being null and returning silently, the reason being
11370         that I did not want to put the knowledge about this error in upper
11371         layers, like:
11372
11373         int old = Report.Errors;
11374         x = new PropertyExpr (...);
11375         if (old != Report.Errors)
11376                 return null;
11377         else
11378                 return x;
11379
11380         So the property expr is returned, but it is invalid, so the error
11381         will be flagged during the resolve process. 
11382
11383         * class.cs: Remove InheritablePropertySignatureCompare from the
11384         class, as we no longer depend on the property signature to compute
11385         whether it is possible to implement a method or not.
11386
11387         The reason is that calling PropertyInfo.GetGetMethod will return
11388         null (in .NET, in Mono it works, and we should change this), in
11389         cases where the Get Method does not exist in that particular
11390         class.
11391
11392         So this code:
11393
11394         class X { public virtual int A { get { return 1; } } }
11395         class Y : X { }
11396         class Z : Y { public override int A { get { return 2; } } }
11397
11398         Would fail in Z because the parent (Y) would not have the property
11399         defined.  So we avoid this completely now (because the alternative
11400         fix was ugly and slow), and we now depend exclusively on the
11401         method names.
11402
11403         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11404         reference method, instead of using the property.
11405
11406         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11407         routines are gone now.
11408
11409         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11410         names, they were incorrectly named.
11411
11412         * cs-tokenizer.cs: Return are more gentle token on failure. 
11413
11414         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11415         had an out-of-sync index variable, which caused it to remove from
11416         the list of pending methods the wrong method sometimes.
11417
11418 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11419
11420         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11421         CanWrite, because those refer to this particular instance of the
11422         property, and do not take into account the fact that we can
11423         override single members of a property.
11424
11425         Constructor requires an EmitContext.  The resolution process does
11426         not happen here, but we need to compute the accessors before,
11427         because the resolution does not always happen for properties.
11428
11429         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11430         subclass, before we did not update this flag, but we did update
11431         bindingflags. 
11432
11433         (GetAccessors): Drop this routine, as it did not work in the
11434         presence of partially overwritten set/get methods. 
11435
11436         Notice that this broke the cs1540 detection, but that will require
11437         more thinking. 
11438
11439 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11440
11441         * class.cs:
11442         * codegen.cs:
11443         * driver.cs: issue a warning instead of an error if we don't support
11444         debugging for the platform. Also ignore a couple of errors that may
11445         arise when trying to write the symbols. Undo my previous patch.
11446
11447 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11448
11449         * driver.cs: ignore /debug switch except for Unix platforms.
11450
11451 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11452
11453         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11454
11455 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11456
11457         * driver.cs: Do not make mcs-debug conditional, so we do not break
11458         builds that use it.
11459
11460         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11461         review this patch.  But basically after all the children variables
11462         have been merged, the value of "Breaks" was not being set to
11463         new_breaks for Switch blocks.  I think that it should be set after
11464         it has executed.  Currently I set this to the value of new_breaks,
11465         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11466         conservative, but I do not understand this code very well.
11467
11468         I did not break anything in the build, so that is good ;-)
11469
11470         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11471
11472 2002-10-20  Mark Crichton  <crichton@gimp.org>
11473
11474         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11475
11476 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11477
11478         * cfold.cs: Fixed compile blocker.
11479
11480 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11481
11482         * driver.cs: I was chekcing the key, not the file.
11483
11484 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11485
11486         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11487         message that we were generating - we just need to silently return
11488         a null.
11489
11490 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11491
11492         * class.cs (Event.Define): Change my previous commit, as this
11493         breaks the debugger.  This is a temporary hack, as it seems like
11494         the compiler is generating events incorrectly to begin with.
11495
11496         * expression.cs (Binary.ResolveOperator): Added support for 
11497         "U operator - (E x, E y)"
11498
11499         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11500         y)".
11501
11502         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11503         init-only variables, but this path did not take into account that
11504         there might be also instance readonly variables.  Correct this
11505         problem. 
11506
11507         This fixes bug 32253
11508
11509         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11510         delegates as well.
11511
11512         * driver.cs: Change the extension for modules to `netmodule'
11513
11514         * cs-parser.jay: Improved slightly the location tracking for
11515         the debugger symbols.
11516
11517         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11518         modifiers that were specified instead of the hardcoded value
11519         (FamAndAssem).  This was basically ignoring the static modifier,
11520         and others.  Fixes 32429.
11521
11522         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11523         fixed a bug in the process (32476)
11524
11525         * expression.cs (ArrayAccess.EmitAssign): Patch from
11526         hwang_rob@yahoo.ca that fixes bug 31834.3
11527
11528 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11529
11530         * driver.cs: Make the module extension .netmodule.
11531
11532 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11533
11534         * driver.cs: Report an error if the resource file is not found
11535         instead of crashing.
11536
11537         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11538         false, like Emit does.
11539
11540 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11541
11542         * typemanager.cs: Remove unused private member.  Also reported mcs
11543         bug to report this as a warning like csc.
11544
11545 2002-10-15  Martin Baulig  <martin@gnome.org>
11546
11547         * statement.cs (Statement.Emit): Made this a virtual method; emits
11548         the line number info and calls DoEmit().
11549         (Statement.DoEmit): New protected abstract method, formerly knows
11550         as Statement.Emit().
11551
11552         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11553
11554 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11555
11556         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11557         have fixed a remaining problem: not every AddXXXX was adding a
11558         fully qualified name.  
11559
11560         Now everyone registers a fully qualified name in the DeclSpace as
11561         being defined instead of the partial name.  
11562
11563         Downsides: we are slower than we need to be due to the excess
11564         copies and the names being registered this way.  
11565
11566         The reason for this is that we currently depend (on the corlib
11567         bootstrap for instance) that types are fully qualified, because
11568         we dump all the types in the namespace, and we should really have
11569         types inserted into the proper namespace, so we can only store the
11570         basenames in the defined_names array.
11571
11572 2002-10-10  Martin Baulig  <martin@gnome.org>
11573
11574         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11575         from bug #31834, see the bug report for a testcase which is
11576         miscompiled.
11577
11578 2002-10-10  Martin Baulig  <martin@gnome.org>
11579
11580         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11581         flow analysis code for this.
11582
11583         * statement.cs (Do, While, For): Tell the flow analysis code about
11584         infinite loops.
11585         (FlowBranching.UsageVector): Added support for infinite loops.
11586         (Block.Resolve): Moved the dead code elimination here and use flow
11587         analysis to do it.
11588
11589 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11590
11591         * class.cs (Field.Define): Catch cycles on struct type
11592         definitions. 
11593
11594         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11595         fields if the fields are static.  We only need to check instance
11596         fields. 
11597
11598         * expression.cs (As.DoResolve): Test for reference type.
11599
11600         * statement.cs (Using.ResolveExpression): Use
11601         ConvertImplicitRequired, not ConvertImplicit which reports an
11602         error on failture
11603         (Using.ResolveLocalVariableDecls): ditto.
11604
11605         * expression.cs (Binary.ResolveOperator): Report errors in a few
11606         places where we had to.
11607
11608         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11609
11610 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11611
11612         * expression.cs: Use StoreFromPtr instead of extracting the type
11613         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11614
11615         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11616         an enumeration value to a System.Enum, but System.Enum is not a
11617         value type, but an class type, so we need to box.
11618
11619         (Expression.ConvertExplicit): One codepath could return
11620         errors but not flag them.  Fix this.  Fixes #31853
11621
11622         * parameter.cs (Resolve): Do not allow void as a parameter type.
11623
11624 2002-10-06  Martin Baulig  <martin@gnome.org>
11625
11626         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11627         if it's a class type and not a struct.  Fixes #31815.
11628
11629 2002-10-06  Martin Baulig  <martin@gnome.org>
11630
11631         * statement.cs: Reworked the flow analysis code a bit to make it
11632         usable for dead code elimination.
11633
11634 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11635
11636         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11637
11638 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11639
11640         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11641         to fix the test 165, will investigate deeper.
11642
11643 2002-10-04  Martin Baulig  <martin@gnome.org>
11644
11645         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11646         finally blocks actually work.
11647         (Try.Resolve): We don't need to create a sibling for `finally' if
11648         there is no finally block.
11649
11650 2002-10-04  Martin Baulig  <martin@gnome.org>
11651
11652         * class.cs (Constructor.Define): The default accessibility for a
11653         non-default constructor is private, not public.
11654
11655 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11656
11657         * class.cs (Constructor): Make AllowedModifiers public, add
11658         EXTERN.
11659
11660         * cs-parser.jay: Perform the modifiers test here, as the
11661         constructor for the Constructor class usually receives a zero
11662         because of the way we create it (first we create, later we
11663         customize, and we were never checking the modifiers).
11664
11665         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11666         is a version of LookupTypeReflection that includes the type-name
11667         cache.  This can be used as a fast path for functions that know
11668         the fully qualified name and are only calling into *.GetType() to
11669         obtain a composed type.
11670
11671         This is also used by TypeManager.LookupType during its type
11672         composition.
11673
11674         (LookupType): We now also track the real type name, as sometimes
11675         we can get a quey for the real type name from things like
11676         ComposedCast.  This fixes bug 31422.
11677
11678         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11679         complete type fullname, it does not have to go through the type
11680         resolution system to obtain the composed version of the type (for
11681         obtaining arrays or pointers).
11682
11683         (Conditional.Emit): Use the EmitBoolExpression to
11684         generate nicer code, as requested by Paolo.
11685
11686         (ArrayCreation.CheckIndices): Use the patch from
11687         hwang_rob@yahoo.ca to validate the array initializers. 
11688
11689 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11690
11691         * class.cs (ConstructorInitializer.Emit): simplify code by using
11692         Invocation.EmitCall, and at the same time, fix the bugs in calling
11693         parent constructors that took variable arguments. 
11694
11695         * ecore.cs (Expression.ConvertNumericExplicit,
11696         Expression.ImplicitNumericConversion): Remove the code that
11697         manually wrapped decimal (InternalTypeConstructor call is now gone
11698         as well).
11699
11700         * expression.cs (Cast.TryReduce): Also handle decimal types when
11701         trying to perform a constant fold on the type.
11702
11703         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11704
11705         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11706         that only turned off an error report, and did nothing else. 
11707
11708 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11709
11710         * driver.cs: Handle and ignore /fullpaths
11711
11712 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11713
11714         * expression.cs (Binary.ResolveOperator): Catch the case where
11715         DoNumericPromotions returns true, 
11716
11717         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11718
11719 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11722         report error 70.
11723
11724 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11725
11726         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11727         conversion exists, but it is also required that the conversion be
11728         performed.  This manifested in "(Type64Enum) 2".  
11729
11730         * class.cs (TypeManager.AddMethod): The fix is not to change
11731         AddEnum, because that one was using a fully qualified name (every
11732         DeclSpace derivative does), but to change the AddMethod routine
11733         that was using an un-namespaced name.  This now correctly reports
11734         the duplicated name.
11735
11736         Revert patch until I can properly fix it.  The issue
11737         is that we have a shared Type space across all namespaces
11738         currently, which is wrong.
11739
11740         Options include making the Namespace a DeclSpace, and merge
11741         current_namespace/current_container in the parser.
11742
11743 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11744
11745         * cs-parser.jay: Improve error reporting when we get a different
11746         kind of expression in local_variable_type and
11747         local_variable_pointer_type. 
11748
11749         Propagate this to avoid missleading errors being reported.
11750
11751         * ecore.cs (ImplicitReferenceConversion): treat
11752         TypeManager.value_type as a target just like object_type.   As
11753         code like this:
11754
11755         ValueType v = 1;
11756
11757         Is valid, and needs to result in the int 1 being boxed before it
11758         is assigned to the value type v.
11759
11760         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11761         to validate the enumeration name.
11762
11763         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11764         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11765         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11766
11767         * ecore.cs (TryImplicitIntConversion): When doing an
11768         implicit-enumeration-conversion, check if the type is 64-bits and
11769         perform a conversion before passing to EnumConstant.
11770
11771 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11772
11773         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11774         report ambiguous type references.  Unlike the MS version, we
11775         report what the ambiguity is.   Innovation at work ;-)
11776
11777         (DeclSpace.FindType): Require a location argument to
11778         display when we display an ambiguous error.
11779
11780         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11781
11782         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11783
11784         * expression.cs (EmitDynamicInitializers): Apply patch from
11785         hwang_rob@yahoo.ca that fixes the order in which we emit our
11786         initializers. 
11787
11788 2002-09-21  Martin Baulig  <martin@gnome.org>
11789
11790         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11791         delegate takes no arguments.
11792
11793 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11794
11795         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11796         from integers.
11797
11798         * expression.cs: Extract the underlying type.
11799
11800         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11801
11802         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11803
11804 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11805
11806         * class.cs (TypeContainer.DefineType): We can not use the nice
11807         PackingSize with the size set to 1 DefineType method, because it
11808         will not allow us to define the interfaces that the struct
11809         implements.
11810
11811         This completes the fixing of bug 27287
11812
11813         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11814         means also structs.  This fixes part of the problem. 
11815         (Expresion.ImplicitReferenceConversionExists): ditto.
11816
11817         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11818         error if there were no errors reported during the type lookup
11819         process, to avoid duplicates or redundant errors.  Without this
11820         you would get an ambiguous errors plus a type not found.  We have
11821         beaten the user enough with the first error.  
11822
11823         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11824         reference. 
11825
11826         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11827         during the resolution process, stop the lookup, this avoids
11828         repeated error reports (same error twice).
11829
11830         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11831
11832         * typemanager.cs (LookupType): Redo the type lookup code to match
11833         the needs of System.Reflection.  
11834
11835         The issue is that System.Reflection requires references to nested
11836         types to begin with a "+" sign instead of a dot.  So toplevel
11837         types look like: "NameSpace.TopLevelClass", and nested ones look
11838         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11839         levels. 
11840
11841 2002-09-19  Martin Baulig  <martin@gnome.org>
11842
11843         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11844         says that a method always returns or always throws an exception,
11845         don't report the CS0161.
11846
11847         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11848         set `Returns = new_returns'.
11849
11850 2002-09-19  Martin Baulig  <martin@gnome.org>
11851
11852         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11853         to an enum constant, check for a CS0176.
11854
11855 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11856
11857         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11858         for operators that must be in pairs and report errors.
11859
11860         * ecore.cs (SimpleName.DoResolveType): During the initial type
11861         resolution process, when we define types recursively, we must
11862         check first for types in our current scope before we perform
11863         lookups in the enclosing scopes.
11864
11865         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11866
11867         (Invocation.VerifyArgumentsCompat): Call
11868         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11869         I thought we were supposed to always call this, but there are a
11870         few places in the code where we dont do it.
11871
11872 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11873
11874         * driver.cs: Add support in -linkres and -resource to specify the
11875         name of the identifier.
11876
11877 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11878
11879         * ecore.cs (StandardConversionExists): Sync with the conversion
11880         code: allow anything-* to void* conversions.
11881
11882         (FindMostSpecificSource): Use an Expression argument
11883         instead of a Type, because we might be handed over a Literal which
11884         gets a few more implicit conversions that plain types do not.  So
11885         this information was being lost.
11886
11887         Also, we drop the temporary type-holder expression when not
11888         required.
11889
11890 2002-09-17  Martin Baulig  <martin@gnome.org>
11891
11892         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11893         this is an explicit interface implementation.
11894
11895 2002-09-17  Martin Baulig  <martin@gnome.org>
11896
11897         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11898         different `IndexerName' attributes.
11899
11900         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11901         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11902         virtual CommonResolve().
11903
11904 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11905
11906         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11907         and convert that to the UnderlyingType.
11908
11909         * statement.cs (Foreach.Resolve): Indexers are just like variables
11910         or PropertyAccesses.
11911
11912         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11913         inside quoted strings, we were not doing this before.
11914
11915 2002-09-16  Martin Baulig  <martin@gnome.org>
11916
11917         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11918         resolve it.  This is needed for the definite assignment check of the
11919         instance expression, fixes bug #29846.
11920         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11921
11922 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11923
11924         * parameter.cs: Fix compile error.  Cannot reference static member
11925         from an instance object.  Is this an mcs bug?
11926
11927 2002-09-14  Martin Baulig  <martin@gnome.org>
11928
11929         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11930         multiple times.  Fixes bug #30295, added test-166.cs.
11931
11932 2002-09-14  Martin Baulig  <martin@gnome.org>
11933
11934         * statement.cs (Block.Emit): Don't emit unreachable code.
11935         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11936         `break' statements.
11937         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11938
11939 2002-09-14  Martin Baulig  <martin@gnome.org>
11940
11941         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11942         is set.
11943
11944 2002-09-14  Martin Baulig  <martin@gnome.org>
11945
11946         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11947         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11948         be false on the ms runtime.
11949
11950 2002-09-13  Martin Baulig  <martin@gnome.org>
11951
11952         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11953         the CS0038 error message.
11954
11955 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11956
11957         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11958         constant inside, return it.
11959
11960 2002-09-12  Martin Baulig  <martin@gnome.org>
11961
11962         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11963         implicit conversion can be done between enum types.
11964
11965         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11966         check whether an implicit conversion to the current enum's UnderlyingType
11967         exists and report an error if not.
11968
11969         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11970         without debugging support.
11971
11972         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11973         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11974
11975 2002-09-12  Martin Baulig  <martin@gnome.org>
11976
11977         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11978
11979         * ecore.cs (IMemberExpr.DeclaringType): New property.
11980         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11981         nonstatic member of an outer type (CS0038).
11982
11983 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11984
11985         * driver.cs: Activate the using-error detector at warning level
11986         4 (at least for MS-compatible APIs).
11987
11988         * namespace.cs (VerifyUsing): Small buglett fix.
11989
11990         * pending.cs (PendingImplementation): pass the container pointer. 
11991
11992         * interface.cs (GetMethods): Allow for recursive definition.  Long
11993         term, I would like to move every type to support recursive
11994         definitions, not the current ordering mechanism that we have right
11995         now.
11996
11997         The situation is this: Attributes are handled before interfaces,
11998         so we can apply attributes to interfaces.  But some attributes
11999         implement interfaces, we will now handle the simple cases
12000         (recursive definitions will just get an error).  
12001
12002         * parameter.cs: Only invalidate types at the end if we fail to
12003         lookup all types.  
12004
12005 2002-09-09  Martin Baulig  <martin@gnome.org>
12006
12007         * ecore.cs (PropertyExpr.Emit): Also check for
12008         TypeManager.system_int_array_get_length so this'll also work when
12009         compiling corlib.  Fixes #30003.
12010
12011 2002-09-09  Martin Baulig  <martin@gnome.org>
12012
12013         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12014         and throw an exception if we can't get the type's size.  Fixed #30040,
12015         added test-165.cs.
12016
12017 2002-09-09  Martin Baulig  <martin@gnome.org>
12018
12019         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12020
12021         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12022         context.  Fixes bug #30027.
12023
12024         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12025         virtual functions.  Fixes bug #30043, added test-164.cs.
12026
12027 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12028
12029         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12030
12031 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12032
12033         * driver.cs: Use an object to get the windows codepage since it's not a
12034         static property.
12035
12036 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12037
12038         * statement.cs (For.Emit): for infinite loops (test == null)
12039         return whether there is a break inside, not always "true".
12040
12041         * namespace.cs (UsingEntry): New struct to hold the name of the
12042         using definition, the location where it is defined, and whether it
12043         has been used in a successful type lookup.
12044
12045         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12046         strings.
12047
12048         * decl.cs: ditto.
12049
12050 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12051
12052         * attribute.cs : Fix incorrect code which relied on catching
12053         a NullReferenceException to detect a null being passed in
12054         where an object was expected.
12055
12056 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12057
12058         * statement.cs (Try): flag the catch variable as assigned
12059
12060         * expression.cs (Cast): Simplified by using ResolveType instead of
12061         manually resolving.
12062
12063         * statement.cs (Catch): Fix bug by using ResolveType.
12064
12065 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12066
12067         * expression.cs (BetterConversion): Special case for when we have
12068         a NullLiteral as the argument and we have to choose between string
12069         and object types - we choose string the way csc does.
12070
12071         * attribute.cs (Attribute.Resolve): Catch the
12072         NullReferenceException and report error #182 since the Mono
12073         runtime no more has the bug and having this exception raised means
12074         we tried to select a constructor which takes an object and is
12075         passed a null.
12076
12077 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12078
12079         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12080         message (1502, 1503) when we can't locate a method after overload
12081         resolution. This is much more informative and closes the bug
12082         Miguel reported.
12083
12084         * interface.cs (PopulateMethod): Return if there are no argument
12085         types. Fixes a NullReferenceException bug.
12086
12087         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12088         expressions too. Previously we were checking only in one place for
12089         positional arguments leaving out named arguments.
12090
12091         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12092         type to the enum type is not allowed. Remove code corresponding to
12093         that.
12094
12095         (ConvertNumericExplicit): Allow explicit conversions from
12096         the underlying type to enum type. This precisely follows the spec
12097         and closes a bug filed by Gonzalo.
12098
12099 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12100
12101         * compiler.csproj:
12102         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12103
12104 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12105
12106         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12107         it was important that we stored the right value after the
12108         reduction in `converted'.
12109
12110 2002-09-04  Martin Baulig  <martin@gnome.org>
12111
12112         * location.cs (Location.SymbolDocument): Use full pathnames for the
12113         source files.
12114
12115 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12116
12117         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12118         of the expression resolve mechanism, because that will catch the
12119         SimpleName error failures.
12120
12121         (Conditional): If we can not resolve the
12122         expression, return, do not crash.
12123
12124 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12125
12126         * cs-tokenizer.cs:
12127         (location): display token name instead of its number.
12128
12129 2002-08-28  Martin Baulig  <martin@gnome.org>
12130
12131         * expression.cs (Binary.ResolveOperator): Don't silently return
12132         but return an error if an operator cannot be applied between two
12133         enum types.
12134
12135 2002-08-28  Martin Baulig  <martin@gnome.org>
12136
12137         * class.cs (Constructor.Define): Set the permission attributes
12138         correctly instead of making all constructors public.
12139
12140 2002-08-28  Martin Baulig  <martin@gnome.org>
12141
12142         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12143         for private members before reporting a CS0103; if we find anything,
12144         it's a CS0122.
12145
12146 2002-08-28  Martin Baulig  <martin@gnome.org>
12147
12148         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12149         to check whether `closure_start_type == closure_invocation_type',
12150         we also need to check whether `m.DeclaringType == closure_invocation_type'
12151         before bypassing the permission checks.  We might be accessing
12152         protected/private members from the base class.
12153         (TypeManager.RealMemberLookup): Only set private_ok if private
12154         members were requested via BindingFlags.NonPublic.
12155
12156         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12157
12158         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12159         MethodGroupExpr.IsExplicitImpl if appropriate.
12160         (Invocation.DoResolve): Don't report the CS0120 for explicit
12161         interface implementations.
12162
12163 2002-08-27  Martin Baulig  <martin@gnome.org>
12164
12165         * expression.cs (Invocation.DoResolve): If this is a static
12166         method and we don't have an InstanceExpression, we must report
12167         a CS0120.
12168
12169 2002-08-25  Martin Baulig  <martin@gnome.org>
12170
12171         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12172         `==' between a valuetype and an object.
12173
12174 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12175
12176         * ecore.cs (TypeExpr): Provide a ToString method.
12177
12178 2002-08-24  Martin Baulig  <martin@gnome.org>
12179
12180         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12181         now called proggie.dbg and it's a binary file.
12182
12183 2002-08-23  Martin Baulig  <martin@gnome.org>
12184
12185         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12186
12187 2002-08-23  Martin Baulig  <martin@gnome.org>
12188
12189         * struct.cs (MyStructInfo.ctor): Make this work with empty
12190         structs; it's not allowed to use foreach() on null.
12191
12192 2002-08-23  Martin Baulig  <martin@gnome.org>
12193
12194         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12195         writer the full pathname of the generated assembly.
12196
12197 2002-08-23  Martin Baulig  <martin@gnome.org>
12198
12199         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12200         A `finally' block never returns or breaks; improved handling of
12201         unreachable code.
12202
12203 2002-08-23  Martin Baulig  <martin@gnome.org>
12204
12205         * statement.cs (Throw.Resolve): Allow `throw null'.
12206
12207 2002-08-23  Martin Baulig  <martin@gnome.org>
12208
12209         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12210         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12211         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12212         MemberLookup would return a wrong event if this is an explicit
12213         interface implementation and the class has an event with the same
12214         name.
12215
12216 2002-08-23  Martin Baulig  <martin@gnome.org>
12217
12218         * statement.cs (Block.AddChildVariableNames): New public method.
12219         (Block.AddChildVariableName): Likewise.
12220         (Block.IsVariableNameUsedInChildBlock): Likewise.
12221         (Block.AddVariable): Check whether a variable name has already
12222         been used in a child block.
12223
12224         * cs-parser.jay (declare_local_variables): Mark all variable names
12225         from the current block as being used in a child block in the
12226         implicit block.
12227
12228 2002-08-23  Martin Baulig  <martin@gnome.org>
12229
12230         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12231         find the symbol writer.
12232
12233         * driver.cs: csc also allows the arguments to /define being
12234         separated by commas, not only by semicolons.
12235
12236 2002-08-23  Martin Baulig  <martin@gnome.org>
12237
12238         * interface.cs (Interface.GetMembers): Added static check for events.
12239
12240 2002-08-15  Martin Baulig  <martin@gnome.org>
12241
12242         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12243         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12244
12245         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12246         why the MethodData.EmitDestructor() change was necessary.
12247
12248 2002-08-20  Martin Baulig  <martin@gnome.org>
12249
12250         * class.cs (TypeContainer.FindMembers): Added static check for events.
12251
12252         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12253
12254         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12255         use Type.GetEvents(), not Type.FindMembers().
12256
12257 2002-08-20  Martin Baulig  <martin@gnome.org>
12258
12259         * decl.cs (MemberCache): Added a special method cache which will
12260         be used for method-only searched.  This ensures that a method
12261         search will return a MethodInfo with the correct ReflectedType for
12262         inherited methods.      
12263
12264 2002-08-20  Martin Baulig  <martin@gnome.org>
12265
12266         * decl.cs (DeclSpace.FindMembers): Made this public.
12267
12268 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12269
12270         * delegate.cs: fixed build on windows.
12271         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12272
12273 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12274
12275         * ecore.cs (StandardConversionExists): Return a false
12276         if we are trying to convert the void type to anything else
12277         since that is not allowed.
12278
12279         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12280         we flag error 70 in the event an event is trying to be accessed
12281         directly from outside the declaring type.
12282
12283 2002-08-20  Martin Baulig  <martin@gnome.org>
12284
12285         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12286         MemberCache from typemanager.cs to decl.cs.
12287
12288 2002-08-19  Martin Baulig  <martin@gnome.org>
12289
12290         * class.cs (TypeContainer): Implement IMemberContainer.
12291         (TypeContainer.DefineMembers): Create the MemberCache.
12292         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12293         return public members if BindingFlags.Public was given, check
12294         whether members are static.
12295
12296 2002-08-16  Martin Baulig  <martin@gnome.org>
12297
12298         * decl.cs (DeclSpace.Define): Splitted this in Define and
12299         DefineMembers.  DefineMembers is called first and initializes the
12300         MemberCache.
12301
12302         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12303         DefineMembers() on all our DeclSpaces.
12304
12305         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12306         but call DefineMembers() on all nested interfaces.  We call their
12307         Define() in our new Define() function.
12308
12309         * interface.cs (Interface): Implement IMemberContainer.
12310         (Interface.Define): Moved all code except the attribute stuf to
12311         DefineMembers().
12312         (Interface.DefineMembers): Initialize the member cache.
12313
12314         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12315         need this anymore since we can use MemberCache.FindMembers directly.
12316
12317 2002-08-19  Martin Baulig  <martin@gnome.org>
12318
12319         * typemanager.cs (MemberCache): When creating the cache for an
12320         interface type, add all inherited members.
12321         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12322         to `out bool used_cache' and documented it.
12323         (TypeManager.MemberLookup): If we already used the cache in the first
12324         iteration, we don't need to do the interfaces check.
12325
12326 2002-08-19  Martin Baulig  <martin@gnome.org>
12327
12328         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12329         here from IMemberFinder and don't implement this interface anymore.
12330         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12331
12332         * typemanager.cs (IMemberFinder): This interface is now only used by
12333         classes which actually support the member cache.
12334         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12335         since we only put DeclSpaces into this Hashtable.
12336         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12337         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12338
12339 2002-08-16  Martin Baulig  <martin@gnome.org>
12340
12341         * typemanager.cs (ICachingMemberFinder): Removed.
12342         (IMemberFinder.MemberCache): New property.
12343         (TypeManager.FindMembers): Merged this with RealFindMembers().
12344         This function will never be called from TypeManager.MemberLookup()
12345         so we can't use the cache here, just the IMemberFinder.
12346         (TypeManager.MemberLookup_FindMembers): Check whether the
12347         IMemberFinder has a MemberCache and call the cache's FindMembers
12348         function.
12349         (MemberCache): Rewrote larger parts of this yet another time and
12350         cleaned it up a bit.
12351
12352 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12353
12354         * driver.cs (LoadArgs): Support quoting.
12355
12356         (Usage): Show the CSC-like command line arguments.
12357
12358         Improved a few error messages.
12359
12360 2002-08-15  Martin Baulig  <martin@gnome.org>
12361
12362         * typemanager.cs (IMemberContainer.Type): New property.
12363         (IMemberContainer.IsInterface): New property.
12364
12365         The following changes are conditional to BROKEN_RUNTIME, which is
12366         defined at the top of the file.
12367
12368         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12369         class'es members, but add all members from TypeHandle.ObjectType
12370         if we're an interface.
12371         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12372         is the current type.
12373         (MemberCache.CacheEntry.Container): Removed this field.
12374         (TypeHandle.GetMembers): Include inherited members.
12375
12376 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12377
12378         * typemanager.cs: fixed compilation and added a comment on a field that
12379         is never used.
12380
12381 2002-08-15  Martin Baulig  <martin@gnome.org>
12382
12383         * class.cs (ConstructorInitializer.Resolve): In the
12384         Expression.MemberLookup call, use the queried_type as
12385         invocation_type.
12386
12387         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12388         declared' attribute, it's always true.
12389         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12390         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12391         temporary wrapper for FindMembers which tells MemberLookup whether
12392         members from the base classes are included in the return value.
12393         This will go away soon.
12394         (TypeManager.MemberLookup): Use this temporary hack here; once the
12395         new MemberCache is completed, we don't need to do the DeclaredOnly
12396         looping here anymore since the MemberCache will take care of this.
12397         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12398         (MemberCache): When creating the MemberCache for a class, get
12399         members from the current class and all its base classes.
12400         (MemberCache.CacheEntry.Container): New field.  This is a
12401         temporary hack until the Mono runtime is fixed to distinguish
12402         between ReflectedType and DeclaringType.  It allows us to use MCS
12403         with both the MS runtime and the unfixed Mono runtime without
12404         problems and without accecting performance.
12405         (MemberCache.SearchMembers): The DeclaredOnly looping from
12406         TypeManager.MemberLookup is now done here.      
12407
12408 2002-08-14  Martin Baulig  <martin@gnome.org>
12409
12410         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12411         Type.GetFields on dynamic types but get the fields from the
12412         corresponding TypeContainer.
12413         (MyStructInfo.GetStructInfo): Added check for enum types.
12414
12415         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12416         (MemberList.SyncRoot): Implemented.
12417         (TypeManager.FilterWithClosure): No need to check permissions if
12418         closure_start_type == closure_invocation_type, don't crash if
12419         closure_invocation_type is null.
12420
12421 2002-08-13  Martin Baulig  <martin@gnome.org>
12422
12423         Rewrote TypeContainer.FindMembers to use a member cache.  This
12424         gives us a speed increase of about 35% for the self-hosting MCS
12425         build and of about 15-20% for the class libs (both on GNU/Linux).
12426
12427         * report.cs (Timer): New class to get enhanced profiling.  This
12428         whole class is "TIMER" conditional since it remarkably slows down
12429         compilation speed.
12430
12431         * class.cs (MemberList): New class.  This is an IList wrapper
12432         which we're now using instead of passing MemberInfo[]'s around to
12433         avoid copying this array unnecessarily.
12434         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12435         (ICachingMemberFinder, IMemberContainer): New interface.
12436         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12437         has already been checked, otherwise use it for the name comparision.
12438         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12439         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12440         if possible.  Returns a MemberList, not a MemberInfo [].
12441         (TypeHandle): New class, implements IMemberContainer.  We create
12442         one instance of this class per type, it contains a MemberCache
12443         which is used to do the member lookups.
12444         (MemberCache): New class.  Each instance of this class contains
12445         all members of a type and a name-based hash table.
12446         (MemberCache.FindMembers): This is our new member lookup
12447         function.  First, it looks up all members of the requested name in
12448         the hash table.  Then, it walks this list and sorts out all
12449         applicable members and returns them.
12450
12451 2002-08-13  Martin Baulig  <martin@gnome.org>
12452
12453         In addition to a nice code cleanup, this gives us a performance
12454         increase of about 1.4% on GNU/Linux - not much, but it's already
12455         half a second for the self-hosting MCS compilation.
12456
12457         * typemanager.cs (IMemberFinder): New interface.  It is used by
12458         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12459         Enum, Delegate or Interface.
12460         (TypeManager.finder_to_member_finder): New PtrHashtable.
12461         (TypeManager.finder_to_container): Removed.
12462         (TypeManager.finder_to_delegate): Removed.
12463         (TypeManager.finder_to_interface): Removed.
12464         (TypeManager.finder_to_enum): Removed.
12465
12466         * interface.cs (Interface): Implement IMemberFinder.
12467
12468         * delegate.cs (Delegate): Implement IMemberFinder.
12469
12470         * enum.cs (Enum): Implement IMemberFinder.
12471
12472         * class.cs (TypeContainer): Implement IMemberFinder.
12473
12474 2002-08-12  Martin Baulig  <martin@gnome.org>
12475
12476         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12477
12478 2002-08-12  Martin Baulig  <martin@gnome.org>
12479
12480         * ecore.cs (ITypeExpression): New interface for expressions which
12481         resolve to a type.
12482         (TypeExpression): Renamed to TypeLookupExpression.
12483         (Expression.DoResolve): If we're doing a types-only lookup, the
12484         expression must implement the ITypeExpression interface and we
12485         call DoResolveType() on it.
12486         (SimpleName): Implement the new ITypeExpression interface.
12487         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12488         hack, the situation that we're only looking up types can't happen
12489         anymore when this method is called.  Moved the type lookup code to
12490         DoResolveType() and call it.
12491         (SimpleName.DoResolveType): This ITypeExpression interface method
12492         is now doing the types-only lookup.
12493         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12494         (ResolveFlags): Added MaskExprClass.
12495
12496         * expression.cs (MemberAccess): Implement the ITypeExpression
12497         interface.
12498         (MemberAccess.DoResolve): Added support for a types-only lookup
12499         when we're called via ITypeExpression.DoResolveType().
12500         (ComposedCast): Implement the ITypeExpression interface.
12501
12502         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12503         Expression.Resolve() with ResolveFlags.Type instead.
12504
12505 2002-08-12  Martin Baulig  <martin@gnome.org>
12506
12507         * interface.cs (Interface.Define): Apply attributes.
12508
12509         * attribute.cs (Attribute.ApplyAttributes): Added support for
12510         interface attributes.
12511
12512 2002-08-11  Martin Baulig  <martin@gnome.org>
12513
12514         * statement.cs (Block.Emit): Only check the "this" variable if we
12515         do not always throw an exception.
12516
12517         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12518         whether the property has a set accessor.
12519
12520 2002-08-11  Martin Baulig  <martin@gnome.org>
12521
12522         Added control flow analysis support for structs.
12523
12524         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12525         with control flow analysis turned off.
12526         (IVariable): New interface.
12527         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12528         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12529         (FieldExpr.DoResolve): Resolve the instance expression with flow
12530         analysis turned off and do the definite assignment check after the
12531         resolving when we know what the expression will resolve to.
12532
12533         * expression.cs (LocalVariableReference, ParameterReference):
12534         Implement the new IVariable interface, only call the flow analysis
12535         code if ec.DoFlowAnalysis is true.
12536         (This): Added constructor which takes a Block argument.  Implement
12537         the new IVariable interface.
12538         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12539         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12540         This does the definite assignment checks for struct members.
12541
12542         * class.cs (Constructor.Emit): If this is a non-static `struct'
12543         constructor which doesn't have any initializer, call
12544         Block.AddThisVariable() to tell the flow analysis code that all
12545         struct elements must be initialized before control returns from
12546         the constructor.
12547
12548         * statement.cs (MyStructInfo): New public class.
12549         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12550         argument to this indexer.  If non-zero, check an individual struct
12551         member, not the whole struct.
12552         (FlowBranching.CheckOutParameters): Check struct members.
12553         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12554         overloaded versions of these methods which take an additional
12555         `int field_idx' argument to check struct members.
12556         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12557         overloaded versions of these methods which take an additional
12558         `string field_name' argument to check struct member.s
12559         (VariableInfo): Implement the IVariable interface.
12560         (VariableInfo.StructInfo): New public property.  Returns the
12561         MyStructInfo instance of the variable if it's a struct or null.
12562         (Block.AddThisVariable): New public method.  This is called from
12563         Constructor.Emit() for non-static `struct' constructor which do
12564         not have any initializer.  It creates a special variable for the
12565         "this" instance variable which will be checked by the flow
12566         analysis code to ensure that all of the struct's fields are
12567         initialized before control returns from the constructor.
12568         (UsageVector): Added support for struct members.  If a
12569         variable/parameter is a struct with N members, we reserve a slot
12570         in the usage vector for each member.  A struct is considered fully
12571         initialized if either the struct itself (slot 0) or all its
12572         members are initialized.
12573
12574 2002-08-08  Martin Baulig  <martin@gnome.org>
12575
12576         * driver.cs (Driver.MainDriver): Only report an error CS5001
12577         if there were no compilation errors.
12578
12579         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12580         `UnsafeContext' property to determine whether the parent is in
12581         unsafe context rather than checking the parent's ModFlags:
12582         classes nested in an unsafe class are unsafe as well.
12583
12584 2002-08-08  Martin Baulig  <martin@gnome.org>
12585
12586         * statement.cs (UsageVector.MergeChildren): Distinguish between
12587         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12588         we return.  Added test17() and test18() to test-154.cs.
12589
12590 2002-08-08  Martin Baulig  <martin@gnome.org>
12591
12592         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12593         Family access, make sure the invoking type isn't a subclass of the
12594         queried type (that'd be a CS1540).
12595
12596         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12597         this method which takes an additional `Type invocation_type'.
12598
12599         * expression.cs (BaseAccess.DoResolve): Use the base type as
12600         invocation and query type.
12601         (MemberAccess.DoResolve): If the lookup failed and we're about to
12602         report a CS0122, try a lookup with the ec.ContainerType - if this
12603         succeeds, we must report a CS1540.
12604
12605 2002-08-08  Martin Baulig  <martin@gnome.org>
12606
12607         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12608         (MethodGroupExpr): Implement the IMemberExpr interface.
12609
12610         * expression (MemberAccess.ResolveMemberAccess): No need to have
12611         any special code for MethodGroupExprs anymore, they're now
12612         IMemberExprs.   
12613
12614 2002-08-08  Martin Baulig  <martin@gnome.org>
12615
12616         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12617         Family, FamANDAssem and FamORAssem permissions.
12618         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12619
12620 2002-08-08  Martin Baulig  <martin@gnome.org>
12621
12622         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12623         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12624         or loop block.
12625
12626 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12627
12628         * driver.cs: implemented /resource option to embed managed resources.
12629
12630 2002-08-07  Martin Baulig  <martin@gnome.org>
12631
12632         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12633         (FieldBase.HasFieldInitializer): New public property.
12634         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12635         returns the field initializer and makes sure it is only resolved once.
12636         (TypeContainer.EmitFieldInitializers): Call
12637         FieldBase.GetInitializerExpression to get the initializer, this ensures
12638         that it isn't resolved multiple times.
12639
12640         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12641         the resolving process (SimpleName/MemberLookup) that we're currently
12642         emitting a field initializer (which must not access any instance members,
12643         this is an error CS0236).
12644
12645         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12646         argument, if the `IsFieldInitializer' flag is set, we must report and
12647         error CS0236 and not an error CS0120.   
12648
12649 2002-08-07  Martin Baulig  <martin@gnome.org>
12650
12651         * ecore.cs (IMemberExpr): New public interface.
12652         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12653         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12654         if the expression is an IMemberExpr.
12655
12656         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12657         to be null, implicitly default to `this' if we're non-static in
12658         this case.  Simplified the code a lot by using the new IMemberExpr
12659         interface.  Also fixed bug #28176 here.
12660
12661 2002-08-06  Martin Baulig  <martin@gnome.org>
12662
12663         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12664         ParameterReferences during semantic analysis so that we can do a
12665         type-only search when resolving Cast, TypeOf and SizeOf.
12666         (block): Pass the `current_local_parameters' to the Block's
12667         constructor.
12668
12669         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12670         argument to the constructor.
12671         (ConstructorInitializer.Resolve): Create a temporary implicit
12672         block with the parameters.
12673
12674         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12675         references here if we aren't doing a type-only search.
12676
12677         * statement.cs (Block): Added constructor which takes a
12678         `Parameters parameters' argument.
12679         (Block.Parameters): New public property.
12680
12681         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12682         to `Parameters' and made it public readonly.
12683
12684 2002-08-06  Martin Baulig  <martin@gnome.org>
12685
12686         * ecore.cs (Expression.Warning): Made this public as well.
12687
12688         * report.cs (Report.Debug): Print the contents of collections.
12689
12690 2002-08-06  Martin Baulig  <martin@gnome.org>
12691
12692         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12693         used to tell Resolve() which kinds of expressions it may return.
12694         (Expression.Resolve): Added overloaded version of this method which
12695         takes a `ResolveFlags flags' argument.  This can be used to tell
12696         Resolve() which kinds of expressions it may return.  Reports a
12697         CS0118 on error.
12698         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12699         ResolveFlags.SimpleName.
12700         (Expression.Error118): Added overloaded version of this method which
12701         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12702         which kinds of expressions are allowed.
12703
12704         * expression.cs (Argument.ResolveMethodGroup): New public method.
12705         Resolves an argument, but allows a MethodGroup to be returned.
12706         This is used when invoking a delegate.
12707
12708         * TODO: Updated a bit.
12709
12710 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12711
12712         Fixed compilation with csc.
12713
12714         * ecore.cs: Expression.Error made public. Is this correct? Should
12715         Warning be made public too?
12716
12717         * expression.cs: use ea.Location instead of ea.loc.
12718         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12719
12720 2002-08-06  Martin Baulig  <martin@gnome.org>
12721
12722         * ecore.cs (Expression.loc): Moved the location here instead of
12723         duplicating it in all derived classes.
12724         (Expression.Location): New public property.
12725         (Expression.Error, Expression.Warning): Made them non-static and
12726         removed the location argument.
12727         (Expression.Warning): Added overloaded version which takes an
12728         `int level' argument.
12729         (Expression.Error118): Make this non-static and removed the
12730         expression and location arguments.
12731         (TypeExpr): Added location argument to the constructor.
12732
12733         * expression.cs (StaticCallExpr): Added location argument to
12734         the constructor.
12735         (Indirection, PointerArithmetic): Likewise.
12736         (CheckedExpr, UnCheckedExpr): Likewise.
12737         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12738         (StringPtr): Likewise.
12739
12740
12741 2002-08-05  Martin Baulig  <martin@gnome.org>
12742
12743         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12744
12745         * assign.cs (Assign.DoResolve): Check whether the source
12746         expression is a value or variable.
12747
12748         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12749         while resolving the corresponding blocks.
12750
12751         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12752         an error, don't silently return null.
12753
12754         * statement.cs (Block.AddVariable): Do the error reporting here
12755         and distinguish between CS0128 and CS0136.
12756         (Block.DoResolve): Report all unused labels (warning CS0164).
12757         (LabeledStatement): Pass the location to the constructor.
12758         (LabeledStatement.HasBeenReferenced): New property.
12759         (LabeledStatement.Resolve): Set it to true here.
12760
12761         * statement.cs (Return.Emit): Return success even after reporting
12762         a type mismatch error (CS0126 or CS0127), this is what csc does and
12763         it avoids confusing the users with any consecutive errors.
12764
12765 2002-08-05  Martin Baulig  <martin@gnome.org>
12766
12767         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12768
12769         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12770
12771         * expression.cs (MemberAccess.DoResolve): Silently return if an
12772         error has already been reported.
12773
12774         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12775         error has already been reported.
12776
12777 2002-08-05  Martin Baulig  <martin@gnome.org>
12778
12779         * statement.cs (UsageVector): Only initialize the `parameters'
12780         vector if we actually have any "out" parameters.
12781
12782 2002-08-05  Martin Baulig  <martin@gnome.org>
12783
12784         * expression.cs (Binary.ResolveOperator): When combining delegates,
12785         they must have the same type.
12786
12787 2002-08-05  Martin Baulig  <martin@gnome.org>
12788
12789         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12790         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12791         work with the ms runtime and we also don't need it: if we're a
12792         PropertyBuilder and not in the `indexer_arguments' hash, then we
12793         are a property and not an indexer.
12794
12795         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12796         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12797         since the latter one doesn't work with the ms runtime.
12798
12799 2002-08-03  Martin Baulig  <martin@gnome.org>
12800
12801         Fixed bugs #27998 and #22735.
12802
12803         * class.cs (Method.IsOperator): New public field.
12804         (Method.CheckBase): Report CS0111 if there's already a method
12805         with the same parameters in the current class.  Report CS0508 when
12806         attempting to change the return type of an inherited method.
12807         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12808         and it's not marked abstract or extern.
12809         (PropertyBase): New abstract base class for Property and Indexer.
12810         (PropertyBase.CheckBase): Moved here from Property and made it work
12811         for indexers.
12812         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12813         the same so we can reuse it there.
12814         (Property, Indexer): Derive from PropertyBase.
12815         (MethodSignature.inheritable_property_signature_filter): New delegate
12816         to find properties and indexers.
12817
12818         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12819         argument and improved error reporting.
12820
12821         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12822         EmptyReadOnlyParameters and made it a property.
12823
12824         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12825         version of this method which takes a `PropertyInfo indexer'.
12826         (TypeManager.RegisterIndexer): New method.
12827
12828         * class.cs: Added myself as author of this file :-)
12829
12830 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12831
12832         * class.cs: fixed compilation on windoze.
12833
12834 2002-08-03  Martin Baulig  <martin@gnome.org>
12835
12836         * interface.cs (Interface.GetInterfaceBases): Check whether all
12837         base interfaces are at least as accessible than the current one.
12838
12839         * class.cs (TypeContainer.GetClassBases): Check whether base types
12840         are at least as accessible than the current type.
12841         (TypeContainer.AsAccessible): Implemented and made non-static.
12842         (MemberBase.CheckParameters): Report errors if the accessibility
12843         checks fail.
12844
12845         * delegate.cs (Delegate.Delegate): The default visibility is
12846         internal for top-level types and private for nested types.
12847         (Delegate.Define): Report errors if the accessibility checks fail.
12848
12849         * enum.cs (Enum.Enum): The default visibility is internal for
12850         top-level types and private for nested types.
12851         (Enum.DefineType): Compute the correct visibility.
12852
12853         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12854         function which takes a `bool is_toplevel' instead of a TypeContainer.
12855
12856         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12857         builtin type.
12858
12859 2002-08-02  Martin Baulig  <martin@gnome.org>
12860
12861         * expression.cs (LocalVariableReferenc): Added constructor which
12862         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12863         (LocalVariableReference.IsReadOnly): New property.
12864         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12865         variable is readonly, use our own readonly flag to do this; you can
12866         use the new constructor to get a writable reference to a read-only
12867         variable.
12868
12869         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12870         reference to the local variable.
12871
12872 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12873
12874         * rootcontext.cs (ResolveCore): Also include System.Exception
12875
12876         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12877         we reach an EmptyStatement.
12878
12879         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12880         is also fine.
12881
12882         * expression.cs (Binary.ResolveOperator): Check error result in
12883         two places.
12884
12885         use brtrue/brfalse directly and avoid compares to null.
12886
12887 2002-08-02  Martin Baulig  <martin@gnome.org>
12888
12889         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12890         Fixes bug #28407, added test-155.cs.
12891
12892 2002-08-01  Martin Baulig  <martin@gnome.org>
12893
12894         * class.cs (Event.EmitDefaultMethod): Make this work with static
12895         events.  Fixes #28311, added verify-3.cs.
12896
12897 2002-08-01  Martin Baulig  <martin@gnome.org>
12898
12899         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12900         `is_disposable' fields.
12901         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12902         `hm.is_disposable' if we're using the collection pattern.
12903         (Foreach.EmitCollectionForeach): Use the correct type for the
12904         enumerator's local variable, only emit the try/finally block if
12905         necessary (fixes #27713).
12906
12907 2002-08-01  Martin Baulig  <martin@gnome.org>
12908
12909         * ecore.cs (Expression.report118): Renamed to Error118 and made
12910         it public static.
12911
12912         * statement.cs (Throw.Resolve): Check whether the expression is of
12913         the correct type (CS0118) and whether the type derives from
12914         System.Exception (CS0155).
12915         (Catch.Resolve): New method.  Do the type lookup here and check
12916         whether it derives from System.Exception (CS0155).
12917         (Catch.CatchType, Catch.IsGeneral): New public properties.
12918
12919         * typemanager.cs (TypeManager.exception_type): Added.
12920
12921 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12922
12923         * driver.cs: Updated About function.
12924
12925 2002-07-31  Martin Baulig  <martin@gnome.org>
12926
12927         Implemented Control Flow Analysis.
12928
12929         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12930         (EmitContext.CurrentBranching): Added.
12931         (EmitContext.StartFlowBranching): Added.
12932         (EmitContext.EndFlowBranching): Added.
12933         (EmitContext.KillFlowBranching): Added.
12934         (EmitContext.IsVariableAssigned): Added.
12935         (EmitContext.SetVariableAssigned): Added.
12936         (EmitContext.IsParameterAssigned): Added.
12937         (EmitContext.SetParameterAssigned): Added.
12938         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12939         Added control flow analysis stuff here.
12940
12941         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12942         resolve the expression as lvalue.
12943         (LocalVariableReference.DoResolve): Check whether the variable has
12944         already been assigned.
12945         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12946         the parameter as assigned here.
12947         (ParameterReference.DoResolve): Check whether the parameter has already
12948         been assigned.
12949         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12950         expression as lvalue.
12951
12952         * statement.cs (FlowBranching): New class for the flow analysis code.
12953         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12954         (LabeledStatement.IsDefined): New public property.
12955         (LabeledStatement.AddUsageVector): New public method to tell flow
12956         analyis that the label may be reached via a forward jump.
12957         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12958         flow analysis.
12959         (VariableInfo.Number): New public field.  This is used by flow analysis
12960         to number all locals of a block.
12961         (Block.CountVariables): New public property.  This is the number of
12962         local variables in this block (including the locals from all parent
12963         blocks).
12964         (Block.EmitMeta): Number all the variables.
12965
12966         * statement.cs: Added flow analysis support to all classes.
12967
12968 2002-07-31  Martin Baulig  <martin@gnome.org>
12969
12970         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12971         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12972         then use this argument.
12973
12974         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12975
12976         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12977         use this to specify /define options.
12978
12979 2002-07-29  Martin Baulig  <martin@gnome.org>
12980
12981         * statement.cs (Fixed): Moved all code that does variable lookups
12982         and resolvings from Emit to Resolve.
12983
12984         * statement.cs (For): Moved all code that does variable lookups
12985         and resolvings from Emit to Resolve.
12986
12987         * statement.cs (Using): Moved all code that does variable lookups
12988         and resolvings from Emit to Resolve.
12989
12990 2002-07-29  Martin Baulig  <martin@gnome.org>
12991
12992         * attribute.cs (Attribute.Resolve): Explicitly catch a
12993         System.NullReferenceException when creating the
12994         CustromAttributeBuilder and report a different warning message.
12995
12996 2002-07-29  Martin Baulig  <martin@gnome.org>
12997
12998         * support.cs (ParameterData.ParameterName): Added method to
12999         get the name of a parameter.
13000
13001         * typemanager.cs (TypeManager.IsValueType): New public method.
13002
13003 2002-07-29  Martin Baulig  <martin@gnome.org>
13004
13005         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13006         is a flag which specifies that it's either ref or out.
13007         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13008         the out parameter to `out Parameter.Modifier mod', also set the
13009         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13010
13011         * support.cs (InternalParameters.ParameterModifier): Distinguish
13012         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13013         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13014
13015         * expression.cs (Argument.GetParameterModifier): Distinguish
13016         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13017         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13018
13019 2002-07-29  Martin Baulig  <martin@gnome.org>
13020
13021         * expression.cs (ParameterReference.ParameterReference): Added
13022         `Location loc' argument to the constructor.
13023
13024         * cs-parser.jay: Pass location to ParameterReference.
13025
13026 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13027
13028         * statement.cs (Try): Initialize the location.
13029
13030         * cs-parser.jay: pass location to Try.
13031
13032         * expression.cs (Unary.Reduce): Change the prototype to return
13033         whether a constant fold could be performed or not.  The result is
13034         returned in an out parameters.  In the case of Indirection and
13035         AddressOf, we want to perform the full tests.
13036
13037 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13038
13039         * statement.cs (Statement.Emit): Flag dead code.
13040
13041 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13042
13043         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13044
13045 2002-07-27  Martin Baulig  <martin@gnome.org>
13046
13047         * class.cs (MethodData.Define): Put back call to
13048         TypeManager.AddMethod(), accidentally commented this out.
13049
13050         * report.cs (Debug): New public method to print debugging information,
13051         this is `[Conditional ("DEBUG")]'.
13052
13053 2002-07-26  Martin Baulig  <martin@gnome.org>
13054
13055         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13056         (switch_statement): Push the current_block to the switch_stack and
13057         pop it again when we're done with the switch.
13058         (switch_section): The new block is a child of the current_block.
13059         Fixes bug #24007, added test-152.cs.
13060
13061 2002-07-27  Martin Baulig  <martin@gnome.org>
13062
13063         * expression.cs (Invocation.EmitArguments): When calling a varargs
13064         function with only its fixed arguments, we need to pass an empty
13065         array.
13066
13067 2002-07-27  Martin Baulig  <martin@gnome.org>
13068
13069         Mono 0.13 has been released.
13070
13071 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13072
13073         * driver.cs: Rename --resource to --linkres, because that is what
13074         we do currently, we dont support --resource yet.
13075
13076         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13077
13078 2002-07-25  Martin Baulig  <martin@gnome.org>
13079
13080         * class.cs (MethodData): New public class.  This is a `method builder'
13081         class for a method or one accessor of a Property/Indexer/Event.
13082         (MethodData.GetMethodFlags): Moved here from MemberBase.
13083         (MethodData.ApplyAttributes): Likewise.
13084         (MethodData.ApplyObsoleteAttribute): Likewise.
13085         (MethodData.ApplyConditionalAttribute): Likewise.
13086         (MethodData.ApplyDllImportAttribute): Likewise.
13087         (MethodData.CheckAbstractAndExternal): Likewise.
13088         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13089         (MethodData.Emit): Formerly known as Method.Emit().
13090         (MemberBase): Moved everything which was specific to a single
13091         accessor/method to MethodData.
13092         (Method): Create a new MethodData and call Define() and Emit() on it.
13093         (Property, Indexer, Event): Create a new MethodData objects for each
13094         accessor and call Define() and Emit() on them.
13095
13096 2002-07-25  Martin Baulig  <martin@gnome.org>
13097
13098         Made MethodCore derive from MemberBase to reuse the code from there.
13099         MemberBase now also checks for attributes.
13100
13101         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13102         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13103         as virtual.
13104         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13105         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13106         (MemberBase.ApplyAttributes): New virtual method; applies the
13107         attributes to a method or accessor.
13108         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13109         (MemberBase.ApplyConditionalAttribute): Likewise.
13110         (MemberBase.ApplyDllImportAttribute): Likewise.
13111         (MemberBase.CheckAbstractAndExternal): Likewise.
13112         (MethodCore.ParameterTypes): This is now a property instead of a
13113         method, it's initialized from DoDefineParameters().
13114         (MethodCore.ParameterInfo): Removed the set accessor.
13115         (MethodCore.DoDefineParameters): New protected virtual method to
13116         initialize ParameterTypes and ParameterInfo.
13117         (Method.GetReturnType): We can now simply return the MemberType.
13118         (Method.GetMethodFlags): Override the MemberBase version and add
13119         the conditional flags.
13120         (Method.CheckBase): Moved some code from Define() here, call
13121         DoDefineParameters() here.
13122         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13123         here to avoid some larger code duplication.
13124         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13125         ensure that abstract and external accessors don't declare a body.
13126
13127         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13128         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13129         lookup in the attribute's parent classes, so we need to abort as soon
13130         as we found the first match.
13131         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13132         the attribute has no arguments.
13133
13134         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13135         of a Method.
13136
13137 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13138
13139         * cs-parser.jay: reverted previous patch.
13140
13141 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13142
13143         * cs-parser.jay: fixed bug #22119.
13144
13145 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13146
13147         * attribute.cs: fixed compilation. The error was:
13148         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13149         be assigned to before control leaves the current method."
13150         [FIXME:  Filed as bug #28186: MCS must report this error.]
13151
13152 2002-07-25  Martin Baulig  <martin@gnome.org>
13153
13154         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13155         method to pull the condition name ouf of a Conditional attribute.
13156         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13157         the obsolete message and error flag out of an Obsolete attribute.
13158
13159         * class.cs (Method.GetMethodFlags): New public method to get the
13160         TypeManager.MethodFlags for this method.
13161         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13162         private methods.
13163         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13164         if we're overriding a virtual function, set the new private variable
13165         `parent_method'; call the new TypeManager.AddMethod().
13166
13167         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13168         the MethodBuilder and the Method in a PtrHashtable.
13169         (TypeManager.builder_to_method): Added for this purpose.
13170         (TypeManager.MethodFlags): Added IsObsoleteError.
13171         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13172         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13173         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13174         the message from the attribute.
13175
13176 2002-07-24  Martin Baulig  <martin@gnome.org>
13177
13178         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13179         preprocessor directives, ensure that the argument to #define/#undef is
13180         exactly one identifier and that it's actually an identifier.
13181
13182         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13183         did not work ....
13184
13185 2002-07-24  Martin Baulig  <martin@gnome.org>
13186
13187         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13188         initialize it to TypeManager.object_type in the constructor.
13189         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13190         of the `hm.get_current' method if we're using the collection pattern.
13191         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13192         for the explicit conversion to make it work when we're using the collection
13193         pattern and the `Current' property has a different return type than `object'.
13194         Fixes #27713.
13195
13196 2002-07-24  Martin Baulig  <martin@gnome.org>
13197
13198         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13199         does not match, but don't report any errors.  This method is called in
13200         order for all methods in a MethodGroupExpr until a matching method is
13201         found, so we don't want to bail out if the first method doesn't match.
13202         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13203         matches, report the 123.  Fixes #28070.
13204
13205 2002-07-24  Martin Baulig  <martin@gnome.org>
13206
13207         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13208         TypeManager.TypeToCoreType() to the top of the method so the
13209         following equality checks will work.  Fixes #28107.
13210
13211 2002-07-24  Martin Baulig  <martin@gnome.org>
13212
13213         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13214         operand is of type uint, and the other operand is of type sbyte,
13215         short or int, the operands are converted to type long." -
13216         Actually do what this comment already told us.  Fixes bug #28106,
13217         added test-150.cs.
13218
13219 2002-07-24  Martin Baulig  <martin@gnome.org>
13220
13221         * class.cs (MethodBase): New abstract class.  This is now a base
13222         class for Property, Indexer and Event to avoid some code duplication
13223         in their Define() and DefineMethods() methods.
13224         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13225         generic methods for Define() and DefineMethods().
13226         (FieldBase): Derive from MemberBase, not MemberCore.
13227         (Property): Derive from MemberBase, not MemberCore.
13228         (Property.DefineMethod): Moved all the code from this method to the
13229         new MethodBase.DefineAccessor(), just call it with appropriate
13230         argumetnts.
13231         (Property.Define): Call the new Property.DoDefine(), this does some
13232         sanity checks and we don't need to duplicate the code everywhere.
13233         (Event): Derive from MemberBase, not MemberCore.
13234         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13235         accessors, this will also make them work with interface events.
13236         (Indexer): Derive from MemberBase, not MemberCore.
13237         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13238         (Indexer.Define): Use the new MethodBase functions.
13239
13240         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13241         argument to the constructor.
13242         (Interface.FindMembers): Added support for interface events.
13243         (Interface.PopluateEvent): Implemented.
13244
13245         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13246
13247 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13248
13249         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13250         but this is required to check for a method name being the same as
13251         the containing class.  
13252
13253         Handle this now.
13254
13255 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13256
13257         * interface.cs: initialize variable.
13258
13259 2002-07-23  Martin Baulig  <martin@gnome.org>
13260
13261         Implemented the IndexerName attribute in interfaces.
13262
13263         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13264         name if this is an explicit interface implementation.
13265         (Indexer.InterfaceIndexerName): New public variable.  If we're
13266         implementing an interface indexer, this is the IndexerName in that
13267         interface.  Otherwise, it's the IndexerName.
13268         (Indexer.DefineMethod): If we're implementing interface indexer,
13269         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13270         and Pending.ImplementIndexer methods.
13271         (Indexer.Define): Also define the PropertyBuilder if we're
13272         implementing an interface indexer and this is neither an explicit
13273         interface implementation nor do the IndexerName match the one in
13274         the interface.
13275
13276         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13277         If a method is defined here, then we always need to create a proxy
13278         for it.  This is used when implementing interface indexers.
13279         (Pending.IsInterfaceIndexer): New public method.
13280         (Pending.ImplementIndexer): New public method.
13281         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13282         This is used when implementing interface indexers to define a proxy
13283         if necessary.
13284         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13285         define a proxy if necessary.
13286
13287         * interface.cs (Interface.IndexerName): New public variable.
13288         (Interface.PopulateIndexer): Set the IndexerName.
13289         (Interface.DefineIndexers): New private method.  Populate all the
13290         indexers and make sure their IndexerNames match.
13291
13292         * typemanager.cs (IndexerPropertyName): Added support for interface
13293         indexers.
13294
13295 2002-07-22  Martin Baulig  <martin@gnome.org>
13296
13297         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13298         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13299         ret if HasReturnLabel.
13300         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13301         variables.
13302
13303         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13304         and set the ec.LoopBeginTryCatchLevel.
13305         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13306         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13307         the current ec.TryCatchLevel, the branch goes out of an exception
13308         block.  In this case, we need to use Leave and not Br.
13309
13310 2002-07-22  Martin Baulig  <martin@gnome.org>
13311
13312         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13313         block unless the block does not always return or it is contained in
13314         another try { ... } catch { ... } block.  Fixes bug #26506.
13315         Added verify-1.cs to the test suite.
13316
13317 2002-07-22  Martin Baulig  <martin@gnome.org>
13318
13319         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13320         then we do not always return.  Fixes bug #24985.
13321
13322 2002-07-22  Martin Baulig  <martin@gnome.org>
13323
13324         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13325         lookup on a per-class level; ie. walk up the class hierarchy until we
13326         found at least one applicable method, then choose the best among them.
13327         Fixes bug #24463 and test-29.cs.
13328
13329 2002-07-22  Martin Baulig  <martin@gnome.org>
13330
13331         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13332         return types of the methods.  The return type is not part of the
13333         signature and we must not check it to make the `new' modifier work.
13334         Fixes bug #27999, also added test-147.cs.
13335         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13336
13337         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13338         on the method's return type.
13339
13340 2002-07-21  Martin Baulig  <martin@gnome.org>
13341
13342         * assign.cs: Make this work if the rightmost source is a constant and
13343         we need to do an implicit type conversion.  Also adding a few more tests
13344         to test-38.cs which should have caught this.
13345
13346         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13347         target in the makefile for this.  The makefile.gnu is primarily intended
13348         for end-users who don't want to debug the compiler.
13349
13350 2002-07-21  Martin Baulig  <martin@gnome.org>
13351
13352         * assign.cs: Improved the Assign class so it can now handle embedded
13353         assignments (X = Y = Z = something).  As a side-effect this'll now also
13354         consume less local variables.  test-38.cs now passes with MCS, added
13355         a few new test cases to that test.
13356
13357 2002-07-20  Martin Baulig  <martin@gnome.org>
13358
13359         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13360         instructions.  Fixes bug #27977, also added test-146.cs.
13361
13362 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13363
13364         * cs-tokenizer.cs: fixed getHex ().
13365
13366 2002-07-19  Martin Baulig  <martin@gnome.org>
13367
13368         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13369         not Type.GetType() to lookup the array type.  This is needed when
13370         we're constructing an array of a user-defined type.
13371         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13372         single-dimensional arrays, but also for single-dimensial arrays of
13373         type decimal.
13374
13375 2002-07-19  Martin Baulig  <martin@gnome.org>
13376
13377         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13378         this function is called, it's not allowed to share LocalBuilders
13379         among ILGenerators.
13380
13381 2002-07-19  Martin Baulig  <martin@gnome.org>
13382
13383         * expression.cs (Argument.Resolve): Report an error 118 when trying
13384         to pass a type as argument.
13385
13386 2002-07-18  Martin Baulig  <martin@gnome.org>
13387
13388         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13389         Conv_R_Un for the signed `long' type.
13390
13391 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13392
13393         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13394         `expr' for the temporary result, as that will fail if we do
13395         multiple resolves on the same expression.
13396
13397 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13398
13399         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13400         ec.TypeContainer for looking up aliases. 
13401
13402         * class.cs (TypeContainer): Remove LookupAlias from here.
13403
13404         * decl.cs (DeclSpace); Move here.
13405
13406 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13407
13408         * class.cs (FindMembers): Only call filter if the constructor
13409         bulider is not null.
13410
13411         Also handle delegates in `NestedTypes' now.  Now we will perform
13412         type lookups using the standard resolution process.  This also
13413         fixes a bug.
13414
13415         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13416         This uses Expressions (the limited kind that can be parsed by the
13417         tree) instead of strings.
13418
13419         * expression.cs (ComposedCast.ToString): Implement, used to flag
13420         errors since now we have to render expressions.
13421
13422         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13423         FormArrayType. 
13424
13425         * ecore.cs (SimpleName.ToString): ditto.
13426
13427         * cs-parser.jay: Instead of using strings to assemble types, use
13428         Expressions to assemble the type (using SimpleName, ComposedCast,
13429         MemberAccess).  This should fix the type lookups in declarations,
13430         because we were using a different code path for this.
13431
13432         * statement.cs (Block.Resolve): Continue processing statements
13433         even when there is an error.
13434
13435 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13436
13437         * class.cs (Event.Define): Also remove the `remove' method from
13438         the list of pending items.
13439
13440         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13441         generate more compact code. 
13442
13443 2002-07-17  Martin Baulig  <martin@gnome.org>
13444
13445         * const.cs (Const.LookupConstantValue): Add support for constant
13446         `unchecked' and `checked' expressions.
13447         Also adding test case test-140.cs for this.
13448
13449 2002-07-17  Martin Baulig  <martin@gnome.org>
13450
13451         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13452         check whether mi.ReturnType implements the IEnumerator interface; the
13453         `==' and the IsAssignableFrom() will fail in this situation.
13454
13455 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13456
13457         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13458         here too.
13459
13460 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13461
13462         * expression.cs: fixed bug #27811.
13463
13464 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13467         Molaro: when we are a ref, the value already contains a pointer
13468         value, do not take the address of it.
13469
13470 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13471         * removed mb-parser.jay and mb-tokenizer.cs
13472
13473 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13474
13475         * expression.cs: check against the building corlib void type.
13476
13477 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13478
13479         * ecore.cs: fix for valuetype static readonly fields: when 
13480         initializing them, we need their address, not the address of a copy.
13481
13482 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13483
13484         * typemanager.cs: register also enum_type in corlib.
13485
13486 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13487
13488         * class.cs: allow calling this (but not base) initializers in structs.
13489
13490 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13491
13492         * ecore.cs: make sure we compare against the building base types
13493         in GetTypeSize ().
13494
13495 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13496
13497         * typemanager.cs: fix TypeToCoreType() to handle void and object
13498         (corlib gets no more typerefs after this change).
13499
13500 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13501
13502         * expression.cs (ArrayCreation.EmitArrayArguments): use
13503         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13504
13505         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13506         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13507         array indexes, the runtime actually forbids them.
13508
13509         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13510         for array arguments here.
13511
13512         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13513         instead of the default for ValueTypes.
13514
13515         (New.DoEmit): Use IsValueType instead of
13516         IsSubclassOf (value_type)
13517         (New.DoResolve): ditto.
13518         (Invocation.EmitCall): ditto.
13519
13520         * assign.cs (Assign): ditto.
13521
13522         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13523         Statements *are* currently doing part of their resolution during
13524         Emit.  
13525
13526         Expressions do always resolve during resolve, but statements are
13527         only required to propagate resolution to their children.
13528
13529 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13530
13531         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13532
13533         (LoadAssembly): Do not add the dll if it is already specified
13534
13535         (MainDriver): Add the System directory to the link path at the end,
13536         after all the other -L arguments. 
13537
13538         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13539         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13540         ldelem.u1) and using the opposite for sbytes.
13541
13542         This fixes Digger, and we can finally run it.
13543
13544         * driver.cs (UnixParseOption): Move the option parsing here.  
13545         (CSCParseOption): Implement CSC-like parsing of options.
13546
13547         We now support both modes of operation, the old Unix way, and the
13548         new CSC-like way.  This should help those who wanted to make cross
13549         platform makefiles.
13550
13551         The only thing broken is that /r:, /reference: and /lib: are not
13552         implemented, because I want to make those have the same semantics
13553         as the CSC compiler has, and kill once and for all the confussion
13554         around this.   Will be doing this tomorrow.
13555
13556         * statement.cs (Unsafe.Resolve): The state is checked during
13557         resolve, not emit, so we have to set the flags for IsUnsfe here.
13558
13559 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13560
13561         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13562         not catch the Error_ObjectRefRequired in SimpleName (as it is
13563         possible to have a class/instance variable name that later gets
13564         deambiguated), we have to check this here.      
13565
13566 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13567
13568         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13569         make static and put into Expression.
13570
13571         (Event.Define): Register the private field of the event with the 
13572         TypeManager so that GetFieldFromEvent can get at it.
13573
13574         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13575         keep track of the private field associated with an event which
13576         has no accessors.
13577
13578         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13579         private field.
13580
13581         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13582
13583 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13584
13585         * expression.cs (Binary.EmitBranchable): this routine emits the
13586         Binary expression in a branchable context.  This basically means:
13587         we need to branch somewhere, not just get the value on the stack.
13588
13589         This works together with Statement.EmitBoolExpression.
13590
13591         * statement.cs (Statement.EmitBoolExpression): Use
13592         EmitBranchable. 
13593
13594 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13595
13596         * statement.cs (For): Reduce the number of jumps in loops.
13597
13598         (For): Implement loop inversion for the For statement.
13599
13600         (Break): We can be breaking out of a Try/Catch controlled section
13601         (foreach might have an implicit try/catch clause), so we need to
13602         use Leave instead of Br.
13603
13604         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13605         now).  If the instace expression supports IMemoryLocation, we use
13606         the AddressOf method from the IMemoryLocation to extract the
13607         address instead of emitting the instance.
13608
13609         This showed up with `This', as we were emitting the instance
13610         always (Emit) instead of the Address of This.  Particularly
13611         interesting when This is a value type, as we dont want the Emit
13612         effect (which was to load the object).
13613
13614 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13615
13616         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13617
13618         * statement.cs (Checked): Set the CheckedState during the resolve
13619         process too, as the ConvCast operations track the checked state on
13620         the resolve process, and not emit.
13621
13622         * cs-parser.jay (namespace_member_declaration): Flag that we have
13623         found a declaration when we do.  This is used to flag error 1529
13624
13625         * driver.cs: Report ok when we display the help only.
13626
13627 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13628
13629         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13630
13631 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * cs-tokenizer.cs (define): We also have to track locally the
13634         defines.  AllDefines is just used for the Conditional Attribute,
13635         but we also need the local defines for the current source code. 
13636
13637 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13638
13639         * statement.cs (While, For, Do): These loops can exit through a
13640         Break statement, use this information to tell whether the
13641         statement is the last piece of code.
13642
13643         (Break): Flag that we break.
13644
13645         * codegen.cs (EmitContexts): New `Breaks' state variable.
13646
13647 2002-07-03  Martin Baulig  <martin@gnome.org>
13648
13649         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13650         modifiers in method declarations in structs.  Otherwise, you won't
13651         be able to override things like Object.Equals().
13652
13653 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * class.cs (Method, Property, Indexer): Do not allow the public
13656         modifier to be used in explicit interface implementations.
13657
13658         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13659         override modifiers in method declarations in structs
13660
13661 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13662
13663         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13664         integer or real overflow, report an error
13665
13666 2002-07-02  Martin Baulig  <martin@gnome.org>
13667
13668         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13669         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13670         to tell the runtime about our newly created System.Object and
13671         System.ValueType types.
13672
13673 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13674
13675         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13676         struct instead of Ldarg/Starg.
13677
13678 2002-07-02  Martin Baulig  <martin@gnome.org>
13679
13680         * expression.cs (Indirection.Indirection): Call
13681         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13682
13683 2002-07-02  Martin Baulig  <martin@gnome.org>
13684
13685         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13686         ValueType, call TypeManager.TypeToCoreType() on it.
13687         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13688         the OpCodes.Newarr argument.
13689
13690 2002-07-02  Martin Baulig  <martin@gnome.org>
13691
13692         * expression.cs (Invocation.EmitCall): When compiling corlib,
13693         replace all calls to the system's System.Array type to calls to
13694         the newly created one.
13695
13696         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13697         System.Array methods.
13698         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13699         from the system's System.Array type which must be replaced.
13700
13701 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13702
13703         * typemanager.cs: load unverifiable_code_ctor so we can build
13704         corlib using the correct type. Avoid using GetTypeCode() with
13705         TypeBuilders.
13706         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13707         TypeManager.object_type to allow building corlib.
13708
13709 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13710
13711         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13712
13713 2002-07-01  Martin Baulig  <martin@gnome.org>
13714
13715         * class.cs: Make the last change actually work, we need to check
13716         whether `ifaces != null' to avoid a crash.
13717
13718 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13719
13720         * class.cs: when we build structs without fields that implement
13721         interfaces, we need to add the interfaces separately, since there is
13722         no API to both set the size and add the interfaces at type creation
13723         time.
13724
13725 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13726
13727         * expression.cs: the dimension arguments to the array constructors
13728         need to be converted if they are a long.
13729
13730 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13731
13732         * class.cs: don't emit ldarg.0 if there is no parent constructor
13733         (fixes showstopper for corlib).
13734
13735 2002-06-29  Martin Baulig  <martin@gnome.org>
13736
13737         MCS now compiles corlib on GNU/Linux :-)
13738
13739         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13740         ie. check for MethodImplOptions.InternalCall.
13741
13742         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13743         and TypeManager.attribute_type are null, so we must explicitly check
13744         whether parent is not null to find out whether it's an attribute type.
13745         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13746         and SetBuilder, not only if the property is neither abstract nor external.
13747         This is necessary to set the MethodImplOptions on the accessor methods.
13748         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13749         SetBuilder, see Property.Emit().
13750
13751         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13752         populate "System.Object", "System.ValueType" and "System.Attribute" since
13753         they've already been populated from BootCorlib_PopulateCoreTypes().
13754
13755 2002-06-29  Martin Baulig  <martin@gnome.org>
13756
13757         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13758         is the NullLiteral, we also need to make sure that target_type is not
13759         an enum type.   
13760
13761 2002-06-29  Martin Baulig  <martin@gnome.org>
13762
13763         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13764         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13765         before calling BootstrapCorlib_ResolveDelegate ().
13766
13767 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13768
13769         * statement.cs: fixed build-breaker. All tests passed ok.
13770
13771 2002-06-27  Martin Baulig  <martin@gnome.org>
13772
13773         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13774         for System.Decimal when compiling corlib.
13775
13776 2002-06-27  Martin Baulig  <martin@gnome.org>
13777
13778         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13779         switch blocks which contain nothing but a default clause.
13780
13781 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13782
13783        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13784
13785 2002-06-27  Martin Baulig  <martin@gnome.org>
13786
13787         * ecore.cs (PropertyExpr.PropertyExpr): Call
13788         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13789
13790         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13791         is already a TypeBuilder.
13792
13793 2002-06-27  Martin Baulig  <martin@gnome.org>
13794
13795         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13796         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13797         the "from an array-type to System.Array" case.  This makes it work
13798         when compiling corlib.
13799
13800 2002-06-27  Martin Baulig  <martin@gnome.org>
13801
13802         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13803         non-static PropertyExpr, set its InstanceExpression.  This makes
13804         the `ICollection.Count' property work in System/Array.cs.
13805
13806 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13807
13808         * driver.cs: Made error handling more consistent.  Errors now
13809         tracked by Report class, so many methods which used to return int
13810         now return void.  Main() now prints success/failure and 
13811         errors/warnings message.
13812
13813         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13814         the magic number return values (123 and 124).  Now, if the
13815         expected error occurs, the compiler exits with success (exit value
13816         0).  If the compilation completes without seeing that particular
13817         error, the compiler exits with failure (exit value 1).  The
13818         makefile in mcs/errors has been changed to handle the new behaviour.
13819
13820         * report.cs: Made 'expected error' number a property and renamed
13821         it from 'Probe' to 'ExpectedError'.
13822
13823         * genericparser.cs: Removed error handling support, since it is
13824         now all done by Report class.
13825
13826         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13827         class, so parse() no longer returns an int.
13828
13829         * namespace.cs: Use Report.Error instead of GenericParser.error
13830
13831 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13832
13833         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13834         TypeContainer.AddOperator): At the front of the list put the
13835         explicit implementations, so they get resolved/defined first. 
13836
13837 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13838
13839         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13840         interface type is implemented by this TypeContainer.  Used during
13841         explicit interface implementation.
13842
13843         (Property.Define, Indexer.Define, Method.Define): Validate that
13844         the given interface in the explicit implementation is one of the
13845         base classes for the containing type.
13846
13847         Also if we are explicitly implementing an interface, but there is
13848         no match in the pending implementation table, report an error.
13849
13850         (Property.Define): Only define the property if we are
13851         not explicitly implementing a property from an interface.  Use the
13852         correct name also for those properties (the same CSC uses,
13853         although that is really not needed).
13854
13855         (Property.Emit): Do not emit attributes for explicitly implemented
13856         properties, as there is no TypeBuilder.
13857
13858         (Indexer.Emit): ditto.
13859
13860         Hiding then means that we do not really *implement* a pending
13861         implementation, which makes code fail.
13862
13863 2002-06-22  Martin Baulig  <martin@gnome.org>
13864
13865         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13866         the return value of Object.GetType().  [FIXME: we need to do this whenever
13867         we get a type back from the reflection library].
13868
13869 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13870
13871         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13872
13873 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * attribute.cs: Return null if we can not look up the type.
13876
13877         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13878         the interface types found.
13879
13880         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13881         interface types found.
13882
13883         * typemanager.cs (GetInterfaces): Make this routine returns alll
13884         the interfaces and work around the lame differences between
13885         System.Type and System.Reflection.Emit.TypeBuilder in the results
13886         result for GetInterfaces.
13887
13888         (ExpandInterfaces): Given an array of interface types, expand and
13889         eliminate repeated ocurrences of an interface.  This expands in
13890         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13891         be IA, IB, IC.
13892
13893 2002-06-21  Martin Baulig  <martin@gnome.org>
13894
13895         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13896         on System.Enum.
13897
13898 2002-06-21  Martin Baulig  <martin@gnome.org>
13899
13900         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13901         and called with one of the core types, return the corresponding typebuilder for
13902         that type.
13903
13904         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13905         element type.
13906
13907 2002-06-21  Martin Baulig  <martin@gnome.org>
13908
13909         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13910         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13911         (Expression.ConvertReferenceExplicit): Likewise.
13912
13913         * expression.cs (ElementAccess.DoResolve): Likewise.
13914         (ElementAccess.DoResolveLValue): Likewise.
13915
13916 2002-06-10  Martin Baulig  <martin@gnome.org>
13917
13918         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13919         add the "value" parameter to the parameter list.
13920
13921         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13922         to our caller.
13923
13924 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13927         the argument to an int, uint, long or ulong, per the spec.  Also
13928         catch negative constants in array creation.
13929
13930 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13931
13932         * class.cs: do not allow the same interface to appear twice in
13933         the definition list.
13934
13935 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13936
13937         * ecore.cs: don't use ldlen with System.Array.
13938
13939 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13940
13941         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13942
13943 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13944
13945         * modifiers.cs: produce correct field attributes for protected
13946         internal. Easy fix so miguel can work on ther harder stuff:-)
13947
13948 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13949
13950         * pending.cs: New file.  Move the code from class.cs here.
13951         Support clearning the pending flag for all methods (when not doing
13952         explicit interface implementation).
13953
13954 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13955
13956         * rootcontext.cs: added a couple more types needed to bootstrap.
13957
13958 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13961         constructor in the type, instead of any constructor in the type
13962         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13963         a bug in the Mono runtime when applying the params attribute). 
13964
13965 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13966         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13967
13968 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13969
13970         * expression.cs (Unary.ResolveOperator): Use TypeManager
13971         to resolve the type.
13972
13973 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13974
13975         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13976         attached.
13977
13978         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13979         with each member too.
13980
13981         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13982         field builders too - this takes care of the enum member case.
13983
13984 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13985
13986         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13987         address-of operator on both value types and pointers.
13988
13989 2002-06-10  Martin Baulig  <martin@gnome.org>
13990
13991         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13992         PropertyBuilder to the `property_builders' list.
13993
13994         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13995         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13996         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13997         find any indexers which are inherited from an interface.
13998
13999 2002-06-09  Martin Baulig  <martin@gnome.org>
14000
14001         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14002         the same type as the constant if necessary.  There's also a test-130.cs
14003         for this.
14004
14005         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14006
14007         * typemanager.cs (TypeManager.ChangeType): Previously known as
14008         Enum.ChangeEnumType().
14009
14010 2002-06-09  Martin Baulig  <martin@gnome.org>
14011
14012         * expression.cs (Cast.TryReduce): Added support for consts.
14013
14014 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14015
14016         * class.cs (Accessor): Hold attributes information so we can pass
14017         it along.
14018
14019         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14020         Modify to pass in attributes attached to the methods.
14021
14022         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14023
14024         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14025         to handle the Accessor kind :-)
14026
14027         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14028
14029 2002-06-08  Martin Baulig  <martin@gnome.org>
14030
14031         * expression.cs (Unary.TryReduceNegative): Added support for
14032         ULongConstants.
14033
14034 2002-06-08  Martin Baulig  <martin@gnome.org>
14035
14036         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14037         name can't be found in the `defined_names' - the caller will do a
14038         MemberLookup in this case and thus find methods in System.Enum
14039         such as Enum.IsDefined().
14040
14041 2002-06-08  Martin Baulig  <martin@gnome.org>
14042
14043         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14044         Convert.ChangeType() which works with TypeBuilder created types.
14045         (Enum.LookupEnumValue, Enum.Define): Use it here.
14046
14047         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14048         `TypeBuilder.BaseType != null' check.
14049         (TypeContainer.FindMembers): Only lookup parent members if we
14050         actually have a parent.
14051         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14052         (ConstructorInitializer.Resolve): Likewise.
14053
14054         * interface.cs (Interface.FindMembers): Added
14055         `TypeBuilder.BaseType != null' check.
14056
14057         * rootcontext.cs (RootContext.ResolveCore): Added
14058         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14059         classes_second_stage.
14060
14061         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14062         debug_type and trace_type when compiling with --nostdlib.       
14063
14064 2002-06-07  Martin Baulig  <martin@gnome.org>
14065
14066         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14067         (AddField): Set it to true when adding a non-static field.
14068         (DefineType): Use `have_nonstatic_fields' to find out whether we
14069         have non-static fields, not `Fields != null'.
14070
14071 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14072
14073         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14074         dereferencing a null on the static-field code path)
14075
14076 2002-05-30  Martin Baulig  <martin@gnome.org>
14077
14078         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14079         to take command line arguments.  Use reflection to call the new
14080         custom `Initialize' function on the symbol writer and pass it the
14081         command line arguments.
14082
14083         * driver.cs (--debug-args): New command line argument to pass command
14084         line arguments to the symbol writer.
14085
14086 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14089         the target type for indexers and properties.  Thanks to Joe for
14090         catching this.
14091
14092 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * typemanager.cs (MethodFlags): returns the method flags
14095         (Obsolete/ShouldIgnore) that control warning emission and whether
14096         the invocation should be made, or ignored. 
14097
14098         * expression.cs (Invocation.Emit): Remove previous hack, we should
14099         not do this on matching a base type, we should do this based on an attribute
14100
14101         Only emit calls to System.Diagnostics.Debug and
14102         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14103         on the command line.
14104
14105         * rootcontext.cs: Global settings for tracing and debugging.
14106
14107         * cs-tokenizer.cs (define): New utility function to track
14108         defines.   Set the global settings for TRACE and DEBUG if found.
14109
14110 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14111
14112         * interface.cs (Populate*): Pass in the TypeContainer as well as
14113         the DeclSpace as parameters so that we can create EmitContexts and
14114         then use that to apply attributes etc.
14115
14116         (PopulateMethod, PopulateEvent, PopulateProperty)
14117         (PopulateIndexer): Apply attributes everywhere.
14118
14119         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14120         etc.
14121
14122         (ApplyAttributes): Update accordingly.
14123
14124         We now apply interface attributes for all members too.
14125
14126 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14127
14128         * class.cs (Indexer.Define); Correctly check if we are explicit
14129         implementation (instead of checking the Name for a ".", we
14130         directly look up if the InterfaceType was specified).
14131
14132         Delay the creation of the PropertyBuilder.
14133
14134         Only create the PropertyBuilder if we are not an explicit
14135         interface implementation.   This means that explicit interface
14136         implementation members do not participate in regular function
14137         lookups, and hence fixes another major ambiguity problem in
14138         overload resolution (that was the visible effect).
14139
14140         (DefineMethod): Return whether we are doing an interface
14141         implementation. 
14142
14143         * typemanager.cs: Temporary hack until we get attributes in
14144         interfaces (Ravi is working on that) and we get IndexerName
14145         support in interfaces.
14146
14147         * interface.cs: Register the indexers as properties.
14148
14149         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14150         warning, I have verified that this is a bug in the .NET runtime
14151         (JavaScript suffers of the same problem).
14152
14153         * typemanager.cs (MemberLookup): When looking up members for
14154         interfaces, the parent of an interface is the implicit
14155         System.Object (so we succeed in searches of Object methods in an
14156         interface method invocation.  Example:  IEnumerable x;  x.ToString
14157         ()) 
14158
14159 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * class.cs (Event): Events should also register if they do
14162         implement the methods that an interface requires.
14163
14164         * typemanager.cs (MemberLookup); use the new GetInterfaces
14165         method. 
14166
14167         (GetInterfaces): The code used to lookup interfaces for a type is
14168         used in more than one place, factor it here. 
14169
14170         * driver.cs: Track the errors at the bottom of the file, we kept
14171         on going.
14172
14173         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14174         instance if the method we are calling is static!
14175
14176 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14177
14178         * attribute.cs (ApplyAttributes): Make this function filter out
14179         the IndexerName attribute (as that attribute in reality is never
14180         applied) and return the string constant for the IndexerName
14181         attribute. 
14182
14183         * class.cs (TypeContainer.Emit): Validate that all the indexers
14184         have the same IndexerName attribute, and if so, set the
14185         DefaultName attribute on the class. 
14186
14187         * typemanager.cs: The return value might contain other stuff (not
14188         only methods).  For instance, consider a method with an "Item"
14189         property and an Item method.
14190
14191         * class.cs: If there is a problem with the parameter types,
14192         return. 
14193
14194 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14195
14196         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14197         looks at user defined conversion after making a call to 
14198         StandardConversionExists - we need this for overload resolution.
14199
14200         * expression.cs : Update accordingly the various method calls.
14201
14202         This fixes 2 bugs filed against implicit user defined conversions 
14203
14204 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14205
14206         * statement.cs: Track the result of the assignment.
14207
14208 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14209
14210         * expression.cs (MemberAccess): Improved error reporting for
14211         inaccessible members.
14212
14213 2002-05-22  Martin Baulig  <martin@gnome.org>
14214
14215         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14216         itself with debugging support.
14217
14218 2002-05-22  Martin Baulig  <martin@gnome.org>
14219
14220         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14221         Removed, this isn't needed anymore.
14222
14223 2002-05-20  Martin Baulig  <martin@gnome.org>
14224
14225         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14226         be underlying type for an enum.
14227
14228 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14229
14230         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14231         that splits out the loading of just the core types.
14232
14233         * rootcontext.cs (ResolveCore): Split the struct resolution in
14234         two, so we can load the enumeration underlying types before any
14235         enums are used.
14236
14237         * expression.cs (Is): Bandaid until we fix properly Switch (see
14238         bug #24985 for details).
14239
14240         * typemanager.cs (ImplementsInterface): The hashtable will contain
14241         a null if there are no interfaces implemented.
14242
14243 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * cs-parser.jay (indexer_declarator): It is fine to have array
14246         parameters
14247
14248 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * typemanager.cs: (RegisterBuilder): New function used to register
14251         TypeBuilders that implement interfaces.  Since
14252         TypeBuilder.GetInterfaces (as usual) does not work with lame
14253         Reflection.Emit. 
14254         (AddUserType): register interfaces.
14255
14256         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14257         dealing with TypeBuilder.  Also, arrays are showing up as
14258         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14259         methods can not be invoked on them!
14260
14261         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14262         (ImplicitReferenceConversionExists): Split out from
14263         StandardConversionExists. 
14264
14265         * expression.cs (As): We were only implementing one of the three
14266         cases for the as operator.  We now implement them all.
14267         (Is): Implement the various other cases for Is as well.
14268
14269         * typemanager.cs (CACHE): New define used to control if we want or
14270         not the FindMembers cache.  Seems to have a negative impact on
14271         performance currently
14272
14273         (MemberLookup): Nested types have full acess to
14274         enclosing type members
14275
14276         Remove code that coped with instance/static returns for events, we
14277         now catch this in RealFindMembers.
14278
14279         (RealFindMembers): only perform static lookup if the instance
14280         lookup did not return a type or an event.  
14281
14282 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14283
14284         * assign.cs (CompoundAssign): We pass more semantic information
14285         now to Compound Assignments than we did before: now we have all
14286         the information at hand, and now we resolve the target *before* we
14287         do the expression expansion, which allows the "CacheValue" method
14288         to have the effect we intended (before, a [x] += 1 would generate
14289         two differen ArrayAccess expressions from the ElementAccess,
14290         during the resolution process).
14291
14292         (CompoundAssign.DoResolve): Resolve target and original_source here.
14293
14294 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14295
14296         * expression.cs (ArrayAccess): dropped debugging information. 
14297
14298         * typemanager.cs: Small bug fix: I was always returning i_members,
14299         instead of one of i_members or s_members (depending on which had
14300         the content).
14301
14302         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14303         method is invoked before any code generation takes place, and it
14304         is a mechanism to inform that the expression will be invoked more
14305         than once, and that the method should use temporary values to
14306         avoid having side effects
14307
14308         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14309
14310         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14311         implementation.
14312
14313         * expression.cs (Indirection, ArrayAccess): Add support for
14314         CacheTemporaries in these two bad boys. 
14315
14316         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14317         ldobj or ldind_ref.  
14318         (StoreFromPtr): Handle stobj as well.
14319
14320         * expression.cs (UnaryMutator): Share more code.
14321
14322         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14323         down: I was not tracking the Filter function as well, which
14324         was affecting the results of the cache.
14325
14326 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14327
14328         * attribute.cs: Remove the hack to handle the CharSet property on
14329         StructLayouts. 
14330
14331 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14332
14333         * attribute.cs (DoResolve): More uglyness, we now only try to
14334         resolve the attribute partially, to extract the CharSet
14335         information (only if we are a StructLayout attribute).  Otherwise 
14336
14337         (GetExtraTypeInfo): Add some code to conditionally kill in the
14338         future this.   I am more and more convinced that the .NET
14339         framework has special code to handle the attribute setting on
14340         certain elements.
14341
14342         * expression.cs (IsParamsMethodApplicable): Revert my previous
14343         foreach change here, it was wrong.
14344
14345 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14348         (pp_expr): do not abort on unknown input, just return.
14349         (eval): abort if there are pending chars.
14350
14351         * attribute.cs (Attribute.Resolve): Positional parameters are
14352         optional.  Deal with that case.
14353
14354         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14355         the Ansi/Unicode/Auto information for the type.
14356
14357         (TypeContainer.DefineType): instantiate the EmitContext here, as
14358         we will be using it during the type definition (to resolve
14359         attributes) and during the emit phase.
14360
14361         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14362         to pull type information out of the attributes
14363
14364         (Attribute.Resolve): track the constructor builder, and allow for
14365         multiple invocations (structs and classes will use this).
14366
14367         * ecore.cs (MemberLookupFinal): new version with all the
14368         parameters customizable.
14369
14370         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14371         constructors.  Return if the result value is null (as the error
14372         would have been flagged already by MemberLookupFinal)
14373
14374         Do not allow instances of abstract classes or interfaces to be
14375         created.
14376
14377         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14378         We have to compare the assembly property here when dealing with
14379         FamANDAssem and Assembly access modifiers, because we might be
14380         creating an assembly from *modules* (that means that we are not
14381         getting TypeBuilders for types defined in other modules that are
14382         part of this assembly).
14383
14384         (Method.Emit): If the method is marked abstract and has a body,
14385         emit an error. 
14386
14387         (TypeContainer.DefineMembers): If both the defined member and the
14388         parent name match are methods, then do not emit any warnings: let
14389         the Method.Define routine take care of flagging warnings.  But if
14390         there is a mismatch (method overrides something else, or method is
14391         overriwritten by something, then emit warning).
14392
14393         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14394         set to null, this means `do not check for the return type on the
14395         signature'. 
14396
14397         (Method.Define): set the return type for the method signature to
14398         null, so that we get methods with the same name and parameters and
14399         different return types.  This is used to flag warning 114 (you are
14400         hiding a method, and you probably want to use the new/override
14401         keywords instead).
14402
14403         * typemanager.cs (MemberLookup): Implemented proper access
14404         control, closing a long standing set of bug reports.  The problem
14405         was that the Framework only has two bits: Public and NonPublic,
14406         and NonPublic includes private and protected methods, but we need
14407         to enforce the FamANDAssem, FamOrAssem and Family. 
14408
14409 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14410
14411         * statement.cs (GotoCase): Return true: Ammounts to giving up
14412         knowledge on whether we return or not, and letting the other case
14413         be responsible for it.
14414
14415 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14416
14417         * driver.cs: Do not load directories for each file processed, only
14418         do it if there is a pattern.
14419
14420         * ecore.cs: Report readonly assigns here as well, as we might have
14421         been resolved only by MemberAccess.
14422
14423         (SimpleName.SimpleNameResolve): Also be useful for LValue
14424         resolution.   We need this to propagate assign to local readonly variables
14425
14426         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14427         do not want to reuse potential criteria memory.
14428
14429         * class.cs (MyEventBuilder): Set reflected_type;
14430
14431         * ecore.cs (Constantify): Added support for constifying bools.
14432
14433         (RootContext.LookupType): Added a cache for values looked up in
14434         the declaration space.
14435
14436         * typemanager.cs (FindMembers): Now is a front-end to
14437         RealFindMembers, and provides a two-level hashtable-based cache to
14438         the request.  
14439
14440         15% performance improvement: from 22.5 to 19.2 seconds.
14441
14442         * expression.cs (IsParamsMethodApplicable): use foreach.
14443         (Invocation.DoResolve): ditto.
14444         (New.DoResolve): ditto.
14445         (ArrayCreation.DoResolve): ditto.
14446
14447         * ecore.cs (FindMostEncompassingType): use foreach.
14448
14449         * delegate.cs (NewDelegate.DoResolve): Use foreach
14450
14451         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14452         (RemoveMethods): use foreach.
14453
14454         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14455         nested foreach statements instead of for, and also break out of
14456         the inner loop once a match is found.
14457
14458         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14459
14460 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14461
14462         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14463         we actually unwrap the expression to allow for extra information
14464         to be extracted. 
14465
14466         * expression.cs: Use Shr_Un on unsigned operations. 
14467
14468 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14469
14470         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14471         applicable operators was not being considered correctly. This closes
14472         the bug Miguel reported.
14473
14474 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14475
14476         * attribute.cs: check that the type derives from System.Attribute
14477         and report the correct error in that case (moved the duplicate code to
14478         its own method, too).
14479
14480 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14481
14482         * attribute.cs: lookup attribute type name as the spec says: first the
14483         bare attribute name and then name + "Attribute" (nant compiles with
14484         mcs after this fix).
14485
14486 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14487
14488         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14489         Because of the way we parse things, we should try to see if a
14490         UIntConstant can fit in an integer.
14491
14492 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14493
14494         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14495         when we are in an explicit context.
14496
14497         (ConvertReferenceExplicit): When converting from Iface type S to Class
14498         T make sure the rules are implemented as an OR.
14499
14500         * parameter.cs (ParameterType): Make it a property for now although the
14501         purpose really isn't anything immediate.
14502
14503         * expression.cs (Is*Applicable): Do better checking on the parameter type
14504         of a ref/out parameter. The ones from the system assemblies are already 
14505         marked with the correct type so we don't need to do any correction.
14506
14507         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14508         the object type is standard too so include that.
14509
14510 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14511
14512         * ecore.cs (StandardConversionExists): Augment with missing code:
14513         deal with IntConstant, LongConstants and Enumerations.
14514
14515         * assign.cs: Report the error, instead of failing silently
14516
14517         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14518         typecontainer that they are declared, because the
14519         typecontainer/namespace will have the list of using clauses that
14520         need to be applied.
14521
14522         Assembly Attributes were escaping the normal registration
14523         mechanism. 
14524
14525         (EmitCode): Apply attributes within an EmitContext that represents
14526         the container they were declared on.
14527
14528         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14529
14530 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14531
14532         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14533         Revamp completely - make much cleaner as we now operate only
14534         on a set of Types.
14535
14536         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14537         to implement the logic detailed in the spec more correctly.
14538
14539         (UserDefinedConversion): Update accordingly.
14540
14541 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14542
14543         * statement.cs: Return flow analysis information up.
14544
14545         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14546         and the default.
14547
14548         (token): Do not consume an extra character before calling
14549         decimal_digits.
14550
14551 2002-05-06  Piers Haken <piersh@friskit.com>
14552
14553         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14554
14555 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14558         EmitContext during the instance constructor initializer
14559         resolution, to stop access to instance variables.
14560
14561         This is mandated by the spec, last paragraph of the `constructor
14562         initializers' section. 
14563
14564 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14565
14566         * cs-parser.jay, class.cs (Accessor): new class used to represent
14567         an accessor (get or set).  In the past we used `null' to represent
14568         a missing accessor.  But this is ambiguous because there was no
14569         way to tell in abstract indexers/properties if one of them was
14570         specified.
14571
14572         Now there is a way of addressing that.
14573
14574         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14575         instead of FindMembers.
14576
14577         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14578         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14579
14580         * attribute.cs: Treat indexers and properties as the same in terms
14581         of applying attributes
14582
14583         * ecore.cs (FindMostEncompassedType): Use statically initialized
14584         EmptyExpressions()s like we do elsewhere to avoid creating useless
14585         objects (and we take this out of the tight loop).
14586
14587         (GetConversionOperators): Move the code to extract the actual
14588         operators to a separate routine to clean things up.
14589
14590 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14593         events are always registered FieldBuilders.
14594
14595         * class.cs (FieldBase): New class shared by Fields 
14596
14597         * delegate.cs: If we are a toplevel delegate, use our full name.
14598         If we are a nested delegate, then only use our tail name.
14599
14600 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14601
14602         * expression.cs (IsApplicable): Ensure that we add the "&" to
14603         ref/out types before comparing it with the type of the argument.
14604
14605         (IsParamsMethodApplicable): Ditto.
14606
14607         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14608         silly me ;-)
14609
14610         * delegate.cs : Handle the case when we have more than one applicable
14611         method. Flag an error only when we finish checking all.
14612
14613 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14614
14615         * expression.cs: Add support for boolean static initializers.
14616
14617 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14618
14619         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14620
14621         * parameter.cs (ComputeParameterTypes,
14622         ComputeAndDefineParameterTypes): Better error handling: now we
14623         clear the `types' cache if we fail during any of the type lookups.
14624         We also return the status code correctly to our caller
14625
14626         * delegate.cs: If we fail to define a delegate, abort the extra
14627         steps. 
14628
14629         * expression.cs (Binary.ResolveOperator): for
14630         operator==(object,object) and operator !=(object, object) we also
14631         have to verify that there is an implicit conversion from one to
14632         the other.
14633
14634         (ArrayAccess.DoResolve): Array Access can operate on
14635         non-variables. 
14636
14637 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * assign.cs (CompoundAssign): A new class used as a "flag" that
14640         the assignment actually is happening as part of a compound
14641         assignment operator.
14642
14643         During compound assignment, a few new rules exist to enable things
14644         like:
14645
14646         byte b |= 1 + 2
14647
14648         From the spec:
14649
14650         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14651         to the type of x) if y is implicitly convertible to the type of x,
14652         and the operator is a builtin operator and the return type of the
14653         operator is explicitly convertible to the type of x. 
14654
14655         * rootcontext.cs: Reset warning level to 2.  4 catches various
14656         "interesting" features in mcs, we must clean this up at some
14657         point, but currently am trying to kill other bugs ;-)
14658
14659         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14660         in container classes as well.  
14661
14662         * expression.cs (Binary.ResolveOperator): Handle string case
14663         before anything else (as operator overloading does emit an error
14664         before doing anything else).
14665
14666         This code could go away when we move to a table driven model, but
14667         i could not come up with a good plan last night.
14668
14669 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14670
14671         * typemanager.cs (CSharpName): reimplementation using regex.
14672         * class.cs: added null check for fields in Emit
14673         * rootcontext.cs: set warninglevel to 4
14674
14675 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14676
14677         * typemanager.cs (CSharpName): reimplemented with Lupus
14678         suggestion.
14679
14680 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * statement.cs (If): correclty implement Resolve, because we were
14683         not catching sem errors in there.  The same process is needed
14684         everywhere else. 
14685         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14686
14687
14688         (Statement.Warning_DeadCodeFound): Factorize code.
14689         (While): Report dead code here too.
14690
14691         (Statement): Added Resolve virtual method to allow
14692         for resolution split from the emit code.
14693
14694 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * statement.cs (EmitBoolExpression): No longer try to resolve the
14697         expression here.    
14698         (MakeBoolean): New utility function that resolve, implicitly
14699         converts to boolean and tags the expression. 
14700
14701
14702         (If, Do): Implement dead code elimination.
14703         (While): Implement loop inversion
14704
14705         (Do, While, For, If): Resolve the expression prior to calling our
14706         code generation.
14707
14708 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14709
14710         * class.cs:
14711           - added method Report28 (warning: program has more than one entry point)
14712           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14713           - modified method Method.Define, the part at the end of the method
14714
14715         * rootcontext.cs: added static public Location EntryPointLocation;
14716           
14717         * ../errors/cs0028.cs : Add test case for the above warning.              
14718
14719         * typemanager.cs:
14720           - modified method CSharpName to allow arrays of primitive type to
14721             be printed nicely (e.g. instead of System.Int32[][] it now prints
14722             int[][])
14723           - added method CSharpSignature: returns the signature of a method
14724             in string format to be used in reporting errors, warnings, etc.
14725
14726         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14727         with String.Empty.
14728
14729 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14730
14731         * delegate.cs (Define): Fix extremely silly bug where I was
14732         setting the type of the 'object' parameter of the BeginInvoke
14733         method to System.IAsyncResult instead of System.Object ;-)
14734
14735 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14738         here. 
14739
14740         (Constructor.Emit): return if we fail to initialize the
14741         constructor.  Another door closed!  
14742
14743         * expression.cs (New.DoResolve): Improve error message (from -6 to
14744         1501).  Use DeclaredOnly lookup to find the exact constructor.
14745
14746         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14747         loop.  This is useful.
14748
14749         * cs-parser.jay: Adjust the default parameters so that destructors
14750         have the proper signature.
14751
14752 2002-04-26  Martin Baulig  <martin@gnome.org>
14753
14754         * driver.cs (LoadAssembly): If `assembly' contains any characters
14755         which are only valid in path names and not in assembly names
14756         (currently slash, backslash and point), use Assembly.LoadFrom ()
14757         instead of Assembly.Load () on the `assembly' (before iteration
14758         over the link_paths).
14759
14760 2002-04-26  Martin Baulig  <martin@gnome.org>
14761
14762         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14763
14764 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14765
14766         * class.cs (Property): use the new typemanager.MemberLookup
14767
14768         (TypeContainer.MemberLookup): Implement using the
14769         TypeManager.MemberLookup now. 
14770
14771         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14772         and return MemberInfos, so that these can be used without an
14773         EmitContext (what we had before).
14774
14775 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14776
14777         * expression.cs: Fix the case where the argument to params if the
14778         type of the params.  I omitted handling this before.   Fixed
14779
14780 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * driver.cs: Call BootCorlib_PopulateCoreType
14783
14784         * class.cs (Property.CheckBase): Check for properties only, not
14785         for all members. 
14786
14787         * interface.cs: Temporary hack: try/catch around the
14788         CustomAttributeBuilder, because I am getting an exception that I
14789         do not understand.
14790
14791         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14792         types whose definitions are required to be there (attributes are
14793         defined before standard types).
14794
14795         Compute definitions as we boot the various types, as they are used
14796         immediately (value_type class will need object_type, but if we do
14797         not initialize object_type, we will pass a null, which will let
14798         the runtime pick the System.Object from the existing corlib, which
14799         is not what we want).
14800
14801 2002-04-22  Patrik Torstensson <totte@labs2.com>
14802
14803         * cs-tokenizer.cs: fixed a number of trim() issues.
14804
14805 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14806
14807         * expression.cs (Argument.Type): Ensure that we return the correct
14808         type when we have out or ref parameters [in which case we 
14809         append a "&"].
14810
14811 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14812
14813         * class.cs (Property, Indexer): Allow extern modifier in there. 
14814
14815         * typemanager.cs (InitBaseTypes): Initializes object_type and
14816         value_type, since those will be used early on during the bootstrap
14817         process to compile corlib.
14818
14819         (InitCoreTypes): Move code from here to InitBaseTypes.
14820
14821 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14822
14823         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14824         single-dimension arrays as using the ldlen opcode.  
14825
14826         Daniel Lewis discovered this optimization.  
14827
14828         * typemanager.cs: Add signature for System.Array::get_Length
14829
14830 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14831
14832         * statement.cs: report the error when the foreach does not apply to an
14833         array nor a collection.
14834
14835 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14836
14837         * expression.cs: Add implicit conversions to the operator ~.
14838
14839         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14840
14841         * typemanager.cs: Locate the decimal constructor.
14842
14843 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14844
14845         * attribute.cs: use the new property of TypeOf.
14846         * expression.cs: added 'get' property around typearg.
14847
14848         These changes fix a build breaker reported by NickD. Is this the
14849         correct way to fix?  If not, please, revert my changes and make it
14850         work :-).
14851
14852 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * attribute.cs: Add support for typeof in attribute invocations.
14855         I am not sure that this is right though.
14856
14857 2002-04-14  Duncan Mak  <duncan@ximian.com>
14858
14859         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14860         Binary.Operator.Division case.
14861
14862 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14863
14864         * class.cs (DefineType): Ensure that we do a proper check on
14865         attribute types and also register it with the TypeManager.
14866
14867         (TypeContainer.Targets): The default for attribute types is
14868         AttributeTargets.All.
14869
14870         * attribute.cs (ApplyAttributes): Registering the attribute type
14871         is done elsewhere, not when we discover we have a Usage attribute.
14872
14873 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14874
14875         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14876         and get rid of is_delegate parameter.
14877
14878         * everywhere : update.
14879
14880 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14881
14882         * cs-parser.jay (compilation_unit): Revamp completely to use
14883         some new ideas that I got from Rhys' grammar to solve the problems
14884         with assembly level attributes.
14885
14886         (outer_declaration): New grammar production.
14887
14888         (attribute_sections): Add.
14889
14890         (opt_attributes): Base on attribute_sections
14891
14892         (namespace_declaration): Allow opt_attributes to tackle the case
14893         when we have assembly level attributes - we are clever in this
14894         regard now ;-)
14895
14896         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14897         attributes in the non-global context.
14898
14899         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14900         instead of SetGlobalAttributes.
14901
14902         * class.cs, rootcontext.cs : Ensure we define and generate 
14903         attribute types before anything else.
14904
14905         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14906         and flag the new error -20 for the case when the attribute type
14907         does not have valid targets specified. csc does not catch this.
14908
14909         * ../errors/errors.txt : update for error # -20
14910
14911 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14912
14913         * support.cs (InternalParameters.ParameterModifier): Do some null
14914         checking and return sane values.
14915
14916         * class.cs (Method.Define): If we are a PInvoke method, ensure
14917         that we are static and extern. Report error # 601
14918
14919         * ../errors/cs0601.cs : Add test case for the above error.
14920
14921 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14922
14923         * rootcontext.cs (attribute_types): We need to keep type of
14924         all attribute types separately and emit code for them first.
14925
14926         (RegisterAttribute) : Implement.
14927
14928         * class.cs (DefineType): Check if the current Type is a custom
14929         attribute type and register it accordingly.
14930
14931         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14932         adding the first attribute twice and rename to
14933
14934         (SetGlobalAttributes): this.
14935
14936         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14937         lookups.
14938
14939         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14940         if we are processing global arguments. Hmm, I am unsure of this.
14941
14942 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14943
14944         * expression.cs: added static array of strings to avoid calling
14945         Enum.ToString () for Operator in Binary. Significant recover of
14946         performance.
14947
14948 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * class.cs (FindMembers): Allow the Builders of the various
14951         members to be null.  If they are skip them.  This only happens
14952         during the PInvoke declaration.
14953
14954 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14955
14956         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14957         failure, so we do not keep going afterwards.
14958
14959         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14960         wanted to pass `false' as the `is_delegate' argument.  If this is
14961         the case, why not use delegate_type == null to mean `is_delegate =
14962         false' and anything else as is_delegate = true.
14963
14964 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14965
14966         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14967         code for the section, not the beginning of the tests.
14968
14969 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14970
14971         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14972
14973         * expression.cs (Binary): same.  Warn about errors where we have
14974         Enum/Enum in operator + as well.
14975
14976 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14977
14978         * statement.cs:
14979                 - added support for switch(bool)
14980                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14981                 - add TableSwitchEmit() to handle table-based switch statements
14982
14983 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14984
14985         * expression.cs (Invocation.OverloadResolve): Factor out code which
14986         does parameter compatibility checking with arguments so that we can 
14987         re-use the code even from Delegate.VerifyApplicability
14988
14989         (VerifyArgumentsCompat): Move above code here.
14990
14991         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14992         and instead make a call to the above method.
14993
14994 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14995
14996         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14997         We use it to keep track of classes which are attribute types.
14998
14999 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15000
15001         * delegate.cs (Delegate.Define): Correctly define the types in the
15002         presence of fixed and array parameters.
15003
15004         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15005         doing FindMembers.
15006
15007         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15008         include NonPublic after the first iteration.
15009
15010         * class.cs (Indexer.CheckBase): Only check if both parents are
15011         non-null. 
15012
15013         * cs-parser.jay (accessor_body): If empty, set to null.
15014
15015         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15016         same code path here to resolve constants names that we did have in
15017         MemberAccess.DoResolve.  There is too much code duplicated here.
15018
15019 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15020
15021         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15022
15023         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15024         to MakeUnionSet.
15025
15026         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15027         tokens, numbers and strings.
15028
15029         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15030         parenthesis.
15031
15032         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15033         asyncronous parameters and the regular parameters.  
15034
15035         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15036         specify the target directory.
15037
15038         * expression.cs: (This.DoResolve): Simplify
15039         (As.Emit): Optimize, do not generate IsInst if the expression is
15040         always of the given type.
15041
15042         (Is.DoResolve): Bug fix, we were reporting both always/never for
15043         the is expression.
15044
15045         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15046         creating too many unnecessary arrays.
15047
15048 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15049
15050         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15051         fields instead of rolling our own initializer.   Takes care of all
15052         implicit conversions, and drops unnecessary static checks/argument.
15053
15054 2002-03-31  Dick Porter  <dick@ximian.com>
15055
15056         * driver.cs: use the GetDirectories() return values properly, and
15057         use "/" as path separator.
15058
15059 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * expression.cs (Unary): Optimize - - expr into expr.
15062         (Binary): Optimize a + (-b) into a -b.
15063
15064         * codegen.cs (CodeGen): Made all methods static.
15065
15066 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15067
15068         * rootcontext.cs: 
15069
15070         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15071         TypeBuilder property.
15072
15073         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15074         instead. 
15075
15076         * tree.cs: Removed the various RecordXXXX, and replaced with a
15077         single RecordDecl.  Removed all the accessor methods, and just
15078         left a single access point Type 
15079
15080         * enum.cs: Rename DefineEnum to DefineType.
15081
15082         * decl.cs: New abstract method `DefineType' used to unify the
15083         Defines for Enumerations, Interfaces, TypeContainers and
15084         Delegates.
15085
15086         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15087         LookupBaseClasses method that used to live in class.cs and
15088         interface.cs here, and renamed to FindType.
15089
15090         * delegate.cs: Implement DefineType.  Take advantage of the
15091         refactored pattern for locating the parent builder without taking
15092         the parent_builder argument (which we know does not work if we are
15093         nested, and triggering a toplevel definition).
15094
15095 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15096
15097         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15098         accessibility of a member has changed during override and report
15099         an error if so.
15100
15101         * class.cs (Method.Define, Property.Define): Only complain on
15102         overrides if the method is private, any other accessibility is
15103         fine (and since we just checked the permission is the same, we are
15104         good to go).
15105
15106         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15107         and elif are processed always.  The other pre-processing
15108         directives are only processed if we are "taking" the path
15109
15110 2002-03-29  Martin Baulig  <martin@gnome.org>
15111
15112         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15113         current location is not Null.
15114
15115         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15116         a separate method so we can profile it.
15117
15118         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15119         `span.Seconds' are just seconds, but no minutes or hours.
15120         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15121
15122 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15123
15124         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15125         Remove the gratuitous set of Final:
15126
15127                                 // If an interface implementation, then we can set Final.
15128                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15129                                     implementing.DeclaringType.IsInterface)
15130                                         flags |= MethodAttributes.Final;
15131
15132         I do not know what I was smoking when I used that.
15133
15134
15135         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15136         step into fixing the name resolution issues for delegates and
15137         unifying the toplevel name resolution.
15138
15139 2002-03-28  Martin Baulig  <martin@gnome.org>
15140
15141         * class.cs (Method.Emit): If we have a symbol writer, call its
15142         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15143         tell it about the current method.
15144
15145         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15146         writer that we're going to emit the first byte of IL code for a new
15147         statement (a new source line).
15148         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15149         EmitContext.Mark() before emitting any code.
15150
15151         * location.cs (SymbolDocument): Return null when we're Null.
15152
15153         * statement.cs (Statement): Moved the `Location loc' variable here.
15154         (Statement.EmitBoolExpression): If we have a symbol writer, call
15155         ec.Mark() before emitting any code to tell it that we're at the
15156         beginning of a new statement.
15157         (StatementExpression): Added `Location' argument to the constructor.
15158         (Block): Added public readonly variable `StartLocation' and public
15159         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15160         (Block): Added constructor which takes a start and end location.
15161         (Block.SetEndLocation): New method. This sets the end location.
15162         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15163         local variables we create.
15164         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15165         each statement and do also mark the begin and end of the block.
15166
15167         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15168         tell it the current lexer.Location, use Location.Null for the end of the
15169         block.
15170         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15171         current block, set its end location using SetEndLocation().
15172         (statement_expression): StatementExpression constructor now takes the
15173         lexer.Location as additional argument.
15174         (for_statement, declare_local_variables): Likewise.
15175         (declare_local_variables): When creating a new implicit block, use the
15176         new Block constructor and pass it the lexer.Location.
15177
15178 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15179
15180         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15181         members also on the parent interfaces recursively.
15182
15183 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * report.cs: Use new formats, since Gonzalo finished the missing
15186         bits. 
15187
15188         * expression.cs (Binary.ResolveOperator): added missing operator|
15189         operator& and operator^ for bool/bool.
15190
15191         * cs-parser.jay: CheckDef now takes a Location argument that is
15192         used to report errors more precisly (instead of reporting the end
15193         of a definition, we try to track something which is a lot closer
15194         to the source of the problem).
15195
15196         * cs-tokenizer.cs: Track global token use, so we can properly flag
15197         the use of #define/#undef after the first token has been seen.
15198
15199         Also, rename the reportXXXX to Error_DescriptiveName
15200
15201         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15202         TypeContainer, so that Enum and Interface can use this too.
15203
15204         * class.cs (TypeContainer.LookupInterfaceOrClass,
15205         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15206         `builder' argument.  Typically this was used to pass the parent
15207         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15208         the definition).  
15209
15210         The problem is that a nested class could trigger the definition of
15211         a toplevel class, and the builder would be obviously wrong in that
15212         case. 
15213
15214         So we drop this argument, and we compute dynamically the
15215         TypeBuilder/ModuleBuilder (the correct information was available
15216         to us anyways from DeclSpace.Parent)
15217
15218         * interface.cs (Interface.DefineInterface): Drop builder
15219         parameter cleanup like class.cs
15220
15221         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15222         like class.cs
15223
15224         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15225         values. 
15226
15227         (Try.Emit): Propagate the returns value from the statement.
15228
15229         (Return.Emit): Even if we are leavning 
15230
15231         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15232
15233         * modifiers.cs: Fix the computation of MethodAttributes flags.
15234
15235 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15236
15237         * driver.cs: allow compilation of files that start with '/'.
15238         Add a default case when checking the argument of --target.
15239
15240 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15241
15242         * interface.cs: Implement the same search algorithm for types in
15243         the interface code.
15244
15245         * delegate.cs: Do not allow multiple definition.
15246
15247         * Recovered ChangeLog that got accidentally amputated
15248
15249         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15250
15251         * rootcontext.cs: Load manually enum to allow core classes to
15252         contain enumerations.
15253
15254         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15255         Update to new static methods in TypeManager.
15256
15257         * typemanager.cs (GetMethod, GetConstructor): Use our
15258         implementation of FindMembers to find the members, since during
15259         corlib compilation, the types are TypeBuilders and GetMethod and
15260         GetConstructor do not work.
15261
15262         Make all methods in TypeManager static.
15263
15264         (InitCodeHelpers): Split the functionality from
15265         the InitCodeTypes function.
15266
15267         * driver.cs: Call InitCodeHelpers after we have populated the
15268         types. 
15269
15270         * cs-parser.jay (delegate_declaration): we did not used to compute
15271         the delegate name correctly for void delegates.
15272
15273 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15274
15275         * rootcontext.cs (RootContext): Init the interface_resolve_order
15276         and type_container_resolve_order always.
15277
15278         (ResolveCore, BootstrapCorlib_ResolveClass,
15279         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15280         compiler when compiling with --nostdlib
15281
15282         * class.cs (TypeContainer.DefineType): Check that our parent is
15283         not null.  This test is most important when we are bootstraping
15284         the core types.
15285
15286         * codegen.cs: Split out the symbol writing code.
15287
15288 2002-03-25  Martin Baulig  <martin@gnome.org>
15289
15290         * driver.cs (-g): Made -g an alias for --debug.
15291
15292 2002-03-24  Martin Baulig  <martin@gnome.org>
15293
15294         * codegen.cs (SymbolWriter): New public variable. Returns the
15295         current symbol writer.
15296         (CodeGen): Added `bool want_debugging_support' argument to the
15297          constructor. If true, tell the ModuleBuild that we want debugging
15298         support and ask it for the ISymbolWriter.
15299         (Save): If we have a symbol writer, call it's Close() method after
15300         saving the assembly.
15301
15302         * driver.c (--debug): New command line argument to create a
15303         debugger information file.
15304
15305         * location.cs (SymbolDocument): New public property. Returns an
15306         ISymbolDocumentWriter object for the current source file or null
15307         if we don't have a symbol writer.
15308
15309 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15310
15311         * driver.cs (LoadAssembly): Correctly return when all the paths
15312         have been tried and not before.
15313
15314         * statement.cs (Switch.Emit): return the actual coverage for this
15315         statement (returns/not-returns)
15316
15317         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15318         switch of the statement if we are the last switch section.  That
15319         kills two problems: try/catch problems (we used to emit an empty
15320         nop at the end) and switch statements where all branches would
15321         return. 
15322
15323 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15324
15325         * driver.cs: Add default assemblies (the equivalent to the
15326         Microsoft CSC.RSP file)
15327
15328         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15329         also update tokens_seen and set it to false.
15330
15331         * driver.cs: Implement --recurse for Mike.
15332
15333         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15334         correctly splitting out the paths.
15335
15336 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15337
15338         * interface.cs (Interface.PopulateProperty): Instead of using
15339         `parent' as the declaration space for the set parameters, use
15340         `this' 
15341
15342         * support.cs (InternalParameters): InternalParameters constructor
15343         takes a DeclSpace instead of a TypeContainer.
15344
15345         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15346         types are being initialized, load the address of it before calling
15347         the function.  
15348
15349         (New): Provide a mechanism to disable the generation of local
15350         value type temporaries when the caller will be providing us with
15351         an address to store it.
15352
15353         (ArrayCreation.EmitDynamicInitializers): Use it.
15354
15355 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15356
15357         * expression.cs (Invocation.EmitArguments): Only probe for array
15358         property if there is more than one argument.  Sorry about that.
15359
15360         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15361         empty param arrays.
15362
15363         * class.cs (Method.LabelParameters): Fix incorrect code path that
15364         prevented the `ParamArrayAttribute' from being applied to the
15365         params attribute.
15366
15367 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15368
15369         * support.cs (ReflectionParameters): Correctly compute whether the
15370         last argument is a params array.  Fixes the problem with
15371         string.Split ('a')
15372
15373         * typemanager.cs: Make the assemblies array always be non-null
15374         (empty, but non-null)
15375
15376         * tree.cs (RecordDecl): New function that abstracts the recording
15377         of names.  This reports error 101, and provides a pointer to the
15378         previous declaration.  Fixes a crash in the compiler.
15379
15380         * cs-parser.jay (constructor_declaration): Update to new grammar,
15381         and provide a constructor_body that can be empty.
15382
15383 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15384
15385         * driver.cs: Add support for --resources.
15386
15387         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15388         Make all types for the various array helper methods be integer.
15389
15390         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15391         CheckState to ConvCast.
15392
15393         (ConvCast): Now it takes a `checked' state argument, to avoid
15394         depending on the emit context for the conversion, and just using
15395         the resolve time setting.
15396
15397         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15398         instead of Invocation.EmitArguments.  We do not emit the original
15399         arguments, instead we emit those which have been converted to
15400         unsigned int expressions.
15401
15402         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15403
15404         * codegen.cs: ditto.
15405
15406         * expression.cs (LocalVariableReference): Drop the use of the
15407         Store function that depended on the variable index.
15408
15409         * statement.cs (VariableInfo): Drop the `Idx' property from this
15410         class, as this is not taking into account the indexes for
15411         temporaries tat we generate during the execution, getting the
15412         indexes wrong.
15413
15414         * class.cs: First emit class initializers, then call the parent
15415         constructor. 
15416
15417         * expression.cs (Binary): Fix opcode emision.
15418         (UnaryMutator.EmitCode): Support checked code generation
15419
15420         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15421         matches for events for both the Static and Instance scans,
15422         pointing to the same element.   Fix that.
15423
15424 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15425
15426         * rootcontext.cs (ResolveTree): Always set the
15427         interface_resolve_order, because nested interfaces will be calling
15428         into us.
15429
15430         * class.cs (GetInterfaceOrClass): Track the same resolution
15431         process used by TypeManager.LookupType.  This fixes the nested
15432         type lookups in class declarations (separate path from
15433         LookupType). 
15434
15435         (TypeContainer.DefineType): Also define nested interfaces.
15436         (TypeContainer.RegisterOrder): New public function used to
15437         register the order in which child interfaces need to be closed.
15438
15439         Nested interfaces need to be closed after their parents have been
15440         created. 
15441
15442         * interface.cs (InterfaceAttr): Put all the logic for computing
15443         the interface attribute here. 
15444
15445         (DefineInterface): Register our interface order with the
15446         RootContext or with the TypeContainer depending on the case.
15447
15448 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15449
15450         * cs-parser.jay: rework foreach statement to work with the new
15451         changes to the policy on SimpleNames.
15452
15453         * report.cs: support Stacktrace on warnings as well.
15454
15455         * makefile: drop --unsafe and /unsafe from the compile.
15456
15457 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15458
15459         * ecore.cs (StandardConversionExists): Modify to take an Expression
15460         as the first parameter. Ensure we do null -> reference type conversion
15461         checking.
15462
15463         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15464         temporary Expression objects.
15465
15466 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15467
15468         * interface.cs: workaround bug in method overloading resolution
15469         (there is already a bugzilla bug for it).
15470
15471 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15472
15473         We could also solve this problem by having a separate path for
15474         performing type lookups, instead of DoResolve, we could have a
15475         ResolveType entry point, and only participating pieces of the
15476         production (simplename, deref, array) would implement this. 
15477
15478         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15479         signal SimpleName to only resolve type names and not attempt to
15480         resolve anything else.
15481
15482         * expression.cs (Cast): Set the flag.
15483
15484         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15485
15486         * class.cs: Only report 108 if there is no `new' modifier.
15487
15488         * cs-parser.jay: rework foreach statement to work with the new
15489         changes to the policy on SimpleNames.
15490
15491         * report.cs: support Stacktrace on warnings as well.
15492
15493         * makefile: drop --unsafe and /unsafe from the compile.
15494
15495 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15496
15497         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15498         lookups here, instead of doing that at parse time.  This means
15499         that our grammar will not introduce `LocalVariableReferences' as
15500         expressions at this point.  That solves the problem of code like
15501         this:
15502
15503         class X {
15504            static void Main ()
15505            { int X = 1;
15506             { X x = null }}}
15507
15508         This is only half the fix.  The full fix requires parameters to
15509         also be handled in this way.
15510
15511         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15512         makes the use more obvious of the DeclSpace.  The
15513         ec.TypeContainer.TypeBuilder is now only used to pull the
15514         TypeBuilder for it.
15515
15516         My theory is that I can get rid of the TypeBuilder completely from
15517         the EmitContext, and have typecasts where it is used (from
15518         DeclSpace to where it matters).  
15519
15520         The only pending problem is that the code that implements Aliases
15521         is on TypeContainer, and probably should go in DeclSpace.
15522
15523         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15524         lookups here, instead of doing that at parse time.  This means
15525         that our grammar will not introduce `LocalVariableReferences' as
15526         expressions at this point.  That solves the problem of code like
15527         this:
15528
15529         class X {
15530            static void Main ()
15531            { int X = 1;
15532             { X x = null }}}
15533
15534         This is only half the fix.  The full fix requires parameters to
15535         also be handled in this way.
15536
15537         * class.cs (Property.DefineMethod): When implementing an interface
15538         method, set newslot, when implementing an abstract method, do not
15539         set the flag (before we tried never setting it, or always setting
15540         it, which is the difference).
15541         (Indexer.DefineMethod): same.
15542         (Method.DefineMethod): same.
15543
15544         * ecore.cs: Only set the status used flag if we get back a Field.
15545
15546         * attribute.cs: Temporary hack, so Paolo can keep working.
15547
15548 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15549
15550         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15551         the unmanaged type in the case we have a MarshalAs attribute.
15552
15553         (Resolve): Handle the case when we are parsing the special MarshalAs
15554         attribute [we need to store the unmanaged type to use later]
15555
15556         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15557         MarshalAs Attribute.
15558
15559         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15560         on parameters and accordingly set the marshalling info.
15561
15562 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15563
15564         * class.cs: Optimizing slightly by removing redundant code after
15565         we switched to the `NoTypes' return value.
15566         (Property.DefineMethod): use NoTypes here too.
15567
15568         This fixes the bug I introduced in my last batch of changes.
15569
15570 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15571
15572         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15573
15574         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15575         Enums since those are types too. 
15576
15577         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15578
15579         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15580         thanks to a call during the lookup process.
15581
15582 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * statement.cs (Foreach): Lots of work to accomodate a particular
15585         kind of foreach statement that I had not kept in mind.  It is
15586         possible to have foreachs on classes that provide a GetEnumerator
15587         method that return objects that implement the "pattern" for using
15588         a foreach, there is no need to support GetEnumerator
15589         specifically. 
15590
15591         This is needed to compile nant.
15592
15593         * decl.cs: Only report 114 if the member is not `Finalize' and if
15594         the warning level is at least 2.
15595
15596         * class.cs: Moved the compare function from Method to
15597         MethodSignature. 
15598
15599         (MethodSignature.InheritableMemberSignatureCompare): Add new
15600         filter function that is used to extract inheritable methods from a
15601         class. 
15602
15603         (Method.Define): Use the new `inheritable_method_signature_filter'
15604         delegate
15605
15606         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15607         command. 
15608
15609 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15612
15613         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15614
15615         * expression.cs: Pass location information to
15616         ConvertImplicitStandard. 
15617
15618         * class.cs: Added debugging code to track return values from
15619         interfaces. 
15620
15621 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15622
15623         * expression.cs (Is.DoResolve): If either side of the `is' is an
15624         interface, do not flag the warning.
15625
15626         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15627         for interfaces
15628
15629         * report.cs: Allow for --fatal to be used with --probe.
15630
15631         * typemanager.cs (NoTypes): Move the definition for the empty Type
15632         array here. 
15633
15634         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15635         properties. 
15636         (TypeContainer.DefineProxy): New function used to proxy to parent
15637         implementations when implementing interfaces.
15638         (TypeContainer.ParentImplements): used to lookup if our parent
15639         implements a public function that is required by an interface.
15640         (TypeContainer.VerifyPendingMethods): Hook this up.
15641
15642         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15643         `modules' and `assemblies' arraylists into arrays.  We only grow
15644         these are the very early start up of the program, so this improves
15645         the speedof LookupType (nicely measured).
15646
15647         * expression.cs (MakeByteBlob): Replaced unsafe code with
15648         BitConverter, as suggested by Paolo.
15649
15650         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15651         folding of string concatenation, but if either side is a string,
15652         and the other is not, then return null, and let the runtime use
15653         the concatenation on the string plus the object (using
15654         `Object.ToString'). 
15655
15656 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15657
15658         Constant Folding has been implemented now.
15659
15660         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15661         the error instead on types that are not supported in one's
15662         complement. 
15663
15664         * constant.cs (Constant and all children): New set of functions to
15665         perform implict and explicit conversions.
15666
15667         * ecore.cs (EnumConstant): Implement the new functions to perform
15668         conversion by proxying to the child expression.
15669
15670         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15671         own separate setting that can not be turned off from the command
15672         line using --unchecked or --checked and is only controlled using
15673         the checked/unchecked statements and expressions.  This setting is
15674         used by the constant folder to flag errors.
15675
15676         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15677         ConstantCheckState as well.   
15678
15679         During Resolve, they also have to flag the state, because the
15680         constant folder runs completely in the Resolve phase.
15681
15682         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15683         well.
15684
15685 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * cfold.cs: New file, this file contains the constant folder.
15688
15689         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15690         argument to track whether we are using the resulting address to
15691         load or store a value and provide better error messages. 
15692
15693         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15694         new AddressOf arguments.
15695
15696         * statement.cs (Foreach.EmitCollectionForeach): Update
15697
15698         * expression.cs (Argument.Emit): Call AddressOf with proper
15699         arguments to track usage.
15700
15701         (New.DoEmit): Call AddressOf with new arguments.
15702
15703         (Unary.Emit): Adjust AddressOf call.
15704
15705 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15706
15707         * cs-parser.jay (member_access): Change the case for pre-defined types
15708         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15709         this suggestion.
15710
15711         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15712         a method body.
15713
15714         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15715         essentially like methods and apply attributes like MethodImplOptions to them too.
15716
15717         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15718         not being null.
15719
15720         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15721         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15722         is the DeclSpace.
15723
15724         * Update code everywhere accordingly.
15725
15726         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15727
15728         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15729
15730 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15731
15732         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15733         try performing lookups against those instead of jumping straight into using
15734         the 'using' clauses.
15735
15736         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15737
15738         (LookupType): Perform lookups in implicit parents too.
15739
15740         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15741         sequence as RootContext.LookupType. 
15742
15743         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15744         the various cases of namespace lookups into this method.
15745
15746 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15747
15748         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15749         in positional arguments)
15750
15751         * class.cs (Operator): Update the AllowedModifiers to contain
15752         extern. 
15753
15754         * cs-parser.jay: Update operator declaration to allow for the
15755         operator body to be empty.
15756
15757         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15758         values. 
15759
15760 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * class.cs (Method.Emit): Label parameters.
15763
15764         * driver.cs: Return 1 or 0 as the program exit code.
15765
15766 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * expression.cs: Special case the `null' object when trying to
15769         auto-compute the type, as anything can be explicitly converted to
15770         that. 
15771
15772         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15773         spotting this Paolo.
15774
15775         (Expression.ImplicitNumericConversion): Perform comparissions of
15776         the type using the underlying type in the case of an enumeration
15777         rather than using the enumeration type for the compare.
15778
15779         Cope with the underlying == type case, which is not possible to
15780         catch before. 
15781
15782         (Expression.ConvertNumericExplicit): Perform comparissions of
15783         the type using the underlying type in the case of an enumeration
15784         rather than using the enumeration type for the compare.
15785
15786         * driver.cs: If the user does not supply an extension, assume .exe
15787
15788         * cs-parser.jay (if_statement): Rewrote so that we can track the
15789         location for the if statement.
15790
15791         * expression.cs (Binary.ConstantFold): Only concat strings when
15792         the operation is "+", not everything ;-)
15793
15794         * statement.cs (Statement.EmitBoolExpression): Take a location
15795         argument. 
15796         (If, While, Do): Track location.
15797
15798         * expression.cs (Binary.ResolveOperator): In the object + string
15799         case, I was missing a call to ConvertImplicit
15800
15801 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15802
15803         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15804         Location arguments. Ensure we use RootContext.LookupType to do our work
15805         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15806
15807         * interface.cs (PopulateMethod): Handle the type of the parameter being
15808         null gracefully.
15809
15810         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15811         have a params method with no fixed arguments and a call is made with no
15812         arguments.
15813
15814 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15815
15816         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15817         the verbatim-string-literal
15818
15819         * support.cs (InternalParameters.ParameterModifier): handle null
15820         fixed parameters.
15821         (InternalParameters.ParameterType): ditto.
15822
15823         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15824         duplicating the name of the variable parameter.
15825         (GetParameterByName): Fix bug where we were not looking up array
15826         paramters if they were the only present (thanks Paolo!).
15827         (GetParameterInfo): We only have an empty set of types if both
15828         fixed and array are set to null.
15829         (GetParameterInfo-idx): Handle FixedParameter == null
15830
15831         * cs-parser.jay: Handle the case where there is no catch
15832         statements (missing null test).
15833
15834 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * driver.cs (MainDriver): Be conservative on our command line
15837         handling.
15838
15839         Catch DirectoryNotFoundException when calling GetFiles.
15840
15841         (SplitPathAndPattern): Used to split the input specification into
15842         a path and a pattern that we can feed to Directory.GetFiles.
15843
15844 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15845
15846         * statement.cs (Fixed): Implement the last case of the Fixed
15847         statement (string handling).
15848
15849         * expression.cs (StringPtr): New class used to return a char * to
15850         a string;  Used by the Fixed statement.
15851
15852         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15853
15854         * expression.cs (Binary.ResolveOperator): Remove redundant
15855         MemberLookup pn parent type.
15856         Optimize union call, we do not need a union if the types are the same.
15857         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15858         type.
15859
15860         Specialize the use of MemberLookup everywhere, instead of using
15861         the default settings. 
15862
15863         (StackAlloc): Implement stackalloc keyword.
15864
15865         * cs-parser.jay: Add rule to parse stackalloc.
15866
15867         * driver.cs: Handle /h, /help, /?
15868
15869         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15870         before we supported unsafe code.
15871
15872         * makefile: add --unsafe to the self compilation of mcs.
15873
15874 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15875
15876         * expression.cs (PointerArithmetic): New class that is used to
15877         perform pointer arithmetic.
15878         (Binary.Resolve): Handle pointer arithmetic
15879         Handle pointer comparission.
15880         (ArrayPtr): Utility expression class that is used to take the
15881         address of an array.
15882
15883         (ElementAccess): Implement array access for pointers
15884
15885         * statement.cs (Fixed): Implement fixed statement for arrays, we
15886         are missing one more case before we are done.
15887
15888         * expression.cs (Indirection): Implement EmitAssign and set the
15889         ExprClass to Variable.  This allows pointer dereferences to be
15890         treated as variables, and to have values assigned to them.
15891
15892         * ecore.cs (Expression.StoreFromPtr): New utility function to
15893         store values dereferencing.
15894
15895 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15896
15897         * expression.cs (Binary.ResolveOperator): Ensure that we are
15898         not trying to operate on a void type - this fixes the reported
15899         bug.
15900
15901         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15902         the parent implementation is sealed.
15903
15904         * ../errors/cs0239.cs : Add.
15905
15906         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15907
15908         * typemanager.cs (unverifiable_code_type): Corresponds to 
15909         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15910         which have unsafe code in them.
15911
15912         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15913         unsafe context.
15914
15915 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * cs-tokenizer.cs: Add support for @"litreal strings"
15918
15919         Make tokenizer accept pre-processor directives
15920         on any column (remove the old C-like limitation). 
15921
15922         * rootcontext.cs (EmitCode): Emit any global attributes.
15923         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15924
15925         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15926
15927         * cs-parser.jay: Add support for global attributes.  
15928
15929 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15930
15931         * expression.cs (Indirection): New helper class.  Unary will
15932         create Indirection classes to be able to implement the
15933         IMemoryLocation interface on it.
15934
15935 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15936
15937         * cs-parser.jay (fixed_statement): reference the right statement.
15938
15939         * statement.cs (Fixed.Emit): Finish implementing the fixed
15940         statement for the &x case.
15941
15942 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * class.cs (Property.Define, Method.Define): Remove newslot when
15945         `implementing'.  
15946
15947         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15948         wrong.  NewSlot should only be used if the `new' keyword is present.
15949
15950         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15951         locating our system dir.  Sorry about this.
15952
15953 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15954
15955         * driver.cs (GetSystemDir): Compute correctly the location of our
15956         system assemblies.  I was using the compiler directory instead of
15957         the library directory.
15958
15959 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15960
15961         * expression.cs (BetterFunction): Put back in what Miguel commented out
15962         since it is the correct fix. The problem is elsewhere ;-)
15963
15964         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15965         parameters of the parms method are themselves compatible or not !
15966
15967         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15968         to check that a class implements an interface before saying that an implicit
15969         conversion was allowed. Use ImplementsInterface to do the checking.
15970
15971 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15972
15973         * class.cs (Method.Define): Track whether we are an explicit
15974         implementation or not.  And only call DefineMethodOverride if we
15975         are an explicit implementation.
15976
15977         (Property.DefineMethod): Ditto.
15978
15979 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15980
15981         * expression.cs (BetterFunction): Catch hideous bug which was
15982          preventing us from detecting ambiguous calls due to implicit casts i.e
15983         cs0121.
15984
15985 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15986
15987         * support.cs (Pair): Remove un-needed method.  I figured why I was
15988         getting the error in cs-parser.jay, the variable in a foreach loop
15989         is readonly, and the compiler does not really treat this as a variable.
15990
15991         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15992         instead of EQUALS in grammar.  
15993
15994         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15995
15996         * expression.cs (Unary.DoResolve): Check whether the argument is
15997         managed or not.
15998
15999 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16000
16001         * support.cs: Api for Pair to set a value.  Despite the fact that
16002         the variables are public the MS C# compiler refuses to compile
16003         code that accesses the field if the variable is part of a foreach
16004         statement. 
16005
16006         * statement.cs (Fixed): Begin implementation of the fixed
16007         statement.
16008
16009         (Block.AddVariable): Return the VariableInfo on success and null
16010         on failure instead of true/false. 
16011
16012         * cs-parser.jay (foreach): Catch errors on variables already
16013         defined (we were ignoring this value before) and properly unwind
16014         the block hierarchy
16015
16016         (fixed_statement): grammar for the fixed statement.
16017
16018 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16019
16020         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16021         pointer types to be incretemented.
16022
16023         (SizeOf): Implement.
16024
16025         * cs-parser.jay (pointer_member_access): Implement
16026         expr->IDENTIFIER production.
16027
16028         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16029         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16030         on safe contexts.
16031
16032         (Unary): Implement indirection.
16033
16034         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16035         use in non-unsafe context).
16036
16037         (SimpleName.DoResolve): Check for pointers in field access on safe
16038         contexts. 
16039
16040         (Expression.LoadFromPtr): Factor the load-indirect code in this
16041         function.  This was duplicated in UnboxCast and ParameterReference
16042
16043 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16044
16045         * expression.cs (ComposedCast): report an error if a pointer cast
16046         is used in a safe region.
16047
16048         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16049         pointer type casts in unsafe context.
16050
16051         * codegen.cs (EmitContext): Set up IsUnsafe.
16052
16053         * cs-parser.jay (non_expression_type): Add productions for pointer
16054         casts. 
16055
16056         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16057         code.  We should not use force into static mode if the method is
16058         not virtual.  Fixes bug in MIS
16059
16060         * statement.cs (Do.Emit, While.Emit, For.Emit,
16061         Statement.EmitBoolExpression): Add support to Do and While to
16062         propagate infinite loop as `I do return' semantics.
16063
16064         Improve the For case to also test for boolean constants.
16065
16066         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16067         to the list of attributes we can add.
16068
16069         Remove `EmitContext' argument.
16070
16071         * class.cs (Method.Define): Apply parameter attributes.
16072         (Constructor.Define): Apply parameter attributes.
16073         (MethodCore.LabelParameters): Move here the core of labeling
16074         parameters. 
16075
16076         * support.cs (ReflectionParameters.ParameterModifier,
16077         InternalParameters.ParameterModifier): Use IsByRef on the type and
16078         only return the OUT bit for these parameters instead of in/out/ref
16079         flags.
16080
16081         This is because I miss-understood things.  The ParameterInfo.IsIn
16082         and IsOut represent whether the parameter has the [In] and [Out]
16083         attributes set.  
16084
16085 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * ecore.cs (FieldExpr.Emit): Release temporaries.
16088
16089         * assign.cs (LocalTemporary.Release): new function.
16090
16091         * codegen.cs (EmitContext.GetTemporaryStorage,
16092         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16093         temporary storage.  Now we can "put back" localbuilders when we
16094         are done with them
16095
16096 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16099         need to make a copy of the variable to generate verifiable code.
16100
16101 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16102
16103         * driver.cs: Compute dynamically the system directory.
16104
16105         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16106         Slower, but more generally useful.  Used by the abstract
16107         registering implementation. 
16108
16109         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16110         the rules for the special rule on Type/instances.  First check if
16111         we have the same name, and if so, try that special static path
16112         rather than the instance path.
16113
16114 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16117         for, while and if.
16118
16119         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16120         Enum, ValueType, Delegate or Array for non-corlib compiles.
16121
16122         * cs-tokenizer.cs: Catch long identifiers (645)
16123
16124         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16125         piece of code.
16126
16127         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16128         fix, we were returning too early, so we were not registering
16129         pending methods from abstract classes.
16130
16131         Do not register pending methods if the class is abstract.
16132
16133         * expression.cs (Conditional.DoResolve): Report circular implicit
16134         conversions when we neecd to compute it for conditional
16135         expressions. 
16136
16137         (Is.DoResolve): If the expression is always of the provided type,
16138         flag warning 183.  If the expression can not ever be of the
16139         provided type flag warning 184.
16140
16141         * class.cs: Catch 169 as well.
16142
16143         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16144         read. 
16145
16146 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16147
16148         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16149
16150 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16151
16152         * interface.cs: (PopulateMethod): Check for pointers being defined
16153         only if the unsafe context is active.
16154         (PopulateProperty): ditto.
16155         (PopulateIndexer): ditto.
16156
16157         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16158         specified.  If pointers are present, make sure that they are
16159         present in an unsafe context.
16160         (Constructor, Constructor.Define): ditto.
16161         (Field, Field.Define): ditto.
16162         (Property, Property.Define): ditto.
16163         (Event, Event.Define): ditto.
16164
16165         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16166         hashtable if there are classes or structs defined.
16167
16168         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16169         code, as the constant resolution moved.
16170
16171         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16172         the metadata, so we can flag error 133. 
16173
16174         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16175         pointer is being declared in an unsafe context.
16176
16177 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16178
16179         * modifiers.cs (Modifiers.Check): Require a Location argument.
16180         Report error 227 for Unsafe use.
16181
16182         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16183
16184         * statement.cs (For.Emit): If the test is null, then report that
16185         we do `return', as we wont reach anything afterwards.
16186
16187         (Switch.SwitchGoverningType): Track the expression that matched
16188         the conversion.
16189
16190         * driver.cs: Allow negative numbers as an error code to flag.
16191
16192         * cs-parser.jay: Handle 1551.
16193
16194         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16195
16196 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16197
16198         * cs-parser.jay: Report 1518 (type declaration can only contain
16199         class, struct, interface, enum or delegate)
16200
16201         (switch_label): Report 1523 (keywords `case' or `default' must
16202         preced code)
16203
16204         (opt_switch_sections): Report 1522 (empty switch)
16205
16206         * driver.cs: Report 1515 (response file specified multiple times)
16207         Report 1516 (Source file specified multiple times).
16208
16209         * expression.cs (Argument.Resolve): Signal 1510
16210
16211         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16212         access not allowed in static code)
16213
16214 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16215
16216         * typemanager.cs (IsPointerType): Utility method which we are going
16217         to need a lot.
16218
16219         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16220         the object type, so we take care of that.
16221
16222         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16223
16224         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16225         added to non-params parameters :-)
16226
16227         * typemanager.cs (CSharpName): Include 'void' type too. 
16228
16229         (void_ptr_type): Include in the set of core types.
16230
16231         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16232         duplicating code.
16233
16234         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16235         an unsafe context.
16236
16237         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16238         completely forgotten about it.
16239
16240 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16241
16242         * cs-parser.jay (pointer_type): Add. This begins our implementation
16243         of parsing rules for unsafe code.
16244
16245         (unsafe_statement): Implement.
16246
16247         (embedded_statement): Modify to include the above.
16248
16249         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16250
16251         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16252         if the current context is an unsafe one.
16253
16254         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16255         are handled differently, we need separate rules for them.
16256
16257         (local_variable_declaration): Update to use local_variable_pointer_type
16258         to allow variable declarations of unmanaged pointer types.
16259
16260         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16261         in unsafe contexts.
16262
16263         * ../errors/cs0214.cs : Add.
16264
16265 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16266
16267         * makefile: remove 'response' file when cleaning.
16268
16269 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16270
16271         * cs-parser.jay: Report 1524.
16272
16273 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16274
16275         * typemanager.cs (RegisterMethod): drop checking if we have
16276         registered this from here
16277
16278 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16279
16280         * class.cs (Method.EmitDestructor): Implement calling our base
16281         destructor. 
16282
16283         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16284         value of InFinally.
16285
16286         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16287         this routine and will wrap the call in a try/catch block.  Deal
16288         with the case.
16289
16290 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * ecore.cs (Expression.MemberLookup): instead of taking a
16293         parameter `same_type' that was used to tell whether we could
16294         access private members we compute our containing type from the
16295         EmitContext.
16296
16297         (FieldExpr): Added partial support for volatile fields.  This does
16298         not work for volatile fields exposed from assemblies, as I can not
16299         figure out how to extract the modreq from it.
16300
16301         Updated all the source files to use this.
16302
16303         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16304         because it is referenced by MemberLookup very often. 
16305
16306 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16307
16308         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16309         TypeBuilder.GetCustomAttributes to retrieve what we need.
16310
16311         Get rid of redundant default_member_attr_type as this is the same as
16312         default_member_type which already exists.
16313
16314         * interface.cs, attribute.cs : Update accordingly.
16315
16316 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16317
16318         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16319         work for TYpeBuilders though.  Ravi, can you please fix this?
16320
16321         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16322
16323         * expression.cs (Argument.Emit): Handle the case of ref objects
16324         being passed to ref functions;  
16325
16326         (ParameterReference.EmitLoad): Loads the content of the pointer
16327         without dereferencing.
16328
16329 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16330
16331         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16332
16333 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16334
16335         * class.cs (Indexer.DefineMethod): Incorporate the interface
16336         type in the name of the method if we are doing explicit interface
16337         implementation.
16338
16339         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16340
16341         (BetterConversion): Fix extremely trivial bug where we were referring to
16342         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16343         again !
16344
16345         * ../errors/bug16.cs : Add although we have fixed it.
16346
16347 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16348
16349         * expression.cs (BaseIndexer): Begin implementation.
16350
16351         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16352
16353         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16354         production directly to remove a shift/reduce, and implement
16355         explicit interface implementation.
16356
16357         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16358         after a floating point suffix.
16359
16360         * expression.cs (DoNumericPromotions): Improved the conversion for
16361         uint/uint.  If we have a constant, we avoid doing a typecast to a
16362         larger type.
16363
16364         * class.cs (Indexer): Implement explicit interface implementation
16365         for indexers.
16366
16367 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16368
16369         * class.cs: make the default instance constructor public and hidebysig.
16370
16371 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16372
16373         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16374         so we can call it from elsewhere.
16375
16376         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16377         we emit it internally if the class has a defined indexer; otherwise the user
16378         emits it by decorating the class definition with the DefaultMemberAttribute.
16379
16380         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16381         attribute is not used on a type which defines an indexer.
16382
16383         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16384         character when we skip whitespace.
16385
16386         * ../errors/cs0646.cs : Add.
16387
16388 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16389
16390         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16391         again. 
16392
16393         * makefile: Add practical target `mcs3.exe' which builds the third
16394         generation compiler. 
16395
16396         * expression.cs (New): Fix structures constructor calling.
16397
16398         * class.cs (Property, Method, Indexer): Emit Final flag on the
16399         method if we are an interface implementation and we are not
16400         abstract. 
16401
16402         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16403         whether this property is referencing a `base' method.
16404
16405         * expression.cs (Invocation.EmitCall): take an extra argument:
16406         is_base, this is used to determine whether the `call' or
16407         `callvirt' opcode should be used.
16408
16409
16410         * delegate.cs: update EmitCall.
16411
16412         * class.cs (Method.Define): Set NewSlot for the cases where we are
16413         not implementing an interface method.
16414
16415         (Property.Define): ditto.
16416
16417 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16418
16419         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16420         'r'.  Allows mcs to parse itself fully.
16421
16422 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16423
16424         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16425         of the number of initializers that require the InitializeArray method.
16426
16427         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16428         update the above field where necessary.
16429
16430         (MakeByteBlob): Update accordingly.
16431
16432         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16433         greater than 2.
16434
16435         (EmitDynamicInitializers): Update in accordance with the new optimization.
16436
16437         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16438         same OpCode applies.
16439
16440         * cs-parser.jay : Fix some glaring errors I introduced.
16441
16442 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16443
16444         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16445         so that we can check for name clashes there too.
16446
16447         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16448         for interface indexers.
16449
16450         * interfaces.cs (Define): Emit the default member attribute.
16451
16452         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16453         variable was being referred to while setting the value ;-)
16454
16455 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16456
16457         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16458         byte-by-byte information when we know the data is zero.
16459
16460         Make the block always a multiple of 4, because
16461         DefineInitializedData has a bug.
16462
16463         * assign.cs: Fix, we should assign from the temporary, not from
16464         the source. 
16465
16466         * expression.cs (MakeByteBlob): Fix my incorrect code.
16467
16468 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16469
16470         * typemanager.cs (EnumToUnderlying): This function is used to get
16471         the underlying type from an enumeration, because it does not
16472         always work. 
16473
16474         * constant.cs: Use the I4_S form for values between -128 and 127.
16475
16476         * statement.cs (Block.LookupLabel): Looks up a label.
16477         (Block): Drop support for labeled blocks.
16478
16479         (LabeledStatement): New kind of statement that represents a label
16480         only.
16481
16482         (Goto): Finally implement this bad boy.
16483
16484         * cs-parser.jay: Update to reflect new mechanism to implement
16485         labels.
16486
16487 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * codegen.cs (EmitContext.This): a codegen property that keeps the
16490         a single instance of this instead of creating many different this
16491         instances. 
16492
16493         * delegate.cs (Delegate.DoResolve): Update to use the property;
16494
16495         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16496
16497         * expression.cs (BaseAccess.DoResolve): Ditto.
16498
16499 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16500
16501         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16502         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16503
16504         (InitCoreTypes): Update accordingly.
16505
16506         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16507         so we can quickly store the state.
16508
16509         (ApplyAttributes): Set the correct implementation flags
16510         for InternalCall methods.
16511
16512 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16513
16514         * expression.cs (EmitCall): if a method is not virtual, then do
16515         not use callvirt on it.
16516
16517         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16518         user defined stuff) requires the use of stobj, which takes an
16519         address on the stack instead of an array and an index.  So emit
16520         the Ldelema operation for it.
16521
16522         (EmitStoreOpcode): Use stobj for valuetypes.
16523
16524         (UnaryMutator.EmitCode): Use the right 1 value depending on
16525         whether we are dealing with int64/uint64, float or doubles.
16526
16527         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16528         constructors that I implemented last night.
16529
16530         (Constructor.IsDefault): Fix to work properly for static
16531         constructors.
16532
16533         * cs-parser.jay (CheckDef): report method signature errors.
16534         Update error number 103 to be 132.
16535
16536         * decl.cs: New AdditionResult enumeration value: MethodExists.
16537         Although we do this check for methods later on in the semantic
16538         analysis, catching repeated default constructors is so easy that
16539         we catch these here. 
16540
16541         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16542         promotions code.
16543
16544         (ParameterReference.EmitAssign, Emit): handle
16545         bools as bytes.
16546
16547         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16548         (ArrayAccess.EmitStoreOpcode): ditto.
16549
16550         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16551
16552         * expression.cs (MakeByteBlob): Complete all the missing types
16553         (uint, short, ushort, byte, sbyte)
16554
16555         * class.cs: Only init instance field initializers on instance
16556         constructors. 
16557
16558         Rename `constructors' to instance_constructors. 
16559
16560         (TypeContainer.AddConstructor): Only add constructors to the list
16561         if it is not static.
16562
16563         Make sure that we handle default_static_constructor independently
16564         everywhere where we handle instance_constructors
16565
16566 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * class.cs: Do not lookup or create a base initializer for a
16569         static constructor.
16570
16571         (ConstructorInitializer.Resolve): use the proper type to lookup
16572         for constructors.
16573
16574         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16575
16576         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16577         in DeclSpace. 
16578
16579         * decl.cs: CloseType is now an virtual method, the default
16580         implementation just closes this type.
16581
16582 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16583
16584         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16585         to PreserveSig by default. Also emit HideBySig on such methods.
16586
16587         Basically, set the defaults to standard values.
16588
16589         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16590         argument, if candidate is better, it can't be worse than the best !
16591
16592         (Invocation): Re-write bits to differentiate between methods being
16593         applicable in their expanded form and their normal form - for params
16594         methods of course.
16595
16596         Get rid of use_standard everywhere as only standard conversions are allowed
16597         in overload resolution. 
16598
16599         More spec conformance.
16600
16601 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16602
16603         * driver.cs: Add --timestamp, to see where the compiler spends
16604         most of its time.
16605
16606         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16607         `this' in static code.
16608
16609         (SimpleName.DoResolve): Implement in terms of a helper function
16610         that allows static-references to be passed upstream to
16611         MemberAccess.
16612
16613         (Expression.ResolveWithSimpleName): Resolve specially simple
16614         names when called by MemberAccess to implement the special
16615         semantics. 
16616
16617         (Expression.ImplicitReferenceConversion): Handle conversions from
16618         Null to reference types before others, as Null's type is
16619         System.Object. 
16620
16621         * expression.cs (Invocation.EmitCall): Handle the special case of
16622         calling methods declared on a reference type from a ValueType
16623         (Base classes System.Object and System.Enum)
16624
16625         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16626         the left hand side is a TypeExpr, not on every enumeration. 
16627
16628         (Binary.Resolve): If types are reference types, then do a cast to
16629         object on operators != and == of both arguments.
16630
16631         * typemanager.cs (FindMembers): Extract instance and static
16632         members if requested.
16633
16634         * interface.cs (PopulateProperty): Use void_type instead of null
16635         as the return type for the setter method.
16636
16637         (PopulateIndexer): ditto.
16638
16639 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16640
16641         * support.cs (ReflectionParameters): Fix minor bug where we
16642         were examining the wrong parameter for the ParamArray attribute.
16643
16644         Cope with requests for the type of the parameter at position
16645         greater than the params parameter's. We now return the element
16646         type of the params array as that makes more sense.
16647
16648         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16649         accordingly as we no longer have to extract the element type
16650         ourselves.
16651
16652         (Invocation.OverloadResolve): Update.
16653
16654 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16655
16656         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16657         against IEnumerator, test whether the return value is a descendant
16658         of the IEnumerator interface.
16659
16660         * class.cs (Indexer.Define): Use an auxiliary method to implement
16661         the other bits of the method definition.  Begin support for
16662         explicit interface implementation.
16663
16664         (Property.DefineMethod): Use TypeManager.void_type instead of null
16665         for an empty return value.
16666
16667 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16670         dealing with a FieldExpr which is composed of a FieldBuilder, in
16671         the code path we did extract the constant, but we should have
16672         obtained the underlying value to be able to cast it (otherwise we
16673         end up in an infinite loop, this is what Ravi was running into).
16674
16675         (ArrayCreation.UpdateIndices): Arrays might be empty.
16676
16677         (MemberAccess.ResolveMemberAccess): Add support for section
16678         14.5.4.1 that deals with the special case of E.I when E is a type
16679         and something else, that I can be a reference to a static member.
16680
16681         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16682         handle a particular array type to create byte blobs, it is just
16683         something we dont generate byteblobs for.
16684
16685         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16686         arguments. 
16687
16688         * location.cs (Push): remove the key from the hashtable that we
16689         are about to add.   This happens for empty files.
16690
16691         * driver.cs: Dispose files after we have parsed them.
16692
16693         (tokenize): new function that only runs the tokenizer on its
16694         input, for speed testing.
16695
16696 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16697
16698         * class.cs (Event.Define): Define the private field only if there
16699         are no accessors defined.
16700
16701         * expression.cs (ResolveMemberAccess): If there is no associated
16702         field with the event, that means we have an event defined with its
16703         own accessors and we should flag error cs0070 since transforming
16704         ourselves into a field is not valid in that case.
16705
16706         * ecore.cs (SimpleName.DoResolve): Same as above.
16707
16708         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16709         and charset to sane values.
16710
16711 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16712
16713         * assign.cs (DoResolve): Perform check on events only if they 
16714         are being accessed outside the declaring type.
16715
16716         * cs-parser.jay (event_declarations): Update rules to correctly
16717         set the type of the implicit parameter etc.
16718
16719         (add_accessor, remove_accessor): Set current local parameters.
16720
16721         * expression.cs (Binary): For delegate addition and subtraction,
16722         cast the return value from the method into the appropriate delegate
16723         type.
16724
16725 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16726
16727         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16728         of these as the workaround is unnecessary.
16729
16730         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16731         delegate data - none of that is needed at all.
16732
16733         Re-write bits to extract the instance expression and the delegate method
16734         correctly.
16735
16736         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16737         on delegates too.
16738
16739         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16740         of attaching attributes instead of duplicating code everywhere.
16741
16742         * everywhere : Update code to do attribute emission using the above method.
16743
16744 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * expression.cs (IsParamsMethodApplicable): if there are not
16747         parameters, return immediately.
16748
16749         * ecore.cs: The 0 literal can be implicity converted to an enum
16750         type. 
16751
16752         (SimpleName.DoResolve): First lookup the type, then lookup the
16753         members. 
16754
16755         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16756         want to get its address.  If the InstanceExpression is not
16757         addressable, store the result in a temporary variable, then get
16758         the address of it.
16759
16760         * codegen.cs: Only display 219 errors on warning level or above. 
16761
16762         * expression.cs (ArrayAccess): Make it implement the
16763         IMemoryLocation interface.
16764
16765         (Binary.DoResolve): handle the operator == (object a, object b)
16766         and operator != (object a, object b) without incurring into a
16767         BoxedCast (because 5 != o should never be performed).
16768
16769         Handle binary enumerator operators.
16770
16771         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16772         value type, otherwise use Ldelem_ref.
16773
16774         Use precomputed names;
16775
16776         (AddressOf): Implement address of
16777
16778         * cs-parser.jay (labeled_statement): Fix recursive block
16779         addition by reworking the production.
16780
16781         * expression.cs (New.DoEmit): New has a special case:
16782                 
16783                  If we are dealing with a ValueType, we have a few
16784                  situations to deal with:
16785                 
16786                     * The target of New is a ValueType variable, that is
16787                       easy, we just pass this as the variable reference
16788                 
16789                     * The target of New is being passed as an argument,
16790                       to a boxing operation or a function that takes a
16791                       ValueType.
16792                 
16793                       In this case, we need to create a temporary variable
16794                       that is the argument of New.
16795
16796
16797 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16798
16799         * rootcontext.cs (LookupType): Check that current_type is not null before
16800         going about looking at nested types.
16801
16802         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16803         not implement the IAssignMethod interface any more.
16804
16805         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16806         where we tranform them into FieldExprs if they are being resolved from within
16807         the declaring type.
16808
16809         * ecore.cs (SimpleName.DoResolve): Do the same here.
16810
16811         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16812
16813         * ../errors/bug10.cs : Add.
16814
16815         * ../errors/cs0070.cs : Add.
16816
16817         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16818
16819         * assign.cs : Get rid of EventIsLocal everywhere.
16820
16821 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16822
16823         * ecore.cs (ConvertIntLiteral): finished the implementation.
16824
16825         * statement.cs (SwitchLabel): Convert the value we are using as a
16826         key before looking up the table.
16827
16828 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16829
16830         * codegen.cs (EmitTopBlock): Require a Location argument now.
16831
16832         * cs-parser.jay (constructor_declarator): We need to setup
16833         current_local_parameters before we parse the
16834         opt_constructor_initializer, to allow the variables to be bound
16835         to the constructor arguments.
16836
16837         * rootcontext.cs (LookupType): First lookup nested classes in our
16838         class and our parents before we go looking outside our class.
16839
16840         * expression.cs (ConstantFold): Extract/debox the values at the
16841         beginnning. 
16842
16843         * rootcontext.cs (EmitCode): Resolve the constants first before we
16844         resolve the types.  This is not really needed, but it helps debugging.
16845
16846         * statement.cs: report location.
16847
16848         * cs-parser.jay: pass location to throw statement.
16849
16850         * driver.cs: Small bug fix.
16851
16852         * report.cs: Updated format to be 4-zero filled digits.
16853
16854 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16855
16856         * expression.cs (CheckIndices): Fix minor bug where the wrong
16857         variable was being referred to ;-)
16858
16859         (DoEmit): Do not call EmitStaticInitializers when the 
16860         underlying type is System.Object.
16861
16862 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16863
16864         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16865         and do the usual workaround for SRE.
16866
16867         * class.cs (MyEventBuilder.EventType): New member to get at the type
16868         of the event, quickly.
16869
16870         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16871
16872         * assign.cs (Assign.DoResolve): Handle the case when the target
16873         is an EventExpr and perform the necessary checks.
16874
16875         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16876         interface.
16877
16878         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16879
16880         (EventExpr): Set the type in the constructor itself since we 
16881         are meant to be born fully resolved.
16882
16883         (EventExpr.Define): Revert code I wrote earlier.
16884                 
16885         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16886         instance expression is null. The instance expression is a This in that case
16887         or a null, depending on whether it is a static method or not.
16888
16889         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16890         refers to more than one method.
16891
16892         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16893         and accordingly flag errors.
16894
16895 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16896
16897         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16898
16899 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * location.cs (ToString): Provide useful rutine.
16902
16903 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16904
16905         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16906         objects, return the actual integral boxed.
16907
16908         * statement.cs (SwitchLabel): define an ILLabel for each
16909         SwitchLabel. 
16910
16911         (Switch.CheckSwitch): If the value is a Literal, extract
16912         the underlying literal.
16913
16914         Also in the unused hashtable we had, add the SwitchLabel so we can
16915         quickly look this value up.
16916
16917         * constant.cs: Implement a bunch of new constants.  Rewrite
16918         Literal based on this.  Made changes everywhere to adapt to this.
16919
16920         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16921         dereferencing array only once, and also copes with enumrations.
16922
16923         bytes are two bytes wide, not one.
16924
16925         (Cast): Perform constant conversions.
16926
16927         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16928         wrappers to the literals here.
16929
16930         * expression.cs (DoNumericPromotions): long literals can converted
16931         to ulong implicity (this is taken care of elsewhere, but I was
16932         missing this spot).
16933
16934         * ecore.cs (Expression.Literalize): Make the return type Literal,
16935         to improve type checking.
16936
16937         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16938
16939 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16940
16941         * literal.cs: Revert code from ravi that checked the bounds.  The
16942         bounds are sane by the definition of the type itself. 
16943
16944         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16945         need to actually look up in our parent hierarchy for interfaces
16946         implemented. 
16947
16948         * const.cs: Use the underlying type for enumerations
16949
16950         * delegate.cs: Compute the basename for the delegate creation,
16951         that should fix the delegate test case, and restore the correct
16952         Type Lookup semantics in rootcontext
16953
16954         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16955         referencing a nested type with the Reflection API is using the "+"
16956         sign. 
16957
16958         * cs-parser.jay: Do not require EOF token at the end.
16959
16960 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16961
16962         * rootcontext.cs (LookupType): Concatenate type names with
16963         a '.' instead of a '+' The test suite passes again.
16964
16965         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16966         field of the enumeration.
16967
16968         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16969         the case when the member is an EventExpr.
16970
16971         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16972         static has an associated instance expression.
16973
16974         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16975
16976         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16977
16978         * class.cs (Event.Define): Register event and perform appropriate checks
16979         for error #111.
16980
16981         We define the Add and Remove methods even if the use provides none because
16982         in that case, we provide default implementations ourselves.
16983
16984         Define a private field of the type of the event. This is done by the CSC compiler
16985         and we should be doing it too ;-)
16986
16987         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16988         More methods we use in code we generate.
16989
16990         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16991         is important.
16992
16993         (InitCoreTypes): Update accordingly for the above.
16994
16995         * class.cs (Event.Emit): Generate code for default accessors that we provide
16996
16997         (EmitDefaultMethod): Do the job in the above.
16998
16999         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17000         appropriate place.
17001
17002 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17003
17004         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17005         builders even if we were missing one.
17006
17007         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17008         pass the Basename as our class name instead of the Name.  The
17009         basename will be correctly composed for us.
17010
17011         * parameter.cs (Paramters): Now takes a Location argument.
17012
17013         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17014         make all the code call directly LookupType in RootContext and take
17015         this chance to pass the Location information everywhere.
17016
17017         * Everywhere: pass Location information.
17018
17019 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * class.cs (Constructor.Define): Updated way of detecting the
17022         length of the parameters.
17023
17024         (TypeContainer.DefineType): Use basename as the type name for
17025         nested types.
17026
17027         (TypeContainer.Define): Do not recursively define types here, as
17028         definition is taken care in order by the RootContext.
17029
17030         * tree.cs: Keep track of namespaces in a per-file basis.
17031
17032         * parameter.cs (Parameter.ComputeSignature): Update to use
17033         DeclSpace. 
17034
17035         (Parameters.GetSignature): ditto.
17036
17037         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17038         instead of a TypeContainer.
17039
17040         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17041         resolve names.  Because we need to be resolve in our context, not
17042         our parents.
17043
17044         * driver.cs: Implement response files.
17045
17046         * class.cs (TypeContainer.DefineType): If we are defined, do not
17047         redefine ourselves.
17048
17049         (Event.Emit): Emit the code for add/remove handlers.
17050         (Event.Define): Save the MethodBuilders for add/remove.
17051
17052         * typemanager.cs: Use pair here too.
17053
17054         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17055         DictionaryEntry requires the first argument to be non-null.  
17056
17057         (enum_declaration): Compute full name for registering the
17058         enumeration.
17059
17060         (delegate_declaration): Instead of using
17061         formal_parameter_list, use opt_formal_parameter_list as the list
17062         can be empty.
17063
17064         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17065         (EventParsing): New property that controls whether `add' and
17066         `remove' are returned as tokens or identifiers (for events);
17067
17068 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17069
17070         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17071         use MyEventBuilder only and let it wrap the real builder for us.
17072
17073         (MyEventBuilder): Revamp constructor etc.
17074
17075         Implement all operations that we perform on EventBuilder in precisely the same
17076         way here too.
17077
17078         (FindMembers): Update to use the EventBuilder member.
17079
17080         (Event.Emit): Update accordingly.
17081
17082 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17083
17084         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17085         by calling the appropriate methods.
17086
17087         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17088         useful.
17089
17090         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17091
17092 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17093
17094         * delegate.cs (Delegate.Populate): Check that the return type
17095         and various parameters types are indeed accessible.
17096
17097         * class.cs (Constructor.Define): Same here.
17098
17099         (Field.Define): Ditto.
17100
17101         (Event.Define): Ditto.
17102
17103         (Operator.Define): Check that the underlying Method defined itself
17104         correctly - so it's MethodBuilder should not be null.
17105
17106         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17107         expression happens to be null.
17108
17109         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17110         members but as of now we don't seem to be able to do anything really useful with it.
17111
17112         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17113         not the EventBuilder.
17114
17115 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17116
17117         * cs-tokenizer.cs: Add support for defines.
17118         Add support for #if, #elif, #else, #endif
17119
17120         (eval_var): evaluates a variable.
17121         (eval): stubbed for evaluating functions.
17122
17123         * cs-parser.jay: Pass the defines information
17124
17125         * driver.cs: Add --define command line option.
17126
17127         * decl.cs: Move MemberCore here.
17128
17129         Make it the base class for DeclSpace.  This allows us to catch and
17130         report 108 and 109 for everything now.
17131
17132         * class.cs (TypeContainer.Define): Extract all the members
17133         before populating and emit the warning 108 (new keyword required
17134         to override) instead of having each member implement this.
17135
17136         (MemberCore.Define): New abstract method, we will be using this in
17137         the warning reporting engine in Populate.
17138
17139         (Operator.Define): Adjust to new MemberCore protocol. 
17140
17141         * const.cs (Const): This does not derive from Expression, it is a
17142         temporary object we use to create fields, it is a MemberCore. 
17143
17144         * class.cs (Method.Define): Allow the entry point to be in a
17145         specific class.
17146
17147         * driver.cs: Rewrite the argument handler to clean it up a bit.
17148
17149         * rootcontext.cs: Made it just an auxiliary namespace feature by
17150         making everything static.
17151
17152         * driver.cs: Adapt code to use RootContext type name instead of
17153         instance variable.
17154
17155         * delegate.cs: Remove RootContext argument.
17156
17157         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17158         argument. 
17159
17160         * class.cs (Event.Define): The lookup can fail.
17161
17162         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17163
17164         * expression.cs: Resolve the this instance before invoking the code.
17165
17166 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * cs-parser.jay: Add a production in element_access that allows
17169         the thing to become a "type" reference.  This way we can parse
17170         things like "(string [])" as a type.
17171
17172         Note that this still does not handle the more complex rules of
17173         casts. 
17174
17175
17176         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17177
17178         * ecore.cs: (CopyNewMethods): new utility function used to
17179         assemble the list of methods from running FindMembers.
17180
17181         (MemberLookup): Rework FindMembers so that 
17182
17183 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17184
17185         * class.cs (TypeContainer): Remove Delegates who fail to be
17186         defined.
17187
17188         * delegate.cs (Populate): Verify that we dont get null return
17189         values.   TODO: Check for AsAccessible.
17190
17191         * cs-parser.jay: Use basename to emit error 574 (destructor should
17192         have the same name as container class), not the full name.
17193
17194         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17195         possible representation.  
17196
17197         Also implements integer type suffixes U and L.
17198
17199 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17200
17201         * expression.cs (ArrayCreation.DoResolve): We need to do the
17202         argument resolution *always*.
17203
17204         * decl.cs: Make this hold the namespace.  Hold the root context as
17205         well.
17206         (LookupType): Move here.
17207
17208         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17209
17210         * location.cs (Row, Name): Fixed the code, it was always returning
17211         references to the first file.
17212
17213         * interface.cs: Register properties defined through interfaces.
17214
17215         * driver.cs: Add support for globbing on the command line
17216
17217         * class.cs (Field): Make it derive from MemberCore as well.
17218         (Event): ditto.
17219
17220 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17221
17222         * class.cs (Event::Define): Check that the type of the event is a delegate
17223         type else flag error #66.
17224
17225         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17226         same.
17227
17228         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17229         values of EntryPoint, CharSet etc etc.
17230
17231         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17232
17233         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17234         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17235         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17236         which needs this to do its work.
17237
17238         * ../errors/cs0066.cs : Add.
17239
17240 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17241
17242         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17243         helper functions.
17244
17245         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17246         clears out the parameters field.
17247         (MemberSignatureCompare): Cleanup
17248
17249         (MemberCore): New base class used to share code between MethodCore
17250         and Property.
17251
17252         (RegisterRequiredImplementations) BindingFlags.Public requires
17253         either BindingFlags.Instace or Static.  Use instance here.
17254
17255         (Property): Refactored code to cope better with the full spec.
17256
17257         * parameter.cs (GetParameterInfo): Return an empty array instead
17258         of null on error.
17259
17260         * class.cs (Property): Abstract or extern properties have no bodies.
17261
17262         * parameter.cs (GetParameterInfo): return a zero-sized array.
17263
17264         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17265         method modifier validation to the typecontainer so we can reuse
17266         this on properties.
17267
17268         (MethodCore.ParameterTypes): return an empty sized array of types.
17269
17270         (Property.Define): Test property modifier validity.
17271
17272         Add tests for sealed/override too.
17273
17274         (Method.Emit): abstract or extern methods have no bodies.
17275
17276 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17277
17278         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17279         thing.
17280
17281         (Method::Define, ::Emit): Modify accordingly.
17282
17283         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17284
17285         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17286
17287         * makefile: Pass in /unsafe.
17288
17289 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17290
17291         * class.cs (MakeKey): Kill routine.
17292
17293         * class.cs (TypeContainer.Define): Correctly define explicit
17294         method implementations (they require the full interface name plus
17295         the method name).
17296
17297         * typemanager.cs: Deply the PtrHashtable here and stop using the
17298         lame keys.  Things work so much better.
17299
17300         This of course broke everyone who depended on `RegisterMethod' to
17301         do the `test for existance' test.  This has to be done elsewhere.
17302
17303         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17304         the object stupid Equals method (because, that like fails all over
17305         the place).  We still do not use it.
17306
17307         * class.cs (TypeContainer.SetRequiredInterface,
17308         TypeContainer.RequireMethods): Killed these two routines and moved
17309         all the functionality to RegisterRequiredImplementations.
17310
17311         (TypeContainer.RegisterRequiredImplementations): This routine now
17312         registers all the implementations required in an array for the
17313         interfaces and abstract methods.  We use an array of structures
17314         which can be computed ahead of time to reduce memory usage and we
17315         also assume that lookups are cheap as most classes will not
17316         implement too many interfaces.
17317
17318         We also avoid creating too many MethodSignatures.
17319
17320         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17321         clear the "pending" bit if we find that there are problems with
17322         the declaration.
17323
17324         (TypeContainer.VerifyPendingMethods): Update to report errors of
17325         methods that look like implementations but are not.
17326
17327         (TypeContainer.Define): Add support for explicit interface method
17328         implementation. 
17329
17330 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17331
17332         * typemanager.cs: Keep track of the parameters here instead of
17333         being a feature of the TypeContainer.
17334
17335         * class.cs: Drop the registration of parameters here, as
17336         InterfaceMethods are also interface declarations.
17337
17338         * delegate.cs: Register methods with the TypeManager not only with
17339         the TypeContainer.  This code was buggy.
17340
17341         * interface.cs: Full registation here.
17342
17343 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * expression.cs: Remove reducer for binary expressions, it can not
17346         be done this way.
17347
17348         * const.cs: Put here the code that used to go into constant.cs
17349
17350         * constant.cs: Put here the code for constants, this is a new base
17351         class for Literals.
17352
17353         * literal.cs: Make Literal derive from Constant.
17354
17355 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17356
17357         * statement.cs (Return.Emit): Report error 157 if the user
17358         attempts to return from a finally block.
17359
17360         (Return.Emit): Instead of emitting a return, jump to the end of
17361         the function.
17362
17363         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17364         LocalBuilder to store the result of the function.  ReturnLabel is
17365         the target where we jump.
17366
17367
17368 2001-12-09  Radek Doulik  <rodo@ximian.com>
17369
17370         * cs-parser.jay: remember alias in current namespace
17371
17372         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17373         namespaces
17374
17375         * class.cs (LookupAlias): lookup alias in my_namespace
17376
17377         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17378         aliases hashtable
17379         (LookupAlias): lookup alias in this and if needed in parent
17380         namespaces
17381
17382 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17383
17384         * support.cs: 
17385
17386         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17387         making things static.  I need this to avoid passing the
17388         TypeContainer when calling ParameterType.
17389
17390         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17391         that did string manipulation to compute the type and then call
17392         GetType.  Use Parameter.ParameterType instead.
17393
17394         * cs-tokenizer.cs: Consume the suffix for floating values.
17395
17396         * expression.cs (ParameterReference): figure out whether this is a
17397         reference parameter or not.  Kill an extra variable by computing
17398         the arg_idx during emission.
17399
17400         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17401         function that returns whether a parameter is an out/ref value or not.
17402
17403         (Parameter.ParameterType): The type of the parameter (base,
17404         without ref/out applied).
17405
17406         (Parameter.Resolve): Perform resolution here.
17407         (Parameter.ExternalType): The full type (with ref/out applied).
17408
17409         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17410         support for expressions on the using statement.
17411
17412 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17413
17414         * statement.cs (Using.EmitLocalVariableDecls): Split the
17415         localvariable handling of the using statement.
17416
17417         (Block.EmitMeta): Keep track of variable count across blocks.  We
17418         were reusing slots on separate branches of blocks.
17419
17420         (Try.Emit): Emit the general code block, we were not emitting it. 
17421
17422         Check the type of the declaration to be an IDisposable or
17423         something that can be implicity converted to it. 
17424
17425         Emit conversions if required.
17426
17427         * ecore.cs (EmptyExpression): New utility class.
17428         (Expression.ImplicitConversionExists): New utility function.
17429
17430 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17431
17432         * statement.cs (Using): Implement.
17433
17434         * expression.cs (LocalVariableReference): Support read only variables.
17435
17436         * statement.cs: Remove the explicit emit for the Leave opcode.
17437         (VariableInfo): Add a readonly field.
17438
17439 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * ecore.cs (ConvCast): new class used to encapsulate the various
17442         explicit integer conversions that works in both checked and
17443         unchecked contexts.
17444
17445         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17446         properly generate the overflow opcodes.
17447
17448 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17449
17450         * statement.cs: The correct type for the EmptyExpression is the
17451         element_type, not the variable type.  Ravi pointed this out.
17452
17453 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17454
17455         * class.cs (Method::Define): Handle PInvoke methods specially
17456         by using DefinePInvokeMethod instead of the usual one.
17457
17458         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17459         above to do the task of extracting information and defining the method.
17460
17461 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17462
17463         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17464         of the condition for string type.
17465
17466         (Emit): Move that here. 
17467
17468         (ArrayCreation::CheckIndices): Keep string literals in their expression
17469         form.
17470
17471         (EmitDynamicInitializers): Handle strings appropriately.
17472
17473 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * codegen.cs (EmitContext): Replace multiple variables with a
17476         single pointer to the current Switch statement.
17477
17478         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17479         EmitContext.
17480
17481 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17482
17483         * statement.cs 
17484
17485         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17486         default'.
17487
17488         (Foreach.Emit): Foreach on arrays was not setting
17489         up the loop variables (for break/continue).
17490
17491         (GotoCase): Semi-implented.
17492
17493 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17494
17495         * attribute.cs (CheckAttribute): Handle system attributes by using
17496         Attribute.GetAttributes to examine information we need.
17497
17498         (GetValidPlaces): Same here.
17499
17500         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17501
17502         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17503
17504         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17505
17506         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17507
17508         (Method::Emit): Handle the case when we are a PInvoke method.
17509
17510 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * expression.cs: Use ResolveWithSimpleName on compound names.
17513
17514 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17515
17516         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17517         before trying to reduce it.
17518
17519         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17520
17521         * constant.cs (LookupConstantValue): Implement.
17522
17523         (EmitConstant): Use the above in emitting the constant.
17524
17525         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17526         that are user-defined by doing a LookupConstantValue on them.
17527
17528         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17529         too, like above.
17530
17531 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17532
17533         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17534
17535         (BaseAccess.DoResolve): Implement.
17536
17537         (MemberAccess.DoResolve): Split this routine into a
17538         ResolveMemberAccess routine that can be used independently
17539
17540 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17541
17542         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17543         As that share bits of the implementation.  Is returns a boolean,
17544         while As returns the Type that is being probed.
17545
17546 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17547
17548         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17549         instead of a Literal - much easier.
17550
17551         (EnumInTransit): Remove - utterly useless :-)
17552
17553         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17554
17555         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17556
17557         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17558         chain when we have no associated expression.
17559
17560 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17561
17562         * constant.cs (Define): Use Location while reporting the errror.
17563
17564         Also emit a warning when 'new' is used and there is no inherited
17565         member to hide.
17566
17567         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17568         populated.
17569
17570         (LookupEnumValue): Implement to lookup an enum member's value and define it
17571         if necessary.
17572
17573         (Populate): Re-write accordingly to use the above routine.
17574
17575 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17576
17577         * expression.cs (This): Fix prototype for DoResolveLValue to
17578         override the base class DoResolveLValue.
17579
17580         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17581         declarations) 
17582
17583         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17584         (we need to load the address of the field here).  This fixes
17585         test-22. 
17586
17587         (FieldExpr.DoResolveLValue): Call the DoResolve
17588         function to initialize the Instance expression.
17589
17590         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17591         correctly the GetEnumerator operation on a value type.
17592
17593         * cs-parser.jay: Add more simple parsing error catches.
17594
17595         * statement.cs (Switch): Add support for string switches.
17596         Handle null specially.
17597
17598         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17599
17600 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17601
17602         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17603
17604         (declare_local_constant): New helper function.
17605
17606         * statement.cs (AddConstant): Keep a separate record of constants
17607
17608         (IsConstant): Implement to determine if a variable is a constant.
17609
17610         (GetConstantExpression): Implement.
17611
17612         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17613
17614         * statement.cs (IsVariableDefined): Re-write.
17615
17616 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17617
17618         * class.cs (TypeContainer::FindMembers): Look for constants
17619         in the case when we are looking for MemberTypes.Field
17620
17621         * expression.cs (MemberAccess::DoResolve): Check that in the
17622         case we are a FieldExpr and a Literal, we are not being accessed
17623         by an instance reference.
17624
17625         * cs-parser.jay (local_constant_declaration): Implement.
17626
17627         (declaration_statement): Implement for constant declarations.
17628
17629 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * statement.cs (Switch): Catch double defaults.
17632
17633         (Switch): More work on the switch() statement
17634         implementation.  It works for integral values now, need to finish
17635         string support.
17636
17637
17638 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17639
17640         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17641         integer literals into other integer literals.  To be used by
17642         switch. 
17643
17644 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17645
17646         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17647         some memory.
17648
17649         (EmitDynamicInitializers): Cope with the above since we extract data
17650         directly from ArrayData now.
17651
17652         (ExpectInitializers): Keep track of whether initializers are mandatory
17653         or not.
17654
17655         (Bounds): Make it a hashtable to prevent the same dimension being 
17656         recorded for every element in that dimension.
17657
17658         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17659         from being found.
17660
17661         Also fix bug which was causing the indices to be emitted in the reverse
17662         order.
17663
17664 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17665
17666         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17667         unfinished.  They do not work, because the underlying code is
17668         sloppy.
17669
17670 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17671
17672         * cs-parser.jay: Remove bogus fixme.
17673
17674         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17675         on Switch statement.
17676
17677 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17678
17679         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17680         the same. 
17681
17682         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17683         parameter. Apparently, any expression is allowed. 
17684
17685         (ValidateInitializers): Update accordingly.
17686
17687         (CheckIndices): Fix some tricky bugs thanks to recursion.
17688
17689         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17690         I was being completely brain-dead.
17691
17692         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17693         and re-write acordingly.
17694
17695         (DelegateInvocation): Re-write accordingly.
17696
17697         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17698
17699         (MakeByteBlob): Handle types more correctly.
17700
17701         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17702         initialization from expressions but it is incomplete because I am a complete
17703         Dodo :-|
17704
17705 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17706
17707         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17708         on If.  Basically, we have to return `true' (ie, we do return to
17709         our caller) only if both branches of the if return.
17710
17711         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17712         short-circuit operators, handle them as short circuit operators. 
17713
17714         (Cast.DoResolve): Resolve type.
17715         (Cast.Cast): Take an expression as the target type.
17716
17717         * cs-parser.jay (cast_expression): Remove old hack that only
17718         allowed a limited set of types to be handled.  Now we take a
17719         unary_expression and we resolve to a type during semantic
17720         analysis.
17721
17722         Use the grammar productions from Rhys to handle casts (this is
17723         not complete like Rhys syntax yet, we fail to handle that corner
17724         case that C# has regarding (-x), but we will get there.
17725
17726 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17727
17728         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17729         field which is an array type.
17730
17731         * cs-parser.jay (declare_local_variables): Support array initialization too.
17732
17733         * typemanager.cs (MakeKey): Implement.
17734
17735         (everywhere): Use the above appropriately.
17736
17737         * cs-parser.jay (for_statement): Update for array initialization while
17738         declaring variables.
17739
17740         * ecore.cs : The error message was correct, it's the variable's names that
17741         were misleading ;-) Make the code more readable.
17742
17743         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17744         the correct type etc.
17745
17746         (ConvertExplicit): Handle Enum types by examining the underlying type.
17747
17748 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17749
17750         * parameter.cs (GetCallingConvention): Always return
17751         CallingConventions.Standard for now.
17752
17753 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17756         and `r' after calling DoNumericPromotions.
17757
17758         * ecore.cs: Fix error message (the types were in the wrong order).
17759
17760         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17761         BindingFlags.Instance as well 
17762
17763         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17764         implicit int literal conversion in an empty cast so that we
17765         propagate the right type upstream.
17766
17767         (UnboxCast): new class used to unbox value types.
17768         (Expression.ConvertExplicit): Add explicit type conversions done
17769         by unboxing.
17770
17771         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17772         the target type before applying the implicit LongLiterals to ULong
17773         literal cast.
17774
17775 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17776
17777         * cs-parser.jay (for_statement): Reworked the way For works: now
17778         we declare manually any variables that are introduced in
17779         for_initializer to solve the problem of having out-of-band code
17780         emition (that is what got for broken).
17781
17782         (declaration_statement): Perform the actual variable declaration
17783         that used to be done in local_variable_declaration here.
17784
17785         (local_variable_declaration): Do not declare anything, just pass
17786         the information on a DictionaryEntry
17787
17788 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17789
17790         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17791         re-write of the logic to now make it recursive.
17792
17793         (UpdateIndices): Re-write accordingly.
17794
17795         Store element data in a separate ArrayData list in the above methods.
17796
17797         (MakeByteBlob): Implement to dump the array data into a byte array.
17798
17799 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17800
17801         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17802         into CheckIndices.
17803
17804         * constant.cs (Define): Implement.
17805
17806         (EmitConstant): Re-write fully.
17807
17808         Pass in location info.
17809
17810         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17811         respectively.
17812
17813         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17814         DictionaryEntry since we need location info too.
17815
17816         (constant_declaration): Update accordingly.
17817
17818         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17819         code into another method : UpdateIndices.
17820
17821 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17822
17823         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17824         some type checking etc.
17825
17826 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17827
17828         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17829         bits to provide dimension info if the user skips doing that.
17830
17831         Update second constructor to store the rank correctly.
17832
17833 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17834
17835         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17836         and try to implement.
17837
17838         * ../errors/cs0150.cs : Add.
17839
17840         * ../errors/cs0178.cs : Add.
17841
17842 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17843
17844         * statement.cs: Implement foreach on multi-dimensional arrays. 
17845
17846         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17847         name of the params argument.
17848
17849         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17850         initializing the array.
17851
17852         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17853         we can use this elsewhere.
17854
17855         * statement.cs: Finish implementation of foreach for single
17856         dimension arrays.
17857
17858         * cs-parser.jay: Use an out-of-band stack to pass information
17859         around, I wonder why I need this.
17860
17861         foreach_block: Make the new foreach_block the current_block.
17862
17863         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17864         function used to return a static Parameters structure.  Used for
17865         empty parameters, as those are created very frequently.
17866
17867         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17868
17869 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17870
17871         * interface.cs : Default modifier is private, not public. The
17872         make verify test passes again.
17873
17874 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17875
17876         * support.cs (ReflectionParameters): Fix logic to determine
17877         whether the last parameter is a params one. Test 9 passes again.
17878
17879         * delegate.cs (Populate): Register the builders we define with
17880         RegisterParameterForBuilder. Test 19 passes again.
17881
17882         * cs-parser.jay (property_declaration): Reference $6 instead
17883         of $$ to get at the location.
17884
17885         (indexer_declaration): Similar stuff.
17886
17887         (attribute): Ditto.
17888
17889         * class.cs (Property): Register parameters for the Get and Set methods
17890         if they exist. Test 23 passes again.
17891
17892         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17893         call to EmitArguments as we are sure there aren't any params arguments. 
17894         Test 32 passes again.
17895
17896         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17897         IndexOutOfRangeException. 
17898
17899         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17900         Test 33 now passes again.
17901
17902 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17903
17904         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17905         broke a bunch of things.  Will have to come up with a better way
17906         of tracking locations.
17907
17908         * statement.cs: Implemented foreach for single dimension arrays.
17909
17910 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17911
17912         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17913         an error.  This removes the lookup from the critical path.
17914
17915         * cs-parser.jay: Removed use of temporary_loc, which is completely
17916         broken. 
17917
17918 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17919
17920         * support.cs (ReflectionParameters.ParameterModifier): Report
17921         whether the argument is a PARAMS argument or not.
17922
17923         * class.cs: Set the attribute `ParamArrayAttribute' on the
17924         parameter argument.
17925
17926         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17927         and cons_param_array_attribute (ConstructorInfo for
17928         ParamArrayAttribute)., 
17929
17930         * codegen.cs: Emit the return using the `Return' statement, that
17931         way we can report the error correctly for missing return values. 
17932
17933         * class.cs (Method.Emit): Clean up.
17934
17935         * expression.cs (Argument.Resolve): Take another argument: the
17936         location where this argument is used.  Notice that this is not
17937         part of the "Argument" class as to reduce the size of the
17938         structure (we know the approximate location anyways).
17939
17940         Test if the argument is a variable-reference, if not, then
17941         complain with a 206.
17942
17943         (Argument.Emit): Emit addresses of variables.
17944
17945         (Argument.FullDesc): Simplify.
17946
17947         (Invocation.DoResolve): Update for Argument.Resolve.
17948
17949         (ElementAccess.DoResolve): ditto.
17950
17951         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17952         method should be virtual, as this method is always virtual.
17953
17954         (NewDelegate.DoResolve): Update for Argument.Resolve.
17955
17956         * class.cs (ConstructorInitializer.DoResolve): ditto.
17957
17958         * attribute.cs (Attribute.Resolve): ditto.
17959
17960 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17963
17964         * expression.cs (ParameterReference): Drop IStackStorage and implement
17965         IAssignMethod instead. 
17966
17967         (LocalVariableReference): ditto.
17968
17969         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17970         IAssignMethod instead. 
17971
17972 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17973
17974         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17975         enumerations that are used in heavily used structures derive from
17976         byte in a laughable and pathetic attempt to reduce memory usage.
17977         This is the kind of pre-optimzations that you should not do at
17978         home without adult supervision.
17979
17980         * expression.cs (UnaryMutator): New class, used to handle ++ and
17981         -- separatedly from the other unary operators.  Cleans up the
17982         code, and kills the ExpressionStatement dependency in Unary.
17983
17984         (Unary): Removed `method' and `Arguments' from this class, making
17985         it smaller, and moving it all to SimpleCall, so I can reuse this
17986         code in other locations and avoid creating a lot of transient data
17987         strucutres when not required.
17988
17989         * cs-parser.jay: Adjust for new changes.
17990
17991 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17992
17993         * enum.cs (Enum.Populate): If there is a failure during
17994         definition, return
17995
17996         * cs-parser.jay (opt_enum_base): we used to catch type errors
17997         here, but this is really incorrect.  The type error should be
17998         catched during semantic analysis.
17999
18000 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18001
18002         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18003         current_local_parameters as expected since I, in my stupidity, had forgotten
18004         to do this :-)
18005
18006         * attribute.cs (GetValidPlaces): Fix stupid bug.
18007
18008         * class.cs (Method::Emit): Perform check on applicability of attributes.
18009
18010         (Constructor::Emit): Ditto.
18011
18012         (Field::Emit): Ditto.
18013
18014         (Field.Location): Store location information.
18015
18016         (Property, Event, Indexer, Operator): Ditto.
18017
18018         * cs-parser.jay (field_declaration): Pass in location for each field.
18019
18020         * ../errors/cs0592.cs : Add.
18021
18022 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18023
18024         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18025
18026         (InitCoreTypes): Update accordingly.
18027
18028         (RegisterAttrType, LookupAttr): Implement.
18029
18030         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18031         info about the same.
18032
18033         (Resolve): Update to populate the above as necessary.
18034
18035         (Error592): Helper.
18036
18037         (GetValidPlaces): Helper to the above.
18038
18039         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18040
18041         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18042
18043 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18044
18045         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18046
18047         * ../errors/cs0617.cs : Add.
18048
18049 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18050
18051         * enum.cs (Emit): Rename to Populate to be more consistent with what
18052         we expect it to do and when exactly it is called.
18053
18054         * class.cs, rootcontext.cs : Update accordingly.
18055
18056         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18057         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18058
18059         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18060
18061         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18062         of a fieldinfo using the above, when dealing with a FieldBuilder.
18063
18064 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18065
18066         * ../errors/cs0031.cs : Add.
18067
18068         * ../errors/cs1008.cs : Add.
18069
18070         * ../errrors/cs0543.cs : Add.
18071
18072         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18073         enum type.
18074
18075         (FindMembers): Implement.
18076
18077         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18078         enums and delegates too.
18079
18080         (enum_types): Rename to builder_to_enum.
18081
18082         (delegate_types): Rename to builder_to_delegate.
18083
18084         * delegate.cs (FindMembers): Implement.
18085
18086 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18087
18088         * typemanager.cs (IsEnumType): Implement.
18089
18090         * enum.cs (Emit): Re-write parts to account for the underlying type
18091         better and perform checking etc.
18092
18093         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18094         of the underlying type.
18095
18096         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18097         value
18098
18099         * enum.cs (error31): Helper to report error #31.
18100
18101         * cs-parser.jay (enum_declaration): Store location of each member too.
18102
18103         * enum.cs (member_to_location): New hashtable. 
18104
18105         (AddEnumMember): Update location hashtable.
18106
18107         (Emit): Use the location of each member while reporting errors.
18108
18109 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * cs-parser.jay: A for_initializer if is a
18112         local_variable_declaration really ammount to have an implicit
18113         block with the variable declaration and no initializer for for.
18114
18115         * statement.cs (For.Emit): Cope with null initializers.
18116
18117         This fixes the infinite loop on for initializers.
18118
18119 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18120
18121         * enum.cs: More cleanup.
18122
18123         * ecore.cs: Remove dead code.
18124
18125         * class.cs (Property.Emit): More simplification.
18126         (Event.Emit): ditto.
18127
18128         Reworked to have less levels of indentation.
18129
18130 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18131
18132         * class.cs (Property): Emit attributes.
18133
18134         (Field): Ditto.
18135
18136         (Event): Ditto.
18137
18138         (Indexer): Ditto.
18139
18140         (Operator): Ditto.
18141
18142         * enum.cs (Emit): Ditto.
18143
18144         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18145         Enums too.
18146
18147         * class.cs (Field, Event, etc.): Move attribute generation into the
18148         Emit method everywhere.
18149
18150         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18151         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18152         as we had no way of defining nested enums !
18153
18154         * rootcontext.cs : Adjust code accordingly.
18155
18156         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18157
18158 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18159
18160         * expression.cs (EvalConstantExpression): Move into ecore.cs
18161
18162         * enum.cs (Enum): Rename some members and make them public and readonly
18163         according to our convention.
18164
18165         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18166         nothing else.
18167
18168         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18169
18170         (Enum::Emit): Write a simple version for now which doesn't try to compute
18171         expressions. I shall modify this to be more robust in just a while.
18172
18173         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18174
18175         (TypeContainer::CloseType): Create the Enum types too.
18176
18177         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18178
18179         * expression.cs (EvalConstantExpression): Get rid of completely.
18180
18181         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18182         user-defined values and other cases.
18183
18184         (IsValidEnumLiteral): Helper function.
18185
18186         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18187         out there in the case we had a literal FieldExpr.
18188
18189         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18190
18191         (Literalize): Revamp a bit to take two arguments.
18192
18193         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18194
18195 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18196
18197         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18198
18199         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18200
18201         (Resolve): Use the above to ensure we have proper initializers.
18202
18203 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18204
18205         * expression.cs (Expression::EvalConstantExpression): New method to 
18206         evaluate constant expressions.
18207
18208         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18209
18210 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18211
18212         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18213         in an array.
18214
18215         (Binary.ResolveOperator): Handle operator != (object a, object b)
18216         and operator == (object a, object b);
18217
18218         (Binary.DoNumericPromotions): Indicate whether the numeric
18219         promotion was possible.
18220
18221         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18222         Implement.  
18223
18224         Made the ArrayAccess implement interface IAssignMethod instead of
18225         IStackStore as the order in which arguments are passed reflects
18226         this.
18227
18228         * assign.cs: Instead of using expr.ExprClass to select the way of
18229         assinging, probe for the IStackStore/IAssignMethod interfaces.
18230
18231         * typemanager.cs: Load InitializeArray definition.
18232
18233         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18234         static data that can be used to initialize arrays. 
18235
18236 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18237
18238         * expression.cs: Handle operator== and operator!= for booleans.
18239
18240         (Conditioal.Reduce): Implement reducer for the ?: operator.
18241
18242         (Conditional.Resolve): Implement dead code elimination.
18243
18244         (Binary.Resolve): Catch string literals and return a new
18245         concatenated string.
18246
18247         (Unary.Reduce): Implement reduction of unary expressions.
18248
18249         * ecore.cs: Split out the expression core handling here.
18250
18251         (Expression.Reduce): New method used to perform constant folding
18252         and CSE.  This is needed to support constant-expressions. 
18253
18254         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18255         targets, and optimize for !x.
18256
18257 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18258
18259         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18260         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18261         set custom atttributes.
18262
18263         * literal.cs (Literal::GetValue): New abstract method to return the actual
18264         value of the literal, cast as an object.
18265
18266         (*Literal): Implement GetValue method.
18267
18268         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18269         expressions to the arraylist but objects of type Argument.
18270
18271         * class.cs (TypeContainer::Emit): Emit our attributes too.
18272
18273         (Method::Emit, Constructor::Emit): Ditto.
18274
18275         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18276         to be ignoring earlier.
18277
18278 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18279
18280         * attribute.cs (AttributeSection::Define): Implement to do the business
18281         of constructing a CustomAttributeBuilder.
18282
18283         (Attribute): New trivial class. Increases readability of code.  
18284
18285         * cs-parser.jay : Update accordingly.
18286
18287         (positional_argument_list, named_argument_list, named_argument): New rules
18288
18289         (attribute_arguments): Use the above so that we are more correct.
18290
18291 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18292
18293         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18294         to perform all checks for a method with a params parameter.
18295
18296         (Invocation::OverloadResolve): Update to use the above method and therefore
18297         cope correctly with params method invocations.
18298
18299         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18300         params too.
18301
18302         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18303         constructors in our parent too because we can't afford to miss out on 
18304         protected ones ;-)
18305
18306         * attribute.cs (AttributeSection): New name for the class Attribute
18307
18308         Other trivial changes to improve readability.
18309
18310         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18311         use the new class names.
18312
18313 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18314
18315         * class.cs (Method::Define): Complete definition for params types too
18316
18317         (Indexer::Define): Ditto.
18318
18319         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18320         Cope everywhere with a request for info about the array parameter.
18321
18322 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18323
18324         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18325
18326         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18327         local_variable_type to extract the string corresponding to the type.
18328
18329         (local_variable_type): Fixup the action to use the new helper method.
18330
18331         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18332         go.
18333
18334         * expression.cs : Clean out code which uses the above.
18335
18336 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18337
18338         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18339         and bale out if necessary by returning a false.
18340
18341         (RegisterProperty): Ditto.
18342
18343         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18344         and print out appropriate error messages.
18345
18346         * interface.cs (everywhere): Ditto.
18347
18348         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18349         location to constructor.
18350
18351         * class.cs (Property, Event, Indexer): Update accordingly.
18352
18353         * ../errors/cs111.cs : Added.
18354
18355         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18356         of a method, as laid down by the spec.
18357
18358         (Invocation::OverloadResolve): Use the above method.
18359
18360 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18361
18362         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18363         now take a TypeContainer and a Parameters object.
18364
18365         (ParameterData): Modify return type of ParameterModifier method to be 
18366         Parameter.Modifier and not a string.
18367
18368         (ReflectionParameters, InternalParameters): Update accordingly.
18369
18370         * expression.cs (Argument::GetParameterModifier): Same here.
18371
18372         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18373         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18374         symbol in it at all so maybe this is only for now.
18375
18376 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18377
18378         * support.cs (InternalParameters): Constructor now takes an extra argument 
18379         which is the actual Parameters class.
18380
18381         (ParameterDesc): Update to provide info on ref/out modifiers.
18382
18383         * class.cs (everywhere): Update call to InternalParameters to pass in
18384         the second argument too.
18385
18386         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18387         to return the modifier info [ref/out etc]
18388
18389         (InternalParameters, ReflectionParameters): Implement the above.
18390
18391         * expression.cs (Argument::ParameterModifier): Similar function to return
18392         info about the argument's modifiers.
18393
18394         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18395         too.
18396
18397         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18398         a new SetFormalParameters object which we pass to InternalParameters.
18399
18400 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18401
18402         * expression.cs (NewArray): Merge into the ArrayCreation class.
18403
18404 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18405
18406         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18407         NewUserdefinedArray into one as there wasn't much of a use in having
18408         two separate ones.
18409
18410         * expression.cs (Argument): Change field's name to ArgType from Type.
18411
18412         (Type): New readonly property which returns the proper type, taking into 
18413         account ref/out modifiers.
18414
18415         (everywhere): Adjust code accordingly for the above.
18416
18417         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18418         whether we are emitting for a ref or out parameter.
18419
18420         * expression.cs (Argument::Emit): Use the above field to set the state.
18421
18422         (LocalVariableReference::Emit): Update to honour the flag and emit the
18423         right stuff.
18424
18425         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18426
18427         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18428
18429         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18430
18431         (ReflectionParameters, InternalParameters): Implement the above method.
18432
18433         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18434         reporting errors.
18435
18436         (Invocation::FullMethodDesc): Ditto. 
18437
18438 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18439
18440         * cs-parser.jay: Add extra production for the second form of array
18441         creation. 
18442
18443         * expression.cs (ArrayCreation): Update to reflect the above
18444         change. 
18445
18446         * Small changes to prepare for Array initialization.
18447
18448 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18449
18450         * typemanager.cs (ImplementsInterface): interface might be null;
18451         Deal with this problem;
18452
18453         Also, we do store negative hits on the cache (null values), so use
18454         this instead of calling t.GetInterfaces on the type everytime.
18455
18456 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18457
18458         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18459
18460         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18461         split functionality out into different classes.
18462
18463         (New::FormArrayType): Move into NewBuiltinArray.
18464
18465         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18466         quite useless.
18467
18468         (NewBuiltinArray): New class to handle creation of built-in arrays.
18469
18470         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18471         account creation of one-dimensional arrays.
18472
18473         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18474
18475         (NewUserdefinedArray::DoResolve): Implement.
18476
18477         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18478
18479         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18480         we maintain inside the TypeManager. This is necessary to perform lookups on the
18481         module builder.
18482
18483         (LookupType): Update to perform GetType on the module builders too.     
18484
18485         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18486
18487         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18488
18489 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18490
18491         * expression.cs (New::DoResolve): Implement guts of array creation.
18492
18493         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18494
18495 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18496
18497         * expression.cs: Fix bug I introduced lsat night that broke
18498         Delegates. 
18499
18500         (Expression.Resolve): Report a 246 error (can not resolve name)
18501         if we find a SimpleName in the stream.
18502
18503         (Expression.ResolveLValue): Ditto.
18504
18505         (Expression.ResolveWithSimpleName): This function is a variant of
18506         ResolveName, this one allows SimpleNames to be returned without a
18507         warning.  The only consumer of SimpleNames is MemberAccess
18508
18509 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18510
18511         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18512         might arrive here.  I have my doubts that this is correct.
18513
18514         * statement.cs (Lock): Implement lock statement.
18515
18516         * cs-parser.jay: Small fixes to support `lock' and `using'
18517
18518         * cs-tokenizer.cs: Remove extra space
18519
18520         * driver.cs: New flag --checked, allows to turn on integer math
18521         checking. 
18522
18523         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18524         Threading.Monitor.Exit 
18525
18526 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18527
18528         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18529         Expression Class to be IndexerAccess.
18530
18531         Notice that Indexer::DoResolve sets the eclass to Value.
18532
18533 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18534
18535         * class.cs (TypeContainer::Emit): Emit code for indexers.
18536
18537         * assign.cs (IAssignMethod): New interface implemented by Indexers
18538         and Properties for handling assignment.
18539
18540         (Assign::Emit): Simplify and reuse code. 
18541
18542         * expression.cs (IndexerAccess, PropertyExpr): Implement
18543         IAssignMethod, clean up old code. 
18544
18545 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18546
18547         * typemanager.cs (ImplementsInterface): New method to determine if a type
18548         implements a given interface. Provides a nice cache too.
18549
18550         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18551         method.
18552
18553         (ConvertReferenceExplicit): Ditto.
18554
18555         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18556         various methods, with correct names etc.
18557
18558         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18559         Operator.UnaryNegation.
18560
18561         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18562         we have a unary plus or minus operator.
18563
18564         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18565         UnaryMinus.
18566
18567         * everywhere : update accordingly.
18568
18569         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18570         respectively.
18571
18572         * class.cs (Method::Define): For the case where we are implementing a method
18573         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18574         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18575
18576 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18577
18578         * interface.cs (FindMembers): Implement to work around S.R.E
18579         lameness.
18580
18581         * typemanager.cs (IsInterfaceType): Implement.
18582
18583         (FindMembers): Update to handle interface types too.
18584
18585         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18586         use IsAssignableFrom as that is not correct - it doesn't work.
18587
18588         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18589         and accordingly override EmitStatement.
18590
18591         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18592         using the correct logic :-)
18593
18594 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18595
18596         * ../errors/cs-11.cs : Add to demonstrate error -11 
18597
18598 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18599
18600         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18601         then pass this as a hint to ResolveLValue.
18602
18603         * expression.cs (FieldExpr): Add Location information
18604
18605         (FieldExpr::LValueResolve): Report assignment to readonly
18606         variable. 
18607
18608         (Expression::ExprClassFromMemberInfo): Pass location information.
18609
18610         (Expression::ResolveLValue): Add new method that resolves an
18611         LValue. 
18612
18613         (Expression::DoResolveLValue): Default invocation calls
18614         DoResolve. 
18615
18616         (Indexers): New class used to keep track of indexers in a given
18617         Type. 
18618
18619         (IStackStore): Renamed from LValue, as it did not really describe
18620         what this did.  Also ResolveLValue is gone from this interface and
18621         now is part of Expression.
18622
18623         (ElementAccess): Depending on the element access type
18624
18625         * typemanager.cs: Add `indexer_name_type' as a Core type
18626         (System.Runtime.CompilerServices.IndexerNameAttribute)
18627
18628         * statement.cs (Goto): Take a location.
18629
18630 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18631
18632         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18633         if two delegates are compatible.
18634
18635         (NewDelegate::DoResolve): Update to take care of the case when
18636         we instantiate a delegate from another delegate.
18637
18638         * typemanager.cs (FindMembers): Don't even try to look up members
18639         of Delegate types for now.
18640
18641 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18642
18643         * delegate.cs (NewDelegate): New class to take care of delegate
18644         instantiation.
18645
18646         * expression.cs (New): Split the delegate related code out into 
18647         the NewDelegate class.
18648
18649         * delegate.cs (DelegateInvocation): New class to handle delegate 
18650         invocation.
18651
18652         * expression.cs (Invocation): Split out delegate related code into
18653         the DelegateInvocation class.
18654
18655 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18656
18657         * expression.cs (New::DoResolve): Implement delegate creation fully
18658         and according to the spec.
18659
18660         (New::DoEmit): Update to handle delegates differently.
18661
18662         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18663         because of which we were printing out arguments in reverse order !
18664
18665         * delegate.cs (VerifyMethod): Implement to check if the given method
18666         matches the delegate.
18667
18668         (FullDelegateDesc): Implement.
18669
18670         (VerifyApplicability): Implement.
18671
18672         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18673         delegate invocations too.
18674
18675         (Invocation::Emit): Ditto.
18676
18677         * ../errors/cs1593.cs : Added.
18678
18679         * ../errors/cs1594.cs : Added.
18680
18681         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18682
18683 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18684
18685         * typemanager.cs (intptr_type): Core type for System.IntPtr
18686
18687         (InitCoreTypes): Update for the same.
18688
18689         (iasyncresult_type, asynccallback_type): Ditto.
18690
18691         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18692         correct.
18693
18694         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18695         too.
18696
18697         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18698         the builders for the 4 members of a delegate type :-)
18699
18700         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18701         type.
18702
18703         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18704
18705         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18706
18707 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * statement.cs (Break::Emit): Implement.   
18710         (Continue::Emit): Implement.
18711
18712         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18713         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18714         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18715         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18716         end loop
18717
18718         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18719         properties that track the label for the current loop (begin of the
18720         loop and end of the loop).
18721
18722 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18723
18724         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18725         use of emitting anything at all.
18726
18727         * class.cs, rootcontext.cs : Get rid of calls to the same.
18728
18729         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18730
18731         (Populate): Define the constructor correctly and set the implementation
18732         attributes.
18733
18734         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18735         have been defined.
18736
18737         (AddDelegateType): Implement.
18738
18739         (IsDelegateType): Implement helper method.
18740
18741         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18742
18743         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18744         and accordingly handle it.
18745
18746         * delegate.cs (Populate): Take TypeContainer argument.
18747         Implement bits to define the Invoke method. However, I still haven't figured out
18748         how to take care of the native int bit :-(
18749
18750         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18751         Qualify the name of the delegate, not its return type !
18752
18753         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18754         conversion.
18755
18756         (StandardConversionExists): Checking for array types turns out to be recursive.
18757
18758         (ConvertReferenceExplicit): Implement array conversion.
18759
18760         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18761
18762 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18763
18764         * cs-parser.jay (delegate_declaration): Store the fully qualified
18765         name as it is a type declaration.
18766
18767         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18768         readonly.
18769
18770         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18771         as TypeContainer::DefineType.
18772
18773         (Populate): Method in which all the definition of the various methods (Invoke)
18774         etc is done.
18775
18776         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18777         see.
18778
18779         (CloseDelegate): Finally creates the delegate.
18780
18781         * class.cs (TypeContainer::DefineType): Update to define delegates.
18782         (Populate, Emit and CloseType): Do the same thing here too.
18783
18784         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18785         delegates in all these operations.
18786
18787 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18788
18789         * expression.cs: LocalTemporary: a new expression used to
18790         reference a temporary that has been created.
18791
18792         * assign.cs: Handle PropertyAccess back here, so that we can
18793         provide the proper semantic access to properties.
18794
18795         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18796         a few more explicit conversions. 
18797
18798         * modifiers.cs: `NEW' modifier maps to HideBySig.
18799
18800         * expression.cs (PropertyExpr): Make this into an
18801         ExpressionStatement, and support the EmitStatement code path. 
18802
18803         Perform get/set error checking, clean up the interface.
18804
18805         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18806         them into toplevel access objects.
18807
18808 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18811         SRE.
18812
18813         * typemanager.cs: Keep track here of our PropertyBuilders again to
18814         work around lameness in SRE.
18815
18816 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18817
18818         * expression.cs (LValue::LValueResolve): New method in the
18819         interface, used to perform a second resolution pass for LValues. 
18820
18821         (This::DoResolve): Catch the use of this in static methods.
18822
18823         (This::LValueResolve): Implement.
18824
18825         (This::Store): Remove warning, assigning to `this' in structures
18826         is 
18827
18828         (Invocation::Emit): Deal with invocation of
18829         methods on value types.  We need to pass the address to structure
18830         methods rather than the object itself.  (The equivalent code to
18831         emit "this" for structures leaves the entire structure on the
18832         stack instead of a pointer to it). 
18833
18834         (ParameterReference::DoResolve): Compute the real index for the
18835         argument based on whether the method takes or not a `this' pointer
18836         (ie, the method is static).
18837
18838         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18839         value types returned from functions when we need to invoke a
18840         method on the sturcture.
18841
18842
18843 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18844
18845         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18846         defining the type in the Modulebuilder or Typebuilder. This is to take
18847         care of nested types which need to be defined on the TypeBuilder using
18848         DefineNestedMethod.
18849
18850         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18851         methods in RootContext, only ported to be part of TypeContainer.
18852
18853         (TypeContainer::GetInterfaceOrClass): Ditto.
18854
18855         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18856
18857         * interface.cs (Interface::DefineInterface): New method. Does exactly
18858         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18859         too.
18860
18861         (Interface::GetInterfaces): Move from RootContext here and port.
18862
18863         (Interface::GetInterfaceByName): Same here.
18864
18865         * rootcontext.cs (ResolveTree): Re-write.
18866
18867         (PopulateTypes): Re-write.
18868
18869         * class.cs (TypeContainer::Populate): Populate nested types too.
18870         (TypeContainer::Emit): Emit nested members too.
18871
18872         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18873         instead just use the name argument passed in as it is already fully
18874         qualified.
18875
18876         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18877         to TypeContainer mapping to see if a type is user-defined.
18878
18879         * class.cs (TypeContainer::CloseType): Implement. 
18880
18881         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18882         the default constructor.
18883
18884         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18885         twice.
18886
18887         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18888
18889         * interface.cs (CloseType): Create the type here.
18890
18891         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18892         the hierarchy.
18893
18894         Remove all the methods which are now in TypeContainer.
18895
18896 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18897
18898         * delegate.cs (Define): Re-write bits to define the delegate
18899         correctly.
18900
18901 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18902
18903         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18904
18905         * expression.cs (ImplicitReferenceConversion): handle null as well
18906         as a source to convert to any reference type.
18907
18908         * statement.cs (Return): Perform any implicit conversions to
18909         expected return type.  
18910
18911         Validate use of return statement.  
18912
18913         * codegen.cs (EmitContext): Pass the expected return type here.
18914
18915         * class.cs (Method, Constructor, Property): Pass expected return
18916         type to EmitContext.
18917
18918 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18919
18920         * expression.cs: Make DoResolve take an EmitContext instead of a
18921         TypeContainer.
18922
18923         Replaced `l' and `location' for `loc', for consistency.
18924
18925         (Error, Warning): Remove unneeded Tc argument.
18926
18927         * assign.cs, literal.cs, constant.cs: Update to new calling
18928         convention. 
18929
18930         * codegen.cs: EmitContext now contains a flag indicating whether
18931         code is being generated in a static method or not.
18932
18933         * cs-parser.jay: DecomposeQI, new function that replaces the old
18934         QualifiedIdentifier.  Now we always decompose the assembled
18935         strings from qualified_identifier productions into a group of
18936         memberaccesses.
18937
18938 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18939
18940         * rootcontext.cs: Deal with field-less struct types correctly now
18941         by passing the size option to Define Type.
18942
18943         * class.cs: Removed hack that created one static field. 
18944
18945 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * statement.cs: Moved most of the code generation here. 
18948
18949 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18950
18951         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18952         seem very right.
18953
18954         (ElementAccess): Remove useless bits for now - keep checks as the spec
18955         says.
18956
18957 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18958
18959         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18960         and start performing checks according to the spec.
18961
18962 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18963
18964         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18965         rank_specifiers instead.
18966
18967         (rank_specifiers): Change the order in which the rank specifiers are stored
18968
18969         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18970
18971         * expression.cs (ElementAccess): Implement the LValue interface too.
18972
18973 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18974
18975         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18976         except that user defined conversions are not included.
18977
18978         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18979         perform the conversion of the return type, if necessary.
18980
18981         (New::DoResolve): Check whether we are creating an array or an object
18982         and accordingly do the needful.
18983
18984         (New::Emit): Same here.
18985
18986         (New::DoResolve): Implement guts of array creation.
18987
18988         (New::FormLookupType): Helper function.
18989
18990 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18991
18992         * codegen.cs: Removed most of the code generation here, and move the
18993         corresponding code generation bits to the statement classes. 
18994
18995         Added support for try/catch/finalize and throw.
18996
18997         * cs-parser.jay: Added support for try/catch/finalize.
18998
18999         * class.cs: Catch static methods having the flags override,
19000         virtual or abstract.
19001
19002         * expression.cs (UserCast): This user cast was not really doing
19003         what it was supposed to do.  Which is to be born in fully resolved
19004         state.  Parts of the resolution were being performed at Emit time! 
19005
19006         Fixed this code.
19007
19008 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * expression.cs: Implicity convert the result from UserCast.
19011
19012 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19013
19014         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19015         prevented it from working correctly. 
19016
19017         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19018         merely ConvertImplicit.
19019
19020 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19021
19022         * typemanager.cs: Make the LookupTypeContainer function static,
19023         and not per-instance.  
19024
19025         * class.cs: Make static FindMembers (the one that takes a Type
19026         argument). 
19027
19028         * codegen.cs: Add EmitForeach here.
19029
19030         * cs-parser.jay: Make foreach a toplevel object instead of the
19031         inline expansion, as we need to perform semantic analysis on it. 
19032
19033 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19034
19035         * expression.cs (Expression::ImplicitUserConversion): Rename to
19036         UserDefinedConversion.
19037
19038         (Expression::UserDefinedConversion): Take an extra argument specifying 
19039         whether we look for explicit user conversions too.
19040
19041         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19042
19043         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19044
19045         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19046         with the appropriate arguments.
19047
19048         * cs-parser.jay (cast_expression): Record location too.
19049
19050         * expression.cs (Cast): Record location info.
19051
19052         (Expression::ConvertExplicit): Take location argument.
19053
19054         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19055         to determine if we are doing explicit conversions.
19056
19057         (UserCast::Emit): Update accordingly.
19058
19059         (Expression::ConvertExplicit): Report an error if everything fails.
19060
19061         * ../errors/cs0030.cs : Add.
19062
19063 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19064
19065         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19066         virtual and newslot bits. 
19067
19068         * class.cs (TypeContainer::RegisterRequiredImplementations):
19069         Record methods we need.
19070
19071         (TypeContainer::MakeKey): Helper function to make keys for
19072         MethodBases, since the Methodbase key is useless.
19073
19074         (TypeContainer::Populate): Call RegisterRequiredImplementations
19075         before defining the methods.   
19076
19077         Create a mapping for method_builders_to_methods ahead of time
19078         instead of inside a tight loop.
19079
19080         (::RequireMethods):  Accept an object as the data to set into the
19081         hashtable so we can report interface vs abstract method mismatch.
19082
19083 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * report.cs: Make all of it static.
19086
19087         * rootcontext.cs: Drop object_type and value_type computations, as
19088         we have those in the TypeManager anyways.
19089
19090         Drop report instance variable too, now it is a global.
19091
19092         * driver.cs: Use try/catch on command line handling.
19093
19094         Add --probe option to debug the error reporting system with a test
19095         suite. 
19096
19097         * report.cs: Add support for exiting program when a probe
19098         condition is reached.
19099
19100 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19101
19102         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19103         we do a forcible conversion regardless of type, to check if 
19104         ForceConversion returns a null.
19105
19106         (Binary::error19): Use location to report error.
19107
19108         (Unary::error23): Use location here too.
19109
19110         * ../errors/cs0019.cs : Check in.
19111
19112         * ../errors/cs0023.cs : Check in.
19113
19114         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19115         case of a non-null MethodInfo object with a length of 0 !
19116
19117         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19118         an applicable member - according to the spec :-)
19119         Also fix logic to find members in base types.
19120
19121         (Unary::ResolveOperator): Same here.
19122
19123         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19124         as I was getting thoroughly confused between this and error19 :-)
19125
19126         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19127         (::FindMostEncompassedType): Implement.
19128         (::FindMostEncompassingType): Implement.
19129         (::StandardConversionExists): Implement.
19130
19131         (UserImplicitCast): Re-vamp. We now need info about most specific
19132         source and target types so that we can do the necessary conversions.
19133
19134         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19135         mathematical union with no duplicates.
19136
19137 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19138
19139         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19140         in order from base classes to child classes, so that we can in
19141         child classes look up in our parent for method names and
19142         attributes (required for handling abstract, virtual, new, override
19143         constructs: we need to instrospect our base class, and if we dont
19144         populate the classes in order, the introspection might be
19145         incorrect.  For example, a method could query its parent before
19146         the parent has any methods and would determine that the parent has
19147         no abstract methods (while it could have had them)).
19148
19149         (RootContext::CreateType): Record the order in which we define the
19150         classes.
19151
19152 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19153
19154         * class.cs (TypeContainer::Populate): Also method definitions can
19155         fail now, keep track of this.
19156
19157         (TypeContainer::FindMembers): Implement support for
19158         DeclaredOnly/noDeclaredOnly flag.
19159
19160         (Constructor::Emit) Return the ConstructorBuilder.
19161
19162         (Method::Emit) Return the MethodBuilder. 
19163         Check for abstract or virtual methods to be public.
19164
19165         * rootcontext.cs (RootContext::CreateType): Register all the
19166         abstract methods required for the class to be complete and the
19167         interface methods that must be implemented. 
19168
19169         * cs-parser.jay: Report error 501 (method requires body if it is
19170         not marked abstract or extern).
19171
19172         * expression.cs (TypeOf::Emit): Implement.
19173
19174         * typemanager.cs: runtime_handle_type, new global type.
19175
19176         * class.cs (Property::Emit): Generate code for properties.
19177
19178 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19179
19180         * expression.cs (Unary::ResolveOperator): Find operators on base type
19181         too - we now conform exactly to the spec.
19182
19183         (Binary::ResolveOperator): Same here.
19184
19185         * class.cs (Operator::Define): Fix minor quirk in the tests.
19186
19187         * ../errors/cs0215.cs : Added.
19188
19189         * ../errors/cs0556.cs : Added.
19190
19191         * ../errors/cs0555.cs : Added.
19192
19193 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19194
19195         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19196         single integer which is really efficient
19197
19198 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19199
19200         *  expression.cs (Expression::ImplicitUserConversion): Use location
19201         even in the case when we are examining True operators.
19202  
19203         * class.cs (Operator::Define): Perform extensive checks to conform
19204         with the rules for operator overloading in the spec.
19205
19206         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19207         some of the other conversions mentioned in the spec.
19208
19209         * typemanager.cs (array_type): New static member for the System.Array built-in
19210         type.
19211
19212         (cloneable_interface): For System.ICloneable interface.
19213
19214         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19215         we start resolving the tree and populating types.
19216
19217         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19218  
19219 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19220
19221         * expression.cs (Expression::ExprClassFromMemberInfo,
19222         Expression::Literalize): Create literal expressions from
19223         FieldInfos which are literals.
19224
19225         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19226         type casts, because they were wrong.  The test suite in tests
19227         caught these ones.
19228
19229         (ImplicitNumericConversion): ushort to ulong requires a widening
19230         cast. 
19231
19232         Int32 constant to long requires widening cast as well.
19233
19234         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19235         for integers because the type on the stack is not i4.
19236
19237 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19238
19239         * expression.cs (report118): require location argument. 
19240
19241         * parameter.cs: Do not dereference potential null value.
19242
19243         * class.cs: Catch methods that lack the `new' keyword when
19244         overriding a name.  Report warnings when `new' is used without
19245         anything being there to override.
19246
19247         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19248
19249         * class.cs: Only add constructor to hashtable if it is non-null
19250         (as now constructors can fail on define).
19251
19252         (TypeManager, Class, Struct): Take location arguments.
19253
19254         Catch field instance initialization in structs as errors.
19255
19256         accepting_filter: a new filter for FindMembers that is static so
19257         that we dont create an instance per invocation.
19258
19259         (Constructor::Define): Catch errors where a struct constructor is
19260         parameterless 
19261
19262         * cs-parser.jay: Pass location information for various new
19263         constructs. 
19264
19265         * delegate.cs (Delegate): take a location argument.
19266
19267         * driver.cs: Do not call EmitCode if there were problesm in the
19268         Definition of the types, as many Builders wont be there. 
19269
19270         * decl.cs (Decl::Decl): Require a location argument.
19271
19272         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19273         into integers, and find the most appropiate integer for it.
19274
19275         * literal.cs: Implement ULongLiteral.
19276
19277         * rootcontext.cs: Provide better information about the location of
19278         failure when CreateType fails.
19279
19280 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19281
19282         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19283         as well.
19284
19285         * expression.cs (Binary::CheckShiftArguments): Add missing type
19286         computation.
19287         (Binary::ResolveOperator): Add type to the logical and and logical
19288         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19289         before.
19290
19291         (Binary::DoNumericPromotions): In the case where either argument
19292         is ulong (and most signed types combined with ulong cause an
19293         error) perform implicit integer constant conversions as well.
19294
19295 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19296
19297         * expression.cs (UserImplicitCast): Method should always be
19298         non-null. 
19299         (Invocation::BetterConversion): Simplified test for IntLiteral.
19300
19301         (Expression::ImplicitNumericConversion): Split this routine out.
19302         Put the code that performs implicit constant integer conversions
19303         here. 
19304
19305         (Expression::Resolve): Become a wrapper around DoResolve so we can
19306         check eclass and type being set after resolve.
19307
19308         (Invocation::Badness): Remove this dead function
19309
19310         (Binary::ResolveOperator): Do not compute the expensive argumnets
19311         unless we have a union for it.
19312
19313         (Probe::Emit): Is needs to do an isinst and then
19314         compare against null.
19315
19316         (::CanConvert): Added Location argument.  If the Location argument
19317         is null (Location.Null), then we do not report errors.  This is
19318         used by the `probe' mechanism of the Explicit conversion.  We do
19319         not want to generate an error for something that the user
19320         explicitly requested to be casted.  But the pipeline for an
19321         explicit cast first tests for potential implicit casts.
19322
19323         So for now, if the Location is null, it means `Probe only' to
19324         avoid adding another argument.   Might have to revise this
19325         strategy later.
19326
19327         (ClassCast): New class used to type cast objects into arbitrary
19328         classes (used in Explicit Reference Conversions).
19329
19330         Implement `as' as well.
19331
19332         Reverted all the patches from Ravi below: they were broken:
19333
19334                 * The use of `level' as a mechanism to stop recursive
19335                   invocations is wrong.  That was there just to catch the
19336                   bug with a strack trace but not as a way of addressing
19337                   the problem.
19338
19339                   To fix the problem we have to *understand* what is going
19340                   on and the interactions and come up with a plan, not
19341                   just get things going.
19342
19343                 * The use of the type conversion cache that I proposed
19344                   last night had an open topic: How does this work across
19345                   protection domains.  A user defined conversion might not
19346                   be public in the location where we are applying the
19347                   conversion, a different conversion might be selected
19348                   (ie, private A->B (better) but public B->A (worse),
19349                   inside A, A->B applies, but outside it, B->A will
19350                   apply).
19351
19352                 * On top of that (ie, even if the above is solved),
19353                   conversions in a cache need to be abstract.  Ie, `To
19354                   convert from an Int to a Short use an OpcodeCast', not
19355                   `To convert from an Int to a Short use the OpcodeCast on
19356                   the variable 5' (which is what this patch was doing).
19357
19358 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19359
19360         * expression.cs (Invocation::ConversionExists): Re-write to use
19361         the conversion cache
19362
19363         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19364         cache all conversions done, not just user-defined ones.
19365
19366         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19367         to determine if a conversion exists instead of acutually trying to 
19368         perform the conversion. It's faster too.
19369
19370         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19371         and only then attempt the implicit conversion.
19372
19373 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19374
19375         * expression.cs (ConvertImplicit): Use a cache for conversions
19376         already found. Check level of recursion and bail out if necessary.
19377
19378 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19379
19380         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19381         Export standard methods that we expect for string operations.
19382
19383         * statement.cs (Block::UsageWarning): Track usage of variables and
19384         report the errors for not used variables.
19385
19386         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19387         operator. 
19388
19389 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19390
19391         * codegen.cs: remove unnneded code 
19392
19393         * expression.cs: Removed BuiltinTypeAccess class
19394
19395         Fix the order in which implicit conversions are
19396         done.  
19397
19398         The previous fixed dropped support for boxed conversions (adding a
19399         test to the test suite now)
19400
19401         (UserImplicitCast::CanConvert): Remove test for source being null,
19402         that code is broken.  We should not feed a null to begin with, if
19403         we do, then we should track the bug where the problem originates
19404         and not try to cover it up here.
19405
19406         Return a resolved expression of type UserImplicitCast on success
19407         rather than true/false.  Ravi: this is what I was talking about,
19408         the pattern is to use a static method as a "constructor" for
19409         objects. 
19410
19411         Also, do not create arguments until the very last minute,
19412         otherwise we always create the arguments even for lookups that
19413         will never be performed. 
19414
19415         (UserImplicitCast::Resolve): Eliminate, objects of type
19416         UserImplicitCast are born in a fully resolved state. 
19417
19418         * typemanager.cs (InitCoreTypes): Init also value_type
19419         (System.ValueType). 
19420
19421         * expression.cs (Cast::Resolve): First resolve the child expression.
19422
19423         (LValue): Add new method AddressOf to be used by
19424         the `&' operator.  
19425
19426         Change the argument of Store to take an EmitContext instead of an
19427         ILGenerator, because things like FieldExpr need to be able to call
19428         their children expression to generate the instance code. 
19429
19430         (Expression::Error, Expression::Warning): Sugar functions for
19431         reporting errors.
19432
19433         (Expression::MemberLookup): Accept a TypeContainer instead of a
19434         Report as the first argument.
19435
19436         (Expression::ResolvePrimary): Killed.  I still want to improve
19437         this as currently the code is just not right.
19438
19439         (Expression::ResolveMemberAccess): Simplify, but it is still
19440         wrong. 
19441
19442         (Unary::Resolve): Catch errors in AddressOf operators.
19443
19444         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19445         index to a byte for the short-version, or the compiler will choose
19446         the wrong Emit call, which generates the wrong data.
19447
19448         (ParameterReference::Emit, ::Store): same.
19449
19450         (FieldExpr::AddressOf): Implement.
19451
19452         * typemanager.cs: TypeManager: made public variable instead of
19453         property.
19454
19455         * driver.cs: document --fatal.
19456
19457         * report.cs (ErrorMessage, WarningMessage): new names for the old
19458         Error and Warning classes.
19459
19460         * cs-parser.jay (member_access): Turn built-in access to types
19461         into a normal simplename
19462
19463 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19464
19465         * expression.cs (Invocation::BetterConversion): Fix to cope
19466         with q being null, since this was introducing a bug.
19467
19468         * expression.cs (ConvertImplicit): Do built-in conversions first.
19469
19470 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19471
19472         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19473
19474 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19475
19476         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19477         I had introduced long ago (what's new ?).
19478
19479         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19480         the work of all the checking. 
19481         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19482         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19483
19484         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19485         that is the right way. 
19486
19487         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19488         overloading resolution. Use everywhere instead of cutting and pasting code.
19489
19490         (Binary::ResolveOperator): Use MakeUnionSet.
19491
19492         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19493         we have to convert to bool types. Not complete yet.
19494
19495 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19496
19497         * typemanager.cs (TypeManager::CSharpName): support ushort.
19498
19499         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19500         to provide an expression that performsn an implicit constant int
19501         conversion (section 6.1.6).
19502         (Expression::ConvertImplicitRequired): Reworked to include
19503         implicit constant expression conversions.
19504
19505         (Expression::ConvertNumericExplicit): Finished.
19506
19507         (Invocation::Emit): If InstanceExpression is null, then it means
19508         that we perform a call on this.
19509
19510 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * expression.cs (Unary::Emit): Remove some dead code.
19513         (Probe): Implement Resolve and Emit for `is'.
19514         (Expression::ConvertImplicitRequired): Attempt to do constant
19515         expression conversions here.  Maybe should be moved to
19516         ConvertImplicit, but I am not sure.
19517         (Expression::ImplicitLongConstantConversionPossible,
19518         Expression::ImplicitIntConstantConversionPossible): New functions
19519         that tell whether is it possible to apply an implicit constant
19520         expression conversion.
19521
19522         (ConvertNumericExplicit): Started work on explicit numeric
19523         conversions.
19524
19525         * cs-parser.jay: Update operator constants.
19526
19527         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19528         (Parameters::GetSignature): Hook up VerifyArgs here.
19529         (Parameters::VerifyArgs): Verifies that no two arguments have the
19530         same name. 
19531
19532         * class.cs (Operator): Update the operator names to reflect the
19533         ones that the spec expects (as we are just stringizing the
19534         operator names).
19535
19536         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19537         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19538         previous usage did only work for our methods.
19539         (Expression::ConvertImplicit): Handle decimal implicit numeric
19540         conversions as well.
19541         (Expression::InternalTypeConstructor): Used to invoke constructors
19542         on internal types for default promotions.
19543
19544         (Unary::Emit): Implement special handling for the pre/post
19545         increment/decrement for overloaded operators, as they need to have
19546         the same semantics as the other operators.
19547
19548         (Binary::ResolveOperator): ditto.
19549         (Invocation::ConversionExists): ditto.
19550         (UserImplicitCast::Resolve): ditto.
19551
19552 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19553
19554         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19555         operator, return after emitting body. Regression tests pass again !
19556
19557         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19558         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19559         (Invocation::OverloadResolve): Ditto.
19560         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19561
19562         * everywhere : update calls to the above methods accordingly.
19563
19564 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19567
19568         * expression.cs (ExpressionStatement): New base class used for
19569         expressions that can appear in statements, so that we can provide
19570         an alternate path to generate expression that do not leave a value
19571         on the stack.
19572
19573         (Expression::Emit, and all the derivatives): We no longer return
19574         whether a value is left on the stack or not.  Every expression
19575         after being emitted leaves a single value on the stack.
19576
19577         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19578         facilties of ExpressionStatement if possible.
19579
19580         * cs-parser.jay: Update statement_expression.
19581
19582 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19583
19584         * driver.cs: Change the wording of message
19585
19586 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19587
19588         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19589         the type of the expression to the return type of the method if
19590         we have an overloaded operator match ! The regression tests pass again !
19591         (Unary::ResolveOperator): Ditto.
19592
19593         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19594         to find "op_Implicit", not "implicit" ;-)
19595         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19596         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19597
19598         * everywhere : Correct calls to the above accordingly.
19599
19600         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19601         (ConvertImplicit): Do user-defined conversion if it exists.
19602
19603 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19604
19605         * assign.cs: track location.
19606         (Resolve): Use implicit conversions on assignment.
19607
19608         * literal.cs: Oops.  Not good, Emit of short access values should
19609         pass (Bytes) or the wrong argument will be selected.
19610
19611         * expression.cs (Unary::Emit): Emit code for -expr.
19612
19613         (Unary::ResolveOperator): Handle `Substract' for non-constants
19614         (substract from zero from the non-constants).
19615         Deal with Doubles as well. 
19616
19617         (Expression::ConvertImplicitRequired): New routine that reports an
19618         error if no implicit conversion exists. 
19619
19620         (Invocation::OverloadResolve): Store the converted implicit
19621         expressions if we make them
19622
19623 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19624
19625         * class.cs (ConstructorInitializer): Take a Location argument.
19626         (ConstructorBaseInitializer): Same here.
19627         (ConstructorThisInitializer): Same here.
19628
19629         * cs-parser.jay : Update all calls accordingly.
19630
19631         * expression.cs (Unary, Binary, New): Take location argument.
19632         Update accordingly everywhere.
19633
19634         * cs-parser.jay : Update all calls to the above to take a location
19635         argument.
19636
19637         * class.cs : Ditto.
19638
19639 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19640
19641         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19642         (Invocation::BetterConversion): Same here
19643         (Invocation::ConversionExists): Ditto.
19644
19645         (Invocation::ConversionExists): Implement.
19646
19647 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19648
19649         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19650         Also take an additional TypeContainer argument.
19651
19652         * All over : Pass in TypeContainer as argument to OverloadResolve.
19653
19654         * typemanager.cs (CSharpName): Update to check for the string type and return
19655         that too.
19656
19657         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19658         a given method.
19659
19660 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19661
19662         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19663         (Invocation::BetterFunction): Implement.
19664         (Invocation::BetterConversion): Implement.
19665         (Invocation::ConversionExists): Skeleton, no implementation yet.
19666
19667         Okay, things work fine !
19668
19669 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19670
19671         * typemanager.cs: declare and load enum_type, delegate_type and
19672         void_type. 
19673
19674         * expression.cs (Expression::Emit): Now emit returns a value that
19675         tells whether a value is left on the stack or not.  This strategy
19676         might be reveted tomorrow with a mechanism that would address
19677         multiple assignments.
19678         (Expression::report118): Utility routine to report mismatches on
19679         the ExprClass.
19680
19681         (Unary::Report23): Report impossible type/operator combination
19682         utility function.
19683
19684         (Unary::IsIncrementableNumber): Whether the type can be
19685         incremented or decremented with add.
19686         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19687         complemented. 
19688         (Unary::ResolveOperator): Implement ++, !, ~,
19689
19690         (Invocation::Emit): Deal with new Emit convetion.
19691
19692         * All Expression derivatives: Updated their Emit method to return
19693         whether they leave values on the stack or not.
19694
19695         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19696         stack for expressions that are statements. 
19697
19698 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19699
19700         * expression.cs (LValue): New interface.  Must be implemented by
19701         LValue objects.
19702         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19703         LValue interface.
19704
19705         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19706         interface for generating code, simplifies the code.
19707
19708 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19709
19710         * expression.cs (everywhere): Comment out return statements in ::Resolve
19711         methods to avoid the warnings.
19712
19713 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * driver.cs (parse): Report error 2001 if we can not open the
19716         source file.
19717
19718         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19719         not resolve it.
19720
19721         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19722         object. 
19723
19724         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19725         otherwise nested blocks end up with the same index.
19726
19727         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19728
19729         * expression.cs:  Instead of having FIXMEs in the Resolve
19730         functions, throw exceptions so it is obvious that we are facing a
19731         bug. 
19732
19733         * cs-parser.jay (invocation_expression): Pass Location information.
19734
19735         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19736         Use a basename for those routines because .NET does not like paths
19737         on them. 
19738
19739         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19740         already defined.
19741
19742 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19743
19744         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19745         are loading the correct data types (throws an exception if not).
19746         (TypeManager::InitCoreTypes): Use CoreLookupType
19747
19748         * expression.cs (Unary::ResolveOperator): return the child
19749         expression for expressions which are just +expr.
19750         (Unary::ResolveOperator): Return negative literals for -LITERAL
19751         expressions (otherwise they are Unary {Literal}).
19752         (Invocation::Badness): Take into account `Implicit constant
19753         expression conversions'.
19754
19755         * literal.cs (LongLiteral): Implement long literal class.
19756         (IntLiteral): export the `Value' of the intliteral. 
19757
19758 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19759
19760         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19761
19762         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19763         instead of 'Operator'
19764
19765         * expression.cs (Binary::ResolveOperator): Update accordingly.
19766         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19767         and 'Minus'
19768
19769         * cs-parser.jay (unary_expression): Update to use the new names.
19770
19771         * gen-treedump.cs (GetUnary): Same here.
19772
19773         * expression.cs (Unary::Resolve): Implement.
19774         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19775         operators are found instead of making noise ;-)
19776         (Unary::ResolveOperator): New method to do precisely the same thing which
19777         Binary::ResolveOperator does for Binary expressions.
19778         (Unary.method, .Arguments): Add.
19779         (Unary::OperName): Implement.   
19780         (Unary::ForceConversion): Copy and Paste !
19781
19782         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19783         a unary operator.
19784
19785         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19786         for the inbuilt operators. Only overloading works for now ;-)
19787
19788 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19791         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19792
19793         * expression.cs (This::Emit): Implement. 
19794         (This::Resolve): Implement.
19795         (TypeOf:Resolve): Implement.
19796         (Expression::ResolveSimpleName): Add an implicit this to instance
19797         field references. 
19798         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19799         Bind instance variable to Field expressions.
19800         (FieldExpr::Instance): New field used to track the expression that
19801         represents the object instance.
19802         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19803         binding 
19804         (FieldExpr::Emit): Implement.
19805
19806         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19807         the last instruction contains a return opcode to avoid generating
19808         the last `ret' instruction (this generates correct code, and it is
19809         nice to pass the peverify output).
19810
19811         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19812         initializer for static and instance variables.
19813         (Constructor::Emit): Allow initializer to be null in the case of
19814         static constructors.  Only emit initializer for instance
19815         constructors. 
19816
19817         (TypeContainer::FindMembers): Return a null array if there are no
19818         matches.
19819
19820         Also fix the code for the MemberTypes.Method branch, as it was not
19821         scanning that for operators (or tried to access null variables before).
19822
19823         * assign.cs (Assign::Emit): Handle instance and static fields. 
19824
19825         * TODO: Updated.
19826
19827         * driver.cs: Stop compilation if there are parse errors.
19828
19829         * cs-parser.jay (constructor_declaration): Provide default base
19830         initializer for non-static constructors.
19831         (constructor_declarator): Do not provide a default base
19832         initializers if none was specified.
19833         Catch the fact that constructors should not have parameters.
19834
19835         * class.cs: Do not emit parent class initializers for static
19836         constructors, that should be flagged as an error.
19837
19838 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19839
19840         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19841         Move back code into TypeContainer::Populate.
19842
19843 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19844
19845         * class.cs (TypeContainer::AddConstructor): Fix the check to
19846         compare against Name, not Basename. 
19847         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19848
19849         * cs-parser.jay : Update accordingly.
19850
19851         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19852         for methods, don't forget to look into the operators too.
19853         (RegisterMethodBuilder): Helper method to take care of this for
19854         methods, constructors and operators.
19855         (Operator::Define): Completely revamp.
19856         (Operator.OperatorMethod, MethodName): New fields.
19857         (TypeContainer::Populate): Move the registering of builders into
19858         RegisterMethodBuilder.
19859         (Operator::Emit): Re-write.
19860
19861         * expression.cs (Binary::Emit): Comment out code path to emit method
19862         invocation stuff for the case when we have a user defined operator. I am
19863         just not able to get it right !
19864
19865 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19866
19867         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19868         argument. 
19869
19870         (Expression::MemberLookup): Provide a version that allows to
19871         specify the MemberTypes and BindingFlags. 
19872
19873         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19874         so it was not fetching variable information from outer blocks.
19875
19876         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19877         Beforefieldinit as it was buggy.
19878
19879         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19880         that Ravi put here.  
19881
19882         * class.cs (Constructor::Emit): Only emit if block is not null.
19883         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19884         deal with this by semantically definining it as if the user had
19885         done it.
19886
19887         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19888         constructors as we now "emit" them at a higher level.
19889
19890         (TypeContainer::DefineDefaultConstructor): Used to define the
19891         default constructors if none was provided.
19892
19893         (ConstructorInitializer): Add methods Resolve and Emit. 
19894
19895         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19896
19897 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19898
19899         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19900         the default constructor builder with our hashtable for methodbuilders
19901         to methodcores.
19902
19903         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19904         and argument_count is 0 in which case we have a match.
19905         (Binary::ResolveOperator): More null checking and miscellaneous coding
19906         style cleanup.
19907
19908 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19909
19910         * rootcontext.cs (IsNameSpace): Compare against null.
19911
19912         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19913
19914         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19915         and Unary::Operator.
19916
19917         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19918         accordingly.
19919
19920         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19921         we have overloaded operators.
19922         (Binary::ResolveOperator): Implement the part which does the operator overload
19923         resolution.
19924
19925         * class.cs (Operator::Emit): Implement.
19926         (TypeContainer::Emit): Emit the operators we have too.
19927
19928         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19929         the case when we have a user-defined operator.
19930
19931 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19932
19933         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19934
19935 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19936
19937         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19938         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19939         (Constructor::Emit): Implement.
19940         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19941         if we have no work to do. 
19942         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19943         Emit method.
19944
19945         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19946         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19947
19948         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19949         of parent.parent.
19950
19951 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19952
19953         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19954         in the source.
19955         (Tree::RecordNamespace): Method to do what the name says ;-)
19956         (Tree::Namespaces): Property to get at the namespaces hashtable.
19957
19958         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19959         keep track.
19960
19961         * rootcontext.cs (IsNamespace): Fixed it :-)
19962
19963 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19964
19965         * class.cs (TypeContainer::FindMembers): Add support for
19966         constructors. 
19967         (MethodCore): New class that encapsulates both the shared aspects
19968         of a Constructor and a Method.  
19969         (Method, Constructor): Factored pieces into MethodCore.
19970
19971         * driver.cs: Added --fatal which makes errors throw exceptions.
19972         Load System assembly as well as part of the standard library.
19973
19974         * report.cs: Allow throwing exceptions on errors for debugging.
19975
19976         * modifiers.cs: Do not use `parent', instead use the real type
19977         container to evaluate permission settings.
19978
19979         * class.cs: Put Ravi's patch back in.  He is right, and we will
19980         have to cope with the
19981
19982 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19983
19984         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19985         FamORAssem, not FamANDAssem.
19986
19987 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * driver.cs: Added --parse option that only parses its input files
19990         and terminates.
19991
19992         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19993         incorrect.  IsTopLevel is not used to tell whether an object is
19994         root_types or not (that can be achieved by testing this ==
19995         root_types).  But to see if this is a top-level *class* (not
19996         necessarly our "toplevel" container). 
19997
19998 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19999
20000         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20001         parent instead of a direct call to GetType.
20002
20003 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20004
20005         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20006         Modifiers.TypeAttr. This should just be a call to that method.
20007
20008         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20009         object so that we can determine if we are top-level or not.
20010
20011         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20012         TypeContainer too.
20013
20014         * enum.cs (Enum::Define): Ditto.
20015
20016         * modifiers.cs (FieldAttr): Re-write.
20017
20018         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20019         (TypeContainer::HaveStaticConstructor): New property to provide access
20020         to precisely that info.
20021
20022         * modifiers.cs (MethodAttr): Re-write.
20023         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20024
20025         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20026         of top-level types as claimed.
20027
20028 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * expression.cs (MemberLookup): Fruitless attempt to lookup
20031         constructors.  Maybe I need to emit default constructors?  That
20032         might be it (currently .NET emits this for me automatically).
20033         (Invocation::OverloadResolve): Cope with Arguments == null.
20034         (Invocation::EmitArguments): new function, shared by the new
20035         constructor and us.
20036         (Invocation::Emit): Handle static and instance methods.  Emit
20037         proper call instruction for virtual or non-virtual invocations.
20038         (New::Emit): Implement.
20039         (New::Resolve): Implement.
20040         (MemberAccess:Resolve): Implement.
20041         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20042         to track instances.
20043         (FieldExpr::Resolve): Set type.
20044
20045         * support.cs: Handle empty arguments.
20046                 
20047         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20048         SimpleLookup): Auxiliary routines to help parse a qualifier
20049         identifier.  
20050
20051         Update qualifier_identifier rule.
20052
20053         * codegen.cs: Removed debugging messages.
20054
20055         * class.cs: Make this a global thing, this acts just as a "key" to
20056         objects that we might have around.
20057
20058         (Populate): Only initialize method_builders_to_methods once.
20059
20060         * expression.cs (PropertyExpr): Initialize type from the
20061         PropertyType. 
20062
20063         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20064         Resolve pattern.  Attempt to implicitly convert value to boolean.
20065         Emit code.
20066
20067         * expression.cs: Set the type for the int32/int32 argument case.
20068         (Binary::ResolveOperator): Set the return type to boolean for
20069         comparission operators
20070
20071         * typemanager.cs: Remove debugging print code.
20072
20073         (Invocation::Resolve): resolve type.
20074
20075         * class.cs: Allocate a MemberInfo of the correct size, as the code
20076         elsewhere depends on the test to reflect the correct contents.
20077
20078         (Method::) Keep track of parameters, due to System.Reflection holes
20079
20080         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20081         mapping here.
20082
20083         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20084         of the exact size and return that.
20085
20086         (Class::LookupMethodByBuilder): New function that maps
20087         MethodBuilders to its methods.  Required to locate the information
20088         on methods because System.Reflection bit us again.
20089
20090         * support.cs: New file, contains an interface ParameterData and
20091         two implementations: ReflectionParameters and InternalParameters
20092         used to access Parameter information.  We will need to grow this
20093         as required.
20094
20095         * expression.cs (Invocation::GetParameterData): implement a cache
20096         and a wrapper around the ParameterData creation for methods. 
20097         (Invocation::OverloadResolve): Use new code.
20098
20099 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20100
20101         * class.cs (TypeContainer::EmitField): Remove and move into 
20102         (Field::Define): here and modify accordingly.
20103         (Field.FieldBuilder): New member.
20104         (TypeContainer::Populate): Update accordingly.
20105         (TypeContainer::FindMembers): Implement.
20106
20107 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20108
20109         * statement.cs: (VariableInfo::VariableType): New field to be
20110         initialized with the full type once it is resolved. 
20111
20112 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20113
20114         * parameter.cs (GetParameterInfo): Use a type cache to compute
20115         things only once, and to reuse this information
20116
20117         * expression.cs (LocalVariableReference::Emit): Implement.
20118         (OpcodeCast::Emit): fix.
20119
20120         (ParameterReference::Resolve): Implement.
20121         (ParameterReference::Emit): Implement.
20122
20123         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20124         that are expressions need to stay as Expressions.
20125
20126         * typemanager.cs (CSharpName): Returns the C# name of a type if
20127         possible. 
20128
20129         * expression.cs (Expression::ConvertImplicit): New function that
20130         implements implicit type conversions.
20131
20132         (Expression::ImplicitReferenceConversion): Implements implicit
20133         reference conversions.
20134
20135         (EmptyCast): New type for transparent casts.
20136
20137         (OpcodeCast): New type for casts of types that are performed with
20138         a sequence of bytecodes.
20139
20140         (BoxedCast): New type used for casting value types into reference
20141         types.  Emits a box opcode.
20142
20143         (Binary::DoNumericPromotions): Implements numeric promotions of
20144         and computation of the Binary::Type.
20145
20146         (Binary::EmitBranchable): Optimization.
20147
20148         (Binary::Emit): Implement code emission for expressions.
20149
20150         * typemanager.cs (TypeManager): Added two new core types: sbyte
20151         and byte.
20152
20153 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20154
20155         * class.cs (TypeContainer::FindMembers): Method which does exactly
20156         what Type.FindMembers does, only we don't have to use reflection. No
20157         implementation yet.
20158
20159         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20160         typecontainer objects as we need to get at them.
20161         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20162
20163         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20164         typecontainer object.
20165
20166         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20167         of just a Report object.
20168
20169 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20170
20171         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20172         "remove_"
20173         (TypeContainer::Populate): Now define the delegates of the type too.
20174         (TypeContainer.Delegates): Property to access the list of delegates defined
20175         in the type.
20176
20177         * delegates.cs (Delegate::Define): Implement partially.
20178
20179         * modifiers.cs (TypeAttr): Handle more flags.
20180
20181 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20182
20183         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20184         and not <=
20185         (Operator::Define): Re-write logic to get types by using the LookupType method
20186         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20187         (Indexer::Define): Ditto.
20188         (Event::Define): Ditto.
20189         (Property::Define): Ditto.
20190
20191 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20192
20193         * class.cs (TypeContainer::Populate): Now define operators too. 
20194         (TypeContainer.Operators): New property to access the list of operators
20195         in a type.
20196         (Operator.OperatorMethodBuilder): New member to hold the method builder
20197         for the operator we are defining.
20198         (Operator::Define): Implement.
20199
20200 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20201
20202         * class.cs (Event::Define): Make the prefixes of the accessor methods
20203         addOn_ and removeOn_ 
20204
20205         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20206         of the location being passed in too. Ideally, this should go later since all
20207         error reporting should be done through the Report object.
20208
20209         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20210         (Populate): Iterate thru the indexers we have and define them too.
20211         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20212         for the get and set accessors.
20213         (Indexer::Define): Implement.
20214
20215 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20216
20217         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20218         my previous implementation, did not work.
20219
20220         * typemanager.cs: Add a couple of missing types (the longs).
20221
20222         * literal.cs: Use TypeManager.bool_type instead of getting it.
20223
20224         * expression.cs (EventExpr): New kind of expressions.
20225         (Expressio::ExprClassFromMemberInfo): finish
20226
20227 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20228
20229         * assign.cs: Emit stores to static fields differently.
20230
20231 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20232
20233         * Merge in changes and adjust code to tackle conflicts. Backed out my
20234         code in Assign::Resolve ;-) 
20235
20236 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20237
20238         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20239         instead Report.Error and also pass in the location.
20240         (CSharpParser::Lexer): New readonly property to return the reference
20241         to the Tokenizer object.
20242         (declare_local_variables): Use Report.Error with location instead of plain 
20243         old error.
20244         (CheckDef): Ditto.
20245
20246         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20247         (Operator.CheckBinaryOperator): Ditto.
20248
20249         * cs-parser.jay (operator_declarator): Update accordingly.
20250
20251         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20252         (CheckBinaryOperator): Same here.
20253
20254         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20255         on the name without any prefixes of namespace names etc. This is because we
20256         already might have something already fully qualified like 
20257         'System.Console.WriteLine'
20258
20259         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20260
20261 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20262
20263         * cs-tokenizer.cs (location): Return a string which also contains
20264         the file name.
20265
20266         * expression.cs (ElementAccess): New class for expressions of the
20267         type 'element access.'
20268         (BaseAccess): New class for expressions of the type 'base access.'
20269         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20270         respectively.
20271
20272         * cs-parser.jay (element_access): Implement action.
20273         (base_access): Implement actions.
20274         (checked_expression, unchecked_expression): Implement.
20275
20276         * cs-parser.jay (local_variable_type): Correct and implement.
20277         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20278
20279         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20280
20281         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20282         name and the specifiers.
20283
20284         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20285
20286         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20287         making them all public ;-)
20288
20289         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20290         class anyways.
20291
20292 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20293
20294         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20295         PropertyExprs.
20296         (FieldExpr, PropertyExprs): New resolved expressions.
20297         (SimpleName::MemberStaticCheck): Perform static checks for access
20298         to non-static fields on static methods. Maybe this should be
20299         generalized for MemberAccesses. 
20300         (SimpleName::ResolveSimpleName): More work on simple name
20301         resolution. 
20302
20303         * cs-parser.jay (primary_expression/qualified_identifier): track
20304         the parameter index.
20305
20306         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20307         (EmitContext::EmitBoolExpression): Chain to expression generation
20308         instead of temporary hack.
20309         (::EmitStatementExpression): Put generic expression code generation.
20310
20311         * assign.cs (Assign::Emit): Implement variable assignments to
20312         local variables, parameters and fields.
20313
20314 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20315
20316         * statement.cs (Block::GetVariableInfo): New method, returns the
20317         VariableInfo for a variable name in a block.
20318         (Block::GetVariableType): Implement in terms of GetVariableInfo
20319
20320         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20321         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20322
20323 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20324
20325         * cs-parser.jay (operator_declaration): Continue on my quest : update
20326         to take attributes argument.
20327         (event_declaration): Ditto.
20328         (enum_declaration): Ditto.
20329         (indexer_declaration): Ditto.
20330
20331         * class.cs (Operator::Operator): Update constructor accordingly.
20332         (Event::Event): Ditto.
20333
20334         * delegate.cs (Delegate::Delegate): Same here.
20335
20336         * enum.cs (Enum::Enum): Same here.
20337
20338 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20339
20340         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20341
20342         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20343
20344         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20345         being passed around as an arraylist.
20346         (Attributes::AddAttribute): Method to add attribute sections.
20347
20348         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20349         (struct_declaration): Update accordingly.
20350         (constant_declaration): Update.
20351         (field_declaration): Update.
20352         (method_header): Update.
20353         (fixed_parameter): Update.
20354         (parameter_array): Ditto.
20355         (property_declaration): Ditto.
20356         (destructor_declaration): Ditto.
20357
20358         * class.cs (Struct::Struct): Update constructors accordingly.
20359         (Class::Class): Ditto.
20360         (Field::Field): Ditto.
20361         (Method::Method): Ditto.
20362         (Property::Property): Ditto.
20363         (TypeContainer::OptAttribute): update property's return type.
20364
20365         * interface.cs (Interface.opt_attributes): New member.
20366         (Interface::Interface): Update to take the extra Attributes argument.
20367
20368         * parameter.cs (Parameter::Parameter): Ditto.
20369
20370         * constant.cs (Constant::Constant): Ditto.
20371
20372         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20373         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20374         the attributes as a parameter.
20375         (InterfaceProperty): Update constructor call.
20376         (InterfaceEvent): Ditto.
20377         (InterfaceMethod): Ditto.
20378         (InterfaceIndexer): Ditto.
20379
20380         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20381         pass the attributes too.
20382         (interface_event_declaration): Ditto.
20383         (interface_property_declaration): Ditto.
20384         (interface_method_declaration): Ditto.
20385         (interface_declaration): Ditto.
20386
20387 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20388
20389         * class.cs (Method::Define): Track the "static Main" definition to
20390         create an entry point. 
20391
20392         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20393         EntryPoint if we find it. 
20394
20395         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20396         (EmitContext::ig): Make this variable public.
20397
20398         * driver.cs: Make the default output file be the first file name
20399         with the .exe extension.  
20400
20401         Detect empty compilations
20402
20403         Handle various kinds of output targets.  Handle --target and
20404         rename -t to --dumper.
20405
20406         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20407         methods inherited from Expression return now an Expression.  This
20408         will is used during the tree rewriting as we resolve them during
20409         semantic analysis.
20410
20411         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20412         the spec.  Missing entirely is the information about
20413         accessability of elements of it.
20414
20415         (Expression::ExprClassFromMemberInfo): New constructor for
20416         Expressions that creates a fully initialized Expression based on
20417         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20418         a Type.
20419
20420         (Invocation::Resolve): Begin implementing resolution of invocations.
20421
20422         * literal.cs (StringLiteral):  Implement Emit.
20423
20424 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20425
20426         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20427         member.
20428
20429 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20430
20431         * cs-parser.jay (attribute_arguments): Implement actions.
20432         (attribute): Fix bug in production. Implement action.
20433         (attribute_list): Implement.
20434         (attribute_target): Implement.
20435         (attribute_target_specifier, opt_target_specifier): Implement
20436         (CheckAttributeTarget): New method to check if the attribute target
20437         is valid.
20438         (attribute_section): Implement.
20439         (opt_attributes): Implement.
20440
20441         * attribute.cs : New file to handle attributes.
20442         (Attribute): Class to hold attribute info.
20443
20444         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20445         (attribute_section): Modify production to use 2 different rules to 
20446         achieve the same thing. 1 s/r conflict down !
20447         Clean out commented, useless, non-reducing dimension_separator rules.
20448
20449         * class.cs (TypeContainer.attributes): New member to hold list
20450         of attributes for a type.
20451         (Struct::Struct): Modify to take one more argument, the attribute list.
20452         (Class::Class): Ditto.
20453         (Field::Field): Ditto.
20454         (Method::Method): Ditto.
20455         (Property::Property): Ditto.
20456
20457         * cs-parser.jay (struct_declaration): Update constructor call to
20458         pass in the attributes too.
20459         (class_declaration): Ditto.
20460         (constant_declaration): Ditto.
20461         (field_declaration): Ditto.
20462         (method_header): Ditto.
20463         (fixed_parameter): Ditto.
20464         (parameter_array): Ditto.
20465         (property_declaration): Ditto.
20466
20467         * constant.cs (Constant::Constant): Update constructor similarly.
20468         Use System.Collections.
20469
20470         * parameter.cs (Parameter::Parameter): Update as above.
20471
20472 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20473
20474         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20475         (TypeContainer.delegates): New member to hold list of delegates.
20476
20477         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20478         this time as I seem to be on crack ;-)
20479
20480 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20483         tell whether an identifier represents a namespace.
20484
20485         * expression.cs (NamespaceExpr): A namespace expression, used only
20486         temporarly during expression resolution.
20487         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20488         utility functions to resolve names on expressions.
20489
20490 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20491
20492         * codegen.cs: Add hook for StatementExpressions. 
20493
20494         * class.cs: Fix inverted test for static flag in methods.
20495
20496 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20497
20498         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20499         to make it coincide with MS' number.
20500         (Operator::CheckBinaryOperator): Ditto.
20501
20502         * ../errors/errors.txt : Remove error numbers added earlier.
20503
20504         * ../errors/cs1019.cs : Test case for error # 1019
20505
20506         * ../errros/cs1020.cs : Test case for error # 1020
20507
20508         * cs-parser.jay : Clean out commented cruft.
20509         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20510         used anywhere - non-reducing rule.
20511         (namespace_declarations): Non-reducing rule - comment out.
20512
20513         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20514         with TypeContainer::AddEnum.
20515
20516         * delegate.cs : New file for delegate handling classes.
20517         (Delegate): Class for declaring delegates.
20518
20519         * makefile : Update.
20520
20521         * cs-parser.jay (delegate_declaration): Implement.
20522
20523 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20524
20525         * class.cs (Event::Define): Implement.
20526         (Event.EventBuilder): New member.
20527
20528         * class.cs (TypeContainer::Populate): Update to define all enums and events
20529         we have.
20530         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20531         readonly fields for all these cases ?
20532
20533 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20534
20535         * class.cs (Property): Revamp to use the convention of making fields readonly.
20536         Accordingly modify code elsewhere.
20537
20538         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20539         the Define method of the Property class.
20540
20541         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20542         trivial bug.
20543         (TypeContainer::Populate): Update to define all the properties we have. Also
20544         define all enumerations.
20545
20546         * enum.cs (Define): Implement.
20547
20548 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20549
20550         * cs-parser.jay (overloadable_operator): The semantic value is an
20551         enum of the Operator class.
20552         (operator_declarator): Implement actions.
20553         (operator_declaration): Implement.
20554
20555         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20556         validity of definitions.
20557         (Operator::CheckBinaryOperator): Static method to check for binary operators
20558         (TypeContainer::AddOperator): New method to add an operator to a type.
20559
20560         * cs-parser.jay (indexer_declaration): Added line to actually call the
20561         AddIndexer method so it gets added ;-)
20562
20563         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20564         already taken care of by the MS compiler ?  
20565
20566 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20567
20568         * class.cs (Operator): New class for operator declarations.
20569         (Operator::OpType): Enum for the various operators.
20570
20571 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20572
20573         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20574         ostensibly handle this in semantic analysis.
20575
20576         * cs-parser.jay (general_catch_clause): Comment out
20577         (specific_catch_clauses, specific_catch_clause): Ditto.
20578         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20579         (catch_args, opt_catch_args): New productions.
20580         (catch_clause): Rewrite to use the new productions above
20581         (catch_clauses): Modify accordingly.
20582         (opt_catch_clauses): New production to use in try_statement
20583         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20584         and re-write the code in the actions to extract the specific and
20585         general catch clauses by being a little smart ;-)
20586
20587         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20588         Hooray, try and catch statements parse fine !
20589
20590 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20591
20592         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20593         string from the hashtable of variables.
20594
20595         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20596         I end up making that mistake ;-)
20597         (catch_clauses): Fixed gross error which made Key and Value of the 
20598         DictionaryEntry the same : $1 !!
20599
20600 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20601
20602         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20603
20604         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20605         when the add and remove accessors are specified. 
20606
20607 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20608
20609         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20610         information about indexer_declarator.
20611         (indexer_declarator): Implement actions.
20612         (parsing_indexer): New local boolean used to keep track of whether
20613         we are parsing indexers or properties. This is necessary because 
20614         implicit_parameters come into picture even for the get accessor in the 
20615         case of an indexer.
20616         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20617
20618         * class.cs (Indexer): New class for indexer declarations.
20619         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20620         (TypeContainer::indexers): New member to hold list of indexers for the
20621         type.
20622
20623 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20624
20625         * cs-parser.jay (add_accessor_declaration): Implement action.
20626         (remove_accessor_declaration): Implement action.
20627         (event_accessors_declaration): Implement
20628         (variable_declarators): swap statements for first rule - trivial.
20629
20630         * class.cs (Event): New class to hold information about event
20631         declarations.
20632         (TypeContainer::AddEvent): New method to add an event to a type
20633         (TypeContainer::events): New member to hold list of events.
20634
20635         * cs-parser.jay (event_declaration): Implement actions.
20636
20637 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20638
20639         * cs-parser.jay (dim_separators): Implement. Make it a string
20640         concatenating all the commas together, just as they appear.
20641         (opt_dim_separators): Modify accordingly
20642         (rank_specifiers): Update accordingly. Basically do the same
20643         thing - instead, collect the brackets here.
20644         (opt_rank_sepcifiers): Modify accordingly.
20645         (array_type): Modify to actually return the complete type string
20646         instead of ignoring the rank_specifiers.
20647         (expression_list): Implement to collect the expressions
20648         (variable_initializer): Implement. We make it a list of expressions
20649         essentially so that we can handle the array_initializer case neatly too.
20650         (variable_initializer_list): Implement.
20651         (array_initializer): Make it a list of variable_initializers
20652         (opt_array_initializer): Modify accordingly.
20653
20654         * expression.cs (New::NType): Add enumeration to help us
20655         keep track of whether we have an object/delegate creation
20656         or an array creation.
20657         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20658         members to hold data about array creation.
20659         (New:New): Modify to update NewType
20660         (New:New): New Overloaded contructor for the array creation
20661         case.
20662
20663         * cs-parser.jay (array_creation_expression): Implement to call
20664         the overloaded New constructor.
20665
20666 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20667
20668         * class.cs (TypeContainer::Constructors): Return member
20669         constructors instead of returning null.
20670
20671 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * typemanager.cs (InitCoreTypes): Initialize the various core
20674         types after we have populated the type manager with the user
20675         defined types (this distinction will be important later while
20676         compiling corlib.dll)
20677
20678         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20679         on Expression Classification.  Now all expressions have a method
20680         `Resolve' and a method `Emit'.
20681
20682         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20683         generation from working.     Also add some temporary debugging
20684         code. 
20685
20686 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * codegen.cs: Lots of code generation pieces.  This is only the
20689         beginning, will continue tomorrow with more touches of polish.  We
20690         handle the fundamentals of if, while, do, for, return.  Others are
20691         trickier and I need to start working on invocations soon.
20692
20693         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20694         s.InitStatement. 
20695
20696         * codegen.cs (EmitContext): New struct, used during code
20697         emission to keep a context.   Most of the code generation will be
20698         here. 
20699
20700         * cs-parser.jay: Add embedded blocks to the list of statements of
20701         this block.  So code generation proceeds in a top down fashion.
20702
20703 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20704
20705         * statement.cs: Add support for multiple child blocks.
20706
20707 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * codegen.cs (EmitCode): New function, will emit the code for a
20710         Block of code given a TypeContainer and its ILGenerator. 
20711
20712         * statement.cs (Block): Standard public readonly optimization.
20713         (Block::Block constructors): Link children. 
20714         (Block::Child): Child Linker.
20715         (Block::EmitVariables): Emits IL variable declarations.
20716
20717         * class.cs: Drop support for MethodGroups here, delay until
20718         Semantic Analysis.
20719         (Method::): Applied the same simplification that I did before, and
20720         move from Properties to public readonly fields.
20721         (Method::ParameterTypes): Returns the parameter types for the
20722         function, and implements a cache that will be useful later when I
20723         do error checking and the semantic analysis on the methods is
20724         performed.
20725         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20726         and made a method, optional argument tells whether this is a class
20727         or a structure to apply the `has-this' bit.
20728         (Method::GetCallingConvention): Implement, returns the calling
20729         convention. 
20730         (Method::Define): Defines the type, a second pass is performed
20731         later to populate the methods.
20732
20733         (Constructor::ParameterTypes): implement a cache similar to the
20734         one on Method::ParameterTypes, useful later when we do semantic
20735         analysis. 
20736
20737         (TypeContainer::EmitMethod):  New method.  Emits methods.
20738
20739         * expression.cs: Removed MethodGroup class from here.
20740
20741         * parameter.cs (Parameters::GetCallingConvention): new method.
20742
20743 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20744
20745         * class.cs (TypeContainer::Populate): Drop RootContext from the
20746         argument. 
20747
20748         (Constructor::CallingConvention): Returns the calling convention.
20749         (Constructor::ParameterTypes): Returns the constructor parameter
20750         types. 
20751
20752         (TypeContainer::AddConstructor): Keep track of default constructor
20753         and the default static constructor.
20754
20755         (Constructor::) Another class that starts using `public readonly'
20756         instead of properties. 
20757
20758         (Constructor::IsDefault): Whether this is a default constructor. 
20759
20760         (Field::) use readonly public fields instead of properties also.
20761
20762         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20763         track of static constructors;  If none is used, turn on
20764         BeforeFieldInit in the TypeAttributes. 
20765
20766         * cs-parser.jay (opt_argument_list): now the return can be null
20767         for the cases where there are no arguments. 
20768
20769         (constructor_declarator): If there is no implicit `base' or
20770         `this', then invoke the default parent constructor. 
20771
20772         * modifiers.cs (MethodAttr): New static function maps a set of
20773         modifiers flags into a MethodAttributes enum
20774         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20775         MethodAttr, TypeAttr to represent the various mappings where the
20776         modifiers are used.
20777         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20778
20779 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20780
20781         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20782         method arguments.
20783
20784         * interface.cs (PopulateIndexer): Implemented the code generator
20785         for interface indexers.
20786
20787 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * interface.cs (InterfaceMemberBase): Now we track the new status
20790         here.  
20791
20792         (PopulateProperty): Implement property population.  Woohoo!  Got
20793         Methods and Properties going today. 
20794
20795         Removed all the properties for interfaces, and replaced them with
20796         `public readonly' fields. 
20797
20798 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20799
20800         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20801         initialize their hashtables/arraylists only when they are needed
20802         instead of doing this always.
20803
20804         * parameter.cs: Handle refs and out parameters.
20805
20806         * cs-parser.jay: Use an ArrayList to construct the arguments
20807         instead of the ParameterCollection, and then cast that to a
20808         Parameter[] array.
20809
20810         * parameter.cs: Drop the use of ParameterCollection and use
20811         instead arrays of Parameters.
20812
20813         (GetParameterInfo): Use the Type, not the Name when resolving
20814         types. 
20815
20816 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20817
20818         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20819         and instead use public readonly fields.
20820
20821         * class.cs: Put back walking code for type containers.
20822
20823 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20824
20825         * class.cs (MakeConstant): Code to define constants.
20826
20827         * rootcontext.cs (LookupType): New function.  Used to locate types 
20828
20829
20830 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20831
20832         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20833         this System.Reflection code is.  Kudos to Microsoft
20834
20835         * typemanager.cs: Implement a type cache and avoid loading all
20836         types at boot time.  Wrap in LookupType the internals.  This made
20837         the compiler so much faster.  Wow.  I rule!
20838
20839         * driver.cs: Make sure we always load mscorlib first (for
20840         debugging purposes, nothing really important).
20841
20842         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20843         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20844
20845         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20846         on namespaces that have been imported using the `using' keyword.
20847
20848         * class.cs (TypeContainer::TypeAttr): Virtualize.
20849         (Class::TypeAttr): Return attributes suitable for this bad boy.
20850         (Struct::TypeAttr): ditto.
20851         Handle nested classes.
20852         (TypeContainer::) Remove all the type visiting code, it is now
20853         replaced with the rootcontext.cs code
20854
20855         * rootcontext.cs (GetClassBases): Added support for structs. 
20856
20857 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20858
20859         * interface.cs, statement.cs, class.cs, parameter.cs,
20860         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20861         Drop use of TypeRefs, and use strings instead.
20862
20863 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20864
20865         * rootcontext.cs: 
20866
20867         * class.cs (Struct::Struct): set the SEALED flags after
20868         checking the modifiers.
20869         (TypeContainer::TypeAttr): new property, returns the
20870         TypeAttributes for a class.  
20871
20872         * cs-parser.jay (type_list): Oops, list production was creating a
20873         new list of base types.
20874
20875         * rootcontext.cs (StdLib): New property.
20876         (GetInterfaceTypeByName): returns an interface by type name, and
20877         encapsulates error handling here.
20878         (GetInterfaces): simplified.
20879         (ResolveTree): Encapsulated all the tree resolution here.
20880         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20881         types. 
20882
20883         * driver.cs: Add support for --nostdlib, to avoid loading the
20884         default assemblies.
20885         (Main): Do not put tree resolution here. 
20886
20887         * rootcontext.cs: Beginning of the class resolution.
20888
20889 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20890
20891         * rootcontext.cs: Provide better error reporting. 
20892
20893         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20894
20895         * rootcontext.cs (CreateInterface): Handle the case where there
20896         are no parent interfaces.
20897
20898         (CloseTypes): Routine to flush types at the end.
20899         (CreateInterface): Track types.
20900         (GetInterfaces): Returns an array of Types from the list of
20901         defined interfaces.
20902
20903         * typemanager.c (AddUserType): Mechanism to track user types (puts
20904         the type on the global type hash, and allows us to close it at the
20905         end). 
20906
20907 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20908
20909         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20910         RecordInterface instead.
20911
20912         * cs-parser.jay: Updated to reflect changes above.
20913
20914         * decl.cs (Definition): Keep track of the TypeBuilder type that
20915         represents this type here.  Not sure we will use it in the long
20916         run, but wont hurt for now.
20917
20918         * driver.cs: Smaller changes to accomodate the new code.
20919
20920         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20921         when done. 
20922
20923         * rootcontext.cs (CreateInterface):  New method, used to create
20924         the System.TypeBuilder type for interfaces.
20925         (ResolveInterfaces): new entry point to resolve the interface
20926         hierarchy. 
20927         (CodeGen): Property, used to keep track of the code generator.
20928
20929 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20930
20931         * cs-parser.jay: Add a second production for delegate_declaration
20932         with `VOID'.
20933
20934         (enum_body): Put an opt_comma here instead of putting it on
20935         enum_body or enum_member_declarations so we can handle trailing
20936         commas on enumeration members.  Gets rid of a shift/reduce.
20937
20938         (type_list): Need a COMMA in the middle.
20939
20940         (indexer_declaration): Tell tokenizer to recognize get/set
20941
20942         * Remove old targets.
20943
20944         * Re-add the parser target.
20945
20946 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20947
20948         * cs-parser.jay: Add precendence rules for a number of operators
20949         ot reduce the number of shift/reduce conflicts in the grammar.
20950
20951 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20952
20953         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20954         and put it here.
20955
20956         Get rid of old crufty code.
20957
20958         * rootcontext.cs: Use this to keep track of the parsed
20959         representation and the defined types available to the program. 
20960
20961         * gen-treedump.cs: adjust for new convention.
20962
20963         * type.cs: Split out the type manager, and the assembly builder
20964         from here. 
20965
20966         * typemanager.cs: the type manager will live here now.
20967
20968         * cil-codegen.cs: And the code generator here. 
20969
20970 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20971
20972         * makefile: Fixed up for easy making.
20973
20974 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20975
20976         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20977         the 
20978
20979         (unary_expression): Expand pre_increment_expression and
20980         post_decrement_expression to reduce a shift/reduce.
20981
20982 2001-07-11  Simon Cozens
20983
20984         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20985
20986         Improve allow_keyword_as_indent name.
20987
20988 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20989
20990         * Adjustments for Beta2. 
20991
20992 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20993
20994         * decl.cs: Added `Define' abstract method.
20995         (InTransit): new property, used to catch recursive definitions. 
20996
20997         * interface.cs: Implement `Define'. 
20998
20999         * modifiers.cs: Map Modifiers.constants to
21000         System.Reflection.TypeAttribute flags.
21001
21002         * class.cs: Keep track of types and user-defined types.
21003         (BuilderInit): New method for creating an assembly
21004         (ResolveType): New function to launch the resolution process, only
21005         used by interfaces for now.
21006
21007         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21008         that are inserted into the name space. 
21009
21010 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21011
21012         * ARGH.  I have screwed up my tree so many times due to the use of
21013         rsync rather than using CVS.  Going to fix this at once. 
21014
21015         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21016         load types.
21017
21018 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21019
21020         * Experiment successful: Use System.Type rather that our own
21021         version of Type.  
21022
21023 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * cs-parser.jay: Removed nsAliases from here.
21026
21027         Use new namespaces, handle `using XXX;' 
21028
21029         * namespace.cs: Reimplemented namespace handling, use a recursive
21030         definition of the class.  Now we can keep track of using clauses
21031         and catch invalid using clauses.
21032
21033 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21034
21035         * gen-treedump.cs: Adapted for all the renaming.
21036
21037         * expression.cs (Expression): this class now has a Type property
21038         which returns an expression Type.
21039
21040         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21041         `Type', as this has a different meaning now in the base
21042
21043 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21044
21045         * interface.cs, class.cs: Removed from all the sources the
21046         references to signature computation, as we can not do method
21047         signature computation during the parsing time, as we are not
21048         trying to solve at that point distinguishing:
21049
21050         class X {
21051                 void a (Blah x) {}
21052                 void a (NS.Blah x) {}
21053         }
21054
21055         Which depending on the context might be valid or not, as we do not
21056         know if Blah is the same thing as NS.Blah at that point.
21057
21058         * Redid everything so the code uses TypeRefs now instead of
21059         Types.  TypeRefs are just temporary type placeholders, that need
21060         to be resolved.  They initially have a pointer to a string and the
21061         current scope in which they are used.  This is used later by the
21062         compiler to resolve the reference to an actual Type. 
21063
21064         * DeclSpace is no longer a CIR.Type, and neither are
21065         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21066         are all DeclSpaces, but no Types. 
21067
21068         * type.cs (TypeRefManager): This implements the TypeRef manager,
21069         which keeps track of all the types that need to be resolved after
21070         the parsing has finished. 
21071
21072 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21073
21074         * ARGH.  We are going to have to store `foreach' as a class rather
21075         than resolving it, as we need to verify error 1579 after name
21076         resolution.   *OR* we could keep a flag that says `This request to
21077         IEnumerator comes from a foreach statement' which we can then use
21078         to generate the error.
21079
21080 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21081
21082         * class.cs (TypeContainer.AddMethod): we now add methods to the
21083         MethodGroup instead of the method hashtable.  
21084
21085         * expression.cs: Add MethodGroup abstraction, which gets us one
21086         step closer to the specification in the way we handle method
21087         declarations.  
21088
21089         * cs-parser.jay (primary_expression): qualified_identifier now
21090         tried to match up an identifier to a local variable reference or
21091         to a parameter reference.
21092
21093         current_local_parameters is now a parser global variable that
21094         points to the current parameters for the block, used during name
21095         lookup.
21096
21097         (property_declaration): Now creates an implicit `value' argument to
21098         the set accessor.
21099
21100 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21101
21102         * parameter.cs: Do not use `param' arguments as part of the
21103         signature, per the spec.
21104
21105 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21106
21107         * decl.cs: Base class for classes, structs and interfaces.  This
21108         is the "Declaration Space" 
21109
21110         * cs-parser.jay: Use CheckDef for checking declaration errors
21111         instead of having one on each function.
21112
21113         * class.cs: Factor out some code for handling error handling in
21114         accordance to the "Declarations" section in the "Basic Concepts"
21115         chapter in the ECMA C# spec.
21116
21117         * interface.cs: Make all interface member classes derive from
21118         InterfaceMemberBase.
21119
21120 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21121
21122         * Many things: all interfaces are parsed and generated in
21123         gen-treedump.  Support for member variables, constructors,
21124         destructors, properties, constants is there.
21125
21126         Beginning of the IL backend, but very little done, just there for
21127         testing purposes. 
21128
21129 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21130
21131         * cs-parser.jay: Fix labeled statement.
21132
21133         * cs-tokenizer.cs (escape): Escape " and ' always.
21134         ref_line, ref_name: keep track of the line/filename as instructed
21135         by #line by the compiler.
21136         Parse #line.
21137
21138 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21139
21140         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21141         to match the values in System.CodeDOM.
21142
21143         Divid renamed to Divide.
21144
21145         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21146         statements. 
21147         (Statements.set): remove.
21148
21149         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21150         statements. 
21151
21152         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21153         falseStatements always have valid values. 
21154
21155         * cs-parser.jay: Use System.CodeDOM now.
21156