2005-08-20 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-08-20  Martin Baulig  <martin@ximian.com>
2
3         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4         scope if we don't already have it.
5
6         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8         fixes #75867.
9
10 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
11
12         Fix #75803
13         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
14         is a partial class.
15
16 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
17
18         The big constants rewrite
19         Fix #75746, #75685 and more
20         As a side effect saved 1MB for MWF ;-)
21         
22         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
23         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
24         enum based for corlib compilation.
25         
26         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
27         subtractions.
28         
29         * class.cs (FixedField.Define): Use ResolveAsConstant.
30         
31         * const.cs (IConstant): Interface constants and enums.
32         (Const.ResolveValue): New method for constant resolvning.
33         (ExternalConstant): Constants from imported assemblies.
34         
35         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
36         conversion; like enums.
37         (Constant.ToType): Converts this constant to different type.
38         (Constant.Increment): Adds 1.
39         
40         * convert.cs (ImplicitConversionRequired): Simplified.
41         
42         * cs-parser.jay: Create EnumMember directly.
43         
44         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
45         
46         * doc.cs (GenerateEnumDocComment): Removed.
47         
48         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
49         (ConvertIntLiteral): Removed.
50         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
51         
52         * enum.cs (EnumMember): Implement IConstant.
53         (Enum.IsValidEnumConstant): Removed.
54         (Enum.GetNextDefaultValue): Removed.
55         (Enum.FindMembers): Updated.
56         (Enum.GenerateDocComment): Iterate enum members.
57         
58         * expression.cs (Cast.TryReduce): Handle enums correctly.
59         (New.Constantify): Made public.
60         (MemberAccess.DoResolve): Removed contant specific if(s).
61         
62         * literal.cs (NullLiteral): Implement new abstract methods.
63         
64         * statement.cs (GotoCase.Resolve): Use new constant methods.
65         (SwitchLabel.ResolveAndReduce): Use new constant methods.
66         
67         * typemanager.cs (LookupEnum): Removed.
68         (IsEnumType): Fixed to work with corlib.
69         (RegisterConstant): Removed.
70         (LookupConstant): Removed.
71         (GetConstant): Changed to work with IConstant.
72
73 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
74
75         * location.cs : Fixed overflown (>255) column number.
76
77 2005-08-03  Raja R Harinath  <rharinath@novell.com>
78
79         First cut of the qualified-alias-member feature.
80         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
81         token.
82         * cs-parser.jay (DOUBLE_COLON): New token.
83         (namespace_or_type_name): Add rule for recognizing
84         qualified-alias-members.
85         (primary_expression): Likewise.
86         (element_access): Allow QualifiedAliasMember as a possible
87         type-bearing expression.
88         (local_variable_type, local_variable_pointer_type): Likewise.
89         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
90         aliases in the current and enclosing namespace declarations.
91         (NamespaceEntry.UsingAlias): Add CS0440 warning.
92         * decl.cs (MemberName.is_double_colon): New.
93         (MemberName.MemberName): Add new constructor for alias-member.
94         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
95         * expression.cs (QualifiedAliasMember): New expression type.
96
97 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
98
99         * location.cs : it borked when no argument was specified.
100
101 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
102
103         * location.cs : tiny ToString() format fix.
104
105 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
106
107         * statement.cs : oops, it was missing.
108
109 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
110
111         A set of fixes for precise line/column location.
112
113         * location.cs :
114           "token" field now holds a file/line "delta", a line number offset 
115           from the segment, and a column number. See also:
116           http://lists.ximian.com/pipermail/mono-devel-list/2004-
117           December/009508.html
118           Removed static IsNull. Use instance IsNull property instead.
119         * cs-tokenizer.cs :
120           For some tokens it stores Location. For Identifier it stores
121           LocatedToken which is a pair of string name and location.
122           Column numbers are adjusted only at getChar().
123         * report.cs :
124           Use Location.ToString() for reporting (it now contains column).
125         * cs-parser.jay :
126           Largely modified to use LocatedToken instead of
127           string (IDENTIFIER), and to acquire Location from some tokens.
128         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
129           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
130           codegen.cs :
131           Now MemberName holds Location. DeclSpace.ctor() receives Location
132           as a parameter. Removed extra parameters to all derived classes.
133           Replaced Location.IsNull() with instance property.
134         * assign.cs, expression.cs :
135           Added .ctor() overload that omits Location.
136         * attribute.cs :
137           Added "nameEscaped" flag that indicates the identifier was escaped
138           in the source file. This fixes bug #57047.
139
140 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
141
142         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
143         New method, looking for lo-case imported cls type.
144
145         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
146         here.
147
148         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
149
150         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
151
152         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
153         all_imported_types.
154         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
155
156         Optimized to save 3.5 MB for SWF compilation.
157
158 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
159
160         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
161         (PartialContainer.Create): Moved logic AddToContainer.
162         (PartialContainer.MarkForDuplicationCheck): Shares name.
163         
164         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
165         place.
166         
167         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
168         initialization.
169         (Namespace.GetSignatureForError): New method.
170         
171         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
172         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
173
174 2005-08-01  Raja R Harinath  <rharinath@novell.com>
175
176         Fix #75669.
177         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
178         member lookup rather than qualifier_type, since qualifier_type can
179         be null.
180
181 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
182
183         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
184         enum member.
185
186 2005-07-31  Miguel de Icaza  <miguel@novell.com>
187
188         * statement.cs: Copy the local exception into the exception
189         captured local.  Fixes 75674
190
191 2005-07-31  Raja R Harinath  <harinath@gmail.com>
192
193         Fix #75658.
194         * expression.cs (Invocation.OverloadResolve): Don't report error
195         CS1501 if error CS1502 has been reported.
196         (New.DoResolve): Delegate CS1501 reporting to
197         Invocation.OverloadResolve.
198
199         Fix #75656.
200         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
201         invariant-meaning-in-block property in an enclosing block if
202         necessary.
203
204 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
205
206         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
207         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
208         (Switch.CheckSwitch): Just save 50kb for SWF.
209
210 2005-07-27  Martin Baulig  <martin@ximian.com>
211
212         * anonymous.cs (CaptureContext.AddField): Added
213         `AnonymousContainer am' argument; compute its toplevel scope if
214         it's not already computed.  Fixes #75649.
215
216 2005-07-26  Raja R Harinath  <rharinath@novell.com>
217
218         Fix #75628.
219         * class.cs (Constructor.Emit): Reset block to null if the block
220         resolve fails.
221
222 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
223
224         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
225
226 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
227
228         * class.cs (MethodData.Define): Check whether accessor implementing
229         interface is public.
230
231         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
232
233 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
234
235         Fix #57245
236         * namespace.cs (LookupType): Moved same type check to...
237         
238         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
239         with the same name.
240
241 2005-07-21  Raja R Harinath  <rharinath@novell.com>
242
243         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
244         already found a typebuilder.
245         * class.cs (MethodCore.IsDuplicateImplementation): Compare
246         MemberNames, not strings.
247
248         * const.cs (Error_ExpressionMustBeConst): 
249         Rename from Error_EpressionMustBeConst.
250         * const.cs, class.cs, statement.cd: Update.
251
252 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
253
254         Fix #65573
255
256         * const.cs (Const.LookupConstantValue): Report missing contant expression
257         everytime.
258         (Error_EpressionMustBeConstant): Only one error method.
259
260         * class.cs, statement.c: Updated.
261
262 2005-07-20  Raja R Harinath  <rharinath@novell.com>
263
264         * statement.cs (Block.Flags): Add back HasVarargs.
265         (Block.flags): Make protected.
266         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
267
268         * typemanager.cs (types, typecontainers, user_types): Remove.
269         (UserTypes, TypeContainers): Likewise.
270         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
271         (CleanUp, Reset): Update.
272         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
273         (GetNestedType): Use Type.GetNestedType.
274         (CoreLookupType): Take two arguments, the namespace and the
275         basename of the type.  Update to use the Namespace.Lookup
276         mechanism.
277         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
278         (RealMemberLookup): Use IsNestedChildOf instead of playing with
279         string concatenation and substring matches.
280         * class.cs, enum.cs, delegate.cs: Update to changes.
281
282 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
283
284         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
285         Expression and made virtual.
286
287         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
288         (ImplicitStandardConversionExists): Fixed `byte' typo ?
289
290         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
291
292         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
293         error message.
294
295         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
296         change.
297
298 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
299
300         Fix #57707
301         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
302         AssemblyCultureAttribute is not used on executable.
303
304         * rootcontext.cs,
305         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
306
307 2005-07-16  Raja R Harinath  <rharinath@novell.com>
308
309         Fix #60638.
310         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
311         New.  Reports CS0252/CS0253.
312         Mostly taken from preliminary patch by Duncak Mak.
313         (Binary.DoResolveOperator): Store results of operator lookup.
314         Use them to detect if we need to warn about unintended reference
315         comparisons.
316
317 2005-07-15  Raja R Harinath  <rharinath@novell.com>
318
319         Fix #72969.
320         * namespace.cs (Namespace.Lookup): Add back location parameter.
321         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
322         * delegate.cs, ecore.cs, expression.cs: Update to changes.
323
324         * codegen.cs (EmitContext.DeclSpace): Make readonly.
325         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
326         (Namespace.LookupType): ... this.
327         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
328         of namespaces.
329         * typemanager.cs (LookupTypeReflection): Remove buggy code that
330         purported to handle pointers.
331         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
332         CoreLookupType.
333
334 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
335
336         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
337         type as namespace.
338
339 2005-07-15  Raja R Harinath  <rharinath@novell.com>
340
341         * namespace.cs (Namespace.Lookup): Drop location parameter.
342         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
343         (NamespaceEntry.Lookup): ... this.
344         (NamespaceEntry.Error_AmbiguousTypeReference):
345         Move here from DeclSpace.
346         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
347         names ...
348         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
349         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
350         Move to NamespaceEntry.
351         * delegate.cs, expression.cs: Update to changes.
352
353 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
354
355         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
356         CheckAttributeType and refactored.
357         (Attribute.ResolvePossibleAttributeType): Changed to reuse
358         ResolveAsTypeTerminal error handling.
359         (ResolveAsTypeTerminal): Introduced because of global attributes extra
360         handling.
361         (GetSignatureForError): Print errors in same way.
362
363         * class.cs,
364         * codegen.cs: Reflect attribute GetSignatureForError change.
365
366         * ecore.cs,
367         * expression.cs: Add silent parameter to ResolveAsTypeStep.
368
369         * namespace.cs (UsingEntry): Refactored to make fields private.
370
371         * assign.cs,
372         statement.cs: Error_UnexpectedKind has extra parameter.
373
374 2005-07-14  Raja R Harinath  <rharinath@novell.com>
375
376         * ecore.cs (IAlias): Remove.
377         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
378         that implement the interface.
379         * namespace.cs (Namespace): Likewise.
380         (Namespace.declspaces): Renamed from 'defined_names'.
381         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
382         DeclSpace instead of an IAlias.
383         * tree.cs (Tree.AddDecl): Update.
384
385 2005-07-12  Raja R Harinath  <rharinath@novell.com>
386
387         * statement.cs (Block.Flags); Remove HasVarargs.
388         (Block.HasVarargs): Move to ToplevelBlock.
389         (Block.ThisVariable, Block.AddThisVariable): Likewise.
390         (Block.Variables): Make protected.  Initialize variable hashtable
391         if necessary.
392         (Block.AddVariable): Update.
393         (Block.Resolve): Update to changes.
394         (ToplevelBlock.HasVarargs): New boolean.
395         (ToplevelBlock.ThisVariable): Move here from Block.
396         (ToplevelBlock.AddThisVariable): Likewise.
397         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
398         * expression.cs (This.ResolveBase): Update to changes.
399         (ArglistAccess.DoResolve): Likewise.
400
401 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
402
403         Fix #75321
404         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
405
406         * class.cs (TypeContainer.VerifyMembers): Distinguish between
407         not used and not used & assigned.
408         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
409
410 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
411
412         Fix #75053
413         * expression.cs (Is.DoResolve): null is never provided type.
414
415 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
416
417         Fix #52496
418         * cs-parser.jay: Less strict event error rule to catch more errors.
419
420 2005-07-08  Martin Baulig  <martin@ximian.com>
421
422         Fix test-iter-10.cs - distinguish whether we `yield' in a property
423         gettter (allowed) or setter (not allowed).
424
425         * class.cs (Accessor): Implement IIteratorContainer.
426         (Accessor.Yields): New public field.
427         (PropertyBase.PropertyMethod.Define): Handle iterators on a
428         per-accessor basis.
429
430         * cs-parser.jay
431         (get_accessor_declaration, set_accessor_declaration): Set the
432         `yields' flag on the accessor, not the property.
433         (property_declaration): Do the iterators check on a per-accessor
434         basis and not for the whole property.
435
436 2005-07-08  Martin Baulig  <martin@ximian.com>
437
438         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
439         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
440
441 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
442
443         Fix #74975
444         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
445         (ExtractSecurityPermissionSet): Cope with self referencing security
446         attributes properly.
447
448         * driver.cs (SetOutputFile): Made public property OutputFile.
449
450 2005-07-07  Raja R Harinath  <rharinath@novell.com>
451
452         Fix #75486.
453         * class.cs (TypeContainer.first_nonstatic_field): Rename from
454         has_nonstatic_fields.  Make into a FieldBase pointer.
455         (TypeContainer.AddField): Add CS0282 check.
456         (TypeContainer.EmitType): Update.
457
458 2005-07-06  Miguel de Icaza  <miguel@novell.com>
459
460         * cs-tokenizer.cs (consume_identifier): Do not create strings to
461         compare if they start with __.
462
463 2005-07-06  Raja R Harinath  <rharinath@novell.com>
464
465         * statement.cs (Switch.SwitchGoverningType): Only look at
466         UserCasts that don't need implicit standard conversions to one of
467         the allowed switch types (Fixes test-322.cs).
468         (LocalInfo.Resolve): Re-enable sanity-test.
469
470 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
471
472         * cs-tokenizer.cs (consume_identifier): Detect double undescores
473         
474         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
475         
476         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
477
478 2005-07-06  Raja R Harinath  <rharinath@novell.com>
479
480         Fix #75472.
481         * ecore.cs (SimpleName.GetSignatureForError): Add.
482         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
483         (MemberAccess.GetSignatureForError): Add.
484
485 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
486  
487         The big error and warning messages review.
488         
489         * anonymous.cs,
490         * assign.cs,
491         * attribute.cs,
492         * class.cs,
493         * codegen.cs,
494         * convert.cs,
495         * cs-parser.jay,
496         * cs-tokenizer.cs,
497         * decl.cs,
498         * delegate.cs,
499         * doc.cs,
500         * driver.cs,
501         * ecore.cs,
502         * enum.cs,
503         * expression.cs,
504         * flowanalysis.cs,
505         * iterators.cs,
506         * literal.cs,
507         * location.cs,
508         * modifiers.cs,
509         * namespace.cs,
510         * parameter.cs,
511         * pending.cs,
512         * report.cs,
513         * rootcontext.cs,
514         * statement.cs,
515         * support.cs,
516         * tree.cs,
517         * typemanager.cs: Updated.
518         
519         * class.cs: (MethodCore.SetYields): Moved here to share.
520         (PropertyMethod.Define): Moved iterator setup here.
521         
522         * iterators.cs: Add orig_method to have full access to parent
523         container.
524
525 2005-07-05  Raja R Harinath  <rharinath@novell.com>
526
527         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
528         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
529         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
530         variable of struct type.
531         * expression.cs (Unary.ResolveOperator): Update to change.
532         (Indirection.VerifyFixed): Likewise.
533         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
534         (ParameterReference.VerifyFixed): Value parameters are fixed.
535         (This.VerifyFixed): Treat 'this' as a value parameter.
536         * statement.cs (LocalInfo.IsFixed): Remove.
537
538 2005-07-01  Martin Baulig  <martin@ximian.com>
539
540         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
541         `ec.EmitThis ()' to get the correct scope.
542
543 2005-07-01  Martin Baulig  <martin@ximian.com>
544
545         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
546         instance is a ParameterReference; fixes #75299.
547
548 2005-07-01  Martin Baulig  <martin@ximian.com>
549
550         Reverted Marek's latest patch (r46725):
551         - it contains structural changes which are neither mentioned in
552           the ChangeLog nor explained anywhere; for example the additional
553           argument of EmitContext's and Iterator's .ctor's and the
554           TypeContainer.DefineMembers() change.
555         - structural changes like this should go in in seperate patches
556           and not be hidden in a huge patch which just seems to affect
557           warnings and errors.
558           a big and hard to understand patch.
559         - it breaks iterators and causes regressions, for instance in
560           test-iter-03.cs.      
561
562 2005-06-30  Raja R Harinath  <rharinath@novell.com>
563
564         Fix #75412.
565         * expression.cs (Indexers.map): Remove.
566         (Indexers.Append): Filter out inaccessible setters and getters.
567         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
568
569         Fix #75283.
570         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
571         Refactored from ...
572         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
573         (FieldExpr.Emit, PropertyExpr.Emit): Update.
574         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
575         * expression.cs (Invocation.EmitCall): Add CS0120 check.
576
577 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
578
579         Fix #75322
580         * class.cs (FieldBase.GetInitializerExpression): One more field
581         for backup.
582
583 2005-06-28  Miguel de Icaza  <miguel@novell.com>
584
585         * pending.cs: Do not define a proxy if the base method is virtual,
586         it will be picked up by the runtime (bug 75270).
587
588 2005-06-08  Martin Baulig  <martin@ximian.com>
589
590         The big Iterators rewrite :-)
591
592         * iterators.cs: Rewrite this to use the anonymous methods framework.
593
594         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
595         before the TypeContainers; see 2test-21.cs.
596
597         * class.cs
598         (TypeContainer.DefineType): Don't create a new EmitContext if we
599         already have one (this only happens if we're an Iterator).
600         (TypeContainer.Define): Also call Define() on all our iterators.
601         (Method.CreateEmitContext): Added support for iterators.
602
603         * anonymous.cs
604         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
605         (AnonymousContainer.CreateMethodHost): Moved here from
606         AnonymousMethod and made abstract.
607         (AnonymousContainer.CreateScopeType): New abstract method.
608         (AnonymousContainer.IsIterator): New public property.
609         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
610         get the ScopeTypeBuilder rather than manually defining it here. 
611         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
612         iterators here.
613
614         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
615         before RootContext.DefineTypes().
616
617         * codegen.cs (EmitContext.RemapToProxy): Removed.
618         (EmitContext.CurrentAnonymousMethod): Changed type from
619         AnonymousMethod -> AnonymousContainer.
620         (EmitContext.ResolveTopBlock): Protect from being called twice.
621         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
622         (EmitContext.EmitThis): Removed the iterators hacks; use the
623         anonymous methods framework for that.
624
625         * statement.cs
626         (ToplevelBlock.Container): Make this a property, not a field.
627         (ToplevelBlock.ReParent): New public method; move the
628         ToplevelBlock into a new container.
629         (Foreach.TemporaryVariable): Simplify.
630
631 2005-06-05  Martin Baulig  <martin@ximian.com>
632
633         * statement.cs (LocalInfo.CompilerGenerated): New flag.
634         (Block.AddTemporaryVariable): New public method; creates a new
635         `LocalInfo' for a temporary variable.
636         (Block.EmitMeta): Create the LocalBuilders for all the temporary
637         variables here.
638         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
639         non-iterator variables.
640
641 2005-06-05  Martin Baulig  <martin@ximian.com>
642
643         * statement.cs (Foreach.TemporaryVariable): Create the
644         LocalBuilder in the Emit phase and not in Resolve since in some
645         situations, we don't have an ILGenerator during Resolve; see
646         2test-19.cs for an example.
647
648 2005-06-04  Martin Baulig  <martin@ximian.com>
649
650         **** Merged r45395 from GCS ****
651
652         The big Foreach rewrite - Part II.
653
654         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
655         with `PropertyInfo ienumerator_getcurrent'.
656
657         * codegen.cs (VariableStorage): Removed.
658
659         * statement.cs
660         (Foreach): Derive from Statement, not ExceptionStatement.
661         (Foreach.CollectionForeach): New nested class.  Moved all the code
662         dealing with collection foreach here.
663         (Foreach.ForeachHelperMethods): Removed.
664         (Foreach.TemporaryVariable): Implement IMemoryLocation.
665
666 2005-05-23  Martin Baulig  <martin@ximian.com>
667
668         * statement.cs (Try.DoResolve): Don't create a `finally' if we
669         don't need to.  Fix #75014.
670
671 2005-05-20  Martin Baulig  <martin@ximian.com>
672
673         Merged r44808 from GMCS.
674
675         * class.cs (TypeContainer.CircularDepException): Removed.
676         (TypeContainer.DefineType): Removed the `InTransit' stuff.
677         (TypeContainer.CheckRecursiveDefinition): Check for circular class
678         (CS0146) and interface (CS0529) dependencies here.
679
680 2005-06-21  Raja R Harinath  <rharinath@novell.com>
681
682         * expression.cs (Invocation.EmitCall): Fix initialization
683         'this_call' to reflect current behaviour.  Fix indentation.
684
685         * convert.cs (FindMostEncompassedType): Add two trivial special
686         cases (number_of_types == 0 || number_of_types == 1).
687         (FindMostEncompasingType): Likewise.
688
689 2005-06-17  Raja R Harinath  <rharinath@novell.com>
690
691         Some cleanups preparing for the fix of #75283.
692         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
693         error testing.
694         (EventExpr.InstanceResolve): Likewise.
695         (EventExpr.DoResolve): Remove redundant checks.
696
697 2005-06-10  Duncan Mak  <duncan@novell.com>
698
699         * cs-tokenizer.cs (process_directives): New flag for controlling
700         the processing of preprocessor directives.
701         (x_token): After seeing a '#', return Token.NONE instead of going
702         to handle_preprocessing_directive() when not processing
703         directives. This avoids unnecessary processing during the token peek in
704         is_punct().
705
706         This fixes #74939.
707
708         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
709         the existing error reporting methods instead of Report.Error.
710
711         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
712         after Raja's rewrite.
713
714 2005-06-08  Miguel de Icaza  <miguel@novell.com>
715
716         * class.cs: Small fix.
717
718 2005-06-08  Raja R Harinath  <rharinath@novell.com>
719
720         Fix #75160.
721         * class.cs (GetPartialBases): Fix return value check of
722         part.GetClassBases.
723
724 2005-06-07  Raja R Harinath  <rharinath@novell.com>
725
726         Ensure that partial classes are registered in their enclosing
727         namespace.  Initial part of fix of #75160.
728         * tree.cs (Tree.RecordDecl): Add new namespace argument.
729         Register declspace with namespace here, not in
730         DeclSpace.RecordDecl.
731         * cs-parser.jay: Pass namespace to RecordDecl.
732         * class.cs (PartialContainer.Create): Likewise.
733         (ClassPart.DefineType): New sanity-check.  Throws an exception if
734         called.
735         * decl.cs (Declspace.RecordDecl): Remove.
736         * namespace.cs (NamespaceEntry.DefineName): Remove.
737
738 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
739
740         * rootcontext.cs: Reset TargetExt as well.
741
742 2005-06-03  Raja R Harinath  <rharinath@novell.com>
743
744         * ecore.cs (Expression.Resolve): Emit CS0654 error when
745         -langversion:ISO-1.
746
747 2005-06-02  Raja R Harinath  <rharinath@novell.com>
748
749         Fix #75080, cs0119.cs.
750         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
751         of ...
752         (Expression.Resolve): ... this.  Use it.  Remove bogus code
753         allowing ExprClass.Type and ExprClass.Namespace for
754         ResolveFlags.VariableOrValue.
755         (Expression.Resolve) [1-argument variant]: Change default resolve
756         flags based on language version.
757         (Expression.Error_UnexpectedKind): Use a simple string array
758         rather than an ArrayList.
759         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
760         not ExprClass.Type.
761         (TypeOfVoid.DoResolve): Likewise.
762         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
763         flags argument -- it always has the same value.
764
765 2005-05-31  Raja R Harinath  <rharinath@novell.com>
766
767         Fix #75081.
768         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
769         Use it in the error message.
770         * assign.cs, expression.cs, statement.cs: Update.
771
772 2005-05-30  Raja R Harinath  <rharinath@novell.com>
773
774         Fix #75088.
775         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
776         the "almostMatchedMember" case too.
777         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
778         that failed the accessibility checks to 'almost_match'.
779
780 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
781
782         * attribute.cs: Use internal MethodBuilder methods to set
783         ExactSpelling and SetLastError on PInvoke methods, instead
784         of passing them via charset.  Fixes #75060.
785
786 2005-05-27  Raja R Harinath  <rharinath@novell.com>
787
788         * parameter.cs (Parameter): Remove TODO comment.
789         (Parameter.DefineParameter): Remove Location parameter.
790         (Parameters.LabelParameters): Likewise.
791         * class.cs (Constructor.Emit): Update to change.
792         (MethodData.Emit): Likewise.
793         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
794         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
795
796 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
797
798         * parameter.cs,
799           Removed Parameters.Location and added Parameter.Location instead.
800           Removed Location parameter from Emit() and GetSignature().
801         * anonymous.cs,
802           class.cs,
803           cs-parser.jay,
804           delegate.cs,
805           iterators.cs,
806           statement.cs :
807           Modified all related calls.
808
809 2005-05-26  Raja R Harinath  <rharinath@novell.com>
810
811         Improve user-defined conversion handling.
812         * convert.cs (GetConversionOperators): Rewrite.  Return only the
813         applicable operators.
814         (AddConversionOperators): New.  Helper for GetConversionOperators.
815         (FindMostEncompassedType, FindMostEncompassingType): Verify that
816         there is only one most encompassed/encompassing type.
817         (FindMostSpecificSource, FindMostSpecificTarget): Remove
818         "applicable operator" handling.
819         (UserConversion): Move cache here from GetConversionOperators.
820         Directly cache the chosen operator, rather than the whole
821         MethodGroup.
822         (ExplicitNumericConversion): Fix buggy implementation of Decimal
823         case.  Allow conversion of decimal to sbyte and byte too.
824         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
825         New static methods.  Used to avoid allocating EmptyExpressions in
826         convert.cs.
827
828 2005-05-24  Duncan Mak  <duncan@novell.com>
829
830         * ecore.cs (CastFromDecimal): New class for casting a decimal to
831         another class, used in Convert.ExplicitNumericConversion.
832         (CastToDecimal): New class, similar to above, but casts to
833         System.Decimal, used in Convert.ImplicitNumericConversion and also
834         in explicit convesion from double/float to decimal.
835
836         * convert.cs (ImplicitNumericConversion): Handle implicit
837         conversions to System.Decimal.
838         (ExplicitNumericConversion): handle explicit conversions to
839         System.Decimal.
840
841         This fixes #68711.
842         
843 2005-05-20  Miguel de Icaza  <miguel@novell.com>
844
845         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
846         know the type at this stage, just break through.   Fixes #75008 
847
848 2005-05-19  Martin Baulig  <martin@ximian.com>
849
850         * delegate.cs
851         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
852         to disable error reporting.
853
854         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
855         here since we don't want to report an error; see the new test-336.cs.
856
857 2005-05-19  Raja R Harinath  <rharinath@novell.com>
858
859         * statement.cs (ToplevelBlock.GetParameterReference)
860         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
861         Move here from class Block.
862         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
863         * expression.cs (ParameterReference.DoResolveBase): Likewise.
864
865 2005-05-18  Martin Baulig  <martin@ximian.com>
866
867         Fix #74978.
868
869         * flowanalysis.cs
870         (FlowBranching.Reachability): Add non-static public And() and Or()
871         methods.
872         (FlowBranchingSwitch): New class; do the `break_origins' thing
873         like in FlowBranchingLoop.
874         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
875         reachability, not just locals and parameters.
876         (FlowBranching.MergeChild): Remove some of the hacks for loop and
877         switch; MergeBreakOrigins() now takes care of that.
878
879 2005-05-18  Martin Baulig  <martin@ximian.com>
880
881         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
882         a loop and may leave it, reset the barrier; fixes #74974.
883
884 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
885         
886         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
887         is back.
888         
889         * cs-parser.jay: Catch more lexical errors.
890         
891         * report.cs: Add one more Error method.
892         
893         * rootcontext.cs,
894         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
895
896 2005-05-17  Martin Baulig  <martin@ximian.com>
897
898         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
899         #70970. 
900
901 2005-05-16  Raja R Harinath  <rharinath@novell.com>
902
903         Fix test-382.cs.  Emit values of decimal constants.
904         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
905         Carved out of ...
906         (TypeContainer.AddField): ... this.
907         (TypeContainer.EmitFieldInitializers): Allow the list of fields
908         with initializers to include 'Const's.
909         (ClassPart.RegisterFieldForInitialization): Forward to
910         PartialContainer.
911         * const.cs (Const.Const): Pass initializer to base class.
912         (Const.Define): In case of decimal constants, register them for
913         initialization in a static constructor.
914
915 2005-05-14  Martin Baulig  <martin@ximian.com>
916
917         * statement.cs (Block.Resolve): Correctly handle unreachable code;
918         do not call ResolveUnreachable() on unreachable statements in
919         here, see the comment in the source code.
920
921 2005-05-13  Raja R Harinath  <rharinath@novell.com>
922
923         Fix #74934.
924         * expression.cs (BinaryResolveOperator): If one of the operands of
925         an equality comparison is 'null' and the other is a pointer type,
926         convert the null to a NullPointer.
927         * convert.cs (ImplicitReferenceConversion): If the expression is a
928         NullLiteral and the target type is a pointer type, return a
929         NullPointer instead.
930         (ImplicitConversionStandard): Likewise.
931
932 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
933         
934         * cs-parser.jay: Set readonly context based on special constructs.
935         
936         * expression.cs (LocalVariableReference.DoResolveBase): Improved
937         readonly variable error handling.
938         
939         * rootcontext.cs (EmitCode): Don't verify members when error
940         occurred.
941         
942         * statement.cs (LocalInfo): Add reaodnly context information.
943         (SetReadOnlyContext, GetReadOnlyContext): New methods.
944
945 2005-05-13  Raja R Harinath  <rharinath@novell.com>
946
947         * statement.cs (Block.Resolve): Revert change below.  Modify fix
948         for #74041 to initialize 'resolved' to false only for explicit
949         blocks.  Fixes #74873.
950
951 2005-05-12  Raja R Harinath  <harinath@gmail.com>
952
953         Fix #74920.
954         * typemanager.cs (unmanaged_enclosing_types): New.
955         (IsUnmanagedType): Avoid infloops by using
956         'unmanaged_enclosing_types' to talk with recursive invocations.
957
958 2005-05-13  Martin Baulig  <martin@ximian.com>
959
960         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
961         instance variable, not a local.  Fix #74873.
962         (Block.ResolveUnreachable): Set it to true here.
963
964 2005-05-11  Duncan Mak  <duncan@novell.com>
965
966         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
967         continuing to process for 'arg'.
968         (handle_preprocessing_directive): Check the argument of the #endif
969         directive and report error CS1025 if there are any trailing
970         characters.
971
972         According to the C# spec, having even whitespace after the #endif
973         directive is illegal; however, because we call arg.TrimEnd ()
974         beforehand, we have the same behavior as csc, allowing whitespace
975         after the directive.
976
977         Fixes #74892.
978
979 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
980
981         Fix #74863.
982         
983         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
984         (Constructor.GetObsoleteAttribute): Implemented correctly.
985
986 2005-05-10  Martin Baulig  <martin@ximian.com>
987
988         * support.cs (ReflectionParameters.ParameterModifier): Use
989         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
990         and `ParameterAttributes.In'.  Fixes #74884.
991
992 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
993
994         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
995         
996         * expression.cs (Argument.GetParameterModifier): Turned to property.
997         (Invocation.Error_InvalidArguments): Add more descriptive errors.
998         
999         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1000         its C# equivalent.
1001         
1002 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1003
1004         Fix #74852.
1005         * decl.cs (MemberCache.AddMethods): Register override methods,
1006         rather than non-override methods.
1007         * typemanager.cs (RegisterOverride): New.
1008         (IsOverride): Update.
1009
1010 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1011
1012         Fix #73105.
1013         
1014         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1015         recursive declaration.
1016         
1017         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1018         
1019 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1020
1021         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1022         
1023         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1024
1025 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1026
1027         Fix #74797.
1028         * decl.cs (DeclSpace.FamilyAccessible): 
1029         Use TypeManager.IsNestedFamilyAccessible.
1030
1031         Fix reopened #64812.
1032         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1033         internal'.
1034
1035 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1036             Abin Thomas  <projectmonokochi@rediffmail.com>
1037             Anoob V E  <projectmonokochi@rediffmail.com>
1038             Harilal P R  <projectmonokochi@rediffmail.com>
1039
1040         Fix #64812.
1041         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1042         allow access to all static members.
1043
1044 2005-05-04  Martin Baulig  <martin@ximian.com>
1045
1046         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1047
1048 2005-05-04  Martin Baulig  <martin@ximian.com>
1049
1050         Fix #74655.
1051
1052         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1053         section at the end; make things work if `default' is not the last
1054         section.        
1055
1056 2005-05-04  Martin Baulig  <martin@ximian.com>
1057
1058         Fix #70400.
1059
1060         * statement.cs (Switch): Replaced the `got_default' field with a
1061         `default_section' one.
1062         (Switch.CheckSwitch): Set `default_section' here.
1063         (Switch.Resolve): If we're a constant switch and the constant is
1064         not found, use the default section.
1065
1066 2005-05-03  Martin Baulig  <martin@ximian.com>
1067
1068         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1069
1070         * statement.cs (Foreach.ArrayForeach): New nested class.
1071         (Foreach.TemporaryVariable): New nested class.
1072         (Foreach.EmitArrayForeach): Removed; this is now in the new
1073         ArrayForeach class.
1074
1075 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1076
1077         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1078         more conservative.
1079         (VerifyPendingMethods): Revert change below.
1080
1081         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1082         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1083         that used to trigger warning -28.  Remove warning -28.
1084         * expression.cs (Invocation.OverloadResolve): Use
1085         TypeManager.IsOverride to distinguish override methods.
1086
1087         Fix #74773.
1088         * pending.cs (VerifyPendingMethods): If a base type implements the
1089         requested interface, don't bother checking individual methods of
1090         the base type.  As a side-effect, this prevents the creation of
1091         unnecessary proxies.
1092
1093 2005-05-02  Martin Baulig  <martin@ximian.com>
1094
1095         Fix #70182.
1096
1097         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1098         Also `And' the locals if the old vector is null.
1099         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1100         null; in this case we basically reset all the variables.        
1101
1102 2005-05-02  Martin Baulig  <martin@ximian.com>
1103
1104         Fix #74529.
1105
1106         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1107         Added `FlowBranching branching' argument; always `and' the
1108         variables instead of `or'ing them unless we're an infinite loop.
1109
1110         * statement.cs (While.Resolve): Create a new sibling unless we're
1111         infinite.       
1112
1113 2005-05-02  Martin Baulig  <martin@ximian.com>
1114
1115         Fix #70140.
1116
1117         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1118         arguments; use it instead of creating a new TopLevelBlock.
1119         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1120         our ConstructorInitializer.
1121
1122         * statement.cs
1123         (TopLevelBlock.TopLevelBranching): New public property.
1124         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1125         and create our `TopLevelBranching'.
1126
1127         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1128         anonymous method host, use `block.TopLevelBranching' rather than
1129         creating a new branching.
1130
1131 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1132
1133         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1134         a ScopeInfo, if any of the current children is a child of the new
1135         entry, move those children there.
1136
1137 2005-04-30  Martin Baulig  <martin@ximian.com>
1138
1139         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1140         at the beginning of a SwitchSection.  Fix #73335.
1141
1142 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1143
1144         Fix #74378
1145         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1146         
1147         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1148         (FieldExpr.DoResolve): Obsolete members are ignored for field
1149         initializers.
1150         
1151 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1152
1153         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1154         of arrays detection.
1155
1156         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1157         verification.
1158         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1159
1160         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1161         arrays report.
1162
1163 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1164
1165         * cs-parser.jay: Use the prefered version of -unsafe in error
1166         message.
1167
1168 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1169
1170         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1171         circumstances.
1172
1173 2005-04-20  John Luke  <john.luke@gmail.com>
1174
1175         * driver.cs: fix typo in error message, --outout to --output
1176
1177 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1178
1179         * codegen.cs (InRefOutArgumentResolving): New field.
1180         
1181         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1182         fields outside contructor.
1183         
1184         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1185         
1186 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1187
1188         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1189         parameter code was not completed ever, so it was not as up-to-date
1190         as local variables.  Must finish it.
1191
1192         The bug fix was to compare the Toplevel of the block, not the
1193         current block.  Thanks for Ben for pointing this out. 
1194
1195 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1196
1197         * decl.cs (AddMethods): Use the declaring type of the problem
1198         method to determine if we want to squash a warning.
1199
1200 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1201
1202         * attribute.cs: Removed debug output.
1203
1204         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1205         
1206         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1207         Report.Stderr.
1208         
1209 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1210
1211         Fix #74481.
1212         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1213         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1214         all null comparisons against reference types.
1215
1216 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1217
1218         Fix# 74565
1219         * class.cs (TypeContainer.CircularDepException) New nested
1220         exception class.
1221         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1222         (TypeContainer.DefineType): Removed error, reset InTransit before
1223         exit.
1224         (Class.DefineType): Throw exception when is in Transit.
1225         Catch exception and report error.
1226         (Struct.DefineType): Throw exception when is in Transit.
1227         Catch exception and report error.
1228         (Interface.DefineType): Throw exception when is in Transit.
1229         Catch exception and report error.
1230
1231         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1232         handle nested exception handlers.
1233
1234         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1235         a catch.
1236
1237         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1238         InFinally and InCatch storage.
1239
1240         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1241         (Catch.Resolve): Set and Restore ec.InCatch.
1242         (Try.Resolve): Set and Restore ec.InFinally.
1243         (Try.HasCatch): True when try has catch.
1244
1245 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1246
1247         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1248           for the same event member, so exclude such cases from warning 419.
1249           Fixed bug #74633.
1250
1251 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1252
1253         * expression.cs (Binary.ResolveOperator): Apply patch from John
1254         Luke to fix bug 59864: operators &, | and ^ on enumerations
1255         require that the same enum type on both sides.
1256
1257         * driver.cs: Add warnings to old flag usage, this is to assist
1258         people who produce Makefiles and hope that the Makefiles will be
1259         used on Windows.
1260
1261         * class.cs (TypeContainer.EmitType): Moved the definition of the
1262         special $PRIVATE$ field from the resolve phase to the Emit phase.
1263         During resolve we do not know if we are a struct with
1264         HasExplicitLayout, we know this only after the attributes for the
1265         type are emitted.
1266
1267         Set the FieldOffset to zero on the dummy field that we create for
1268         the class.   Fixes 74590.
1269
1270 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1271
1272         Fix #73834.
1273         * ecore.cs (PropertyExpr.resolved): New.
1274         (DoResolve): Use it to handle a case of double resolution here.
1275         Handle a case of identical-name-and-type-name.
1276         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1277         resolution by storing the results of expression resolution back
1278         into the "probes" array.
1279
1280 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1281
1282         Fix cs0208-7.cs and cs0208-8.cs.
1283         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1284         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1285         error reporting to point out the reason a struct is not unmanaged.
1286
1287 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1288
1289         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1290           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1291
1292 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1293
1294         Fix #74528.
1295         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1296         IdenticalNameAndTypeName here.
1297         (EventExpr.InstanceResolve): Likewise.
1298
1299 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1300
1301         C# 2.0 DefaultCharSetAttribute implementation
1302         
1303         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1304         which allows us to set GlobalNamespace for every resolve.
1305         (Attribute.ResolveArguments): Cut from Resolve.
1306         (Attribute.GetCharSetValue): Returns CharSet named argument.
1307         (Attribute.DefinePInvokeMethod): Gets default charset from
1308         module settings.
1309         (GlobalAttribute.ResolveAsTypeStep): Override.
1310         (GlobalAttribute.ResolveArguments): Override.
1311         
1312         * class.cs (TypeAttr): Is protected.
1313         
1314         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1315         (ModuleClass.DefaultCharSetType): New memeber.
1316         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1317         
1318         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1319         charset from module.
1320         
1321         * delegate.cs (TypeAttr): Override.
1322         (Delegate.DefineType): Use this TypeAttr.
1323         
1324         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1325         at very early stage (before types are defined) to resolve model
1326         module attributes. It will probably not work with corlib but it
1327         should be ok.
1328         
1329         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1330         charset from module.
1331         
1332         * typemanager.cs (default_charset_type): New type.
1333
1334 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1335
1336         * decl.cs (MemberCache.AddMethods): Don't warn if
1337         System.Object.Finalize has buggy MethodAttributes.
1338
1339         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1340         removed below.
1341
1342 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1343
1344         * doc.cs : detect ambiguous reference to overloaded members.
1345           Fixed bug #71603. MS 1.1 csc does not detect it.
1346
1347 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1348
1349         * doc.cs : delegates must not be referenced with parameters.
1350           Fixed bug #71605.
1351
1352 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1353
1354         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1355
1356 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1357
1358         * driver.cs (MainDriver): Stop processing if the CLS stage found
1359         errors. 
1360
1361         (CompilerCallableEntryPoint.InvokeCompiler): Always
1362         reset after execution;   Take a TextWriter argument for the
1363         output.
1364
1365         * report.cs: Use the error stream instead of hardcoding stderr. 
1366
1367 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1368
1369         * class.cs: Reduce code paths to test, too small of an
1370         optimization to make it worth the extra testing.  Always perform
1371         it. 
1372
1373 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1374
1375         Fix #74510.
1376         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1377         operators that had errors reported on them.
1378
1379 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1380
1381         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1382         argument types.
1383         (Attribute.Resolve): Add named argument type checking.
1384         
1385         * class.cs (FixedField.Define): Use IsPrimitiveType
1386         
1387         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1388         
1389         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1390         unsafe parameter types.
1391         
1392         * statement.cs (Using.ResolveExpression): Add better error description.
1393         
1394         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1395         
1396 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1397
1398         Fix #74484.
1399         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1400         AttributeUsageAttribute in the emitcontext of the attribute class,
1401         not in the emitcontext of the attributable entity it was attached to.
1402         * cs-parser.jay: Use 'current_class', not 'current_container',
1403         when creating a GlobalAttribute.
1404
1405 2005-04-08  Alp Toker  <alp@atoker.com>
1406
1407         * pending.cs: The fix to #58413 failed to compile methods implementing
1408         interfaces with/without params modifiers and vice versa, even though
1409         params modifiers aren't part of the signature. Make the modifier check
1410         less strict as in csc.
1411
1412 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1413             Anoob V E  <projectmonokochi@rediffmail.com>
1414             Harilal P R  <projectmonokochi@rediffmail.com>
1415
1416         Fix #58413.
1417         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1418         modifiers of pending methods.
1419         (PendingImplementation.PendingImplementation): Initialize it.
1420         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1421         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1422         with ParameterData.  Add check for modifiers.
1423         * class.cs (MethodData.Define): Update to changes.
1424
1425 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1426
1427         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1428
1429 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1432         property.
1433         
1434         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1435         
1436         * rootcontext.cs,
1437         * typemanager.cs: Registered RequiredAttributeAttribute.
1438         
1439 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1440
1441         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1442         Warning CS0169 is back at level 3.
1443         (IMethodData.SetMemberIsUsed): New method.
1444         
1445         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1446         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1447         
1448         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1449
1450         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1451         contants.
1452         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1453         is used.
1454         
1455         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1456         is used.
1457         
1458         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1459         to avoid the problems with nested types.
1460
1461 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1462             Anoob V.E  <projectmonokochi@rediffmail.com>
1463             Harilal P.R  <projectmonokochi@rediffmail.com>
1464             Raja R Harinath  <rharinath@novell.com>
1465
1466         Fix #73820.
1467         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1468         attribute.
1469         * typemanager (GetConstructor): Make public.
1470
1471 2005-04-05  John Luke  <john.luke@gmail.com>
1472             Raja R Harinath  <rharinath@novell.com>
1473
1474         Fix #62232.
1475         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1476         struct too.  Return false quicker in a few cases.
1477         (VerifyUnManaged): Use it.
1478
1479 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1480
1481         Fix #74041.
1482         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1483         not 'unreachable_seen'.
1484
1485 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1486
1487         * attribute.cs (Attribute.GetValue): Removed unused.
1488         
1489         * codegen.cs (CodeGen.TrimExt): Removed unused.
1490         
1491         * cs-parser.jay (output): Removed unused.
1492         
1493         * cs-tokenizer.cs (hex_digits): Removed unused.
1494         
1495         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1496         
1497         * expression.cs (Indirection.LoadExprValue): Removed unused.
1498         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1499         
1500         * iterators.cs (Iterator.param_types): Removed unused.
1501         
1502         * statement.cs (Goto.block): Removed unused.
1503         (ToplevelBlock.did): Removed unused.
1504         (Switch.ResolveConstantSwitch): Removed unused.
1505
1506 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1507
1508         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1509         resetting thingy.
1510
1511 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1512
1513         Fix #74232 and cs0208-3.cs.
1514         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1515         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1516         unmanaged type.  Don't use FieldBuilders when 't' is a
1517         TypeBuilder.  Use ModFlags and MemberType fields.
1518         * class.cs (MemberBase.member_type): Rename from MemberType.
1519         (MemberBase.MemberType): New property.  Determines member_type on
1520         demand.
1521         (MemberBase.DoDefine): Don't initialize MemberType here.
1522         (FieldMember.Define): Likewise.
1523
1524 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1525
1526         Fix #74241
1527         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1528         Attributes are emitted there.
1529         
1530 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1531
1532         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1533         keyword in 'partial enum' too.
1534         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1535         is not allowed).
1536         Report from Kamil Skalski <nazgul@omega.pl>.
1537
1538         Fix #74309.
1539         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1540         have partial containers too.
1541
1542         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1543         in block' checks to Block.CheckInvariantMeaningInBlock.
1544         * statement.cs (Block.GetKnownVariableInfo): Make private.
1545         (Block.IsVariableUsedInChildBlock): Remove.
1546         (Block.IsVariableUsedInBlock): Likewise.
1547         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1548         conflicting declaration.
1549         (Block.AddVariable): Make error messages less long-winded and more
1550         specific.  Show location of conflicting declaration.
1551         * parameter.cs (Parameters.Location): New readonly property.
1552
1553 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1554
1555         Clean up semantics of invoking ResolveMemberAccess.
1556         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1557         can have an instance, ensure that we pass in a non-TypeExpression
1558         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1559         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1560         argument.  Update to changes and simplify.
1561         (FieldExpr.Emitinstance): Remove CS0120 check.
1562         (PropertyExpr.EmitInstance): Likewise.
1563         * expression.cs (Argument.Resolve): Likewise.
1564         (Invocation.DoResolve): Update to changes in semantics of
1565         InstanceExpression.
1566
1567 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1568
1569         Fix #74241
1570         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1571         customization.
1572         
1573         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1574
1575 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1576
1577         Fix difference in behaviour with commandline invocation.
1578         * driver.cs (Driver.Reset): New.
1579         (CompilerCallableEntryPoint): Call it.
1580
1581         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1582         variable" warnings if the boolean expression failed to resolve.
1583
1584 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1585
1586         * attribute.cs: Fix the union of several permissions when some of them
1587         are unrestricted (so the result isn't an unrestricted permission set).
1588         Fix #74036.
1589
1590 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1591
1592         * ecore.cs (MemberExpr): New class.  Convert from interface
1593         IMemberExpr.
1594         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1595         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1596         error checks.
1597         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1598         (MethodGroupExpr.IsExplicitImpl): Remove.
1599         (Expression.GetFieldFromEvent): Remove.
1600         (SimpleName.MemberStaticCheck): Remove.
1601         (SimpleName.DoSimpleNameResolve): Update to changes.
1602         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1603         (MemberAccess.IdenticalNameAndTypeName): Remove.
1604         (MemberAccess.error176): Move to MemberExpr.
1605         (MemberAccess.DoResolve): Update to changes.
1606         (BaseAccess.DoResolve): Likewise.
1607
1608 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1609
1610         C# 2.0 Conditional attribute class implementation
1611         
1612         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1613         Analyzes class whether it has attribute which has ConditionalAttribute
1614         and its condition is not defined.
1615         
1616         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1617         (Class.IsExcluded): New method. Search for at least one defined
1618         condition in ConditionalAttribute of attribute class.
1619
1620 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1621
1622         * ecore.cs (PropertyExpr): Derive from Expression, not
1623         ExpressionStatement.
1624         (PropertyExpr.EmitStatement): Remove.
1625
1626 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1627
1628         Fix #74060.
1629         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1630         internal field "value__" of an enum be private.  The examples for
1631         "value__" that I found on MSDN all used FieldAttributes.Private.
1632
1633         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1634         Don't mention IL method attribute names.
1635
1636         Fix #47991.  Remove a TODO.
1637         * statement.cs (Block.Toplevel): Make into a field.
1638         (Block.Parameters): Move into ToplevelBlock.
1639         (Block.known_variables): Rename from child_variable_names.
1640         (Block.Block): Remove variants that take Parameters.  Initialize
1641         'Toplevel' with the immediately surrounding toplevel block.
1642         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1643         LocalInfo parameter.
1644         (Block.GetKnownVariableInfo): New.
1645         (Block.IsVariableNameUsedInChildBlock): Update.
1646         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1647         the block, even though it may not be in scope.
1648         (Block.AddVariable): Remove Parameters parameter.  Use
1649         Toplevel.Parameters instead.
1650         (Block.AddConstant): Remove Parameters parameter.
1651         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1652         (Block.IsParamaterReference): Likewise.
1653         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1654         (ToplevelBlock.Parameters): New.  Moved from Block.
1655         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1656         initialize Parameters to a non-null value.
1657         * cs-parser.jay: Update to changes.
1658         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1659         simple names that mean different things in the same block.  Use
1660         Block.IsVariableNameUsedInBlock.
1661
1662 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1663
1664         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1665         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1666         GetTypeHandle.  It is possible for a reflected type to derive from
1667         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1668         System.Array during mscorlib compilation).
1669         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1670         contain a method_hash, don't create one either.  Don't create a
1671         deep copy of the base cache's method_hash.
1672         (MemberCache.SetupCache): Rename back from DeepCopy.
1673         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1674         already initialized.  If we see an override function, add its
1675         underlying base virtual function to the member_hash too.
1676
1677         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1678
1679 2005-03-26  Raja R Harinath  <harinath@acm.org>
1680
1681         Fix #73038.
1682         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1683         fails to resolve, ensure that the LHS is still resolved as an
1684         lvalue.
1685
1686 2005-03-25  Raja R Harinath  <harinath@acm.org>
1687
1688         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1689         ec.ContainerType.
1690         (Enum.current_ec): Remove.
1691         (Enum.LookupEnumValue): Remove EmitContext argument.
1692         Just uses the one created during DefineType.
1693         (Enum.FindMembers): Update.
1694         * expression.cs (MemberAccess.DoResolve): Update.
1695
1696 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1697
1698         * assign.cs (Assign.DoResolve): Check for CS1717 when
1699         source and target are same (uses Equals).
1700
1701         * expression.cs (LocalVariableReference, ParameterReference,
1702         This): Implemented Equals, GetHashCode.
1703
1704         * statement.cs (Block.GetParameterReference): Removed useless
1705         local variable.
1706
1707 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1708
1709         Fix cs0128.cs
1710         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1711         blocks before deciding whether the error is cs0136 or cs0128.
1712
1713         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1714         (using_alias_directive, using_namespace_directive): Pass
1715         MemberName, not an expression to Namespace.UsingAlias and
1716         Namespace.Using.
1717         (MakeName): Use the MemberName of the namespace.
1718         * namespace.cs (Namespace.MemberName): New.
1719         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1720         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1721         Likewise.
1722         * decl.cs (MemberName.Name): Make readonly.
1723         (MemberName.FromDotted): New "constructor".
1724         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1725         (MemberCore.Name): Compute from MemberName on demand.
1726         (MemberCore.SetMemberName): Provide a way to change the
1727         MemberName.
1728         (MemberCore.AddToContainer): Don't take a fullname parameter.
1729         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1730         fully qualified name of the container to the member name.
1731         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1732         only if the type is a member of the root container.
1733         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1734         MemberName.Left rather than searching for an embedded ".".
1735         (PartialContainer.CreatePart): Update to changes in RootContext.
1736         (MemberBase.ShortName): Turn into a property.  Use
1737         MemberCore.SetMemberName.
1738         (MemberBase.ExplicitInterfaceName): Remove.
1739         (MemberBase.UpdateMemberName): Remove.
1740         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1741         (PropertyBase.SetMemberName): New override.
1742         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1743         (Tree.GetDecl): New.
1744         (Tree.AllDecls): Rename from Decls.
1745         * attribute.cs, enum.cs, report.cs: Update to changes.
1746         * driver.cs (MainDriver): Use MemberName.FromDotted on
1747         RootContext.MainClass.
1748
1749 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1750
1751         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1752         checks.
1753
1754         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1755
1756 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1757
1758         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1759         property accessor modifiers.
1760
1761         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1762         fixed buffer attribute (CS1716).
1763         (PropertyMethod.HasCustomAccessModifier): When property accessor
1764         has custom modifier.
1765
1766         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1767         modifiers.
1768         (PropertyExpr.DoResolveLValue): Add CS0272.
1769
1770 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1771
1772         * convert.cs: When converting to a pointer, use the proper Conv.U
1773         or Conv.I depending on the source data type.
1774
1775         * cs-tokenizer.cs: Make the size for large decimal constants,
1776         fixes #72957.
1777
1778 2005-03-17  Martin Baulig  <martin@ximian.com>
1779
1780         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1781         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1782
1783 2005-03-17  Martin Baulig  <martin@ximian.com>
1784
1785         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1786         to bool so we can return an error condition.
1787         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1788         returned an error.
1789
1790 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1791
1792         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1793         attributes.
1794
1795 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1796
1797         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1798         Refactor to avoid traversing the list of assemblies, and to avoid
1799         string concatenation.
1800         * typemanager.cs (guid_attr_type): Remove.
1801         (negative_hits, pointers, references): Remove hashes.
1802         (type_hash): New.
1803         (GetConstructedType): New.  Uses type_hash to handle constructed
1804         types (arrays, references, pointers).
1805         (GetReferenceType, GetPointerType): Use it.
1806         (GetNestedType): New.  Uses type_hash to handle nested types of
1807         reflected types.
1808         (LookupType, LookupTypeDirect): Remove.
1809         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1810         'types' hash and LookupTypeReflection directly.
1811         (params_string, params_object): Use GetConstructedType.
1812         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1813         top-level types.
1814         (Namespace.Lookup): Use cached_types.
1815         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1816         provided by old TypeManager.LookupType.
1817         * rootcontext.cs (MakeFQN): Remove.
1818         * decl.cs (DeclSpace.MakeFQN): Likewise.
1819         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1820         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1821         TypeManager.GetConstructedType.
1822         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1823
1824 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1825
1826         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1827         indexers.
1828
1829         * cs-parser.jay: Reports CS1527 for any namespace element.
1830
1831         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1832         Added CS0407.
1833
1834         * expression.cs (ParameterReference.IsAssigned): Changed error to
1835         CS0269.
1836         (Error_WrongNumArguments): Moved CS0245 detection here.
1837
1838         * statement.cs (Return.Resolve): Add CS1622 report.
1839
1840 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1841
1842         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1843
1844 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1845
1846         * attribute.cs expression.cs: Get rid of some allocations.
1847
1848 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1849
1850         * doc.cs : just eliminate the latest change.
1851
1852 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1853
1854         * doc.cs : commented out the latest change. It breaks xml-030.cs
1855
1856 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1857
1858         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1859           fail. So invoke CreateType() in FindDocumentedType().
1860
1861 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1862
1863         * cs-tokenizer.cs : added IsKeyword().
1864         * doc.cs : Detect keyword incorrectly used as identifier.
1865           Allow identifiers prefixed by @.
1866
1867 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1868
1869         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1870         It caused exception in namespace resolving (again!).
1871         
1872         * class.cs (Class.ctor): Removed exit.
1873         (PropertyMethod.ctor): ditto.
1874         
1875         * codegen.cs (Codegen.Reset): Reset static data.
1876         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1877         
1878         * cs-tokenizer.cs (Cleanup): Removed.
1879         
1880         * driver.cs (GetSystemDir): Rewrote to one line command.
1881         It caused problem with unloaded dynamic modules.
1882         (UnixParseOption): Removed Exit.
1883         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1884         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1885         Now can be mcs used as library.
1886         
1887         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1888         empty location.
1889         
1890         * location.cs (Reset): Reset static data.
1891         
1892         * namespace.cs (Reset): Reset static data.
1893         
1894         * report.cs (Report.Reset): Reset static data.
1895         
1896         * rootcontext.cs (RootContext.Reset): Reset static data.
1897         
1898         * tree.cs (RootTypes.ctor): Use Location.Null
1899         
1900         * typemanager.cs (TypeManager.Reset): Reset static data.
1901         (CoreLookupType): Removed Exit.
1902         (TypeHandle.Reset): Reset static data.
1903         
1904 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1905
1906         Fix #73516.
1907         * typemanager.cs (ComputeNamespaces): Import namespaces from
1908         referenced modules too.
1909
1910 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1911
1912         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1913         than '.'.
1914
1915 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1916
1917         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1918         enclosing DeclSpace.  This ensures that a name-lookup populates
1919         more caches and there are fewer 'TypeExpression's.  Carve out
1920         nested type lookup into ...
1921         (LookupNestedTypeInHierarchy): ... this.
1922
1923 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1924
1925         Clean up a few partial-class semantics.  
1926         Fixes test-357.cs and cs1618-2.cs.
1927         * cs-parser.jay (struct_declaration): Use 'current_class' as
1928         parent of newly-created struct.  Remove call to Register ().
1929         Use 'pop_current_class' to complete handing the current struct.
1930         (interface_declaration): Likewise.
1931         (class_declaration): Likewise.
1932         (enum_declaration): Use 'current_class' as parent of newly created
1933         enum.
1934         (delegate_declaration): Likewise.
1935         (pop_current_class): New function.  This is used to handle closing
1936         up the 'current_class' and 'current_container', and pointing them
1937         to the enclosing class/container.
1938         (CSharpParser): Initialize 'current_class' too.
1939         * decl.cs (MemberCore): Add check for invariant: a partial
1940         container is not a parsed entity, and thus does not enclose any
1941         parsed members.
1942         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1943         (DeclSpace.BaseTypeExpr): Use it.
1944         (DeclSpace.LookupType): Add check for invariant.
1945         * class.cs (TypeContainer): Add check for invariant: a nested
1946         class should have the same NamespaceEntry as its enclosing class.
1947         (TypeContainer.EmitFieldInitializers): Make virtual.
1948         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1949         MemberCore.
1950         (TypeContainer.Register): Remove.
1951         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1952         null.  Use TypeResolveEmitContext for resolving base types and
1953         interfaces.  Move initialization of Parts.TypeBuilder here from
1954         ...
1955         (TypeContainer.DefineNestedTypes): ... here.
1956         (PartialContainer): Take a Namespace not a NamespaceEntry.
1957         (PartialContainer.Create): Don't use Register.  Call the
1958         appropriate Add... function directly.
1959         (ClassPart): Take both the PartialContainer and the enclosing
1960         class as constructor arguments.
1961         (ClassPart.EmitFieldInitializers): Override.
1962         (ClassPart.PartFindNestedTypes): Remove.
1963         (FieldBase.GetInitializerExpression): Resolve the initializer
1964         expression in the emit context of the enclosing class.
1965         * tree.cs (RootTypes): Remove Register ().
1966         
1967 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1968
1969         * cs-parser.jay: Removed CS0134.
1970         
1971         * driver.cs: Removed CS1901.
1972         
1973         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1974         for predefined types.
1975
1976 2005-03-07  Duncan Mak  <duncan@novell.com>
1977
1978         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1979         well. Fixes bug #73454.
1980
1981 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1982
1983         * cs-tokenizer.cs (xtoken): Add CS1035.
1984         
1985         * class.cs (MethodData.Define): Add CS0683.
1986         (FieldMember.ctor): Add CS0681.
1987
1988 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1989
1990         * ecore.cs (SimpleName.DoResolve): Rename from
1991         SimpleName.DoResolveAllowStatic.
1992         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1993         Pass 'intermediate' flag to MemberStaticCheck.
1994         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1995         of "intermediate" lookups via MemberAccess.
1996         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1997         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1998
1999 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2000
2001         Fix #73394.
2002         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2003         slipped in because of variable names that are identical to a
2004         builtin type's BCL equivalent ('string String;', 'int Int32;').
2005         (PropertyExpr.EmitInstance): Likewise.
2006
2007 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2008
2009         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2010         
2011         * report.cs (warning_ignore_table): Made public.
2012
2013 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2014
2015         Fix #73282.
2016         * class.cs (MethodData.Emit): Pass 'container' to
2017         container.GetObsoleteAttribute instead of 'container.Parent'.
2018
2019 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2020
2021         * cs-parser.jay: Add 1534 error test.
2022
2023         * iterators.cs (Yield.CheckContext): Add error 1629.
2024         (Iterator.ctor): Save unsafe modifier.
2025         (MoveNextMethod.DoEmit): Restore unsafe context.
2026
2027         * namespace.cs (UsingAlias): Better error message.
2028
2029 2005-03-03  Dan Winship  <danw@novell.com>
2030
2031         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2032         the warning message [#73219]
2033
2034 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2035
2036         Fix compile with MCS 1.0.0.0.
2037         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2038         w_restore to not depend on string constant folding.
2039
2040 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2041
2042         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2043         CS0246 check to users who passed 'silent = false'.
2044         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2045         check.
2046         (SimpleName.SimpleNameResolve): Update.
2047         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2048         (MemberAccess.IdenticalNameAndTypeName): Update.
2049         * doc.cs (FindDocumentedTypeNonArray): Update.
2050
2051 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2052
2053         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2054         * parameters.cs (ComputeAndDefineParameters): Remove.
2055         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2056         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2057         Use GetParameterInfo.
2058
2059 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2060
2061         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2062
2063 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2064
2065         Unify DeclSpace.LookupType and DeclSpace.FindType.
2066         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2067         is in charge of defining nested types on demand.
2068         (DeclSpace.LookupType): Use it when the current_type is a
2069         TypeBuilder.  Use LookupTypeDirect for reflected types.
2070         (DeclSpace.FindType): Remove.
2071         (DeclSpace.LookupInterfaceOrClass): Likewise.
2072         (DeclSpace.DefineTypeAndParents): Likewise.
2073         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2074         DeclSpace.LookupType.
2075         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2076         * typemanager.cs (LookupType): Simplify.
2077         (AddUserType): Remove type from negative_hits.
2078         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2079         * class.cs (TypeContainer.FindMembers): Move handling of nested
2080         types ...
2081         (TypeContainer.FindMembers_NestedTypes): ... here.
2082         (TypeContainer.FindNestedType): Implement override.
2083         (ClassPart.FindNestedType): Delegate to PartialContainer.
2084         (ClassPart.PartFindNestedType): Looks up the nested types of the
2085         part alone.
2086
2087 2005-03-02  Martin Baulig  <martin@ximian.com>
2088
2089         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2090         static constructor in static classes.
2091
2092 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2093
2094         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2095         sizeParamIndex is not specified.
2096
2097 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2098
2099         Fix #73117
2100         * report.cs (WarningMessage.IsEnabled): Missing null check.
2101
2102 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2103
2104         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2105         in the fields and not in the properties.
2106
2107 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2108
2109         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2110         fields as well.
2111
2112 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2113
2114         * attribute.cs: Small refactoring (improved robustness).
2115         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2116         (ValidateGuid): Removed.
2117         (Resolve): Removed referenced to above mentioned.
2118         (GetAttributeUsage): Made private and changed to work without
2119         class assistance.
2120         (GetIndexerAttributeValue): Don't crash.
2121         (GetConditionalAttributeValue): Ditto.
2122         (GetClsCompliantAttributeValue): Ditto.
2123         (ExtractSecurityPermissionSet): All attributes exceptions are
2124         error 648.
2125         (GetPropertyValue): New helper.
2126         (GetMethodImplOptions): New method.
2127         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2128         some missing properties.
2129         
2130         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2131         (Method.ApplyAttributeBuilder): Updated.
2132         
2133         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2134         exception.
2135
2136 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2137
2138         Fix #73052.
2139         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2140         non-simple types (array, pointer, reference).
2141
2142 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2143
2144         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2145
2146         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2147         for operators.
2148         (Method.CheckBase): Catch wrong destructor here.
2149         (MethodData.Define): Add errors 550, 668.
2150
2151         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2152
2153         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2154
2155         * pending.cs (VerifyPendingMethods): Add error 551.
2156
2157         * typemanager.cs (CSharpName): Next error report helper.
2158
2159 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2160
2161         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2162         attributes. Removed useless attribute double check.
2163         It saves almost 2MBs for corlib.
2164
2165 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2166
2167         Fix #72924.
2168         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2169         called twice in case of error.
2170
2171 2005-02-23  Chris Toshok  <toshok@ximian.com>
2172
2173         Fix compiler portions of #72827.
2174         * statement.cs (Block.Emit): call Begin/EndScope on the
2175         EmitContext instead of the ILGenerator.
2176
2177         * codegen.cs (EmitContext.BeginScope): new method, call
2178         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2179         we have one.)
2180         (EmitContext.BeginScope): same, but EndScope and CloseScope
2181
2182         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2183         offset and call the superclass's OpenScope(int) with it.
2184         (SymbolWriter.CloseScope): get the current il
2185         offset and call superclass's CloseScope(int) with it.
2186
2187 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2188
2189         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2190         CS1677 for out and ref as well.
2191
2192         * class.cs (Method.Define): Add error CS1599 detection.
2193         
2194         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2195         
2196         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2197         
2198         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2199         
2200         * support.cs.cs (ModifierDesc): New helper method.
2201
2202 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2203             Abin Thomas  <projectmonokochi@rediffmail.com>
2204             Anoob V E  <projectmonokochi@rediffmail.com>
2205             Harilal P R  <projectmonokochi@rediffmail.com>
2206
2207         Fix #57851, #72718.
2208         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2209         MemberLookup (used for error reporting) actually returns a result.
2210         Fix error report number (122, not 112).
2211
2212 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2213             Anoob V E  <projectmonokochi@rediffmail.com>
2214             Harilal P R  <projectmonokochi@rediffmail.com>
2215
2216         Fix #71134.
2217         * pending.cs (PendingImplementation.GetAbstractMethods):
2218         Find NonPublic members too.
2219
2220 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2221
2222         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2223         Fixed error 217.
2224         
2225         * class.cs (MethodCore.CheckMethodAgainstBase):
2226         Add error 239 report.
2227
2228 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2229
2230         Fix #68955.
2231         * expression.cs (Invocation.IsApplicable): Make public.
2232         (Invocation.IsParamsMethodApplicable): Likewise.
2233         * delegate.cs (Delegate.VerifyApplicability): Don't use
2234         Invocation.VerifyArgumentCompat for parameter applicability
2235         testing.  Use Invocation.IsApplicable and
2236         Invocation.IsParamsMethodApplicable.
2237
2238 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2239
2240         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2241         
2242         * class.cs (Operator.Define): Add error 217 report.
2243         
2244 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2245
2246         * namespace.cs (UsingEntry.Resolve): Undo change below.
2247
2248 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2249
2250         Fix #72756.
2251         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2252         disable the error message when the extended MemberLookup also
2253         fails.
2254         (Expression.MemberLookupFinal): Update.
2255         (SimpleName.DoSimpleNameResolve): Update.
2256         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2257         Don't use MemberLookupFinal.
2258         (New.DoResolve): Update.
2259         (BaseAccess.CommonResolve): Update.
2260
2261 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2262
2263         Fix #72732.
2264         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2265         occured previously, don't resolve again.
2266
2267 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2268
2269         Fix #69949
2270         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2271         argument. Call ResolveAttributeUsage for unresolved.
2272         when types doesn't match ctor arguments.
2273         
2274         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2275         for nested attribute classes.
2276         (Class.attribute_usage): Removed.
2277         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2278         for attribute class.
2279         
2280         * ecore.cs (IsAttribute): Removed.
2281         
2282         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2283         
2284         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2285         now normal types.
2286         (attribute_types): Removed.
2287         (EmitCode): Global attributes are emited as the latest.
2288
2289 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2290
2291         * class.cs (EmitFieldInitializers): Don't emit field initializer
2292         for default values when optimilization is on.
2293         
2294         * constant.cs (Constant.IsDefaultValue): New property.
2295         
2296         * driver.cs: Add /optimize handling.
2297         
2298         * constant.cs,
2299         * ecore.cs,
2300         * literal.cs: Implement new IsDefaultValue property.
2301         
2302         * rootcontext.cs (Optimize): New field, holds /optimize option.
2303
2304 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2305
2306         Fix crasher in re-opened #72347.
2307         * namespace.cs (Namespace.Lookup): Return null if
2308         DeclSpace.DefineType returns null.
2309
2310         Fix #72678.
2311         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2312
2313 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2314
2315         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2316         now returns null if it cannot resolve to an lvalue.
2317         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2318         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2319         returned null.  Remove check for SimpleName.
2320         (EventExpr.DoResolveLValue): New.
2321         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2322         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2323         error from ...
2324         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2325         avoid CS0131 error.
2326         (Unary.ResolveOperator): Move CS0211 check ...
2327         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2328         CS0131 error.
2329         (Unary.DoResolveLValue): Simplify.
2330         (AddressOf.DoResolveLValue): New.
2331         (ArrayAccess.DoResolveLValue): New.
2332
2333 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2334
2335         * attribute.cs (Attribute.Resolve): Add arguments casting for
2336         when types doesn't match ctor arguments.
2337
2338 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2339
2340         Fix parts of #63202.
2341         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2342         lookup of operator in base type.  Ensure that all checks happen
2343         when the operator resolves to an "op_..." method.
2344
2345 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2346
2347         Fix #71992.
2348         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2349         'ignore_cs0104' parameter.  Pass it to ...
2350         (NamespaceEntry.Lookup): ... this.
2351         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2352         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2353         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2354         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2355         Update.  Request that cs0104 errors be ignored.
2356         (ComposedCast.ResolveAsTypeStep): Update.
2357
2358 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2359
2360         Fix #59209.
2361         * expression.cs (Invocation.BetterFunction): Remove support for
2362         comparing virtual functions and their overrides.
2363         (Invocation.IsOverride): New.
2364         (Invocation.OverloadResolve): Don't consider 'override' functions
2365         during candidate selection.  Store them in a lookaside list.
2366         If the selected method is a 'virtual' function, use the list to
2367         find any overrides that are closer to the LHS type.
2368
2369 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2370
2371         * expression.cs (New.DoResolve): Add complex core type reduction.
2372         (New.Constantify): Converts complex core type syntax like 'new int ()'
2373         to simple constant.
2374         
2375 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2376
2377         * decl.cs (EntryType.EntryType): New constructor to create an
2378         updated copy of a cache entry.
2379         (MemberCache.AddMethods): Use it.
2380         (MemberCache.ClearDeclaredOnly): Remove.
2381         (MemberCache.MemberCache): Update.
2382
2383 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2384
2385         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2386         variable.  This one is represents the actual low-level declaration
2387         of the method, as opposed to the semantic level `IsStatic'.   
2388
2389         An anonymous method which is hosted into a static method might be
2390         actually an instance method.  IsStatic would reflect the
2391         container, while MethodIsStatic represents the actual code
2392         generated.
2393
2394         * expression.cs (ParameterReference): Use the new MethodIsStatic
2395         instead of IsStatic.
2396
2397         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2398         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2399         set on the current EmitContext. 
2400
2401         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2402         resolve our casted expression as an LValue.  This triggers the
2403         proper LValue processing that is later required by Assign.
2404
2405         This fixes 72347.
2406
2407         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2408
2409 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2410
2411         C# 2.0 Fixed buffer implementation
2412
2413         * anonymous.cs: Update after RegisterHelperClass renaming.
2414
2415         * attribute.cs (AttributeTester.fixed_buffer_cache):
2416         Cache of external fixed buffers.
2417         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2418         implementation if field is fixed buffer else null.
2419
2420         * class.cs
2421         (TypeContainer.AddField): Accept FieldMember instead of Field.
2422         (FieldBase.IsFieldClsCompliant): Extracted code from
2423         VerifyClsCompliance descendant customization.
2424         (FixedField): New class handles fixed buffer fields.
2425         (FixedFieldExternal): Keeps information about imported fixed
2426         buffer.
2427         (IFixedField): Make access to internal or external fixed buffer
2428         same.
2429
2430         * cs-parser.jay: Add fixed buffer parsing.
2431
2432         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2433         buffer.
2434
2435         * expression.cs (Indirection): Extended implementation to accept
2436         fixed buffer field.
2437         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2438         (ElementAccess.MakePointerAccess): Get type as parameter.
2439         (DoResolve): Add fixed buffer field expression conversion.
2440         (DoResolveLValue): Ditto.
2441         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2442         (ArrayPtr): Derives from FixedBufferPtr.
2443         (ArrayPtr.Emit): Add extra emit for array elements.
2444
2445         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2446
2447         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2448         for compiler generated types.
2449         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2450
2451         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2452         and consume less memory.
2453         (Fixed.Resolve): Add fixed buffer case.
2454
2455         * typemanager.cs (compiler_generated_attr_ctor,
2456         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2457         (HasElementType): Add our own implementation to work on every
2458         runtime.
2459
2460 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2461
2462         * anonymous.cs (CaptureContext): Track whether `this' has been
2463         referenced.   
2464
2465         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2466         only captured `this' if it was implicitly done (instance
2467         methods/variables were used). 
2468
2469         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2470         `this' must be captured.
2471
2472 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2473  
2474         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2475         is null it means that there has been no need to capture anything,
2476         so we just create a sibling.
2477
2478         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2479
2480         Just a partial fix.  The other half is fairly elusive.
2481         
2482 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2483
2484         Fix #52586, cs0121-4.cs.
2485         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2486         and return a hashtable.
2487         (MemberCache.ClearDeclaredOnly): New.
2488         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2489         the method_hash of a base type too.
2490         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2491         type methods.  Overwrite entries with the same MethodHandle so
2492         that the ReflectedType is correct.  The process leaves in base
2493         virtual functions and their overrides as distinct entries.
2494         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2495         matters since it was boxed in a ArrayList before.
2496         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2497         modifier.
2498         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2499         case of a virtual function and its override (choose the overload
2500         as better).
2501         (Invocation.OverloadResolve): Avoid 'override' members during
2502         'applicable_type' calculation.
2503
2504 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2505
2506         Combine two near-redundant caches.
2507         * typemanager.cs (method_params): Rename from method_internal_params.
2508         (TypeManager.GetParameterData): New.  Replace
2509         Invocation.GetParameterData.
2510         (TypeManager.LookupParametersByBuilder): Remove.
2511         * expression.cs (Invocation.method_parameter_cache): Remove.
2512         (Invocation.GetParameterData): Remove.
2513         Update to changes.
2514         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2515         Update to changes.
2516
2517 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2518
2519         Fix #72015.
2520         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2521         TypeManager.multicast_delegate_type is null, resolve it by looking
2522         up "System.MulticastDelegate".
2523         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2524
2525 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2526             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2527             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2528
2529         Fix cs0164.cs.
2530         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2531         (LabeledStatement.AddReference): New.  Set 'referenced'.
2532         (Goto.Resolve): Use it.
2533
2534 2005-02-05  John Luke  <john.luke@gmail.com>
2535
2536         * driver.cs: remove duplicate -doc line in Usage ()
2537
2538 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2539
2540         * location.cs (Location.AddFile): Fix CS2002 error report.
2541
2542 2005-02-02  Martin Baulig  <martin@ximian.com>
2543
2544         * delegate.cs (Delegate.DefineType): Report an internal error if
2545         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2546         details.        
2547
2548 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2549
2550         Fix a crasher in a variant of #31984.
2551         * const.cs (Constant.CheckBase): New override that defers the
2552         new-or-override check in case the base type hasn't been populated
2553         yet.
2554         (Constant.Define): Ensure the new-or-override check is performed.
2555
2556 2005-02-01  Duncan Mak  <duncan@ximian.com>
2557
2558         * const.cs (LookupConstantValue): Check that `ce' is not null
2559         before calling GetValue ().
2560
2561 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2562
2563         Fix test-334.cs (#69519).
2564         * cs-parser.jay (using_alias_directive): Pass in an expression to
2565         NamespaceEntry.UsingAlias.
2566         (using_namespace_directive): Pass in an expression to
2567         NamespaceEntry.Using.
2568         (namespace_name): Don't flatten to a string.
2569         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2570         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2571         ResolveAsTypeStep.
2572         (NamespaceEntry.UsingEntry): Likewise.
2573         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2574         changes.
2575         (NamespaceEntry.LookupForUsing): Remove.
2576         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2577         names.
2578         (NamespaceEntry.Lookup): Remove support for dotted names.
2579
2580 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2581
2582         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2583         split into two.
2584         (NamespaceEntry.ImplicitParent): Compute on demand.
2585         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2586         parallels the current.
2587         (NamespaceEntry.LookupForUsing): Use it.
2588         (NamespaceEntry.Lookup): If the current namespace-entry is
2589         implicit, don't search aliases and using tables.
2590
2591 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2592
2593         Fix #31984.
2594         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2595         BaseCache here.
2596         (TypeContainer.BaseCache): Compute on demand.
2597         (TypeContainer.FindMembers): Define constants and types if they're
2598         not already created.
2599         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2600         check.
2601         * const.cs (Constant.Define): Make idempotent.
2602
2603 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2604
2605         * pending.cs: Produce better code (no nops produced by using Ldarg
2606         + value).
2607         
2608         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2609         i - 1' it should be arg + 1.
2610
2611         Fixes bug #71819.
2612
2613 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2614
2615         * attribute.cs (Attribute.CheckAttributeType): Make private
2616         non-virtual.
2617         (Attribute.ResolveType): Make virtual.
2618         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2619         handling of RootContext.Tree.Types.
2620
2621 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2622
2623         Update attribute-handling to use the SimpleName/MemberAccess
2624         mechanisms.
2625         * cs-parser.jay (attribute): Pass in an expression to the
2626         constructors of Attribute and GlobalAttribute.
2627         * attribute.cs (Attribute): Take an expression for the name.
2628         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2629         passed in attribute name expression.
2630         (Attribute.CheckAttributeType): Use it.
2631         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2632         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2633         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2634         argument to prevent error messages if the lookup fails.
2635
2636 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2637
2638         * expression.cs (Indirection): Implemented IVariable interface
2639         to support indirection in AddressOf operator.
2640         (PointerArithmetic.Emit): Add optimalization for case where
2641         result can be precomputed.
2642
2643 2005-01-26  Martin Baulig  <martin@ximian.com>
2644
2645         * class.cs (TypeContainer.AttributeTargets): Return the correct
2646         AttributeTargets depending on our `Kind' instead of throwing an
2647         exception; fixes #71632.
2648
2649 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2650
2651         Fix #71257
2652         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2653         constant members.
2654
2655 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2656
2657         Fix #71602.
2658         * expression.cs (MemberAccess.DoResolve): Don't complain with
2659         cs0572 when the LHS of a member access has identical name and type
2660         name.
2661
2662 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2663
2664         Fix #71651, #71675
2665         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2666         CreatePermission.
2667         Create custom PermissionSet only for PermissionSetAttribute.
2668
2669 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2670
2671         Fix #71649
2672         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2673         delegates in static class.
2674
2675 2005-01-24  Martin Baulig  <martin@ximian.com>
2676
2677         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2678         merging an implicit block, just use its reachability.
2679
2680         * statement.cs (Block.Resolve): Make the unreachable code check
2681         work wrt. implicit blocks; see test-337 from #63842.
2682
2683 2005-01-21  Alp Toker  <alp@atoker.com>
2684  
2685         * cs-parser.jay: destructor_declaration's container is PartialContainer
2686         not Class when partial types are used, so use Kind prop instead of
2687         'is'.
2688         
2689 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2690
2691         * cs-parser.jay: Improve error reporting when an interface
2692         declares new types.
2693
2694 2005-01-20  Dick Porter  <dick@ximian.com>
2695
2696         * support.cs: SeekableStreamReader fix from Sandor Dobos
2697         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2698         chars are read.  Fixes bug 70369.
2699
2700 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2701
2702         * cs-parser.jay (catch_clause): Simplify current_block handling
2703         somewhat.
2704
2705 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2706
2707         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2708         code with ImplicitStandardConversion to handle the implicit
2709         conversion of method groups into valid delegate invocations. 
2710
2711         The problem is that in parameter handling we were using this code
2712         path.  Fixes bug #64698
2713
2714 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2715
2716         * cs-parser.jay: Fix several infelicities.
2717         - Avoid assigning to the parser value stack.  Code like 
2718           '$3 = null' is unclean.  Synthesize a value for the code block
2719           instead. 
2720         - Avoid using oob_stack for storing location information.  Use ...
2721         (_mark_): ... this.  New (empty) rule.  Saves the current location
2722         in $$.
2723         (foreach_statement): Avoid using oob_stack for current_block
2724         handling.  Use technique used in for_statement and
2725         using_statement.  Synthesize a value for the code block to store
2726         additional intermediate information.
2727
2728 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2729
2730         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2731         of a different type is only allowed to private fields of a
2732         containing type, not on fields of a base class.
2733
2734         See test-174.cs and error cs0122-9.cs
2735
2736 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2737
2738         Fix test-335.cs (bug #58126).
2739         * cs-parser.jay (argument): Split out non-expression parts of the
2740         rule into 'non_simple_argument'.
2741         (invocation_expression): Support parenthesized invocations with
2742         multiple arguments, and with single non-simple arguments.
2743
2744 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2745
2746         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2747         places.
2748
2749 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2750
2751         Fix cs0038-1.cs, cs1640-6.cs.
2752         * ecore.cs (Expression.Resolve): Remove special-case for
2753         SimpleName in error-handling.
2754         (Expression.almostMatchedMembers): Relax access permission to
2755         protected.
2756         (Expression.MemberLookupFailed): Handle duplicates in
2757         almostMatchedMembers list.
2758         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2759         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2760         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2761         overload if the passed in MemberInfo is a MethodBase.
2762
2763 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2764
2765         Fix #70749
2766         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2767         for non-CAS & merge permission sets properly.
2768
2769 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2770
2771         Improve standard-compliance of simple name and member access 
2772         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2773         * ecore.cs (FullNamedExpression): New abstract base class 
2774         for Namespaces and TypeExpressions.
2775         (ResolveFlags.SimpleName): Remove.
2776         (SimpleName): Remove support for dotted names.
2777         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2778         DeclSpace.FindType and DeclSpace.LookupType.
2779         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2780         (Expression.ExprClassName): Make member function.
2781         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2782         a namespace.  Remove creation of dotted "SimpleName"s.
2783         (MemberAccess.DoResolve): Likewise.
2784         * decl.cs (DeclSpace.Cache): Make private.
2785         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2786         (DeclSpace.FindType): Update.
2787         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2788         FullNamedExpression.
2789         * namespace.cs (Namespace): Derive from FullNamedExpression
2790         so that it can be part of expression resolution.
2791         (Namespace.Lookup): Return an FullNamedExpression.
2792         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2793         namespace.
2794         * rootcontext.cs (NamespaceLookup): Remove.
2795         (LookupType): Move to DeclSpace.
2796         * attribute.cs (CheckAttributeType): Update.
2797         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2798         (FindDocumentedTypeNonArray): Likewise.
2799
2800 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2801
2802         Fix cs0509.cs, cs1632.cs.
2803         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2804         is the same as IsInterface.
2805         (TypeContainer.GetClassBases): Likewise.
2806         * statement.cs (LabeledStatement.ig): New field.
2807         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2808         label.
2809         (LabeledStatement.DoEmit): Check that the label was created with
2810         the same ILGenerator.
2811
2812 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2813
2814         Fix #71058
2815         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2816         accessors to its properties.
2817
2818         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2819         from accessors to property.
2820         
2821 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2822
2823         Fix #70722
2824         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2825         only for overrides.
2826         
2827 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2828
2829         * attribute.cs: Check for null and empty strings.  
2830
2831         I have lost another battle to Paolo.
2832
2833 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2834
2835         Fix #70942
2836         * class.cs (PropertyMethod): Set Parent field in ctors.
2837         (SetMethod.InternalParameters): Add unsafe switch hack.
2838         Override MarkForDuplicationCheck where it is appropriate.
2839
2840         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2841         It says whether container allows members with the same name.
2842         Base default is no.
2843         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2844         Removed is_method parameter.
2845
2846 2005-01-06  Duncan Mak  <duncan@ximian.com>
2847
2848         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2849         because the previous change led to incorrect reporting of CS1032
2850         ("Cannot define/undefine preprocessor symbols after first token in
2851         file"). Instead of using `tokens_seen' as the only flag that
2852         triggers CS1040, introduce `comments_seen'. This new flag is used
2853         to signify having seen comments on the current line, so it is
2854         unset after a newline.
2855
2856 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2857
2858         * doc.cs : When searching for a type, find nested type too.
2859           This fixes bug #71040.
2860
2861 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2862
2863         * doc.cs :
2864           - Warn missing member comment on those classes which also does not
2865             have doc comments. Fixed bug #71041.
2866           - Don't warn missing doc comment on default constructor.
2867             Fixed bug #71042.
2868
2869 2005-01-06  Duncan Mak  <duncan@ximian.com>
2870
2871         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2872         comments, set `tokens_seen' to true. This allows us to detect
2873         misplaced preprocessor directives (i.e. not at the beginning of
2874         the a line, nor after whitespaces). In that case, report error
2875         CS1040. This fixes bug #56460.
2876
2877         * cs-parser.jay (interface_member_declaration): Add checks for
2878         IsExplicitImpl, and report CS0541 error if an interface member is
2879         defined as an explicit interface declaration.
2880
2881 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2882
2883         Fix #70817
2884         * class.cs (PropertyMethod): Set Parent field in ctors.
2885         (SetMethod.InternalParameters): Add unsafe switch hack.
2886         
2887         * decl.cs (MemberCore.Parent): Cannot be readonly.
2888
2889 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2890
2891         * decl.cs (DeclSpace.ResolveType): Remove.
2892         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2893         Merge in code from ...
2894         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2895         * class.cs, enum.cs: Update to changes.
2896
2897 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2898
2899         * anonymous.cs: Ensure that we init the scope of our parent if it
2900         has not been initialized yet.
2901
2902 2004-12-30  Duncan Mak  <duncan@ximian.com>
2903
2904         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2905         if field.FieldBuilder is null. Fixes #70758.
2906
2907         * convert.cs: Fixed some typos and updated some of the comments.
2908         (ImplicitStandardConversionExists):
2909         (TryImplicitIntConversion): If `target_type' is an interface and
2910         the type of `ic' implements this interface, return true or a new
2911         BoxedCast instead of null. This fixes #70468.
2912
2913 2004-12-29  Duncan Mak  <duncan@ximian.com>
2914
2915         * expression.cs (Argument.Emit): Check that Expr is
2916         IMemoryLocation before casting to it, and report CS1510 otherwise.
2917
2918         This fixes #70402.
2919
2920 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2921
2922         * statement.cs (Block.ThisVariable): remove the recursion here, to
2923         make the --profile more sane.
2924
2925 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2926
2927         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2928         assembly, by JB Evain.
2929
2930 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2931
2932         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2933           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2934         "parent" refers to enclosing type/class.  "base" refers to superclass.
2935
2936 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2937
2938         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2939         Ensure that we only have GlobalAttributes.
2940         * attribute.cs (Attribute.Emit): Make non-virtual.
2941         (GlobalAttribute.Emit): Remove.
2942         (Attribute.Resolve): Make virtual.
2943         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2944         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2945         the argument. Don't create one.
2946         (Attribute.GetObsoleteAttribute): Likewise.
2947         (Attribute.GetClsCompliantAttributeValue): Likewise.
2948         * class.cs, decl.cs: Update to changes.
2949
2950 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2951
2952         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2953         
2954         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2955         
2956         * statement.cs (Foreach.Resolve): Add error 186 report.
2957
2958 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2959
2960         * expression.cs (Conditional.DoResolve): Add warning 429.
2961         
2962         * statement.cs (If.Resolve): Add warning 665.
2963
2964 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2965
2966         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2967         except when in the parser, and in GlobalAttribute.
2968         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2969         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2970         RootContext.Tree.Types.NamespaceEntry once work is done.
2971         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2972         and resets RootContext.Tree.Types.NamespaceEntry.
2973
2974 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2975
2976         * cs-parser.jay: Don't create a block for every variable.
2977
2978 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2979
2980         * location.cs: Provide extra information.
2981
2982         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2983         variables from the captured environment, it is the ldarg_0.
2984
2985 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2986
2987         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2988         find a conclusion.
2989         
2990         * class.cs: Changed warning level for 169 to avoid developer
2991         displeasure from warning flooding. It will be changed back when they
2992         fix most of current BCL warnings.
2993         
2994         * RootContext.cs: Pushed default WarningLevel to 3.
2995         
2996         * statement.cs: Removed unused variable.
2997
2998 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2999
3000         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3001         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3002         Add error 502 report.
3003         (StaticClass.DefineType): Add error 441 report.
3004         (Class.AllowedModifiersProp): New virtual property as temporary
3005         extension to AllowedModifiers.
3006         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3007         to share implementation with StaticClass and don't call virtual
3008         methods from ctor.
3009         
3010         * driver.cs (MainDriver): Add error 1558 test.
3011
3012         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3013         report. Moved error 36 test here.
3014
3015         * statement.cs (Throw.Resolve): Add error 724 report.
3016
3017         * typemanager.cs: Add out_attribute_type core type.
3018         
3019 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3020
3021         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3022         3018 report.
3023         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3024
3025         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3026         3017 report.
3027         
3028         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3029
3030         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3031         Add error 3023 report.
3032         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3033
3034         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3035         implementation.
3036
3037 2004-12-12  John Luke  <john.luke@gmail.com>
3038
3039         * driver.cs (AddArgs): take -- into account when
3040         adding arguments, fixes bug 65710 
3041
3042 2004-12-12  Martin Baulig  <martin@ximian.com>
3043
3044         * expression.cs (Unary.TryReduceNegative): Added support for
3045         SByteConstant and ByteConstant.
3046         (Unary.Reduce): Check error values from TryReduceNegative().
3047
3048 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3049
3050         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3051         and report exception as error 182.
3052
3053 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3054
3055         * driver.cs (Main): Fix message when there are warnings.
3056
3057 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3058
3059         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3060
3061 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3062
3063         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3064         Reduced number of warnings.
3065         
3066         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3067
3068 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3069
3070         * driver.cs: Removed message.
3071
3072         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3073
3074 2004-12-08    <vargaz@freemail.hu>
3075
3076         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3077
3078 2004-12-08  Martin Baulig  <martin@ximian.com>
3079
3080         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3081         instead of a CS3002 for properties and indexer.
3082
3083 2004-12-08  Martin Baulig  <martin@ximian.com>
3084
3085         * decl.cs (MemberName.ToString): Make this work again.
3086
3087 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3088
3089         * attribute.cs (Resolve): Add error 591 detection.
3090
3091         * class.cs (FieldMember.Define): Add error 1547 detection.
3092         (Indexer.Define): Add error 620 detection.
3093         (Operator.Define): Add error 590 detection.
3094
3095         * ecore.cs: Missing argument for error 79.
3096
3097         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3098         detection.
3099
3100 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3101
3102         Fix #70106
3103         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3104         only.
3105
3106 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3107
3108         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3109           Some operator comments were suppressed.
3110         * doc.cs : Implicit/explicit operator name in doc comments are like
3111           "op_Explicit(type)~returnType", so added suffix handling.
3112
3113 2004-12-07  Martin Baulig  <martin@ximian.com>
3114
3115         * decl.cs
3116         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3117         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3118         (DeclSpace.ec): New protected field; store the EmitContext here.
3119         (DeclSpace.EmitContext): New public property; moved here from
3120         `TypeContainer'.
3121         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3122         EmitContext.
3123
3124         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3125         (Enum.Emit): Don't create a new EmitContext.
3126
3127         * delegate.cs (Delegate.DefineType): Always create the
3128         EmitContext.
3129
3130         * iterators.cs (Iterators.DefineIterator): Create a new
3131         EmitContext and store it in `ec'.
3132
3133 2004-08-24  Martin Baulig  <martin@ximian.com>
3134
3135         * typemanager.cs
3136         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3137         this for accessibility checks.
3138         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3139         IsNestedFamilyAccessible.
3140         (TypeManager.IsSubclassOf): New method, do what the name actually
3141         says.   
3142
3143 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3144
3145         Fix crash on cs0657-17.cs.
3146         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3147         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3148         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3149         the case where the NamespaceEntry gets overwritten.
3150
3151 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3152
3153         Fixed #69195, #56821
3154         * ecore.cs (ResolveBoolean): Tiny refactoring.
3155
3156         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3157         of right expression resolving when left is false constant and
3158         operator is LogicalAnd OR true constant and operator is LogicalOr.
3159
3160         * statement.cs (ResolveUnreachable): Always reports warning.
3161
3162 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3163
3164         * class.cs: Distinguish between 1721 and 1722 (just a little help
3165         for the programmer).
3166
3167 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3168
3169         * delegate.cs: Only allow this on new versions of the language. 
3170
3171 2004-12-02  Duncan Mak  <duncan@ximian.com>
3172
3173         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3174         Expression class.
3175         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3176         here as a static method. Take an additional bool out parameter
3177         `must_do_cs1540_check' for signaling to InstanceResolve.
3178         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3179         member field from PropertyExpr class and made it an argument of
3180         the method instead.
3181         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3182         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3183         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3184         and `remove_accessor' as well as InstanceResolve: report CS0122
3185         where applicable.
3186
3187         Fixes #70129.
3188
3189 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3190
3191         Fix test-327.cs, test-328.cs, and put in early infrastructure
3192         for eventually fixing #52697.
3193         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3194         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3195         from other methods.
3196         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3197         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3198         (VerifyUsing, error246): Update.
3199         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3200         'NamespaceEntry.LookupNamespaceOrType'.
3201
3202 2004-12-03  Martin Baulig  <martin@ximian.com>
3203
3204         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3205         method as our child, call AnonymousMethod.Compatible() on it.
3206
3207 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3208
3209         Disable XML documentation support in 'basic' profile.
3210         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3211         Redirect XmlElement to System.Object.
3212         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3213         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3214         * mcs.exe.sources: Add doc-bootstrap.cs.
3215         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3216         of doc.cs.
3217
3218 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3219
3220         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3221           comments are allowed.
3222
3223 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3224
3225         * delegate.cs: Add checks for subtypes in paramaters and return values
3226         in VerifyMethod () to add support for Covariance/Contravariance
3227         in delegates.
3228         
3229 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3230
3231         * report.cs: Remove extra closing parenthesis.
3232
3233         * convert.cs (Error_CannotImplicitConversion): If the name of the
3234         types are the same, provide some extra information.
3235
3236         * class.cs (FieldBase): Use an unused bit field from the field to
3237         encode the `has_offset' property from the FieldMember.  This saves
3238         a couple of Ks on bootstrap compilation.
3239
3240         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3241         method as our child, return the AnonymousMethod resolved
3242         expression.
3243
3244         * expression.cs (New.DoResolve): Allow return values from
3245         NewDelegate to also include AnonymousMethods.
3246
3247         Fixes #70150.
3248
3249 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3250
3251         Fix bug #70102
3252         * attribute.cs (Resolve): Improved implementation of params
3253         attribute arguments.
3254
3255         * support.cs (ParameterData): Add HasParams to be faster.
3256
3257 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3258
3259         all things are for /doc support:
3260
3261         * doc.cs: new file that supports XML documentation generation.
3262         * mcs.exe.sources: added doc.cs.
3263         * driver.cs:
3264           Handle /doc command line option.
3265           Report error 2006 instead of 5 for missing file name for /doc.
3266           Generate XML documentation when required, after type resolution.
3267         * cs-tokenizer.cs:
3268           Added support for picking up documentation (/// and /** ... */),
3269           including a new XmlCommentState enumeration.
3270         * cs-parser.jay:
3271           Added lines to fill Documentation element for field, constant,
3272           property, indexer, method, constructor, destructor, operator, event
3273           and class, struct, interface, delegate, enum.
3274           Added lines to warn incorrect comment.
3275         * rootcontext.cs :
3276           Added Documentation field (passed only when /doc was specified).
3277         * decl.cs:
3278           Added DocComment, DocCommentHeader, GenerateDocComment() and
3279           OnGenerateDocComment() and some supporting private members for
3280           /doc feature to MemberCore.
3281         * class.cs:
3282           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3283         * delegate.cs:
3284           Added overriden DocCommentHeader.
3285         * enum.cs:
3286           Added overriden DocCommentHeader and GenerateDocComment().
3287
3288 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3289
3290         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3291         unwrapping the enumeration values, chain to
3292         DoConstantNumericPromotions again, so we can promote things to the
3293         fundamental types (takes care of enums that are bytes, sbytes).
3294
3295         Fixes bug #62054.
3296
3297 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3298
3299         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3300         Fix long-standing bug in type-lookup.  Use FindType instead of
3301         LookupType when ec.ResolvingTypeTree.
3302         (Attribute.ResolveType, Attribute.Resolve)
3303         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3304         Update to changes.
3305         (Attributes.Search): Remove internal version.  Update.
3306         (Attributes.SearchMulti): Update.
3307         (Attributes.GetClsCompliantAttribute): Remove.
3308         (Attributes.GetIndexerNameAttribute): Remove.
3309         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3310         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3311         * class.cs (Indexer.Define): Likewise.
3312
3313 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3314
3315         Fix bug #68790
3316         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3317         MarshallByReference members access.
3318
3319         * expression.cs: Use CheckMarshallByRefAccess;
3320         Better error CS0197 message.
3321
3322         * report.cs: Print whole related error message.
3323
3324 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3325
3326         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3327         the current directory to help debugging.
3328
3329 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3330
3331         * class (GetClassBases): Better error 60 report.
3332         (EventProperty): Disabled warning 67 detection.
3333
3334 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3335
3336         Fix bug #60324
3337         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3338
3339         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3340         precise values.
3341
3342 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3343
3344         Fix bug #49488
3345         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3346
3347         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3348
3349 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3350
3351         * attribute.cs (Attribute.Resolve): Refine error reporting and
3352         report a cs0117 if the identifier does not exist, to distinguish
3353         from 0617 which is a miss-use of the actual identifier.
3354
3355         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3356         between cs0070 and cs0079.
3357
3358         * class.cs (MemberBase.DoDefine): When reporting a wrong
3359         accessibility level, we use MethodCore to compare instead of
3360         Method (this was a regression in some refactoring effort).
3361
3362         So now we correctly report cs0056 again.
3363
3364         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3365         testing the target_type (which was known to be object_type) and
3366         not the source type (which is anonymous_method).
3367
3368         Fixed reporting of error cs1660.
3369
3370         * expression.cs (UserCast.Source): Expose the underlying cast.
3371
3372         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3373         allowed types to find a match to int32 first (most common).
3374
3375         In addition, it ignores any ImplicitUserConversions that did an
3376         internal implicit conversion (as the switch statement allows only
3377         one integral conversion to exist).
3378
3379         * class.cs (PartialContainer.Create): rename `name' to
3380         `member_name' for clarity.  Then replace the string calls with a
3381         call to MemberName.GetPartialName, as now using
3382         MemberName.ToString is an error (this is due to the side effects
3383         it had, that were fixed in the past).
3384
3385         This will restore the error reporting on a number of partial class
3386         errors that were missusing this (and getting an exception as a
3387         results, which is now just a plain textual warning, because
3388         yyparse debug output would crash otherwise).
3389
3390 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3391
3392         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3393
3394 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3395
3396         * rootcontext.cs (LookupType): Make sure to cache lookups that
3397         don't give us a negative result. This saves about 5% of corlib
3398         compilation time.
3399
3400 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3401
3402         * report.cs (AbstractMessage.Print): messages are sent to stderr
3403
3404         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3405         non-interface in the list of interfaces (at this point, either
3406         parent was properly set, or a base class is being listed in the
3407         interfaces section).
3408
3409         This flags error 1722, and resolves the crash from bug 69259.
3410
3411 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3412
3413         * statement.cs (Using.EmitExpressionFinally): make this work right
3414         for valuetypes. Fixes 69926.
3415
3416 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3417
3418         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3419         converted to an enum" here, before we try to change the underlying
3420         type.  This code exists, but it is a different code path than the
3421         one used while encoding constants.
3422
3423         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3424         old bug: when converting from the null literal to a pointer,
3425         return an EmptyCast, not the NullLiteral.
3426
3427         This fixes #69921, the recent null_type changes probably made this
3428         bug more prominent.
3429
3430         (ImplicitReferenceConversionExists): In addition, resynchronized
3431         the code here, so it matches the same code in
3432         ImplicitReferenceConversionExists for the `from any class-type S
3433         to any interface-type T'.
3434         
3435
3436 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3437
3438         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3439
3440 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3441
3442         * cs-parser.jay: Use verbosity accordingly. 
3443
3444 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3445
3446         * expression.cs (Unary.ResolveOperator): Do not report warning;
3447         AddressOf reads from variable.
3448         
3449         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3450
3451 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3452
3453         Fix bug #69462
3454
3455         * attribute.cs (Attributable): Removed CheckTargets.
3456         (Attributes.Emit): Explicit attribute targets are tested here.
3457
3458         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3459         not enabled for interfaces.
3460
3461         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3462         (GetAssemblyName): Ouch next bug there.
3463
3464 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3465
3466         * expression.cs: Error 275 added.
3467         
3468 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3469
3470         Fix bug #69177 (Implemented decimal constant support)
3471
3472         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3473         (BinaryFold): Add DecimalConstant.
3474
3475         * const.cs (Define): Decimal constant 
3476         (is not constant.
3477         (ChangeType): Add decimal type handling.
3478         (LookupConstantValue): Don't set value for decimal type but
3479         emit DecimalConstantAttribute. Needed for constant optimization.
3480
3481         * constant.cs (ToDecimal): New method.
3482         (ConvertToDecimal): New method.
3483         (IntConstant): Implemented ConvertToDecimal.
3484         (DecimalConstant.Emit): Emit optimized version for decimals in
3485         int range.
3486
3487         * expression.cs (ResolveOperator): Changed order of constant
3488         reduction to work correctly with native types which have
3489         overloaded operators.
3490         (ResolveMemberAccess): Extract constant value from attribute
3491         for decimal type.
3492
3493         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3494
3495         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3496         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3497         (ChangeType): Decimal is special.
3498         (TypeToCoreType): Add decimal type.
3499
3500 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3501
3502         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3503         decimal types.
3504
3505 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3506
3507         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3508         test cs1667-5.cs.
3509
3510 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3511
3512         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3513
3514         * pending.cs (PendingImplementation): Grab only interfaces.
3515
3516 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3517
3518         * statement.cs (ForeachHelperMethods): Add location member and
3519         error 202 detection.
3520
3521 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3522
3523         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3524         automatically handled by executable.make.
3525         (PROGRAM): Make profile-specific.
3526
3527 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3528
3529         * expression.cs (DoResolveBase): Fixed wrong warning for out
3530         variables.
3531
3532 2004-11-18  Martin Baulig  <martin@ximian.com>
3533
3534         Merged latest changes into gmcs.  Please keep this comment in
3535         here, it makes it easier for me to see what changed in MCS since
3536         the last time I merged.
3537
3538 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3539
3540         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3541         (TypeHandle.GetMemberCache): New.
3542         (TypeHandle.TypeHandle): Update.
3543         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3544         (TypeManager.LookupParentInterfacesCache):
3545         Rename from LookupInterfaceCache.  Optimize slightly.
3546         (TypeManager.MemberLookup_FindMembers): Update.
3547         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3548         multi-type variant.
3549         (AddCacheContents): Rename from AddHashtable.
3550         * class.cs (TypeContainer.parent_container): Remove.
3551         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3552         (TypeContainer.DoDefineMembers): Don't initialize it.
3553         Update to name changes.
3554         
3555 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3556
3557         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3558         that factors the code to check access modifiers on override.  
3559
3560         (PropertyBase): Use the code here.
3561
3562         Patch from Lluis S'anchez, fixes bug #69361.
3563
3564 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3565
3566         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3567         routine that is used to report the use of a captured variable
3568         whose address has been taken.
3569
3570         There are two checks: one when variables are being captured and
3571         the other check is when the address of a variable is taken. 
3572         
3573         (because an anonymous methods might be resolved before *or* after
3574         the address has been taken) and 
3575
3576         * expression.cs (Conditional.DoResolve): Remove the special
3577         casing that Martin added to trueExpr and falseExpr being both
3578         NullLiteral.  We get the right behavior now just by introducing
3579         the null_type into the compiler. 
3580
3581         * convert.cs (ExplicitConversion): Change the code to use
3582         null_type instead of testing `expr is NullLiteral'.
3583         (ImplicitConversionStandard): use null_type too.
3584         (ImplicitReferenceConversionExists): use null_type too.
3585         (ImplicitReferenceConversion): use null_type too.
3586
3587         * literal.cs: The type of `NullLiteral' is now null_type instead
3588         of object_type. 
3589         (Resolve): Set the type here.
3590
3591         * typemanager.cs: Introduce null_type.
3592
3593 2004-11-17  Martin Baulig  <martin@ximian.com>
3594
3595         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3596         direction, like FindMembers() does.  Fixes #69546, testcase is in
3597         test-315.cs.    
3598
3599 2004-11-16  Martin Baulig  <martin@ximian.com>
3600
3601         This is based on a patch from Marek Safar, see bug #69082.
3602         Fixes bugs #63705 and #67130.
3603
3604         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3605         method; create a MemberCache for an interface type and cache the
3606         result.
3607
3608         * decl.cs (IMemberContainer.ParentContainer): Removed.
3609         (IMemberContainer.ParentCache): New property.
3610         (MemberCache.SetupCacheForInterface): Removed.
3611         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3612         to create a cache for an interface's "parent".
3613
3614         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3615         interfaces too.
3616
3617 2004-11-16  Martin Baulig  <martin@ximian.com>
3618
3619         Merged back from gmcs; these changes already went into gmcs a
3620         couple of weeks ago.
3621
3622         * typemanager.cs
3623         (TypeManager.AddUserType): Removed the `ifaces' argument.
3624         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3625         `TypeExpr []'.
3626         (TypeManager.AddUserInterface): Removed.
3627         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3628         `TypeExpr []'.
3629         (TypeManager.GetInterfaces): Likewise.
3630         (TypeManager.GetExplicitInterfaces): Likewise.
3631
3632         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3633
3634         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3635         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3636
3637 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3638
3639         * statement.cs: Avoid adding bools to a hashtable.
3640
3641 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3642
3643         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3644         calling an unsafe method from a safe location.
3645
3646 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3647
3648         Fix #69167
3649         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3650
3651 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3652
3653         * namespace.cs (VerifyUsing): use GetPartialName instead of
3654         ToString. 
3655
3656 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3657
3658         * statement.cs (Return.Resolve): Fix regression in typo: if
3659         `in_exc', we have to request a NeedReturnLabel, this was a typo
3660         introduced in the anonymous method check-in.  Fixes #69131.
3661
3662         * Indexers were using the ShortName when defining themselves,
3663         causing a regression in the compiler bootstrap when applying the
3664         patch from 2004-11-02 (first part), now they use their full name
3665         and the bug is gone.
3666
3667 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3668
3669         * driver.cs: Strip the path from the names of embedded resources. Fixes
3670         #68519.
3671
3672 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3673
3674         Fix error message regression: cs0104-2.cs.
3675         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3676         (AliasEntry.Resolve): Update.
3677         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3678         'silent' flag.
3679         (RootContext.LookupType): Update.
3680
3681 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3682
3683         * cs-parser.jay: Add support for handling accessor modifiers
3684         * class: Add support port accessor modifiers and error checking,
3685         define PropertyMethod.Define as virtual (not abstract anymore)
3686         * ecore.cs: Add checking for proeprties access with access modifiers
3687         * iterators.cs: Modify Accessor constructor call based in the modified
3688         constructor
3689 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3690
3691         * expression.cs (StringConcat): Handle being called twice,
3692         as when we have a concat in a field init with more than two
3693         ctors in the class
3694
3695 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3696
3697         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3698         special case explicit implementations, we should always produce
3699         the .property or .event declaration.
3700         
3701         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3702         since it will not return correct data if people use this
3703         unresolved in the presence of using statements (see test-313).
3704
3705         * class.cs (MethodData.Define): If we are an explicit interface
3706         implementation, set the method name to the full name of the
3707         interface plus the name of the method.  
3708
3709         Notice that using the method.MethodName.GetFullName() does not
3710         work, as it will only contain the name as declared on the source
3711         file (it can be a shorthand in the presence of using statements)
3712         and not the fully qualifed type name, for example:
3713
3714         using System;
3715
3716         class D : ICloneable {
3717                 object ICloneable.Clone ()  {
3718                 }
3719         }
3720
3721         Would produce a method called `ICloneable.Clone' instead of
3722         `System.ICloneable.Clone'.
3723
3724         * namespace.cs (Alias.Resolve): Use GetPartialName.
3725         
3726 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3727
3728         * cs-parser.jay: Add error 1055 report.
3729
3730 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3731
3732         * assign.cs (Assign.DoResolve): Only do the transform of
3733         assignment into a New if the types are compatible, if not, fall
3734         through and let the implicit code deal with the errors and with
3735         the necessary conversions. 
3736
3737 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3738
3739         * cs-parser.jay: Add error 1031 report.
3740
3741         * cs-tokenizer.cs: Add location for error 1038.
3742
3743 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3744
3745         * cs-parser.jay: Add error 1016 report.
3746
3747 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3748
3749         * cs-parser.jay: Add errors 1575,1611 report.
3750
3751 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3752
3753         * cs-parser.jay: Add error 1001 report.
3754
3755 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3756
3757         Fix #68850
3758         * attribute.cs (GetMarshal): Add method argument for
3759         caller identification.
3760
3761         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3762         agument for GetMarshal and RuntimeMissingSupport.
3763
3764 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3765
3766         * attribute.cs (ExtractSecurityPermissionSet): Removed
3767         TypeManager.code_access_permission_type.
3768
3769         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3770
3771 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3772
3773         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3774         for obsolete use of a variable here.   Fixes regression on errors
3775         cs0619-25 and cs0619-26.
3776
3777 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3778
3779         Fix #62358, implemented security attribute encoding.
3780
3781         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3782         Tests permitted SecurityAction for assembly or other types.
3783         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3784         data from SecurityPermissionAttribute to PermisionSet class.
3785
3786         * class.cs (ApplyAttributeBuilder): Added special handling
3787         for System.Security.Permissions.SecurityAttribute based types.
3788
3789         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3790         special handling for System.Security.Permissions.SecurityAttribute
3791         based types.
3792
3793         * enum.cs (ApplyAttributeBuilder): Added special handling
3794         for System.Security.Permissions.SecurityAttribute based types.
3795
3796         * parameter.cs (ApplyAttributeBuilder): Added special handling
3797         for System.Security.Permissions.SecurityAttribute based types.
3798
3799         * rootcontext.cs: Next 2 core types.
3800
3801         * typemanager.cs (TypeManager.security_permission_attr_type):
3802         Built in type for the SecurityPermission Attribute.
3803         (code_access_permission_type): Build in type.
3804
3805 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3806
3807         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3808         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3809         all of this information into
3810         EmitContext.EmitCapturedVariableInstance.
3811         
3812         * codegen.cs (EmitCapturedVariableInstance): move here the
3813         funcionality of emitting an ldarg.0 in the presence of a
3814         remapping.   This centralizes the instance emit code.
3815
3816         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3817         then emit a load of this: it means that we have reached the
3818         topmost ScopeInfo: the one that contains the pointer to the
3819         instance of the class hosting the anonymous method.
3820
3821         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3822         captures to the topmost CaptureContext.
3823
3824 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3825
3826         * expression.cs (LocalVariableReference): Move the knowledge about
3827         the iterators into codegen's EmitCapturedVariableInstance.
3828
3829 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3830
3831         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3832         all code paths return a value from an anonymous method (it is the
3833         same as the 161 error, but for anonymous methods).
3834
3835 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3836
3837         The introduction of anonymous methods in the compiler changed
3838         various ways of doing things in the compiler.  The most
3839         significant one is the hard split between the resolution phase
3840         and the emission phases of the compiler.
3841
3842         For instance, routines that referenced local variables no
3843         longer can safely create temporary variables during the
3844         resolution phase: they must do so from the emission phase,
3845         since the variable might have been "captured", hence access to
3846         it can not be done with the local-variable operations from the runtime.
3847         
3848         * statement.cs 
3849
3850         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3851         is a toplevel block.
3852
3853         (ToplevelBlock): A new kind of Block, these are the blocks that
3854         are created by the parser for all toplevel method bodies.  These
3855         include methods, accessors and anonymous methods.
3856
3857         These contain some extra information not found in regular blocks:
3858         A pointer to an optional CaptureContext (for tracking captured
3859         local variables and parameters).  A pointer to the parent
3860         ToplevelBlock.
3861         
3862         (Return.Resolve): Catch missmatches when returning a value from an
3863         anonymous method (error 1662).
3864         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3865         phase.
3866
3867         (Break.Resolve): ditto.
3868
3869         (SwitchLabel): instead of defining the labels during the
3870         resolution phase, we now turned the public ILLabel and ILLabelCode
3871         labels into methods called GetILLabelCode() and GetILLabel() that
3872         only define the label during the Emit phase.
3873
3874         (GotoCase): Track the SwitchLabel instead of the computed label
3875         (its contained therein).  Emit the code by using
3876         SwitchLabel.GetILLabelCode ().
3877
3878         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3879         whether the Local has been captured or not.
3880
3881         (LocalInfo.IsCaptured): New property, used to tell whether the
3882         local has been captured.
3883         
3884         * anonymous.cs: Vastly updated to contain the anonymous method
3885         support.
3886
3887         The main classes here are: CaptureContext which tracks any
3888         captured information for a toplevel block and ScopeInfo used to
3889         track the activation frames for various local variables.   
3890
3891         Each toplevel block has an optional capture context associated
3892         with it.  When a method contains an anonymous method both the
3893         toplevel method and the anonymous method will create a capture
3894         context.   When variables or parameters are captured, they are
3895         recorded on the CaptureContext that owns them, for example:
3896
3897         void Demo () {
3898              int a;
3899              MyDelegate d = delegate {
3900                  a = 1;
3901              }
3902         }
3903
3904         Here `a' will be recorded as captured on the toplevel
3905         CapturedContext, the inner captured context will not have anything
3906         (it will only have data if local variables or parameters from it
3907         are captured in a nested anonymous method.
3908
3909         The ScopeInfo is used to track the activation frames for local
3910         variables, for example:
3911
3912         for (int i = 0; i < 10; i++)
3913                 for (int j = 0; j < 10; j++){
3914                    MyDelegate d = delegate {
3915                         call (i, j);
3916                    }
3917                 }
3918
3919         At runtime this captures a single captured variable `i', but it
3920         captures 10 different versions of the variable `j'.  The variable
3921         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3922         recorded on a child.  
3923
3924         The toplevel ScopeInfo will also track information like the `this'
3925         pointer if instance variables were referenced (this is necessary
3926         as the anonymous method lives inside a nested class in the host
3927         type of the method). 
3928
3929         (AnonymousMethod): Expanded to track the Toplevel, implement
3930         `AnonymousMethod.Compatible' to tell whether an anonymous method
3931         can be converted to a target delegate type. 
3932
3933         The routine now also produces the anonymous method content
3934
3935         (AnonymousDelegate): A helper class that derives from
3936         DelegateCreation, this is used to generate the code necessary to
3937         produce the delegate for the anonymous method that was created. 
3938
3939         * assign.cs: API adjustments for new changes in
3940         Convert.ImplicitStandardConversionExists.
3941
3942         * class.cs: Adjustments to cope with the fact that now toplevel
3943         blocks are of type `ToplevelBlock'. 
3944
3945         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3946         insteda of standard blocks.
3947
3948         Flag errors if params arguments are passed to anonymous methods.
3949
3950         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3951         `CurrentAnonymousMethod' which points to the current Anonymous
3952         Method.  The variable points to the AnonymousMethod class that
3953         holds the code being compiled.  It is set in the new EmitContext
3954         created for the anonymous method.
3955
3956         (EmitContext.Phase): Introduce a variable and an enumeration to
3957         assist in enforcing some rules about when and where we are allowed
3958         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3959         only one that enfonces this right now).
3960
3961         (EmitContext.HaveCaptureInfo): new helper method that returns
3962         whether we have a CapturedContext initialized.
3963
3964         (EmitContext.CaptureVariable): New method used to register that a
3965         LocalInfo must be flagged for capturing. 
3966
3967         (EmitContext.CapturedParameter): New method used to register that a
3968         parameters must be flagged for capturing. 
3969         
3970         (EmitContext.CapturedField): New method used to register that a
3971         field must be flagged for capturing. 
3972
3973         (EmitContext.HaveCapturedVariables,
3974         EmitContext.HaveCapturedFields): Return whether there are captured
3975         variables or fields. 
3976
3977         (EmitContext.EmitMethodHostInstance): This is used to emit the
3978         instance for the anonymous method.  The instance might be null
3979         (static methods), this (for anonymous methods that capture nothing
3980         and happen to live side-by-side with the current method body) or a
3981         more complicated expression if the method has a CaptureContext.
3982
3983         (EmitContext.EmitTopBlock): Routine that drives the emission of
3984         code: it will first resolve the top block, then emit any metadata
3985         and then emit the code.  The split is done so that we can extract
3986         any anonymous methods and flag any captured variables/parameters.
3987         
3988         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
3989         during this phase, the ILGenerator should not be used as labels
3990         and local variables declared here might not be accessible to any
3991         code that is part of an anonymous method.  
3992
3993         Exceptions to this include the temporary variables that are
3994         created by some statements internally for holding temporary
3995         variables. 
3996         
3997         (EmitContext.EmitMeta): New routine, in charge of emitting all the
3998         metadata for a cb
3999
4000         (EmitContext.TemporaryReturn): This method is typically called
4001         from the Emit phase, and its the only place where we allow the
4002         ReturnLabel to be defined other than the EmitMeta.  The reason is
4003         that otherwise we would have to duplicate a lot of logic in the
4004         Resolve phases of various methods that today is on the Emit
4005         phase. 
4006
4007         (EmitContext.NeedReturnLabel): This no longer creates the label,
4008         as the ILGenerator is not valid during the resolve phase.
4009
4010         (EmitContext.EmitThis): Extended the knowledge in this class to
4011         work in anonymous methods in addition to iterators. 
4012
4013         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4014         code is necessary on the stack to access the instance to a local
4015         variable (the variable will be accessed as a field).
4016
4017         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4018         EmitContext.EmitAddressOfParameter): Routines to support
4019         parameters (not completed at this point). 
4020         
4021         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4022         will also remove the parameters.
4023
4024         * convert.cs (Convert): Define a `ConstantEC' which points to a
4025         null.  This is just to prefity some code that uses
4026         ImplicitStandardConversion code and do not have an EmitContext
4027         handy.
4028
4029         The idea is to flag explicitly that at that point in time, it is
4030         known that the conversion will not trigger the delegate checking
4031         code in implicit conversions (which requires a valid
4032         EmitContext). 
4033
4034         Everywhere: pass new EmitContext parameter since
4035         ImplicitStandardConversionExists now requires it to check for
4036         anonymous method conversions. 
4037
4038         (Convert.ImplicitStandardConversionExists): If the type of an
4039         expression is the anonymous_method_type, and the type is a
4040         delegate, we invoke the AnonymousMethod.Compatible method to check
4041         whether an implicit conversion is possible. 
4042
4043         (Convert.ImplicitConversionStandard): Only do implicit method
4044         group conversions if the language level is not ISO_1.
4045
4046         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4047         MethodInfo for the Invoke method.  used by Delegate and
4048         AnonymousDelegate.
4049
4050         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4051         method conversions if the target type is a delegate.
4052
4053         Removed extra debugging nops.
4054
4055         (LocalVariableReference): Turn the `local_info' into a public
4056         field. 
4057
4058         Add `prepared' field, the same hack used for FieldExprs to cope
4059         with composed assignments, as Local variables do not necessarily
4060         operate purely on the stack as they used to: they can be captured
4061         fields. 
4062
4063         Add `temp' for a temporary result, like fields.
4064
4065         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4066
4067         It now copes with Local variables that are captured and emits the
4068         proper instance variable to load it from a field in the captured
4069         case. 
4070
4071         (ParameterReference.DoResolveBase): During the resolve phase,
4072         capture parameters if we are in an anonymous method.
4073
4074         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4075         anonymous method, use the EmitContext helper routines to emit the
4076         parameter reference.
4077
4078         * iterators.cs: Set RemapToProxy to true/false during the
4079         EmitDispose class.
4080
4081         * parameters.cs (GetParameterByName): New helper method. 
4082
4083         * typemanager.cs (anonymous_method_type) a new type that
4084         represents an anonyous method.  This is always an internal type,
4085         used as a fencepost to test against the anonymous-methodness of an
4086         expression. 
4087         
4088 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4089
4090         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4091         561 report.
4092         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4093
4094 2004-10-18  Martin Baulig  <martin@ximian.com>
4095
4096         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4097         `Type' directly, but call ResolveType() on it.
4098         (Catch.Resolve): Likewise.
4099         (Foreach.Resolve): Likewise.
4100
4101 2004-10-18  Martin Baulig  <martin@ximian.com>
4102
4103         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4104         `Type' directly, but call ResolveType() on it.
4105         (Probe.DoResolve): Likewise.
4106         (ArrayCreation.LookupType): Likewise.
4107         (TypeOf.DoResolve): Likewise.
4108         (SizeOf.DoResolve): Likewise.
4109
4110 2004-10-18  Martin Baulig  <martin@ximian.com>
4111
4112         * expression.cs (Invocation.BetterFunction): Put back
4113         TypeManager.TypeToCoreType().
4114
4115 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4116
4117         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4118         the ResolveType.
4119
4120 2004-10-18  Martin Baulig  <martin@ximian.com>
4121
4122         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4123         `Type' directly, but call ResolveType() on it.
4124
4125 2004-10-18  Martin Baulig  <martin@ximian.com>
4126
4127         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4128         `Type' directly, but call ResolveType() on it.
4129         (MemberBase.DoDefine): Likewise.
4130
4131         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4132         `Type' directly, but call ResolveType() on it.
4133         (ComposedCast.DoResolveAsTypeStep): Likewise.
4134
4135         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4136         `Type' directly, but call ResolveType() on it.
4137
4138 2004-10-17  John Luke  <john.luke@gmail.com>
4139
4140         * class.cs (Operator.GetSignatureForError): use CSharpName
4141
4142         * parameter.cs (Parameter.GetSignatureForError): Returns
4143         correct name even if was not defined.
4144
4145 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4146
4147         Fix #65816.
4148         * class.cs (TypeContainer.EmitContext): New property.
4149         (DefineNestedTypes): Create an emitcontext for each part.
4150         (MethodCore.DoDefineParameters): Use container's emitcontext.
4151         Pass type array to InternalParameters.
4152         (MemberBase.DoDefine): Use container's emitcontext.
4153         (FieldMember.Define): Likewise.
4154         (Event.Define): Likewise.
4155         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4156         Pass type array to InternalParameters.
4157         (SetIndexerMethod.GetParameterInfo): Likewise.
4158         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4159         * delegate.cs (Define): Pass emitcontext to
4160         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4161         array to InternalParameters.
4162         * expression.cs (ParameterReference.DoResolveBase): Pass
4163         emitcontext to GetParameterInfo.
4164         (ComposedCast.DoResolveAsTypeStep): Remove check on
4165         ec.ResolvingTypeTree.
4166         * parameter.cs (Parameter.Resolve): Change argument to
4167         EmitContext.  Use ResolveAsTypeTerminal.
4168         (Parameter.GetSignature): Change argument to EmitContext.
4169         (Parameters.ComputeSignature): Likewise.
4170         (Parameters.ComputeParameterTypes): Likewise.
4171         (Parameters.GetParameterInfo): Likewise.
4172         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4173         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4174         * support.cs (InternalParameters..ctor): Remove variant that takes
4175         a DeclSpace.
4176         * typemanager.cs (system_intptr_expr): New.
4177         (InitExpressionTypes): Initialize it.
4178
4179 2004-10-12  Chris Toshok  <toshok@ximian.com>
4180
4181         * cs-parser.jay: fix location for try_statement and catch_clause.
4182
4183 2004-10-11  Martin Baulig  <martin@ximian.com>
4184
4185         * report.cs: Don't make --fatal abort on warnings, we have
4186         -warnaserror for that.
4187
4188 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4189
4190         More DeclSpace.ResolveType avoidance.
4191         * decl.cs (MemberCore.InUnsafe): New property.
4192         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4193         with newly created EmitContext.
4194         (FieldMember.Define): Likewise.
4195         * delegate.cs (Delegate.Define): Likewise.
4196         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4197         only if normal name-lookup fails.
4198         (TypeExpr.DoResolve): Enable error-checking.
4199         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4200         (SizeOf.DoResolve): Likewise.
4201         (ComposedCast.DoResolveAsTypeStep): Likewise.
4202         (StackAlloc.DoResolve): Likewise.
4203         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4204         (Block.Unsafe): New property.
4205         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4206         (Unsafe): Set 'unsafe' flag of contained block.
4207         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4208         (Fixed.Resolve): Likewise.
4209         (Catch.Resolve): Likewise.
4210         (Using.ResolveLocalVariableDecls): Likewise.
4211         (Foreach.Resolve): Likewise.
4212
4213 2004-10-05  John Luke <john.luke@gmail.com>
4214
4215         * cs-parser.jay: add location to error CS0175
4216
4217 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4218
4219         * ecore.cs (Expression.Constantity): Add support for turning null
4220         into a constant.
4221
4222         * const.cs (Const.Define): Allow constants to be reference types
4223         as long as the value is Null.
4224
4225 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4226
4227         * namespace.cs (NamespaceEntry.Using): No matter which warning
4228         level is set, check if this namespace name has already been added.
4229
4230 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4231
4232         * expression.cs: reftype [!=]= null should always use br[true,false].
4233         # 67410
4234
4235 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4236
4237         Fix #67108
4238         * attribute.cs: Enum conversion moved to 
4239         GetAttributeArgumentExpression to be applied to the all
4240         expressions.
4241
4242 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4243
4244         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4245         * class.c (TypeContainer.DefineType): Flag error if
4246         base types aren't accessible due to access permissions.
4247         * decl.cs (DeclSpace.ResolveType): Move logic to
4248         Expression.ResolveAsTypeTerminal.
4249         (DeclSpace.ResolveTypeExpr): Thin layer over
4250         Expression.ResolveAsTypeTerminal.
4251         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4252         Refactor code into NestedAccess.  Use it.
4253         (DeclSpace.NestedAccess): New.
4254         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4255         argument to silence errors.  Check access permissions.
4256         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4257         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4258         (Cast.DoResolve): Likewise.
4259         (New.DoResolve): Likewise.
4260         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4261         (TypeOf.DoResolve): Likewise.
4262
4263         * expression.cs (Invocation.BetterConversion): Return the Type of
4264         the better conversion.  Implement section 14.4.2.3 more faithfully.
4265         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4266         section 14.4.2.2 explicit.
4267         (Invocation.OverloadResolve): Update.
4268         (Invocation): Remove is_base field.
4269         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4270         (Invocation.Emit): Likewise.
4271
4272 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4273
4274         * README: Update to changes.
4275
4276 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4277
4278         * cs-parser.jay: Reverted 642 warning fix.
4279
4280 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4281
4282         Fix bug #66615
4283         * decl.cs (FindMemberWithSameName): Indexer can have more than
4284         1 argument.
4285
4286 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4287
4288         * expression.cs (LocalVariableReference.DoResolveLValue):
4289         Do not report warning 219 for out values.
4290         (EmptyExpression.Null): New member to avoid extra allocations.
4291
4292 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4293
4294         * cs-parser.jay: Fix wrong warning 642 report.
4295
4296         * cs-tokenizer.cs (CheckNextToken): New helper;
4297         Inspect next character if is same as expected.
4298
4299 2004-09-23  Martin Baulig  <martin@ximian.com>
4300
4301         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4302         (Convert.ImplicitReferenceConversionExists): Likewise.
4303
4304 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4305
4306         * class.cs (Operator.Define): Add error 448 and 559 report.
4307
4308 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4309
4310         * class.cs (MemberBase.IsTypePermitted): New protected
4311         method for checking error CS0610.
4312
4313 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4314
4315         * class.cs (TypeContainer.HasExplicitLayout): New property
4316         Returns whether container has StructLayout attribute set Explicit.
4317         (FieldMember): New abstract class for consts and fields.
4318         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4319         (Field): Reuse FieldMember.
4320
4321         * const.cs (Const): Reuse FieldMember.
4322
4323         * rootcontext.cs: EmitConstants call moved to class.
4324
4325 2004-09-22  Martin Baulig  <martin@ximian.com>
4326
4327         Thanks to Peter Sestoft for this bug report.
4328
4329         * expression.cs (Conditional): If both the `trueExpr' and the
4330         `falseExpr' is a NullLiteral, return a NullLiteral.
4331
4332 2004-09-22  Martin Baulig  <martin@ximian.com>
4333
4334         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4335         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4336         for the "get_Current" call.
4337
4338 2004-09-22  Martin Baulig  <martin@ximian.com>
4339
4340         Marek and me just fixed one of our oldest bugs: #28562 :-)
4341
4342         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4343
4344         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4345         we're an EnumConstant, just return that.
4346         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4347         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4348         to get the value which'll actually be written into the attribute.
4349         However, we have to use GetValue() to access the attribute's value
4350         in the compiler.        
4351
4352 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4353
4354         * constant.cs (Constant.IsNegative): New abstract property
4355         IsNegative.
4356
4357         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4358         (StackAlloc.DoResolve): Reused IsNegative.
4359
4360 2004-09-21  Martin Baulig  <martin@ximian.com>
4361
4362         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4363         if we're used in an iterator, we may be called from different
4364         methods.
4365
4366         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4367         we actually have an exception block.
4368
4369 2004-09-20  John Luke <jluke@cfl.rr.com>
4370
4371         * class.cs, cs-parser.jay: Improve the error report for 1520:
4372         report the actual line where the error happens, not where the
4373         class was declared.
4374
4375         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4376         Pass location information that was available elsewhere.
4377
4378 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4379
4380         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4381         runtime to delay sign assemblies.
4382
4383 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4384
4385         * cs-parser.jay: Do not report the stack trace, this is barely
4386         used nowadays.
4387
4388 2004-08-22  John Luke  <john.luke@gmail.com>
4389  
4390         * driver.cs : check that a resource id is not already used
4391         before adding it, report CS1508 if it is, bug #63637
4392
4393 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4394
4395         * ecore.cs: Removed dead code.
4396
4397 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4398
4399         * class.cs: Do not report warning CS0067 on the interfaces.
4400
4401 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4402
4403         * cs-parser.jay: Add error 504 report.
4404
4405 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4406
4407         * rootcontext.cs: WarningLevel is 4 by default now.
4408
4409         * statement.cs (Fixed.Resolve): Do not null
4410         VariableInfo.
4411
4412 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4413
4414         Fixed bug #55780
4415         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4416         deep search when property is not virtual.
4417         (PropertyExpr.ResolveAccessors): Make one call for both
4418         accessors.
4419
4420 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4421
4422         Fixed bug #65766
4423         * statement.cs: Error 152 report constains also location.
4424
4425 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4426
4427         Fixed bug #65766
4428         * const.cs: Explicitly set constant as static.
4429
4430 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4431
4432         Fixed bug #64226
4433         * cs-parser.jay: Add error 1017 report.
4434
4435 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4436
4437         Fixed bug #59980, #64224
4438         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4439
4440         * typemanager.cs (IsSpecialMethod): Simplified
4441
4442 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4443
4444         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4445         condition with better params.
4446
4447 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4448
4449         Fixed bug #65238
4450         * attribute.cs (Resolve): Property has to have both
4451         accessors.
4452
4453 2004-09-14  Martin Baulig  <martin@ximian.com>
4454
4455         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4456
4457 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4458
4459         Fixed bug #61902
4460         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4461         called and is obsolete then this member suppress message
4462         when call is inside next [Obsolete] method or type.
4463
4464         * expression.cs: Use TestObsoleteMethodUsage member.
4465
4466 2004-09-14  Martin Baulig  <martin@ximian.com>
4467
4468         * cs-parser.jay: Sync a bit with the GMCS version.
4469
4470 2004-09-14  Martin Baulig  <martin@ximian.com>
4471
4472         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4473         (CSharpParser.yacc_verbose_flag): New public field.
4474
4475         * genericparser.cs: Removed.
4476
4477 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4478
4479         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4480
4481 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4482
4483         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4484
4485 2004-09-10  Martin Baulig  <martin@ximian.com>
4486
4487         Backported my MemberName changes from GMCS into MCS.
4488
4489         - we are now using a special `MemberName' class instead of using
4490         strings; in GMCS, the `MemberName' also contains the type
4491         arguments.
4492
4493         - changed the grammar rules a bit:
4494           * the old `member_name' is now a `namespace_or_type_name':
4495             The rule is that we use `namespace_or_type_name' everywhere
4496             where we expect either a "member name" (GetEnumerator) or a
4497             "member name" with an explicit interface name
4498             (IEnumerable.GetEnumerator).
4499             In GMCS, the explicit interface name may include type arguments
4500             (IEnumerable<T>.GetEnumerator).
4501           * we use `member_name' instead of just `IDENTIFIER' for
4502             "member names":
4503             The rule is that we use `member_name' wherever a member may
4504             have type parameters in GMCS.       
4505
4506         * decl.cs (MemberName): New public class.
4507         (MemberCore.MemberName): New public readonly field.
4508         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4509         (DeclSpace): Likewise.
4510
4511         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4512         * enum.cs (Enum.ctor): Likewise.
4513
4514         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4515         MemberName.     
4516         (AliasEntry.ctor): Take a MemberName, not an Expression.
4517         (AliasEntry.UsingAlias): Likewise.
4518
4519         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4520         (IMethodData.MemberName): Changed type from string to MemberName.
4521         (MemberBase.ExplicitInterfaceName): Likewise.
4522         (AbstractPropertyEventMethod.SetupName): Make this private.
4523         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4524         argument; compute the member name here.
4525         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4526         on the `member.MemberName' and the `prefix'.
4527
4528         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4529         not `type_name'.
4530         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4531         thus, we get a `MemberName' instead of a `string'.  These
4532         declarations may have type parameters in GMCS.
4533         (interface_method_declaration, delegate_declaration): Likewise.
4534         (class_declaration, interface_declaration): Likewise.
4535         (method_header): Use `namespace_or_type_name' instead of
4536         `member_name'.  We may be an explicit interface implementation.
4537         (property_declaration, event_declaration): Likewise.
4538         (member_name): This is now just an `IDENTIFIER', not a
4539         `namespace_or_type_name'.
4540         (type_name, interface_type): Removed.
4541         (namespace_or_type_name): Return a MemberName, not an Expression.
4542         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4543         call GetTypeExpression() on the MemberName to get an expression.
4544         (IndexerDeclaration.interface_type): Changed type from string to
4545         MemberName.
4546         (MakeName): Operate on MemberName's instead of string's.
4547
4548 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4549
4550         Fix bug #55770.
4551         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4552         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4553         lookup to avoid symbols introduced by 'using'.
4554         * rootcontext.cs (NamespaceLookup): Update.
4555
4556 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4557
4558         * class.cs (TypeContainer.DoDefineMembers): Do not call
4559         DefineDefaultConstructor for static classes.
4560
4561 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4562
4563         * attribute.cs (Attribute.Resolve): Add error 653 report.
4564
4565         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4566         report.
4567         (Method.ApplyAttributeBuilder): Add error 685 report.
4568         (Operator.Define): Add error 564 report.
4569
4570         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4571
4572         * expression.cs (Invocation.DoResolve): Add error
4573         245 and 250 report.
4574
4575         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4576         error 674 report.
4577
4578 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4579
4580         * class.cs (ConstructorInitializer.Resolve):
4581         Wrong error number (515->516).
4582
4583 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4584
4585         * class.cs (Indexer.Define): Add error 631 report.
4586
4587 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4588
4589         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4590
4591 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4592
4593         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4594
4595 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4596
4597         * cs-parser.jay: Added error CS0241 report.
4598
4599 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4600
4601         * cs-parser.jay (fixed_statement): Introduce a scope for the
4602         declaration in the 'fixed' statement.
4603
4604 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4605
4606         * cs-parser.jay: Added CS0230 error report.
4607
4608 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4609
4610         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4611
4612 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4613
4614         * expression.cs (Argument.Resolve): Added error CS0192 and
4615         CS0199 report.
4616
4617 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4618
4619         C# 2.0 #pragma warning feature
4620
4621         * cs-tokenizer.cs (PreProcessPragma): New method; 
4622         Handles #pragma directive.
4623
4624         * report.cs (WarningRegions): New class; Support
4625         class for #pragma warning directive. It tests whether
4626         warning is enabled for a given line.
4627
4628 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4629
4630         * const.cs: Add more descriptive error report, tahnks to
4631         Sebastien. 
4632
4633 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4634
4635         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4636
4637 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4638
4639         * expression.cs: Apply patch from Ben: Remove dead code from
4640         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4641         as that code just threw an exception anwyays.
4642
4643         * const.cs: Remove the call to the turnintoconstant, for details
4644         see bug: #63144
4645         
4646         * literal.cs: The type of the null-literal is the null type;  So
4647         we use a placeholder type (literal.cs:System.Null, defined here)
4648         for it.
4649
4650         * expression.cs (Conditional.DoResolve): Remove some old code that
4651         is no longer needed, conversions have been fixed.
4652
4653         (ArrayCreationExpression.DoResolve): Return false if we fail to
4654         resolve the inner expression.
4655
4656 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4657
4658         Fix test-290.cs.
4659         * cs-parser.jay (delegate_declaration): Record a delegate
4660         declaration as a type declaration.
4661         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4662
4663 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4664
4665         * parameter.cs: Do not crash if the type can not be resolved. 
4666
4667         * expression.cs: Report errors with unsafe pointers, fixes #64896
4668
4669 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4670
4671         * expression.cs: Pointer arith always needs to do a conv.i
4672         if the operand is a long. fix 65320
4673
4674 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4675
4676         Fixed cs0619-37.cs, cs0619-38.cs
4677
4678         * enum.cs (GetObsoleteAttribute): Removed.
4679
4680         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4681         on Enum member is double staged. The first is tested member
4682         and then enum.
4683
4684 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4685
4686         Fixed #56986, #63631, #65231
4687
4688         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4689         adds member to name container.
4690         (TypeContainer.AddToTypeContainer): New method, adds type to
4691         name container.
4692         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4693         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4694         AddOperator): Simplified by reusing AddToMemberContainer.
4695         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4696         instead of field.
4697         (Method.CheckForDuplications): Fixed implementation to test all
4698         possibilities.
4699         (MemberBase): Detection whether member is explicit interface
4700         implementation is now in constructor.
4701         (MemberBase.UpdateMemberName): Handles IndexerName.
4702         (Accessor): Changed to keep also location information.
4703         (AbstractPropertyEventMethod): Is derived from MemberCore.
4704         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4705         will be emited or not.
4706         (PropertyBase.AreAccessorsDuplicateImplementation):
4707         Tests whether accessors are not in collision with some method.
4708         (Operator): Is derived from MethodCore to simplify common
4709         operations.
4710
4711         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4712         must be performed.
4713         (DeclSpace.AddToContainer): Adds the member to defined_names
4714         table. It tests for duplications and enclosing name conflicts.
4715
4716         * enum.cs (EnumMember): Clean up to reuse the base structures
4717
4718 2004-09-03  Martin Baulig  <martin@ximian.com>
4719
4720         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4721         into TypeContainer, to make partial classes work again.
4722
4723 2004-09-03  Martin Baulig  <martin@ximian.com>
4724
4725         * rootcontext.cs (RootContext.V2): Removed.
4726
4727 2004-03-23  Martin Baulig  <martin@ximian.com>
4728
4729         * expression.cs (Invocation.OverloadResolve): Added `bool
4730         may_fail' argument and use it instead of the Location.IsNull() hack.
4731
4732 2004-09-03  Martin Baulig  <martin@ximian.com>
4733
4734         Merged latest changes into gmcs.  Please keep this comment in
4735         here, it makes it easier for me to see what changed in MCS since
4736         the last time I merged.
4737
4738 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4739
4740         Fix #61128.
4741         * expression.cs (BetterConversion): Don't allow either conversion 
4742         to be null.  Remove redundant implicit conversion test when 'q ==
4743         null' -- when this function is invoked, we already know that the
4744         implicit conversion exists.
4745         (BetterFunction): Assume that 'best' is non-null.  Remove
4746         redundant reimplementation of IsApplicable when 'best' is null.
4747         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4748         number of arguments.
4749         (IsAncestralType): Extract from OverloadResolve.
4750         (OverloadResolve): Make robust to the MethodGroupExpr being
4751         unsorted.  Implement all the logic of Section 14.5.5.1, and
4752         support overloading of methods from multiple applicable types.
4753         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4754
4755         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4756         (RealError, Warning): Append type of report to related symbol.
4757
4758 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4759
4760         * enum.cs: Fixed CLS-Compliance checks for enum members.
4761         Error tests cs3008-8.cs, cs3014-8.cs
4762
4763 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4764
4765         Fixed bug #62342, #63102
4766         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4767         like ImplementMethod.
4768
4769 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4770
4771         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4772         Fixed bug #65170.
4773
4774 2004-09-02  Martin Baulig  <martin@ximian.com>
4775
4776         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4777         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4778         on the MethodBase.
4779
4780 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4781
4782         C# 2.0 Static classes implemented
4783
4784         * class.cs (TypeContainer): instance_constructors,
4785         initialized_fields, initialized_static_fields,
4786         default_constructor, base_inteface_types are protected to be
4787         accessible from StaticClass.
4788         (TypeContainer.DefineDefaultConstructor): New virtual method
4789         for custom default constructor generating
4790         (StaticClass): New class to handle "Static classes" feature.
4791
4792         * cs-parser.jay: Handle static keyword on class like instance
4793         of StaticClass.
4794
4795         * driver.cs: Added "/langversion" command line switch with two
4796         options (iso-1, default).
4797
4798 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4799
4800         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4801
4802 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4803
4804         * delegate.cs: Style.
4805
4806 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4807
4808         * delegate.cs: Add seperate instance expr field for miguel.
4809
4810 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4811
4812         * PointerArithmetic (Resolve): make sure we are not doing
4813         pointer arith on void*. Also, make sure we are resolved
4814         by not setting eclass until resolve.
4815
4816         All callers: Make sure that PointerArithmetic gets resolved.
4817
4818 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4819
4820         * ArrayCreation (LookupType): If the type does not resolve 
4821         to an array, give an error.
4822
4823 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * statement.cs (Try.Resolve): Fixed bug #64222
4826
4827 2004-08-27  Martin Baulig  <martin@ximian.com>
4828
4829         * class.cs
4830         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4831         crash here.     
4832
4833 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4834
4835         * ecore.cs (Constantify): Get underlying type via
4836         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4837         Windows in special cases.
4838
4839 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4840
4841         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4842         for obtaining also private methods.
4843         (GetRemoveMethod): Used GetRemoveMethod (true)
4844         for obtaining also private methods.
4845
4846 2004-08-24  Martin Baulig  <martin@ximian.com>
4847
4848         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4849         MethodAttributes.HideBySig for operators.
4850
4851 2004-08-23  Martin Baulig  <martin@ximian.com>
4852
4853         Back to the old error reporting system :-)
4854
4855         * report.cs (Message): Removed.
4856         (Report.MessageData, ErrorData, WarningData): Removed.
4857         (Report.Error, Warning): Back to the old system.
4858
4859 2004-08-23  Martin Baulig  <martin@ximian.com>
4860
4861         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4862
4863         * class.cs (TypeContainer.ParentContainer): New public virtual
4864         method; replaces the explicit interface implementation.
4865         (ClassPart.ParentContainer): Override.
4866
4867 2004-08-23  Martin Baulig  <martin@ximian.com>
4868
4869         * statement.cs (Switch): Added support for constant switches; see
4870         #59428 or test-285.cs.
4871
4872 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4873
4874         Fixed bug #62740.
4875         * statement.cs (GetEnumeratorFilter): Removed useless
4876         logic because C# specs is strict. GetEnumerator must be
4877         public.
4878
4879 2004-08-22  Martin Baulig  <martin@ximian.com>
4880
4881         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4882         a switch and may break, reset the barrier.  Fixes #59867.
4883
4884 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4885
4886         CLS-Compliance speed up (~5% for corlib)
4887
4888         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
4889         New method. Tests container for CLS-Compliant names
4890
4891         * class.cs (TypeContainer.VerifyClsName): New method.
4892         Checks whether container name is CLS Compliant.
4893         (Constructor): Implements IMethodData.
4894
4895         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
4896         low-case table for CLS Compliance test.
4897         (MemberCache.VerifyClsParameterConflict): New method.
4898         Checks method parameters for CS3006 error.
4899
4900         * enum.cs (EnumMember): Is derived from MemberCore.
4901         (Enum.VerifyClsName): Optimized for better performance.
4902
4903 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4904
4905         * report.cs: Renamed Error_T to Error and changed all
4906         references.
4907
4908 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4909
4910         * class.cs (TypeContainer.IndexerArrayList): New inner class
4911         container for indexers.
4912         (TypeContainer.DefaultIndexerName): New constant for default
4913         indexer name. Replaced all "Item" with this constant.
4914         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
4915
4916         * typemanager.cs (TypeManager.default_member_ctor): Cache here
4917         DefaultMemberAttribute constructor.
4918
4919 2004-08-05  Martin Baulig  <martin@ximian.com>
4920
4921         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4922         Fix bug #59429.
4923
4924 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
4925
4926         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
4927         multi platforms problem.
4928
4929         * compiler.csproj: Included shared files.
4930
4931 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4932
4933         Fix bug 60333, 55971 in the more general way
4934         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4935         Added arg_type argument for constant conversion.
4936         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
4937
4938 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4939
4940         Fix bug #59760
4941         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
4942         OperatorArrayList, MethodCoreArrayList for typecontainer
4943         containers. Changed class member types to these new types.
4944         (MethodArrayList.DefineMembers): Added test for CS0659.
4945
4946 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
4947
4948         * cfold.cs: Synchronize the folding with the code in expression.cs
4949         Binary.DoNumericPromotions for uint operands.
4950
4951         * attribute.cs: Revert patch from Raja, it introduced a regression
4952         while building Blam-1.2.1 (hard to isolate a test case).
4953
4954 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4955
4956         Fix for #55382
4957         * class.cs:
4958         (TypeContainer.Define): Renamed to DefineContainerMembers because of
4959         name collision.
4960         (MethodCore.parent_method): New member. The method we're overriding
4961         if this is an override method.
4962         (MethodCore.CheckBase): Moved from Method class and made common.
4963         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
4964         private.
4965         (MethodCore.CheckForDuplications): New abstract method. For custom
4966         member duplication search in a container
4967         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
4968         method and its return type.
4969         (Event.conflict_symbol): New member. Symbol with same name in the
4970         parent class.
4971
4972         * decl.cs:
4973         (MemberCache.FindMemberWithSameName): New method. The method
4974         is looking for conflict with inherited symbols.
4975
4976 2004-08-04  Martin Baulig  <martin@ximian.com>
4977
4978         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
4979
4980         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
4981
4982 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4983
4984         * report.cs (Message): New enum for better error, warning reference in
4985         the code.
4986         (MessageData): New inner abstract class. It generally handles printing of
4987         error and warning messages.
4988         Removed unused Error, Warning, Message methods.
4989
4990 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4991
4992         Fix for cs0592-8.cs test
4993         * attribute.cs
4994         (Attributable.ValidAttributeTargets): Made public.
4995         (Attribute.ExplicitTarget): New member for explicit target value.
4996         (Attribute.CheckTargets): Now we translate explicit attribute
4997         target to Target here.
4998
4999 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5000
5001         * ecore.cs (MethodGroupExpr): new IsBase property.
5002
5003         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5004
5005         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5006         rather than an instance expr.
5007
5008         (DelegateCreation.Emit): Use the method group rather than
5009         the instance expression. Also, if you have base.Foo as the
5010         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5011
5012         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5013
5014         (NewDelegate.DoResolve): Only check for the existance of Invoke
5015         if the method is going to be needed. Use MethodGroupExpr.
5016
5017         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5018
5019         * expression.cs: For pointer arith., make sure to use
5020         the size of the type, not the size of the pointer to
5021         the type.
5022
5023 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5024
5025         Fix for #60722
5026         * class.cs (Class): Added error CS0502 test.
5027
5028 2004-08-03  John Luke  <jluke@cfl.rr.com>
5029             Raja R Harinath  <rharinath@novell.com>
5030
5031         Fix for #60997.
5032         * attribute.cs (Attribute.complained_before): New flag.
5033         (Attribute.ResolveType, Attribute.Resolve),
5034         (Attribute.DefinePInvokeMethod): Set it.
5035         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5036         
5037 2004-08-03  Martin Baulig  <martin@ximian.com>
5038
5039         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5040         use a user-defined operator; we still need to do numeric
5041         promotions in case one argument is a builtin type and the other
5042         one has an implicit conversion to that type.  Fixes #62322.
5043
5044 2004-08-02  Martin Baulig  <martin@ximian.com>
5045
5046         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5047         (LocalInfo.IsThis): New public property.
5048         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5049
5050 2004-08-01  Martin Baulig  <martin@ximian.com>
5051
5052         * class.cs (TypeContainer.GetClassBases): Don't set the default
5053         here since we may get called from GetPartialBases().
5054         (TypeContainer.DefineType): If GetClassBases() didn't return a
5055         parent, use the default one.
5056
5057 2004-07-30  Duncan Mak  <duncan@ximian.com>
5058
5059         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5060
5061 2004-07-30  Martin Baulig  <martin@ximian.com>
5062
5063         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5064
5065         * class.cs (SourceMethod): New public class, derive from the
5066         symbol writer's ISourceMethod.
5067         (Method): Use the new symbol writer API.
5068
5069         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5070         as argument and use the new symbol writer.
5071
5072         * location.cs
5073         (SourceFile): Implement the symbol writer's ISourceFile.
5074         (Location.SymbolDocument): Removed.
5075         (Location.SourceFile): New public property.
5076
5077         * symbolwriter.cs: Use the new symbol writer API.
5078
5079 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5080
5081         * Makefile (install-local): Remove.  Functionality moved to
5082         executable.make.
5083
5084 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5085
5086         * Makefile: Install mcs.exe.config file together with mcs.exe.
5087         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5088         correct runtime version.
5089         
5090 2004-07-25  Martin Baulig  <martin@ximian.com>
5091
5092         * class.cs
5093         (TypeContainer.RegisterOrder): Removed, this was unused.
5094         (TypeContainer, interface_order): Removed.
5095         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5096         TypeContainer as argument since we can also be called with a
5097         `PartialContainer' for a partial class/struct/interface.
5098         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5099         of checking whether we're an `Interface' - we could be a
5100         `PartialContainer'.
5101         (PartialContainer.Register): Override; call
5102         AddClass()/AddStruct()/AddInterface() on our parent.
5103
5104         * cs-parser.jay (interface_member_declaration): Add things to the
5105         `current_container', not the `current_class'.
5106
5107         * rootcontext.cs (RegisterOrder): The overloaded version which
5108         takes an `Interface' was unused, removed.
5109
5110         * typemanager.cs (TypeManager.LookupInterface): Return a
5111         `TypeContainer', not an `Interface'.
5112         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5113         contain a `PartialContainer' for an interface, so check it's
5114         `Kind' to figure out what it is.
5115
5116 2004-07-25  Martin Baulig  <martin@ximian.com>
5117
5118         * class.cs (Class.DefaultTypeAttributes): New public constant.
5119         (Struct.DefaultTypeAttributes): Likewise.
5120         (Interface.DefaultTypeAttributes): Likewise.
5121         (PartialContainer.TypeAttr): Override this and add the
5122         DefaultTypeAttributes.
5123
5124 2004-07-25  Martin Baulig  <martin@ximian.com>
5125
5126         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5127         we can just use the `Parent' field instead.
5128
5129 2004-07-25  Martin Baulig  <martin@ximian.com>
5130
5131         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5132
5133 2004-07-25  Martin Baulig  <martin@ximian.com>
5134
5135         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5136         our parts before defining any methods.
5137         (TypeContainer.VerifyImplements): Make this virtual.
5138         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5139         on our PartialContainer.
5140
5141 2004-07-25  Martin Baulig  <martin@ximian.com>
5142
5143         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5144
5145         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5146         argument, we can just use the `Parent' field instead.
5147
5148         * class.cs
5149         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5150         (MemberBase.DoDefine): Likewise.
5151
5152 2004-07-24  Martin Baulig  <martin@ximian.com>
5153
5154         * decl.cs (MemberCore.Parent): New public field.
5155         (DeclSpace.Parent): Moved to MemberCore.
5156
5157         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5158         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5159         parent's .ctor.
5160         (FieldBase, Field, Operator): Likewise.
5161         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5162         (EventField, Event): Likewise.
5163
5164 2004-07-23  Martin Baulig  <martin@ximian.com>
5165
5166         * class.cs (PartialContainer): New public class.
5167         (ClassPart): New public class.
5168         (TypeContainer): Added support for partial classes.
5169         (TypeContainer.GetClassBases): Splitted some of the functionality
5170         out into GetNormalBases() and GetPartialBases().
5171
5172         * cs-tokenizer.cs (Token.PARTIAL): New token.
5173         (Tokenizer.consume_identifier): Added some hacks to recognize
5174         `partial', but only if it's immediately followed by `class',
5175         `struct' or `interface'.
5176
5177         * cs-parser.jay: Added support for partial clases.
5178
5179 2004-07-23  Martin Baulig  <martin@ximian.com>
5180
5181         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5182         a `DeclSpace' and also made it readonly.
5183         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5184         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5185         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5186
5187         * cs-parser.jay: Pass the `current_class', not the
5188         `current_container' (at the moment, this is still the same thing)
5189         to a new Method, Property, Event, Indexer or Constructor.
5190
5191 2004-07-23  Martin Baulig  <martin@ximian.com>
5192
5193         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5194         and removed the `current_interface' one.
5195         (struct_declaration, class_declaration, interface_declaration):
5196         Set `current_class' to the newly created class/struct/interface;
5197         set their `Bases' and call Register() before parsing their body.
5198
5199 2004-07-23  Martin Baulig  <martin@ximian.com>
5200
5201         * class.cs (Kind): New public enum.
5202         (TypeContainer): Made this class abstract.
5203         (TypeContainer.Kind): New public readonly field.
5204         (TypeContainer.CheckDef): New public method; moved here from
5205         cs-parser.jay.
5206         (TypeContainer.Register): New public abstract method.
5207         (TypeContainer.GetPendingImplementations): New public abstract
5208         method.
5209         (TypeContainer.GetClassBases): Removed the `is_class' and
5210         `is_iface' parameters.
5211         (TypeContainer.DefineNestedTypes): Formerly known as
5212         DoDefineType().
5213         (ClassOrStruct): Made this class abstract.
5214
5215         * tree.cs (RootTypes): New public type. 
5216
5217 2004-07-20  Martin Baulig  <martin@ximian.com>
5218
5219         * tree.cs (Tree.RecordNamespace): Removed.
5220         (Tree.Namespaces): Removed.
5221
5222         * rootcontext.cs (RootContext.IsNamespace): Removed.
5223
5224         * cs-parser.jay (namespace_declaration): Just create a new
5225         NamespaceEntry here.
5226
5227 2004-07-20  Martin Baulig  <martin@ximian.com>
5228
5229         * statement.cs (ExceptionStatement): New abstract class.  This is
5230         now used as a base class for everyone who's using `finally'.
5231         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5232         our local variables before using them.
5233
5234         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5235         virtual method.  This is used by Yield.Resolve() to "steal" an
5236         outer block's `finally' clauses.
5237         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5238         argument.
5239
5240         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5241         version which takes an ExceptionStatement.  This version must be
5242         used to create exception branchings.
5243
5244         * iterator.cs
5245         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5246         (Iterator.EmitMoveNext): Added exception support; protect the
5247         block with a `fault' clause, properly handle 'finally' clauses.
5248         (Iterator.EmitDispose): Run all the `finally' clauses here.
5249
5250 2004-07-20  Martin Baulig  <martin@ximian.com>
5251
5252         * iterator.cs: This is the first of a set of changes in the
5253         iterator code.  Match the spec more closely: if we're an
5254         IEnumerable, then GetEnumerator() must be called.  The first time
5255         GetEnumerator() is called, it returns the current instance; all
5256         subsequent invocations (if any) must create a copy.
5257
5258 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5259
5260         * expression.cs: Resolve the constant expression before returning
5261         it. 
5262
5263 2004-07-19  Martin Baulig  <martin@ximian.com>
5264
5265         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5266         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5267         the return type of the new EmitContext.
5268
5269 2004-07-18  Martin Baulig  <martin@ximian.com>
5270
5271         * class.cs (Property.Define): Fix iterators.
5272
5273         * iterators.cs (Iterator.Define): Moved the
5274         `container.AddInterator (this)' call here from the .ctor; only do
5275         it if we resolved successfully.
5276
5277 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5278
5279         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5280         `true' for preprocessing directives that we parse.  The return
5281         value indicates whether we should return to regular tokenizing or
5282         not, not whether it was parsed successfully.
5283
5284         In the past if we were in: #if false ... #line #endif, we would
5285         resume parsing after `#line'.  See bug 61604.
5286
5287         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5288         building: IsEnumType should return true only for enums, not for
5289         enums or System.Enum itself.  This fixes #61593.
5290
5291         Likely what happened is that corlib was wrong: mcs depended on
5292         this bug in some places.  The bug got fixed, we had to add the
5293         hack, which caused bug 61593.
5294
5295         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5296         that was a workaround for the older conditions.
5297
5298 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5299
5300         * assign.cs: IAssignMethod has a new interface, as documented
5301         inline. All assignment code now uses this new api.
5302
5303         * ecore.cs, expression.cs: All classes which implement
5304         IAssignMethod now use the new interface.
5305
5306         * expression.cs (Invocation): add a hack to EmitCall so that
5307         IndexerAccess can be the target of a compound assignment without
5308         evaluating its arguments twice.
5309
5310         * statement.cs: Handle changes in Invocation api.
5311
5312 2004-07-16  Martin Baulig  <martin@ximian.com>
5313
5314         * iterators.cs: Rewrote this.  We're now using one single Proxy
5315         class for both the IEnumerable and the IEnumerator interface and
5316         `Iterator' derives from Class so we can use the high-level API.
5317
5318         * class.cs (TypeContainer.AddIterator): New method.
5319         (TypeContainer.DoDefineType): New protected virtual method, which
5320         is called from DefineType().
5321         (TypeContainer.DoDefineMembers): Call DefineType() and
5322         DefineMembers() on all our iterators.
5323         (TypeContainer.Emit): Call Emit() on all our iterators.
5324         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5325
5326         * codegen.cs (EmitContext.CurrentIterator): New public field.
5327
5328 2004-07-15  Martin Baulig  <martin@ximian.com>
5329
5330         * typemanager.cs
5331         (TypeManager.not_supported_exception_type): New type.   
5332
5333 2004-07-14  Martin Baulig  <martin@ximian.com>
5334
5335         * iterators.cs: Use real error numbers.
5336
5337 2004-07-14  Martin Baulig  <martin@ximian.com>
5338
5339         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5340         requires this to be a System.Collection.IEnumerable and not a
5341         class implementing that interface.
5342         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5343
5344 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5345
5346         * class.cs: Fixed previous fix, it broke some error tests.
5347
5348 2004-07-12  Martin Baulig  <martin@ximian.com>
5349
5350         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5351         Fixes #61293.
5352
5353 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5354
5355         * assign.cs (LocalTemporary): Add new argument: is_address,If
5356         `is_address' is true, then the value that we store is the address
5357         to the real value, and not the value itself.
5358         
5359         * ecore.cs (PropertyExpr): use the new local temporary
5360         stuff to allow us to handle X.Y += z (where X is a struct)
5361
5362 2004-07-08  Martin Baulig  <martin@ximian.com>
5363
5364         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5365         not always return, just like we're doing in Using.Resolve().
5366
5367 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5368
5369         * cs-parser.jay (fixed_statement): flag this as Pinned.
5370
5371 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5372
5373         * typemanager.cs (TypeManager): Removed MakePinned method, this
5374         mechanism is replaced with the .NET 2.x compatible mechanism of
5375         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5376
5377         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5378         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5379         `IsFixed' property which has a different meaning.
5380
5381 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5382
5383         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5384         visible from inside a nested class, not just the names of the
5385         immediately enclosing class.
5386         Fix for bug #60730.
5387
5388 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5389
5390         * expression.cs (BetterConversion): Remove buggy special-case
5391         handling of "implicit constant expression conversions".  At this
5392         point, we already know that the conversion is possible -- we're
5393         only checking to see which is better.
5394
5395 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5396
5397         * cs-parser.jay: Added error CS0210 test.
5398
5399 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5400
5401         * cs-parser.jay: Added error CS0134 test.
5402
5403 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5404
5405         Fix bug #52507
5406         * cs-parser.jay: Added error CS0145 test.
5407
5408 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5409
5410         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5411
5412 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5413         
5414         * expression.cs (StackAlloc.Resolve): The argument may not
5415         be a constant; deal with this case.
5416         
5417 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5418
5419         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5420         GetIndexerAttributeValue.
5421         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5422
5423         * class.cs (Indexer.Define): Added error tests for CS0415,
5424         CS0609.
5425
5426 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5427
5428         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5429         property code.
5430
5431 2004-06-23  Martin Baulig  <martin@ximian.com>
5432
5433         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5434         neither return nor throw, reset the barrier as well.  Fixes #60457.
5435
5436 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5437
5438         * class.cs : EventAttributes is now set to None by default.
5439           This fixes bug #60459.
5440
5441 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5442
5443         Fix bug #60219
5444         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5445         Don't throw exception but return null (it's sufficient now).
5446
5447 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5448
5449         * typemanager.cs (GetArgumentTypes): Faster implementation.
5450
5451 2004-06-18  Martin Baulig  <martin@ximian.com>
5452
5453         * attribute.cs (Attribute.Resolve): Check whether we're an
5454         EmptyCast which a Constant child.  Fixes #60333.
5455
5456 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5457
5458         * statement.cs (EmitCollectionForeach): Account for the fact that
5459         not all valuetypes are in areas which we can take the address of.
5460         For these variables, we store to a temporary variable. Also, make
5461         sure that we dont emit a `callvirt' on a valuetype method.
5462
5463 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * expression.cs (StackAlloc.DoReSolve): Added test for
5466         negative parameter (CS0247).
5467
5468 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5469
5470         Fix bug #59792
5471         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5472
5473 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5474
5475         Fix bug #59781
5476         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5477         ulong.
5478
5479 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5480
5481         Fix bug #58254 & cs1555.cs, cs1556.cs
5482         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5483
5484 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5485
5486         * cs-parser.jay: Added error CS1669 test for indexers.
5487
5488 2004-06-11  Martin Baulig  <martin@ximian.com>
5489
5490         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5491         call this twice: for params and varargs methods.
5492
5493 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5494
5495         * class.cs:
5496         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5497
5498 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5499
5500         * attribute.cs (Attribute.GetValidTargets): Made public.
5501
5502         * class.cs: 
5503         (AbstractPropertyEventMethod): New class for better code sharing.
5504         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5505         CS1667 report.
5506         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5507
5508 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5509
5510         Fix bug #59477.
5511         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5512         that the call to Resolve is part of a MemberAccess.
5513         (Expression.Resolve): Use it for SimpleName resolution.
5514         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5515         Add 'intermediate' boolean argument.
5516         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5517         error message when the SimpleName can be resolved ambiguously
5518         between an expression and a type.
5519         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5520         public.
5521         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5522         call on the left-side.
5523
5524 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5525
5526         * class.cs:
5527         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5528
5529 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5530
5531         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5532
5533 2004-06-11  Martin Baulig  <martin@ximian.com>
5534
5535         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5536         varargs methods if applicable.
5537
5538 2004-06-11  Martin Baulig  <martin@ximian.com>
5539
5540         * expression.cs (Invocation.EmitCall): Don't use
5541         `method.CallingConvention == CallingConventions.VarArgs' since the
5542         method could also have `CallingConventions.HasThis'.
5543
5544 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5545
5546         * class.cs (Event.GetSignatureForError): Implemented.
5547         Fixed crash in error test cs3010.cs
5548
5549 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5550
5551         * cs-tokenizer.cs: Change the way we track __arglist to be
5552         consistent with the other keywords.
5553
5554 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5555
5556         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5557         tomorrow.
5558
5559 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5560
5561         * codegen.cs: Check that all referenced assemblies have a strongname
5562         before strongnaming the compiled assembly. If not report error CS1577.
5563         Fix bug #56563. Patch by Jackson Harper.
5564         * typemanager.cs: Added a method to return all referenced assemblies.
5565         Fix bug #56563. Patch by Jackson Harper.
5566
5567 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5568
5569         * class.cs:
5570         (Method.ApplyAttributeBuilder): Moved and added conditional
5571         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5572
5573         * delegate.cs:
5574         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5575
5576 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5577
5578         Fixed #59640
5579         * class.cs: (EventField.attribute_targets): Changed default target.
5580
5581 2004-06-08  Martin Baulig  <martin@ximian.com>
5582
5583         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5584
5585 2004-06-08  Martin Baulig  <martin@ximian.com>
5586
5587         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5588
5589 2004-06-07  Martin Baulig  <martin@ximian.com>
5590
5591         Added support for varargs methods.
5592
5593         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5594         keyword.
5595
5596         * cs-parser.jay: Added support for `__arglist'.
5597
5598         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5599
5600         * expression.cs (Argument.AType): Added `ArgList'.
5601         (Invocation): Added support for varargs methods.
5602         (ArglistAccess): New public class.
5603         (Arglist): New public class.
5604
5605         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5606
5607         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5608         a method's top-level block if the method has varargs.
5609
5610         * support.cs (ReflectionParameters, InternalParameters): Added
5611         support for varargs methods.    
5612
5613 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5614
5615         * class.cs: Provide location in indexer error report.
5616
5617         * driver.cs: Use standard names.
5618
5619         * namespace.cs: Catch the use of using after a namespace has been
5620         declared also on using aliases.
5621
5622 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5623
5624         Bug #50820.
5625         * typemanager.cs (closure_private_ok, closure_invocation_type)
5626         (closure_qualifier_type, closure_invocation_assembly)
5627         (FilterWithClosure): Move to ...
5628         (Closure): New internal nested class.
5629         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5630         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5631         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5632         (MemberLookup, MemberLookupFailed): Use it.
5633         * expression.cs (New.DoResolve): Treat the lookup for the
5634         constructor as being qualified by the 'new'ed type.
5635         (Indexers.GetIndexersForTypeOrInterface): Update.
5636
5637 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5638
5639         * attribute.cs
5640         (GetConditionalAttributeValue): New method. Returns
5641         condition of ConditionalAttribute.
5642         (SearchMulti): New method.  Returns all attributes of type 't'.
5643         Use it when attribute is AllowMultiple = true.
5644         (IsConditionalMethodExcluded): New method.
5645
5646         * class.cs
5647         (Method.IsExcluded): Implemented. Returns true if method has conditional
5648         attribute and the conditions is not defined (method is excluded).
5649         (IMethodData): Extended interface for ConditionalAttribute support.
5650         (PropertyMethod.IsExcluded): Implemented.
5651
5652         * decl.cs
5653         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5654
5655         * expression.cs
5656         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5657         on the method.
5658
5659 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5660
5661         * expression.cs (ArrayCreationExpression): Make this just an
5662         `expression'. It can't be a statement, so the code here was
5663         dead.
5664
5665 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5666
5667         Fixed #59072
5668         * typemanager.cs (GetFullNameSignature): New method for
5669         MethodBase types.
5670
5671 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5672
5673         Fixed #56452
5674         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5675         Use this method when MethodBuilder is null.
5676         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5677         Added test for error CS0626 (MONO reports error for this situation).
5678         (IMethodData.GetSignatureForError): Extended interface.
5679
5680 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5681
5682         * attribute.cs
5683         (AttributeTester.GetObsoleteAttribute): Returns instance of
5684         ObsoleteAttribute when type is obsolete.
5685
5686         * class.cs
5687         (TypeContainer.VerifyObsoleteAttribute): Override.
5688         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5689         (MethodCode.VerifyObsoleteAttribute): Override.
5690         (MemberBase.VerifyObsoleteAttribute): Override.
5691
5692         * decl.cs
5693         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5694         and report proper error.
5695
5696         *delegate.cs
5697         Delegate.VerifyObsoleteAttribute): Override.
5698
5699         * ecore.cs
5700         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5701         and report proper error.
5702         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5703
5704         * enum.cs
5705         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5706         and enum member.
5707
5708         * expression.cs
5709         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5710         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5711         Added test for ObsoleteAttribute.
5712
5713         * statement.cs
5714         (Catch): Derived from Statement.
5715
5716 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5717  
5718         Fixed bug #59071 & cs0160.cs
5719  
5720         * statement.cs (Try.Resolve): Check here whether order of catch
5721         clauses matches their dependencies.
5722
5723 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5724
5725         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5726         caused a regression: #59343.  Referencing nested classes from an
5727         assembly stopped working.
5728
5729 2004-05-31  Martin Baulig  <martin@ximian.com>
5730
5731         MCS is now frozen for beta 2.
5732
5733 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5734
5735         * convert.cs: add a trivial cache for overload operator resolution.
5736
5737 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5738
5739         * decl.cs: If possible, use lookuptypedirect here. We can only do
5740         this if there is no `.' after the namespace. Avoids using
5741         LookupType, which does lots of slow processing.
5742         (FindNestedType) New method, does what it says :-).
5743         * namespace.cs: use LookupTypeDirect.
5744         * rootcontext.cs: use membercache, if possible.
5745         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5746
5747 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5748
5749         * expression.cs:
5750         According to the spec, 
5751
5752         In a member access of the form E.I, if E is a single identifier,
5753         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5754         field, property, localvariable, or parameter with the same type as
5755         the meaning of E as a type-name (§3.8), then both possible
5756         meanings of E are permitted.
5757
5758         We did not check that E as a simple-name had the same type as E as
5759         a type name.
5760
5761         This trivial check gives us 5-7% on bootstrap time.
5762
5763 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5764
5765         * expression.cs (Invocation.OverloadResolve): Avoid the
5766         use of hashtables and boxing here by allocating on demand.
5767
5768 2004-05-30  Martin Baulig  <martin@ximian.com>
5769
5770         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5771         we're doing a silent lookup.  Don't try to lookup nested types in
5772         TypeManager.object_type (thanks to Ben Maurer).
5773
5774 2004-05-30  Martin Baulig  <martin@ximian.com>
5775
5776         Committing a patch from Ben Maurer.
5777
5778         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5779
5780 2004-05-29  Martin Baulig  <martin@ximian.com>
5781
5782         * class.cs (IMethodData.ShouldIgnore): New method.
5783
5784         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5785         `Location' argument, we don't need it anywhere.  Use
5786         `IMethodData.ShouldIgnore ()' instead of
5787         `MethodData.GetMethodFlags ()'.
5788         (TypeManager.AddMethod): Removed.
5789         (TypeManager.AddMethod2): Renamed to AddMethod.
5790
5791 2004-05-29  Martin Baulig  <martin@ximian.com>
5792
5793         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5794
5795         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5796         converting from a class type S to an interface type and we already
5797         have an object on the stack, don't box it again.  Fixes #52578.
5798
5799 2004-05-29  Martin Baulig  <martin@ximian.com>
5800
5801         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5802         Added support for `params' parameters.  Fixes #59267.
5803
5804 2004-05-29  Martin Baulig  <martin@ximian.com>
5805
5806         * literal.cs (NullPointer): Provide a private .ctor which sets
5807         `type' to TypeManager.object_type.  Fixes #59048.
5808
5809 2004-05-29  Martin Baulig  <martin@ximian.com>
5810
5811         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5812         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5813
5814         * ecore.cs (EventExpr.instance_expr): Make the field private.
5815
5816 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5817
5818         Fixed bug #50080 & cs0214-2.cs
5819         * expression.cs (Cast.DoResolve): Check unsafe context here.
5820         
5821         * statement.cs (Resolve.DoResolve): Likewise.
5822
5823 2004-05-26  Martin Baulig  <martin@ximian.com>
5824
5825         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5826
5827         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5828         (RootContext.LookupType): Pass down the `silent' flag.
5829
5830 2004-05-25  Martin Baulig  <martin@ximian.com>
5831
5832         * expression.cs
5833         (MethodGroupExpr.IdenticalTypeName): New public property.
5834         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5835         expression actually refers to a type.
5836
5837 2004-05-25  Martin Baulig  <martin@ximian.com>
5838
5839         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5840         for #56176 and made it actually work.
5841
5842 2004-05-25  Martin Baulig  <martin@ximian.com>
5843
5844         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5845         (FieldExpr, PropertyExpr): Override and implement
5846         CacheTemporaries.  Fixes #52279.
5847
5848 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5849
5850         * location.cs: In the new compiler listing a file twice is a
5851         warning, not an error.
5852
5853 2004-05-24  Martin Baulig  <martin@ximian.com>
5854
5855         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5856         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5857
5858 2004-05-24  Martin Baulig  <martin@ximian.com>
5859
5860         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5861         walking the `using' list.  Fixes #53921.
5862
5863 2004-05-24  Martin Baulig  <martin@ximian.com>
5864
5865         * const.cs (Const.LookupConstantValue): Added support for
5866         EmptyCast's; fixes #55251.
5867
5868 2004-05-24  Martin Baulig  <martin@ximian.com>
5869
5870         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5871         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5872         which does the CS0135 check.  The reason is that we first need to
5873         check whether the variable actually exists.
5874
5875 2004-05-24  Martin Baulig  <martin@ximian.com>
5876
5877         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5878         than RootContext.LookupType() to find the explicit interface
5879         type.  Fixes #58584.
5880
5881 2004-05-24  Raja R Harinath  <rharinath@novell.com>
5882
5883         * Makefile: Simplify.  Use executable.make.
5884         * mcs.exe.sources: New file.  List of sources of mcs.exe.
5885
5886 2004-05-24  Anders Carlsson  <andersca@gnome.org>
5887
5888         * decl.cs:
5889         * enum.cs:
5890         Use the invariant culture when doing String.Compare for CLS case
5891         sensitivity.
5892         
5893 2004-05-23  Martin Baulig  <martin@ximian.com>
5894
5895         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
5896         don't have any dots.  Fixes #52622, added cs0246-8.cs.
5897
5898         * namespace.cs (NamespaceEntry.Lookup): Likewise.
5899         
5900 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5901
5902         * class.cs (MemberBase.Define): Reuse MemberType member for 
5903         resolved type. Other methods can use it too.
5904
5905 2004-05-23  Martin Baulig  <martin@ximian.com>
5906
5907         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
5908         the variable also exists in the current block (otherwise, we need
5909         to report a CS0103).  Fixes #58670.
5910
5911 2004-05-23  Martin Baulig  <martin@ximian.com>
5912
5913         * flowanalysis.cs (Reachability.Reachable): Compute this
5914         on-the-fly rather than storing it as a field.
5915
5916 2004-05-23  Martin Baulig  <martin@ximian.com>
5917
5918         * flowanalysis.cs (Reachability.And): Manually compute the
5919         resulting `barrier' from the reachability.      
5920        
5921 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5922
5923         Fix bug #57835
5924         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
5925         instance of ObsoleteAttribute when symbol is obsolete.
5926
5927         * class.cs
5928         (IMethodData): Extended interface for ObsoleteAttribute support.
5929
5930 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5931
5932         * attribute.cs: Fix bug #55970
5933
5934 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5935
5936         Fix bug #52705
5937         * attribute.cs
5938         (GetObsoleteAttribute): New method. Creates the instance of
5939         ObsoleteAttribute.
5940         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
5941         ObsoleteAttribute when member is obsolete.
5942         (AttributeTester.Report_ObsoleteMessage): Common method for
5943         Obsolete error/warning reporting.
5944
5945         * class.cs
5946         (TypeContainer.base_classs_type): New member for storing parent type.
5947
5948         * decl.cs
5949         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
5950         for this MemberCore.
5951
5952 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5953
5954         * attribute.cs, const.cs: Fix bug #58590
5955
5956 2004-05-21  Martin Baulig  <martin@ximian.com>
5957
5958         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
5959         out parameters if the end of the method is unreachable.  Fixes
5960         #58098. 
5961
5962 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5963
5964         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
5965         Hari was right, why extra method.
5966
5967 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5968
5969         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
5970
5971 2004-05-20  Martin Baulig  <martin@ximian.com>
5972
5973         Merged this back from gmcs to keep the differences to a minumum.
5974
5975         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
5976         instead of a Declspace.
5977         (Attribute.ResolveType): Likewise.
5978         (Attributes.Search): Likewise.
5979         (Attributes.Contains): Likewise.
5980         (Attributes.GetClsCompliantAttribute): Likewise.
5981
5982         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
5983         argument.
5984         (MethodData.ApplyAttributes): Take an EmitContext instead of a
5985         DeclSpace.
5986
5987 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
5988
5989         Fix bug #58688 (MCS does not report error when the same attribute
5990         is assigned twice)
5991
5992         * attribute.cs (Attribute.Emit): Distinction between null and default.
5993
5994 2004-05-19  Raja R Harinath  <rharinath@novell.com>
5995
5996         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
5997         of a top-level attribute without an attribute target.
5998         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
5999         Make non-static.
6000         (Attribute.Conditional_GetConditionName), 
6001         (Attribute.Obsolete_GetObsoleteMessage): Update.
6002         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6003         part of ScanForIndexerName.
6004         (Attribute.CanIgnoreInvalidAttribute): New function.
6005         (Attribute.ScanForIndexerName): Move to ...
6006         (Attributes.ScanForIndexerName): ... here.
6007         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6008         (Attributes.Search): New internal variant that can choose not to
6009         complain if types aren't resolved.  The original signature now
6010         complains.
6011         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6012         complaints suppressed.
6013         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6014         only if it not useful.
6015         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6016         top-level for attributes that are shared between the assembly
6017         and a top-level class.
6018         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6019         * class.cs: Update to reflect changes.
6020         (DefineIndexers): Fuse loops.
6021         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6022         a couple more variants of attribute names.
6023
6024 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6025
6026         Fix bug #52585 (Implemented explicit attribute declaration)
6027
6028         * attribute.cs:
6029         (Attributable.ValidAttributeTargets): New abstract method. It gets
6030         list of valid attribute targets for explicit target declaration.
6031         (Attribute.Target): It holds target itself.
6032         (AttributeSection): Removed.
6033         (Attribute.CheckTargets): New method. It checks whether attribute
6034         target is valid for the current element.
6035
6036         * class.cs:
6037         (EventProperty): New class. For events that are declared like
6038         property (with add and remove accessors).
6039         (EventField): New class. For events that are declared like field.
6040         class.cs
6041
6042         * cs-parser.jay: Implemented explicit attribute target declaration.
6043
6044         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6045         Override ValidAttributeTargets.
6046
6047         * parameter.cs:
6048         (ReturnParameter): Class for applying custom attributes on 
6049         the return type.
6050         (ParameterAtribute): New class. Class for applying custom
6051         attributes on the parameter type.
6052
6053 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6054
6055         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6056         definitions. 
6057
6058         (Method): Allow UNSAFE here.
6059
6060         * modifiers.cs: Support unsafe reporting.
6061
6062 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6063
6064         * decl.cs: Fix bug #58478.
6065
6066 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6067
6068         * statement.cs: When checking for unreachable code on an EmptyStatement,
6069         set the location. Fixes bug #58488.
6070
6071 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6072
6073         * driver.cs: Add -pkg handling.
6074
6075         From Gonzalo: UseShelLExecute=false
6076
6077 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6078
6079         * attribute.cs:
6080         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6081         for attribute.
6082         (Attribute.IsClsCompliaceRequired): Moved to base for better
6083         accesibility.
6084         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6085         when attribute is AttributeUsageAttribute.
6086         (Attribute.GetValidTargets): Simplified.
6087         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6088         attribute for this type.
6089         (Attribute.ApplyAttributes): Method renamed to Emit and make
6090         non-static.
6091         (GlobalAttributeSection): New class for special handling of global
6092         attributes (assembly, module).
6093         (AttributeSection.Emit): New method.
6094
6095         * class.cs: Implemented Attributable abstract methods.
6096         (MethodCore.LabelParameters): Moved to Parameter class.
6097         (Accessor): Is back simple class.
6098         (PropertyMethod): Implemented Attributable abstract class.
6099         (DelegateMethod): Implemented Attributable abstract class.
6100         (Event): New constructor for disctintion between normal Event
6101         and Event with accessors.
6102
6103         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6104
6105         * codegen.cs, const.cs, decl.cs, delegate.cs:
6106         (CommonAssemblyModulClass): Implemented Attributable abstract class
6107         and simplified.
6108
6109         * enum.cs: Implement IAttributeSupport interface.
6110         (EnumMember): New class for emum members. Implemented Attributable
6111         abstract class
6112
6113         * parameter.cs:
6114         (ParameterBase): Is abstract.
6115         (ReturnParameter): New class for easier [return:] attribute handling.
6116
6117         * typemanager.cs: Removed builder_to_attr.
6118
6119 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6120
6121         Fix bug #57151.
6122         * attribute.cs (Attribute.GetPositionalValue): New function.
6123         * class.cs (TypeContainer.VerifyMembers): New function.
6124         (TypeContainer.Emit): Use it.
6125         (ClassOrStruct): New base class for Class and Struct.
6126         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6127         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6128         class.
6129         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6130         then each non-static field should have a FieldOffset attribute.
6131         Otherwise, none of the fields should have a FieldOffset attribute.
6132         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6133         and FieldOffset attributes.
6134         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6135         (TypeManager.field_offset_attribute_type): New core types.
6136         (TypeManager.InitCoreTypes): Initialize them.
6137
6138 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6139
6140         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6141         Return correct type.
6142         From bug #58270.
6143
6144 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6145
6146         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6147         be implicitly converted to ulong.
6148         
6149         * expression.cs: The logic for allowing operator &, | and ^ worked
6150         was wrong, it worked before because we did not report an error in
6151         an else branch.  Fixes 57895.
6152
6153         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6154         allow volatile fields to be reference types.
6155
6156 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6157
6158         * driver.cs: Add support for /debug-
6159
6160 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6161
6162         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6163         Add a 'complain' parameter to silence errors.
6164         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6165         silently overlooked type-resolutions.
6166         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6167         to reflect changes.
6168         (Attributes.Search): New function.
6169         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6170         (Attributes.GetAttributeFullName): Remove hack.
6171         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6172         Update to reflect changes.
6173         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6174         Use Attributes.Search instead of nested loops.
6175
6176 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6177
6178         * decl.cs:
6179         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6180         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6181         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6182
6183         * report.cs: (Report.Warning): Renamed to Warning_T because of
6184         parameter collision.
6185
6186 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6187
6188         * expression.cs (MemberAccess.ResolveMemberAccess):
6189         Exit with non-zero status after Report.Error.
6190         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6191         Likewise.
6192         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6193
6194 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6195
6196         * support.cs: Don't hang when the file is empty.
6197
6198 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6199
6200         * support.cs: In SeekableStreamReader, compute the preamble size of the
6201           underlying stream. Position changes should take into account that initial
6202           count of bytes.
6203
6204 2004-05-03  Todd Berman  <tberman@sevenl.net>
6205
6206         * driver.cs: remove unused GetSysVersion function.
6207
6208 2004-05-03  Todd Berman  <tberman@sevenl.net>
6209
6210         * driver.cs: Remove the hack from saturday, as well as the hack
6211         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6212         link_paths to get that bit proper.
6213
6214 2004-05-01  Todd Berman  <tberman@sevenl.net>
6215
6216         * driver.cs: Try a LoadFrom before a Load, this checks the current
6217         path. This is currently a bug in mono that is be fixed, however, this
6218         provides a workaround for now. This will be removed when the bug
6219         is fixed.
6220
6221 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6222
6223         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6224         incomplete key pairs (#57941).
6225
6226 2004-05-01  Todd Berman  <tberman@sevenl.net>
6227
6228         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6229         from the GAC
6230
6231 2004-04-30  Jackson Harper  <jackson@ximian.com>
6232
6233         * codegen.cs: Open keys readonly.
6234         
6235 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6236
6237         * typemanager.cs: don't report cyclic struct layout when a struct
6238         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6239         which has 2 Pango.Rectangle fields.
6240
6241 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6242
6243         * expression.cs: Handle IntPtr comparisons with IL code
6244         rather than a method call.
6245
6246 2004-04-29  Martin Baulig  <martin@ximian.com>
6247
6248         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6249         the list of PropertyInfo's in class hierarchy and find the
6250         accessor.  Fixes #56013.
6251
6252 2004-04-29  Martin Baulig  <martin@ximian.com>
6253
6254         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6255
6256 2004-04-29  Martin Baulig  <martin@ximian.com>
6257
6258         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6259
6260         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6261
6262 2004-04-29  Martin Baulig  <martin@ximian.com>
6263
6264         * class.cs (ConstructorInitializer.Resolve): Check whether the
6265         parent .ctor is accessible.  Fixes #52146.
6266
6267 2004-04-29  Martin Baulig  <martin@ximian.com>
6268
6269         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6270
6271         * statement.cs (Using.EmitLocalVariableDecls): Use
6272         TypeManager.idisposable_type, not typeof (IDisposable).
6273         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6274
6275 2004-04-29  Martin Baulig  <martin@ximian.com>
6276
6277         * class.cs (Event.Define): Don't emit the field and don't set
6278         RTSpecialName and SpecialName for events on interfaces.  Fixes
6279         #57703. 
6280
6281 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6282
6283         Refactor Attribute.ApplyAttributes.
6284         * attribute.cs (Attributable): New base class for objects that can
6285         have Attributes applied on them.
6286         (Attribute): Make AttributeUsage fields public.
6287         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6288         (Attribute.IsInternalCall): New property.
6289         (Attribute.UsageAttr): Convert to a public read-only property.
6290         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6291         (Attribute.ResolveType, Attribute.Resolve)
6292         (Attribute.ScanForIndexerName): Update to reflect changes.
6293         (Attribute.CheckAttributeTarget): Re-format.
6294         (Attribute.ApplyAttributes): Refactor, to various
6295         Attributable.ApplyAttributeBuilder methods.
6296         * decl.cs (MemberCore): Make Attributable.
6297         * class.cs (Accessor): Make Attributable.
6298         (MethodData.ApplyAttributes): Use proper attribute types, not
6299         attribute names.
6300         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6301         (TypeContainer.ApplyAttributeBuilder)
6302         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6303         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6304         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6305         (Operator.ApplyAttributeBuilder): New factored-out methods.
6306         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6307         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6308         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6309         * parameter.cs (ParameterBase): New Attributable base class
6310         that can also represent Return types.
6311         (Parameter): Update to the changes.
6312
6313 2004-04-29  Jackson Harper  <jackson@ximian.com>
6314
6315         * driver.cs: Prefer the corlib system version when looking for
6316         assemblies in the GAC. This is still a hack, but its a better hack
6317         now.
6318         
6319 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6320
6321         * decl.cs, enum.cs: Improved error 3005 reporting.
6322   
6323         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6324         (related_symbols): New private member for list of symbols
6325         related to reported error/warning.
6326         
6327         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6328
6329 2004-04-29  Martin Baulig  <martin@ximian.com>
6330
6331         * ecore.cs (Expression.Constantify): If we're an enum and
6332         TypeManager.TypeToCoreType() doesn't give us another type, use
6333         t.UnderlyingSystemType.  Fixes #56178.  
6334
6335 2004-04-29  Martin Baulig  <martin@ximian.com>
6336
6337         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6338         interfaces and for each interface, only add members directly
6339         declared in that interface.  Fixes #53255.
6340
6341 2004-04-28  Martin Baulig  <martin@ximian.com>
6342
6343         * expression.cs (ConditionalLogicalOperator): Use a temporary
6344         variable for `left' to avoid that we evaluate it more than once;
6345         bug #52588.
6346
6347 2004-04-28  Martin Baulig  <martin@ximian.com>
6348
6349         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6350         `void[]' (CS1547).
6351
6352 2004-04-28  Martin Baulig  <martin@ximian.com>
6353
6354         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6355         void (CS1547).
6356
6357         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6358         whether the type is not void (CS1547).
6359
6360 2004-04-28  Martin Baulig  <martin@ximian.com>
6361
6362         * expression.cs (Unary.DoResolveLValue): Override this and report
6363         CS0131 for anything but Operator.Indirection.
6364
6365 2004-04-28  Martin Baulig  <martin@ximian.com>
6366
6367         Committing a patch from Ben Maurer; see bug #50820.
6368
6369         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6370         check for classes.
6371
6372         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6373         classes.        
6374
6375 2004-04-28  Martin Baulig  <martin@ximian.com>
6376
6377         Committing a patch from Ben Maurer; see bug #50820.
6378
6379         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6380         check for classes.
6381
6382         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6383         classes.        
6384
6385 2004-04-28  Martin Baulig  <martin@ximian.com>
6386
6387         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6388         (Block.AddLabel): Call DoLookupLabel() to only search in the
6389         current block.
6390
6391 2004-04-28  Martin Baulig  <martin@ximian.com>
6392
6393         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6394         comparing StringConstants and NullLiterals in Equality and Inequality.
6395
6396 2004-04-28  Jackson Harper  <jackson@ximian.com>
6397
6398         * driver.cs: Attempt to load referenced assemblies from the
6399         GAC. This is the quick and dirty version of this method that
6400         doesnt take into account versions and just takes the first
6401         canidate found. Will be good enough for now as we will not have more
6402         then one version installed into the GAC until I update this method.
6403
6404 2004-04-28  Martin Baulig  <martin@ximian.com>
6405
6406         * typemanager.cs (TypeManager.CheckStructCycles): New public
6407         static method to check for cycles in the struct layout.
6408
6409         * rootcontext.cs (RootContext.PopulateTypes): Call
6410         TypeManager.CheckStructCycles() for each TypeContainer.
6411         [Note: We only need to visit each type once.]
6412
6413 2004-04-28  Martin Baulig  <martin@ximian.com>
6414
6415         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6416
6417         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6418         success and added `out object value'.  Use a `bool resolved' field
6419         to check whether we've already been called rather than
6420         `ConstantValue != null' since this breaks for NullLiterals.
6421
6422 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6423
6424         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6425         setting of this flag, since the 'set' method may be non-public.
6426
6427 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6428
6429         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6430         check on current_vector.Block.
6431
6432 2004-04-27  Martin Baulig  <martin@ximian.com>
6433
6434         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6435         a field initializer.  Fixes #56459.
6436
6437 2004-04-27  Martin Baulig  <martin@ximian.com>
6438
6439         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6440         we're not attempting to use an indexer.  Fixes #52154.
6441
6442 2004-04-27  Martin Baulig  <martin@ximian.com>
6443
6444         * statement.cs (Return): Don't create a return label if we don't
6445         need it; reverts my change from January 20th.  Thanks to Ben
6446         Maurer for this.
6447
6448 2004-04-27  Martin Baulig  <martin@ximian.com>
6449
6450         According to the spec, `goto' can only leave a nested scope, but
6451         never enter it.
6452
6453         * statement.cs (Block.LookupLabel): Only lookup in the current
6454         block, don't recurse into parent or child blocks.
6455         (Block.AddLabel): Check in parent and child blocks, report
6456         CS0140/CS0158 if we find a duplicate.
6457         (Block): Removed this indexer for label lookups.
6458         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6459         this already does the error reporting for us.
6460
6461         * flowanalysis.cs
6462         (FlowBranching.UsageVector.Block): New public variable; may be null.
6463         (FlowBranching.CreateSibling): Added `Block' argument.
6464         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6465         label for the target of a `goto' and check whether we're not
6466         leaving a `finally'.
6467
6468 2004-04-27  Martin Baulig  <martin@ximian.com>
6469
6470         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6471         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6472         just for returns).
6473
6474 2004-04-27  Martin Baulig  <martin@ximian.com>
6475
6476         * statement.cs (Block.AddLabel): Also check for implicit blocks
6477         and added a CS0158 check.
6478
6479 2004-04-27  Martin Baulig  <martin@ximian.com>
6480
6481         * flowanalysis.cs (FlowBranchingLoop): New class.
6482         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6483         UsageVector's instead of an ArrayList.
6484         (FlowBranching.Label): Likewise.
6485         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6486         (FlowBranching.AddBreakVector): New method.
6487
6488 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * attribute.cs: Small regression fix: only convert the type if we
6491         the type is different, fixes System.Drawing build.
6492
6493 2004-04-27  Martin Baulig  <martin@ximian.com>
6494
6495         * attribute.cs (Attribute.Resolve): If we have a constant value
6496         for a named field or property, implicity convert it to the correct
6497         type.
6498
6499 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6500
6501         * statement.cs (Block.Block): Implicit blocks share
6502         'child_variable_names' fields with parent blocks.
6503         (Block.AddChildVariableNames): Remove.
6504         (Block.AddVariable): Mark variable as "used by a child block" in
6505         every surrounding block.
6506         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6507         been used in a child block, complain about violation of "Invariant
6508         meaning in blocks" rule.
6509         * cs-parser.jay (declare_local_variables): Don't use
6510         AddChildVariableNames.
6511         (foreach_statement): Don't create an implicit block: 'foreach'
6512         introduces a scope.
6513
6514 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6515
6516         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6517         converting from 0L to ulong.  Fixes 57522.
6518
6519 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6520
6521         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6522         derived class hides via 'new' keyword field from base class (test-242.cs).
6523         TODO: Handle this in the more general way.
6524         
6525         * class.cs (CheckBase): Ditto.
6526
6527 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6528
6529         * decl.cs (caching_flags): New member for storing cached values
6530         as bit flags.
6531         (MemberCore.Flags): New enum where bit flags for caching_flags
6532         are defined.
6533         (MemberCore.cls_compliance): Moved to caching_flags.
6534         (DeclSpace.Created): Moved to caching_flags.
6535
6536         * class.cs: Use caching_flags instead of DeclSpace.Created
6537         
6538 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6539
6540         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6541         if we are only a derived class, not a nested class.
6542
6543         * typemanager.cs: Same as above, but do this at the MemberLookup
6544         level (used by field and methods, properties are handled in
6545         PropertyExpr).   Allow for the qualified access if we are a nested
6546         method. 
6547
6548 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6549
6550         * class.cs: Refactoring.
6551         (IMethodData): New inteface; Holds links to parent members
6552         to avoid member duplication (reduced memory allocation).
6553         (Method): Implemented IMethodData interface.
6554         (PropertyBase): New inner classes for get/set methods.
6555         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6556         (Event): New inner classes for add/remove methods.
6557         (Event.DelegateMethod): Implemented IMethodData interface.
6558
6559         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6560         EmitContext (related to class.cs refactoring).
6561
6562 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6563
6564         * delegate.cs (Delegate.VerifyApplicability): If the number of
6565         arguments are the same as the number of parameters, first try to
6566         verify applicability ignoring  any 'params' modifier on the last
6567         parameter.
6568         Fixes #56442.
6569
6570 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6571
6572         * class.cs (TypeContainer.AddIndexer): Use
6573         'ExplicitInterfaceName' to determine if interface name was
6574         explicitly specified.  'InterfaceType' is not initialized at this time.
6575         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6576         Indexers array is already in the required order.  Initialize
6577         'IndexerName' only if there are normal indexers.
6578         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6579         (TypeContainer.Emit): Emit DefaultMember attribute only if
6580         IndexerName is initialized.
6581         Fixes #56300.
6582
6583 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6584
6585         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6586         Fixes #57007
6587
6588 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6589
6590         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6591         attributes.
6592         Fix for #56456.
6593
6594         * attribute.cs (Attribute.Resolve): Check for duplicate named
6595         attributes.
6596         Fix for #56463.
6597
6598 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6599
6600         * iterators.cs (MarkYield): track whether we are in an exception,
6601         and generate code accordingly.  Use a temporary value to store the
6602         result for our state.
6603
6604         I had ignored a bit the interaction of try/catch with iterators
6605         since their behavior was not entirely obvious, but now it is
6606         possible to verify that our behavior is the same as MS .NET 2.0
6607
6608         Fixes 54814
6609
6610 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6611
6612         * iterators.cs: Avoid creating temporaries if there is no work to
6613         do. 
6614
6615         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6616         Enumerations, use TypeManager.EnumToUnderlying and call
6617         recursively. 
6618
6619         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6620         bug #57013
6621
6622         (This.Emit): Use EmitContext.EmitThis to emit our
6623         instance variable.
6624
6625         (This.EmitAssign): Ditto.
6626
6627         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6628         codepaths, we will move all the functionality into
6629         Mono.CSharp.This 
6630
6631         (FieldExpr.EmitAssign): Ditto.
6632
6633         This fixes several hidden bugs that I uncovered while doing a code
6634         review of this today.
6635
6636         * codegen.cs (EmitThis): reworked so the semantics are more clear
6637         and also support value types "this" instances.
6638
6639         * iterators.cs: Changed so that for iterators in value types, we
6640         do not pass the value type as a parameter.  
6641
6642         Initialization of the enumerator helpers is now done in the caller
6643         instead of passing the parameters to the constructors and having
6644         the constructor set the fields.
6645
6646         The fields have now `assembly' visibility instead of private.
6647
6648 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6649
6650         * expression.cs (Argument.Resolve): Check if fields passed as ref
6651         or out are contained in a MarshalByRefObject.
6652
6653         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6654         another compiler type.
6655
6656 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6657
6658         * class.cs (Indexer.Define): use the new name checking method.
6659         Also, return false on an error.
6660         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6661         (is_identifier_[start/part]_character): make static.
6662
6663 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6664
6665         * expression.cs (Binary.ResolveOperator): Do no append strings
6666         twice: since we can be invoked more than once (array evaluation)
6667         on the same concatenation, take care of this here.  Based on a fix
6668         from Ben (bug #56454)
6669
6670 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6671
6672         * codegen.cs: Fix another case where CS1548 must be reported (when 
6673         delay-sign isn't specified and no private is available #56564). Fix
6674         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6675         error when MCS is used on the MS runtime and we need to delay-sign 
6676         (which seems unsupported by AssemblyBuilder - see #56621).
6677
6678 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6679
6680         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6681         (TypeManager.ComputeNamespaces): Faster implementation for
6682         Microsoft runtime.
6683
6684         * compiler.csproj: Updated AssemblyName to mcs.
6685
6686 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6687
6688         * rootcontext.cs: Add new types to the boot resolution.
6689
6690         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6691         MulticastDelegate is not allowed.
6692
6693         * typemanager.cs: Add new types to lookup: System.TypedReference
6694         and ArgIterator.
6695
6696         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6697         check for TypedReference or ArgIterator, they are not allowed. 
6698
6699         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6700         makes us properly catch 1510 in some conditions (see bug 56016 for
6701         details). 
6702
6703 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6704
6705         * CryptoConvert.cs: update from corlib version
6706         with endian fixes.
6707
6708 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6709
6710         * class.cs (Indexer.Define): Check indexername declaration
6711
6712 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6713
6714         * attribute.cs (IsClsCompliant): Fixed problem with handling
6715         all three states (compliant, not-compliant, undetected).
6716
6717 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6718
6719         * attribute.cs (Attribute): Location is now public.
6720         (Resolve): Store resolved arguments (pos_values) in attribute class.
6721         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6722         (GetClsCompliantAttributeValue): New method that gets
6723         CLSCompliantAttribute value.
6724         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6725         if exists else null.
6726         (AttributeTester): New class for CLS-Compliant verification routines.
6727
6728         * class.cs (Emit): Add CLS-Compliant verification.
6729         (Method.GetSignatureForError): Implemented.
6730         (Constructor.GetSignatureForError): Implemented
6731         (Constructor.HasCompliantArgs): Returns if constructor has
6732         CLS-Compliant arguments.
6733         (Constructor.Emit): Override.
6734         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6735         is needed to test only parameters.
6736         (FieldBase.GetSignatureForError): Implemented.
6737         (TypeContainer): New member for storing base interfaces.
6738         (TypeContainer.FindMembers): Search in base interfaces too.
6739
6740         * codegen.cs (GetClsComplianceAttribute): New method that gets
6741         assembly or module CLSCompliantAttribute value.
6742         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6743         for assembly.
6744         (ModuleClass.Emit): Add error 3012 test.
6745
6746         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6747
6748         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6749         state for all decl types.
6750         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6751         if CLS-Compliant tests are required.
6752         (IsClsCompliaceRequired): New method. Analyze whether code
6753         must be CLS-Compliant.
6754         (IsExposedFromAssembly): New method. Returns true when MemberCore
6755         is exposed from assembly.
6756         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6757         value or gets cached value.
6758         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6759         is explicitly marked with CLSCompliantAttribute.
6760         (IsIdentifierClsCompliant): New abstract method. This method is
6761         used to testing error 3005.
6762         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6763         for identifier and parameters CLS-Compliant testing.
6764         (VerifyClsCompliance): New method. The main virtual method for
6765         CLS-Compliant verifications.
6766         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6767         null. I don't know why is null (too many public members !).
6768         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6769         and get value of first CLSCompliantAttribute that found.
6770
6771         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6772         (VerifyClsCompliance): Override and add extra tests.
6773
6774         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6775         clscheck- disable CLS-Compliant verification event if assembly is has
6776         CLSCompliantAttribute(true).
6777
6778         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6779         ApllyAttribute is now called in emit section as in the other cases.
6780         Possible future Emit integration.
6781         (IsIdentifierClsCompliant): New override.
6782         (VerifyClsCompliance): New override.
6783         (GetEnumeratorName): Returns full enum name.
6784
6785         * parameter.cs (GetSignatureForError): Implemented.
6786
6787         * report.cs (WarningData): New struct for Warning message information.
6788         (LocationOfPreviousError): New method.
6789         (Warning): New method. Reports warning based on the warning table.
6790         (Error_T): New method. Reports error based on the error table.
6791
6792         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6793         verifications are done here.
6794
6795         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6796
6797         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6798         CLSCompliantAttribute.
6799         (all_imported_types): New member holds all imported types from other
6800         assemblies.
6801         (LoadAllImportedTypes): New method fills static table with exported types
6802         from all referenced assemblies.
6803         (Modules): New property returns all assembly modules.
6804
6805 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6806
6807         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6808         throwing a parser error.
6809
6810         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6811         which removes the hardcoded get_/set_ prefixes for properties, as
6812         IL allows for the properties to be named something else.  
6813
6814         Bug #56013
6815
6816         * expression.cs: Do not override operand before we know if it is
6817         non-null.  Fix 56207
6818
6819 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6820
6821         * typemanager.cs: support for pinned variables.
6822
6823 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6824
6825         * decl.cs, typemanager.cs: Avoid using an arraylist
6826         as a buffer if there is only one result set.
6827
6828 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6829
6830         * expression.cs: Make sure you cant call a static method
6831         with an instance expression, bug #56174.
6832
6833 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6834
6835         * class.cs (IsDuplicateImplementation): Improve error reporting to
6836         flag 663 (method only differs in parameter modifier).
6837
6838         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
6839         in preprocessor directives.
6840
6841         * location.cs (LookupFile): Allow for the empty path.
6842
6843         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
6844         better approach for some of that patch, but its failing with the
6845         CharSet enumeration.  For now try/catch will do.
6846
6847         * typemanager.cs: Do not crash if a struct does not have fields.
6848         Fixes 56150.
6849
6850 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6851
6852         * expression.cs: cs0213, cant fix a fixed expression.
6853         fixes 50231.
6854
6855 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6856
6857         * cs-parser.jay: detect invalid embeded statements gracefully.
6858         bug #51113.
6859
6860 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6861
6862         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
6863         As a regex:
6864         s/
6865         the invocation type may not be a subclass of the tye of the item/
6866         The type of the item must be a subclass of the invocation item.
6867         /g
6868
6869         Fixes bug #50820.
6870
6871 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6872
6873         * attribute.cs: Added methods to get a string and a bool from an
6874         attribute. Required to information from AssemblyKeyFileAttribute,
6875         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
6876         * codegen.cs: Modified AssemblyName creation to include support for
6877         strongnames. Catch additional exceptions to report them as CS1548.
6878         * compiler.csproj: Updated include CryptoConvert.cs.
6879         * compiler.csproj.user: Removed file - user specific configuration.
6880         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
6881         Mono.Security assembly. The original class is maintained and tested in
6882         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
6883         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
6884         like CSC 8.0 (C# v2) supports.
6885         * Makefile: Added CryptoConvert.cs to mcs sources.
6886         * rootcontext.cs: Added new options for strongnames.
6887
6888 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
6889
6890         * driver.cs: For --expect-error, report error code `2'
6891         if the program compiled with no errors, error code `1' if
6892         it compiled with an error other than the one expected.
6893
6894 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
6895
6896         * compiler.csproj: Updated for Visual Studio .NET 2003.
6897         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
6898         * compiler.sln: Updated for Visual Studio .NET 2003.
6899
6900 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
6901
6902         * expression.cs: Fix bug #47234. We basically need to apply the
6903         rule that we prefer the conversion of null to a reference type
6904         when faced with a conversion to 'object' (csc behaviour).
6905
6906 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6907
6908         * statement.cs: Shorter form for foreach, eliminates
6909         a local variable. r=Martin.
6910
6911 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6912
6913         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
6914         checks if we can use brtrue/brfalse to test for 0.
6915         * expression.cs: use the above in the test for using brtrue/brfalse.
6916         cleanup code a bit.
6917
6918 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6919
6920         * expression.cs: Rewrite string concat stuff. Benefits:
6921
6922         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
6923         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
6924         rather than a concat chain.
6925
6926         * typemanager.cs: Add lookups for more concat overloads.
6927
6928 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6929
6930         * expression.cs: Emit shorter il code for array init.
6931
6932         newarr
6933         dup
6934         // set 1
6935
6936         // set 2
6937
6938         newarr
6939         stloc.x
6940
6941         ldloc.x
6942         // set 1
6943
6944         ldloc.x
6945         // set 2
6946
6947 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
6948
6949         * statement.cs: Before, two switch blocks would be merged if the
6950         total size of the blocks (end_item - begin_item + 1) was less than
6951         two times the combined sizes of the blocks.
6952
6953         Now, it will only merge if after the merge at least half of the
6954         slots are filled.
6955
6956         fixes 55885.
6957
6958 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
6959
6960         * class.cs : csc build fix for GetMethods(). See bug #52503.
6961
6962 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
6963
6964         * expression.cs: Make sure fp comparisons work with NaN.
6965         This fixes bug #54303. Mig approved this patch a long
6966         time ago, but we were not able to test b/c the runtime
6967         had a related bug.
6968
6969 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
6970
6971         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
6972
6973 2004-03-19  Martin Baulig  <martin@ximian.com>
6974
6975         * class.cs (MemberCore.IsDuplicateImplementation): Report the
6976         error here and not in our caller.
6977
6978 2004-03-19  Martin Baulig  <martin@ximian.com>
6979
6980         * interface.cs: Completely killed this file.
6981         (Interface): We're now a TypeContainer and live in class.cs.
6982
6983         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
6984         argument; we're now also called for interfaces.
6985         (TypeContainer.DefineMembers): Allow this method being called
6986         multiple times.
6987         (TypeContainer.GetMethods): New public method; formerly known as
6988         Interface.GetMethod().  This is used by PendingImplementation.
6989         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
6990         it's now private and non-static.
6991         (Interface): Moved this here; it's now implemented similar to
6992         Class and Struct.
6993         (Method, Property, Event, Indexer): Added `bool is_interface'
6994         argument to their .ctor's.
6995         (MemberBase.IsInterface): New public field.
6996
6997         * cs-parser.jay: Create normal Method, Property, Event, Indexer
6998         instances instead of InterfaceMethod, InterfaceProperty, etc.
6999         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7000         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7001
7002 2004-03-19  Martin Baulig  <martin@ximian.com>
7003
7004         * class.cs (MethodCore.IsDuplicateImplementation): New private
7005         method which does the CS0111 checking.
7006         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7007         Use IsDuplicateImplementation().
7008
7009 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7010
7011         * decl.cs (FindMemberToOverride): New method to find the correct
7012         method or property to override in the base class.
7013         * class.cs
7014             - Make Method/Property use the above method to find the
7015               version in the base class.
7016             - Remove the InheritableMemberSignatureCompare as it is now
7017               dead code.
7018
7019         This patch makes large code bases much faster to compile, as it is
7020         O(n) rather than O(n^2) to do this validation.
7021
7022         Also, it fixes bug 52458 which is that nested classes are not
7023         taken into account when finding the base class member.
7024
7025         Reviewed/Approved by Martin.
7026
7027 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7028
7029         * interface.cs: In all interface classes removed redundant
7030         member initialization.
7031
7032 2004-03-16  Martin Baulig  <martin@ximian.com>
7033
7034         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7035
7036 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7037
7038         * decl.cs (DefineTypeAndParents): New helper method to define a
7039         type's containers before the type itself is defined;  This is a
7040         bug exposed by the recent changes to Windows.Forms when an
7041         implemented interface was defined inside a class that had not been
7042         built yet.   
7043
7044         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7045
7046         (Check): Loop correctly to report errors modifiers
7047         (UNSAFE was not in the loop, since it was the same as TOP).
7048
7049         * interface.cs: Every interface member now takes a ModFlags,
7050         instead of a "is_new" bool, which we set on the base MemberCore. 
7051
7052         Every place where we called "UnsafeOk" in the interface, now we
7053         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7054         the unsafe settings from the member declaration instead of the
7055         container interface. 
7056
7057         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7058
7059         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7060         `set_indexer_name' to the pending bits (one per type).
7061
7062         We fixed a bug today that was picking the wrong method to
7063         override, since for properties the existing InterfaceMethod code
7064         basically ignored the method name.  Now we make sure that the
7065         method name is one of the valid indexer names.
7066
7067 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7068  
7069         * support.cs (SeekableStreamReader): Keep track of stream byte
7070         positions and don't mix them with character offsets to the buffer.
7071
7072         Patch from Gustavo Giráldez
7073
7074 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7075
7076         * interface.cs (InterfaceSetGetBase): Removed double member
7077         initialization, base class does it as well.
7078
7079 2004-03-13  Martin Baulig  <martin@ximian.com>
7080
7081         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7082         when compiling corlib.
7083
7084 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7085
7086         * convert.cs (ExplicitConversion): We were reporting an error on
7087         certain conversions (object_type source to a value type, when the
7088         expression was `null') before we had a chance to pass it through
7089         the user defined conversions.
7090
7091         * driver.cs: Replace / and \ in resource specifications to dots.
7092         Fixes 50752
7093
7094         * class.cs: Add check for duplicate operators.  Fixes 52477
7095
7096 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7097
7098         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7099         that are in the middle of the statements, not only at the end.
7100         Fixes #54987
7101
7102         * class.cs (TypeContainer.AddField): No longer set the
7103         `HaveStaticConstructor' flag, now we call it
7104         `UserDefineStaticConstructor' to diferentiate the slightly
7105         semantic difference.
7106
7107         The situation is that we were not adding BeforeFieldInit (from
7108         Modifiers.TypeAttr) to classes that could have it.
7109         BeforeFieldInit should be set to classes that have no static
7110         constructor. 
7111
7112         See:
7113
7114         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7115
7116         And most importantly Zoltan's comment:
7117
7118         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7119
7120         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7121          before its static fields are used', i.e. initialization does not need
7122          to be triggered by the first access to the type. Setting this flag
7123          helps the JIT to compile better code, since it can run the static
7124          constructor at JIT time, and does not need to generate code to call it
7125          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7126          this flag for lots of classes like String. 
7127          
7128          csc sets this flag if the type does not have an explicit static 
7129          constructor. The reasoning seems to be that if there are only static
7130          initalizers for a type, and no static constructor, then the programmer
7131          does not care when this initialization happens, so beforefieldinit
7132          can be used.
7133          
7134          This bug prevents the AOT compiler from being usable, since it 
7135          generates so many calls to mono_runtime_class_init that the AOT code
7136          is much slower than the JITted code. The JITted code is faster, 
7137          because it does not generate these calls if the vtable is type is
7138          already initialized, which is true in the majority of cases. But the
7139          AOT compiler can't do this."
7140
7141 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7142
7143         * class.cs (MethodData.Emit): Refactor the code so symbolic
7144         information is generated for destructors;  For some reasons we
7145         were taking a code path that did not generate symbolic information
7146         before. 
7147
7148 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7149
7150         * class.cs: Create a Constructor.CheckBase method that
7151         takes care of all validation type code. The method
7152         contains some code that was moved from Define.
7153
7154         It also includes new code that checks for duplicate ctors.
7155         This fixes bug #55148.
7156
7157 2004-03-09  Joshua Tauberer <tauberer@for.net>
7158
7159         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7160         a { ... }-style array creation invokes EmitStaticInitializers
7161         which is not good for reference-type arrays.  String, decimal
7162         and now null constants (NullCast) are not counted toward
7163         static initializers.
7164
7165 2004-03-05  Martin Baulig  <martin@ximian.com>
7166
7167         * location.cs (SourceFile.HasLineDirective): New public field;
7168         specifies whether the file contains or is referenced by a "#line"
7169         directive.
7170         (Location.DefineSymbolDocuments): Ignore source files which
7171         either contain or are referenced by a "#line" directive.        
7172
7173 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7174
7175         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7176         direct access to our parent, so check the method inline there.
7177
7178 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7179
7180         * expression.cs (Invocation.EmitCall): Miguel's last commit
7181         caused a regression. If you had:
7182
7183             T t = null;
7184             t.Foo ();
7185
7186         In Foo the implict this would be null.
7187
7188 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7189
7190         * expression.cs (Invocation.EmitCall): If the method is not
7191         virtual, do not emit a CallVirt to it, use Call.
7192
7193         * typemanager.cs (GetFullNameSignature): Improve the method to
7194         cope with ".ctor" and replace it with the type name.
7195
7196         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7197         as an argument the ConstructorBuilder where it is being defined,
7198         to catch the recursive constructor invocations.
7199
7200 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7201
7202         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7203         routines to check if a type is an enumerable/enumerator allow
7204         classes that implement the IEnumerable or IEnumerator interfaces.
7205
7206         * class.cs (Property, Operator): Implement IIteratorContainer, and
7207         implement SetYields.
7208
7209         (Property.Define): Do the block swapping for get_methods in the
7210         context of iterators.   We need to check if Properties also
7211         include indexers or not.
7212
7213         (Operator): Assign the Block before invoking the
7214         OperatorMethod.Define, so we can trigger the Iterator code
7215         replacement. 
7216
7217         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7218         Property and Operator classes are not created when we parse the
7219         declarator but until we have the block completed, so we use a
7220         singleton SimpleIteratorContainer.Simple to flag whether the
7221         SetYields has been invoked.
7222
7223         We propagate this setting then to the Property or the Operator to
7224         allow the `yield' to function.
7225
7226 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7227
7228         * codegen.cs: Implemented attribute support for modules.
7229         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7230         Assembly/Module functionality.
7231
7232         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7233         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7234         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7235
7236 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7237
7238         * interface.cs (FindMembers): The operation is performed on all base
7239         interfaces and not only on the first. It is required for future CLS Compliance patch.
7240
7241 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7242
7243         * statement.cs, codegen.cs:
7244         This patch deals with patterns such as:
7245
7246         public class List : IEnumerable {
7247
7248                 public MyEnumerator GetEnumerator () {
7249                         return new MyEnumerator(this);
7250                 }
7251
7252                 IEnumerator IEnumerable.GetEnumerator () {
7253                         ...
7254                 }
7255                 
7256                 public struct MyEnumerator : IEnumerator {
7257                         ...
7258                 }
7259         }
7260
7261         Before, there were a few things we did wrong:
7262         1) we would emit callvirt on a struct, which is illegal
7263         2) we emited ldarg when we needed to emit ldarga
7264         3) we would mistakenly call the interface methods on an enumerator
7265         type that derived from IEnumerator and was in another assembly. For example:
7266
7267         public class MyEnumerator : IEnumerator
7268
7269         Would have the interface methods called, even if there were public impls of the
7270         method. In a struct, this lead to invalid IL code.
7271
7272 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7273
7274         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7275           renamed to Emit.
7276
7277         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7278
7279 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7280
7281         * cs-parser.jay: Fix small regression: we were not testing V2
7282         compiler features correctly.
7283
7284         * interface.cs: If the emit context is null, then create one
7285
7286 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7287
7288         * decl.cs (GetSignatureForError): New virtual method to get full name
7289           for error messages.
7290
7291         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7292           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7293
7294         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7295           Duplicated members and code in these classes has been removed.
7296           Better encapsulation in these classes.
7297
7298 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7299
7300         * assign.cs (Assign.DoResolve): When dealing with compound
7301         assignments, there is a new rule in ECMA C# 2.4 (might have been
7302         there before, but it is documented here) that states that in:
7303
7304         a op= b;
7305
7306         If b is of type int, and the `op' is a shift-operator, then the
7307         above is evaluated as:
7308
7309         a = (int) a op b 
7310
7311         * expression.cs (Binary.ResolveOperator): Instead of testing for
7312         int/uint/long/ulong, try to implicitly convert to any of those
7313         types and use that in pointer arithmetic.
7314
7315         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7316         method to print information for from the type, not from the
7317         null-method we were given.
7318
7319 2004-02-01  Duncan Mak  <duncan@ximian.com>
7320
7321         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7322         parsing for cmd, fixes bug #53694.
7323
7324 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7325
7326         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7327         in the member name duplication tests. Property and operator name duplication
7328         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7329
7330 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7331
7332         * interface.cs (PopulateMethod): Fixed crash when interface method
7333         returns not existing type (error test cs0246-3.cs).
7334
7335 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7336
7337         * cs-parser.jay (interface_accessors): Re-write actions to also
7338         store attributes attached to get and set methods. Fix spelling
7339         while at it.
7340
7341         (inteface_property_declaration): Modify accordingly.
7342
7343         (InterfaceAccessorInfo): New helper class to store information to pass
7344         around between rules that use interface_accessors.
7345
7346         * interface.cs (Emit): Apply attributes on the get and set
7347         accessors of properties and indexers too.
7348
7349         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7350         right MethodBuilder when applying attributes to the get and set accessors.
7351
7352 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7353
7354         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7355
7356 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7357
7358         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7359
7360 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7361
7362         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7363         changes that treat `yield' specially when present before `break'
7364         or `return' tokens.
7365
7366         * cs-tokenizer.cs: yield is no longer a keyword.
7367
7368 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7369
7370         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7371         setting for default constructors.
7372         For default constructors are almost every time set wrong Modifier. The
7373         generated IL code has been alright. But inside mcs this values was
7374         wrong and this was reason why several of my CLS Compliance tests
7375         failed.
7376
7377 2004-01-22  Martin Baulig  <martin@ximian.com>
7378
7379         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7380         not a QualifiedIdentifier.  This is what `type_name_expression'
7381         was previously doing.
7382         (type_name_expression): Removed; the code is now in
7383         `namespace_or_type_name'.
7384         (qualified_identifier): Removed, use `namespace_or_type_name'
7385         instead.
7386         (QualifiedIdentifier): Removed this class.      
7387
7388 2004-01-22  Martin Baulig  <martin@ximian.com>
7389
7390         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7391         not a string as alias name.
7392
7393 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7394
7395         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7396         #52730 bug, and instead compute correctly the need to use a
7397         temporary variable when requesting an address based on the
7398         static/instace modified of the field and the constructor.
7399  
7400 2004-01-21  Martin Baulig  <martin@ximian.com>
7401
7402         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7403         class and namespace before looking up aliases.  Fixes #52517.
7404
7405 2004-01-21  Martin Baulig  <martin@ximian.com>
7406
7407         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7408         assinged in a 'try'; fixes exception4.cs.
7409
7410 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7411         * class.cs : Implemented parameter-less constructor for TypeContainer
7412
7413         * decl.cs: Attributes are now stored here. New property OptAttributes
7414
7415         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7416
7417         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7418
7419 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7420
7421         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7422           (CSharpSignature): New method for indexer and property signature.
7423
7424 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7425
7426         * pending.cs (IsVirtualFilter): Faster implementation.
7427
7428 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7429
7430         * typemanager.cs: Avoid inclusion of same assembly more than once.
7431
7432 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7433
7434         * cs-parser.jay: Fixed problem where the last assembly attribute
7435           has been applied also to following declaration (class, struct, etc.)
7436           
7437 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7438
7439         * class.cs: Added error CS0538, CS0539 reporting.
7440         Fixed crash on Microsoft runtime when field type is void.
7441
7442         * cs-parser.jay: Added error CS0537 reporting.
7443
7444         * pending.cs: Added error CS0535 reporting.
7445         Improved error report for errors CS0536, CS0534.
7446
7447 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7448
7449         Merge a few bits from the Anonymous Method MCS tree.
7450
7451         * statement.cs (ToplevelBlock): New class for toplevel methods,
7452         will hold anonymous methods, lifted variables.
7453
7454         * cs-parser.jay: Create toplevel blocks for delegates and for
7455         regular blocks of code. 
7456
7457 2004-01-20  Martin Baulig  <martin@ximian.com>
7458
7459         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7460         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7461         and `NeedExplicitReturn'; added `IsLastStatement'.
7462         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7463         have a `ReturnLabel' or we're not unreachable.
7464
7465         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7466         child's reachability; don't just override ours with it.  Fixes
7467         #58058 (lluis's example).
7468         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7469         InFinally(), InLoop(), InSwitch() and
7470         BreakCrossesTryCatchBoundary() methods.
7471
7472         * statement.cs (Return): Do all error checking in Resolve().
7473         Unless we are the last statement in a top-level block, always
7474         create a return label and jump to it.
7475         (Break, Continue): Do all error checking in Resolve(); also make
7476         sure we aren't leaving a `finally'.
7477         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7478         statement in a top-level block.
7479         (Block.Flags): Added `IsDestructor'.
7480         (Block.IsDestructor): New public property.
7481
7482 2004-01-20  Martin Baulig  <martin@ximian.com>
7483
7484         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7485
7486 2004-01-20  Martin Baulig  <martin@ximian.com>
7487
7488         * statement.cs (Statement.ResolveUnreachable): New public method.
7489         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7490         (Block.Resolve): Resolve unreachable statements.
7491
7492 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7493
7494         * expression.cs: We need to fix the case where we do
7495         not have a temp variable here.
7496
7497         * assign.cs: Only expression compound assignments need
7498         temporary variables.
7499
7500 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7501
7502         * flowanalysis.cs: Reduce memory allocation in a few ways:
7503           - A block with no variables should not allocate a bit
7504             vector for itself.
7505           - A method with no out parameters does not need any tracking
7506             for assignment of the parameters, so we need not allocate
7507             any data for it.
7508           - The arrays:
7509                 public readonly Type[] VariableTypes;
7510                 public readonly string[] VariableNames;
7511             Are redundant. The data is already stored in the variable
7512             map, so we need not allocate another array for it.
7513           - We need to add alot of checks for if (params | locals) == null
7514             due to the first two changes.
7515
7516 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7517
7518         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7519         implement IMemoryLocation, we store a copy on a local variable and
7520         take the address of it.  Patch from Benjamin Jemlich
7521
7522         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7523         to use a special "type_name_expression" rule which reduces the
7524         number of "QualifiedIdentifier" classes created, and instead
7525         directly creates MemberAccess expressions.
7526
7527 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7528
7529         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7530         that fixes #52853.  Null literal assignment to ValueType
7531
7532         * class.cs (MethodData.Emit): Instead of checking the name of the
7533         method to determine if its a destructor, create a new derived
7534         class from Method called Destructor, and test for that.  
7535
7536         * cs-parser.jay: Create a Destructor object instead of a Method.  
7537
7538         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7539
7540         Fixes: 52933
7541
7542 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7543
7544         * expression.cs (Binary.ResolveOperator): Perform an implicit
7545         conversion from MethodGroups to their delegate types on the
7546         Addition operation.
7547
7548         * delegate.cs: Introduce a new class DelegateCreation that is the
7549         base class for `NewDelegate' and `ImplicitDelegateCreation',
7550         factor some code in here.
7551
7552         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7553         conversion from MethodGroups to compatible delegate types. 
7554
7555         * ecore.cs (Expression.Resolve): Do not flag error 654
7556         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7557         we allow conversions from MethodGroups to delegate types now.
7558
7559         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7560         assignments in v2 either.
7561
7562 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7563
7564         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7565         static read-only fields in ctors.
7566
7567         Applied patch from Benjamin Jemlich 
7568
7569         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7570
7571 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7572
7573         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7574         here to return true, as they can be used like this:
7575
7576                 (XXX) int.MEMBER ()
7577
7578         Fixed 49836 and all the other dups
7579
7580 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7581
7582         * driver.cs: Implement /win32res and /win32icon.
7583
7584 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7585
7586         * cs-parser.jay: Add a rule to improve error handling for the
7587         common mistake of placing modifiers after the type.
7588
7589 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7590
7591         * cs-parser.jay (interface_event_declaration): Catch
7592         initialization of events on interfaces, and report cs0068
7593
7594         * cs-parser.jay (interface_event_declaration): Catch
7595         initialization of events. 
7596
7597         * ecore.cs: Better report missing constructors.
7598
7599         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7600         the error reporting done in the wrong place.  Fix.
7601
7602         * expression.cs (Binary.ResolveOperator): Catch the 
7603         operator + (E x, E y) error earlier, and later allow for implicit
7604         conversions in operator +/- (E e, U x) from U to the underlying
7605         type of E.
7606
7607         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7608         52596, if the container class is abstract, the default constructor
7609         is protected otherwise its public (before, we were always public).
7610
7611         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7612         fixed statement.
7613
7614         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7615         Jemlich that fixes bug #52597, MCS was generating invalid code for
7616         idisposable structs.   Thanks to Ben for following up with this
7617         bug as well.
7618
7619 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7620
7621         * driver.cs: Allow assemblies without code to be generated, fixes
7622         52230.
7623
7624 2004-01-07  Nick Drochak <ndrochak@gol.com>
7625
7626         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7627
7628 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7629
7630         * cs-parser.jay: Add rules to improve error reporting if fields or
7631         methods are declared at the namespace level (error 116)
7632
7633         * Add rules to catch event add/remove
7634
7635 2004-01-04  David Sheldon <dave-mono@earth.li>
7636
7637   * expression.cs: Added matching ")" to error message for 
7638   CS0077
7639
7640 2004-01-03 Todd Berman <tberman@gentoo.org>
7641
7642         * ecore.cs, attribute.cs:
7643         Applying fix from #52429.
7644
7645 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7646
7647         * ecore.cs, expression.cs, statement.cs:
7648         Total rewrite of how we handle branching. We
7649         now handle complex boolean expressions with fewer
7650         jumps. As well if (x == 0) no longer emits a ceq.
7651
7652         if (x is Foo) is much faster now, because we generate
7653         better code.
7654
7655         Overall, we get a pretty big improvement on our benchmark
7656         tests. The code we generate is smaller and more readable.
7657
7658         I did a full two-stage bootstrap. The patch was reviewed
7659         by Martin and Miguel.
7660
7661 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7662
7663         * cs-parser.jay: Make primary_expression not take a QI.
7664         we dont need this because the member_access rule covers
7665         us here. So we replace the rule with just IDENTIFIER.
7666
7667         This has two good effects. First, we remove a s/r conflict.
7668         Second, we allocate many fewer QualifiedIdentifier objects.
7669
7670 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7671
7672         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7673         set the correct information via SRE. This prevents
7674         hanging on the MS runtime. Fixes #29374.
7675
7676 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7677
7678         * convert.cs: correctly handle conversions to value types
7679         from Enum and ValueType as unboxing conversions.
7680
7681         Fixes bug #52569. Patch by Benjamin Jemlich.
7682
7683 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7684
7685         * expression.cs (BetterConversion): Prefer int -> uint
7686         over int -> ulong (csc's behaviour). This fixed bug #52046.
7687
7688 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7689
7690         * decl.cs (MemberCache.FindMembers): now returns a
7691         MemberInfo [].
7692
7693         * typemanager.cs: In general, go with with ^^.
7694         (CopyNewMethods): take an IList.
7695         (RealMemberLookup): Only allocate an arraylist
7696         if we copy from two sets of methods.
7697
7698         This change basically does two things:
7699         1) Fewer array lists allocated due to CopyNewMethods.
7700         2) the explicit cast in MemberList costed ALOT.
7701
7702 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7703
7704         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7705         a hashtable to avoid needless string allocations when an identifier is
7706         used more than once (the common case).
7707
7708 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7709
7710         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7711         is broken, it will not return anything. So, we
7712         have to use the information we have in mcs to
7713         do the task.
7714
7715         * typemanager.cs: Add a cache for GetInterfaces,
7716         since this will now be used more often (due to ^^)
7717
7718         (GetExplicitInterfaces) New method that gets the
7719         declared, not effective, interfaces on a type
7720         builder (eg, if you have interface IFoo, interface
7721         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7722         { IBar }.
7723
7724         This patch makes MCS able to bootstrap itself on
7725         Windows again.
7726
7727 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7728
7729         * expression.cs: Remove the Nop's that Miguel put
7730         in by mistake.
7731
7732 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7733
7734         * report.cs, codegen.cs: Give the real stack trace to
7735         the error when an exception is thrown.
7736
7737 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7738
7739         * decl.cs: only allocate hashtables for ifaces if 
7740         it is an iface!
7741
7742 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7743
7744         * expression.cs: fix the error from cs0121-2.cs
7745         (a parent interface has two child interfaces that
7746         have a function with the same name and 0 params
7747         and the function is called through the parent).
7748
7749 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7750
7751         * class.cs, rootcontext.cs, typmanager.cs: do not
7752         leak pointers.
7753
7754 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7755
7756         * codegen.cs: remove stack for the ec flow branching.
7757         It is already a linked list, so no need.
7758
7759 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7760
7761         * Makefile: Allow custom profiler here.
7762
7763 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7764
7765         * typemanager.cs (LookupType):
7766           - Use a static char [], because split takes
7767             a param array for args, so it was allocating
7768             every time.
7769           - Do not store true in a hashtable, it boxes.
7770
7771 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7772
7773         * flowanalysis.cs: bytify common enums.
7774
7775 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7776
7777         * modifiers.cs: Add a new set of flags for the
7778         flags allowed on explicit interface impls.
7779         * cs-parser.jay: catch the use of modifiers in
7780         interfaces correctly.
7781         * class.cs: catch private void IFoo.Blah ().
7782
7783         All related to bug #50572.
7784
7785 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7786
7787         * decl.cs: Rewrite the consistant accessability checking.
7788         Accessability is not linear, it must be implemented in
7789         a tableish way. Fixes #49704.
7790
7791 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7792
7793         * expression.cs: Handle negation in a checked context.
7794         We must use subtraction from zero. Fixes #38674.
7795
7796 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7797
7798         * class.cs: Ignore static void main in DLLs.
7799         * rootcontext.cs: Handle the target type here,
7800         since we are have to access it from class.cs
7801         * driver.cs: account for the above.
7802
7803 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7804
7805         * report.cs: Give line numbers and files if available.
7806
7807 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7808
7809         * driver.cs: Implement /addmodule.
7810
7811         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7812         ModuleBuilders.
7813
7814 2003-12-20  Martin Baulig  <martin@ximian.com>
7815
7816         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7817         (FieldBase.IsAssigned): Removed this field.
7818         (FieldBase.SetAssigned): New public method.
7819         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7820
7821 2003-12-20  Martin Baulig  <martin@ximian.com>
7822
7823         * expression.cs (LocalVariableReference.DoResolve): Don't set
7824         `vi.Used' if we're called from DoResolveLValue().
7825
7826         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7827         returns the usage vector it just merged into the current one -
7828         pass this one to UsageWarning().
7829         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7830         of the `EmitContext', don't call this recursively on our children.
7831
7832 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7833
7834         * driver.cs: Implement /target:module.
7835
7836 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
7837
7838         * support.cs (CharArrayHashtable): New helper class.
7839
7840         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
7841         char arrays, not strings, so we can avoid creating a string in
7842         consume_identifier if the identifier is a keyword.
7843
7844 2003-12-16  Martin Baulig  <martin@ximian.com>
7845
7846         * statement.cs (LocalInfo.Assigned): Removed this property.
7847         (LocalInfo.Flags): Removed `Assigned'.
7848         (LocalInfo.IsAssigned): New public method; takes the EmitContext
7849         and uses flow analysis.
7850         (Block.UsageWarning): Made this method private.
7851         (Block.Resolve): Call UsageWarning() if appropriate.
7852
7853         * expression.cs (LocalVariableReference.DoResolve): Always set
7854         LocalInfo.Used here.
7855
7856 2003-12-13  Martin Baulig  <martin@ximian.com>
7857
7858         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
7859         any value here; we're now using flow analysis to figure out
7860         whether a statement/block returns a value.
7861
7862 2003-12-13  Martin Baulig  <martin@ximian.com>
7863
7864         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
7865         working again.
7866         (FlowBranching.MergeFinally): Don't call
7867         `branching.CheckOutParameters()' here, this is called in
7868         MergeTopBlock().
7869         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
7870         when adding the `finally' vector.       
7871
7872 2003-12-13  Martin Baulig  <martin@ximian.com>
7873
7874         * flowanalysis.cs
7875         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
7876         actually work and also fix #48962.
7877
7878 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7879
7880         * decl.cs: Do not check System.Object for nested types,
7881         since we know it does not have any. Big bang for buck:
7882
7883         BEFORE:
7884            Run 1:   8.35 seconds
7885            Run 2:   8.32 seconds
7886            corlib:  17.99 seconds
7887         AFTER:
7888            Run 1:   8.17 seconds
7889            Run 2:   8.17 seconds
7890            corlib:  17.39 seconds
7891
7892 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7893
7894         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
7895         time we are returning 0 members, so we save alot here.
7896
7897 2003-12-11  Martin Baulig  <martin@ximian.com>
7898
7899         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
7900         `MergeChild()', also just take the `FlowBranching' as argument;
7901         call Merge() on it and return the result.
7902         (FlowBranching.Merge): We don't need to do anything if we just
7903         have one sibling.
7904
7905 2003-12-11  Martin Baulig  <martin@ximian.com>
7906
7907         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
7908         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
7909         Maurer for this idea.
7910
7911 2003-12-11  Martin Baulig  <martin@ximian.com>
7912
7913         * flowanalysis.cs (MergeResult): This class is now gone; we now
7914         use the `UsageVector' for this.  The reason for this is that if a
7915         branching just has one sibling, we don't need to "merge" them at
7916         all - that's the next step to do.
7917         (FlowBranching.Merge): We now return a `UsageVector' instead of a
7918         `MergeResult'.
7919
7920 2003-12-11  Martin Baulig  <martin@ximian.com>
7921
7922         Reworked flow analyis and made it more precise and bug-free.  The
7923         most important change is that we're now using a special `Reachability'
7924         class instead of having "magic" meanings of `FlowReturns'.  I'll
7925         do some more cleanups and optimizations and also add some more
7926         documentation this week.
7927
7928         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
7929         largely reworked this class.
7930         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
7931         the new `Reachability' class instead of having "magic" values here.
7932         (FlowBranching): We're now using an instance of `Reachability'
7933         instead of having separate `Returns', `Breaks' etc. fields.
7934
7935         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
7936         based on flow analysis; ignore the return value of block.Emit ().
7937
7938 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
7939
7940         * driver.cs typemanager.cs: Find the mono extensions to corlib even
7941         if they are private.
7942
7943 2003-12-09  Martin Baulig  <martin@ximian.com>
7944
7945         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
7946         call them directly on the UsageVector.
7947
7948 2003-12-09  Martin Baulig  <martin@ximian.com>
7949
7950         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
7951         Changed return type from `FlowReturns' to `Reachability'.
7952
7953 2003-12-09  Martin Baulig  <martin@ximian.com>
7954
7955         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
7956         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
7957         `Reachable' fields with a single `Reachability' one.
7958
7959 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7960
7961         * class.cs (FindMembers): Remove foreach's.
7962
7963         Bootstrap times:
7964
7965         BEFORE
7966                 Run 1:   8.74 seconds
7967                 Run 2:   8.71 seconds
7968
7969         AFTER
7970                 Run 1:   8.64 seconds
7971                 Run 2:   8.58 seconds
7972
7973
7974 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7975
7976         * cs-parser.jay:
7977         * gen-treedump.cs:
7978         * statement.cs:
7979         This patch does a few things:
7980                 1. EmptyStatement is now a singleton, so it is never reallocated.
7981                 2. All blah is EmptyStatement constructs have been changed to
7982                    blah == EmptyStatement.Value, which is much faster and valid
7983                    now that EmptyStatement is a singleton.
7984                 3. When resolving a block, rather than allocating a new array for
7985                    the non-empty statements, empty statements are replaced with
7986                    EmptyStatement.Value
7987                 4. Some recursive functions have been made non-recursive.
7988         Mainly the performance impact is from (3), however (1) and (2) are needed for
7989         this to work. (4) does not make a big difference in normal situations, however
7990         it makes the profile look saner.
7991
7992         Bootstrap times:
7993
7994         BEFORE
7995         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7996         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7997         Total memory allocated: 56397 KB
7998
7999         AFTER
8000         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8001         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8002         Total memory allocated: 55666 KB
8003
8004 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8005
8006         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8007         than the hashtable in a hashtable version
8008
8009         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8010         we always end up concating a string. This results in a huge perf
8011         loss, because many strings have to be tracked by the GC. In this
8012         patch, we first use a hashtable that works with two keys, so that
8013         the strings do not need to be concat'ed.
8014
8015         Bootstrap times:
8016         BEFORE
8017                 Run 1:   8.74 seconds
8018                 Run 2:   8.71 seconds
8019
8020         AFTER
8021                 Run 1:   8.65 seconds
8022                 Run 2:   8.56 seconds
8023
8024 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8025
8026         * Makefile: Add a new target `do-time' that does a quick and simple
8027         profile, leaving easy to parse output.
8028
8029 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8030
8031         * codegen.cs (Init): Create the dynamic assembly with 
8032         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8033
8034 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8035
8036         * support.cs: Make the PtrHashtable use only one
8037         instance of its comparer.
8038
8039 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8040
8041         * typemanager.cs: Fix lookup of GetNamespaces.
8042
8043 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8044
8045         * expression.cs: Removed redundant line.
8046
8047         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8048         ArrayLists, use for loops with bounds.  
8049
8050         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8051         arraylist.
8052
8053         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8054         arraylists, use for loop with bounds.
8055
8056         The above three changes give us a 0.071 second performance
8057         improvement out of 3.294 seconds down to 3.223.  On my machine
8058         the above changes reduced the memory usage by 1,387 KB during
8059         compiler bootstrap.
8060
8061         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8062         QualifiedIdentifiers.  Before we created a new string through
8063         concatenation, and mostly later on, the result would be
8064         manipulated by DecomposeQI through string manipulation.
8065
8066         This reduced the compiler memory usage for bootstrapping from
8067         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8068         compile times in 0.05 seconds.
8069
8070 2003-11-28  Dick Porter  <dick@ximian.com>
8071
8072         * support.cs: Do string compares with the Invariant culture.
8073
8074         * rootcontext.cs: 
8075         * gen-treedump.cs: 
8076         * expression.cs: 
8077         * driver.cs: 
8078         * decl.cs: 
8079         * codegen.cs: 
8080         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8081         the comparison is done with the Invariant culture.
8082
8083 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8084
8085         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8086         GetEnumerator method.
8087
8088         (ProbeCollectionType): Iterate starting at the most specific type
8089         upwards looking for a GetEnumerator
8090
8091         * expression.cs: Shift count can be up to 31 for int/uint and 63
8092         for long/ulong.
8093
8094 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8095
8096         * statement.cs (Block.LookupLabel): Also look for the label on the
8097         children blocks.  Use a hash table to keep track of visited
8098         nodes. 
8099
8100         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8101         we actually did transform the other operand, otherwise fall back
8102         to the common codepath that casts to long.
8103
8104         * cs-tokenizer.cs: Use the same code pattern as the int case.
8105         Maybe I should do the parsing myself, and avoid depending on the
8106         Parse routines to get this done.
8107
8108 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8109
8110         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8111         which fixes bug 51347.  This time test it.
8112
8113         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8114         attributes for example can not tell the difference between these.
8115         The difference was only a syntax feature of the language. 
8116
8117         * attribute.cs: Apply attributes to delegates.
8118
8119         * delegate.cs: Call the apply attributes method.
8120
8121 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8122
8123         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8124         comparing 0 vs Byte.MinValue, not the value
8125
8126         (ImplicitConversionRequired): When reporting a conversion error,
8127         use error 31 to print out the constant error instead of the
8128         simpler 29.
8129
8130         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8131         which fixes bug 51347.
8132
8133 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8134
8135         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8136         which fixes the -warnaserror command line option.
8137
8138 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8139
8140         * cfold.cs (DoNumericPromotions): During constant folding of
8141         additions on UIntConstant, special case intconstants with
8142         IntConstants like we do on the expression binary operator. 
8143
8144 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8145
8146         * convert.cs (ImplicitReferenceConversion): We were missing a case
8147         (System.Enum are not value types or class types, so we need to
8148         classify them separatedly).
8149
8150         * driver.cs: We do not support error 2007.
8151
8152 2003-11-12 Jackson Harper <jackson@ximian.com>
8153
8154         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8155         system directory. Also use the full file name so users can
8156         libraries names mscorlib-o-tron.dll in a non system dir.
8157
8158 2003-11-10  Martin Baulig  <martin@ximian.com>
8159
8160         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8161         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8162         calling `ResolveType()' on them, directly assign their `Type'.
8163
8164 2003-11-08  Martin Baulig  <martin@ximian.com>
8165
8166         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8167         return value and the `out parent' parameter.
8168         (TypeContainer.DefineType): Moved the CS0644 check into
8169         GetClassBases().  Don't pass the interface types to the
8170         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8171         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8172
8173         * ecore.cs (TypeExpr.IsAttribute): New property.
8174         (TypeExpr.GetInterfaces): New method.
8175
8176         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8177         TypeExpr instead of a Type.
8178         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8179         (Interface.DefineType): Don't pass the interface types to the
8180         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8181         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8182
8183         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8184         instead of a `Type[]'.
8185         (TypeManager.RegisterBuilder): Likewise.
8186         (TypeManager.AddUserInterface): Likewise.
8187         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8188         `Type[]' and also return a `TypeExpr[]'.
8189         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8190
8191 2003-11-08  Martin Baulig  <martin@ximian.com>
8192
8193         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8194         Expression.     
8195
8196 2003-11-08  Martin Baulig  <martin@ximian.com>
8197
8198         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8199         TypeManager.ResolveExpressionTypes().
8200
8201         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8202         instead of an Expression.
8203         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8204         (TypeExpression): New public class; formerly known as `TypeExpr'.
8205
8206         * expression.cs (ComposedCast): Derive from TypeExpr.
8207
8208         * typemanager.cs (TypeManager.system_*_expr): These are now
8209         TypExpr's instead of Expression's.
8210         (TypeManager.ResolveExpressionTypes): New public static function;
8211         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8212         of them.        
8213
8214 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8215
8216         * expression.cs (New.DoResolve): Do not dereference value that
8217         might be a null return.
8218
8219         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8220         sure that the constant value has the right type.  Fixes an
8221         unreported bug, similar to 50425.
8222
8223         * const.cs (Const.LookupConstantValue): Call
8224         ImplicitStandardConversionExists before doing a conversion to
8225         avoid havng the TypeManager.ChangeType do conversions.
8226
8227         Reduced the number of casts used
8228
8229         (Const.ChangeType): New routine to enable reuse of the constant
8230         type changing code from statement.
8231
8232         * typemanager.cs (ChangeType): Move common initialization to
8233         static global variables.
8234
8235         Fixes #50425.
8236
8237         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8238         every value type to go through, even if it was void.  Fix that. 
8239
8240         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8241         character of the define, and the is_identifier_part_character for
8242         the rest of the string.
8243
8244 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8245
8246         * expression.cs (UnaryMutator.EmitCode): When I updated
8247         LocalVariableReference.DoResolve, I overdid it, and dropped an
8248         optimization done on local variable references.
8249
8250 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8251
8252         * ecore.cs: Convert the return from Ldlen into an int.
8253
8254 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8255
8256         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8257         the accessibility, this is a special case for toplevel non-public
8258         classes (internal for instance).
8259
8260 2003-10-20  Nick Drochak <ndrochak@gol.com>
8261
8262         * ecore.cs: Fix typo and build.  Needed another right paren.
8263
8264 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8265
8266         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8267         `internal' case regular and protected, but not allowing protected
8268         to be evaluated later.  Bug 49840
8269
8270 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8271
8272         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8273         to kb.Nlast, and not the kb.nFirst to isolate the switch
8274         statement.
8275
8276         Extract the underlying type, so enumerations of long/ulong are
8277         treated like long/ulong.
8278
8279 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8280
8281         * expression.cs (New): Overload the meaning of RequestedType to
8282         track the possible creation of the NewDelegate type, since
8283         DoResolve is invoked more than once for new constructors on field
8284         initialization.
8285
8286         See bugs: #48800 and #37014
8287
8288         * cs-parser.jay (declare_local_constants): Take an arraylist
8289         instead of a single constant.
8290
8291         (local_constant_declaration): It should take a
8292         constant_declarators, not a constant_declarator.  Fixes 49487
8293
8294         * convert.cs: Fix error report.
8295
8296 2003-10-13 Jackson Harper <jackson@ximian.com>
8297
8298         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8299         bug #49611
8300
8301 2003-10-09  Martin Baulig  <martin@ximian.com>
8302
8303         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8304         to the .ctor.
8305         (MethodCore.DoDefineParameters): Removed the TypeContainer
8306         argument; use the DeclSpace which was passed to the .ctor instead.
8307         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8308         TypeContainer; we only need a DeclSpace here.
8309
8310 2003-10-09  Martin Baulig  <martin@ximian.com>
8311
8312         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8313         to the .ctor.
8314         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8315         EmitContext's .ctor.    
8316
8317 2003-10-09  Martin Baulig  <martin@ximian.com>
8318
8319         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8320         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8321         AsAccessible(), moved them as well.
8322
8323         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8324
8325 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8326
8327         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8328
8329 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8330
8331         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8332         generation for >=, as spotted by Paolo, bug 48679.  
8333         Patch from David Waite.
8334
8335         * cs-tokenizer.cs: Add handling for #pragma.
8336
8337         * cs-parser.jay: Allow for both yield and yield return in the
8338         syntax.  The anti-cobolization of C# fight will go on!
8339
8340         * class.cs (TypeBuilder.DefineType): Catch error condition here
8341         (Parent.DefineType erroring out and returning null).
8342
8343         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8344         coping with enumerations variables, we were mistakenly processing
8345         them as a regular value type instead of built-in types.  Fixes the
8346         bug #48063
8347
8348         * typemanager.cs (IsBuiltinOrEnum): New method.
8349
8350 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * cs-parser.jay: Upgrade: yield now needs the return clause.
8353
8354 2003-09-19  Martin Baulig  <martin@ximian.com>
8355
8356         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8357         `MemberCache parent' argument.  Normally, an interface doesn't
8358         have a parent type except System.Object, but we use this in gmcs
8359         for generic type parameters.
8360
8361 2003-09-18  Martin Baulig  <martin@ximian.com>
8362
8363         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8364         on `type.IsInterface'; don't check whether the type has a parent
8365         to determine whether it's an interface.
8366
8367 2003-09-15  Martin Baulig  <martin@ximian.com>
8368
8369         * class.cs (TypeContainer.DefineType): Added an error flag to
8370         avoid reporting duplicate CS0146's ("class definition is
8371         circular.").
8372
8373         * driver.cs (Driver.MainDriver): Abort if
8374         RootContext.ResolveTree() reported any errors.
8375
8376 2003-09-07  Martin Baulig  <martin@ximian.com>
8377
8378         * report.cs (Error, Warning): Added overloaded versions which take
8379         a `params object[] args' and call String.Format().
8380
8381 2003-09-07  Martin Baulig  <martin@ximian.com>
8382
8383         * decl.cs (DeclSpace..ctor): Don't call
8384         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8385         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8386         (DeclSpace.RecordDecl): New method.
8387
8388         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8389
8390 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8391
8392         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8393         value attributes to be applied to ParameterBuilders.
8394
8395         * class.cs (MethodCore.LabelParameters): Make static and more
8396         generic so that it can be used from other places - like interface
8397         methods, for instance.
8398
8399         * interface.cs (Interface.Emit): Call LabelParameters before
8400         emitting attributes on the InterfaceMethod.
8401
8402 2003-08-26  Martin Baulig  <martin@ximian.com>
8403
8404         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8405         resolving aliases; fixes #47927.
8406
8407 2003-08-26  Martin Baulig  <martin@ximian.com>
8408
8409         * statement.cs (Using.DoResolve): This is internally emitting a
8410         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8411         do not always return.  Fixes #47681.
8412
8413 2003-08-26  Martin Baulig  <martin@ximian.com>
8414
8415         * decl.cs (MemberCore): Moved WarningNotHiding(),
8416         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8417         into MemberBase.
8418         (AdditionResult): Make this nested in DeclSpace.
8419         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8420         argument; call NamespaceEntry.Define() unless we're nested in a
8421         class or struct.
8422
8423         * namespace.cs (Namespace.DefineName): New public function.  This
8424         is called from DeclSpace's .ctor to add 
8425         (Namespace.Lookup): Include DeclSpaces in the lookup.
8426
8427         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8428
8429         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8430
8431 2003-08-25  Martin Baulig  <martin@ximian.com>
8432
8433         * convert.cs (Convert.ExplicitReferenceConversion): When
8434         converting from an interface type to a class, unbox if the target
8435         type is a struct type.  Fixes #47822.
8436
8437 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8438
8439         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8440         #47854.
8441
8442 2003-08-22  Martin Baulig  <martin@ximian.com>
8443
8444         * class.cs (TypeManager.DefineType): When defining a nested type,
8445         call DefineType() on our parent; fixes #47801.
8446
8447 2003-08-22  Martin Baulig  <martin@ximian.com>
8448
8449         * class.cs (MethodData.Define): While checking if a method is an
8450         interface implementation, improve the test a bit more to fix #47654.
8451
8452 2003-08-22  Martin Baulig  <martin@ximian.com>
8453
8454         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8455         correctly; fixes #47722.
8456
8457 2003-08-22  Martin Baulig  <martin@ximian.com>
8458
8459         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8460         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8461
8462         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8463
8464 2003-08-22  Martin Baulig  <martin@ximian.com>
8465
8466         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8467         can only be assigned in static constructors.  Fixes #47161.
8468
8469 2003-08-22  Martin Baulig  <martin@ximian.com>
8470
8471         Rewrote and improved the flow analysis code.
8472
8473         * flowbranching.cs (FlowBranching): Make this class abstract.
8474         (FlowBranching.CreateBranching): New static function to create a
8475         new flow branching.
8476         (FlowBranchingBlock, FlowBranchingException): New classes.
8477         (FlowBranching.UsageVector.Type): New public readonly field.
8478         (FlowBranching.UsageVector.Breaks): Removed the setter.
8479         (FlowBranching.UsageVector.Returns): Removed the setter.
8480         (FlowBranching.UsageVector): Added Break(), Return(),
8481         NeverReachable() and Throw() methods to modify the reachability.
8482         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8483         done by FlowBranching.Merge().
8484         (FlowBranching.UsageVector.MergeChild): New method; merges the
8485         merge result into the current vector.
8486         (FlowBranching.Merge): New abstract method to merge a branching.
8487
8488 2003-08-12  Martin Baulig  <martin@ximian.com>
8489
8490         * expression.cs (Indirection.CacheTemporaries): Create the
8491         LocalTemporary with the pointer type, not its element type.
8492
8493 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8494
8495         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8496         token was a keyword or not.
8497
8498         Add `error' options where an IDENTIFIER was expected;  Provide
8499         CheckToken and CheckIdentifierToken convenience error reporting
8500         functions. 
8501
8502         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8503
8504         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8505         NameSpaceEntry NameSpaceEntry.
8506
8507         (LookupInterfaceOrClass): Avoid creating a full qualified name
8508         from namespace and name: avoid doing lookups when we know the
8509         namespace is non-existant.   Use new Tree.LookupByNamespace which
8510         looks up DeclSpaces based on their namespace, name pair.
8511
8512         * driver.cs: Provide a new `parser verbose' to display the
8513         exception thrown during parsing.  This is turned off by default
8514         now, so the output of a failure from mcs is more graceful.
8515
8516         * namespace.cs: Track all the namespaces defined in a hashtable
8517         for quick lookup.
8518
8519         (IsNamespace): New method
8520
8521 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8522
8523         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8524         we know that we need to concatenate (full typename can never be
8525         null). 
8526
8527         * class.cs: ditto.
8528
8529         * statement.cs: Use a bitfield;  Do not initialize to null things
8530         which are done by the constructor by default.
8531
8532         * cs-parser.jay: bug fix, parameter was 4, not 3.
8533
8534         * expression.cs: Just use the property;
8535
8536         * statement.cs: No need for GetVariableInfo method.
8537
8538 2003-08-08  Martin Baulig  <martin@ximian.com>
8539
8540         * flowanalysis.cs (FlowReturns): This is now nested in the
8541         `FlowBranching' class.
8542         (MyBitVector): Moved this here from statement.cs.
8543         (FlowBranching.SiblingType): New enum type.
8544         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8545
8546 2003-08-07  Martin Baulig  <martin@ximian.com>
8547
8548         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8549         `FlowBranching' class and called `BranchingType'.
8550
8551 2003-08-07  Martin Baulig  <martin@ximian.com>
8552
8553         * flowanalysis.cs: Moved all the control flow analysis code into
8554         its own file.
8555
8556 2003-08-07  Martin Baulig  <martin@ximian.com>
8557
8558         * assign.cs (Assign.DoResolve): `target' must either be an
8559         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8560         #37319.
8561
8562 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8563
8564         * expression.cs (BinaryMethod): This kind of expression is created by the
8565         Binary class if it determines that the operator has to be handled
8566         by a method.
8567
8568         (BinaryDelegate): This kind of expression is created if we are
8569         dealing with a + or - operator on delegates.
8570
8571         (Binary): remove method, argumetns, and DelegateOperator: when
8572         dealing with methods, 
8573
8574         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8575
8576         * statement.cs (Block): use bitfields for the three extra booleans
8577         we had in use.   Remove unused topblock parameter.
8578
8579         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8580
8581         * assign.cs: Drop extra unneeded tests.
8582
8583 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8584
8585         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8586
8587         * statement.cs (Foreach): Use VariableStorage instead of
8588         LocalBuilders.   
8589
8590         * codegen.cs (VariableStorage): New class used by clients that
8591         require a variable stored: locals or fields for variables that
8592         need to live across yield.
8593
8594         Maybe provide a convenience api for EmitThis+EmitLoad?
8595
8596         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8597         these bad boys.
8598
8599 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8600
8601         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8602         RemapParameterLValue): New methods that are used to turn a
8603         precomputed FieldInfo into an expression like this:
8604
8605                 instance.FieldInfo
8606
8607         The idea is to use this instead of making LocalVariableReference
8608         have more than one meaning.
8609
8610         * cs-parser.jay: Add error production to BASE.
8611
8612         * ecore.cs: Deal with TypeManager.GetField returning null, which
8613         is now a valid return value.
8614
8615         (FieldExprNoAddress): New expression for Fields whose address can
8616         not be taken.
8617
8618         * expression.cs (LocalVariableReference): During the resolve
8619         phases, create new expressions if we are in a remapping context.
8620         Remove code that dealt with remapping here.
8621
8622         (ParameterReference): same.
8623
8624         (ProxyInstance): New expression, like the `This' expression, but
8625         it is born fully resolved.  We know what we are doing, so remove
8626         the errors that are targeted to user-provided uses of `this'.
8627
8628         * statement.cs (Foreach): our variable is now stored as an
8629         Expression;  During resolution, follow the protocol, dont just
8630         assume it will return this.
8631
8632 2003-08-06  Martin Baulig  <martin@ximian.com>
8633
8634         * support.cs (SeekableStreamReader.cs): New public class.
8635
8636         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8637         SeekableStreamReader instead of the normal StreamReader.
8638
8639 2003-08-04  Martin Baulig  <martin@ximian.com>
8640
8641         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8642         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8643         deambiguate casts and delegate invocations.
8644         (parenthesized_expression): Use the new tokens to ensure this is
8645         not a cast of method invocation.
8646
8647         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8648         when reading a `)' and Deambiguate_CloseParens () was previously
8649         called.
8650
8651         * expression.cs (ParenthesizedExpression): New class.  This is
8652         just used for the CS0075 test.
8653         (Binary.DoResolve): Check for CS0075.   
8654
8655 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8656
8657         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8658         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8659         reference comparison.
8660
8661         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8662         examine the ReturnType for equality - this is necessary in the
8663         cases of implicit and explicit operators whose signature also
8664         includes the return type.
8665
8666 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8667
8668         * namespace.cs: Cache the result of the namespace computation,
8669         instead of computing it every time.
8670
8671 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8672
8673         * decl.cs: Use a global arraylist that we reuse over invocations
8674         to avoid excesive memory consumption.  Reduces memory usage on an
8675         mcs compile by one meg (45 average).
8676
8677         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8678         private, work around that.
8679
8680 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8681
8682         * literal.cs (IntLiteral): Define Zero and One static literals. 
8683
8684         * cs-parser.jay (integer_literal): use static literals to reduce
8685         memory usage for the most used literals (0, 1 and -1).  211kb
8686         reduced in memory usage.
8687
8688         Replace all calls to `new ArrayList' with `new
8689         ArrayList(4)' which is a good average number for most allocations,
8690         and also requires only 16 bytes of memory for its buffer by
8691         default. 
8692
8693         This reduced MCS memory usage in seven megabytes for the RSS after
8694         bootstrapping.
8695
8696 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8697
8698         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8699         handle params methods the correct way by forming only one
8700         applicable set with params and normal methods in them. Earlier we
8701         were looking at params methods only if we found no normal methods
8702         which was not the correct thing to do.
8703
8704         (Invocation.BetterFunction): Take separate arguments indicating
8705         when candidate and the best method are params methods in their
8706         expanded form.
8707
8708         This fixes bugs #43367 and #46199.
8709
8710         * attribute.cs: Documentation updates.
8711
8712         (CheckAttribute): Rename to CheckAttributeTarget.
8713         (GetValidPlaces): Rename to GetValidTargets.
8714
8715         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8716         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8717
8718         Fixes bug #44468.
8719
8720 2003-07-28  Martin Baulig  <martin@ximian.com>
8721
8722         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8723         name when looking up the base class of a nested class.  Fixes #46977.
8724
8725 2003-07-26  Martin Baulig  <martin@ximian.com>
8726
8727         * expression.cs (Indexers.Indexer): New nested struct; contains
8728         getter, setter and the indexer's type.
8729         (Indexers.Properties): This is now an ArrayList of
8730         Indexers.Indexer's.
8731         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8732         indexer doesn't have any getters.
8733
8734         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8735         for embedded property and indexer assignments.
8736
8737 2003-07-26  Martin Baulig  <martin@ximian.com>
8738
8739         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8740         preprocessor directive is not the first non-whitespace character
8741         on a line.
8742
8743 2003-07-26  Martin Baulig  <martin@ximian.com>
8744
8745         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8746         namespace parsing, follow the spec more closely.
8747
8748         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8749         NamespaceEntry.Lookup().
8750
8751 2003-07-25  Martin Baulig  <martin@ximian.com>
8752
8753         * MethodCore.cs (OverridesSomething): New public field; it's set
8754         from TypeContainer.DefineMembers if this method overrides
8755         something (which doesn't need to be a method).  Fix #39462.
8756
8757 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8758
8759         * typemanager.cs (GetMembers): Ensure that the list of members is
8760         reversed. This keeps things in sync.
8761
8762         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8763         find an AttributeUsage attribute.
8764
8765         * expression.cs (Invocation.OverloadResolve): Perform the check
8766         which disallows Invoke to be directly called on a Delegate.
8767
8768         (Error_InvokeOnDelegate): Report error cs1533.
8769
8770 2003-07-25  Martin Baulig  <martin@ximian.com>
8771
8772         * expression.cs (Indexers.GetIndexersForType): Only look in the
8773         interface hierarchy if the requested type is already an
8774         interface.  Fixes #46788 while keeping #46502 fixed.
8775
8776 2003-07-25  Martin Baulig  <martin@ximian.com>
8777
8778         * class.cs (TypeContainer.DefineMembers): Check whether all
8779         readonly fields have been assigned and report warning CS0649 if
8780         not.
8781
8782         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8783         a valuetype.
8784
8785 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8786
8787         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8788         returned from GetMethods to make things consistent with the
8789         assumptions MCS makes about ordering of methods.
8790
8791         This should comprehensively fix bug #45127 and it does :-)
8792
8793         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8794         ordering is actually reverse.
8795
8796         * Clean up some debug messages I left lying around.
8797
8798         * interface.cs (Populate*): Get rid of code which emits attributes
8799         since the stage in which we emit attributes is the 'Emit' stage,
8800         not the define stage.
8801
8802         (Emit): Move attribute emission for interface members here.
8803
8804 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8805
8806         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8807         closely: we eliminate methods in base types when we have an
8808         applicable method in a top-level type.
8809
8810         Please see section 14.5.5.1 for an exact description of what goes
8811         on. 
8812
8813         This fixes bug #45127 and a host of other related to corlib compilation.
8814
8815         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8816         array is the method corresponding to the top-level type (this is
8817         because of the changes made to icall.c) so we change this
8818         accordingly.
8819
8820         (MethodGroupExpr.Name): This too.
8821
8822         * typemanager.cs (GetElementType): New method which does the right
8823         thing when compiling corlib. 
8824
8825         * everywhere: Make use of the above in the relevant places.
8826
8827 2003-07-22  Martin Baulig  <martin@ximian.com>
8828
8829         * cs-parser.jay (invocation_expression): Moved
8830         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8831         `cast_expression', but create a InvocationOrCast which later
8832         resolves to either an Invocation or a Cast.
8833
8834         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8835         method; call this before EmitStatement() to make sure that this
8836         expression can be used as a statement.
8837
8838         * expression.cs (InvocationOrCast): New class; resolves to either
8839         an Invocation or a Cast.
8840
8841         * statement.cs (StatementExpression): Call ResolveStatement() on
8842         the ExpressionStatement before emitting it.
8843
8844 2003-07-21  Martin Baulig  <martin@ximian.com>
8845
8846         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8847         `ref' and `out' attributes match; fixes #46220.
8848         (MemberAccess.ResolveMemberAccess): You can't reference a type
8849         through an expression; fixes #33180.
8850         (Indexers.GetIndexersForType): Don't return the indexers from
8851         interfaces the class implements; fixes #46502.
8852
8853 2003-07-21  Martin Baulig  <martin@ximian.com>
8854
8855         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8856         CS0661 checks; fixes bug #30442.
8857
8858 2003-07-21  Martin Baulig  <martin@ximian.com>
8859
8860         * decl.cs (AdditionResult): Added `Error'.
8861
8862         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8863
8864         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
8865         makes cs0031.cs actually work.
8866
8867 2003-07-20  Martin Baulig  <martin@ximian.com>
8868
8869         * namespace.cs: Fixed that bug which caused a crash when compiling
8870         the debugger's GUI.
8871
8872 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8873
8874         * typemanager.cs (LookupTypeReflection): Never expose types which
8875         are NotPublic, NestedPrivate, NestedAssembly, or
8876         NestedFamANDAssem.  We used to return these, and later do a check
8877         that would report a meaningful error, but the problem is that we
8878         would not get the real match, if there was a name override.
8879
8880 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8881
8882         * namespace.cs (Namespace, Name): Do not compute the namespace
8883         name dynamically, compute it in the constructor.  This reduced
8884         memory usage by 1697 KB.
8885
8886         * driver.cs: Use --pause to pause at the end.
8887
8888 2003-07-17  Peter Williams  <peter@newton.cx>
8889
8890         * Makefile: Change the name of the test target so that it doesn't
8891         conflict with the recursive test target.
8892
8893 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8894
8895         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8896         AddressOf): Do not use EmitThis, that was wrong, use the actual
8897         this pointer.
8898
8899 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8900
8901         * class.cs (MethodData.Define): While checking if a method is an
8902         interface implementation, improve the test: If we are not public
8903         (use new test here: use the computed MethodAttributes directly,
8904         instead of the parsed modifier flags) check if the `implementing'
8905         method comes from an interface or not.
8906
8907         * pending.cs (VerifyPendingMethods): Slightly better error
8908         message.
8909
8910         * makefile: add test target that does the mcs bootstrap.
8911
8912 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8913
8914         * interface.cs (Define): Do nothing here since there are no
8915         members to populate etc. Move the attribute emission out of here
8916         since this was just totally the wrong place to put it. Attribute
8917         application happens during the 'Emit' phase, not in the 'Define'
8918         phase.
8919
8920         (Emit): Add this method and move the attribute emission here
8921
8922         * rootcontext.cs (EmitCode): Call the Emit method on interface
8923         types too.
8924
8925 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8926
8927         * expression.cs (OverloadResolve): Report error only if Location
8928         is not 'Null' which means that there was a probe going on.
8929
8930 2003-07-14  Martin Baulig  <martin@ximian.com>
8931
8932         * expression.cs (ConditionalLogicalOperator): New public class to
8933         implement user defined conditional logical operators.
8934         This is section 14.11.2 in the spec and bug #40505.
8935
8936 2003-07-14  Martin Baulig  <martin@ximian.com>
8937
8938         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8939
8940 2003-07-14  Martin Baulig  <martin@ximian.com>
8941
8942         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8943
8944         * ecore.cs (IVariable.VerifyFixed): New interface method.
8945
8946         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8947         operator, check whether the variable is actually fixed.  Fixes bug
8948         #36055.  Set a variable definitely assigned when taking its
8949         address as required by the spec.
8950
8951         * statement.cs (LocalInfo.IsFixed): New field.
8952         (LocalInfo.MakePinned): Set `IsFixed' to true.
8953
8954 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8955
8956         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8957         for .ctors, ensure that we only ask for members declared in the
8958         attribute type (BindingFlags.DeclaredOnly).
8959
8960         Fixes bug #43632.
8961
8962         * expression.cs (Error_WrongNumArguments): Report error 1501
8963         correctly the way CSC does.
8964
8965 2003-07-13  Martin Baulig  <martin@ximian.com>
8966
8967         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8968         lookup on the fully qualified name, to make things like "X.X" work
8969         where "X.X" is a fully qualified type name, but we also have a
8970         namespace "X" in the using list.  Fixes #41975.
8971
8972 2003-07-13  Martin Baulig  <martin@ximian.com>
8973
8974         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8975         function. If we're a CompoundAssign, we need to create an embedded
8976         CompoundAssign, not an embedded Assign.
8977         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8978         Fixes #45854.
8979
8980 2003-07-13  Martin Baulig  <martin@ximian.com>
8981
8982         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8983         work to fix bug #46088.
8984
8985 2003-07-13  Ravi Pratap <ravi@ximian.com>
8986
8987         * class.cs (Operator.Emit): Do not emit attributes here - it is
8988         taken care of by the Method class that we delegate too. This takes
8989         care of bug #45876.
8990
8991 2003-07-10  Martin Baulig  <martin@ximian.com>
8992
8993         * expression.cs (TypeOfVoid): New class.
8994         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8995
8996 2003-07-10  Martin Baulig  <martin@ximian.com>
8997
8998         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8999         bug #35957.
9000
9001 2003-07-10  Martin Baulig  <martin@ximian.com>
9002
9003         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9004         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9005
9006         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9007
9008         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9009
9010 2003-07-10  Martin Baulig  <martin@ximian.com>
9011
9012         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9013         of decimal.  Fixes #42850.
9014
9015         NOTE: I also fixed the created byte blob, but this doesn't work on
9016         the MS runtime and csc never produces any byte blobs for decimal
9017         arrays.
9018
9019 2003-07-10  Martin Baulig  <martin@ximian.com>
9020
9021         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9022         structs; fixes #32068.
9023         (Block.AddChildVariableNames): Fixed #44302.
9024
9025 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9026
9027         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9028
9029 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9030
9031         * attribute.cs: And this test is onger needed.
9032
9033 2003-07-08  Martin Baulig  <martin@ximian.com>
9034
9035         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9036         inaccessible types.  Fixes #36313.
9037
9038         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9039
9040         * namespace.cs (NamespaceEntry): Create implicit entries for all
9041         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9042         implicit entries for N1.N2 and N1.
9043
9044 2003-07-08  Martin Baulig  <martin@ximian.com>
9045
9046         Rewrote the handling of namespaces to fix a lot of the issues
9047         wrt. `using' aliases etc.
9048
9049         * namespace.cs (Namespace): Splitted this class into a
9050         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9051
9052         * typemanager.cs (TypeManager.IsNamespace): Removed.
9053         (TypeManager.ComputeNamespaces): Only compute namespaces from
9054         loaded assemblies here, not the namespaces from the assembly we're
9055         currently compiling.
9056
9057 2003-07-08  Martin Baulig  <martin@ximian.com>
9058
9059         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9060
9061 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9062
9063         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9064         already fixed it.  
9065
9066         I thought about the memory savings here, but LookupTypeReflection
9067         is used under already very constrained scenarios.  Compiling
9068         corlib or mcs only exposes one hit, so it would not really reduce
9069         any memory consumption.
9070
9071 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9072
9073         * typemanager.cs: fixes bug #45889 by only adding public types from
9074         other assemblies to the list of known types.
9075
9076 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9077
9078         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9079         on the type we resolved.
9080
9081 2003-07-05  Martin Baulig  <martin@ximian.com>
9082
9083         * pending.cs (PendingImplementation.ParentImplements): Don't
9084         create the proxy if the parent is abstract.
9085
9086         * class.cs (TypeContainer.DefineIndexers): Process explicit
9087         interface implementations first.  Fixes #37714.
9088
9089 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9090
9091         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9092         defined recursively;  but since we modify the input parameters
9093         (left is set to `this' temporarily), we reset this value if the
9094         left_is_explicit is false, which gives the original semantics to
9095         the code.  
9096
9097         * literal.cs (NullPointer): new class used to represent a null
9098         literal in a pointer context.
9099
9100         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9101         type is a pointer, use a NullPointer object instead of a
9102         NullLiteral.   Closes 43687
9103
9104         (ExplicitConversion): Convert pointer values using
9105         the conv opcode to the proper type.
9106
9107         * ecore.cs (New): change ValueTypeVariable property into a method,
9108         that returns whether the valuetype is suitable for being used.
9109
9110         * expression.cs (Binary.DoNumericPromotions): Only return if we
9111         the int constant was a valid uint, and we can return both left and
9112         right as uints.  If not, we continue processing, to trigger the
9113         type conversion.  This fixes 39018.
9114
9115         * statement.cs (Block.EmitMeta): During constant resolution, set
9116         the CurrentBlock property on the emitcontext, so that we resolve
9117         constants propertly.
9118
9119 2003-07-02  Martin Baulig  <martin@ximian.com>
9120
9121         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9122         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9123
9124         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9125         than emitting it here.
9126
9127         * statement.cs: Fixed some more flow analysis bugs.
9128
9129 2003-07-02  Martin Baulig  <martin@ximian.com>
9130
9131         * class.cs (MethodData.Define): When implementing interface
9132         methods, set Final unless we're Virtual.
9133
9134         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9135         check work for interface methods.
9136
9137 2003-07-01  Martin Baulig  <martin@ximian.com>
9138
9139         * ecore.cs (EmitContext.This): Replaced this property with a
9140         GetThis() method which takes a Location argument.  This ensures
9141         that we get the correct error location for a CS0188.
9142
9143 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9144
9145         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9146         ImplicitStandardConversion.
9147
9148         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9149
9150 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9151
9152         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9153         optimization.
9154
9155 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9156
9157         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9158         constructors.
9159
9160         (MethodData.Define): Turn off initlocals for unsafe methods.
9161
9162 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9163
9164         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9165         complete;  Fixes #37521.
9166
9167         * delegate.cs: Use Modifiers.TypeAttr to compute the
9168         TypeAttributes, instead of rolling our own.  This makes the flags
9169         correct for the delegates.
9170
9171 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9172
9173         * class.cs (Constructor.Define): Set the private flag for static
9174         constructors as well.
9175
9176         * cs-parser.jay (statement_expression): Set the return value to
9177         null, to avoid a crash when we catch an error.
9178
9179 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9180
9181         * cs-parser.jay: Applied patch from Jackson that adds support for
9182         extern and unsafe modifiers to destructor declarations.
9183
9184         * expression.cs: Report error 21 if the user is trying to index a
9185         System.Array.
9186
9187         * driver.cs: Add an error message, suggested by the bug report.
9188
9189         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9190         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9191
9192 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9193
9194         * namespace.cs: Add some information to reduce FAQs.
9195
9196 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9197
9198         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9199         underlying enumeration types.  Fixes #43915.
9200
9201         * expression.cs: Treat ushort/short as legal values to be used in
9202         bitwise operations.
9203
9204 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9205
9206         * delegate.cs: transfer custom attributes for paramenters from
9207         the delegate declaration to Invoke and BeginInvoke.
9208
9209 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9210
9211         * attribute.cs: handle custom marshalers and emit marshal info
9212         for fields, too.
9213
9214 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9215
9216         * makefile.gnu: Added anonymous.cs to the compiler sources.
9217
9218 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * iterators.cs: Change the name of the proxy class to include two
9221         underscores.
9222
9223         * cs-parser.jay: Update grammar to include anonymous methods.
9224
9225         * anonymous.cs: new file.
9226
9227 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9228
9229         * class.cs (Field.Define): Add missing test for pointers and
9230         safety. 
9231
9232 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9233
9234         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9235         we use the stobj opcode.
9236
9237         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9238         since it wasn't the correct fix. 
9239
9240         It still is puzzling that we are required to use stobj for IntPtr
9241         which seems to be a ValueType.
9242
9243 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9244
9245         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9246         during regular simple name resolution.   Now, the trick is that
9247         instead of returning for processing the simplename, we do a
9248         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9249         contextual lookup type).   If a match is found, return that, if
9250         not, return for further composition.
9251
9252         This fixes long-standing 30485.
9253
9254         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9255         using the address to initialize an object, do an Stobj instead of
9256         using the regular Stelem.
9257
9258         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9259         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9260         Because if we are a BaseIndexerAccess that value will be true.
9261         Fixes 43643.
9262
9263         * statement.cs (GotoCase.Resolve): Return after reporting an
9264         error, do not attempt to continue. 
9265
9266         * expression.cs (PointerArithmetic.Emit): If our operand is a
9267         long, convert our constants to match the operand before
9268         multiplying.  Convert to I type before adding.   Fixes 43670.
9269
9270 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9271
9272         * enum.cs (ImplicitConversionExists) : Rename to
9273         ImplicitEnumConversionExists to remove ambiguity. 
9274
9275         * ecore.cs (NullCast): New type of cast expression class which
9276         basically is very similar to EmptyCast with the difference being
9277         it still is a constant since it is used only to cast a null to
9278         something else
9279         (eg. (string) null)
9280
9281         * convert.cs (ImplicitReferenceConversion): When casting a null
9282         literal, we return a NullCast.
9283
9284         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9285         should be around anymore.
9286
9287         The renaming (reported was slightly wrong). Corrections:
9288
9289         ConvertImplicitStandard -> ImplicitConversionStandard
9290         ConvertExplicitStandard -> ExplicitConversionStandard
9291
9292         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9293         before passing them in !
9294
9295         * convert.cs (ImplicitConversionStandard): When comparing for
9296         equal expr and target types, ensure that expr is not a
9297         NullLiteral.
9298
9299         In general, we must not be checking (expr_type ==
9300         target_type) in the top level conversion methods
9301         (ImplicitConversion, ExplicitConversion etc). This checking is
9302         done in the methods that they delegate to.
9303
9304 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9305
9306         * convert.cs: Move Error_CannotConvertType,
9307         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9308         ImplicitNumericConversion, ImplicitConversionExists,
9309         ImplicitUserConversionExists, StandardConversionExists,
9310         FindMostEncompassedType, FindMostSpecificSource,
9311         FindMostSpecificTarget, ImplicitUserConversion,
9312         ExplicitUserConversion, GetConversionOperators,
9313         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9314         TryImplicitIntConversion, Error_CannotConvertImplicit,
9315         ConvertImplicitRequired, ConvertNumericExplicit,
9316         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9317         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9318         its own file.
9319
9320         Perform the following renames:
9321
9322         StandardConversionExists -> ImplicitStandardConversionExists
9323         ConvertImplicit -> ImplicitConversion
9324         ConvertImplicitStandard -> ImplicitStandardConversion
9325         TryImplicitIntConversion -> ImplicitIntConversion
9326         ConvertImplicitRequired -> ImplicitConversionRequired
9327         ConvertNumericExplicit -> ExplicitNumericConversion
9328         ConvertReferenceExplicit -> ExplicitReferenceConversion
9329         ConvertExplicit -> ExplicitConversion
9330         ConvertExplicitStandard -> ExplicitStandardConversion
9331
9332 2003-05-19  Martin Baulig  <martin@ximian.com>
9333
9334         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9335         (TypeInfo): Added support for structs having structs as fields.
9336
9337         * ecore.cs (FieldExpr): Implement IVariable.
9338         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9339         VariableInfo for the field.
9340
9341 2003-05-18  Martin Baulig  <martin@ximian.com>
9342
9343         * expression.cs (This.DoResolve): Report a CS0027 if we're
9344         emitting a field initializer.
9345
9346 2003-05-18  Martin Baulig  <martin@ximian.com>
9347
9348         * expression.cs (This.ResolveBase): New public function.
9349         (This.DoResolve): Check for CS0188.
9350
9351         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9352         This.Resolve().
9353
9354         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9355         `instance_expression' to null if we don't have any non-static
9356         methods.
9357
9358 2003-05-18  Martin Baulig  <martin@ximian.com>
9359
9360         Reworked the way how local variables and parameters are handled by
9361         the flow analysis code.
9362
9363         * statement.cs (TypeInfo, VariableMap): New public classes.
9364         (VariableInfo): New public class.  This is now responsible for
9365         checking whether a variable has been assigned.  It is used for
9366         parameters and local variables.
9367         (Block.EmitMeta): Take the InternalParameters as argument; compute
9368         the layout of the flow vectors here.
9369         (Block.LocalMap, Block.ParameterMap): New public properties.
9370         (FlowBranching): The .ctor doesn't get the InternalParameters
9371         anymore since Block.EmitMeta() now computes the layout of the flow
9372         vector.
9373         (MyStructInfo): This class is now known as `StructInfo' and nested
9374         in `TypeInfo'; we don't access this directly anymore.
9375
9376         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9377         property and removed IsAssigned(), IsFieldAssigned(),
9378         SetAssigned() and SetFieldAssigned(); we now call them on the
9379         VariableInfo so we don't need to duplicate this code everywhere.
9380
9381         * expression.cs (ParameterReference): Added `Block block' argument
9382         to the .ctor.
9383         (LocalVariableReference, ParameterReference, This): The new
9384         VariableInfo class is now responsible for all the definite
9385         assignment stuff.
9386
9387         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9388         IsParameterAssigned, SetParameterAssigned): Removed.
9389
9390 2003-05-18  Martin Baulig  <martin@ximian.com>
9391
9392         * typemanager.cs (InitCoreTypes): Try calling
9393         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9394         the 3-args-version.  Corlib now also needs our `void_type'.
9395         (GetMethod): Added overloaded version which takes an optional
9396         `bool report_errors' to allow lookups of optional methods.
9397
9398 2003-05-12  Martin Baulig  <martin@ximian.com>
9399
9400         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9401         only used for locals and not for parameters.
9402
9403 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9404
9405         * support.cs (InternalParameters.ParameterType): Return the
9406         ExternalType of the parameter.
9407
9408         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9409         they were unused.
9410
9411 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9412
9413         * class.cs (MethodData.Define): Do not set the `newslot' on
9414         interface members, if they are also flagged as "override".
9415
9416         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9417         better code for ++i and i++.  This only works for static fields
9418         and local variables.
9419
9420         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9421         want to pull the DeclSpace out of the builder_to_declspace instead
9422         of the TypeBuilder (like in TypeContainer.FindMembers).
9423
9424         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9425         instead of LookupTypeContainer.  Fixes the crash on .NET for
9426         looking up interface members.
9427
9428         * const.cs: Create our own emit context during the Definition
9429         stage, so that constants are evaluated in the proper context, when
9430         a recursive definition happens.
9431
9432 2003-05-11  Martin Baulig  <martin@ximian.com>
9433
9434         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9435         new block for a switch section.
9436         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9437         the adding/lookup in the switch block.  Fixes #39828.
9438
9439 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9440
9441         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9442         functionality: I needed to convert the data after I had performed
9443         the add/sub operation into the operands type size.
9444
9445         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9446         pass the type for the box operation, otherwise the resulting
9447         object would have been of type object.
9448
9449         (BoxedCast): Add constructor to specify the type to box as.
9450
9451 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9452
9453         * iterators.cs: I was reusing the `count' variable inadvertently,
9454         take steps to not allow this to happen.
9455
9456 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9457
9458         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9459         by creating an array at the point where the params starts and
9460         putting all those arguments there, then adjusting the size of the
9461         array.
9462
9463 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9464
9465         * expression.cs (New.AddressOf): Implement interface
9466         IMemoryLocation.  This is used when the `new' operator is used in
9467         the context of an invocation to a method on a value type.
9468
9469         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9470         example. 
9471
9472         * namespace.cs: Also check the using aliases here.
9473
9474         * driver.cs: Move the test for using validity after the types have
9475         been entered, so we do a single pass that also includes the using
9476         aliases. 
9477
9478         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9479         in the regular case.   CreateSiblingForFinally is doing extra
9480         error checking.
9481
9482         * attribute.cs (GetAttributeArgumentExpression): Store the result
9483         on an out value, and use the return value to indicate failure
9484         instead of using null (which is a valid return for Constant.GetValue).
9485
9486         * statement.cs: Perform the analysis flow for the increment
9487         portion after the statement, because this will be the real flow of
9488         execution.  Fixes #42385
9489
9490         * codegen.cs (EmitContext.EmitArgument,
9491         EmitContext.EmitStoreArgument): New helper functions when the
9492         RemapToProxy flag is set.
9493
9494         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9495         function.
9496
9497         Add support for remapping parameters. 
9498
9499         * iterators.cs: Propagate parameter values;  Store parameter
9500         values in the proxy classes.
9501
9502 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9503
9504         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9505         need a proxy reference;  I do not know what I was thinking
9506
9507         * cs-parser.jay (constructor_initializer): catch another error,
9508         and display nice message.
9509
9510         (field_declaration): catch void field declaration
9511         to flag a better error. 
9512
9513         * class.cs (MemberBase.CheckBase): Report an error instead of a
9514         warning if a new protected member is declared in a struct. 
9515         (Field.Define): catch the error of readonly/volatile.
9516
9517         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9518
9519         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9520         volatile variable is taken
9521
9522 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9523
9524         * statement.cs (Fixed.Resolve): Report an error if we are not in
9525         an unsafe context.
9526
9527 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9528
9529         * typemanager.cs: reuse the code that handles type clashes for
9530         delegates and enumerations.
9531
9532         * class.cs (Report28): Always report.
9533
9534         * expression.cs (EncodeAsAttribute): Allow nulls here.
9535
9536 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9539         the functionality for testing whether an expression is valid for
9540         an attribute here.  Also handle the case of arrays of elements
9541         being stored. 
9542
9543         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9544         encoding a linear array into an array of objects that are suitable
9545         to be passed to an CustomAttributeBuilder.
9546
9547         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9548
9549         * ecore.cs: (FieldExpr): Handle field remapping here.
9550
9551         * iteratators.cs: Pass the instance variable (if the method is an
9552         instance method) to the constructors, so we can access the field
9553         variables on the class.
9554
9555         TODO: Test this with structs.  I think the THIS variable on
9556         structs might have to be a pointer, and not a refenrece
9557
9558 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9559
9560         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9561         local variables to fields in a proxy class.
9562
9563         * iterators.cs (PopulateProxy): Rename our internal fields to
9564         <XXX>.  
9565         Create a <THIS> field if we are an instance method, so we can
9566         reference our parent container variables.
9567         (MapVariable): Called back from the EmitContext code to enter a
9568         new variable to field mapping into the proxy class (we just create
9569         a FieldBuilder).
9570
9571         * expression.cs
9572         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9573         for using the remapped locals to fields.
9574
9575         I placed the code here, because that gives the same semantics to
9576         local variables, and only changes the Emit code.
9577
9578         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9579         statements inside iterators.
9580         (VariableInfo): Add a FieldBuilder for the cases when we are
9581         remapping local variables to fields in a proxy class
9582
9583         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9584         current_block != null.
9585
9586         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9587         not cope with strings, as it has been moved to the
9588         TableSwitchEmit.  Fixed bug in switch generation.
9589
9590         * expression.cs (New.DoResolve): Provide more context for the user
9591         when reporting an error.
9592
9593         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9594         pointers. 
9595
9596         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9597         check the permissions for it.  Note than in a type-resolution
9598         context the check was already present in DeclSpace.ResolveType,
9599         but was missing from the MemberAccess.
9600
9601         (ArrayCreation.CheckIndices): warn if the user has
9602         more nested levels of expressions, but there are no more
9603         dimensions specified.  Avoids crash on bug 41906.
9604
9605 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9606
9607         * statement.cs (Block): replace Implicit bool, for a generic
9608         flags.   
9609         New flag: `Unchecked'.  This is used during the EmitMeta phase
9610         (which is out-of-line with the regular Resolve/Emit process for a
9611         statement, as this is done ahead of time, but still gets a chance
9612         to call constant resolve).
9613
9614         (Block.Flags): new enum for adding a new flag.
9615
9616         (Block.EmitMeta): track the state of unchecked.
9617
9618         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9619         to enable constant resolution to work there as well.
9620
9621 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9622
9623         * typemanager.cs (ienumerable_type): Also look up
9624         System.Collections.IEnumerable. 
9625
9626 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9627
9628         TODO: Test more than one conditional per method.
9629
9630         * class.cs (Indexer.Define): Report the location where the user is
9631         referencing the unsupported feature.
9632
9633         (MethodData): Overload the use of `conditionals' to
9634         minimize the creation of needless ArrayLists.   This saves roughly
9635         212kb on my machine.
9636
9637         (Method): Implement the new IIteratorContainer interface.
9638         (Method.SetYields): Implement the method by setting the ModFlags
9639         to contain METHOD_YIELDS.
9640
9641         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9642         which just got set to null.
9643
9644         * iterators.cs: New file.
9645
9646         (Yield, YieldBreak): New statements.
9647
9648         * statement.cs (Return.Resolve): Flag an error if we are used in
9649         an iterator method.
9650
9651         * codegen.cs (InIterator): New flag set if the code is being
9652         compiled in an iterator method.
9653
9654         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9655         internal modifier, and we just use it to avoid adding extra
9656         fields, as this is seldom used.  
9657
9658         * cs-parser.jay: Add yield_statement (yield and yield break).
9659
9660         * driver.cs: New flag -v2 to turn on version 2 features. 
9661
9662         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9663         hashtable when v2 is enabled.
9664
9665 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9666
9667         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9668         there is already a namespace defined with this name.
9669
9670         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9671         people upgraded their corlibs.
9672
9673         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9674         always use fully qualified types, no need to use the compiler
9675         front end.
9676
9677         (TypeManager.IsNamespace): Use binarysearch.
9678
9679         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9680         AddDelegate): I did not quite use the new IsValid API properly: I
9681         have to pass the short-name and the fullname.  I was passing only
9682         the basename instead of the fullname sometimes. 
9683
9684         (TypeContainer.DefineType): call NamespaceClash.
9685
9686         * interface.cs (Interface.DefineType): use NamespaceClash before
9687         defining the type.
9688
9689         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9690         defining the type.
9691
9692         * enum.cs: (Enum.DefineType): use NamespaceClash before
9693         defining the type.
9694
9695         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9696         speed increase.  First, use the negative_hits cache when we get a
9697         negative.  Second, add the type with its full original name
9698         instead of the new . and + encoded name (reflection uses + to
9699         separate type from a nested type).  Use LookupTypeReflection
9700         directly which bypasses the type->name hashtable (that we already
9701         know does not contain the type.
9702
9703         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9704         location/container type. 
9705
9706         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9707
9708 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9709
9710         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9711
9712         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9713         method is being referenced in the method group from a static
9714         context, and report error 120 if so.
9715
9716         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9717         Error118. 
9718
9719         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9720         is created, we create the A namespace).
9721
9722         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9723         Fixes #41591
9724
9725 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9726
9727         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9728         invocation to ModuleBuilder.GetType with the same values will
9729         return a new type instance, so we need to cache its return
9730         values. 
9731
9732         * expression.cs (Binary.ResolveOperator): Only allow the compare
9733         operators on enums if they are of the same type.
9734
9735         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9736         types of ValueType on their own case.  Before we were giving them
9737         the same treatment as objects.
9738
9739         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9740         fullname.  Short name is used to compare against container name.
9741         Fullname is used to check against defined namespace names.
9742
9743         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9744         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9745
9746         (Method.CheckBase): Call parent.
9747         (MemberBase.CheckBase): Check for protected members on sealed
9748         classes.
9749         (PropertyBase.CheckBase): Call parent.
9750         (Field.Define): Call parent.
9751
9752         * report.cs: Negative error codes are now mapped to 8000 - code,
9753         so that the display is render more nicely.
9754
9755         * typemanager.cs: Do not use try/catch, instead report a regular
9756         error. 
9757
9758         (GetPointerType, GetReferenceType): These methods provide
9759         mechanisms to obtain the T* and T& from a T.  We had the code
9760         previously scattered around the code base, and it also used
9761         TypeManager.LookupType that would go through plenty of caches.
9762         This one goes directly to the type source.
9763
9764         In some places we did the Type.GetType followed by
9765         ModuleBuilder.GetType, but not in others, so this unifies the
9766         processing as well.
9767
9768         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9769         statements now that we have namespace information.
9770
9771         * typemanager.cs (IsNamespace): New method, returns whether the
9772         string presented is a namespace or not.
9773
9774         (ComputeNamespaces): New public entry point, computes the list of
9775         available namespaces, using the GetNamespaces API call in Mono, or
9776         the slower version in MS.NET.   
9777
9778         Now before we start the semantic analysis phase, we have a
9779         complete list of namespaces including everything that the user has
9780         provided.
9781
9782         Deleted old code to cache namespaces in .nsc files.
9783
9784 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9785
9786         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9787         class/struct location definition Location for the implicit
9788         constructor location.
9789
9790         (Operator.Define): Use the location of the operator for the
9791         implicit Method definition.
9792
9793         (Constructor.Emit): use the constructor location for the implicit
9794         base initializer constructor.
9795
9796         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9797         and the Expression class now contains two new methods:
9798
9799         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9800         isolate type lookup from the rest of the resolution process.
9801
9802         Since we use Expressions to hold type definitions due to the way
9803         we parse the input we have historically overloaded Resolve to
9804         perform the Type lookups if a special flag is passed.  Now this is
9805         eliminated and two methods take their place. 
9806
9807         The differences in the two methods between xStep and xTerminal is
9808         that xStep is involved in our current lookup system that uses
9809         SimpleNames to compose a name, while xTerminal is used just to
9810         catch the case where the simplename lookup failed.
9811
9812 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9813
9814         * expression.cs (ResolveMemberAccess): Remove redundant code.
9815         TypeExpr expressions are always born fully resolved.
9816
9817         * interface.cs (PopulateMethod): Do not lookup the types twice.
9818         We were doing it once during SemanticAnalysis and once during
9819         PopulateMethod.
9820
9821         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9822         in local variable type definitions, were being returned as a
9823         SimpleName (we decomposed everything into a string), that is
9824         because primary_expression was being used instead of a type in the
9825         grammar (reduce/reduce conflicts).
9826
9827         The part that was wrong is that we converted the expression into a
9828         string (an oversimplification in one hand, compounded with primary
9829         expressions doing string concatenation).
9830
9831         So things like:
9832
9833         A.B.C [] x;
9834
9835         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9836         using clauses from working on this particular context.  And a type
9837         was being matched directly against "A.B.C[]".
9838
9839         We now use the correct approach, and allow for ComposedCast to be
9840         part of the unary expression.  So the "A.B.C []" become a composed
9841         cast of "A.B.C" (as a nested group of MemberAccess with a
9842         SimpleName at the end) plus the rank composition "[]". 
9843
9844         Also fixes 35567
9845
9846 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9849         for the access level checking.
9850
9851         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9852         `TypeContainer container', because I kept getting confused when I
9853         was debugging this code.
9854
9855         * expression.cs (Indexers): Instead of tracking getters/setters,
9856         we now track them in parallel.  We create one arraylist less, but
9857         most importantly it is possible now for the LValue code to find a
9858         matching get for a set.
9859
9860         (IndexerAccess.DoResolveLValue): Update the code.
9861         GetIndexersForType has been modified already to extract all the
9862         indexers from a type.  The code assumed it did not.
9863
9864         Also make the code set the correct return type for the indexer.
9865         This was fixed a long time ago for properties, but was missing for
9866         indexers.  It used to be void_type.
9867
9868         (Binary.Emit): Test first for doubles instead of
9869         floats, as they are more common.
9870
9871         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9872         when dealing with floats and the <=, >= operators.  This fixes bug
9873         #39314 
9874
9875         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9876         to load the array value by emitting a load on the foreach variable
9877         type.  This was incorrect.  
9878
9879         We now emit the code to load an element using the the array
9880         variable type, and then we emit the conversion operator.
9881
9882         Fixed #40176
9883
9884 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9885
9886         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9887
9888 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9889
9890         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9891         test for protection before we test for signatures. 
9892
9893         (MethodSignature.ToString): implement.
9894
9895         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9896         to the case where we reduced into a LongConstant.
9897
9898         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9899         depend on whether the information is acurrate, because the
9900         Microsoft runtime will always claim that the array type is public,
9901         regardless of the real state.
9902
9903         If the type is a pointer, another problem happens: the type is
9904         reported as non-public in Microsoft.  
9905
9906         In both cases we have to call CheckAccessLevel recursively with
9907         the underlying type as the argument to be tested.
9908
9909 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9910
9911         * assign.cs (Assign.Emit): If we are dealing with a compound
9912         assignment expression, we should use the code path that stores the
9913         intermediate result in a temporary value.  This fixes #40903.
9914
9915         *expression.cs (Indirection.ToString): Provide ToString method for
9916         debugging. 
9917
9918 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9919
9920         * class.cs: Null out fields holding references to Block objects so
9921         they can be garbage collected.
9922
9923         * expression.cs (OverloadResolve): Remove unused local.
9924
9925 2003-04-07  Martin Baulig  <martin@ximian.com>
9926
9927         * codegen.cs (EmitContext.CurrentFile): New public field.
9928         (EmitContext.Mark): Use the CurrentFile to check whether the
9929         location is in the correct file.
9930         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9931
9932 2003-04-07  Martin Baulig  <martin@ximian.com>
9933
9934         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9935
9936         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9937         location.  [FIXME: The location argument which gets passed to this
9938         method is sometimes wrong!]
9939
9940 2003-04-07  Nick Drochak <ndrochak@gol.com>
9941
9942         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9943
9944 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9945
9946         * expression.cs (Indirection.EmitAssign): We were using the
9947         temporary, but returning immediately instead of continuing the
9948         EmitAssing flow.
9949
9950 2003-04-06  Martin Baulig  <martin@ximian.com>
9951
9952         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9953         if it's a nested child, but also deriving from the outer class.
9954         See test 190.cs.
9955
9956         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9957         nested child, but also deriving from the outer class.  See
9958         test-190.cs.
9959         (FilterWithClosure): We may access private members of the outer
9960         class if we're a nested child and deriving from the outer class.
9961         (RealMemberLookup): Only set `closure_private_ok' if the
9962         `original_bf' contained BindingFlags.NonPublic.
9963
9964 2003-04-05  Martin Baulig  <martin@ximian.com>
9965
9966         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
9967
9968 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9969
9970         * class.cs (Event.Define): Do not allow abstract events to have
9971         initializers. 
9972
9973 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9974
9975         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9976         block in event declarations.
9977
9978         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9979         value type, get its address.
9980
9981         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9982         leaving a class on the stack instead of a boolean value (int
9983         0/1).  Change the code so we compare against null, and then the
9984         result against zero.
9985
9986         * class.cs (TypeContainer.GetClassBases): We were checking for the
9987         parent class being sealed too late.
9988
9989         * expression.cs (Binary.Emit): For <= and >= when dealing with
9990         floating point values, use cgt.un and clt.un instead of cgt and
9991         clt alone.
9992
9993 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9994
9995         * statement.cs: Apply the same optimization as MS: skip the 
9996         GetEnumerator returning an IEnumerator, and use the one returning a 
9997         CharEnumerator instead. This allows us to avoid the try-finally block 
9998         and the boxing.
9999
10000 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10001
10002         * cs-parser.jay: Attributes cannot be applied to
10003                          namespaces. Fixes #40473
10004
10005 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10006
10007         * class.cs:
10008         (Add*): check if the name is valid using the full name for constants,
10009         fields, properties and events.
10010
10011 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10012
10013         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10014         char constants to be part of the enumeration.
10015
10016         * expression.cs (Conditional.DoResolve): Add support for operator
10017         true. Implements the missing functionality from 14.12
10018
10019         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10020         operator true/false as required by the spec.
10021
10022         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10023         implicit conversion to boolean.
10024
10025         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10026         also one where the type implements `operator true'. 
10027
10028         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10029         get an expression that will invoke operator true based on an
10030         expression.  
10031
10032         (GetConversionOperators): Removed the hack that called op_True
10033         here.  
10034
10035         (Expression.ResolveBoolean): Move this from Statement.
10036
10037 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10038
10039         * ecore.cs (FieldExpr): do not allow initialization of initonly
10040         fields on derived classes
10041
10042 2003-03-13  Martin Baulig  <martin@ximian.com>
10043
10044         * statement.cs (Block.Emit): Call ig.BeginScope() and
10045         ig.EndScope() when compiling with debugging info; call
10046         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10047
10048 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10049
10050         * expression.cs (Indexers): Do not construct immediately, allow
10051         for new members to be appended as we go.  Fixes 38143
10052
10053 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10054
10055         * expression.cs: save/restore context when resolving an unchecked
10056         expression.
10057
10058 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10059
10060         * cfold.cs: Catch division by zero in modulus operator during
10061         constant folding.
10062
10063 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10064
10065         * interface.cs (Interface.DefineMembers): Avoid defining members
10066         twice. 
10067
10068 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10069
10070         * driver.cs: handle the +/- options for -noconfig
10071
10072         * statement.cs (Unckeched.Resolve): Also track the state of
10073         unchecked in the Resolve phase.
10074
10075 2003-02-27  Martin Baulig  <martin@ximian.com>
10076
10077         * ecore.cs (Expression.MemberLookup): Don't create a
10078         MethodGroupExpr for something which is not a method.  Fixes #38291.
10079
10080 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10081
10082         * class.cs (MemberBase.CheckParameters): Also check that the type
10083         is unmanaged if it is a pointer.
10084
10085         * expression.cs (SizeOf.Resolve): Add location information.
10086
10087         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10088         a managed type is declared.
10089
10090         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10091         parameter modifiers as well.  Fixes bug 38606
10092
10093         * class.cs: Very sad.  Am backing out the speed up changes
10094         introduced by the ArrayList -> Array in the TypeContainer, as they
10095         were not actually that much faster, and introduced a bug (no error
10096         reports on duplicated methods).
10097
10098         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10099         source first, this will guarantee that we have a valid expression
10100         before calling in lower levels functions that will require a
10101         resolved object.  Then use this original_source in the
10102         target.ResolveLValue instead of the original source that was
10103         passed to us.
10104
10105         Another change.  Use target.Resolve instead of LValueResolve.
10106         Although we are resolving for LValues, we will let the Assign code
10107         take care of that (it will be called again from Resolve).  This
10108         basically allows code like this:
10109
10110         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10111         class Y { void A (X x) { x [0] += o; }
10112
10113         The problem was that the indexer was trying to resolve for
10114         set_Item (idx, object o) and never finding one.  The real set_Item
10115         was set_Item (idx, X).  By delaying the process we get the right
10116         semantics. 
10117
10118         Fixes bug 36505
10119
10120 2003-02-23  Martin Baulig  <martin@ximian.com>
10121
10122         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10123         while calling DoEmit ().
10124
10125         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10126         source files; if you use the #line directive inside a method, the
10127         compiler stops emitting line numbers for the debugger until it
10128         reaches the end of the method or another #line directive which
10129         restores the original file.
10130
10131 2003-02-23  Martin Baulig  <martin@ximian.com>
10132
10133         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10134
10135 2003-02-23  Martin Baulig  <martin@ximian.com>
10136
10137         * statement.cs (Block.AddChildVariableNames): We need to call this
10138         recursively, not just for our immediate children.
10139
10140 2003-02-23  Martin Baulig  <martin@ximian.com>
10141
10142         * class.cs (Event.Define): Always make the field private, like csc does.
10143
10144         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10145         actually work, fixes bug #37521.
10146
10147 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10148
10149         * delegate.cs: When creating the various temporary "Parameters"
10150         classes, make sure that we call the ComputeAndDefineParameterTypes
10151         on those new parameters (just like we do with the formal ones), to
10152         allow them to be resolved in the context of the DeclSpace.
10153
10154         This fixes the bug that Dick observed in Bugzilla #38530.
10155
10156 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10157
10158         * expression.cs (ResolveMemberAccess): When resolving a constant,
10159         do not attempt to pull a constant if the value was not able to
10160         generate a valid constant.
10161
10162         * const.cs (LookupConstantValue): Do not report more errors than required.
10163
10164 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10165
10166         * expression.cs: fixes bug #38328.
10167
10168 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10169
10170         * class.cs: Changed all the various members that can be part of a
10171         class from being an ArrayList to be an Array of the right type.
10172         During the DefineType type_list, interface_list, delegate_list and
10173         enum_list are turned into types, interfaces, delegates and enums
10174         arrays.  
10175
10176         And during the member population, indexer_list, event_list,
10177         constant_list, field_list, instance_constructor_list, method_list,
10178         operator_list and property_list are turned into their real arrays.
10179
10180         Although we could probably perform this operation earlier, for
10181         good error reporting we need to keep the lists and remove the
10182         lists for longer than required.
10183
10184         This optimization was triggered by Paolo profiling the compiler
10185         speed on the output of `gen-sample-program.pl' perl script. 
10186
10187         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10188         not crash in methods like MemberLookupFailed that use this field.  
10189
10190         This problem arises when the compiler fails to resolve a type
10191         during interface type definition for example.
10192
10193 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10194
10195         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10196         inherit from System.Object, so we have to stop at null, not only
10197         when reaching System.Object.
10198
10199 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10200
10201         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10202         DeclaredOnly because the parent indexer might have had a different
10203         name, but did not loop until the top of the hierarchy was reached.
10204
10205         The problem this one fixes is 35492: when a class implemented an
10206         indexer from an interface, we were getting the interface method
10207         (which was abstract) and we were flagging an error (can not invoke
10208         abstract method).
10209
10210         This also keeps bug 33089 functioning, and test-148 functioning.
10211
10212         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10213         out if a method is special is to see if it is declared in a
10214         property or event, or whether it is one of the predefined operator
10215         names.   This should fix correctly #36804.
10216
10217 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10218
10219         The goal here is to remove the dependency on EmptyCast.Peel ().
10220         Killing it completely.
10221
10222         The problem is that currently in a number of places where
10223         constants are expected, we have to "probe" for an EmptyCast, and
10224         Peel, which is not the correct thing to do, as this will be
10225         repetitive and will likely lead to errors. 
10226
10227         The idea is to remove any EmptyCasts that are used in casts that
10228         can be reduced to constants, so we only have to cope with
10229         constants. 
10230
10231         This bug hunt was triggered by Bug 37363 and the desire to remove
10232         the duplicate pattern where we were "peeling" emptycasts to check
10233         whether they were constants.  Now constants will always be
10234         constants.
10235
10236         * ecore.cs: Use an enumconstant here instead of wrapping with
10237         EmptyCast.  
10238
10239         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10240         throwing me off.  By handling this we can get rid of a few hacks.
10241
10242         * statement.cs (Switch): Removed Peel() code.
10243
10244 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10245
10246         * class.cs: Location information for error 508
10247
10248         * expression.cs (New.DoResolve): Add a guard against double
10249         resolution of an expression.  
10250
10251         The New DoResolve might be called twice when initializing field
10252         expressions (see EmitFieldInitializers, the call to
10253         GetInitializerExpression will perform a resolve on the expression,
10254         and later the assign will trigger another resolution
10255
10256         This leads to bugs (#37014)
10257
10258         * delegate.cs: The signature for EndInvoke should contain any ref
10259         or out parameters as well.  We were not doing this in the past. 
10260
10261         * class.cs (Field.Define): Do not overwrite the type definition
10262         inside the `volatile' group.  Turns out that volatile enumerations
10263         were changing the type here to perform a validity test, which
10264         broke conversions. 
10265
10266 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10267
10268         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10269         and structs, we do not want to load the instance variable
10270
10271         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10272         enum_type has to be handled like an object reference (implicit
10273         conversions exists from this to object), but the regular IsClass
10274         and IsValueType tests will never return true for this one.
10275
10276         Also we use TypeManager.IsValueType instead of type.IsValueType,
10277         just for consistency with the rest of the code (this is only
10278         needed if we ever use the construct exposed by test-180.cs inside
10279         corlib, which we dont today).
10280
10281 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10282
10283         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10284         just InternalCall.
10285
10286 2003-02-09  Martin Baulig  <martin@ximian.com>
10287
10288         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10289         (Namespace.DefineNamespaces): New static public method; this is
10290         called when we're compiling with debugging to add all namespaces
10291         to the symbol file.
10292
10293         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10294         pass it to the Namespace's .ctor.
10295
10296         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10297         and MethodBase arguments; pass the namespace ID to the symwriter;
10298         pass the MethodBase instead of the token to the symwriter.
10299         (SymbolWriter.DefineNamespace): New method to add a namespace to
10300         the symbol file.
10301
10302 2003-02-09  Martin Baulig  <martin@ximian.com>
10303
10304         * symbolwriter.cs: New file.  This is a wrapper around
10305         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10306         methods here in near future.
10307
10308 2003-02-09  Martin Baulig  <martin@ximian.com>
10309
10310         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10311         ILGenerator.MarkSequencePoint() which are actually used by the
10312         symbol writer.
10313
10314 2003-02-09  Martin Baulig  <martin@ximian.com>
10315
10316         * location.cs (SourceFile): New public sealed class.  This
10317         contains the name and an index which is used in the location's token.
10318         (Location): Reserve an appropriate number of bits in the token for
10319         the source file instead of walking over that list, this gives us a
10320         really huge performance improvement when compiling with debugging.
10321
10322         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10323         `SourceFile' argument instead of a string.
10324         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10325         but don't parse/tokenize here, we need to generate the list of all
10326         source files before we do that.
10327         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10328         the files.
10329
10330         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10331         instead of a string.
10332
10333         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10334         of a string.
10335
10336 2003-02-09  Martin Baulig  <martin@ximian.com>
10337
10338         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10339         filename on `#line default'.
10340
10341 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10342
10343         * statement.cs: don't clear the pinned var when the fixed statement
10344         returns from the method (fixes bug#37752).
10345
10346 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10347
10348         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10349         to IsValueType.
10350
10351 2003-02-07  Martin Baulig  <martin@ximian.com>
10352
10353         * driver.cs: Removed the `--debug-args' command line argument.
10354
10355         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10356         automatically by the AsssemblyBuilder.
10357         (CodeGen.InitializeSymbolWriter): We don't need to call any
10358         initialization function on the symbol writer anymore.  This method
10359         doesn't take any arguments.
10360
10361 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10362
10363         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10364         from referenced assemblies as well.
10365
10366 2003-02-02  Martin Baulig  <martin@ximian.com>
10367
10368         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10369
10370 2003-02-02  Martin Baulig  <martin@ximian.com>
10371
10372         * class.cs (Constructor.Emit): Open the symbol writer before
10373         emitting the constructor initializer.
10374         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10375         single-stepping through constructor initializers.
10376
10377 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * class.cs: Handle error 549: do not allow virtual methods in
10380         sealed classes. 
10381
10382 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10383
10384         * decl.cs: Check access levels when resolving types
10385
10386 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10387
10388         * statement.cs: Add parameters and locals set in catch blocks that might 
10389         return to set vector
10390
10391 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10392
10393         * class.cs (Operator): Set the SpecialName flags for operators.
10394
10395         * expression.cs (Invocation.DoResolve): Only block calls to
10396         accessors and operators on SpecialName methods.
10397
10398         (Cast.TryReduce): Handle conversions from char constants.
10399
10400
10401 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10402
10403         * statement.cs: small memory and time optimization in FlowBranching.
10404
10405 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10406
10407         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10408         problem that the last fix but in the other sid (Set).
10409
10410         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10411         access when there is no indexer in the hierarchy.
10412
10413 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10414
10415         * class.cs: Combine some if statements.
10416
10417 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10418
10419         * driver.cs: fixed bug #37187.
10420
10421 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10422
10423         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10424         any indexer, it's needed to build a list with all the indexers in the
10425         hierarchy (AllGetters), else we have problems. Fixes #35653.
10426
10427 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * class.cs (MethodData.Define): It is wrong for an interface
10430         implementation to be static in both cases: explicit and implicit.
10431         We were only handling this in one case.
10432
10433         Improve the if situation there to not have negations.
10434
10435         * class.cs (Field.Define): Turns out that we do not need to check
10436         the unsafe bit on field definition, only on usage.  Remove the test.
10437
10438 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10439
10440         * driver.cs: use assembly.Location instead of Codebase (the latest
10441         patch made mcs fail when using MS assemblies).
10442
10443 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10444
10445         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10446         get the path to *corlib.dll.
10447
10448 2003-01-21  Nick Drochak <ndrochak@gol.com>
10449
10450         * cs-tokenizer.cs:
10451         * pending.cs:
10452         * typemanager.cs: Remove compiler warnings
10453
10454 2003-01-20  Duncan Mak  <duncan@ximian.com>
10455
10456         * AssemblyInfo.cs: Bump the version number to 0.19.
10457
10458 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10459
10460         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10461
10462 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10463
10464         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10465
10466 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10467
10468         * cs-parser.jay: Small fix: we were not comparing the constructor
10469         name correctly.   Thanks to Zoltan for the initial pointer.
10470
10471 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10472
10473         * cs-tokenizer.cs: Set file name when specified with #line
10474
10475 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10476
10477         * cs-parser.jay: Only perform the constructor checks here if we
10478         are named like the class;  This will help provider a better
10479         error.  The constructor path is taken when a type definition is
10480         not found, but most likely the user forgot to add the type, so
10481         report that rather than the constructor error.
10482
10483 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10484
10485         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10486         allocations.
10487
10488 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10489
10490         * cs-parser.jay: Add cleanup call.
10491
10492 2003-01-13  Duncan Mak  <duncan@ximian.com>
10493
10494         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10495         consistent with other methods.
10496
10497 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10498
10499         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10500
10501 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10502
10503         * attribute.cs: only set GuidAttr to true when we have a
10504         GuidAttribute.
10505
10506 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10507
10508         * ecore.cs:
10509         * expression.cs:
10510         * typemanager.cs: fixes to allow mcs compile corlib with the new
10511         Type.IsSubclassOf fix.
10512
10513 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10514
10515         * expression.cs (LocalVariableReference.DoResolve): Classify a
10516         constant as a value, not as a variable.   Also, set the type for
10517         the variable.
10518
10519         * cs-parser.jay (fixed_statement): take a type instead of a
10520         pointer_type, so we can produce a better error message later.
10521
10522         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10523         as an error.  
10524
10525         (For.DoEmit): Make inifinite loops have a
10526         non-conditional branch back.
10527
10528         (Fixed.DoEmit): First populate the pinned variables, then emit the
10529         statement, then clear the variables.  Before I was emitting the
10530         code once for each fixed piece.
10531
10532
10533 2003-01-08  Martin Baulig  <martin@ximian.com>
10534
10535         * statement.cs (FlowBranching.MergeChild): A break in a
10536         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10537
10538 2003-01-08  Martin Baulig  <martin@ximian.com>
10539
10540         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10541         lives in the same number space than `param_map'.  Fixes #36154.
10542
10543 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * cs-parser.jay (constructor_declaration): Set the
10546         Constructor.ModFlags before probing for it.  This makes the
10547         compiler report 514, 515 and 132 (the code was there, but got
10548         broken). 
10549
10550         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10551         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10552         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10553
10554 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10555
10556         * enum.cs: create the enum static fields using the enum type.
10557
10558 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10559
10560         * class.cs: don't try to create the ParamBuilder for the return
10561         type if it's not needed (and handle it breaking for the ms runtime
10562         anyway).
10563
10564 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10565
10566         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10567
10568 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10569
10570         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10571         the command.   This showed up while compiling the JANET source
10572         code, which used \r as its only newline separator.
10573
10574 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10575
10576         * class.cs (Method.Define): If we are an operator (because it
10577         reuses our code), then set the SpecialName and HideBySig.  #36128
10578
10579 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10580
10581         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10582         exception, report error 120 `object reference required'.
10583
10584         * driver.cs: Add --pause option, used during to measure the size
10585         of the process as it goes with --timestamp.
10586
10587         * expression.cs (Invocation.DoResolve): Do not allow methods with
10588         SpecialName to be invoked.
10589
10590 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10591
10592         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10593         number before adding it.
10594
10595 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10596
10597         * ecore.cs (StandardImplicitConversion): When in an unsafe
10598         context, we allow conversion between void * to any other pointer
10599         type. This fixes bug #35973.
10600
10601 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10602
10603         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10604         is not thrown when extensionless outputs are used 
10605
10606 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10607
10608         * rootcontext.cs: fixed compilation of corlib.
10609
10610 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10611
10612         * attribute.cs (Attributes.Contains): Add new method.
10613
10614         * class.cs (MethodCore.LabelParameters): if the parameter is an
10615         `out' parameter, check that no attribute `[In]' has been passed.
10616
10617         * enum.cs: Handle the `value__' name in an enumeration.
10618
10619 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10620
10621         * decl.cs: Added special case to allow overrides on "protected
10622         internal" methods
10623
10624 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10625
10626         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10627         since it makes much more sense.
10628
10629         (Attributes.ctor): Don't require a Location parameter.
10630
10631         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10632
10633         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10634         since we already have that information per attribute.
10635
10636         * everywhere : make appropriate changes.
10637
10638         * class.cs (LabelParameters): Write the code which actually
10639         applies attributes to the return type. We can't do this on the MS
10640         .NET runtime so we flag a warning in the case an exception is
10641         thrown.
10642
10643 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10644
10645         * const.cs: Handle implicit null conversions here too.
10646
10647 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10648
10649         * class.cs (MethodCore.LabelParameters): Remove the extra
10650         Type [] parameter since it is completely unnecessary. Instead
10651         pass in the method's attributes so that we can extract
10652         the "return" attribute.
10653
10654 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10655
10656         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10657         of ignoring it and letting the compile continue.
10658
10659         * typemanager.cs (ChangeType): use an extra argument to return an
10660         error condition instead of throwing an exception.
10661
10662 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10663
10664         * expression.cs (Unary.TryReduce): mimic the code for the regular
10665         code path.  Perform an implicit cast in the cases where we can
10666         implicitly convert to one of the integral types, and then reduce
10667         based on that constant.   This fixes bug #35483.
10668
10669 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10670
10671         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10672
10673 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10674
10675         * namespace.cs: fixed bug #35489.
10676
10677 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * class.cs: Remove some dead code.
10680
10681         * cs-parser.jay: Estimate the number of methods needed
10682         (RootContext.MethodCount);
10683
10684         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10685         numbers instead of StringBuilders.
10686
10687         * support.cs (PtrHashtable): Add constructor with initial size;
10688         We can now reduce reallocations of the method table.
10689
10690 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10691
10692         * attribute.cs (ApplyAttributes): Keep track of the emitted
10693         attributes on a per-target basis. This fixes bug #35413.
10694
10695 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10696
10697         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10698         default to the Windows 1252 encoding.
10699
10700         (UnixParseOption): Support version, thanks to Alp for the missing
10701         pointer. 
10702
10703         * AssemblyInfo.cs: Add nice assembly information.
10704
10705         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10706         (bug 35169).
10707
10708         * cs-parser.jay: Allow a trailing comma before the close bracked
10709         in the attribute_section production.
10710
10711         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10712         address of the instance was being taken, I will take this out,
10713         because we take the address of the object immediately here.
10714
10715 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10716
10717         * typemanager.cs (AreMultipleAllowed): Take care of the most
10718         obvious case where attribute type is not in the current assembly -
10719         stupid me ;-)
10720
10721 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10724         definitions, instead of doing that afterwards.  
10725
10726         Also we use a nice little hack, depending on the constructor, we
10727         know if we are a "composed" name or a simple name.  Hence, we
10728         avoid the IndexOf test, and we avoid 
10729
10730         * codegen.cs: Add code to assist in a bug reporter to track down
10731         the source of a compiler crash. 
10732
10733 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10734
10735         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10736         types have been emitted for a given element and flag an error
10737         if something which does not have AllowMultiple set is used more
10738         than once.
10739
10740         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10741         attribute types and their corresponding AllowMultiple properties
10742
10743         (AreMultipleAllowed): Check the property for a given type.
10744
10745         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10746         property in the case we have a TypeContainer.
10747
10748         (Attributes.AddAttribute): Detect duplicates and just skip on
10749         adding them. This trivial fix catches a pretty gross error in our
10750         attribute emission - global attributes were being emitted twice!
10751
10752         Bugzilla bug #33187 is now fixed.
10753
10754 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10755
10756         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10757         instead of pp_and).
10758
10759         * expression.cs (Binary.ResolveOperator): I can only use the
10760         Concat (string, string, string) and Concat (string, string,
10761         string, string) if the child is actually a concatenation of
10762         strings. 
10763
10764 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10765
10766         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10767         context where we need a 2-character lookahead.
10768
10769         * pending.cs (PendingImplementation): Rework so we can keep track
10770         of interface types all the time, and flag those which were
10771         implemented by parents as optional.
10772
10773 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10774
10775         * expression.cs (Binary.ResolveOperator): Use
10776         String.Concat(string,string,string) or
10777         String.Concat(string,string,string,string) when possible. 
10778
10779         * typemanager: More helper methods.
10780
10781
10782 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10783
10784         * pending.cs: remove the bogus return from GetMissingInterfaces()
10785         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10786
10787 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10788
10789         * namespace.cs: avoid duplicated 'using xxx' being added to
10790         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10791         when we get more than one 'using' statement for the same namespace.
10792         Report a CS0105 warning for it.
10793
10794 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10795
10796         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10797         of calling getChar/putback, uses internal knowledge of it.    
10798
10799         (xtoken): Reorder tokenizer so most common patterns are checked
10800         first.  This reduces the compilation time in another 5% (from 8.11s
10801         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10802
10803         The parsing time is 22% of the compilation in mcs, and from that
10804         64% is spent on the tokenization process.  
10805
10806         I tried using a binary search for keywords, but this is slower
10807         than the hashtable.  Another option would be to do a couple of
10808         things:
10809
10810                 * Not use a StringBuilder, instead use an array of chars,
10811                   with a set value.  Notice that this way we could catch
10812                   the 645 error without having to do it *afterwards*.
10813
10814                 * We could write a hand-parser to avoid the hashtable
10815                   compares altogether.
10816
10817         The identifier consumption process takes 37% of the tokenization
10818         time.  Another 15% is spent on is_number.  56% of the time spent
10819         on is_number is spent on Int64.Parse:
10820
10821                 * We could probably choose based on the string length to
10822                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10823                   computations. 
10824
10825         Another 3% is spend on wrapping `xtoken' in the `token' function.
10826
10827         Handle 0xa0 as whitespace (#34752)
10828
10829 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10830
10831         * typemanager.cs (IsCLRType): New routine to tell whether a type
10832         is one of the builtin types.  
10833
10834         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10835         typecode in more places instead of doing pointer comparissions.
10836         We could leverage some knowledge about the way the typecodes are
10837         laid out.
10838
10839         New code to cache namespaces in assemblies, it is currently not
10840         invoked, to be used soon.
10841
10842         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10843
10844         * expression.cs (Binary.ResolveOperator): specially handle
10845         strings, and do not perform user-defined operator overloading for
10846         built-in types.
10847
10848 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10849
10850         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10851         internalcall as it is a pretty simple operation;  Avoid whenever
10852         possible to call Char.IsLetter.
10853
10854         (consume_identifier): Cut by half the number of
10855         hashtable calls by merging the is_keyword and GetKeyword behavior.
10856
10857         Do not short-circuit, because if we do, we
10858         report errors (ie, #if false && true would produce an invalid
10859         directive error);
10860
10861
10862 2002-11-24  Martin Baulig  <martin@ximian.com>
10863
10864         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10865         check constant ranges and report a CS0221.  Fixes #33186.
10866
10867 2002-11-24  Martin Baulig  <martin@ximian.com>
10868
10869         * cs-parser.jay: Make this work for uninitialized variable
10870         declarations in the `for' initializer.  Fixes #32416.
10871
10872 2002-11-24  Martin Baulig  <martin@ximian.com>
10873
10874         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10875         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10876
10877 2002-11-24  Martin Baulig  <martin@ximian.com>
10878
10879         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10880         argument; if true, we also check for user-defined conversions.
10881         This is only needed if both arguments are of a user-defined type.
10882         Fixes #30443, added test-175.cs.
10883         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10884
10885         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10886
10887 2002-11-24  Martin Baulig  <martin@ximian.com>
10888
10889         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10890         function to get the store opcode.
10891         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10892         only emit the Ldelema if the store opcode is Stobj.  You must run
10893         both test-34 and test-167 to test this.  Fixes #34529.
10894
10895 2002-11-23  Martin Baulig  <martin@ximian.com>
10896
10897         * ecore.cs (Expression.MemberLookup): Added additional
10898         `qualifier_type' argument which is used when we're being called
10899         from MemberAccess.DoResolve() and null if we're called from a
10900         SimpleName lookup.
10901         (Expression.MemberLookupFailed): New method to report errors; this
10902         does the CS1540 check and reports the correct error message.
10903
10904         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10905         argument for the CS1540 check and redone the way how we're dealing
10906         with private members.  See the comment in the source code for details.
10907         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10908         `closure_start_type' to `closure_qualifier_type' and check whether
10909         it's not null.  It was not this filter being broken, it was just
10910         being called with the wrong arguments.
10911
10912         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10913         and pass it the correct `qualifier_type'; this also does the error
10914         handling for us.
10915
10916 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10917
10918         * expression.cs (Invocation.EmitParams): If the we are dealing
10919         with a non-built-in value type, load its address as well.
10920
10921         (ArrayCreation): Use a a pretty constant instead
10922         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10923         static initializers.  
10924
10925         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10926         because they are not really value types, just glorified integers. 
10927
10928         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10929
10930         * ecore.cs: Remove redundant code for enumerations, make them use
10931         the same code path as everything else, fixes the casting issue
10932         with enumerations in Windows.Forms.
10933
10934         * attribute.cs: Do only cast to string if it is a string, the
10935         validation happens later.
10936
10937         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10938         people upgrade their corlibs.
10939
10940         * ecore.cs: Oops, enumerations were not following the entire code path
10941
10942 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10943
10944         * typemanager.cs (FilterWithClosure): Commented out the test for
10945         1540 in typemanager.cs, as it has problems when accessing
10946         protected methods from a parent class (see test-174.cs). 
10947
10948         * attribute.cs (Attribute.ValidateGuid): new method.
10949         (Attribute.Resolve): Use above.
10950
10951 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10952
10953         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10954
10955         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10956         handling for enumerations, as we only needed the TypeContainer
10957         functionality to begin with (this is required for the fix below to
10958         work for enums that reference constants in a container class for
10959         example). 
10960
10961         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10962
10963         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10964         a valid TypeBuilder to perform lookups on.o
10965
10966         * class.cs (InheritableMemberSignatureCompare): Use true in the
10967         call to GetGetMethod and GetSetMethod, because we are comparing
10968         the signature, and we need to get the methods *even* if they are
10969         private. 
10970
10971         (PropertyBase.CheckBase): ditto.
10972
10973         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10974         GotoCase.Resolve): Use Peel on EmpytCasts.
10975
10976         * ecore.cs (EmptyCast): drop child, add Peel method.
10977
10978 2002-11-17  Martin Baulig  <martin@ximian.com>
10979
10980         * ecore.cs (EmptyCast.Child): New public property.
10981
10982         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10983         label resolved to an EmptyCast.  Fixes #34162.
10984         (GotoCase.Resolve): Likewise.
10985         (Block.EmitMeta): Likewise.
10986
10987 2002-11-17  Martin Baulig  <martin@ximian.com>
10988
10989         * expression.cs (Invocation.BetterConversion): Prefer int over
10990         uint; short over ushort; long over ulong for integer literals.
10991         Use ImplicitConversionExists instead of StandardConversionExists
10992         since we also need to check for user-defined implicit conversions.
10993         Fixes #34165.  Added test-173.cs.
10994
10995 2002-11-16  Martin Baulig  <martin@ximian.com>
10996
10997         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10998         with the `true' and `false' literals.  Fixes #33151.
10999
11000 2002-11-16  Martin Baulig  <martin@ximian.com>
11001
11002         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11003         October 22nd; don't do the cs1540 check for static members.
11004
11005         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11006         now using our own filter here and doing the cs1540 check again.
11007
11008 2002-11-16  Martin Baulig  <martin@ximian.com>
11009
11010         * support.cs (InternalParameters): Don't crash if we don't have
11011         any fixed parameters.  Fixes #33532.
11012
11013 2002-11-16  Martin Baulig  <martin@ximian.com>
11014
11015         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11016         when looking up static methods to make this work on Windows.
11017         Fixes #33773.
11018
11019 2002-11-16  Martin Baulig  <martin@ximian.com>
11020
11021         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11022         a setter rather than using PropertyInfo.CanWrite.
11023
11024 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11025
11026         * class.cs: Allow acces to block member by subclasses. Fixes build
11027         breaker.
11028
11029 2002-11-14  Martin Baulig  <martin@ximian.com>
11030
11031         * class.cs (Constructor.Emit): Added the extern/block check.
11032         Fixes bug #33678.
11033
11034 2002-11-14  Martin Baulig  <martin@ximian.com>
11035
11036         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11037         iteration while looking for indexers, this is needed because the
11038         indexer may have a different name in our base classes.  Fixed the
11039         error reporting (no indexers at all, not get accessor, no
11040         overloaded match).  Fixes bug #33089.
11041         (IndexerAccess.DoResolveLValue): Likewise.
11042
11043 2002-11-14  Martin Baulig  <martin@ximian.com>
11044
11045         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11046         indexers.  Fixes the first part of bug #33089.
11047         (MethodSignature.InheritableMemberSignatureCompare): Added support
11048         for properties.
11049
11050 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11051
11052         * attribute.cs (Attribute.Resolve): Catch the
11053         NullReferenceException and report it since it isn't supposed to
11054         happen. 
11055
11056 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11057
11058         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11059         LogicalOr and LogicalAnd that can benefit from recursively
11060         handling EmitBranchable.  The code now should be nice for Paolo.
11061
11062 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11063
11064         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11065         the Type lookups, as we perform quite a number of lookups on
11066         non-Types.  This can be removed once we can deterministically tell
11067         whether we have a type or a namespace in advance.
11068
11069         But this might require special hacks from our corlib.
11070
11071         * TODO: updated.
11072
11073         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11074         and double which avoids a conversion from an integer to a double.
11075
11076         * expression.cs: tiny optimization, avoid calling IsConstant,
11077         because it effectively performs the lookup twice.
11078
11079 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11080
11081         But a bogus return here to keep the semantics of the old code
11082         until the Mono runtime is fixed.
11083
11084         * pending.cs (GetMissingInterfaces): New method used to remove all
11085         the interfaces that are already implemented by our parent
11086         classes from the list of pending methods. 
11087
11088         * interface.cs: Add checks for calls after ResolveTypeExpr.
11089
11090 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11091
11092         * class.cs (Class.Emit): Report warning 67: event not used if the
11093         warning level is beyond 3.
11094
11095         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11096         being a NullLiteral.
11097
11098         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11099         specifiers. 
11100
11101         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11102         path that might fail if a type can not be resolved.
11103
11104         * expression.cs (Binary.Emit): Emit unsigned versions of the
11105         operators. 
11106
11107         * driver.cs: use error 5.
11108
11109 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11110
11111         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11112
11113 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11114
11115         * cs-parser.jay (switch_section): A beautiful patch from Martin
11116         Baulig that fixed 33094.
11117
11118 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11119
11120         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11121         Check whether the base is abstract and report an error if so.
11122
11123         * expression.cs (IndexerAccess.DoResolveLValue,
11124         IndexerAccess.DoResolve): ditto. 
11125
11126         (Invocation.DoResolve): ditto.
11127
11128         (Invocation.FullMethodDesc): Improve the report string.
11129
11130         * statement.cs (Block): Eliminate IsVariableDefined as it is
11131         basically just a wrapper for GetVariableInfo.
11132
11133         * ecore.cs (SimpleName): Use new 
11134
11135         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11136         type, as we return the actual parameter ref/unref state on a
11137         different call.
11138
11139 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11140
11141         * support.cs: Return proper flags REF/OUT fixing the previous
11142         commit.  
11143
11144         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11145         not used to mean `ref' but `ref or out' in ParameterReference
11146
11147         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11148         full type signature instead of calling TypeManger.CSharpName
11149         ourselves. 
11150
11151         * support.cs (InternalParameters.ParameterDesc): Do not compare
11152         directly to the modflags, because REF/OUT will actually be bitsets
11153         if set. 
11154
11155         * delegate.cs (VerifyMethod): Check also the modifiers.
11156
11157         * cs-tokenizer.cs: Fix bug where floating point values with an
11158         exponent where a sign was missing was ignored.
11159
11160         * driver.cs: Allow multiple assemblies to be specified in a single
11161         /r: argument
11162
11163 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11166         because identifiers after a parenthesis would end up in this kind
11167         of production, and we needed to desamiguate it for having casts
11168         like:
11169
11170                 (UserDefinedType *) xxx
11171
11172 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11173
11174         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11175         we should set on the Bindingflags.NonPublic, but not turn on
11176         private_ok.  private_ok controls whether a Private member is
11177         returned (this is chekced on the filter routine), while the
11178         BindingFlags.NonPublic just controls whether private/protected
11179         will be allowed.   This fixes the problem part of the problem of
11180         private properties being allowed to be used in derived classes.
11181
11182         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11183         so we can call the children DoResolveLValue method (this will
11184         properly signal errors on lvalue assignments to base properties)
11185
11186         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11187         getter are null, and we have a property info, we know that this
11188         happened because the lookup failed, so we report an error 122 for
11189         protection level violation.
11190
11191         We also silently return if setter and getter are null in the
11192         resolve functions, this condition only happens if we have flagged
11193         the error before.  This is the other half of the problem. 
11194
11195         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11196         not have accessibility information, that is why we were returning
11197         true in the filter function in typemanager.cs.
11198
11199         To properly report 122 (property is inaccessible because of its
11200         protection level) correctly, we report this error in ResolveAccess
11201         by failing if both the setter and the getter are lacking (ie, the
11202         lookup failed). 
11203
11204         DoResolve and DoLResolve have been modified to check for both
11205         setter/getter being null and returning silently, the reason being
11206         that I did not want to put the knowledge about this error in upper
11207         layers, like:
11208
11209         int old = Report.Errors;
11210         x = new PropertyExpr (...);
11211         if (old != Report.Errors)
11212                 return null;
11213         else
11214                 return x;
11215
11216         So the property expr is returned, but it is invalid, so the error
11217         will be flagged during the resolve process. 
11218
11219         * class.cs: Remove InheritablePropertySignatureCompare from the
11220         class, as we no longer depend on the property signature to compute
11221         whether it is possible to implement a method or not.
11222
11223         The reason is that calling PropertyInfo.GetGetMethod will return
11224         null (in .NET, in Mono it works, and we should change this), in
11225         cases where the Get Method does not exist in that particular
11226         class.
11227
11228         So this code:
11229
11230         class X { public virtual int A { get { return 1; } } }
11231         class Y : X { }
11232         class Z : Y { public override int A { get { return 2; } } }
11233
11234         Would fail in Z because the parent (Y) would not have the property
11235         defined.  So we avoid this completely now (because the alternative
11236         fix was ugly and slow), and we now depend exclusively on the
11237         method names.
11238
11239         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11240         reference method, instead of using the property.
11241
11242         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11243         routines are gone now.
11244
11245         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11246         names, they were incorrectly named.
11247
11248         * cs-tokenizer.cs: Return are more gentle token on failure. 
11249
11250         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11251         had an out-of-sync index variable, which caused it to remove from
11252         the list of pending methods the wrong method sometimes.
11253
11254 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11255
11256         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11257         CanWrite, because those refer to this particular instance of the
11258         property, and do not take into account the fact that we can
11259         override single members of a property.
11260
11261         Constructor requires an EmitContext.  The resolution process does
11262         not happen here, but we need to compute the accessors before,
11263         because the resolution does not always happen for properties.
11264
11265         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11266         subclass, before we did not update this flag, but we did update
11267         bindingflags. 
11268
11269         (GetAccessors): Drop this routine, as it did not work in the
11270         presence of partially overwritten set/get methods. 
11271
11272         Notice that this broke the cs1540 detection, but that will require
11273         more thinking. 
11274
11275 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11276
11277         * class.cs:
11278         * codegen.cs:
11279         * driver.cs: issue a warning instead of an error if we don't support
11280         debugging for the platform. Also ignore a couple of errors that may
11281         arise when trying to write the symbols. Undo my previous patch.
11282
11283 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11284
11285         * driver.cs: ignore /debug switch except for Unix platforms.
11286
11287 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11288
11289         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11290
11291 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11292
11293         * driver.cs: Do not make mcs-debug conditional, so we do not break
11294         builds that use it.
11295
11296         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11297         review this patch.  But basically after all the children variables
11298         have been merged, the value of "Breaks" was not being set to
11299         new_breaks for Switch blocks.  I think that it should be set after
11300         it has executed.  Currently I set this to the value of new_breaks,
11301         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11302         conservative, but I do not understand this code very well.
11303
11304         I did not break anything in the build, so that is good ;-)
11305
11306         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11307
11308 2002-10-20  Mark Crichton  <crichton@gimp.org>
11309
11310         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11311
11312 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11313
11314         * cfold.cs: Fixed compile blocker.
11315
11316 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11317
11318         * driver.cs: I was chekcing the key, not the file.
11319
11320 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11321
11322         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11323         message that we were generating - we just need to silently return
11324         a null.
11325
11326 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11327
11328         * class.cs (Event.Define): Change my previous commit, as this
11329         breaks the debugger.  This is a temporary hack, as it seems like
11330         the compiler is generating events incorrectly to begin with.
11331
11332         * expression.cs (Binary.ResolveOperator): Added support for 
11333         "U operator - (E x, E y)"
11334
11335         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11336         y)".
11337
11338         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11339         init-only variables, but this path did not take into account that
11340         there might be also instance readonly variables.  Correct this
11341         problem. 
11342
11343         This fixes bug 32253
11344
11345         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11346         delegates as well.
11347
11348         * driver.cs: Change the extension for modules to `netmodule'
11349
11350         * cs-parser.jay: Improved slightly the location tracking for
11351         the debugger symbols.
11352
11353         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11354         modifiers that were specified instead of the hardcoded value
11355         (FamAndAssem).  This was basically ignoring the static modifier,
11356         and others.  Fixes 32429.
11357
11358         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11359         fixed a bug in the process (32476)
11360
11361         * expression.cs (ArrayAccess.EmitAssign): Patch from
11362         hwang_rob@yahoo.ca that fixes bug 31834.3
11363
11364 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11365
11366         * driver.cs: Make the module extension .netmodule.
11367
11368 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11369
11370         * driver.cs: Report an error if the resource file is not found
11371         instead of crashing.
11372
11373         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11374         false, like Emit does.
11375
11376 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11377
11378         * typemanager.cs: Remove unused private member.  Also reported mcs
11379         bug to report this as a warning like csc.
11380
11381 2002-10-15  Martin Baulig  <martin@gnome.org>
11382
11383         * statement.cs (Statement.Emit): Made this a virtual method; emits
11384         the line number info and calls DoEmit().
11385         (Statement.DoEmit): New protected abstract method, formerly knows
11386         as Statement.Emit().
11387
11388         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11389
11390 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11391
11392         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11393         have fixed a remaining problem: not every AddXXXX was adding a
11394         fully qualified name.  
11395
11396         Now everyone registers a fully qualified name in the DeclSpace as
11397         being defined instead of the partial name.  
11398
11399         Downsides: we are slower than we need to be due to the excess
11400         copies and the names being registered this way.  
11401
11402         The reason for this is that we currently depend (on the corlib
11403         bootstrap for instance) that types are fully qualified, because
11404         we dump all the types in the namespace, and we should really have
11405         types inserted into the proper namespace, so we can only store the
11406         basenames in the defined_names array.
11407
11408 2002-10-10  Martin Baulig  <martin@gnome.org>
11409
11410         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11411         from bug #31834, see the bug report for a testcase which is
11412         miscompiled.
11413
11414 2002-10-10  Martin Baulig  <martin@gnome.org>
11415
11416         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11417         flow analysis code for this.
11418
11419         * statement.cs (Do, While, For): Tell the flow analysis code about
11420         infinite loops.
11421         (FlowBranching.UsageVector): Added support for infinite loops.
11422         (Block.Resolve): Moved the dead code elimination here and use flow
11423         analysis to do it.
11424
11425 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11426
11427         * class.cs (Field.Define): Catch cycles on struct type
11428         definitions. 
11429
11430         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11431         fields if the fields are static.  We only need to check instance
11432         fields. 
11433
11434         * expression.cs (As.DoResolve): Test for reference type.
11435
11436         * statement.cs (Using.ResolveExpression): Use
11437         ConvertImplicitRequired, not ConvertImplicit which reports an
11438         error on failture
11439         (Using.ResolveLocalVariableDecls): ditto.
11440
11441         * expression.cs (Binary.ResolveOperator): Report errors in a few
11442         places where we had to.
11443
11444         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11445
11446 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11447
11448         * expression.cs: Use StoreFromPtr instead of extracting the type
11449         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11450
11451         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11452         an enumeration value to a System.Enum, but System.Enum is not a
11453         value type, but an class type, so we need to box.
11454
11455         (Expression.ConvertExplicit): One codepath could return
11456         errors but not flag them.  Fix this.  Fixes #31853
11457
11458         * parameter.cs (Resolve): Do not allow void as a parameter type.
11459
11460 2002-10-06  Martin Baulig  <martin@gnome.org>
11461
11462         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11463         if it's a class type and not a struct.  Fixes #31815.
11464
11465 2002-10-06  Martin Baulig  <martin@gnome.org>
11466
11467         * statement.cs: Reworked the flow analysis code a bit to make it
11468         usable for dead code elimination.
11469
11470 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11471
11472         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11473
11474 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11475
11476         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11477         to fix the test 165, will investigate deeper.
11478
11479 2002-10-04  Martin Baulig  <martin@gnome.org>
11480
11481         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11482         finally blocks actually work.
11483         (Try.Resolve): We don't need to create a sibling for `finally' if
11484         there is no finally block.
11485
11486 2002-10-04  Martin Baulig  <martin@gnome.org>
11487
11488         * class.cs (Constructor.Define): The default accessibility for a
11489         non-default constructor is private, not public.
11490
11491 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11492
11493         * class.cs (Constructor): Make AllowedModifiers public, add
11494         EXTERN.
11495
11496         * cs-parser.jay: Perform the modifiers test here, as the
11497         constructor for the Constructor class usually receives a zero
11498         because of the way we create it (first we create, later we
11499         customize, and we were never checking the modifiers).
11500
11501         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11502         is a version of LookupTypeReflection that includes the type-name
11503         cache.  This can be used as a fast path for functions that know
11504         the fully qualified name and are only calling into *.GetType() to
11505         obtain a composed type.
11506
11507         This is also used by TypeManager.LookupType during its type
11508         composition.
11509
11510         (LookupType): We now also track the real type name, as sometimes
11511         we can get a quey for the real type name from things like
11512         ComposedCast.  This fixes bug 31422.
11513
11514         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11515         complete type fullname, it does not have to go through the type
11516         resolution system to obtain the composed version of the type (for
11517         obtaining arrays or pointers).
11518
11519         (Conditional.Emit): Use the EmitBoolExpression to
11520         generate nicer code, as requested by Paolo.
11521
11522         (ArrayCreation.CheckIndices): Use the patch from
11523         hwang_rob@yahoo.ca to validate the array initializers. 
11524
11525 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11526
11527         * class.cs (ConstructorInitializer.Emit): simplify code by using
11528         Invocation.EmitCall, and at the same time, fix the bugs in calling
11529         parent constructors that took variable arguments. 
11530
11531         * ecore.cs (Expression.ConvertNumericExplicit,
11532         Expression.ImplicitNumericConversion): Remove the code that
11533         manually wrapped decimal (InternalTypeConstructor call is now gone
11534         as well).
11535
11536         * expression.cs (Cast.TryReduce): Also handle decimal types when
11537         trying to perform a constant fold on the type.
11538
11539         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11540
11541         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11542         that only turned off an error report, and did nothing else. 
11543
11544 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11545
11546         * driver.cs: Handle and ignore /fullpaths
11547
11548 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11549
11550         * expression.cs (Binary.ResolveOperator): Catch the case where
11551         DoNumericPromotions returns true, 
11552
11553         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11554
11555 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11556
11557         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11558         report error 70.
11559
11560 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11561
11562         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11563         conversion exists, but it is also required that the conversion be
11564         performed.  This manifested in "(Type64Enum) 2".  
11565
11566         * class.cs (TypeManager.AddMethod): The fix is not to change
11567         AddEnum, because that one was using a fully qualified name (every
11568         DeclSpace derivative does), but to change the AddMethod routine
11569         that was using an un-namespaced name.  This now correctly reports
11570         the duplicated name.
11571
11572         Revert patch until I can properly fix it.  The issue
11573         is that we have a shared Type space across all namespaces
11574         currently, which is wrong.
11575
11576         Options include making the Namespace a DeclSpace, and merge
11577         current_namespace/current_container in the parser.
11578
11579 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11580
11581         * cs-parser.jay: Improve error reporting when we get a different
11582         kind of expression in local_variable_type and
11583         local_variable_pointer_type. 
11584
11585         Propagate this to avoid missleading errors being reported.
11586
11587         * ecore.cs (ImplicitReferenceConversion): treat
11588         TypeManager.value_type as a target just like object_type.   As
11589         code like this:
11590
11591         ValueType v = 1;
11592
11593         Is valid, and needs to result in the int 1 being boxed before it
11594         is assigned to the value type v.
11595
11596         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11597         to validate the enumeration name.
11598
11599         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11600         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11601         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11602
11603         * ecore.cs (TryImplicitIntConversion): When doing an
11604         implicit-enumeration-conversion, check if the type is 64-bits and
11605         perform a conversion before passing to EnumConstant.
11606
11607 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11608
11609         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11610         report ambiguous type references.  Unlike the MS version, we
11611         report what the ambiguity is.   Innovation at work ;-)
11612
11613         (DeclSpace.FindType): Require a location argument to
11614         display when we display an ambiguous error.
11615
11616         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11617
11618         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11619
11620         * expression.cs (EmitDynamicInitializers): Apply patch from
11621         hwang_rob@yahoo.ca that fixes the order in which we emit our
11622         initializers. 
11623
11624 2002-09-21  Martin Baulig  <martin@gnome.org>
11625
11626         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11627         delegate takes no arguments.
11628
11629 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11630
11631         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11632         from integers.
11633
11634         * expression.cs: Extract the underlying type.
11635
11636         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11637
11638         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11639
11640 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * class.cs (TypeContainer.DefineType): We can not use the nice
11643         PackingSize with the size set to 1 DefineType method, because it
11644         will not allow us to define the interfaces that the struct
11645         implements.
11646
11647         This completes the fixing of bug 27287
11648
11649         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11650         means also structs.  This fixes part of the problem. 
11651         (Expresion.ImplicitReferenceConversionExists): ditto.
11652
11653         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11654         error if there were no errors reported during the type lookup
11655         process, to avoid duplicates or redundant errors.  Without this
11656         you would get an ambiguous errors plus a type not found.  We have
11657         beaten the user enough with the first error.  
11658
11659         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11660         reference. 
11661
11662         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11663         during the resolution process, stop the lookup, this avoids
11664         repeated error reports (same error twice).
11665
11666         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11667
11668         * typemanager.cs (LookupType): Redo the type lookup code to match
11669         the needs of System.Reflection.  
11670
11671         The issue is that System.Reflection requires references to nested
11672         types to begin with a "+" sign instead of a dot.  So toplevel
11673         types look like: "NameSpace.TopLevelClass", and nested ones look
11674         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11675         levels. 
11676
11677 2002-09-19  Martin Baulig  <martin@gnome.org>
11678
11679         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11680         says that a method always returns or always throws an exception,
11681         don't report the CS0161.
11682
11683         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11684         set `Returns = new_returns'.
11685
11686 2002-09-19  Martin Baulig  <martin@gnome.org>
11687
11688         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11689         to an enum constant, check for a CS0176.
11690
11691 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11692
11693         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11694         for operators that must be in pairs and report errors.
11695
11696         * ecore.cs (SimpleName.DoResolveType): During the initial type
11697         resolution process, when we define types recursively, we must
11698         check first for types in our current scope before we perform
11699         lookups in the enclosing scopes.
11700
11701         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11702
11703         (Invocation.VerifyArgumentsCompat): Call
11704         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11705         I thought we were supposed to always call this, but there are a
11706         few places in the code where we dont do it.
11707
11708 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11709
11710         * driver.cs: Add support in -linkres and -resource to specify the
11711         name of the identifier.
11712
11713 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11714
11715         * ecore.cs (StandardConversionExists): Sync with the conversion
11716         code: allow anything-* to void* conversions.
11717
11718         (FindMostSpecificSource): Use an Expression argument
11719         instead of a Type, because we might be handed over a Literal which
11720         gets a few more implicit conversions that plain types do not.  So
11721         this information was being lost.
11722
11723         Also, we drop the temporary type-holder expression when not
11724         required.
11725
11726 2002-09-17  Martin Baulig  <martin@gnome.org>
11727
11728         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11729         this is an explicit interface implementation.
11730
11731 2002-09-17  Martin Baulig  <martin@gnome.org>
11732
11733         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11734         different `IndexerName' attributes.
11735
11736         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11737         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11738         virtual CommonResolve().
11739
11740 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11741
11742         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11743         and convert that to the UnderlyingType.
11744
11745         * statement.cs (Foreach.Resolve): Indexers are just like variables
11746         or PropertyAccesses.
11747
11748         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11749         inside quoted strings, we were not doing this before.
11750
11751 2002-09-16  Martin Baulig  <martin@gnome.org>
11752
11753         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11754         resolve it.  This is needed for the definite assignment check of the
11755         instance expression, fixes bug #29846.
11756         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11757
11758 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11759
11760         * parameter.cs: Fix compile error.  Cannot reference static member
11761         from an instance object.  Is this an mcs bug?
11762
11763 2002-09-14  Martin Baulig  <martin@gnome.org>
11764
11765         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11766         multiple times.  Fixes bug #30295, added test-166.cs.
11767
11768 2002-09-14  Martin Baulig  <martin@gnome.org>
11769
11770         * statement.cs (Block.Emit): Don't emit unreachable code.
11771         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11772         `break' statements.
11773         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11774
11775 2002-09-14  Martin Baulig  <martin@gnome.org>
11776
11777         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11778         is set.
11779
11780 2002-09-14  Martin Baulig  <martin@gnome.org>
11781
11782         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11783         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11784         be false on the ms runtime.
11785
11786 2002-09-13  Martin Baulig  <martin@gnome.org>
11787
11788         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11789         the CS0038 error message.
11790
11791 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11794         constant inside, return it.
11795
11796 2002-09-12  Martin Baulig  <martin@gnome.org>
11797
11798         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11799         implicit conversion can be done between enum types.
11800
11801         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11802         check whether an implicit conversion to the current enum's UnderlyingType
11803         exists and report an error if not.
11804
11805         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11806         without debugging support.
11807
11808         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11809         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11810
11811 2002-09-12  Martin Baulig  <martin@gnome.org>
11812
11813         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11814
11815         * ecore.cs (IMemberExpr.DeclaringType): New property.
11816         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11817         nonstatic member of an outer type (CS0038).
11818
11819 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11820
11821         * driver.cs: Activate the using-error detector at warning level
11822         4 (at least for MS-compatible APIs).
11823
11824         * namespace.cs (VerifyUsing): Small buglett fix.
11825
11826         * pending.cs (PendingImplementation): pass the container pointer. 
11827
11828         * interface.cs (GetMethods): Allow for recursive definition.  Long
11829         term, I would like to move every type to support recursive
11830         definitions, not the current ordering mechanism that we have right
11831         now.
11832
11833         The situation is this: Attributes are handled before interfaces,
11834         so we can apply attributes to interfaces.  But some attributes
11835         implement interfaces, we will now handle the simple cases
11836         (recursive definitions will just get an error).  
11837
11838         * parameter.cs: Only invalidate types at the end if we fail to
11839         lookup all types.  
11840
11841 2002-09-09  Martin Baulig  <martin@gnome.org>
11842
11843         * ecore.cs (PropertyExpr.Emit): Also check for
11844         TypeManager.system_int_array_get_length so this'll also work when
11845         compiling corlib.  Fixes #30003.
11846
11847 2002-09-09  Martin Baulig  <martin@gnome.org>
11848
11849         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11850         and throw an exception if we can't get the type's size.  Fixed #30040,
11851         added test-165.cs.
11852
11853 2002-09-09  Martin Baulig  <martin@gnome.org>
11854
11855         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11856
11857         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11858         context.  Fixes bug #30027.
11859
11860         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11861         virtual functions.  Fixes bug #30043, added test-164.cs.
11862
11863 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11864
11865         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11866
11867 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11868
11869         * driver.cs: Use an object to get the windows codepage since it's not a
11870         static property.
11871
11872 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11873
11874         * statement.cs (For.Emit): for infinite loops (test == null)
11875         return whether there is a break inside, not always "true".
11876
11877         * namespace.cs (UsingEntry): New struct to hold the name of the
11878         using definition, the location where it is defined, and whether it
11879         has been used in a successful type lookup.
11880
11881         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11882         strings.
11883
11884         * decl.cs: ditto.
11885
11886 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11887
11888         * attribute.cs : Fix incorrect code which relied on catching
11889         a NullReferenceException to detect a null being passed in
11890         where an object was expected.
11891
11892 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * statement.cs (Try): flag the catch variable as assigned
11895
11896         * expression.cs (Cast): Simplified by using ResolveType instead of
11897         manually resolving.
11898
11899         * statement.cs (Catch): Fix bug by using ResolveType.
11900
11901 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11902
11903         * expression.cs (BetterConversion): Special case for when we have
11904         a NullLiteral as the argument and we have to choose between string
11905         and object types - we choose string the way csc does.
11906
11907         * attribute.cs (Attribute.Resolve): Catch the
11908         NullReferenceException and report error #182 since the Mono
11909         runtime no more has the bug and having this exception raised means
11910         we tried to select a constructor which takes an object and is
11911         passed a null.
11912
11913 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11914
11915         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11916         message (1502, 1503) when we can't locate a method after overload
11917         resolution. This is much more informative and closes the bug
11918         Miguel reported.
11919
11920         * interface.cs (PopulateMethod): Return if there are no argument
11921         types. Fixes a NullReferenceException bug.
11922
11923         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11924         expressions too. Previously we were checking only in one place for
11925         positional arguments leaving out named arguments.
11926
11927         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11928         type to the enum type is not allowed. Remove code corresponding to
11929         that.
11930
11931         (ConvertNumericExplicit): Allow explicit conversions from
11932         the underlying type to enum type. This precisely follows the spec
11933         and closes a bug filed by Gonzalo.
11934
11935 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11936
11937         * compiler.csproj:
11938         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11939
11940 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11943         it was important that we stored the right value after the
11944         reduction in `converted'.
11945
11946 2002-09-04  Martin Baulig  <martin@gnome.org>
11947
11948         * location.cs (Location.SymbolDocument): Use full pathnames for the
11949         source files.
11950
11951 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11952
11953         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11954         of the expression resolve mechanism, because that will catch the
11955         SimpleName error failures.
11956
11957         (Conditional): If we can not resolve the
11958         expression, return, do not crash.
11959
11960 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11961
11962         * cs-tokenizer.cs:
11963         (location): display token name instead of its number.
11964
11965 2002-08-28  Martin Baulig  <martin@gnome.org>
11966
11967         * expression.cs (Binary.ResolveOperator): Don't silently return
11968         but return an error if an operator cannot be applied between two
11969         enum types.
11970
11971 2002-08-28  Martin Baulig  <martin@gnome.org>
11972
11973         * class.cs (Constructor.Define): Set the permission attributes
11974         correctly instead of making all constructors public.
11975
11976 2002-08-28  Martin Baulig  <martin@gnome.org>
11977
11978         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11979         for private members before reporting a CS0103; if we find anything,
11980         it's a CS0122.
11981
11982 2002-08-28  Martin Baulig  <martin@gnome.org>
11983
11984         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11985         to check whether `closure_start_type == closure_invocation_type',
11986         we also need to check whether `m.DeclaringType == closure_invocation_type'
11987         before bypassing the permission checks.  We might be accessing
11988         protected/private members from the base class.
11989         (TypeManager.RealMemberLookup): Only set private_ok if private
11990         members were requested via BindingFlags.NonPublic.
11991
11992         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11993
11994         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11995         MethodGroupExpr.IsExplicitImpl if appropriate.
11996         (Invocation.DoResolve): Don't report the CS0120 for explicit
11997         interface implementations.
11998
11999 2002-08-27  Martin Baulig  <martin@gnome.org>
12000
12001         * expression.cs (Invocation.DoResolve): If this is a static
12002         method and we don't have an InstanceExpression, we must report
12003         a CS0120.
12004
12005 2002-08-25  Martin Baulig  <martin@gnome.org>
12006
12007         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12008         `==' between a valuetype and an object.
12009
12010 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12011
12012         * ecore.cs (TypeExpr): Provide a ToString method.
12013
12014 2002-08-24  Martin Baulig  <martin@gnome.org>
12015
12016         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12017         now called proggie.dbg and it's a binary file.
12018
12019 2002-08-23  Martin Baulig  <martin@gnome.org>
12020
12021         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12022
12023 2002-08-23  Martin Baulig  <martin@gnome.org>
12024
12025         * struct.cs (MyStructInfo.ctor): Make this work with empty
12026         structs; it's not allowed to use foreach() on null.
12027
12028 2002-08-23  Martin Baulig  <martin@gnome.org>
12029
12030         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12031         writer the full pathname of the generated assembly.
12032
12033 2002-08-23  Martin Baulig  <martin@gnome.org>
12034
12035         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12036         A `finally' block never returns or breaks; improved handling of
12037         unreachable code.
12038
12039 2002-08-23  Martin Baulig  <martin@gnome.org>
12040
12041         * statement.cs (Throw.Resolve): Allow `throw null'.
12042
12043 2002-08-23  Martin Baulig  <martin@gnome.org>
12044
12045         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12046         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12047         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12048         MemberLookup would return a wrong event if this is an explicit
12049         interface implementation and the class has an event with the same
12050         name.
12051
12052 2002-08-23  Martin Baulig  <martin@gnome.org>
12053
12054         * statement.cs (Block.AddChildVariableNames): New public method.
12055         (Block.AddChildVariableName): Likewise.
12056         (Block.IsVariableNameUsedInChildBlock): Likewise.
12057         (Block.AddVariable): Check whether a variable name has already
12058         been used in a child block.
12059
12060         * cs-parser.jay (declare_local_variables): Mark all variable names
12061         from the current block as being used in a child block in the
12062         implicit block.
12063
12064 2002-08-23  Martin Baulig  <martin@gnome.org>
12065
12066         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12067         find the symbol writer.
12068
12069         * driver.cs: csc also allows the arguments to /define being
12070         separated by commas, not only by semicolons.
12071
12072 2002-08-23  Martin Baulig  <martin@gnome.org>
12073
12074         * interface.cs (Interface.GetMembers): Added static check for events.
12075
12076 2002-08-15  Martin Baulig  <martin@gnome.org>
12077
12078         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12079         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12080
12081         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12082         why the MethodData.EmitDestructor() change was necessary.
12083
12084 2002-08-20  Martin Baulig  <martin@gnome.org>
12085
12086         * class.cs (TypeContainer.FindMembers): Added static check for events.
12087
12088         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12089
12090         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12091         use Type.GetEvents(), not Type.FindMembers().
12092
12093 2002-08-20  Martin Baulig  <martin@gnome.org>
12094
12095         * decl.cs (MemberCache): Added a special method cache which will
12096         be used for method-only searched.  This ensures that a method
12097         search will return a MethodInfo with the correct ReflectedType for
12098         inherited methods.      
12099
12100 2002-08-20  Martin Baulig  <martin@gnome.org>
12101
12102         * decl.cs (DeclSpace.FindMembers): Made this public.
12103
12104 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12105
12106         * delegate.cs: fixed build on windows.
12107         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12108
12109 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12110
12111         * ecore.cs (StandardConversionExists): Return a false
12112         if we are trying to convert the void type to anything else
12113         since that is not allowed.
12114
12115         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12116         we flag error 70 in the event an event is trying to be accessed
12117         directly from outside the declaring type.
12118
12119 2002-08-20  Martin Baulig  <martin@gnome.org>
12120
12121         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12122         MemberCache from typemanager.cs to decl.cs.
12123
12124 2002-08-19  Martin Baulig  <martin@gnome.org>
12125
12126         * class.cs (TypeContainer): Implement IMemberContainer.
12127         (TypeContainer.DefineMembers): Create the MemberCache.
12128         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12129         return public members if BindingFlags.Public was given, check
12130         whether members are static.
12131
12132 2002-08-16  Martin Baulig  <martin@gnome.org>
12133
12134         * decl.cs (DeclSpace.Define): Splitted this in Define and
12135         DefineMembers.  DefineMembers is called first and initializes the
12136         MemberCache.
12137
12138         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12139         DefineMembers() on all our DeclSpaces.
12140
12141         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12142         but call DefineMembers() on all nested interfaces.  We call their
12143         Define() in our new Define() function.
12144
12145         * interface.cs (Interface): Implement IMemberContainer.
12146         (Interface.Define): Moved all code except the attribute stuf to
12147         DefineMembers().
12148         (Interface.DefineMembers): Initialize the member cache.
12149
12150         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12151         need this anymore since we can use MemberCache.FindMembers directly.
12152
12153 2002-08-19  Martin Baulig  <martin@gnome.org>
12154
12155         * typemanager.cs (MemberCache): When creating the cache for an
12156         interface type, add all inherited members.
12157         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12158         to `out bool used_cache' and documented it.
12159         (TypeManager.MemberLookup): If we already used the cache in the first
12160         iteration, we don't need to do the interfaces check.
12161
12162 2002-08-19  Martin Baulig  <martin@gnome.org>
12163
12164         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12165         here from IMemberFinder and don't implement this interface anymore.
12166         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12167
12168         * typemanager.cs (IMemberFinder): This interface is now only used by
12169         classes which actually support the member cache.
12170         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12171         since we only put DeclSpaces into this Hashtable.
12172         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12173         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12174
12175 2002-08-16  Martin Baulig  <martin@gnome.org>
12176
12177         * typemanager.cs (ICachingMemberFinder): Removed.
12178         (IMemberFinder.MemberCache): New property.
12179         (TypeManager.FindMembers): Merged this with RealFindMembers().
12180         This function will never be called from TypeManager.MemberLookup()
12181         so we can't use the cache here, just the IMemberFinder.
12182         (TypeManager.MemberLookup_FindMembers): Check whether the
12183         IMemberFinder has a MemberCache and call the cache's FindMembers
12184         function.
12185         (MemberCache): Rewrote larger parts of this yet another time and
12186         cleaned it up a bit.
12187
12188 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12189
12190         * driver.cs (LoadArgs): Support quoting.
12191
12192         (Usage): Show the CSC-like command line arguments.
12193
12194         Improved a few error messages.
12195
12196 2002-08-15  Martin Baulig  <martin@gnome.org>
12197
12198         * typemanager.cs (IMemberContainer.Type): New property.
12199         (IMemberContainer.IsInterface): New property.
12200
12201         The following changes are conditional to BROKEN_RUNTIME, which is
12202         defined at the top of the file.
12203
12204         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12205         class'es members, but add all members from TypeHandle.ObjectType
12206         if we're an interface.
12207         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12208         is the current type.
12209         (MemberCache.CacheEntry.Container): Removed this field.
12210         (TypeHandle.GetMembers): Include inherited members.
12211
12212 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12213
12214         * typemanager.cs: fixed compilation and added a comment on a field that
12215         is never used.
12216
12217 2002-08-15  Martin Baulig  <martin@gnome.org>
12218
12219         * class.cs (ConstructorInitializer.Resolve): In the
12220         Expression.MemberLookup call, use the queried_type as
12221         invocation_type.
12222
12223         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12224         declared' attribute, it's always true.
12225         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12226         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12227         temporary wrapper for FindMembers which tells MemberLookup whether
12228         members from the base classes are included in the return value.
12229         This will go away soon.
12230         (TypeManager.MemberLookup): Use this temporary hack here; once the
12231         new MemberCache is completed, we don't need to do the DeclaredOnly
12232         looping here anymore since the MemberCache will take care of this.
12233         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12234         (MemberCache): When creating the MemberCache for a class, get
12235         members from the current class and all its base classes.
12236         (MemberCache.CacheEntry.Container): New field.  This is a
12237         temporary hack until the Mono runtime is fixed to distinguish
12238         between ReflectedType and DeclaringType.  It allows us to use MCS
12239         with both the MS runtime and the unfixed Mono runtime without
12240         problems and without accecting performance.
12241         (MemberCache.SearchMembers): The DeclaredOnly looping from
12242         TypeManager.MemberLookup is now done here.      
12243
12244 2002-08-14  Martin Baulig  <martin@gnome.org>
12245
12246         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12247         Type.GetFields on dynamic types but get the fields from the
12248         corresponding TypeContainer.
12249         (MyStructInfo.GetStructInfo): Added check for enum types.
12250
12251         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12252         (MemberList.SyncRoot): Implemented.
12253         (TypeManager.FilterWithClosure): No need to check permissions if
12254         closure_start_type == closure_invocation_type, don't crash if
12255         closure_invocation_type is null.
12256
12257 2002-08-13  Martin Baulig  <martin@gnome.org>
12258
12259         Rewrote TypeContainer.FindMembers to use a member cache.  This
12260         gives us a speed increase of about 35% for the self-hosting MCS
12261         build and of about 15-20% for the class libs (both on GNU/Linux).
12262
12263         * report.cs (Timer): New class to get enhanced profiling.  This
12264         whole class is "TIMER" conditional since it remarkably slows down
12265         compilation speed.
12266
12267         * class.cs (MemberList): New class.  This is an IList wrapper
12268         which we're now using instead of passing MemberInfo[]'s around to
12269         avoid copying this array unnecessarily.
12270         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12271         (ICachingMemberFinder, IMemberContainer): New interface.
12272         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12273         has already been checked, otherwise use it for the name comparision.
12274         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12275         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12276         if possible.  Returns a MemberList, not a MemberInfo [].
12277         (TypeHandle): New class, implements IMemberContainer.  We create
12278         one instance of this class per type, it contains a MemberCache
12279         which is used to do the member lookups.
12280         (MemberCache): New class.  Each instance of this class contains
12281         all members of a type and a name-based hash table.
12282         (MemberCache.FindMembers): This is our new member lookup
12283         function.  First, it looks up all members of the requested name in
12284         the hash table.  Then, it walks this list and sorts out all
12285         applicable members and returns them.
12286
12287 2002-08-13  Martin Baulig  <martin@gnome.org>
12288
12289         In addition to a nice code cleanup, this gives us a performance
12290         increase of about 1.4% on GNU/Linux - not much, but it's already
12291         half a second for the self-hosting MCS compilation.
12292
12293         * typemanager.cs (IMemberFinder): New interface.  It is used by
12294         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12295         Enum, Delegate or Interface.
12296         (TypeManager.finder_to_member_finder): New PtrHashtable.
12297         (TypeManager.finder_to_container): Removed.
12298         (TypeManager.finder_to_delegate): Removed.
12299         (TypeManager.finder_to_interface): Removed.
12300         (TypeManager.finder_to_enum): Removed.
12301
12302         * interface.cs (Interface): Implement IMemberFinder.
12303
12304         * delegate.cs (Delegate): Implement IMemberFinder.
12305
12306         * enum.cs (Enum): Implement IMemberFinder.
12307
12308         * class.cs (TypeContainer): Implement IMemberFinder.
12309
12310 2002-08-12  Martin Baulig  <martin@gnome.org>
12311
12312         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12313
12314 2002-08-12  Martin Baulig  <martin@gnome.org>
12315
12316         * ecore.cs (ITypeExpression): New interface for expressions which
12317         resolve to a type.
12318         (TypeExpression): Renamed to TypeLookupExpression.
12319         (Expression.DoResolve): If we're doing a types-only lookup, the
12320         expression must implement the ITypeExpression interface and we
12321         call DoResolveType() on it.
12322         (SimpleName): Implement the new ITypeExpression interface.
12323         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12324         hack, the situation that we're only looking up types can't happen
12325         anymore when this method is called.  Moved the type lookup code to
12326         DoResolveType() and call it.
12327         (SimpleName.DoResolveType): This ITypeExpression interface method
12328         is now doing the types-only lookup.
12329         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12330         (ResolveFlags): Added MaskExprClass.
12331
12332         * expression.cs (MemberAccess): Implement the ITypeExpression
12333         interface.
12334         (MemberAccess.DoResolve): Added support for a types-only lookup
12335         when we're called via ITypeExpression.DoResolveType().
12336         (ComposedCast): Implement the ITypeExpression interface.
12337
12338         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12339         Expression.Resolve() with ResolveFlags.Type instead.
12340
12341 2002-08-12  Martin Baulig  <martin@gnome.org>
12342
12343         * interface.cs (Interface.Define): Apply attributes.
12344
12345         * attribute.cs (Attribute.ApplyAttributes): Added support for
12346         interface attributes.
12347
12348 2002-08-11  Martin Baulig  <martin@gnome.org>
12349
12350         * statement.cs (Block.Emit): Only check the "this" variable if we
12351         do not always throw an exception.
12352
12353         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12354         whether the property has a set accessor.
12355
12356 2002-08-11  Martin Baulig  <martin@gnome.org>
12357
12358         Added control flow analysis support for structs.
12359
12360         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12361         with control flow analysis turned off.
12362         (IVariable): New interface.
12363         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12364         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12365         (FieldExpr.DoResolve): Resolve the instance expression with flow
12366         analysis turned off and do the definite assignment check after the
12367         resolving when we know what the expression will resolve to.
12368
12369         * expression.cs (LocalVariableReference, ParameterReference):
12370         Implement the new IVariable interface, only call the flow analysis
12371         code if ec.DoFlowAnalysis is true.
12372         (This): Added constructor which takes a Block argument.  Implement
12373         the new IVariable interface.
12374         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12375         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12376         This does the definite assignment checks for struct members.
12377
12378         * class.cs (Constructor.Emit): If this is a non-static `struct'
12379         constructor which doesn't have any initializer, call
12380         Block.AddThisVariable() to tell the flow analysis code that all
12381         struct elements must be initialized before control returns from
12382         the constructor.
12383
12384         * statement.cs (MyStructInfo): New public class.
12385         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12386         argument to this indexer.  If non-zero, check an individual struct
12387         member, not the whole struct.
12388         (FlowBranching.CheckOutParameters): Check struct members.
12389         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12390         overloaded versions of these methods which take an additional
12391         `int field_idx' argument to check struct members.
12392         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12393         overloaded versions of these methods which take an additional
12394         `string field_name' argument to check struct member.s
12395         (VariableInfo): Implement the IVariable interface.
12396         (VariableInfo.StructInfo): New public property.  Returns the
12397         MyStructInfo instance of the variable if it's a struct or null.
12398         (Block.AddThisVariable): New public method.  This is called from
12399         Constructor.Emit() for non-static `struct' constructor which do
12400         not have any initializer.  It creates a special variable for the
12401         "this" instance variable which will be checked by the flow
12402         analysis code to ensure that all of the struct's fields are
12403         initialized before control returns from the constructor.
12404         (UsageVector): Added support for struct members.  If a
12405         variable/parameter is a struct with N members, we reserve a slot
12406         in the usage vector for each member.  A struct is considered fully
12407         initialized if either the struct itself (slot 0) or all its
12408         members are initialized.
12409
12410 2002-08-08  Martin Baulig  <martin@gnome.org>
12411
12412         * driver.cs (Driver.MainDriver): Only report an error CS5001
12413         if there were no compilation errors.
12414
12415         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12416         `UnsafeContext' property to determine whether the parent is in
12417         unsafe context rather than checking the parent's ModFlags:
12418         classes nested in an unsafe class are unsafe as well.
12419
12420 2002-08-08  Martin Baulig  <martin@gnome.org>
12421
12422         * statement.cs (UsageVector.MergeChildren): Distinguish between
12423         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12424         we return.  Added test17() and test18() to test-154.cs.
12425
12426 2002-08-08  Martin Baulig  <martin@gnome.org>
12427
12428         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12429         Family access, make sure the invoking type isn't a subclass of the
12430         queried type (that'd be a CS1540).
12431
12432         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12433         this method which takes an additional `Type invocation_type'.
12434
12435         * expression.cs (BaseAccess.DoResolve): Use the base type as
12436         invocation and query type.
12437         (MemberAccess.DoResolve): If the lookup failed and we're about to
12438         report a CS0122, try a lookup with the ec.ContainerType - if this
12439         succeeds, we must report a CS1540.
12440
12441 2002-08-08  Martin Baulig  <martin@gnome.org>
12442
12443         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12444         (MethodGroupExpr): Implement the IMemberExpr interface.
12445
12446         * expression (MemberAccess.ResolveMemberAccess): No need to have
12447         any special code for MethodGroupExprs anymore, they're now
12448         IMemberExprs.   
12449
12450 2002-08-08  Martin Baulig  <martin@gnome.org>
12451
12452         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12453         Family, FamANDAssem and FamORAssem permissions.
12454         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12455
12456 2002-08-08  Martin Baulig  <martin@gnome.org>
12457
12458         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12459         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12460         or loop block.
12461
12462 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12463
12464         * driver.cs: implemented /resource option to embed managed resources.
12465
12466 2002-08-07  Martin Baulig  <martin@gnome.org>
12467
12468         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12469         (FieldBase.HasFieldInitializer): New public property.
12470         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12471         returns the field initializer and makes sure it is only resolved once.
12472         (TypeContainer.EmitFieldInitializers): Call
12473         FieldBase.GetInitializerExpression to get the initializer, this ensures
12474         that it isn't resolved multiple times.
12475
12476         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12477         the resolving process (SimpleName/MemberLookup) that we're currently
12478         emitting a field initializer (which must not access any instance members,
12479         this is an error CS0236).
12480
12481         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12482         argument, if the `IsFieldInitializer' flag is set, we must report and
12483         error CS0236 and not an error CS0120.   
12484
12485 2002-08-07  Martin Baulig  <martin@gnome.org>
12486
12487         * ecore.cs (IMemberExpr): New public interface.
12488         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12489         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12490         if the expression is an IMemberExpr.
12491
12492         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12493         to be null, implicitly default to `this' if we're non-static in
12494         this case.  Simplified the code a lot by using the new IMemberExpr
12495         interface.  Also fixed bug #28176 here.
12496
12497 2002-08-06  Martin Baulig  <martin@gnome.org>
12498
12499         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12500         ParameterReferences during semantic analysis so that we can do a
12501         type-only search when resolving Cast, TypeOf and SizeOf.
12502         (block): Pass the `current_local_parameters' to the Block's
12503         constructor.
12504
12505         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12506         argument to the constructor.
12507         (ConstructorInitializer.Resolve): Create a temporary implicit
12508         block with the parameters.
12509
12510         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12511         references here if we aren't doing a type-only search.
12512
12513         * statement.cs (Block): Added constructor which takes a
12514         `Parameters parameters' argument.
12515         (Block.Parameters): New public property.
12516
12517         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12518         to `Parameters' and made it public readonly.
12519
12520 2002-08-06  Martin Baulig  <martin@gnome.org>
12521
12522         * ecore.cs (Expression.Warning): Made this public as well.
12523
12524         * report.cs (Report.Debug): Print the contents of collections.
12525
12526 2002-08-06  Martin Baulig  <martin@gnome.org>
12527
12528         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12529         used to tell Resolve() which kinds of expressions it may return.
12530         (Expression.Resolve): Added overloaded version of this method which
12531         takes a `ResolveFlags flags' argument.  This can be used to tell
12532         Resolve() which kinds of expressions it may return.  Reports a
12533         CS0118 on error.
12534         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12535         ResolveFlags.SimpleName.
12536         (Expression.Error118): Added overloaded version of this method which
12537         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12538         which kinds of expressions are allowed.
12539
12540         * expression.cs (Argument.ResolveMethodGroup): New public method.
12541         Resolves an argument, but allows a MethodGroup to be returned.
12542         This is used when invoking a delegate.
12543
12544         * TODO: Updated a bit.
12545
12546 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12547
12548         Fixed compilation with csc.
12549
12550         * ecore.cs: Expression.Error made public. Is this correct? Should
12551         Warning be made public too?
12552
12553         * expression.cs: use ea.Location instead of ea.loc.
12554         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12555
12556 2002-08-06  Martin Baulig  <martin@gnome.org>
12557
12558         * ecore.cs (Expression.loc): Moved the location here instead of
12559         duplicating it in all derived classes.
12560         (Expression.Location): New public property.
12561         (Expression.Error, Expression.Warning): Made them non-static and
12562         removed the location argument.
12563         (Expression.Warning): Added overloaded version which takes an
12564         `int level' argument.
12565         (Expression.Error118): Make this non-static and removed the
12566         expression and location arguments.
12567         (TypeExpr): Added location argument to the constructor.
12568
12569         * expression.cs (StaticCallExpr): Added location argument to
12570         the constructor.
12571         (Indirection, PointerArithmetic): Likewise.
12572         (CheckedExpr, UnCheckedExpr): Likewise.
12573         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12574         (StringPtr): Likewise.
12575
12576
12577 2002-08-05  Martin Baulig  <martin@gnome.org>
12578
12579         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12580
12581         * assign.cs (Assign.DoResolve): Check whether the source
12582         expression is a value or variable.
12583
12584         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12585         while resolving the corresponding blocks.
12586
12587         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12588         an error, don't silently return null.
12589
12590         * statement.cs (Block.AddVariable): Do the error reporting here
12591         and distinguish between CS0128 and CS0136.
12592         (Block.DoResolve): Report all unused labels (warning CS0164).
12593         (LabeledStatement): Pass the location to the constructor.
12594         (LabeledStatement.HasBeenReferenced): New property.
12595         (LabeledStatement.Resolve): Set it to true here.
12596
12597         * statement.cs (Return.Emit): Return success even after reporting
12598         a type mismatch error (CS0126 or CS0127), this is what csc does and
12599         it avoids confusing the users with any consecutive errors.
12600
12601 2002-08-05  Martin Baulig  <martin@gnome.org>
12602
12603         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12604
12605         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12606
12607         * expression.cs (MemberAccess.DoResolve): Silently return if an
12608         error has already been reported.
12609
12610         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12611         error has already been reported.
12612
12613 2002-08-05  Martin Baulig  <martin@gnome.org>
12614
12615         * statement.cs (UsageVector): Only initialize the `parameters'
12616         vector if we actually have any "out" parameters.
12617
12618 2002-08-05  Martin Baulig  <martin@gnome.org>
12619
12620         * expression.cs (Binary.ResolveOperator): When combining delegates,
12621         they must have the same type.
12622
12623 2002-08-05  Martin Baulig  <martin@gnome.org>
12624
12625         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12626         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12627         work with the ms runtime and we also don't need it: if we're a
12628         PropertyBuilder and not in the `indexer_arguments' hash, then we
12629         are a property and not an indexer.
12630
12631         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12632         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12633         since the latter one doesn't work with the ms runtime.
12634
12635 2002-08-03  Martin Baulig  <martin@gnome.org>
12636
12637         Fixed bugs #27998 and #22735.
12638
12639         * class.cs (Method.IsOperator): New public field.
12640         (Method.CheckBase): Report CS0111 if there's already a method
12641         with the same parameters in the current class.  Report CS0508 when
12642         attempting to change the return type of an inherited method.
12643         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12644         and it's not marked abstract or extern.
12645         (PropertyBase): New abstract base class for Property and Indexer.
12646         (PropertyBase.CheckBase): Moved here from Property and made it work
12647         for indexers.
12648         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12649         the same so we can reuse it there.
12650         (Property, Indexer): Derive from PropertyBase.
12651         (MethodSignature.inheritable_property_signature_filter): New delegate
12652         to find properties and indexers.
12653
12654         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12655         argument and improved error reporting.
12656
12657         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12658         EmptyReadOnlyParameters and made it a property.
12659
12660         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12661         version of this method which takes a `PropertyInfo indexer'.
12662         (TypeManager.RegisterIndexer): New method.
12663
12664         * class.cs: Added myself as author of this file :-)
12665
12666 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12667
12668         * class.cs: fixed compilation on windoze.
12669
12670 2002-08-03  Martin Baulig  <martin@gnome.org>
12671
12672         * interface.cs (Interface.GetInterfaceBases): Check whether all
12673         base interfaces are at least as accessible than the current one.
12674
12675         * class.cs (TypeContainer.GetClassBases): Check whether base types
12676         are at least as accessible than the current type.
12677         (TypeContainer.AsAccessible): Implemented and made non-static.
12678         (MemberBase.CheckParameters): Report errors if the accessibility
12679         checks fail.
12680
12681         * delegate.cs (Delegate.Delegate): The default visibility is
12682         internal for top-level types and private for nested types.
12683         (Delegate.Define): Report errors if the accessibility checks fail.
12684
12685         * enum.cs (Enum.Enum): The default visibility is internal for
12686         top-level types and private for nested types.
12687         (Enum.DefineType): Compute the correct visibility.
12688
12689         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12690         function which takes a `bool is_toplevel' instead of a TypeContainer.
12691
12692         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12693         builtin type.
12694
12695 2002-08-02  Martin Baulig  <martin@gnome.org>
12696
12697         * expression.cs (LocalVariableReferenc): Added constructor which
12698         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12699         (LocalVariableReference.IsReadOnly): New property.
12700         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12701         variable is readonly, use our own readonly flag to do this; you can
12702         use the new constructor to get a writable reference to a read-only
12703         variable.
12704
12705         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12706         reference to the local variable.
12707
12708 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * rootcontext.cs (ResolveCore): Also include System.Exception
12711
12712         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12713         we reach an EmptyStatement.
12714
12715         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12716         is also fine.
12717
12718         * expression.cs (Binary.ResolveOperator): Check error result in
12719         two places.
12720
12721         use brtrue/brfalse directly and avoid compares to null.
12722
12723 2002-08-02  Martin Baulig  <martin@gnome.org>
12724
12725         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12726         Fixes bug #28407, added test-155.cs.
12727
12728 2002-08-01  Martin Baulig  <martin@gnome.org>
12729
12730         * class.cs (Event.EmitDefaultMethod): Make this work with static
12731         events.  Fixes #28311, added verify-3.cs.
12732
12733 2002-08-01  Martin Baulig  <martin@gnome.org>
12734
12735         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12736         `is_disposable' fields.
12737         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12738         `hm.is_disposable' if we're using the collection pattern.
12739         (Foreach.EmitCollectionForeach): Use the correct type for the
12740         enumerator's local variable, only emit the try/finally block if
12741         necessary (fixes #27713).
12742
12743 2002-08-01  Martin Baulig  <martin@gnome.org>
12744
12745         * ecore.cs (Expression.report118): Renamed to Error118 and made
12746         it public static.
12747
12748         * statement.cs (Throw.Resolve): Check whether the expression is of
12749         the correct type (CS0118) and whether the type derives from
12750         System.Exception (CS0155).
12751         (Catch.Resolve): New method.  Do the type lookup here and check
12752         whether it derives from System.Exception (CS0155).
12753         (Catch.CatchType, Catch.IsGeneral): New public properties.
12754
12755         * typemanager.cs (TypeManager.exception_type): Added.
12756
12757 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12758
12759         * driver.cs: Updated About function.
12760
12761 2002-07-31  Martin Baulig  <martin@gnome.org>
12762
12763         Implemented Control Flow Analysis.
12764
12765         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12766         (EmitContext.CurrentBranching): Added.
12767         (EmitContext.StartFlowBranching): Added.
12768         (EmitContext.EndFlowBranching): Added.
12769         (EmitContext.KillFlowBranching): Added.
12770         (EmitContext.IsVariableAssigned): Added.
12771         (EmitContext.SetVariableAssigned): Added.
12772         (EmitContext.IsParameterAssigned): Added.
12773         (EmitContext.SetParameterAssigned): Added.
12774         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12775         Added control flow analysis stuff here.
12776
12777         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12778         resolve the expression as lvalue.
12779         (LocalVariableReference.DoResolve): Check whether the variable has
12780         already been assigned.
12781         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12782         the parameter as assigned here.
12783         (ParameterReference.DoResolve): Check whether the parameter has already
12784         been assigned.
12785         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12786         expression as lvalue.
12787
12788         * statement.cs (FlowBranching): New class for the flow analysis code.
12789         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12790         (LabeledStatement.IsDefined): New public property.
12791         (LabeledStatement.AddUsageVector): New public method to tell flow
12792         analyis that the label may be reached via a forward jump.
12793         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12794         flow analysis.
12795         (VariableInfo.Number): New public field.  This is used by flow analysis
12796         to number all locals of a block.
12797         (Block.CountVariables): New public property.  This is the number of
12798         local variables in this block (including the locals from all parent
12799         blocks).
12800         (Block.EmitMeta): Number all the variables.
12801
12802         * statement.cs: Added flow analysis support to all classes.
12803
12804 2002-07-31  Martin Baulig  <martin@gnome.org>
12805
12806         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12807         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12808         then use this argument.
12809
12810         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12811
12812         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12813         use this to specify /define options.
12814
12815 2002-07-29  Martin Baulig  <martin@gnome.org>
12816
12817         * statement.cs (Fixed): Moved all code that does variable lookups
12818         and resolvings from Emit to Resolve.
12819
12820         * statement.cs (For): Moved all code that does variable lookups
12821         and resolvings from Emit to Resolve.
12822
12823         * statement.cs (Using): Moved all code that does variable lookups
12824         and resolvings from Emit to Resolve.
12825
12826 2002-07-29  Martin Baulig  <martin@gnome.org>
12827
12828         * attribute.cs (Attribute.Resolve): Explicitly catch a
12829         System.NullReferenceException when creating the
12830         CustromAttributeBuilder and report a different warning message.
12831
12832 2002-07-29  Martin Baulig  <martin@gnome.org>
12833
12834         * support.cs (ParameterData.ParameterName): Added method to
12835         get the name of a parameter.
12836
12837         * typemanager.cs (TypeManager.IsValueType): New public method.
12838
12839 2002-07-29  Martin Baulig  <martin@gnome.org>
12840
12841         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12842         is a flag which specifies that it's either ref or out.
12843         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12844         the out parameter to `out Parameter.Modifier mod', also set the
12845         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12846
12847         * support.cs (InternalParameters.ParameterModifier): Distinguish
12848         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12849         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12850
12851         * expression.cs (Argument.GetParameterModifier): Distinguish
12852         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12853         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12854
12855 2002-07-29  Martin Baulig  <martin@gnome.org>
12856
12857         * expression.cs (ParameterReference.ParameterReference): Added
12858         `Location loc' argument to the constructor.
12859
12860         * cs-parser.jay: Pass location to ParameterReference.
12861
12862 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12863
12864         * statement.cs (Try): Initialize the location.
12865
12866         * cs-parser.jay: pass location to Try.
12867
12868         * expression.cs (Unary.Reduce): Change the prototype to return
12869         whether a constant fold could be performed or not.  The result is
12870         returned in an out parameters.  In the case of Indirection and
12871         AddressOf, we want to perform the full tests.
12872
12873 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12874
12875         * statement.cs (Statement.Emit): Flag dead code.
12876
12877 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12878
12879         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12880
12881 2002-07-27  Martin Baulig  <martin@gnome.org>
12882
12883         * class.cs (MethodData.Define): Put back call to
12884         TypeManager.AddMethod(), accidentally commented this out.
12885
12886         * report.cs (Debug): New public method to print debugging information,
12887         this is `[Conditional ("DEBUG")]'.
12888
12889 2002-07-26  Martin Baulig  <martin@gnome.org>
12890
12891         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12892         (switch_statement): Push the current_block to the switch_stack and
12893         pop it again when we're done with the switch.
12894         (switch_section): The new block is a child of the current_block.
12895         Fixes bug #24007, added test-152.cs.
12896
12897 2002-07-27  Martin Baulig  <martin@gnome.org>
12898
12899         * expression.cs (Invocation.EmitArguments): When calling a varargs
12900         function with only its fixed arguments, we need to pass an empty
12901         array.
12902
12903 2002-07-27  Martin Baulig  <martin@gnome.org>
12904
12905         Mono 0.13 has been released.
12906
12907 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12908
12909         * driver.cs: Rename --resource to --linkres, because that is what
12910         we do currently, we dont support --resource yet.
12911
12912         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12913
12914 2002-07-25  Martin Baulig  <martin@gnome.org>
12915
12916         * class.cs (MethodData): New public class.  This is a `method builder'
12917         class for a method or one accessor of a Property/Indexer/Event.
12918         (MethodData.GetMethodFlags): Moved here from MemberBase.
12919         (MethodData.ApplyAttributes): Likewise.
12920         (MethodData.ApplyObsoleteAttribute): Likewise.
12921         (MethodData.ApplyConditionalAttribute): Likewise.
12922         (MethodData.ApplyDllImportAttribute): Likewise.
12923         (MethodData.CheckAbstractAndExternal): Likewise.
12924         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12925         (MethodData.Emit): Formerly known as Method.Emit().
12926         (MemberBase): Moved everything which was specific to a single
12927         accessor/method to MethodData.
12928         (Method): Create a new MethodData and call Define() and Emit() on it.
12929         (Property, Indexer, Event): Create a new MethodData objects for each
12930         accessor and call Define() and Emit() on them.
12931
12932 2002-07-25  Martin Baulig  <martin@gnome.org>
12933
12934         Made MethodCore derive from MemberBase to reuse the code from there.
12935         MemberBase now also checks for attributes.
12936
12937         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12938         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12939         as virtual.
12940         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12941         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12942         (MemberBase.ApplyAttributes): New virtual method; applies the
12943         attributes to a method or accessor.
12944         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12945         (MemberBase.ApplyConditionalAttribute): Likewise.
12946         (MemberBase.ApplyDllImportAttribute): Likewise.
12947         (MemberBase.CheckAbstractAndExternal): Likewise.
12948         (MethodCore.ParameterTypes): This is now a property instead of a
12949         method, it's initialized from DoDefineParameters().
12950         (MethodCore.ParameterInfo): Removed the set accessor.
12951         (MethodCore.DoDefineParameters): New protected virtual method to
12952         initialize ParameterTypes and ParameterInfo.
12953         (Method.GetReturnType): We can now simply return the MemberType.
12954         (Method.GetMethodFlags): Override the MemberBase version and add
12955         the conditional flags.
12956         (Method.CheckBase): Moved some code from Define() here, call
12957         DoDefineParameters() here.
12958         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12959         here to avoid some larger code duplication.
12960         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12961         ensure that abstract and external accessors don't declare a body.
12962
12963         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12964         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12965         lookup in the attribute's parent classes, so we need to abort as soon
12966         as we found the first match.
12967         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12968         the attribute has no arguments.
12969
12970         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12971         of a Method.
12972
12973 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12974
12975         * cs-parser.jay: reverted previous patch.
12976
12977 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12978
12979         * cs-parser.jay: fixed bug #22119.
12980
12981 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12982
12983         * attribute.cs: fixed compilation. The error was:
12984         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12985         be assigned to before control leaves the current method."
12986         [FIXME:  Filed as bug #28186: MCS must report this error.]
12987
12988 2002-07-25  Martin Baulig  <martin@gnome.org>
12989
12990         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12991         method to pull the condition name ouf of a Conditional attribute.
12992         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12993         the obsolete message and error flag out of an Obsolete attribute.
12994
12995         * class.cs (Method.GetMethodFlags): New public method to get the
12996         TypeManager.MethodFlags for this method.
12997         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12998         private methods.
12999         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13000         if we're overriding a virtual function, set the new private variable
13001         `parent_method'; call the new TypeManager.AddMethod().
13002
13003         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13004         the MethodBuilder and the Method in a PtrHashtable.
13005         (TypeManager.builder_to_method): Added for this purpose.
13006         (TypeManager.MethodFlags): Added IsObsoleteError.
13007         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13008         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13009         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13010         the message from the attribute.
13011
13012 2002-07-24  Martin Baulig  <martin@gnome.org>
13013
13014         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13015         preprocessor directives, ensure that the argument to #define/#undef is
13016         exactly one identifier and that it's actually an identifier.
13017
13018         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13019         did not work ....
13020
13021 2002-07-24  Martin Baulig  <martin@gnome.org>
13022
13023         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13024         initialize it to TypeManager.object_type in the constructor.
13025         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13026         of the `hm.get_current' method if we're using the collection pattern.
13027         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13028         for the explicit conversion to make it work when we're using the collection
13029         pattern and the `Current' property has a different return type than `object'.
13030         Fixes #27713.
13031
13032 2002-07-24  Martin Baulig  <martin@gnome.org>
13033
13034         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13035         does not match, but don't report any errors.  This method is called in
13036         order for all methods in a MethodGroupExpr until a matching method is
13037         found, so we don't want to bail out if the first method doesn't match.
13038         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13039         matches, report the 123.  Fixes #28070.
13040
13041 2002-07-24  Martin Baulig  <martin@gnome.org>
13042
13043         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13044         TypeManager.TypeToCoreType() to the top of the method so the
13045         following equality checks will work.  Fixes #28107.
13046
13047 2002-07-24  Martin Baulig  <martin@gnome.org>
13048
13049         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13050         operand is of type uint, and the other operand is of type sbyte,
13051         short or int, the operands are converted to type long." -
13052         Actually do what this comment already told us.  Fixes bug #28106,
13053         added test-150.cs.
13054
13055 2002-07-24  Martin Baulig  <martin@gnome.org>
13056
13057         * class.cs (MethodBase): New abstract class.  This is now a base
13058         class for Property, Indexer and Event to avoid some code duplication
13059         in their Define() and DefineMethods() methods.
13060         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13061         generic methods for Define() and DefineMethods().
13062         (FieldBase): Derive from MemberBase, not MemberCore.
13063         (Property): Derive from MemberBase, not MemberCore.
13064         (Property.DefineMethod): Moved all the code from this method to the
13065         new MethodBase.DefineAccessor(), just call it with appropriate
13066         argumetnts.
13067         (Property.Define): Call the new Property.DoDefine(), this does some
13068         sanity checks and we don't need to duplicate the code everywhere.
13069         (Event): Derive from MemberBase, not MemberCore.
13070         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13071         accessors, this will also make them work with interface events.
13072         (Indexer): Derive from MemberBase, not MemberCore.
13073         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13074         (Indexer.Define): Use the new MethodBase functions.
13075
13076         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13077         argument to the constructor.
13078         (Interface.FindMembers): Added support for interface events.
13079         (Interface.PopluateEvent): Implemented.
13080
13081         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13082
13083 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13084
13085         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13086         but this is required to check for a method name being the same as
13087         the containing class.  
13088
13089         Handle this now.
13090
13091 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13092
13093         * interface.cs: initialize variable.
13094
13095 2002-07-23  Martin Baulig  <martin@gnome.org>
13096
13097         Implemented the IndexerName attribute in interfaces.
13098
13099         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13100         name if this is an explicit interface implementation.
13101         (Indexer.InterfaceIndexerName): New public variable.  If we're
13102         implementing an interface indexer, this is the IndexerName in that
13103         interface.  Otherwise, it's the IndexerName.
13104         (Indexer.DefineMethod): If we're implementing interface indexer,
13105         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13106         and Pending.ImplementIndexer methods.
13107         (Indexer.Define): Also define the PropertyBuilder if we're
13108         implementing an interface indexer and this is neither an explicit
13109         interface implementation nor do the IndexerName match the one in
13110         the interface.
13111
13112         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13113         If a method is defined here, then we always need to create a proxy
13114         for it.  This is used when implementing interface indexers.
13115         (Pending.IsInterfaceIndexer): New public method.
13116         (Pending.ImplementIndexer): New public method.
13117         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13118         This is used when implementing interface indexers to define a proxy
13119         if necessary.
13120         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13121         define a proxy if necessary.
13122
13123         * interface.cs (Interface.IndexerName): New public variable.
13124         (Interface.PopulateIndexer): Set the IndexerName.
13125         (Interface.DefineIndexers): New private method.  Populate all the
13126         indexers and make sure their IndexerNames match.
13127
13128         * typemanager.cs (IndexerPropertyName): Added support for interface
13129         indexers.
13130
13131 2002-07-22  Martin Baulig  <martin@gnome.org>
13132
13133         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13134         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13135         ret if HasReturnLabel.
13136         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13137         variables.
13138
13139         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13140         and set the ec.LoopBeginTryCatchLevel.
13141         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13142         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13143         the current ec.TryCatchLevel, the branch goes out of an exception
13144         block.  In this case, we need to use Leave and not Br.
13145
13146 2002-07-22  Martin Baulig  <martin@gnome.org>
13147
13148         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13149         block unless the block does not always return or it is contained in
13150         another try { ... } catch { ... } block.  Fixes bug #26506.
13151         Added verify-1.cs to the test suite.
13152
13153 2002-07-22  Martin Baulig  <martin@gnome.org>
13154
13155         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13156         then we do not always return.  Fixes bug #24985.
13157
13158 2002-07-22  Martin Baulig  <martin@gnome.org>
13159
13160         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13161         lookup on a per-class level; ie. walk up the class hierarchy until we
13162         found at least one applicable method, then choose the best among them.
13163         Fixes bug #24463 and test-29.cs.
13164
13165 2002-07-22  Martin Baulig  <martin@gnome.org>
13166
13167         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13168         return types of the methods.  The return type is not part of the
13169         signature and we must not check it to make the `new' modifier work.
13170         Fixes bug #27999, also added test-147.cs.
13171         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13172
13173         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13174         on the method's return type.
13175
13176 2002-07-21  Martin Baulig  <martin@gnome.org>
13177
13178         * assign.cs: Make this work if the rightmost source is a constant and
13179         we need to do an implicit type conversion.  Also adding a few more tests
13180         to test-38.cs which should have caught this.
13181
13182         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13183         target in the makefile for this.  The makefile.gnu is primarily intended
13184         for end-users who don't want to debug the compiler.
13185
13186 2002-07-21  Martin Baulig  <martin@gnome.org>
13187
13188         * assign.cs: Improved the Assign class so it can now handle embedded
13189         assignments (X = Y = Z = something).  As a side-effect this'll now also
13190         consume less local variables.  test-38.cs now passes with MCS, added
13191         a few new test cases to that test.
13192
13193 2002-07-20  Martin Baulig  <martin@gnome.org>
13194
13195         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13196         instructions.  Fixes bug #27977, also added test-146.cs.
13197
13198 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13199
13200         * cs-tokenizer.cs: fixed getHex ().
13201
13202 2002-07-19  Martin Baulig  <martin@gnome.org>
13203
13204         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13205         not Type.GetType() to lookup the array type.  This is needed when
13206         we're constructing an array of a user-defined type.
13207         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13208         single-dimensional arrays, but also for single-dimensial arrays of
13209         type decimal.
13210
13211 2002-07-19  Martin Baulig  <martin@gnome.org>
13212
13213         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13214         this function is called, it's not allowed to share LocalBuilders
13215         among ILGenerators.
13216
13217 2002-07-19  Martin Baulig  <martin@gnome.org>
13218
13219         * expression.cs (Argument.Resolve): Report an error 118 when trying
13220         to pass a type as argument.
13221
13222 2002-07-18  Martin Baulig  <martin@gnome.org>
13223
13224         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13225         Conv_R_Un for the signed `long' type.
13226
13227 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13228
13229         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13230         `expr' for the temporary result, as that will fail if we do
13231         multiple resolves on the same expression.
13232
13233 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13234
13235         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13236         ec.TypeContainer for looking up aliases. 
13237
13238         * class.cs (TypeContainer): Remove LookupAlias from here.
13239
13240         * decl.cs (DeclSpace); Move here.
13241
13242 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13243
13244         * class.cs (FindMembers): Only call filter if the constructor
13245         bulider is not null.
13246
13247         Also handle delegates in `NestedTypes' now.  Now we will perform
13248         type lookups using the standard resolution process.  This also
13249         fixes a bug.
13250
13251         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13252         This uses Expressions (the limited kind that can be parsed by the
13253         tree) instead of strings.
13254
13255         * expression.cs (ComposedCast.ToString): Implement, used to flag
13256         errors since now we have to render expressions.
13257
13258         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13259         FormArrayType. 
13260
13261         * ecore.cs (SimpleName.ToString): ditto.
13262
13263         * cs-parser.jay: Instead of using strings to assemble types, use
13264         Expressions to assemble the type (using SimpleName, ComposedCast,
13265         MemberAccess).  This should fix the type lookups in declarations,
13266         because we were using a different code path for this.
13267
13268         * statement.cs (Block.Resolve): Continue processing statements
13269         even when there is an error.
13270
13271 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13272
13273         * class.cs (Event.Define): Also remove the `remove' method from
13274         the list of pending items.
13275
13276         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13277         generate more compact code. 
13278
13279 2002-07-17  Martin Baulig  <martin@gnome.org>
13280
13281         * const.cs (Const.LookupConstantValue): Add support for constant
13282         `unchecked' and `checked' expressions.
13283         Also adding test case test-140.cs for this.
13284
13285 2002-07-17  Martin Baulig  <martin@gnome.org>
13286
13287         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13288         check whether mi.ReturnType implements the IEnumerator interface; the
13289         `==' and the IsAssignableFrom() will fail in this situation.
13290
13291 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13292
13293         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13294         here too.
13295
13296 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13297
13298         * expression.cs: fixed bug #27811.
13299
13300 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13303         Molaro: when we are a ref, the value already contains a pointer
13304         value, do not take the address of it.
13305
13306 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13307         * removed mb-parser.jay and mb-tokenizer.cs
13308
13309 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13310
13311         * expression.cs: check against the building corlib void type.
13312
13313 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13314
13315         * ecore.cs: fix for valuetype static readonly fields: when 
13316         initializing them, we need their address, not the address of a copy.
13317
13318 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13319
13320         * typemanager.cs: register also enum_type in corlib.
13321
13322 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13323
13324         * class.cs: allow calling this (but not base) initializers in structs.
13325
13326 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13327
13328         * ecore.cs: make sure we compare against the building base types
13329         in GetTypeSize ().
13330
13331 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13332
13333         * typemanager.cs: fix TypeToCoreType() to handle void and object
13334         (corlib gets no more typerefs after this change).
13335
13336 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * expression.cs (ArrayCreation.EmitArrayArguments): use
13339         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13340
13341         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13342         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13343         array indexes, the runtime actually forbids them.
13344
13345         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13346         for array arguments here.
13347
13348         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13349         instead of the default for ValueTypes.
13350
13351         (New.DoEmit): Use IsValueType instead of
13352         IsSubclassOf (value_type)
13353         (New.DoResolve): ditto.
13354         (Invocation.EmitCall): ditto.
13355
13356         * assign.cs (Assign): ditto.
13357
13358         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13359         Statements *are* currently doing part of their resolution during
13360         Emit.  
13361
13362         Expressions do always resolve during resolve, but statements are
13363         only required to propagate resolution to their children.
13364
13365 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13366
13367         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13368
13369         (LoadAssembly): Do not add the dll if it is already specified
13370
13371         (MainDriver): Add the System directory to the link path at the end,
13372         after all the other -L arguments. 
13373
13374         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13375         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13376         ldelem.u1) and using the opposite for sbytes.
13377
13378         This fixes Digger, and we can finally run it.
13379
13380         * driver.cs (UnixParseOption): Move the option parsing here.  
13381         (CSCParseOption): Implement CSC-like parsing of options.
13382
13383         We now support both modes of operation, the old Unix way, and the
13384         new CSC-like way.  This should help those who wanted to make cross
13385         platform makefiles.
13386
13387         The only thing broken is that /r:, /reference: and /lib: are not
13388         implemented, because I want to make those have the same semantics
13389         as the CSC compiler has, and kill once and for all the confussion
13390         around this.   Will be doing this tomorrow.
13391
13392         * statement.cs (Unsafe.Resolve): The state is checked during
13393         resolve, not emit, so we have to set the flags for IsUnsfe here.
13394
13395 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13398         not catch the Error_ObjectRefRequired in SimpleName (as it is
13399         possible to have a class/instance variable name that later gets
13400         deambiguated), we have to check this here.      
13401
13402 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13403
13404         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13405         make static and put into Expression.
13406
13407         (Event.Define): Register the private field of the event with the 
13408         TypeManager so that GetFieldFromEvent can get at it.
13409
13410         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13411         keep track of the private field associated with an event which
13412         has no accessors.
13413
13414         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13415         private field.
13416
13417         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13418
13419 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13420
13421         * expression.cs (Binary.EmitBranchable): this routine emits the
13422         Binary expression in a branchable context.  This basically means:
13423         we need to branch somewhere, not just get the value on the stack.
13424
13425         This works together with Statement.EmitBoolExpression.
13426
13427         * statement.cs (Statement.EmitBoolExpression): Use
13428         EmitBranchable. 
13429
13430 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * statement.cs (For): Reduce the number of jumps in loops.
13433
13434         (For): Implement loop inversion for the For statement.
13435
13436         (Break): We can be breaking out of a Try/Catch controlled section
13437         (foreach might have an implicit try/catch clause), so we need to
13438         use Leave instead of Br.
13439
13440         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13441         now).  If the instace expression supports IMemoryLocation, we use
13442         the AddressOf method from the IMemoryLocation to extract the
13443         address instead of emitting the instance.
13444
13445         This showed up with `This', as we were emitting the instance
13446         always (Emit) instead of the Address of This.  Particularly
13447         interesting when This is a value type, as we dont want the Emit
13448         effect (which was to load the object).
13449
13450 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13451
13452         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13453
13454         * statement.cs (Checked): Set the CheckedState during the resolve
13455         process too, as the ConvCast operations track the checked state on
13456         the resolve process, and not emit.
13457
13458         * cs-parser.jay (namespace_member_declaration): Flag that we have
13459         found a declaration when we do.  This is used to flag error 1529
13460
13461         * driver.cs: Report ok when we display the help only.
13462
13463 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13464
13465         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13466
13467 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13468
13469         * cs-tokenizer.cs (define): We also have to track locally the
13470         defines.  AllDefines is just used for the Conditional Attribute,
13471         but we also need the local defines for the current source code. 
13472
13473 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * statement.cs (While, For, Do): These loops can exit through a
13476         Break statement, use this information to tell whether the
13477         statement is the last piece of code.
13478
13479         (Break): Flag that we break.
13480
13481         * codegen.cs (EmitContexts): New `Breaks' state variable.
13482
13483 2002-07-03  Martin Baulig  <martin@gnome.org>
13484
13485         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13486         modifiers in method declarations in structs.  Otherwise, you won't
13487         be able to override things like Object.Equals().
13488
13489 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13490
13491         * class.cs (Method, Property, Indexer): Do not allow the public
13492         modifier to be used in explicit interface implementations.
13493
13494         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13495         override modifiers in method declarations in structs
13496
13497 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13498
13499         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13500         integer or real overflow, report an error
13501
13502 2002-07-02  Martin Baulig  <martin@gnome.org>
13503
13504         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13505         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13506         to tell the runtime about our newly created System.Object and
13507         System.ValueType types.
13508
13509 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13510
13511         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13512         struct instead of Ldarg/Starg.
13513
13514 2002-07-02  Martin Baulig  <martin@gnome.org>
13515
13516         * expression.cs (Indirection.Indirection): Call
13517         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13518
13519 2002-07-02  Martin Baulig  <martin@gnome.org>
13520
13521         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13522         ValueType, call TypeManager.TypeToCoreType() on it.
13523         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13524         the OpCodes.Newarr argument.
13525
13526 2002-07-02  Martin Baulig  <martin@gnome.org>
13527
13528         * expression.cs (Invocation.EmitCall): When compiling corlib,
13529         replace all calls to the system's System.Array type to calls to
13530         the newly created one.
13531
13532         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13533         System.Array methods.
13534         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13535         from the system's System.Array type which must be replaced.
13536
13537 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13538
13539         * typemanager.cs: load unverifiable_code_ctor so we can build
13540         corlib using the correct type. Avoid using GetTypeCode() with
13541         TypeBuilders.
13542         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13543         TypeManager.object_type to allow building corlib.
13544
13545 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13546
13547         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13548
13549 2002-07-01  Martin Baulig  <martin@gnome.org>
13550
13551         * class.cs: Make the last change actually work, we need to check
13552         whether `ifaces != null' to avoid a crash.
13553
13554 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13555
13556         * class.cs: when we build structs without fields that implement
13557         interfaces, we need to add the interfaces separately, since there is
13558         no API to both set the size and add the interfaces at type creation
13559         time.
13560
13561 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13562
13563         * expression.cs: the dimension arguments to the array constructors
13564         need to be converted if they are a long.
13565
13566 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13567
13568         * class.cs: don't emit ldarg.0 if there is no parent constructor
13569         (fixes showstopper for corlib).
13570
13571 2002-06-29  Martin Baulig  <martin@gnome.org>
13572
13573         MCS now compiles corlib on GNU/Linux :-)
13574
13575         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13576         ie. check for MethodImplOptions.InternalCall.
13577
13578         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13579         and TypeManager.attribute_type are null, so we must explicitly check
13580         whether parent is not null to find out whether it's an attribute type.
13581         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13582         and SetBuilder, not only if the property is neither abstract nor external.
13583         This is necessary to set the MethodImplOptions on the accessor methods.
13584         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13585         SetBuilder, see Property.Emit().
13586
13587         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13588         populate "System.Object", "System.ValueType" and "System.Attribute" since
13589         they've already been populated from BootCorlib_PopulateCoreTypes().
13590
13591 2002-06-29  Martin Baulig  <martin@gnome.org>
13592
13593         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13594         is the NullLiteral, we also need to make sure that target_type is not
13595         an enum type.   
13596
13597 2002-06-29  Martin Baulig  <martin@gnome.org>
13598
13599         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13600         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13601         before calling BootstrapCorlib_ResolveDelegate ().
13602
13603 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13604
13605         * statement.cs: fixed build-breaker. All tests passed ok.
13606
13607 2002-06-27  Martin Baulig  <martin@gnome.org>
13608
13609         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13610         for System.Decimal when compiling corlib.
13611
13612 2002-06-27  Martin Baulig  <martin@gnome.org>
13613
13614         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13615         switch blocks which contain nothing but a default clause.
13616
13617 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13618
13619        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13620
13621 2002-06-27  Martin Baulig  <martin@gnome.org>
13622
13623         * ecore.cs (PropertyExpr.PropertyExpr): Call
13624         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13625
13626         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13627         is already a TypeBuilder.
13628
13629 2002-06-27  Martin Baulig  <martin@gnome.org>
13630
13631         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13632         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13633         the "from an array-type to System.Array" case.  This makes it work
13634         when compiling corlib.
13635
13636 2002-06-27  Martin Baulig  <martin@gnome.org>
13637
13638         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13639         non-static PropertyExpr, set its InstanceExpression.  This makes
13640         the `ICollection.Count' property work in System/Array.cs.
13641
13642 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13643
13644         * driver.cs: Made error handling more consistent.  Errors now
13645         tracked by Report class, so many methods which used to return int
13646         now return void.  Main() now prints success/failure and 
13647         errors/warnings message.
13648
13649         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13650         the magic number return values (123 and 124).  Now, if the
13651         expected error occurs, the compiler exits with success (exit value
13652         0).  If the compilation completes without seeing that particular
13653         error, the compiler exits with failure (exit value 1).  The
13654         makefile in mcs/errors has been changed to handle the new behaviour.
13655
13656         * report.cs: Made 'expected error' number a property and renamed
13657         it from 'Probe' to 'ExpectedError'.
13658
13659         * genericparser.cs: Removed error handling support, since it is
13660         now all done by Report class.
13661
13662         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13663         class, so parse() no longer returns an int.
13664
13665         * namespace.cs: Use Report.Error instead of GenericParser.error
13666
13667 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13670         TypeContainer.AddOperator): At the front of the list put the
13671         explicit implementations, so they get resolved/defined first. 
13672
13673 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13674
13675         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13676         interface type is implemented by this TypeContainer.  Used during
13677         explicit interface implementation.
13678
13679         (Property.Define, Indexer.Define, Method.Define): Validate that
13680         the given interface in the explicit implementation is one of the
13681         base classes for the containing type.
13682
13683         Also if we are explicitly implementing an interface, but there is
13684         no match in the pending implementation table, report an error.
13685
13686         (Property.Define): Only define the property if we are
13687         not explicitly implementing a property from an interface.  Use the
13688         correct name also for those properties (the same CSC uses,
13689         although that is really not needed).
13690
13691         (Property.Emit): Do not emit attributes for explicitly implemented
13692         properties, as there is no TypeBuilder.
13693
13694         (Indexer.Emit): ditto.
13695
13696         Hiding then means that we do not really *implement* a pending
13697         implementation, which makes code fail.
13698
13699 2002-06-22  Martin Baulig  <martin@gnome.org>
13700
13701         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13702         the return value of Object.GetType().  [FIXME: we need to do this whenever
13703         we get a type back from the reflection library].
13704
13705 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13706
13707         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13708
13709 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13710
13711         * attribute.cs: Return null if we can not look up the type.
13712
13713         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13714         the interface types found.
13715
13716         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13717         interface types found.
13718
13719         * typemanager.cs (GetInterfaces): Make this routine returns alll
13720         the interfaces and work around the lame differences between
13721         System.Type and System.Reflection.Emit.TypeBuilder in the results
13722         result for GetInterfaces.
13723
13724         (ExpandInterfaces): Given an array of interface types, expand and
13725         eliminate repeated ocurrences of an interface.  This expands in
13726         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13727         be IA, IB, IC.
13728
13729 2002-06-21  Martin Baulig  <martin@gnome.org>
13730
13731         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13732         on System.Enum.
13733
13734 2002-06-21  Martin Baulig  <martin@gnome.org>
13735
13736         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13737         and called with one of the core types, return the corresponding typebuilder for
13738         that type.
13739
13740         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13741         element type.
13742
13743 2002-06-21  Martin Baulig  <martin@gnome.org>
13744
13745         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13746         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13747         (Expression.ConvertReferenceExplicit): Likewise.
13748
13749         * expression.cs (ElementAccess.DoResolve): Likewise.
13750         (ElementAccess.DoResolveLValue): Likewise.
13751
13752 2002-06-10  Martin Baulig  <martin@gnome.org>
13753
13754         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13755         add the "value" parameter to the parameter list.
13756
13757         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13758         to our caller.
13759
13760 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13761
13762         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13763         the argument to an int, uint, long or ulong, per the spec.  Also
13764         catch negative constants in array creation.
13765
13766 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13767
13768         * class.cs: do not allow the same interface to appear twice in
13769         the definition list.
13770
13771 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13772
13773         * ecore.cs: don't use ldlen with System.Array.
13774
13775 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13776
13777         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13778
13779 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13780
13781         * modifiers.cs: produce correct field attributes for protected
13782         internal. Easy fix so miguel can work on ther harder stuff:-)
13783
13784 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * pending.cs: New file.  Move the code from class.cs here.
13787         Support clearning the pending flag for all methods (when not doing
13788         explicit interface implementation).
13789
13790 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13791
13792         * rootcontext.cs: added a couple more types needed to bootstrap.
13793
13794 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13795
13796         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13797         constructor in the type, instead of any constructor in the type
13798         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13799         a bug in the Mono runtime when applying the params attribute). 
13800
13801 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13802         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13803
13804 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13805
13806         * expression.cs (Unary.ResolveOperator): Use TypeManager
13807         to resolve the type.
13808
13809 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13810
13811         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13812         attached.
13813
13814         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13815         with each member too.
13816
13817         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13818         field builders too - this takes care of the enum member case.
13819
13820 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13821
13822         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13823         address-of operator on both value types and pointers.
13824
13825 2002-06-10  Martin Baulig  <martin@gnome.org>
13826
13827         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13828         PropertyBuilder to the `property_builders' list.
13829
13830         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13831         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13832         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13833         find any indexers which are inherited from an interface.
13834
13835 2002-06-09  Martin Baulig  <martin@gnome.org>
13836
13837         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13838         the same type as the constant if necessary.  There's also a test-130.cs
13839         for this.
13840
13841         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13842
13843         * typemanager.cs (TypeManager.ChangeType): Previously known as
13844         Enum.ChangeEnumType().
13845
13846 2002-06-09  Martin Baulig  <martin@gnome.org>
13847
13848         * expression.cs (Cast.TryReduce): Added support for consts.
13849
13850 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13851
13852         * class.cs (Accessor): Hold attributes information so we can pass
13853         it along.
13854
13855         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13856         Modify to pass in attributes attached to the methods.
13857
13858         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13859
13860         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13861         to handle the Accessor kind :-)
13862
13863         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13864
13865 2002-06-08  Martin Baulig  <martin@gnome.org>
13866
13867         * expression.cs (Unary.TryReduceNegative): Added support for
13868         ULongConstants.
13869
13870 2002-06-08  Martin Baulig  <martin@gnome.org>
13871
13872         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13873         name can't be found in the `defined_names' - the caller will do a
13874         MemberLookup in this case and thus find methods in System.Enum
13875         such as Enum.IsDefined().
13876
13877 2002-06-08  Martin Baulig  <martin@gnome.org>
13878
13879         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13880         Convert.ChangeType() which works with TypeBuilder created types.
13881         (Enum.LookupEnumValue, Enum.Define): Use it here.
13882
13883         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13884         `TypeBuilder.BaseType != null' check.
13885         (TypeContainer.FindMembers): Only lookup parent members if we
13886         actually have a parent.
13887         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13888         (ConstructorInitializer.Resolve): Likewise.
13889
13890         * interface.cs (Interface.FindMembers): Added
13891         `TypeBuilder.BaseType != null' check.
13892
13893         * rootcontext.cs (RootContext.ResolveCore): Added
13894         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13895         classes_second_stage.
13896
13897         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13898         debug_type and trace_type when compiling with --nostdlib.       
13899
13900 2002-06-07  Martin Baulig  <martin@gnome.org>
13901
13902         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13903         (AddField): Set it to true when adding a non-static field.
13904         (DefineType): Use `have_nonstatic_fields' to find out whether we
13905         have non-static fields, not `Fields != null'.
13906
13907 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13908
13909         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13910         dereferencing a null on the static-field code path)
13911
13912 2002-05-30  Martin Baulig  <martin@gnome.org>
13913
13914         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13915         to take command line arguments.  Use reflection to call the new
13916         custom `Initialize' function on the symbol writer and pass it the
13917         command line arguments.
13918
13919         * driver.cs (--debug-args): New command line argument to pass command
13920         line arguments to the symbol writer.
13921
13922 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13923
13924         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13925         the target type for indexers and properties.  Thanks to Joe for
13926         catching this.
13927
13928 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13929
13930         * typemanager.cs (MethodFlags): returns the method flags
13931         (Obsolete/ShouldIgnore) that control warning emission and whether
13932         the invocation should be made, or ignored. 
13933
13934         * expression.cs (Invocation.Emit): Remove previous hack, we should
13935         not do this on matching a base type, we should do this based on an attribute
13936
13937         Only emit calls to System.Diagnostics.Debug and
13938         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13939         on the command line.
13940
13941         * rootcontext.cs: Global settings for tracing and debugging.
13942
13943         * cs-tokenizer.cs (define): New utility function to track
13944         defines.   Set the global settings for TRACE and DEBUG if found.
13945
13946 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13947
13948         * interface.cs (Populate*): Pass in the TypeContainer as well as
13949         the DeclSpace as parameters so that we can create EmitContexts and
13950         then use that to apply attributes etc.
13951
13952         (PopulateMethod, PopulateEvent, PopulateProperty)
13953         (PopulateIndexer): Apply attributes everywhere.
13954
13955         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13956         etc.
13957
13958         (ApplyAttributes): Update accordingly.
13959
13960         We now apply interface attributes for all members too.
13961
13962 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13963
13964         * class.cs (Indexer.Define); Correctly check if we are explicit
13965         implementation (instead of checking the Name for a ".", we
13966         directly look up if the InterfaceType was specified).
13967
13968         Delay the creation of the PropertyBuilder.
13969
13970         Only create the PropertyBuilder if we are not an explicit
13971         interface implementation.   This means that explicit interface
13972         implementation members do not participate in regular function
13973         lookups, and hence fixes another major ambiguity problem in
13974         overload resolution (that was the visible effect).
13975
13976         (DefineMethod): Return whether we are doing an interface
13977         implementation. 
13978
13979         * typemanager.cs: Temporary hack until we get attributes in
13980         interfaces (Ravi is working on that) and we get IndexerName
13981         support in interfaces.
13982
13983         * interface.cs: Register the indexers as properties.
13984
13985         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13986         warning, I have verified that this is a bug in the .NET runtime
13987         (JavaScript suffers of the same problem).
13988
13989         * typemanager.cs (MemberLookup): When looking up members for
13990         interfaces, the parent of an interface is the implicit
13991         System.Object (so we succeed in searches of Object methods in an
13992         interface method invocation.  Example:  IEnumerable x;  x.ToString
13993         ()) 
13994
13995 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13996
13997         * class.cs (Event): Events should also register if they do
13998         implement the methods that an interface requires.
13999
14000         * typemanager.cs (MemberLookup); use the new GetInterfaces
14001         method. 
14002
14003         (GetInterfaces): The code used to lookup interfaces for a type is
14004         used in more than one place, factor it here. 
14005
14006         * driver.cs: Track the errors at the bottom of the file, we kept
14007         on going.
14008
14009         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14010         instance if the method we are calling is static!
14011
14012 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14013
14014         * attribute.cs (ApplyAttributes): Make this function filter out
14015         the IndexerName attribute (as that attribute in reality is never
14016         applied) and return the string constant for the IndexerName
14017         attribute. 
14018
14019         * class.cs (TypeContainer.Emit): Validate that all the indexers
14020         have the same IndexerName attribute, and if so, set the
14021         DefaultName attribute on the class. 
14022
14023         * typemanager.cs: The return value might contain other stuff (not
14024         only methods).  For instance, consider a method with an "Item"
14025         property and an Item method.
14026
14027         * class.cs: If there is a problem with the parameter types,
14028         return. 
14029
14030 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14031
14032         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14033         looks at user defined conversion after making a call to 
14034         StandardConversionExists - we need this for overload resolution.
14035
14036         * expression.cs : Update accordingly the various method calls.
14037
14038         This fixes 2 bugs filed against implicit user defined conversions 
14039
14040 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * statement.cs: Track the result of the assignment.
14043
14044 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14045
14046         * expression.cs (MemberAccess): Improved error reporting for
14047         inaccessible members.
14048
14049 2002-05-22  Martin Baulig  <martin@gnome.org>
14050
14051         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14052         itself with debugging support.
14053
14054 2002-05-22  Martin Baulig  <martin@gnome.org>
14055
14056         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14057         Removed, this isn't needed anymore.
14058
14059 2002-05-20  Martin Baulig  <martin@gnome.org>
14060
14061         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14062         be underlying type for an enum.
14063
14064 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14067         that splits out the loading of just the core types.
14068
14069         * rootcontext.cs (ResolveCore): Split the struct resolution in
14070         two, so we can load the enumeration underlying types before any
14071         enums are used.
14072
14073         * expression.cs (Is): Bandaid until we fix properly Switch (see
14074         bug #24985 for details).
14075
14076         * typemanager.cs (ImplementsInterface): The hashtable will contain
14077         a null if there are no interfaces implemented.
14078
14079 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14080
14081         * cs-parser.jay (indexer_declarator): It is fine to have array
14082         parameters
14083
14084 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14085
14086         * typemanager.cs: (RegisterBuilder): New function used to register
14087         TypeBuilders that implement interfaces.  Since
14088         TypeBuilder.GetInterfaces (as usual) does not work with lame
14089         Reflection.Emit. 
14090         (AddUserType): register interfaces.
14091
14092         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14093         dealing with TypeBuilder.  Also, arrays are showing up as
14094         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14095         methods can not be invoked on them!
14096
14097         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14098         (ImplicitReferenceConversionExists): Split out from
14099         StandardConversionExists. 
14100
14101         * expression.cs (As): We were only implementing one of the three
14102         cases for the as operator.  We now implement them all.
14103         (Is): Implement the various other cases for Is as well.
14104
14105         * typemanager.cs (CACHE): New define used to control if we want or
14106         not the FindMembers cache.  Seems to have a negative impact on
14107         performance currently
14108
14109         (MemberLookup): Nested types have full acess to
14110         enclosing type members
14111
14112         Remove code that coped with instance/static returns for events, we
14113         now catch this in RealFindMembers.
14114
14115         (RealFindMembers): only perform static lookup if the instance
14116         lookup did not return a type or an event.  
14117
14118 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14119
14120         * assign.cs (CompoundAssign): We pass more semantic information
14121         now to Compound Assignments than we did before: now we have all
14122         the information at hand, and now we resolve the target *before* we
14123         do the expression expansion, which allows the "CacheValue" method
14124         to have the effect we intended (before, a [x] += 1 would generate
14125         two differen ArrayAccess expressions from the ElementAccess,
14126         during the resolution process).
14127
14128         (CompoundAssign.DoResolve): Resolve target and original_source here.
14129
14130 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14131
14132         * expression.cs (ArrayAccess): dropped debugging information. 
14133
14134         * typemanager.cs: Small bug fix: I was always returning i_members,
14135         instead of one of i_members or s_members (depending on which had
14136         the content).
14137
14138         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14139         method is invoked before any code generation takes place, and it
14140         is a mechanism to inform that the expression will be invoked more
14141         than once, and that the method should use temporary values to
14142         avoid having side effects
14143
14144         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14145
14146         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14147         implementation.
14148
14149         * expression.cs (Indirection, ArrayAccess): Add support for
14150         CacheTemporaries in these two bad boys. 
14151
14152         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14153         ldobj or ldind_ref.  
14154         (StoreFromPtr): Handle stobj as well.
14155
14156         * expression.cs (UnaryMutator): Share more code.
14157
14158         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14159         down: I was not tracking the Filter function as well, which
14160         was affecting the results of the cache.
14161
14162 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14163
14164         * attribute.cs: Remove the hack to handle the CharSet property on
14165         StructLayouts. 
14166
14167 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14168
14169         * attribute.cs (DoResolve): More uglyness, we now only try to
14170         resolve the attribute partially, to extract the CharSet
14171         information (only if we are a StructLayout attribute).  Otherwise 
14172
14173         (GetExtraTypeInfo): Add some code to conditionally kill in the
14174         future this.   I am more and more convinced that the .NET
14175         framework has special code to handle the attribute setting on
14176         certain elements.
14177
14178         * expression.cs (IsParamsMethodApplicable): Revert my previous
14179         foreach change here, it was wrong.
14180
14181 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14182
14183         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14184         (pp_expr): do not abort on unknown input, just return.
14185         (eval): abort if there are pending chars.
14186
14187         * attribute.cs (Attribute.Resolve): Positional parameters are
14188         optional.  Deal with that case.
14189
14190         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14191         the Ansi/Unicode/Auto information for the type.
14192
14193         (TypeContainer.DefineType): instantiate the EmitContext here, as
14194         we will be using it during the type definition (to resolve
14195         attributes) and during the emit phase.
14196
14197         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14198         to pull type information out of the attributes
14199
14200         (Attribute.Resolve): track the constructor builder, and allow for
14201         multiple invocations (structs and classes will use this).
14202
14203         * ecore.cs (MemberLookupFinal): new version with all the
14204         parameters customizable.
14205
14206         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14207         constructors.  Return if the result value is null (as the error
14208         would have been flagged already by MemberLookupFinal)
14209
14210         Do not allow instances of abstract classes or interfaces to be
14211         created.
14212
14213         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14214         We have to compare the assembly property here when dealing with
14215         FamANDAssem and Assembly access modifiers, because we might be
14216         creating an assembly from *modules* (that means that we are not
14217         getting TypeBuilders for types defined in other modules that are
14218         part of this assembly).
14219
14220         (Method.Emit): If the method is marked abstract and has a body,
14221         emit an error. 
14222
14223         (TypeContainer.DefineMembers): If both the defined member and the
14224         parent name match are methods, then do not emit any warnings: let
14225         the Method.Define routine take care of flagging warnings.  But if
14226         there is a mismatch (method overrides something else, or method is
14227         overriwritten by something, then emit warning).
14228
14229         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14230         set to null, this means `do not check for the return type on the
14231         signature'. 
14232
14233         (Method.Define): set the return type for the method signature to
14234         null, so that we get methods with the same name and parameters and
14235         different return types.  This is used to flag warning 114 (you are
14236         hiding a method, and you probably want to use the new/override
14237         keywords instead).
14238
14239         * typemanager.cs (MemberLookup): Implemented proper access
14240         control, closing a long standing set of bug reports.  The problem
14241         was that the Framework only has two bits: Public and NonPublic,
14242         and NonPublic includes private and protected methods, but we need
14243         to enforce the FamANDAssem, FamOrAssem and Family. 
14244
14245 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14246
14247         * statement.cs (GotoCase): Return true: Ammounts to giving up
14248         knowledge on whether we return or not, and letting the other case
14249         be responsible for it.
14250
14251 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14252
14253         * driver.cs: Do not load directories for each file processed, only
14254         do it if there is a pattern.
14255
14256         * ecore.cs: Report readonly assigns here as well, as we might have
14257         been resolved only by MemberAccess.
14258
14259         (SimpleName.SimpleNameResolve): Also be useful for LValue
14260         resolution.   We need this to propagate assign to local readonly variables
14261
14262         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14263         do not want to reuse potential criteria memory.
14264
14265         * class.cs (MyEventBuilder): Set reflected_type;
14266
14267         * ecore.cs (Constantify): Added support for constifying bools.
14268
14269         (RootContext.LookupType): Added a cache for values looked up in
14270         the declaration space.
14271
14272         * typemanager.cs (FindMembers): Now is a front-end to
14273         RealFindMembers, and provides a two-level hashtable-based cache to
14274         the request.  
14275
14276         15% performance improvement: from 22.5 to 19.2 seconds.
14277
14278         * expression.cs (IsParamsMethodApplicable): use foreach.
14279         (Invocation.DoResolve): ditto.
14280         (New.DoResolve): ditto.
14281         (ArrayCreation.DoResolve): ditto.
14282
14283         * ecore.cs (FindMostEncompassingType): use foreach.
14284
14285         * delegate.cs (NewDelegate.DoResolve): Use foreach
14286
14287         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14288         (RemoveMethods): use foreach.
14289
14290         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14291         nested foreach statements instead of for, and also break out of
14292         the inner loop once a match is found.
14293
14294         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14295
14296 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14297
14298         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14299         we actually unwrap the expression to allow for extra information
14300         to be extracted. 
14301
14302         * expression.cs: Use Shr_Un on unsigned operations. 
14303
14304 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14305
14306         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14307         applicable operators was not being considered correctly. This closes
14308         the bug Miguel reported.
14309
14310 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14311
14312         * attribute.cs: check that the type derives from System.Attribute
14313         and report the correct error in that case (moved the duplicate code to
14314         its own method, too).
14315
14316 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14317
14318         * attribute.cs: lookup attribute type name as the spec says: first the
14319         bare attribute name and then name + "Attribute" (nant compiles with
14320         mcs after this fix).
14321
14322 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14323
14324         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14325         Because of the way we parse things, we should try to see if a
14326         UIntConstant can fit in an integer.
14327
14328 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14329
14330         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14331         when we are in an explicit context.
14332
14333         (ConvertReferenceExplicit): When converting from Iface type S to Class
14334         T make sure the rules are implemented as an OR.
14335
14336         * parameter.cs (ParameterType): Make it a property for now although the
14337         purpose really isn't anything immediate.
14338
14339         * expression.cs (Is*Applicable): Do better checking on the parameter type
14340         of a ref/out parameter. The ones from the system assemblies are already 
14341         marked with the correct type so we don't need to do any correction.
14342
14343         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14344         the object type is standard too so include that.
14345
14346 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14347
14348         * ecore.cs (StandardConversionExists): Augment with missing code:
14349         deal with IntConstant, LongConstants and Enumerations.
14350
14351         * assign.cs: Report the error, instead of failing silently
14352
14353         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14354         typecontainer that they are declared, because the
14355         typecontainer/namespace will have the list of using clauses that
14356         need to be applied.
14357
14358         Assembly Attributes were escaping the normal registration
14359         mechanism. 
14360
14361         (EmitCode): Apply attributes within an EmitContext that represents
14362         the container they were declared on.
14363
14364         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14365
14366 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14367
14368         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14369         Revamp completely - make much cleaner as we now operate only
14370         on a set of Types.
14371
14372         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14373         to implement the logic detailed in the spec more correctly.
14374
14375         (UserDefinedConversion): Update accordingly.
14376
14377 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * statement.cs: Return flow analysis information up.
14380
14381         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14382         and the default.
14383
14384         (token): Do not consume an extra character before calling
14385         decimal_digits.
14386
14387 2002-05-06  Piers Haken <piersh@friskit.com>
14388
14389         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14390
14391 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14394         EmitContext during the instance constructor initializer
14395         resolution, to stop access to instance variables.
14396
14397         This is mandated by the spec, last paragraph of the `constructor
14398         initializers' section. 
14399
14400 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14401
14402         * cs-parser.jay, class.cs (Accessor): new class used to represent
14403         an accessor (get or set).  In the past we used `null' to represent
14404         a missing accessor.  But this is ambiguous because there was no
14405         way to tell in abstract indexers/properties if one of them was
14406         specified.
14407
14408         Now there is a way of addressing that.
14409
14410         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14411         instead of FindMembers.
14412
14413         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14414         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14415
14416         * attribute.cs: Treat indexers and properties as the same in terms
14417         of applying attributes
14418
14419         * ecore.cs (FindMostEncompassedType): Use statically initialized
14420         EmptyExpressions()s like we do elsewhere to avoid creating useless
14421         objects (and we take this out of the tight loop).
14422
14423         (GetConversionOperators): Move the code to extract the actual
14424         operators to a separate routine to clean things up.
14425
14426 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14427
14428         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14429         events are always registered FieldBuilders.
14430
14431         * class.cs (FieldBase): New class shared by Fields 
14432
14433         * delegate.cs: If we are a toplevel delegate, use our full name.
14434         If we are a nested delegate, then only use our tail name.
14435
14436 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14437
14438         * expression.cs (IsApplicable): Ensure that we add the "&" to
14439         ref/out types before comparing it with the type of the argument.
14440
14441         (IsParamsMethodApplicable): Ditto.
14442
14443         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14444         silly me ;-)
14445
14446         * delegate.cs : Handle the case when we have more than one applicable
14447         method. Flag an error only when we finish checking all.
14448
14449 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14450
14451         * expression.cs: Add support for boolean static initializers.
14452
14453 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14454
14455         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14456
14457         * parameter.cs (ComputeParameterTypes,
14458         ComputeAndDefineParameterTypes): Better error handling: now we
14459         clear the `types' cache if we fail during any of the type lookups.
14460         We also return the status code correctly to our caller
14461
14462         * delegate.cs: If we fail to define a delegate, abort the extra
14463         steps. 
14464
14465         * expression.cs (Binary.ResolveOperator): for
14466         operator==(object,object) and operator !=(object, object) we also
14467         have to verify that there is an implicit conversion from one to
14468         the other.
14469
14470         (ArrayAccess.DoResolve): Array Access can operate on
14471         non-variables. 
14472
14473 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14474
14475         * assign.cs (CompoundAssign): A new class used as a "flag" that
14476         the assignment actually is happening as part of a compound
14477         assignment operator.
14478
14479         During compound assignment, a few new rules exist to enable things
14480         like:
14481
14482         byte b |= 1 + 2
14483
14484         From the spec:
14485
14486         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14487         to the type of x) if y is implicitly convertible to the type of x,
14488         and the operator is a builtin operator and the return type of the
14489         operator is explicitly convertible to the type of x. 
14490
14491         * rootcontext.cs: Reset warning level to 2.  4 catches various
14492         "interesting" features in mcs, we must clean this up at some
14493         point, but currently am trying to kill other bugs ;-)
14494
14495         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14496         in container classes as well.  
14497
14498         * expression.cs (Binary.ResolveOperator): Handle string case
14499         before anything else (as operator overloading does emit an error
14500         before doing anything else).
14501
14502         This code could go away when we move to a table driven model, but
14503         i could not come up with a good plan last night.
14504
14505 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14506
14507         * typemanager.cs (CSharpName): reimplementation using regex.
14508         * class.cs: added null check for fields in Emit
14509         * rootcontext.cs: set warninglevel to 4
14510
14511 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14512
14513         * typemanager.cs (CSharpName): reimplemented with Lupus
14514         suggestion.
14515
14516 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14517
14518         * statement.cs (If): correclty implement Resolve, because we were
14519         not catching sem errors in there.  The same process is needed
14520         everywhere else. 
14521         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14522
14523
14524         (Statement.Warning_DeadCodeFound): Factorize code.
14525         (While): Report dead code here too.
14526
14527         (Statement): Added Resolve virtual method to allow
14528         for resolution split from the emit code.
14529
14530 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * statement.cs (EmitBoolExpression): No longer try to resolve the
14533         expression here.    
14534         (MakeBoolean): New utility function that resolve, implicitly
14535         converts to boolean and tags the expression. 
14536
14537
14538         (If, Do): Implement dead code elimination.
14539         (While): Implement loop inversion
14540
14541         (Do, While, For, If): Resolve the expression prior to calling our
14542         code generation.
14543
14544 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14545
14546         * class.cs:
14547           - added method Report28 (warning: program has more than one entry point)
14548           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14549           - modified method Method.Define, the part at the end of the method
14550
14551         * rootcontext.cs: added static public Location EntryPointLocation;
14552           
14553         * ../errors/cs0028.cs : Add test case for the above warning.              
14554
14555         * typemanager.cs:
14556           - modified method CSharpName to allow arrays of primitive type to
14557             be printed nicely (e.g. instead of System.Int32[][] it now prints
14558             int[][])
14559           - added method CSharpSignature: returns the signature of a method
14560             in string format to be used in reporting errors, warnings, etc.
14561
14562         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14563         with String.Empty.
14564
14565 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14566
14567         * delegate.cs (Define): Fix extremely silly bug where I was
14568         setting the type of the 'object' parameter of the BeginInvoke
14569         method to System.IAsyncResult instead of System.Object ;-)
14570
14571 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14574         here. 
14575
14576         (Constructor.Emit): return if we fail to initialize the
14577         constructor.  Another door closed!  
14578
14579         * expression.cs (New.DoResolve): Improve error message (from -6 to
14580         1501).  Use DeclaredOnly lookup to find the exact constructor.
14581
14582         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14583         loop.  This is useful.
14584
14585         * cs-parser.jay: Adjust the default parameters so that destructors
14586         have the proper signature.
14587
14588 2002-04-26  Martin Baulig  <martin@gnome.org>
14589
14590         * driver.cs (LoadAssembly): If `assembly' contains any characters
14591         which are only valid in path names and not in assembly names
14592         (currently slash, backslash and point), use Assembly.LoadFrom ()
14593         instead of Assembly.Load () on the `assembly' (before iteration
14594         over the link_paths).
14595
14596 2002-04-26  Martin Baulig  <martin@gnome.org>
14597
14598         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14599
14600 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14601
14602         * class.cs (Property): use the new typemanager.MemberLookup
14603
14604         (TypeContainer.MemberLookup): Implement using the
14605         TypeManager.MemberLookup now. 
14606
14607         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14608         and return MemberInfos, so that these can be used without an
14609         EmitContext (what we had before).
14610
14611 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14612
14613         * expression.cs: Fix the case where the argument to params if the
14614         type of the params.  I omitted handling this before.   Fixed
14615
14616 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14617
14618         * driver.cs: Call BootCorlib_PopulateCoreType
14619
14620         * class.cs (Property.CheckBase): Check for properties only, not
14621         for all members. 
14622
14623         * interface.cs: Temporary hack: try/catch around the
14624         CustomAttributeBuilder, because I am getting an exception that I
14625         do not understand.
14626
14627         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14628         types whose definitions are required to be there (attributes are
14629         defined before standard types).
14630
14631         Compute definitions as we boot the various types, as they are used
14632         immediately (value_type class will need object_type, but if we do
14633         not initialize object_type, we will pass a null, which will let
14634         the runtime pick the System.Object from the existing corlib, which
14635         is not what we want).
14636
14637 2002-04-22  Patrik Torstensson <totte@labs2.com>
14638
14639         * cs-tokenizer.cs: fixed a number of trim() issues.
14640
14641 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14642
14643         * expression.cs (Argument.Type): Ensure that we return the correct
14644         type when we have out or ref parameters [in which case we 
14645         append a "&"].
14646
14647 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14648
14649         * class.cs (Property, Indexer): Allow extern modifier in there. 
14650
14651         * typemanager.cs (InitBaseTypes): Initializes object_type and
14652         value_type, since those will be used early on during the bootstrap
14653         process to compile corlib.
14654
14655         (InitCoreTypes): Move code from here to InitBaseTypes.
14656
14657 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14658
14659         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14660         single-dimension arrays as using the ldlen opcode.  
14661
14662         Daniel Lewis discovered this optimization.  
14663
14664         * typemanager.cs: Add signature for System.Array::get_Length
14665
14666 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14667
14668         * statement.cs: report the error when the foreach does not apply to an
14669         array nor a collection.
14670
14671 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14672
14673         * expression.cs: Add implicit conversions to the operator ~.
14674
14675         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14676
14677         * typemanager.cs: Locate the decimal constructor.
14678
14679 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14680
14681         * attribute.cs: use the new property of TypeOf.
14682         * expression.cs: added 'get' property around typearg.
14683
14684         These changes fix a build breaker reported by NickD. Is this the
14685         correct way to fix?  If not, please, revert my changes and make it
14686         work :-).
14687
14688 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14689
14690         * attribute.cs: Add support for typeof in attribute invocations.
14691         I am not sure that this is right though.
14692
14693 2002-04-14  Duncan Mak  <duncan@ximian.com>
14694
14695         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14696         Binary.Operator.Division case.
14697
14698 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14699
14700         * class.cs (DefineType): Ensure that we do a proper check on
14701         attribute types and also register it with the TypeManager.
14702
14703         (TypeContainer.Targets): The default for attribute types is
14704         AttributeTargets.All.
14705
14706         * attribute.cs (ApplyAttributes): Registering the attribute type
14707         is done elsewhere, not when we discover we have a Usage attribute.
14708
14709 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14710
14711         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14712         and get rid of is_delegate parameter.
14713
14714         * everywhere : update.
14715
14716 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14717
14718         * cs-parser.jay (compilation_unit): Revamp completely to use
14719         some new ideas that I got from Rhys' grammar to solve the problems
14720         with assembly level attributes.
14721
14722         (outer_declaration): New grammar production.
14723
14724         (attribute_sections): Add.
14725
14726         (opt_attributes): Base on attribute_sections
14727
14728         (namespace_declaration): Allow opt_attributes to tackle the case
14729         when we have assembly level attributes - we are clever in this
14730         regard now ;-)
14731
14732         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14733         attributes in the non-global context.
14734
14735         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14736         instead of SetGlobalAttributes.
14737
14738         * class.cs, rootcontext.cs : Ensure we define and generate 
14739         attribute types before anything else.
14740
14741         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14742         and flag the new error -20 for the case when the attribute type
14743         does not have valid targets specified. csc does not catch this.
14744
14745         * ../errors/errors.txt : update for error # -20
14746
14747 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14748
14749         * support.cs (InternalParameters.ParameterModifier): Do some null
14750         checking and return sane values.
14751
14752         * class.cs (Method.Define): If we are a PInvoke method, ensure
14753         that we are static and extern. Report error # 601
14754
14755         * ../errors/cs0601.cs : Add test case for the above error.
14756
14757 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14758
14759         * rootcontext.cs (attribute_types): We need to keep type of
14760         all attribute types separately and emit code for them first.
14761
14762         (RegisterAttribute) : Implement.
14763
14764         * class.cs (DefineType): Check if the current Type is a custom
14765         attribute type and register it accordingly.
14766
14767         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14768         adding the first attribute twice and rename to
14769
14770         (SetGlobalAttributes): this.
14771
14772         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14773         lookups.
14774
14775         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14776         if we are processing global arguments. Hmm, I am unsure of this.
14777
14778 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14779
14780         * expression.cs: added static array of strings to avoid calling
14781         Enum.ToString () for Operator in Binary. Significant recover of
14782         performance.
14783
14784 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14785
14786         * class.cs (FindMembers): Allow the Builders of the various
14787         members to be null.  If they are skip them.  This only happens
14788         during the PInvoke declaration.
14789
14790 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14793         failure, so we do not keep going afterwards.
14794
14795         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14796         wanted to pass `false' as the `is_delegate' argument.  If this is
14797         the case, why not use delegate_type == null to mean `is_delegate =
14798         false' and anything else as is_delegate = true.
14799
14800 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14801
14802         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14803         code for the section, not the beginning of the tests.
14804
14805 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14806
14807         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14808
14809         * expression.cs (Binary): same.  Warn about errors where we have
14810         Enum/Enum in operator + as well.
14811
14812 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14813
14814         * statement.cs:
14815                 - added support for switch(bool)
14816                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14817                 - add TableSwitchEmit() to handle table-based switch statements
14818
14819 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14820
14821         * expression.cs (Invocation.OverloadResolve): Factor out code which
14822         does parameter compatibility checking with arguments so that we can 
14823         re-use the code even from Delegate.VerifyApplicability
14824
14825         (VerifyArgumentsCompat): Move above code here.
14826
14827         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14828         and instead make a call to the above method.
14829
14830 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14831
14832         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14833         We use it to keep track of classes which are attribute types.
14834
14835 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14836
14837         * delegate.cs (Delegate.Define): Correctly define the types in the
14838         presence of fixed and array parameters.
14839
14840         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14841         doing FindMembers.
14842
14843         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14844         include NonPublic after the first iteration.
14845
14846         * class.cs (Indexer.CheckBase): Only check if both parents are
14847         non-null. 
14848
14849         * cs-parser.jay (accessor_body): If empty, set to null.
14850
14851         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14852         same code path here to resolve constants names that we did have in
14853         MemberAccess.DoResolve.  There is too much code duplicated here.
14854
14855 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14858
14859         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14860         to MakeUnionSet.
14861
14862         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14863         tokens, numbers and strings.
14864
14865         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14866         parenthesis.
14867
14868         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14869         asyncronous parameters and the regular parameters.  
14870
14871         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14872         specify the target directory.
14873
14874         * expression.cs: (This.DoResolve): Simplify
14875         (As.Emit): Optimize, do not generate IsInst if the expression is
14876         always of the given type.
14877
14878         (Is.DoResolve): Bug fix, we were reporting both always/never for
14879         the is expression.
14880
14881         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14882         creating too many unnecessary arrays.
14883
14884 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14885
14886         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14887         fields instead of rolling our own initializer.   Takes care of all
14888         implicit conversions, and drops unnecessary static checks/argument.
14889
14890 2002-03-31  Dick Porter  <dick@ximian.com>
14891
14892         * driver.cs: use the GetDirectories() return values properly, and
14893         use "/" as path separator.
14894
14895 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14896
14897         * expression.cs (Unary): Optimize - - expr into expr.
14898         (Binary): Optimize a + (-b) into a -b.
14899
14900         * codegen.cs (CodeGen): Made all methods static.
14901
14902 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14903
14904         * rootcontext.cs: 
14905
14906         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14907         TypeBuilder property.
14908
14909         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14910         instead. 
14911
14912         * tree.cs: Removed the various RecordXXXX, and replaced with a
14913         single RecordDecl.  Removed all the accessor methods, and just
14914         left a single access point Type 
14915
14916         * enum.cs: Rename DefineEnum to DefineType.
14917
14918         * decl.cs: New abstract method `DefineType' used to unify the
14919         Defines for Enumerations, Interfaces, TypeContainers and
14920         Delegates.
14921
14922         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14923         LookupBaseClasses method that used to live in class.cs and
14924         interface.cs here, and renamed to FindType.
14925
14926         * delegate.cs: Implement DefineType.  Take advantage of the
14927         refactored pattern for locating the parent builder without taking
14928         the parent_builder argument (which we know does not work if we are
14929         nested, and triggering a toplevel definition).
14930
14931 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14934         accessibility of a member has changed during override and report
14935         an error if so.
14936
14937         * class.cs (Method.Define, Property.Define): Only complain on
14938         overrides if the method is private, any other accessibility is
14939         fine (and since we just checked the permission is the same, we are
14940         good to go).
14941
14942         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14943         and elif are processed always.  The other pre-processing
14944         directives are only processed if we are "taking" the path
14945
14946 2002-03-29  Martin Baulig  <martin@gnome.org>
14947
14948         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14949         current location is not Null.
14950
14951         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14952         a separate method so we can profile it.
14953
14954         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14955         `span.Seconds' are just seconds, but no minutes or hours.
14956         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14957
14958 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14961         Remove the gratuitous set of Final:
14962
14963                                 // If an interface implementation, then we can set Final.
14964                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14965                                     implementing.DeclaringType.IsInterface)
14966                                         flags |= MethodAttributes.Final;
14967
14968         I do not know what I was smoking when I used that.
14969
14970
14971         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14972         step into fixing the name resolution issues for delegates and
14973         unifying the toplevel name resolution.
14974
14975 2002-03-28  Martin Baulig  <martin@gnome.org>
14976
14977         * class.cs (Method.Emit): If we have a symbol writer, call its
14978         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14979         tell it about the current method.
14980
14981         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14982         writer that we're going to emit the first byte of IL code for a new
14983         statement (a new source line).
14984         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14985         EmitContext.Mark() before emitting any code.
14986
14987         * location.cs (SymbolDocument): Return null when we're Null.
14988
14989         * statement.cs (Statement): Moved the `Location loc' variable here.
14990         (Statement.EmitBoolExpression): If we have a symbol writer, call
14991         ec.Mark() before emitting any code to tell it that we're at the
14992         beginning of a new statement.
14993         (StatementExpression): Added `Location' argument to the constructor.
14994         (Block): Added public readonly variable `StartLocation' and public
14995         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14996         (Block): Added constructor which takes a start and end location.
14997         (Block.SetEndLocation): New method. This sets the end location.
14998         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14999         local variables we create.
15000         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15001         each statement and do also mark the begin and end of the block.
15002
15003         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15004         tell it the current lexer.Location, use Location.Null for the end of the
15005         block.
15006         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15007         current block, set its end location using SetEndLocation().
15008         (statement_expression): StatementExpression constructor now takes the
15009         lexer.Location as additional argument.
15010         (for_statement, declare_local_variables): Likewise.
15011         (declare_local_variables): When creating a new implicit block, use the
15012         new Block constructor and pass it the lexer.Location.
15013
15014 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15015
15016         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15017         members also on the parent interfaces recursively.
15018
15019 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15020
15021         * report.cs: Use new formats, since Gonzalo finished the missing
15022         bits. 
15023
15024         * expression.cs (Binary.ResolveOperator): added missing operator|
15025         operator& and operator^ for bool/bool.
15026
15027         * cs-parser.jay: CheckDef now takes a Location argument that is
15028         used to report errors more precisly (instead of reporting the end
15029         of a definition, we try to track something which is a lot closer
15030         to the source of the problem).
15031
15032         * cs-tokenizer.cs: Track global token use, so we can properly flag
15033         the use of #define/#undef after the first token has been seen.
15034
15035         Also, rename the reportXXXX to Error_DescriptiveName
15036
15037         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15038         TypeContainer, so that Enum and Interface can use this too.
15039
15040         * class.cs (TypeContainer.LookupInterfaceOrClass,
15041         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15042         `builder' argument.  Typically this was used to pass the parent
15043         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15044         the definition).  
15045
15046         The problem is that a nested class could trigger the definition of
15047         a toplevel class, and the builder would be obviously wrong in that
15048         case. 
15049
15050         So we drop this argument, and we compute dynamically the
15051         TypeBuilder/ModuleBuilder (the correct information was available
15052         to us anyways from DeclSpace.Parent)
15053
15054         * interface.cs (Interface.DefineInterface): Drop builder
15055         parameter cleanup like class.cs
15056
15057         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15058         like class.cs
15059
15060         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15061         values. 
15062
15063         (Try.Emit): Propagate the returns value from the statement.
15064
15065         (Return.Emit): Even if we are leavning 
15066
15067         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15068
15069         * modifiers.cs: Fix the computation of MethodAttributes flags.
15070
15071 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15072
15073         * driver.cs: allow compilation of files that start with '/'.
15074         Add a default case when checking the argument of --target.
15075
15076 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15077
15078         * interface.cs: Implement the same search algorithm for types in
15079         the interface code.
15080
15081         * delegate.cs: Do not allow multiple definition.
15082
15083         * Recovered ChangeLog that got accidentally amputated
15084
15085         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15086
15087         * rootcontext.cs: Load manually enum to allow core classes to
15088         contain enumerations.
15089
15090         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15091         Update to new static methods in TypeManager.
15092
15093         * typemanager.cs (GetMethod, GetConstructor): Use our
15094         implementation of FindMembers to find the members, since during
15095         corlib compilation, the types are TypeBuilders and GetMethod and
15096         GetConstructor do not work.
15097
15098         Make all methods in TypeManager static.
15099
15100         (InitCodeHelpers): Split the functionality from
15101         the InitCodeTypes function.
15102
15103         * driver.cs: Call InitCodeHelpers after we have populated the
15104         types. 
15105
15106         * cs-parser.jay (delegate_declaration): we did not used to compute
15107         the delegate name correctly for void delegates.
15108
15109 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15110
15111         * rootcontext.cs (RootContext): Init the interface_resolve_order
15112         and type_container_resolve_order always.
15113
15114         (ResolveCore, BootstrapCorlib_ResolveClass,
15115         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15116         compiler when compiling with --nostdlib
15117
15118         * class.cs (TypeContainer.DefineType): Check that our parent is
15119         not null.  This test is most important when we are bootstraping
15120         the core types.
15121
15122         * codegen.cs: Split out the symbol writing code.
15123
15124 2002-03-25  Martin Baulig  <martin@gnome.org>
15125
15126         * driver.cs (-g): Made -g an alias for --debug.
15127
15128 2002-03-24  Martin Baulig  <martin@gnome.org>
15129
15130         * codegen.cs (SymbolWriter): New public variable. Returns the
15131         current symbol writer.
15132         (CodeGen): Added `bool want_debugging_support' argument to the
15133          constructor. If true, tell the ModuleBuild that we want debugging
15134         support and ask it for the ISymbolWriter.
15135         (Save): If we have a symbol writer, call it's Close() method after
15136         saving the assembly.
15137
15138         * driver.c (--debug): New command line argument to create a
15139         debugger information file.
15140
15141         * location.cs (SymbolDocument): New public property. Returns an
15142         ISymbolDocumentWriter object for the current source file or null
15143         if we don't have a symbol writer.
15144
15145 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15146
15147         * driver.cs (LoadAssembly): Correctly return when all the paths
15148         have been tried and not before.
15149
15150         * statement.cs (Switch.Emit): return the actual coverage for this
15151         statement (returns/not-returns)
15152
15153         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15154         switch of the statement if we are the last switch section.  That
15155         kills two problems: try/catch problems (we used to emit an empty
15156         nop at the end) and switch statements where all branches would
15157         return. 
15158
15159 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15160
15161         * driver.cs: Add default assemblies (the equivalent to the
15162         Microsoft CSC.RSP file)
15163
15164         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15165         also update tokens_seen and set it to false.
15166
15167         * driver.cs: Implement --recurse for Mike.
15168
15169         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15170         correctly splitting out the paths.
15171
15172 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * interface.cs (Interface.PopulateProperty): Instead of using
15175         `parent' as the declaration space for the set parameters, use
15176         `this' 
15177
15178         * support.cs (InternalParameters): InternalParameters constructor
15179         takes a DeclSpace instead of a TypeContainer.
15180
15181         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15182         types are being initialized, load the address of it before calling
15183         the function.  
15184
15185         (New): Provide a mechanism to disable the generation of local
15186         value type temporaries when the caller will be providing us with
15187         an address to store it.
15188
15189         (ArrayCreation.EmitDynamicInitializers): Use it.
15190
15191 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * expression.cs (Invocation.EmitArguments): Only probe for array
15194         property if there is more than one argument.  Sorry about that.
15195
15196         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15197         empty param arrays.
15198
15199         * class.cs (Method.LabelParameters): Fix incorrect code path that
15200         prevented the `ParamArrayAttribute' from being applied to the
15201         params attribute.
15202
15203 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15204
15205         * support.cs (ReflectionParameters): Correctly compute whether the
15206         last argument is a params array.  Fixes the problem with
15207         string.Split ('a')
15208
15209         * typemanager.cs: Make the assemblies array always be non-null
15210         (empty, but non-null)
15211
15212         * tree.cs (RecordDecl): New function that abstracts the recording
15213         of names.  This reports error 101, and provides a pointer to the
15214         previous declaration.  Fixes a crash in the compiler.
15215
15216         * cs-parser.jay (constructor_declaration): Update to new grammar,
15217         and provide a constructor_body that can be empty.
15218
15219 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * driver.cs: Add support for --resources.
15222
15223         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15224         Make all types for the various array helper methods be integer.
15225
15226         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15227         CheckState to ConvCast.
15228
15229         (ConvCast): Now it takes a `checked' state argument, to avoid
15230         depending on the emit context for the conversion, and just using
15231         the resolve time setting.
15232
15233         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15234         instead of Invocation.EmitArguments.  We do not emit the original
15235         arguments, instead we emit those which have been converted to
15236         unsigned int expressions.
15237
15238         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15239
15240         * codegen.cs: ditto.
15241
15242         * expression.cs (LocalVariableReference): Drop the use of the
15243         Store function that depended on the variable index.
15244
15245         * statement.cs (VariableInfo): Drop the `Idx' property from this
15246         class, as this is not taking into account the indexes for
15247         temporaries tat we generate during the execution, getting the
15248         indexes wrong.
15249
15250         * class.cs: First emit class initializers, then call the parent
15251         constructor. 
15252
15253         * expression.cs (Binary): Fix opcode emision.
15254         (UnaryMutator.EmitCode): Support checked code generation
15255
15256         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15257         matches for events for both the Static and Instance scans,
15258         pointing to the same element.   Fix that.
15259
15260 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15261
15262         * rootcontext.cs (ResolveTree): Always set the
15263         interface_resolve_order, because nested interfaces will be calling
15264         into us.
15265
15266         * class.cs (GetInterfaceOrClass): Track the same resolution
15267         process used by TypeManager.LookupType.  This fixes the nested
15268         type lookups in class declarations (separate path from
15269         LookupType). 
15270
15271         (TypeContainer.DefineType): Also define nested interfaces.
15272         (TypeContainer.RegisterOrder): New public function used to
15273         register the order in which child interfaces need to be closed.
15274
15275         Nested interfaces need to be closed after their parents have been
15276         created. 
15277
15278         * interface.cs (InterfaceAttr): Put all the logic for computing
15279         the interface attribute here. 
15280
15281         (DefineInterface): Register our interface order with the
15282         RootContext or with the TypeContainer depending on the case.
15283
15284 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15285
15286         * cs-parser.jay: rework foreach statement to work with the new
15287         changes to the policy on SimpleNames.
15288
15289         * report.cs: support Stacktrace on warnings as well.
15290
15291         * makefile: drop --unsafe and /unsafe from the compile.
15292
15293 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15294
15295         * ecore.cs (StandardConversionExists): Modify to take an Expression
15296         as the first parameter. Ensure we do null -> reference type conversion
15297         checking.
15298
15299         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15300         temporary Expression objects.
15301
15302 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15303
15304         * interface.cs: workaround bug in method overloading resolution
15305         (there is already a bugzilla bug for it).
15306
15307 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15308
15309         We could also solve this problem by having a separate path for
15310         performing type lookups, instead of DoResolve, we could have a
15311         ResolveType entry point, and only participating pieces of the
15312         production (simplename, deref, array) would implement this. 
15313
15314         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15315         signal SimpleName to only resolve type names and not attempt to
15316         resolve anything else.
15317
15318         * expression.cs (Cast): Set the flag.
15319
15320         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15321
15322         * class.cs: Only report 108 if there is no `new' modifier.
15323
15324         * cs-parser.jay: rework foreach statement to work with the new
15325         changes to the policy on SimpleNames.
15326
15327         * report.cs: support Stacktrace on warnings as well.
15328
15329         * makefile: drop --unsafe and /unsafe from the compile.
15330
15331 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15332
15333         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15334         lookups here, instead of doing that at parse time.  This means
15335         that our grammar will not introduce `LocalVariableReferences' as
15336         expressions at this point.  That solves the problem of code like
15337         this:
15338
15339         class X {
15340            static void Main ()
15341            { int X = 1;
15342             { X x = null }}}
15343
15344         This is only half the fix.  The full fix requires parameters to
15345         also be handled in this way.
15346
15347         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15348         makes the use more obvious of the DeclSpace.  The
15349         ec.TypeContainer.TypeBuilder is now only used to pull the
15350         TypeBuilder for it.
15351
15352         My theory is that I can get rid of the TypeBuilder completely from
15353         the EmitContext, and have typecasts where it is used (from
15354         DeclSpace to where it matters).  
15355
15356         The only pending problem is that the code that implements Aliases
15357         is on TypeContainer, and probably should go in DeclSpace.
15358
15359         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15360         lookups here, instead of doing that at parse time.  This means
15361         that our grammar will not introduce `LocalVariableReferences' as
15362         expressions at this point.  That solves the problem of code like
15363         this:
15364
15365         class X {
15366            static void Main ()
15367            { int X = 1;
15368             { X x = null }}}
15369
15370         This is only half the fix.  The full fix requires parameters to
15371         also be handled in this way.
15372
15373         * class.cs (Property.DefineMethod): When implementing an interface
15374         method, set newslot, when implementing an abstract method, do not
15375         set the flag (before we tried never setting it, or always setting
15376         it, which is the difference).
15377         (Indexer.DefineMethod): same.
15378         (Method.DefineMethod): same.
15379
15380         * ecore.cs: Only set the status used flag if we get back a Field.
15381
15382         * attribute.cs: Temporary hack, so Paolo can keep working.
15383
15384 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15385
15386         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15387         the unmanaged type in the case we have a MarshalAs attribute.
15388
15389         (Resolve): Handle the case when we are parsing the special MarshalAs
15390         attribute [we need to store the unmanaged type to use later]
15391
15392         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15393         MarshalAs Attribute.
15394
15395         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15396         on parameters and accordingly set the marshalling info.
15397
15398 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * class.cs: Optimizing slightly by removing redundant code after
15401         we switched to the `NoTypes' return value.
15402         (Property.DefineMethod): use NoTypes here too.
15403
15404         This fixes the bug I introduced in my last batch of changes.
15405
15406 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15407
15408         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15409
15410         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15411         Enums since those are types too. 
15412
15413         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15414
15415         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15416         thanks to a call during the lookup process.
15417
15418 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * statement.cs (Foreach): Lots of work to accomodate a particular
15421         kind of foreach statement that I had not kept in mind.  It is
15422         possible to have foreachs on classes that provide a GetEnumerator
15423         method that return objects that implement the "pattern" for using
15424         a foreach, there is no need to support GetEnumerator
15425         specifically. 
15426
15427         This is needed to compile nant.
15428
15429         * decl.cs: Only report 114 if the member is not `Finalize' and if
15430         the warning level is at least 2.
15431
15432         * class.cs: Moved the compare function from Method to
15433         MethodSignature. 
15434
15435         (MethodSignature.InheritableMemberSignatureCompare): Add new
15436         filter function that is used to extract inheritable methods from a
15437         class. 
15438
15439         (Method.Define): Use the new `inheritable_method_signature_filter'
15440         delegate
15441
15442         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15443         command. 
15444
15445 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15446
15447         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15448
15449         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15450
15451         * expression.cs: Pass location information to
15452         ConvertImplicitStandard. 
15453
15454         * class.cs: Added debugging code to track return values from
15455         interfaces. 
15456
15457 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15458
15459         * expression.cs (Is.DoResolve): If either side of the `is' is an
15460         interface, do not flag the warning.
15461
15462         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15463         for interfaces
15464
15465         * report.cs: Allow for --fatal to be used with --probe.
15466
15467         * typemanager.cs (NoTypes): Move the definition for the empty Type
15468         array here. 
15469
15470         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15471         properties. 
15472         (TypeContainer.DefineProxy): New function used to proxy to parent
15473         implementations when implementing interfaces.
15474         (TypeContainer.ParentImplements): used to lookup if our parent
15475         implements a public function that is required by an interface.
15476         (TypeContainer.VerifyPendingMethods): Hook this up.
15477
15478         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15479         `modules' and `assemblies' arraylists into arrays.  We only grow
15480         these are the very early start up of the program, so this improves
15481         the speedof LookupType (nicely measured).
15482
15483         * expression.cs (MakeByteBlob): Replaced unsafe code with
15484         BitConverter, as suggested by Paolo.
15485
15486         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15487         folding of string concatenation, but if either side is a string,
15488         and the other is not, then return null, and let the runtime use
15489         the concatenation on the string plus the object (using
15490         `Object.ToString'). 
15491
15492 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15493
15494         Constant Folding has been implemented now.
15495
15496         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15497         the error instead on types that are not supported in one's
15498         complement. 
15499
15500         * constant.cs (Constant and all children): New set of functions to
15501         perform implict and explicit conversions.
15502
15503         * ecore.cs (EnumConstant): Implement the new functions to perform
15504         conversion by proxying to the child expression.
15505
15506         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15507         own separate setting that can not be turned off from the command
15508         line using --unchecked or --checked and is only controlled using
15509         the checked/unchecked statements and expressions.  This setting is
15510         used by the constant folder to flag errors.
15511
15512         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15513         ConstantCheckState as well.   
15514
15515         During Resolve, they also have to flag the state, because the
15516         constant folder runs completely in the Resolve phase.
15517
15518         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15519         well.
15520
15521 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * cfold.cs: New file, this file contains the constant folder.
15524
15525         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15526         argument to track whether we are using the resulting address to
15527         load or store a value and provide better error messages. 
15528
15529         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15530         new AddressOf arguments.
15531
15532         * statement.cs (Foreach.EmitCollectionForeach): Update
15533
15534         * expression.cs (Argument.Emit): Call AddressOf with proper
15535         arguments to track usage.
15536
15537         (New.DoEmit): Call AddressOf with new arguments.
15538
15539         (Unary.Emit): Adjust AddressOf call.
15540
15541 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15542
15543         * cs-parser.jay (member_access): Change the case for pre-defined types
15544         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15545         this suggestion.
15546
15547         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15548         a method body.
15549
15550         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15551         essentially like methods and apply attributes like MethodImplOptions to them too.
15552
15553         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15554         not being null.
15555
15556         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15557         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15558         is the DeclSpace.
15559
15560         * Update code everywhere accordingly.
15561
15562         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15563
15564         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15565
15566 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15567
15568         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15569         try performing lookups against those instead of jumping straight into using
15570         the 'using' clauses.
15571
15572         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15573
15574         (LookupType): Perform lookups in implicit parents too.
15575
15576         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15577         sequence as RootContext.LookupType. 
15578
15579         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15580         the various cases of namespace lookups into this method.
15581
15582 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15585         in positional arguments)
15586
15587         * class.cs (Operator): Update the AllowedModifiers to contain
15588         extern. 
15589
15590         * cs-parser.jay: Update operator declaration to allow for the
15591         operator body to be empty.
15592
15593         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15594         values. 
15595
15596 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15597
15598         * class.cs (Method.Emit): Label parameters.
15599
15600         * driver.cs: Return 1 or 0 as the program exit code.
15601
15602 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15603
15604         * expression.cs: Special case the `null' object when trying to
15605         auto-compute the type, as anything can be explicitly converted to
15606         that. 
15607
15608         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15609         spotting this Paolo.
15610
15611         (Expression.ImplicitNumericConversion): Perform comparissions of
15612         the type using the underlying type in the case of an enumeration
15613         rather than using the enumeration type for the compare.
15614
15615         Cope with the underlying == type case, which is not possible to
15616         catch before. 
15617
15618         (Expression.ConvertNumericExplicit): Perform comparissions of
15619         the type using the underlying type in the case of an enumeration
15620         rather than using the enumeration type for the compare.
15621
15622         * driver.cs: If the user does not supply an extension, assume .exe
15623
15624         * cs-parser.jay (if_statement): Rewrote so that we can track the
15625         location for the if statement.
15626
15627         * expression.cs (Binary.ConstantFold): Only concat strings when
15628         the operation is "+", not everything ;-)
15629
15630         * statement.cs (Statement.EmitBoolExpression): Take a location
15631         argument. 
15632         (If, While, Do): Track location.
15633
15634         * expression.cs (Binary.ResolveOperator): In the object + string
15635         case, I was missing a call to ConvertImplicit
15636
15637 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15638
15639         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15640         Location arguments. Ensure we use RootContext.LookupType to do our work
15641         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15642
15643         * interface.cs (PopulateMethod): Handle the type of the parameter being
15644         null gracefully.
15645
15646         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15647         have a params method with no fixed arguments and a call is made with no
15648         arguments.
15649
15650 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15651
15652         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15653         the verbatim-string-literal
15654
15655         * support.cs (InternalParameters.ParameterModifier): handle null
15656         fixed parameters.
15657         (InternalParameters.ParameterType): ditto.
15658
15659         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15660         duplicating the name of the variable parameter.
15661         (GetParameterByName): Fix bug where we were not looking up array
15662         paramters if they were the only present (thanks Paolo!).
15663         (GetParameterInfo): We only have an empty set of types if both
15664         fixed and array are set to null.
15665         (GetParameterInfo-idx): Handle FixedParameter == null
15666
15667         * cs-parser.jay: Handle the case where there is no catch
15668         statements (missing null test).
15669
15670 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15671
15672         * driver.cs (MainDriver): Be conservative on our command line
15673         handling.
15674
15675         Catch DirectoryNotFoundException when calling GetFiles.
15676
15677         (SplitPathAndPattern): Used to split the input specification into
15678         a path and a pattern that we can feed to Directory.GetFiles.
15679
15680 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15681
15682         * statement.cs (Fixed): Implement the last case of the Fixed
15683         statement (string handling).
15684
15685         * expression.cs (StringPtr): New class used to return a char * to
15686         a string;  Used by the Fixed statement.
15687
15688         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15689
15690         * expression.cs (Binary.ResolveOperator): Remove redundant
15691         MemberLookup pn parent type.
15692         Optimize union call, we do not need a union if the types are the same.
15693         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15694         type.
15695
15696         Specialize the use of MemberLookup everywhere, instead of using
15697         the default settings. 
15698
15699         (StackAlloc): Implement stackalloc keyword.
15700
15701         * cs-parser.jay: Add rule to parse stackalloc.
15702
15703         * driver.cs: Handle /h, /help, /?
15704
15705         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15706         before we supported unsafe code.
15707
15708         * makefile: add --unsafe to the self compilation of mcs.
15709
15710 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15711
15712         * expression.cs (PointerArithmetic): New class that is used to
15713         perform pointer arithmetic.
15714         (Binary.Resolve): Handle pointer arithmetic
15715         Handle pointer comparission.
15716         (ArrayPtr): Utility expression class that is used to take the
15717         address of an array.
15718
15719         (ElementAccess): Implement array access for pointers
15720
15721         * statement.cs (Fixed): Implement fixed statement for arrays, we
15722         are missing one more case before we are done.
15723
15724         * expression.cs (Indirection): Implement EmitAssign and set the
15725         ExprClass to Variable.  This allows pointer dereferences to be
15726         treated as variables, and to have values assigned to them.
15727
15728         * ecore.cs (Expression.StoreFromPtr): New utility function to
15729         store values dereferencing.
15730
15731 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15732
15733         * expression.cs (Binary.ResolveOperator): Ensure that we are
15734         not trying to operate on a void type - this fixes the reported
15735         bug.
15736
15737         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15738         the parent implementation is sealed.
15739
15740         * ../errors/cs0239.cs : Add.
15741
15742         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15743
15744         * typemanager.cs (unverifiable_code_type): Corresponds to 
15745         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15746         which have unsafe code in them.
15747
15748         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15749         unsafe context.
15750
15751 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15752
15753         * cs-tokenizer.cs: Add support for @"litreal strings"
15754
15755         Make tokenizer accept pre-processor directives
15756         on any column (remove the old C-like limitation). 
15757
15758         * rootcontext.cs (EmitCode): Emit any global attributes.
15759         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15760
15761         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15762
15763         * cs-parser.jay: Add support for global attributes.  
15764
15765 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15766
15767         * expression.cs (Indirection): New helper class.  Unary will
15768         create Indirection classes to be able to implement the
15769         IMemoryLocation interface on it.
15770
15771 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * cs-parser.jay (fixed_statement): reference the right statement.
15774
15775         * statement.cs (Fixed.Emit): Finish implementing the fixed
15776         statement for the &x case.
15777
15778 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * class.cs (Property.Define, Method.Define): Remove newslot when
15781         `implementing'.  
15782
15783         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15784         wrong.  NewSlot should only be used if the `new' keyword is present.
15785
15786         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15787         locating our system dir.  Sorry about this.
15788
15789 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15790
15791         * driver.cs (GetSystemDir): Compute correctly the location of our
15792         system assemblies.  I was using the compiler directory instead of
15793         the library directory.
15794
15795 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15796
15797         * expression.cs (BetterFunction): Put back in what Miguel commented out
15798         since it is the correct fix. The problem is elsewhere ;-)
15799
15800         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15801         parameters of the parms method are themselves compatible or not !
15802
15803         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15804         to check that a class implements an interface before saying that an implicit
15805         conversion was allowed. Use ImplementsInterface to do the checking.
15806
15807 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15808
15809         * class.cs (Method.Define): Track whether we are an explicit
15810         implementation or not.  And only call DefineMethodOverride if we
15811         are an explicit implementation.
15812
15813         (Property.DefineMethod): Ditto.
15814
15815 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15816
15817         * expression.cs (BetterFunction): Catch hideous bug which was
15818          preventing us from detecting ambiguous calls due to implicit casts i.e
15819         cs0121.
15820
15821 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15822
15823         * support.cs (Pair): Remove un-needed method.  I figured why I was
15824         getting the error in cs-parser.jay, the variable in a foreach loop
15825         is readonly, and the compiler does not really treat this as a variable.
15826
15827         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15828         instead of EQUALS in grammar.  
15829
15830         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15831
15832         * expression.cs (Unary.DoResolve): Check whether the argument is
15833         managed or not.
15834
15835 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15836
15837         * support.cs: Api for Pair to set a value.  Despite the fact that
15838         the variables are public the MS C# compiler refuses to compile
15839         code that accesses the field if the variable is part of a foreach
15840         statement. 
15841
15842         * statement.cs (Fixed): Begin implementation of the fixed
15843         statement.
15844
15845         (Block.AddVariable): Return the VariableInfo on success and null
15846         on failure instead of true/false. 
15847
15848         * cs-parser.jay (foreach): Catch errors on variables already
15849         defined (we were ignoring this value before) and properly unwind
15850         the block hierarchy
15851
15852         (fixed_statement): grammar for the fixed statement.
15853
15854 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15855
15856         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15857         pointer types to be incretemented.
15858
15859         (SizeOf): Implement.
15860
15861         * cs-parser.jay (pointer_member_access): Implement
15862         expr->IDENTIFIER production.
15863
15864         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15865         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15866         on safe contexts.
15867
15868         (Unary): Implement indirection.
15869
15870         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15871         use in non-unsafe context).
15872
15873         (SimpleName.DoResolve): Check for pointers in field access on safe
15874         contexts. 
15875
15876         (Expression.LoadFromPtr): Factor the load-indirect code in this
15877         function.  This was duplicated in UnboxCast and ParameterReference
15878
15879 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15880
15881         * expression.cs (ComposedCast): report an error if a pointer cast
15882         is used in a safe region.
15883
15884         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15885         pointer type casts in unsafe context.
15886
15887         * codegen.cs (EmitContext): Set up IsUnsafe.
15888
15889         * cs-parser.jay (non_expression_type): Add productions for pointer
15890         casts. 
15891
15892         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15893         code.  We should not use force into static mode if the method is
15894         not virtual.  Fixes bug in MIS
15895
15896         * statement.cs (Do.Emit, While.Emit, For.Emit,
15897         Statement.EmitBoolExpression): Add support to Do and While to
15898         propagate infinite loop as `I do return' semantics.
15899
15900         Improve the For case to also test for boolean constants.
15901
15902         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15903         to the list of attributes we can add.
15904
15905         Remove `EmitContext' argument.
15906
15907         * class.cs (Method.Define): Apply parameter attributes.
15908         (Constructor.Define): Apply parameter attributes.
15909         (MethodCore.LabelParameters): Move here the core of labeling
15910         parameters. 
15911
15912         * support.cs (ReflectionParameters.ParameterModifier,
15913         InternalParameters.ParameterModifier): Use IsByRef on the type and
15914         only return the OUT bit for these parameters instead of in/out/ref
15915         flags.
15916
15917         This is because I miss-understood things.  The ParameterInfo.IsIn
15918         and IsOut represent whether the parameter has the [In] and [Out]
15919         attributes set.  
15920
15921 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15922
15923         * ecore.cs (FieldExpr.Emit): Release temporaries.
15924
15925         * assign.cs (LocalTemporary.Release): new function.
15926
15927         * codegen.cs (EmitContext.GetTemporaryStorage,
15928         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15929         temporary storage.  Now we can "put back" localbuilders when we
15930         are done with them
15931
15932 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15935         need to make a copy of the variable to generate verifiable code.
15936
15937 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15938
15939         * driver.cs: Compute dynamically the system directory.
15940
15941         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15942         Slower, but more generally useful.  Used by the abstract
15943         registering implementation. 
15944
15945         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15946         the rules for the special rule on Type/instances.  First check if
15947         we have the same name, and if so, try that special static path
15948         rather than the instance path.
15949
15950 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15951
15952         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15953         for, while and if.
15954
15955         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15956         Enum, ValueType, Delegate or Array for non-corlib compiles.
15957
15958         * cs-tokenizer.cs: Catch long identifiers (645)
15959
15960         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15961         piece of code.
15962
15963         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15964         fix, we were returning too early, so we were not registering
15965         pending methods from abstract classes.
15966
15967         Do not register pending methods if the class is abstract.
15968
15969         * expression.cs (Conditional.DoResolve): Report circular implicit
15970         conversions when we neecd to compute it for conditional
15971         expressions. 
15972
15973         (Is.DoResolve): If the expression is always of the provided type,
15974         flag warning 183.  If the expression can not ever be of the
15975         provided type flag warning 184.
15976
15977         * class.cs: Catch 169 as well.
15978
15979         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15980         read. 
15981
15982 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15983
15984         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15985
15986 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * interface.cs: (PopulateMethod): Check for pointers being defined
15989         only if the unsafe context is active.
15990         (PopulateProperty): ditto.
15991         (PopulateIndexer): ditto.
15992
15993         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15994         specified.  If pointers are present, make sure that they are
15995         present in an unsafe context.
15996         (Constructor, Constructor.Define): ditto.
15997         (Field, Field.Define): ditto.
15998         (Property, Property.Define): ditto.
15999         (Event, Event.Define): ditto.
16000
16001         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16002         hashtable if there are classes or structs defined.
16003
16004         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16005         code, as the constant resolution moved.
16006
16007         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16008         the metadata, so we can flag error 133. 
16009
16010         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16011         pointer is being declared in an unsafe context.
16012
16013 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16014
16015         * modifiers.cs (Modifiers.Check): Require a Location argument.
16016         Report error 227 for Unsafe use.
16017
16018         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16019
16020         * statement.cs (For.Emit): If the test is null, then report that
16021         we do `return', as we wont reach anything afterwards.
16022
16023         (Switch.SwitchGoverningType): Track the expression that matched
16024         the conversion.
16025
16026         * driver.cs: Allow negative numbers as an error code to flag.
16027
16028         * cs-parser.jay: Handle 1551.
16029
16030         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16031
16032 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * cs-parser.jay: Report 1518 (type declaration can only contain
16035         class, struct, interface, enum or delegate)
16036
16037         (switch_label): Report 1523 (keywords `case' or `default' must
16038         preced code)
16039
16040         (opt_switch_sections): Report 1522 (empty switch)
16041
16042         * driver.cs: Report 1515 (response file specified multiple times)
16043         Report 1516 (Source file specified multiple times).
16044
16045         * expression.cs (Argument.Resolve): Signal 1510
16046
16047         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16048         access not allowed in static code)
16049
16050 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16051
16052         * typemanager.cs (IsPointerType): Utility method which we are going
16053         to need a lot.
16054
16055         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16056         the object type, so we take care of that.
16057
16058         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16059
16060         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16061         added to non-params parameters :-)
16062
16063         * typemanager.cs (CSharpName): Include 'void' type too. 
16064
16065         (void_ptr_type): Include in the set of core types.
16066
16067         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16068         duplicating code.
16069
16070         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16071         an unsafe context.
16072
16073         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16074         completely forgotten about it.
16075
16076 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16077
16078         * cs-parser.jay (pointer_type): Add. This begins our implementation
16079         of parsing rules for unsafe code.
16080
16081         (unsafe_statement): Implement.
16082
16083         (embedded_statement): Modify to include the above.
16084
16085         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16086
16087         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16088         if the current context is an unsafe one.
16089
16090         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16091         are handled differently, we need separate rules for them.
16092
16093         (local_variable_declaration): Update to use local_variable_pointer_type
16094         to allow variable declarations of unmanaged pointer types.
16095
16096         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16097         in unsafe contexts.
16098
16099         * ../errors/cs0214.cs : Add.
16100
16101 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16102
16103         * makefile: remove 'response' file when cleaning.
16104
16105 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * cs-parser.jay: Report 1524.
16108
16109 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16110
16111         * typemanager.cs (RegisterMethod): drop checking if we have
16112         registered this from here
16113
16114 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * class.cs (Method.EmitDestructor): Implement calling our base
16117         destructor. 
16118
16119         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16120         value of InFinally.
16121
16122         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16123         this routine and will wrap the call in a try/catch block.  Deal
16124         with the case.
16125
16126 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16127
16128         * ecore.cs (Expression.MemberLookup): instead of taking a
16129         parameter `same_type' that was used to tell whether we could
16130         access private members we compute our containing type from the
16131         EmitContext.
16132
16133         (FieldExpr): Added partial support for volatile fields.  This does
16134         not work for volatile fields exposed from assemblies, as I can not
16135         figure out how to extract the modreq from it.
16136
16137         Updated all the source files to use this.
16138
16139         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16140         because it is referenced by MemberLookup very often. 
16141
16142 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16143
16144         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16145         TypeBuilder.GetCustomAttributes to retrieve what we need.
16146
16147         Get rid of redundant default_member_attr_type as this is the same as
16148         default_member_type which already exists.
16149
16150         * interface.cs, attribute.cs : Update accordingly.
16151
16152 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16153
16154         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16155         work for TYpeBuilders though.  Ravi, can you please fix this?
16156
16157         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16158
16159         * expression.cs (Argument.Emit): Handle the case of ref objects
16160         being passed to ref functions;  
16161
16162         (ParameterReference.EmitLoad): Loads the content of the pointer
16163         without dereferencing.
16164
16165 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16166
16167         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16168
16169 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16170
16171         * class.cs (Indexer.DefineMethod): Incorporate the interface
16172         type in the name of the method if we are doing explicit interface
16173         implementation.
16174
16175         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16176
16177         (BetterConversion): Fix extremely trivial bug where we were referring to
16178         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16179         again !
16180
16181         * ../errors/bug16.cs : Add although we have fixed it.
16182
16183 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16184
16185         * expression.cs (BaseIndexer): Begin implementation.
16186
16187         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16188
16189         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16190         production directly to remove a shift/reduce, and implement
16191         explicit interface implementation.
16192
16193         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16194         after a floating point suffix.
16195
16196         * expression.cs (DoNumericPromotions): Improved the conversion for
16197         uint/uint.  If we have a constant, we avoid doing a typecast to a
16198         larger type.
16199
16200         * class.cs (Indexer): Implement explicit interface implementation
16201         for indexers.
16202
16203 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16204
16205         * class.cs: make the default instance constructor public and hidebysig.
16206
16207 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16208
16209         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16210         so we can call it from elsewhere.
16211
16212         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16213         we emit it internally if the class has a defined indexer; otherwise the user
16214         emits it by decorating the class definition with the DefaultMemberAttribute.
16215
16216         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16217         attribute is not used on a type which defines an indexer.
16218
16219         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16220         character when we skip whitespace.
16221
16222         * ../errors/cs0646.cs : Add.
16223
16224 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16227         again. 
16228
16229         * makefile: Add practical target `mcs3.exe' which builds the third
16230         generation compiler. 
16231
16232         * expression.cs (New): Fix structures constructor calling.
16233
16234         * class.cs (Property, Method, Indexer): Emit Final flag on the
16235         method if we are an interface implementation and we are not
16236         abstract. 
16237
16238         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16239         whether this property is referencing a `base' method.
16240
16241         * expression.cs (Invocation.EmitCall): take an extra argument:
16242         is_base, this is used to determine whether the `call' or
16243         `callvirt' opcode should be used.
16244
16245
16246         * delegate.cs: update EmitCall.
16247
16248         * class.cs (Method.Define): Set NewSlot for the cases where we are
16249         not implementing an interface method.
16250
16251         (Property.Define): ditto.
16252
16253 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16254
16255         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16256         'r'.  Allows mcs to parse itself fully.
16257
16258 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16259
16260         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16261         of the number of initializers that require the InitializeArray method.
16262
16263         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16264         update the above field where necessary.
16265
16266         (MakeByteBlob): Update accordingly.
16267
16268         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16269         greater than 2.
16270
16271         (EmitDynamicInitializers): Update in accordance with the new optimization.
16272
16273         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16274         same OpCode applies.
16275
16276         * cs-parser.jay : Fix some glaring errors I introduced.
16277
16278 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16279
16280         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16281         so that we can check for name clashes there too.
16282
16283         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16284         for interface indexers.
16285
16286         * interfaces.cs (Define): Emit the default member attribute.
16287
16288         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16289         variable was being referred to while setting the value ;-)
16290
16291 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16292
16293         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16294         byte-by-byte information when we know the data is zero.
16295
16296         Make the block always a multiple of 4, because
16297         DefineInitializedData has a bug.
16298
16299         * assign.cs: Fix, we should assign from the temporary, not from
16300         the source. 
16301
16302         * expression.cs (MakeByteBlob): Fix my incorrect code.
16303
16304 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16305
16306         * typemanager.cs (EnumToUnderlying): This function is used to get
16307         the underlying type from an enumeration, because it does not
16308         always work. 
16309
16310         * constant.cs: Use the I4_S form for values between -128 and 127.
16311
16312         * statement.cs (Block.LookupLabel): Looks up a label.
16313         (Block): Drop support for labeled blocks.
16314
16315         (LabeledStatement): New kind of statement that represents a label
16316         only.
16317
16318         (Goto): Finally implement this bad boy.
16319
16320         * cs-parser.jay: Update to reflect new mechanism to implement
16321         labels.
16322
16323 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16324
16325         * codegen.cs (EmitContext.This): a codegen property that keeps the
16326         a single instance of this instead of creating many different this
16327         instances. 
16328
16329         * delegate.cs (Delegate.DoResolve): Update to use the property;
16330
16331         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16332
16333         * expression.cs (BaseAccess.DoResolve): Ditto.
16334
16335 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16336
16337         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16338         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16339
16340         (InitCoreTypes): Update accordingly.
16341
16342         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16343         so we can quickly store the state.
16344
16345         (ApplyAttributes): Set the correct implementation flags
16346         for InternalCall methods.
16347
16348 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16349
16350         * expression.cs (EmitCall): if a method is not virtual, then do
16351         not use callvirt on it.
16352
16353         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16354         user defined stuff) requires the use of stobj, which takes an
16355         address on the stack instead of an array and an index.  So emit
16356         the Ldelema operation for it.
16357
16358         (EmitStoreOpcode): Use stobj for valuetypes.
16359
16360         (UnaryMutator.EmitCode): Use the right 1 value depending on
16361         whether we are dealing with int64/uint64, float or doubles.
16362
16363         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16364         constructors that I implemented last night.
16365
16366         (Constructor.IsDefault): Fix to work properly for static
16367         constructors.
16368
16369         * cs-parser.jay (CheckDef): report method signature errors.
16370         Update error number 103 to be 132.
16371
16372         * decl.cs: New AdditionResult enumeration value: MethodExists.
16373         Although we do this check for methods later on in the semantic
16374         analysis, catching repeated default constructors is so easy that
16375         we catch these here. 
16376
16377         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16378         promotions code.
16379
16380         (ParameterReference.EmitAssign, Emit): handle
16381         bools as bytes.
16382
16383         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16384         (ArrayAccess.EmitStoreOpcode): ditto.
16385
16386         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16387
16388         * expression.cs (MakeByteBlob): Complete all the missing types
16389         (uint, short, ushort, byte, sbyte)
16390
16391         * class.cs: Only init instance field initializers on instance
16392         constructors. 
16393
16394         Rename `constructors' to instance_constructors. 
16395
16396         (TypeContainer.AddConstructor): Only add constructors to the list
16397         if it is not static.
16398
16399         Make sure that we handle default_static_constructor independently
16400         everywhere where we handle instance_constructors
16401
16402 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * class.cs: Do not lookup or create a base initializer for a
16405         static constructor.
16406
16407         (ConstructorInitializer.Resolve): use the proper type to lookup
16408         for constructors.
16409
16410         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16411
16412         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16413         in DeclSpace. 
16414
16415         * decl.cs: CloseType is now an virtual method, the default
16416         implementation just closes this type.
16417
16418 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16419
16420         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16421         to PreserveSig by default. Also emit HideBySig on such methods.
16422
16423         Basically, set the defaults to standard values.
16424
16425         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16426         argument, if candidate is better, it can't be worse than the best !
16427
16428         (Invocation): Re-write bits to differentiate between methods being
16429         applicable in their expanded form and their normal form - for params
16430         methods of course.
16431
16432         Get rid of use_standard everywhere as only standard conversions are allowed
16433         in overload resolution. 
16434
16435         More spec conformance.
16436
16437 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * driver.cs: Add --timestamp, to see where the compiler spends
16440         most of its time.
16441
16442         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16443         `this' in static code.
16444
16445         (SimpleName.DoResolve): Implement in terms of a helper function
16446         that allows static-references to be passed upstream to
16447         MemberAccess.
16448
16449         (Expression.ResolveWithSimpleName): Resolve specially simple
16450         names when called by MemberAccess to implement the special
16451         semantics. 
16452
16453         (Expression.ImplicitReferenceConversion): Handle conversions from
16454         Null to reference types before others, as Null's type is
16455         System.Object. 
16456
16457         * expression.cs (Invocation.EmitCall): Handle the special case of
16458         calling methods declared on a reference type from a ValueType
16459         (Base classes System.Object and System.Enum)
16460
16461         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16462         the left hand side is a TypeExpr, not on every enumeration. 
16463
16464         (Binary.Resolve): If types are reference types, then do a cast to
16465         object on operators != and == of both arguments.
16466
16467         * typemanager.cs (FindMembers): Extract instance and static
16468         members if requested.
16469
16470         * interface.cs (PopulateProperty): Use void_type instead of null
16471         as the return type for the setter method.
16472
16473         (PopulateIndexer): ditto.
16474
16475 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16476
16477         * support.cs (ReflectionParameters): Fix minor bug where we
16478         were examining the wrong parameter for the ParamArray attribute.
16479
16480         Cope with requests for the type of the parameter at position
16481         greater than the params parameter's. We now return the element
16482         type of the params array as that makes more sense.
16483
16484         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16485         accordingly as we no longer have to extract the element type
16486         ourselves.
16487
16488         (Invocation.OverloadResolve): Update.
16489
16490 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16493         against IEnumerator, test whether the return value is a descendant
16494         of the IEnumerator interface.
16495
16496         * class.cs (Indexer.Define): Use an auxiliary method to implement
16497         the other bits of the method definition.  Begin support for
16498         explicit interface implementation.
16499
16500         (Property.DefineMethod): Use TypeManager.void_type instead of null
16501         for an empty return value.
16502
16503 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16506         dealing with a FieldExpr which is composed of a FieldBuilder, in
16507         the code path we did extract the constant, but we should have
16508         obtained the underlying value to be able to cast it (otherwise we
16509         end up in an infinite loop, this is what Ravi was running into).
16510
16511         (ArrayCreation.UpdateIndices): Arrays might be empty.
16512
16513         (MemberAccess.ResolveMemberAccess): Add support for section
16514         14.5.4.1 that deals with the special case of E.I when E is a type
16515         and something else, that I can be a reference to a static member.
16516
16517         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16518         handle a particular array type to create byte blobs, it is just
16519         something we dont generate byteblobs for.
16520
16521         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16522         arguments. 
16523
16524         * location.cs (Push): remove the key from the hashtable that we
16525         are about to add.   This happens for empty files.
16526
16527         * driver.cs: Dispose files after we have parsed them.
16528
16529         (tokenize): new function that only runs the tokenizer on its
16530         input, for speed testing.
16531
16532 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16533
16534         * class.cs (Event.Define): Define the private field only if there
16535         are no accessors defined.
16536
16537         * expression.cs (ResolveMemberAccess): If there is no associated
16538         field with the event, that means we have an event defined with its
16539         own accessors and we should flag error cs0070 since transforming
16540         ourselves into a field is not valid in that case.
16541
16542         * ecore.cs (SimpleName.DoResolve): Same as above.
16543
16544         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16545         and charset to sane values.
16546
16547 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16548
16549         * assign.cs (DoResolve): Perform check on events only if they 
16550         are being accessed outside the declaring type.
16551
16552         * cs-parser.jay (event_declarations): Update rules to correctly
16553         set the type of the implicit parameter etc.
16554
16555         (add_accessor, remove_accessor): Set current local parameters.
16556
16557         * expression.cs (Binary): For delegate addition and subtraction,
16558         cast the return value from the method into the appropriate delegate
16559         type.
16560
16561 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16562
16563         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16564         of these as the workaround is unnecessary.
16565
16566         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16567         delegate data - none of that is needed at all.
16568
16569         Re-write bits to extract the instance expression and the delegate method
16570         correctly.
16571
16572         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16573         on delegates too.
16574
16575         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16576         of attaching attributes instead of duplicating code everywhere.
16577
16578         * everywhere : Update code to do attribute emission using the above method.
16579
16580 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16581
16582         * expression.cs (IsParamsMethodApplicable): if there are not
16583         parameters, return immediately.
16584
16585         * ecore.cs: The 0 literal can be implicity converted to an enum
16586         type. 
16587
16588         (SimpleName.DoResolve): First lookup the type, then lookup the
16589         members. 
16590
16591         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16592         want to get its address.  If the InstanceExpression is not
16593         addressable, store the result in a temporary variable, then get
16594         the address of it.
16595
16596         * codegen.cs: Only display 219 errors on warning level or above. 
16597
16598         * expression.cs (ArrayAccess): Make it implement the
16599         IMemoryLocation interface.
16600
16601         (Binary.DoResolve): handle the operator == (object a, object b)
16602         and operator != (object a, object b) without incurring into a
16603         BoxedCast (because 5 != o should never be performed).
16604
16605         Handle binary enumerator operators.
16606
16607         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16608         value type, otherwise use Ldelem_ref.
16609
16610         Use precomputed names;
16611
16612         (AddressOf): Implement address of
16613
16614         * cs-parser.jay (labeled_statement): Fix recursive block
16615         addition by reworking the production.
16616
16617         * expression.cs (New.DoEmit): New has a special case:
16618                 
16619                  If we are dealing with a ValueType, we have a few
16620                  situations to deal with:
16621                 
16622                     * The target of New is a ValueType variable, that is
16623                       easy, we just pass this as the variable reference
16624                 
16625                     * The target of New is being passed as an argument,
16626                       to a boxing operation or a function that takes a
16627                       ValueType.
16628                 
16629                       In this case, we need to create a temporary variable
16630                       that is the argument of New.
16631
16632
16633 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16634
16635         * rootcontext.cs (LookupType): Check that current_type is not null before
16636         going about looking at nested types.
16637
16638         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16639         not implement the IAssignMethod interface any more.
16640
16641         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16642         where we tranform them into FieldExprs if they are being resolved from within
16643         the declaring type.
16644
16645         * ecore.cs (SimpleName.DoResolve): Do the same here.
16646
16647         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16648
16649         * ../errors/bug10.cs : Add.
16650
16651         * ../errors/cs0070.cs : Add.
16652
16653         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16654
16655         * assign.cs : Get rid of EventIsLocal everywhere.
16656
16657 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16658
16659         * ecore.cs (ConvertIntLiteral): finished the implementation.
16660
16661         * statement.cs (SwitchLabel): Convert the value we are using as a
16662         key before looking up the table.
16663
16664 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16665
16666         * codegen.cs (EmitTopBlock): Require a Location argument now.
16667
16668         * cs-parser.jay (constructor_declarator): We need to setup
16669         current_local_parameters before we parse the
16670         opt_constructor_initializer, to allow the variables to be bound
16671         to the constructor arguments.
16672
16673         * rootcontext.cs (LookupType): First lookup nested classes in our
16674         class and our parents before we go looking outside our class.
16675
16676         * expression.cs (ConstantFold): Extract/debox the values at the
16677         beginnning. 
16678
16679         * rootcontext.cs (EmitCode): Resolve the constants first before we
16680         resolve the types.  This is not really needed, but it helps debugging.
16681
16682         * statement.cs: report location.
16683
16684         * cs-parser.jay: pass location to throw statement.
16685
16686         * driver.cs: Small bug fix.
16687
16688         * report.cs: Updated format to be 4-zero filled digits.
16689
16690 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16691
16692         * expression.cs (CheckIndices): Fix minor bug where the wrong
16693         variable was being referred to ;-)
16694
16695         (DoEmit): Do not call EmitStaticInitializers when the 
16696         underlying type is System.Object.
16697
16698 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16699
16700         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16701         and do the usual workaround for SRE.
16702
16703         * class.cs (MyEventBuilder.EventType): New member to get at the type
16704         of the event, quickly.
16705
16706         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16707
16708         * assign.cs (Assign.DoResolve): Handle the case when the target
16709         is an EventExpr and perform the necessary checks.
16710
16711         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16712         interface.
16713
16714         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16715
16716         (EventExpr): Set the type in the constructor itself since we 
16717         are meant to be born fully resolved.
16718
16719         (EventExpr.Define): Revert code I wrote earlier.
16720                 
16721         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16722         instance expression is null. The instance expression is a This in that case
16723         or a null, depending on whether it is a static method or not.
16724
16725         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16726         refers to more than one method.
16727
16728         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16729         and accordingly flag errors.
16730
16731 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16732
16733         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16734
16735 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * location.cs (ToString): Provide useful rutine.
16738
16739 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16740
16741         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16742         objects, return the actual integral boxed.
16743
16744         * statement.cs (SwitchLabel): define an ILLabel for each
16745         SwitchLabel. 
16746
16747         (Switch.CheckSwitch): If the value is a Literal, extract
16748         the underlying literal.
16749
16750         Also in the unused hashtable we had, add the SwitchLabel so we can
16751         quickly look this value up.
16752
16753         * constant.cs: Implement a bunch of new constants.  Rewrite
16754         Literal based on this.  Made changes everywhere to adapt to this.
16755
16756         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16757         dereferencing array only once, and also copes with enumrations.
16758
16759         bytes are two bytes wide, not one.
16760
16761         (Cast): Perform constant conversions.
16762
16763         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16764         wrappers to the literals here.
16765
16766         * expression.cs (DoNumericPromotions): long literals can converted
16767         to ulong implicity (this is taken care of elsewhere, but I was
16768         missing this spot).
16769
16770         * ecore.cs (Expression.Literalize): Make the return type Literal,
16771         to improve type checking.
16772
16773         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16774
16775 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16776
16777         * literal.cs: Revert code from ravi that checked the bounds.  The
16778         bounds are sane by the definition of the type itself. 
16779
16780         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16781         need to actually look up in our parent hierarchy for interfaces
16782         implemented. 
16783
16784         * const.cs: Use the underlying type for enumerations
16785
16786         * delegate.cs: Compute the basename for the delegate creation,
16787         that should fix the delegate test case, and restore the correct
16788         Type Lookup semantics in rootcontext
16789
16790         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16791         referencing a nested type with the Reflection API is using the "+"
16792         sign. 
16793
16794         * cs-parser.jay: Do not require EOF token at the end.
16795
16796 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16797
16798         * rootcontext.cs (LookupType): Concatenate type names with
16799         a '.' instead of a '+' The test suite passes again.
16800
16801         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16802         field of the enumeration.
16803
16804         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16805         the case when the member is an EventExpr.
16806
16807         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16808         static has an associated instance expression.
16809
16810         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16811
16812         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16813
16814         * class.cs (Event.Define): Register event and perform appropriate checks
16815         for error #111.
16816
16817         We define the Add and Remove methods even if the use provides none because
16818         in that case, we provide default implementations ourselves.
16819
16820         Define a private field of the type of the event. This is done by the CSC compiler
16821         and we should be doing it too ;-)
16822
16823         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16824         More methods we use in code we generate.
16825
16826         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16827         is important.
16828
16829         (InitCoreTypes): Update accordingly for the above.
16830
16831         * class.cs (Event.Emit): Generate code for default accessors that we provide
16832
16833         (EmitDefaultMethod): Do the job in the above.
16834
16835         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16836         appropriate place.
16837
16838 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16839
16840         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16841         builders even if we were missing one.
16842
16843         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16844         pass the Basename as our class name instead of the Name.  The
16845         basename will be correctly composed for us.
16846
16847         * parameter.cs (Paramters): Now takes a Location argument.
16848
16849         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16850         make all the code call directly LookupType in RootContext and take
16851         this chance to pass the Location information everywhere.
16852
16853         * Everywhere: pass Location information.
16854
16855 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16856
16857         * class.cs (Constructor.Define): Updated way of detecting the
16858         length of the parameters.
16859
16860         (TypeContainer.DefineType): Use basename as the type name for
16861         nested types.
16862
16863         (TypeContainer.Define): Do not recursively define types here, as
16864         definition is taken care in order by the RootContext.
16865
16866         * tree.cs: Keep track of namespaces in a per-file basis.
16867
16868         * parameter.cs (Parameter.ComputeSignature): Update to use
16869         DeclSpace. 
16870
16871         (Parameters.GetSignature): ditto.
16872
16873         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16874         instead of a TypeContainer.
16875
16876         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16877         resolve names.  Because we need to be resolve in our context, not
16878         our parents.
16879
16880         * driver.cs: Implement response files.
16881
16882         * class.cs (TypeContainer.DefineType): If we are defined, do not
16883         redefine ourselves.
16884
16885         (Event.Emit): Emit the code for add/remove handlers.
16886         (Event.Define): Save the MethodBuilders for add/remove.
16887
16888         * typemanager.cs: Use pair here too.
16889
16890         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16891         DictionaryEntry requires the first argument to be non-null.  
16892
16893         (enum_declaration): Compute full name for registering the
16894         enumeration.
16895
16896         (delegate_declaration): Instead of using
16897         formal_parameter_list, use opt_formal_parameter_list as the list
16898         can be empty.
16899
16900         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16901         (EventParsing): New property that controls whether `add' and
16902         `remove' are returned as tokens or identifiers (for events);
16903
16904 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16905
16906         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16907         use MyEventBuilder only and let it wrap the real builder for us.
16908
16909         (MyEventBuilder): Revamp constructor etc.
16910
16911         Implement all operations that we perform on EventBuilder in precisely the same
16912         way here too.
16913
16914         (FindMembers): Update to use the EventBuilder member.
16915
16916         (Event.Emit): Update accordingly.
16917
16918 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16919
16920         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16921         by calling the appropriate methods.
16922
16923         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16924         useful.
16925
16926         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16927
16928 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16929
16930         * delegate.cs (Delegate.Populate): Check that the return type
16931         and various parameters types are indeed accessible.
16932
16933         * class.cs (Constructor.Define): Same here.
16934
16935         (Field.Define): Ditto.
16936
16937         (Event.Define): Ditto.
16938
16939         (Operator.Define): Check that the underlying Method defined itself
16940         correctly - so it's MethodBuilder should not be null.
16941
16942         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16943         expression happens to be null.
16944
16945         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16946         members but as of now we don't seem to be able to do anything really useful with it.
16947
16948         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16949         not the EventBuilder.
16950
16951 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16952
16953         * cs-tokenizer.cs: Add support for defines.
16954         Add support for #if, #elif, #else, #endif
16955
16956         (eval_var): evaluates a variable.
16957         (eval): stubbed for evaluating functions.
16958
16959         * cs-parser.jay: Pass the defines information
16960
16961         * driver.cs: Add --define command line option.
16962
16963         * decl.cs: Move MemberCore here.
16964
16965         Make it the base class for DeclSpace.  This allows us to catch and
16966         report 108 and 109 for everything now.
16967
16968         * class.cs (TypeContainer.Define): Extract all the members
16969         before populating and emit the warning 108 (new keyword required
16970         to override) instead of having each member implement this.
16971
16972         (MemberCore.Define): New abstract method, we will be using this in
16973         the warning reporting engine in Populate.
16974
16975         (Operator.Define): Adjust to new MemberCore protocol. 
16976
16977         * const.cs (Const): This does not derive from Expression, it is a
16978         temporary object we use to create fields, it is a MemberCore. 
16979
16980         * class.cs (Method.Define): Allow the entry point to be in a
16981         specific class.
16982
16983         * driver.cs: Rewrite the argument handler to clean it up a bit.
16984
16985         * rootcontext.cs: Made it just an auxiliary namespace feature by
16986         making everything static.
16987
16988         * driver.cs: Adapt code to use RootContext type name instead of
16989         instance variable.
16990
16991         * delegate.cs: Remove RootContext argument.
16992
16993         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16994         argument. 
16995
16996         * class.cs (Event.Define): The lookup can fail.
16997
16998         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16999
17000         * expression.cs: Resolve the this instance before invoking the code.
17001
17002 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17003
17004         * cs-parser.jay: Add a production in element_access that allows
17005         the thing to become a "type" reference.  This way we can parse
17006         things like "(string [])" as a type.
17007
17008         Note that this still does not handle the more complex rules of
17009         casts. 
17010
17011
17012         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17013
17014         * ecore.cs: (CopyNewMethods): new utility function used to
17015         assemble the list of methods from running FindMembers.
17016
17017         (MemberLookup): Rework FindMembers so that 
17018
17019 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * class.cs (TypeContainer): Remove Delegates who fail to be
17022         defined.
17023
17024         * delegate.cs (Populate): Verify that we dont get null return
17025         values.   TODO: Check for AsAccessible.
17026
17027         * cs-parser.jay: Use basename to emit error 574 (destructor should
17028         have the same name as container class), not the full name.
17029
17030         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17031         possible representation.  
17032
17033         Also implements integer type suffixes U and L.
17034
17035 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17036
17037         * expression.cs (ArrayCreation.DoResolve): We need to do the
17038         argument resolution *always*.
17039
17040         * decl.cs: Make this hold the namespace.  Hold the root context as
17041         well.
17042         (LookupType): Move here.
17043
17044         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17045
17046         * location.cs (Row, Name): Fixed the code, it was always returning
17047         references to the first file.
17048
17049         * interface.cs: Register properties defined through interfaces.
17050
17051         * driver.cs: Add support for globbing on the command line
17052
17053         * class.cs (Field): Make it derive from MemberCore as well.
17054         (Event): ditto.
17055
17056 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17057
17058         * class.cs (Event::Define): Check that the type of the event is a delegate
17059         type else flag error #66.
17060
17061         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17062         same.
17063
17064         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17065         values of EntryPoint, CharSet etc etc.
17066
17067         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17068
17069         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17070         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17071         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17072         which needs this to do its work.
17073
17074         * ../errors/cs0066.cs : Add.
17075
17076 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17079         helper functions.
17080
17081         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17082         clears out the parameters field.
17083         (MemberSignatureCompare): Cleanup
17084
17085         (MemberCore): New base class used to share code between MethodCore
17086         and Property.
17087
17088         (RegisterRequiredImplementations) BindingFlags.Public requires
17089         either BindingFlags.Instace or Static.  Use instance here.
17090
17091         (Property): Refactored code to cope better with the full spec.
17092
17093         * parameter.cs (GetParameterInfo): Return an empty array instead
17094         of null on error.
17095
17096         * class.cs (Property): Abstract or extern properties have no bodies.
17097
17098         * parameter.cs (GetParameterInfo): return a zero-sized array.
17099
17100         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17101         method modifier validation to the typecontainer so we can reuse
17102         this on properties.
17103
17104         (MethodCore.ParameterTypes): return an empty sized array of types.
17105
17106         (Property.Define): Test property modifier validity.
17107
17108         Add tests for sealed/override too.
17109
17110         (Method.Emit): abstract or extern methods have no bodies.
17111
17112 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17113
17114         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17115         thing.
17116
17117         (Method::Define, ::Emit): Modify accordingly.
17118
17119         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17120
17121         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17122
17123         * makefile: Pass in /unsafe.
17124
17125 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17126
17127         * class.cs (MakeKey): Kill routine.
17128
17129         * class.cs (TypeContainer.Define): Correctly define explicit
17130         method implementations (they require the full interface name plus
17131         the method name).
17132
17133         * typemanager.cs: Deply the PtrHashtable here and stop using the
17134         lame keys.  Things work so much better.
17135
17136         This of course broke everyone who depended on `RegisterMethod' to
17137         do the `test for existance' test.  This has to be done elsewhere.
17138
17139         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17140         the object stupid Equals method (because, that like fails all over
17141         the place).  We still do not use it.
17142
17143         * class.cs (TypeContainer.SetRequiredInterface,
17144         TypeContainer.RequireMethods): Killed these two routines and moved
17145         all the functionality to RegisterRequiredImplementations.
17146
17147         (TypeContainer.RegisterRequiredImplementations): This routine now
17148         registers all the implementations required in an array for the
17149         interfaces and abstract methods.  We use an array of structures
17150         which can be computed ahead of time to reduce memory usage and we
17151         also assume that lookups are cheap as most classes will not
17152         implement too many interfaces.
17153
17154         We also avoid creating too many MethodSignatures.
17155
17156         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17157         clear the "pending" bit if we find that there are problems with
17158         the declaration.
17159
17160         (TypeContainer.VerifyPendingMethods): Update to report errors of
17161         methods that look like implementations but are not.
17162
17163         (TypeContainer.Define): Add support for explicit interface method
17164         implementation. 
17165
17166 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * typemanager.cs: Keep track of the parameters here instead of
17169         being a feature of the TypeContainer.
17170
17171         * class.cs: Drop the registration of parameters here, as
17172         InterfaceMethods are also interface declarations.
17173
17174         * delegate.cs: Register methods with the TypeManager not only with
17175         the TypeContainer.  This code was buggy.
17176
17177         * interface.cs: Full registation here.
17178
17179 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17180
17181         * expression.cs: Remove reducer for binary expressions, it can not
17182         be done this way.
17183
17184         * const.cs: Put here the code that used to go into constant.cs
17185
17186         * constant.cs: Put here the code for constants, this is a new base
17187         class for Literals.
17188
17189         * literal.cs: Make Literal derive from Constant.
17190
17191 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17192
17193         * statement.cs (Return.Emit): Report error 157 if the user
17194         attempts to return from a finally block.
17195
17196         (Return.Emit): Instead of emitting a return, jump to the end of
17197         the function.
17198
17199         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17200         LocalBuilder to store the result of the function.  ReturnLabel is
17201         the target where we jump.
17202
17203
17204 2001-12-09  Radek Doulik  <rodo@ximian.com>
17205
17206         * cs-parser.jay: remember alias in current namespace
17207
17208         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17209         namespaces
17210
17211         * class.cs (LookupAlias): lookup alias in my_namespace
17212
17213         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17214         aliases hashtable
17215         (LookupAlias): lookup alias in this and if needed in parent
17216         namespaces
17217
17218 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17219
17220         * support.cs: 
17221
17222         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17223         making things static.  I need this to avoid passing the
17224         TypeContainer when calling ParameterType.
17225
17226         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17227         that did string manipulation to compute the type and then call
17228         GetType.  Use Parameter.ParameterType instead.
17229
17230         * cs-tokenizer.cs: Consume the suffix for floating values.
17231
17232         * expression.cs (ParameterReference): figure out whether this is a
17233         reference parameter or not.  Kill an extra variable by computing
17234         the arg_idx during emission.
17235
17236         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17237         function that returns whether a parameter is an out/ref value or not.
17238
17239         (Parameter.ParameterType): The type of the parameter (base,
17240         without ref/out applied).
17241
17242         (Parameter.Resolve): Perform resolution here.
17243         (Parameter.ExternalType): The full type (with ref/out applied).
17244
17245         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17246         support for expressions on the using statement.
17247
17248 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17249
17250         * statement.cs (Using.EmitLocalVariableDecls): Split the
17251         localvariable handling of the using statement.
17252
17253         (Block.EmitMeta): Keep track of variable count across blocks.  We
17254         were reusing slots on separate branches of blocks.
17255
17256         (Try.Emit): Emit the general code block, we were not emitting it. 
17257
17258         Check the type of the declaration to be an IDisposable or
17259         something that can be implicity converted to it. 
17260
17261         Emit conversions if required.
17262
17263         * ecore.cs (EmptyExpression): New utility class.
17264         (Expression.ImplicitConversionExists): New utility function.
17265
17266 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17267
17268         * statement.cs (Using): Implement.
17269
17270         * expression.cs (LocalVariableReference): Support read only variables.
17271
17272         * statement.cs: Remove the explicit emit for the Leave opcode.
17273         (VariableInfo): Add a readonly field.
17274
17275 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17276
17277         * ecore.cs (ConvCast): new class used to encapsulate the various
17278         explicit integer conversions that works in both checked and
17279         unchecked contexts.
17280
17281         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17282         properly generate the overflow opcodes.
17283
17284 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17285
17286         * statement.cs: The correct type for the EmptyExpression is the
17287         element_type, not the variable type.  Ravi pointed this out.
17288
17289 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17290
17291         * class.cs (Method::Define): Handle PInvoke methods specially
17292         by using DefinePInvokeMethod instead of the usual one.
17293
17294         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17295         above to do the task of extracting information and defining the method.
17296
17297 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17298
17299         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17300         of the condition for string type.
17301
17302         (Emit): Move that here. 
17303
17304         (ArrayCreation::CheckIndices): Keep string literals in their expression
17305         form.
17306
17307         (EmitDynamicInitializers): Handle strings appropriately.
17308
17309 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17310
17311         * codegen.cs (EmitContext): Replace multiple variables with a
17312         single pointer to the current Switch statement.
17313
17314         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17315         EmitContext.
17316
17317 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17318
17319         * statement.cs 
17320
17321         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17322         default'.
17323
17324         (Foreach.Emit): Foreach on arrays was not setting
17325         up the loop variables (for break/continue).
17326
17327         (GotoCase): Semi-implented.
17328
17329 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17330
17331         * attribute.cs (CheckAttribute): Handle system attributes by using
17332         Attribute.GetAttributes to examine information we need.
17333
17334         (GetValidPlaces): Same here.
17335
17336         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17337
17338         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17339
17340         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17341
17342         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17343
17344         (Method::Emit): Handle the case when we are a PInvoke method.
17345
17346 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17347
17348         * expression.cs: Use ResolveWithSimpleName on compound names.
17349
17350 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17351
17352         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17353         before trying to reduce it.
17354
17355         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17356
17357         * constant.cs (LookupConstantValue): Implement.
17358
17359         (EmitConstant): Use the above in emitting the constant.
17360
17361         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17362         that are user-defined by doing a LookupConstantValue on them.
17363
17364         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17365         too, like above.
17366
17367 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17370
17371         (BaseAccess.DoResolve): Implement.
17372
17373         (MemberAccess.DoResolve): Split this routine into a
17374         ResolveMemberAccess routine that can be used independently
17375
17376 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17377
17378         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17379         As that share bits of the implementation.  Is returns a boolean,
17380         while As returns the Type that is being probed.
17381
17382 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17383
17384         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17385         instead of a Literal - much easier.
17386
17387         (EnumInTransit): Remove - utterly useless :-)
17388
17389         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17390
17391         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17392
17393         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17394         chain when we have no associated expression.
17395
17396 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17397
17398         * constant.cs (Define): Use Location while reporting the errror.
17399
17400         Also emit a warning when 'new' is used and there is no inherited
17401         member to hide.
17402
17403         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17404         populated.
17405
17406         (LookupEnumValue): Implement to lookup an enum member's value and define it
17407         if necessary.
17408
17409         (Populate): Re-write accordingly to use the above routine.
17410
17411 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17412
17413         * expression.cs (This): Fix prototype for DoResolveLValue to
17414         override the base class DoResolveLValue.
17415
17416         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17417         declarations) 
17418
17419         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17420         (we need to load the address of the field here).  This fixes
17421         test-22. 
17422
17423         (FieldExpr.DoResolveLValue): Call the DoResolve
17424         function to initialize the Instance expression.
17425
17426         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17427         correctly the GetEnumerator operation on a value type.
17428
17429         * cs-parser.jay: Add more simple parsing error catches.
17430
17431         * statement.cs (Switch): Add support for string switches.
17432         Handle null specially.
17433
17434         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17435
17436 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17437
17438         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17439
17440         (declare_local_constant): New helper function.
17441
17442         * statement.cs (AddConstant): Keep a separate record of constants
17443
17444         (IsConstant): Implement to determine if a variable is a constant.
17445
17446         (GetConstantExpression): Implement.
17447
17448         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17449
17450         * statement.cs (IsVariableDefined): Re-write.
17451
17452 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17453
17454         * class.cs (TypeContainer::FindMembers): Look for constants
17455         in the case when we are looking for MemberTypes.Field
17456
17457         * expression.cs (MemberAccess::DoResolve): Check that in the
17458         case we are a FieldExpr and a Literal, we are not being accessed
17459         by an instance reference.
17460
17461         * cs-parser.jay (local_constant_declaration): Implement.
17462
17463         (declaration_statement): Implement for constant declarations.
17464
17465 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17466
17467         * statement.cs (Switch): Catch double defaults.
17468
17469         (Switch): More work on the switch() statement
17470         implementation.  It works for integral values now, need to finish
17471         string support.
17472
17473
17474 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17475
17476         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17477         integer literals into other integer literals.  To be used by
17478         switch. 
17479
17480 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17481
17482         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17483         some memory.
17484
17485         (EmitDynamicInitializers): Cope with the above since we extract data
17486         directly from ArrayData now.
17487
17488         (ExpectInitializers): Keep track of whether initializers are mandatory
17489         or not.
17490
17491         (Bounds): Make it a hashtable to prevent the same dimension being 
17492         recorded for every element in that dimension.
17493
17494         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17495         from being found.
17496
17497         Also fix bug which was causing the indices to be emitted in the reverse
17498         order.
17499
17500 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17501
17502         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17503         unfinished.  They do not work, because the underlying code is
17504         sloppy.
17505
17506 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17507
17508         * cs-parser.jay: Remove bogus fixme.
17509
17510         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17511         on Switch statement.
17512
17513 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17514
17515         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17516         the same. 
17517
17518         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17519         parameter. Apparently, any expression is allowed. 
17520
17521         (ValidateInitializers): Update accordingly.
17522
17523         (CheckIndices): Fix some tricky bugs thanks to recursion.
17524
17525         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17526         I was being completely brain-dead.
17527
17528         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17529         and re-write acordingly.
17530
17531         (DelegateInvocation): Re-write accordingly.
17532
17533         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17534
17535         (MakeByteBlob): Handle types more correctly.
17536
17537         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17538         initialization from expressions but it is incomplete because I am a complete
17539         Dodo :-|
17540
17541 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17542
17543         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17544         on If.  Basically, we have to return `true' (ie, we do return to
17545         our caller) only if both branches of the if return.
17546
17547         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17548         short-circuit operators, handle them as short circuit operators. 
17549
17550         (Cast.DoResolve): Resolve type.
17551         (Cast.Cast): Take an expression as the target type.
17552
17553         * cs-parser.jay (cast_expression): Remove old hack that only
17554         allowed a limited set of types to be handled.  Now we take a
17555         unary_expression and we resolve to a type during semantic
17556         analysis.
17557
17558         Use the grammar productions from Rhys to handle casts (this is
17559         not complete like Rhys syntax yet, we fail to handle that corner
17560         case that C# has regarding (-x), but we will get there.
17561
17562 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17563
17564         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17565         field which is an array type.
17566
17567         * cs-parser.jay (declare_local_variables): Support array initialization too.
17568
17569         * typemanager.cs (MakeKey): Implement.
17570
17571         (everywhere): Use the above appropriately.
17572
17573         * cs-parser.jay (for_statement): Update for array initialization while
17574         declaring variables.
17575
17576         * ecore.cs : The error message was correct, it's the variable's names that
17577         were misleading ;-) Make the code more readable.
17578
17579         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17580         the correct type etc.
17581
17582         (ConvertExplicit): Handle Enum types by examining the underlying type.
17583
17584 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17585
17586         * parameter.cs (GetCallingConvention): Always return
17587         CallingConventions.Standard for now.
17588
17589 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17590
17591         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17592         and `r' after calling DoNumericPromotions.
17593
17594         * ecore.cs: Fix error message (the types were in the wrong order).
17595
17596         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17597         BindingFlags.Instance as well 
17598
17599         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17600         implicit int literal conversion in an empty cast so that we
17601         propagate the right type upstream.
17602
17603         (UnboxCast): new class used to unbox value types.
17604         (Expression.ConvertExplicit): Add explicit type conversions done
17605         by unboxing.
17606
17607         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17608         the target type before applying the implicit LongLiterals to ULong
17609         literal cast.
17610
17611 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17612
17613         * cs-parser.jay (for_statement): Reworked the way For works: now
17614         we declare manually any variables that are introduced in
17615         for_initializer to solve the problem of having out-of-band code
17616         emition (that is what got for broken).
17617
17618         (declaration_statement): Perform the actual variable declaration
17619         that used to be done in local_variable_declaration here.
17620
17621         (local_variable_declaration): Do not declare anything, just pass
17622         the information on a DictionaryEntry
17623
17624 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17625
17626         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17627         re-write of the logic to now make it recursive.
17628
17629         (UpdateIndices): Re-write accordingly.
17630
17631         Store element data in a separate ArrayData list in the above methods.
17632
17633         (MakeByteBlob): Implement to dump the array data into a byte array.
17634
17635 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17636
17637         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17638         into CheckIndices.
17639
17640         * constant.cs (Define): Implement.
17641
17642         (EmitConstant): Re-write fully.
17643
17644         Pass in location info.
17645
17646         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17647         respectively.
17648
17649         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17650         DictionaryEntry since we need location info too.
17651
17652         (constant_declaration): Update accordingly.
17653
17654         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17655         code into another method : UpdateIndices.
17656
17657 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17658
17659         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17660         some type checking etc.
17661
17662 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17663
17664         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17665         bits to provide dimension info if the user skips doing that.
17666
17667         Update second constructor to store the rank correctly.
17668
17669 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17670
17671         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17672         and try to implement.
17673
17674         * ../errors/cs0150.cs : Add.
17675
17676         * ../errors/cs0178.cs : Add.
17677
17678 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17679
17680         * statement.cs: Implement foreach on multi-dimensional arrays. 
17681
17682         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17683         name of the params argument.
17684
17685         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17686         initializing the array.
17687
17688         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17689         we can use this elsewhere.
17690
17691         * statement.cs: Finish implementation of foreach for single
17692         dimension arrays.
17693
17694         * cs-parser.jay: Use an out-of-band stack to pass information
17695         around, I wonder why I need this.
17696
17697         foreach_block: Make the new foreach_block the current_block.
17698
17699         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17700         function used to return a static Parameters structure.  Used for
17701         empty parameters, as those are created very frequently.
17702
17703         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17704
17705 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17706
17707         * interface.cs : Default modifier is private, not public. The
17708         make verify test passes again.
17709
17710 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17711
17712         * support.cs (ReflectionParameters): Fix logic to determine
17713         whether the last parameter is a params one. Test 9 passes again.
17714
17715         * delegate.cs (Populate): Register the builders we define with
17716         RegisterParameterForBuilder. Test 19 passes again.
17717
17718         * cs-parser.jay (property_declaration): Reference $6 instead
17719         of $$ to get at the location.
17720
17721         (indexer_declaration): Similar stuff.
17722
17723         (attribute): Ditto.
17724
17725         * class.cs (Property): Register parameters for the Get and Set methods
17726         if they exist. Test 23 passes again.
17727
17728         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17729         call to EmitArguments as we are sure there aren't any params arguments. 
17730         Test 32 passes again.
17731
17732         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17733         IndexOutOfRangeException. 
17734
17735         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17736         Test 33 now passes again.
17737
17738 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17741         broke a bunch of things.  Will have to come up with a better way
17742         of tracking locations.
17743
17744         * statement.cs: Implemented foreach for single dimension arrays.
17745
17746 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17747
17748         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17749         an error.  This removes the lookup from the critical path.
17750
17751         * cs-parser.jay: Removed use of temporary_loc, which is completely
17752         broken. 
17753
17754 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17755
17756         * support.cs (ReflectionParameters.ParameterModifier): Report
17757         whether the argument is a PARAMS argument or not.
17758
17759         * class.cs: Set the attribute `ParamArrayAttribute' on the
17760         parameter argument.
17761
17762         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17763         and cons_param_array_attribute (ConstructorInfo for
17764         ParamArrayAttribute)., 
17765
17766         * codegen.cs: Emit the return using the `Return' statement, that
17767         way we can report the error correctly for missing return values. 
17768
17769         * class.cs (Method.Emit): Clean up.
17770
17771         * expression.cs (Argument.Resolve): Take another argument: the
17772         location where this argument is used.  Notice that this is not
17773         part of the "Argument" class as to reduce the size of the
17774         structure (we know the approximate location anyways).
17775
17776         Test if the argument is a variable-reference, if not, then
17777         complain with a 206.
17778
17779         (Argument.Emit): Emit addresses of variables.
17780
17781         (Argument.FullDesc): Simplify.
17782
17783         (Invocation.DoResolve): Update for Argument.Resolve.
17784
17785         (ElementAccess.DoResolve): ditto.
17786
17787         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17788         method should be virtual, as this method is always virtual.
17789
17790         (NewDelegate.DoResolve): Update for Argument.Resolve.
17791
17792         * class.cs (ConstructorInitializer.DoResolve): ditto.
17793
17794         * attribute.cs (Attribute.Resolve): ditto.
17795
17796 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17797
17798         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17799
17800         * expression.cs (ParameterReference): Drop IStackStorage and implement
17801         IAssignMethod instead. 
17802
17803         (LocalVariableReference): ditto.
17804
17805         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17806         IAssignMethod instead. 
17807
17808 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17809
17810         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17811         enumerations that are used in heavily used structures derive from
17812         byte in a laughable and pathetic attempt to reduce memory usage.
17813         This is the kind of pre-optimzations that you should not do at
17814         home without adult supervision.
17815
17816         * expression.cs (UnaryMutator): New class, used to handle ++ and
17817         -- separatedly from the other unary operators.  Cleans up the
17818         code, and kills the ExpressionStatement dependency in Unary.
17819
17820         (Unary): Removed `method' and `Arguments' from this class, making
17821         it smaller, and moving it all to SimpleCall, so I can reuse this
17822         code in other locations and avoid creating a lot of transient data
17823         strucutres when not required.
17824
17825         * cs-parser.jay: Adjust for new changes.
17826
17827 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17828
17829         * enum.cs (Enum.Populate): If there is a failure during
17830         definition, return
17831
17832         * cs-parser.jay (opt_enum_base): we used to catch type errors
17833         here, but this is really incorrect.  The type error should be
17834         catched during semantic analysis.
17835
17836 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17837
17838         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17839         current_local_parameters as expected since I, in my stupidity, had forgotten
17840         to do this :-)
17841
17842         * attribute.cs (GetValidPlaces): Fix stupid bug.
17843
17844         * class.cs (Method::Emit): Perform check on applicability of attributes.
17845
17846         (Constructor::Emit): Ditto.
17847
17848         (Field::Emit): Ditto.
17849
17850         (Field.Location): Store location information.
17851
17852         (Property, Event, Indexer, Operator): Ditto.
17853
17854         * cs-parser.jay (field_declaration): Pass in location for each field.
17855
17856         * ../errors/cs0592.cs : Add.
17857
17858 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17859
17860         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17861
17862         (InitCoreTypes): Update accordingly.
17863
17864         (RegisterAttrType, LookupAttr): Implement.
17865
17866         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17867         info about the same.
17868
17869         (Resolve): Update to populate the above as necessary.
17870
17871         (Error592): Helper.
17872
17873         (GetValidPlaces): Helper to the above.
17874
17875         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17876
17877         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17878
17879 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17880
17881         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17882
17883         * ../errors/cs0617.cs : Add.
17884
17885 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17886
17887         * enum.cs (Emit): Rename to Populate to be more consistent with what
17888         we expect it to do and when exactly it is called.
17889
17890         * class.cs, rootcontext.cs : Update accordingly.
17891
17892         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17893         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17894
17895         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17896
17897         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17898         of a fieldinfo using the above, when dealing with a FieldBuilder.
17899
17900 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17901
17902         * ../errors/cs0031.cs : Add.
17903
17904         * ../errors/cs1008.cs : Add.
17905
17906         * ../errrors/cs0543.cs : Add.
17907
17908         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17909         enum type.
17910
17911         (FindMembers): Implement.
17912
17913         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17914         enums and delegates too.
17915
17916         (enum_types): Rename to builder_to_enum.
17917
17918         (delegate_types): Rename to builder_to_delegate.
17919
17920         * delegate.cs (FindMembers): Implement.
17921
17922 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17923
17924         * typemanager.cs (IsEnumType): Implement.
17925
17926         * enum.cs (Emit): Re-write parts to account for the underlying type
17927         better and perform checking etc.
17928
17929         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17930         of the underlying type.
17931
17932         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17933         value
17934
17935         * enum.cs (error31): Helper to report error #31.
17936
17937         * cs-parser.jay (enum_declaration): Store location of each member too.
17938
17939         * enum.cs (member_to_location): New hashtable. 
17940
17941         (AddEnumMember): Update location hashtable.
17942
17943         (Emit): Use the location of each member while reporting errors.
17944
17945 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17946
17947         * cs-parser.jay: A for_initializer if is a
17948         local_variable_declaration really ammount to have an implicit
17949         block with the variable declaration and no initializer for for.
17950
17951         * statement.cs (For.Emit): Cope with null initializers.
17952
17953         This fixes the infinite loop on for initializers.
17954
17955 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17956
17957         * enum.cs: More cleanup.
17958
17959         * ecore.cs: Remove dead code.
17960
17961         * class.cs (Property.Emit): More simplification.
17962         (Event.Emit): ditto.
17963
17964         Reworked to have less levels of indentation.
17965
17966 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17967
17968         * class.cs (Property): Emit attributes.
17969
17970         (Field): Ditto.
17971
17972         (Event): Ditto.
17973
17974         (Indexer): Ditto.
17975
17976         (Operator): Ditto.
17977
17978         * enum.cs (Emit): Ditto.
17979
17980         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17981         Enums too.
17982
17983         * class.cs (Field, Event, etc.): Move attribute generation into the
17984         Emit method everywhere.
17985
17986         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17987         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17988         as we had no way of defining nested enums !
17989
17990         * rootcontext.cs : Adjust code accordingly.
17991
17992         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17993
17994 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17995
17996         * expression.cs (EvalConstantExpression): Move into ecore.cs
17997
17998         * enum.cs (Enum): Rename some members and make them public and readonly
17999         according to our convention.
18000
18001         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18002         nothing else.
18003
18004         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18005
18006         (Enum::Emit): Write a simple version for now which doesn't try to compute
18007         expressions. I shall modify this to be more robust in just a while.
18008
18009         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18010
18011         (TypeContainer::CloseType): Create the Enum types too.
18012
18013         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18014
18015         * expression.cs (EvalConstantExpression): Get rid of completely.
18016
18017         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18018         user-defined values and other cases.
18019
18020         (IsValidEnumLiteral): Helper function.
18021
18022         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18023         out there in the case we had a literal FieldExpr.
18024
18025         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18026
18027         (Literalize): Revamp a bit to take two arguments.
18028
18029         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18030
18031 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18032
18033         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18034
18035         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18036
18037         (Resolve): Use the above to ensure we have proper initializers.
18038
18039 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18040
18041         * expression.cs (Expression::EvalConstantExpression): New method to 
18042         evaluate constant expressions.
18043
18044         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18045
18046 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18047
18048         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18049         in an array.
18050
18051         (Binary.ResolveOperator): Handle operator != (object a, object b)
18052         and operator == (object a, object b);
18053
18054         (Binary.DoNumericPromotions): Indicate whether the numeric
18055         promotion was possible.
18056
18057         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18058         Implement.  
18059
18060         Made the ArrayAccess implement interface IAssignMethod instead of
18061         IStackStore as the order in which arguments are passed reflects
18062         this.
18063
18064         * assign.cs: Instead of using expr.ExprClass to select the way of
18065         assinging, probe for the IStackStore/IAssignMethod interfaces.
18066
18067         * typemanager.cs: Load InitializeArray definition.
18068
18069         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18070         static data that can be used to initialize arrays. 
18071
18072 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18073
18074         * expression.cs: Handle operator== and operator!= for booleans.
18075
18076         (Conditioal.Reduce): Implement reducer for the ?: operator.
18077
18078         (Conditional.Resolve): Implement dead code elimination.
18079
18080         (Binary.Resolve): Catch string literals and return a new
18081         concatenated string.
18082
18083         (Unary.Reduce): Implement reduction of unary expressions.
18084
18085         * ecore.cs: Split out the expression core handling here.
18086
18087         (Expression.Reduce): New method used to perform constant folding
18088         and CSE.  This is needed to support constant-expressions. 
18089
18090         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18091         targets, and optimize for !x.
18092
18093 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18094
18095         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18096         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18097         set custom atttributes.
18098
18099         * literal.cs (Literal::GetValue): New abstract method to return the actual
18100         value of the literal, cast as an object.
18101
18102         (*Literal): Implement GetValue method.
18103
18104         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18105         expressions to the arraylist but objects of type Argument.
18106
18107         * class.cs (TypeContainer::Emit): Emit our attributes too.
18108
18109         (Method::Emit, Constructor::Emit): Ditto.
18110
18111         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18112         to be ignoring earlier.
18113
18114 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18115
18116         * attribute.cs (AttributeSection::Define): Implement to do the business
18117         of constructing a CustomAttributeBuilder.
18118
18119         (Attribute): New trivial class. Increases readability of code.  
18120
18121         * cs-parser.jay : Update accordingly.
18122
18123         (positional_argument_list, named_argument_list, named_argument): New rules
18124
18125         (attribute_arguments): Use the above so that we are more correct.
18126
18127 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18128
18129         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18130         to perform all checks for a method with a params parameter.
18131
18132         (Invocation::OverloadResolve): Update to use the above method and therefore
18133         cope correctly with params method invocations.
18134
18135         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18136         params too.
18137
18138         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18139         constructors in our parent too because we can't afford to miss out on 
18140         protected ones ;-)
18141
18142         * attribute.cs (AttributeSection): New name for the class Attribute
18143
18144         Other trivial changes to improve readability.
18145
18146         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18147         use the new class names.
18148
18149 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18150
18151         * class.cs (Method::Define): Complete definition for params types too
18152
18153         (Indexer::Define): Ditto.
18154
18155         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18156         Cope everywhere with a request for info about the array parameter.
18157
18158 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18159
18160         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18161
18162         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18163         local_variable_type to extract the string corresponding to the type.
18164
18165         (local_variable_type): Fixup the action to use the new helper method.
18166
18167         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18168         go.
18169
18170         * expression.cs : Clean out code which uses the above.
18171
18172 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18173
18174         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18175         and bale out if necessary by returning a false.
18176
18177         (RegisterProperty): Ditto.
18178
18179         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18180         and print out appropriate error messages.
18181
18182         * interface.cs (everywhere): Ditto.
18183
18184         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18185         location to constructor.
18186
18187         * class.cs (Property, Event, Indexer): Update accordingly.
18188
18189         * ../errors/cs111.cs : Added.
18190
18191         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18192         of a method, as laid down by the spec.
18193
18194         (Invocation::OverloadResolve): Use the above method.
18195
18196 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18197
18198         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18199         now take a TypeContainer and a Parameters object.
18200
18201         (ParameterData): Modify return type of ParameterModifier method to be 
18202         Parameter.Modifier and not a string.
18203
18204         (ReflectionParameters, InternalParameters): Update accordingly.
18205
18206         * expression.cs (Argument::GetParameterModifier): Same here.
18207
18208         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18209         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18210         symbol in it at all so maybe this is only for now.
18211
18212 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18213
18214         * support.cs (InternalParameters): Constructor now takes an extra argument 
18215         which is the actual Parameters class.
18216
18217         (ParameterDesc): Update to provide info on ref/out modifiers.
18218
18219         * class.cs (everywhere): Update call to InternalParameters to pass in
18220         the second argument too.
18221
18222         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18223         to return the modifier info [ref/out etc]
18224
18225         (InternalParameters, ReflectionParameters): Implement the above.
18226
18227         * expression.cs (Argument::ParameterModifier): Similar function to return
18228         info about the argument's modifiers.
18229
18230         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18231         too.
18232
18233         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18234         a new SetFormalParameters object which we pass to InternalParameters.
18235
18236 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18237
18238         * expression.cs (NewArray): Merge into the ArrayCreation class.
18239
18240 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18241
18242         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18243         NewUserdefinedArray into one as there wasn't much of a use in having
18244         two separate ones.
18245
18246         * expression.cs (Argument): Change field's name to ArgType from Type.
18247
18248         (Type): New readonly property which returns the proper type, taking into 
18249         account ref/out modifiers.
18250
18251         (everywhere): Adjust code accordingly for the above.
18252
18253         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18254         whether we are emitting for a ref or out parameter.
18255
18256         * expression.cs (Argument::Emit): Use the above field to set the state.
18257
18258         (LocalVariableReference::Emit): Update to honour the flag and emit the
18259         right stuff.
18260
18261         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18262
18263         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18264
18265         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18266
18267         (ReflectionParameters, InternalParameters): Implement the above method.
18268
18269         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18270         reporting errors.
18271
18272         (Invocation::FullMethodDesc): Ditto. 
18273
18274 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18275
18276         * cs-parser.jay: Add extra production for the second form of array
18277         creation. 
18278
18279         * expression.cs (ArrayCreation): Update to reflect the above
18280         change. 
18281
18282         * Small changes to prepare for Array initialization.
18283
18284 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18285
18286         * typemanager.cs (ImplementsInterface): interface might be null;
18287         Deal with this problem;
18288
18289         Also, we do store negative hits on the cache (null values), so use
18290         this instead of calling t.GetInterfaces on the type everytime.
18291
18292 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18293
18294         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18295
18296         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18297         split functionality out into different classes.
18298
18299         (New::FormArrayType): Move into NewBuiltinArray.
18300
18301         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18302         quite useless.
18303
18304         (NewBuiltinArray): New class to handle creation of built-in arrays.
18305
18306         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18307         account creation of one-dimensional arrays.
18308
18309         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18310
18311         (NewUserdefinedArray::DoResolve): Implement.
18312
18313         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18314
18315         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18316         we maintain inside the TypeManager. This is necessary to perform lookups on the
18317         module builder.
18318
18319         (LookupType): Update to perform GetType on the module builders too.     
18320
18321         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18322
18323         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18324
18325 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18326
18327         * expression.cs (New::DoResolve): Implement guts of array creation.
18328
18329         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18330
18331 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18332
18333         * expression.cs: Fix bug I introduced lsat night that broke
18334         Delegates. 
18335
18336         (Expression.Resolve): Report a 246 error (can not resolve name)
18337         if we find a SimpleName in the stream.
18338
18339         (Expression.ResolveLValue): Ditto.
18340
18341         (Expression.ResolveWithSimpleName): This function is a variant of
18342         ResolveName, this one allows SimpleNames to be returned without a
18343         warning.  The only consumer of SimpleNames is MemberAccess
18344
18345 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18346
18347         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18348         might arrive here.  I have my doubts that this is correct.
18349
18350         * statement.cs (Lock): Implement lock statement.
18351
18352         * cs-parser.jay: Small fixes to support `lock' and `using'
18353
18354         * cs-tokenizer.cs: Remove extra space
18355
18356         * driver.cs: New flag --checked, allows to turn on integer math
18357         checking. 
18358
18359         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18360         Threading.Monitor.Exit 
18361
18362 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18363
18364         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18365         Expression Class to be IndexerAccess.
18366
18367         Notice that Indexer::DoResolve sets the eclass to Value.
18368
18369 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18370
18371         * class.cs (TypeContainer::Emit): Emit code for indexers.
18372
18373         * assign.cs (IAssignMethod): New interface implemented by Indexers
18374         and Properties for handling assignment.
18375
18376         (Assign::Emit): Simplify and reuse code. 
18377
18378         * expression.cs (IndexerAccess, PropertyExpr): Implement
18379         IAssignMethod, clean up old code. 
18380
18381 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18382
18383         * typemanager.cs (ImplementsInterface): New method to determine if a type
18384         implements a given interface. Provides a nice cache too.
18385
18386         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18387         method.
18388
18389         (ConvertReferenceExplicit): Ditto.
18390
18391         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18392         various methods, with correct names etc.
18393
18394         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18395         Operator.UnaryNegation.
18396
18397         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18398         we have a unary plus or minus operator.
18399
18400         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18401         UnaryMinus.
18402
18403         * everywhere : update accordingly.
18404
18405         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18406         respectively.
18407
18408         * class.cs (Method::Define): For the case where we are implementing a method
18409         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18410         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18411
18412 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18413
18414         * interface.cs (FindMembers): Implement to work around S.R.E
18415         lameness.
18416
18417         * typemanager.cs (IsInterfaceType): Implement.
18418
18419         (FindMembers): Update to handle interface types too.
18420
18421         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18422         use IsAssignableFrom as that is not correct - it doesn't work.
18423
18424         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18425         and accordingly override EmitStatement.
18426
18427         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18428         using the correct logic :-)
18429
18430 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18431
18432         * ../errors/cs-11.cs : Add to demonstrate error -11 
18433
18434 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18437         then pass this as a hint to ResolveLValue.
18438
18439         * expression.cs (FieldExpr): Add Location information
18440
18441         (FieldExpr::LValueResolve): Report assignment to readonly
18442         variable. 
18443
18444         (Expression::ExprClassFromMemberInfo): Pass location information.
18445
18446         (Expression::ResolveLValue): Add new method that resolves an
18447         LValue. 
18448
18449         (Expression::DoResolveLValue): Default invocation calls
18450         DoResolve. 
18451
18452         (Indexers): New class used to keep track of indexers in a given
18453         Type. 
18454
18455         (IStackStore): Renamed from LValue, as it did not really describe
18456         what this did.  Also ResolveLValue is gone from this interface and
18457         now is part of Expression.
18458
18459         (ElementAccess): Depending on the element access type
18460
18461         * typemanager.cs: Add `indexer_name_type' as a Core type
18462         (System.Runtime.CompilerServices.IndexerNameAttribute)
18463
18464         * statement.cs (Goto): Take a location.
18465
18466 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18467
18468         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18469         if two delegates are compatible.
18470
18471         (NewDelegate::DoResolve): Update to take care of the case when
18472         we instantiate a delegate from another delegate.
18473
18474         * typemanager.cs (FindMembers): Don't even try to look up members
18475         of Delegate types for now.
18476
18477 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18478
18479         * delegate.cs (NewDelegate): New class to take care of delegate
18480         instantiation.
18481
18482         * expression.cs (New): Split the delegate related code out into 
18483         the NewDelegate class.
18484
18485         * delegate.cs (DelegateInvocation): New class to handle delegate 
18486         invocation.
18487
18488         * expression.cs (Invocation): Split out delegate related code into
18489         the DelegateInvocation class.
18490
18491 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18492
18493         * expression.cs (New::DoResolve): Implement delegate creation fully
18494         and according to the spec.
18495
18496         (New::DoEmit): Update to handle delegates differently.
18497
18498         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18499         because of which we were printing out arguments in reverse order !
18500
18501         * delegate.cs (VerifyMethod): Implement to check if the given method
18502         matches the delegate.
18503
18504         (FullDelegateDesc): Implement.
18505
18506         (VerifyApplicability): Implement.
18507
18508         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18509         delegate invocations too.
18510
18511         (Invocation::Emit): Ditto.
18512
18513         * ../errors/cs1593.cs : Added.
18514
18515         * ../errors/cs1594.cs : Added.
18516
18517         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18518
18519 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18520
18521         * typemanager.cs (intptr_type): Core type for System.IntPtr
18522
18523         (InitCoreTypes): Update for the same.
18524
18525         (iasyncresult_type, asynccallback_type): Ditto.
18526
18527         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18528         correct.
18529
18530         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18531         too.
18532
18533         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18534         the builders for the 4 members of a delegate type :-)
18535
18536         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18537         type.
18538
18539         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18540
18541         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18542
18543 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18544
18545         * statement.cs (Break::Emit): Implement.   
18546         (Continue::Emit): Implement.
18547
18548         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18549         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18550         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18551         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18552         end loop
18553
18554         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18555         properties that track the label for the current loop (begin of the
18556         loop and end of the loop).
18557
18558 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18559
18560         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18561         use of emitting anything at all.
18562
18563         * class.cs, rootcontext.cs : Get rid of calls to the same.
18564
18565         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18566
18567         (Populate): Define the constructor correctly and set the implementation
18568         attributes.
18569
18570         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18571         have been defined.
18572
18573         (AddDelegateType): Implement.
18574
18575         (IsDelegateType): Implement helper method.
18576
18577         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18578
18579         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18580         and accordingly handle it.
18581
18582         * delegate.cs (Populate): Take TypeContainer argument.
18583         Implement bits to define the Invoke method. However, I still haven't figured out
18584         how to take care of the native int bit :-(
18585
18586         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18587         Qualify the name of the delegate, not its return type !
18588
18589         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18590         conversion.
18591
18592         (StandardConversionExists): Checking for array types turns out to be recursive.
18593
18594         (ConvertReferenceExplicit): Implement array conversion.
18595
18596         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18597
18598 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18599
18600         * cs-parser.jay (delegate_declaration): Store the fully qualified
18601         name as it is a type declaration.
18602
18603         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18604         readonly.
18605
18606         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18607         as TypeContainer::DefineType.
18608
18609         (Populate): Method in which all the definition of the various methods (Invoke)
18610         etc is done.
18611
18612         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18613         see.
18614
18615         (CloseDelegate): Finally creates the delegate.
18616
18617         * class.cs (TypeContainer::DefineType): Update to define delegates.
18618         (Populate, Emit and CloseType): Do the same thing here too.
18619
18620         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18621         delegates in all these operations.
18622
18623 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * expression.cs: LocalTemporary: a new expression used to
18626         reference a temporary that has been created.
18627
18628         * assign.cs: Handle PropertyAccess back here, so that we can
18629         provide the proper semantic access to properties.
18630
18631         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18632         a few more explicit conversions. 
18633
18634         * modifiers.cs: `NEW' modifier maps to HideBySig.
18635
18636         * expression.cs (PropertyExpr): Make this into an
18637         ExpressionStatement, and support the EmitStatement code path. 
18638
18639         Perform get/set error checking, clean up the interface.
18640
18641         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18642         them into toplevel access objects.
18643
18644 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18645
18646         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18647         SRE.
18648
18649         * typemanager.cs: Keep track here of our PropertyBuilders again to
18650         work around lameness in SRE.
18651
18652 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18653
18654         * expression.cs (LValue::LValueResolve): New method in the
18655         interface, used to perform a second resolution pass for LValues. 
18656
18657         (This::DoResolve): Catch the use of this in static methods.
18658
18659         (This::LValueResolve): Implement.
18660
18661         (This::Store): Remove warning, assigning to `this' in structures
18662         is 
18663
18664         (Invocation::Emit): Deal with invocation of
18665         methods on value types.  We need to pass the address to structure
18666         methods rather than the object itself.  (The equivalent code to
18667         emit "this" for structures leaves the entire structure on the
18668         stack instead of a pointer to it). 
18669
18670         (ParameterReference::DoResolve): Compute the real index for the
18671         argument based on whether the method takes or not a `this' pointer
18672         (ie, the method is static).
18673
18674         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18675         value types returned from functions when we need to invoke a
18676         method on the sturcture.
18677
18678
18679 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18680
18681         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18682         defining the type in the Modulebuilder or Typebuilder. This is to take
18683         care of nested types which need to be defined on the TypeBuilder using
18684         DefineNestedMethod.
18685
18686         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18687         methods in RootContext, only ported to be part of TypeContainer.
18688
18689         (TypeContainer::GetInterfaceOrClass): Ditto.
18690
18691         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18692
18693         * interface.cs (Interface::DefineInterface): New method. Does exactly
18694         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18695         too.
18696
18697         (Interface::GetInterfaces): Move from RootContext here and port.
18698
18699         (Interface::GetInterfaceByName): Same here.
18700
18701         * rootcontext.cs (ResolveTree): Re-write.
18702
18703         (PopulateTypes): Re-write.
18704
18705         * class.cs (TypeContainer::Populate): Populate nested types too.
18706         (TypeContainer::Emit): Emit nested members too.
18707
18708         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18709         instead just use the name argument passed in as it is already fully
18710         qualified.
18711
18712         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18713         to TypeContainer mapping to see if a type is user-defined.
18714
18715         * class.cs (TypeContainer::CloseType): Implement. 
18716
18717         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18718         the default constructor.
18719
18720         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18721         twice.
18722
18723         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18724
18725         * interface.cs (CloseType): Create the type here.
18726
18727         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18728         the hierarchy.
18729
18730         Remove all the methods which are now in TypeContainer.
18731
18732 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18733
18734         * delegate.cs (Define): Re-write bits to define the delegate
18735         correctly.
18736
18737 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18738
18739         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18740
18741         * expression.cs (ImplicitReferenceConversion): handle null as well
18742         as a source to convert to any reference type.
18743
18744         * statement.cs (Return): Perform any implicit conversions to
18745         expected return type.  
18746
18747         Validate use of return statement.  
18748
18749         * codegen.cs (EmitContext): Pass the expected return type here.
18750
18751         * class.cs (Method, Constructor, Property): Pass expected return
18752         type to EmitContext.
18753
18754 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18755
18756         * expression.cs: Make DoResolve take an EmitContext instead of a
18757         TypeContainer.
18758
18759         Replaced `l' and `location' for `loc', for consistency.
18760
18761         (Error, Warning): Remove unneeded Tc argument.
18762
18763         * assign.cs, literal.cs, constant.cs: Update to new calling
18764         convention. 
18765
18766         * codegen.cs: EmitContext now contains a flag indicating whether
18767         code is being generated in a static method or not.
18768
18769         * cs-parser.jay: DecomposeQI, new function that replaces the old
18770         QualifiedIdentifier.  Now we always decompose the assembled
18771         strings from qualified_identifier productions into a group of
18772         memberaccesses.
18773
18774 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18775
18776         * rootcontext.cs: Deal with field-less struct types correctly now
18777         by passing the size option to Define Type.
18778
18779         * class.cs: Removed hack that created one static field. 
18780
18781 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18782
18783         * statement.cs: Moved most of the code generation here. 
18784
18785 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18786
18787         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18788         seem very right.
18789
18790         (ElementAccess): Remove useless bits for now - keep checks as the spec
18791         says.
18792
18793 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18794
18795         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18796         and start performing checks according to the spec.
18797
18798 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18799
18800         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18801         rank_specifiers instead.
18802
18803         (rank_specifiers): Change the order in which the rank specifiers are stored
18804
18805         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18806
18807         * expression.cs (ElementAccess): Implement the LValue interface too.
18808
18809 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18810
18811         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18812         except that user defined conversions are not included.
18813
18814         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18815         perform the conversion of the return type, if necessary.
18816
18817         (New::DoResolve): Check whether we are creating an array or an object
18818         and accordingly do the needful.
18819
18820         (New::Emit): Same here.
18821
18822         (New::DoResolve): Implement guts of array creation.
18823
18824         (New::FormLookupType): Helper function.
18825
18826 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18827
18828         * codegen.cs: Removed most of the code generation here, and move the
18829         corresponding code generation bits to the statement classes. 
18830
18831         Added support for try/catch/finalize and throw.
18832
18833         * cs-parser.jay: Added support for try/catch/finalize.
18834
18835         * class.cs: Catch static methods having the flags override,
18836         virtual or abstract.
18837
18838         * expression.cs (UserCast): This user cast was not really doing
18839         what it was supposed to do.  Which is to be born in fully resolved
18840         state.  Parts of the resolution were being performed at Emit time! 
18841
18842         Fixed this code.
18843
18844 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18845
18846         * expression.cs: Implicity convert the result from UserCast.
18847
18848 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18849
18850         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18851         prevented it from working correctly. 
18852
18853         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18854         merely ConvertImplicit.
18855
18856 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * typemanager.cs: Make the LookupTypeContainer function static,
18859         and not per-instance.  
18860
18861         * class.cs: Make static FindMembers (the one that takes a Type
18862         argument). 
18863
18864         * codegen.cs: Add EmitForeach here.
18865
18866         * cs-parser.jay: Make foreach a toplevel object instead of the
18867         inline expansion, as we need to perform semantic analysis on it. 
18868
18869 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18870
18871         * expression.cs (Expression::ImplicitUserConversion): Rename to
18872         UserDefinedConversion.
18873
18874         (Expression::UserDefinedConversion): Take an extra argument specifying 
18875         whether we look for explicit user conversions too.
18876
18877         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18878
18879         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18880
18881         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18882         with the appropriate arguments.
18883
18884         * cs-parser.jay (cast_expression): Record location too.
18885
18886         * expression.cs (Cast): Record location info.
18887
18888         (Expression::ConvertExplicit): Take location argument.
18889
18890         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18891         to determine if we are doing explicit conversions.
18892
18893         (UserCast::Emit): Update accordingly.
18894
18895         (Expression::ConvertExplicit): Report an error if everything fails.
18896
18897         * ../errors/cs0030.cs : Add.
18898
18899 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18900
18901         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18902         virtual and newslot bits. 
18903
18904         * class.cs (TypeContainer::RegisterRequiredImplementations):
18905         Record methods we need.
18906
18907         (TypeContainer::MakeKey): Helper function to make keys for
18908         MethodBases, since the Methodbase key is useless.
18909
18910         (TypeContainer::Populate): Call RegisterRequiredImplementations
18911         before defining the methods.   
18912
18913         Create a mapping for method_builders_to_methods ahead of time
18914         instead of inside a tight loop.
18915
18916         (::RequireMethods):  Accept an object as the data to set into the
18917         hashtable so we can report interface vs abstract method mismatch.
18918
18919 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * report.cs: Make all of it static.
18922
18923         * rootcontext.cs: Drop object_type and value_type computations, as
18924         we have those in the TypeManager anyways.
18925
18926         Drop report instance variable too, now it is a global.
18927
18928         * driver.cs: Use try/catch on command line handling.
18929
18930         Add --probe option to debug the error reporting system with a test
18931         suite. 
18932
18933         * report.cs: Add support for exiting program when a probe
18934         condition is reached.
18935
18936 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18937
18938         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18939         we do a forcible conversion regardless of type, to check if 
18940         ForceConversion returns a null.
18941
18942         (Binary::error19): Use location to report error.
18943
18944         (Unary::error23): Use location here too.
18945
18946         * ../errors/cs0019.cs : Check in.
18947
18948         * ../errors/cs0023.cs : Check in.
18949
18950         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18951         case of a non-null MethodInfo object with a length of 0 !
18952
18953         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18954         an applicable member - according to the spec :-)
18955         Also fix logic to find members in base types.
18956
18957         (Unary::ResolveOperator): Same here.
18958
18959         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18960         as I was getting thoroughly confused between this and error19 :-)
18961
18962         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18963         (::FindMostEncompassedType): Implement.
18964         (::FindMostEncompassingType): Implement.
18965         (::StandardConversionExists): Implement.
18966
18967         (UserImplicitCast): Re-vamp. We now need info about most specific
18968         source and target types so that we can do the necessary conversions.
18969
18970         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18971         mathematical union with no duplicates.
18972
18973 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18974
18975         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18976         in order from base classes to child classes, so that we can in
18977         child classes look up in our parent for method names and
18978         attributes (required for handling abstract, virtual, new, override
18979         constructs: we need to instrospect our base class, and if we dont
18980         populate the classes in order, the introspection might be
18981         incorrect.  For example, a method could query its parent before
18982         the parent has any methods and would determine that the parent has
18983         no abstract methods (while it could have had them)).
18984
18985         (RootContext::CreateType): Record the order in which we define the
18986         classes.
18987
18988 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * class.cs (TypeContainer::Populate): Also method definitions can
18991         fail now, keep track of this.
18992
18993         (TypeContainer::FindMembers): Implement support for
18994         DeclaredOnly/noDeclaredOnly flag.
18995
18996         (Constructor::Emit) Return the ConstructorBuilder.
18997
18998         (Method::Emit) Return the MethodBuilder. 
18999         Check for abstract or virtual methods to be public.
19000
19001         * rootcontext.cs (RootContext::CreateType): Register all the
19002         abstract methods required for the class to be complete and the
19003         interface methods that must be implemented. 
19004
19005         * cs-parser.jay: Report error 501 (method requires body if it is
19006         not marked abstract or extern).
19007
19008         * expression.cs (TypeOf::Emit): Implement.
19009
19010         * typemanager.cs: runtime_handle_type, new global type.
19011
19012         * class.cs (Property::Emit): Generate code for properties.
19013
19014 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19015
19016         * expression.cs (Unary::ResolveOperator): Find operators on base type
19017         too - we now conform exactly to the spec.
19018
19019         (Binary::ResolveOperator): Same here.
19020
19021         * class.cs (Operator::Define): Fix minor quirk in the tests.
19022
19023         * ../errors/cs0215.cs : Added.
19024
19025         * ../errors/cs0556.cs : Added.
19026
19027         * ../errors/cs0555.cs : Added.
19028
19029 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19030
19031         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19032         single integer which is really efficient
19033
19034 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19035
19036         *  expression.cs (Expression::ImplicitUserConversion): Use location
19037         even in the case when we are examining True operators.
19038  
19039         * class.cs (Operator::Define): Perform extensive checks to conform
19040         with the rules for operator overloading in the spec.
19041
19042         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19043         some of the other conversions mentioned in the spec.
19044
19045         * typemanager.cs (array_type): New static member for the System.Array built-in
19046         type.
19047
19048         (cloneable_interface): For System.ICloneable interface.
19049
19050         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19051         we start resolving the tree and populating types.
19052
19053         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19054  
19055 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19056
19057         * expression.cs (Expression::ExprClassFromMemberInfo,
19058         Expression::Literalize): Create literal expressions from
19059         FieldInfos which are literals.
19060
19061         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19062         type casts, because they were wrong.  The test suite in tests
19063         caught these ones.
19064
19065         (ImplicitNumericConversion): ushort to ulong requires a widening
19066         cast. 
19067
19068         Int32 constant to long requires widening cast as well.
19069
19070         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19071         for integers because the type on the stack is not i4.
19072
19073 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19074
19075         * expression.cs (report118): require location argument. 
19076
19077         * parameter.cs: Do not dereference potential null value.
19078
19079         * class.cs: Catch methods that lack the `new' keyword when
19080         overriding a name.  Report warnings when `new' is used without
19081         anything being there to override.
19082
19083         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19084
19085         * class.cs: Only add constructor to hashtable if it is non-null
19086         (as now constructors can fail on define).
19087
19088         (TypeManager, Class, Struct): Take location arguments.
19089
19090         Catch field instance initialization in structs as errors.
19091
19092         accepting_filter: a new filter for FindMembers that is static so
19093         that we dont create an instance per invocation.
19094
19095         (Constructor::Define): Catch errors where a struct constructor is
19096         parameterless 
19097
19098         * cs-parser.jay: Pass location information for various new
19099         constructs. 
19100
19101         * delegate.cs (Delegate): take a location argument.
19102
19103         * driver.cs: Do not call EmitCode if there were problesm in the
19104         Definition of the types, as many Builders wont be there. 
19105
19106         * decl.cs (Decl::Decl): Require a location argument.
19107
19108         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19109         into integers, and find the most appropiate integer for it.
19110
19111         * literal.cs: Implement ULongLiteral.
19112
19113         * rootcontext.cs: Provide better information about the location of
19114         failure when CreateType fails.
19115
19116 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19117
19118         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19119         as well.
19120
19121         * expression.cs (Binary::CheckShiftArguments): Add missing type
19122         computation.
19123         (Binary::ResolveOperator): Add type to the logical and and logical
19124         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19125         before.
19126
19127         (Binary::DoNumericPromotions): In the case where either argument
19128         is ulong (and most signed types combined with ulong cause an
19129         error) perform implicit integer constant conversions as well.
19130
19131 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19132
19133         * expression.cs (UserImplicitCast): Method should always be
19134         non-null. 
19135         (Invocation::BetterConversion): Simplified test for IntLiteral.
19136
19137         (Expression::ImplicitNumericConversion): Split this routine out.
19138         Put the code that performs implicit constant integer conversions
19139         here. 
19140
19141         (Expression::Resolve): Become a wrapper around DoResolve so we can
19142         check eclass and type being set after resolve.
19143
19144         (Invocation::Badness): Remove this dead function
19145
19146         (Binary::ResolveOperator): Do not compute the expensive argumnets
19147         unless we have a union for it.
19148
19149         (Probe::Emit): Is needs to do an isinst and then
19150         compare against null.
19151
19152         (::CanConvert): Added Location argument.  If the Location argument
19153         is null (Location.Null), then we do not report errors.  This is
19154         used by the `probe' mechanism of the Explicit conversion.  We do
19155         not want to generate an error for something that the user
19156         explicitly requested to be casted.  But the pipeline for an
19157         explicit cast first tests for potential implicit casts.
19158
19159         So for now, if the Location is null, it means `Probe only' to
19160         avoid adding another argument.   Might have to revise this
19161         strategy later.
19162
19163         (ClassCast): New class used to type cast objects into arbitrary
19164         classes (used in Explicit Reference Conversions).
19165
19166         Implement `as' as well.
19167
19168         Reverted all the patches from Ravi below: they were broken:
19169
19170                 * The use of `level' as a mechanism to stop recursive
19171                   invocations is wrong.  That was there just to catch the
19172                   bug with a strack trace but not as a way of addressing
19173                   the problem.
19174
19175                   To fix the problem we have to *understand* what is going
19176                   on and the interactions and come up with a plan, not
19177                   just get things going.
19178
19179                 * The use of the type conversion cache that I proposed
19180                   last night had an open topic: How does this work across
19181                   protection domains.  A user defined conversion might not
19182                   be public in the location where we are applying the
19183                   conversion, a different conversion might be selected
19184                   (ie, private A->B (better) but public B->A (worse),
19185                   inside A, A->B applies, but outside it, B->A will
19186                   apply).
19187
19188                 * On top of that (ie, even if the above is solved),
19189                   conversions in a cache need to be abstract.  Ie, `To
19190                   convert from an Int to a Short use an OpcodeCast', not
19191                   `To convert from an Int to a Short use the OpcodeCast on
19192                   the variable 5' (which is what this patch was doing).
19193
19194 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19195
19196         * expression.cs (Invocation::ConversionExists): Re-write to use
19197         the conversion cache
19198
19199         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19200         cache all conversions done, not just user-defined ones.
19201
19202         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19203         to determine if a conversion exists instead of acutually trying to 
19204         perform the conversion. It's faster too.
19205
19206         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19207         and only then attempt the implicit conversion.
19208
19209 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19210
19211         * expression.cs (ConvertImplicit): Use a cache for conversions
19212         already found. Check level of recursion and bail out if necessary.
19213
19214 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19215
19216         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19217         Export standard methods that we expect for string operations.
19218
19219         * statement.cs (Block::UsageWarning): Track usage of variables and
19220         report the errors for not used variables.
19221
19222         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19223         operator. 
19224
19225 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19226
19227         * codegen.cs: remove unnneded code 
19228
19229         * expression.cs: Removed BuiltinTypeAccess class
19230
19231         Fix the order in which implicit conversions are
19232         done.  
19233
19234         The previous fixed dropped support for boxed conversions (adding a
19235         test to the test suite now)
19236
19237         (UserImplicitCast::CanConvert): Remove test for source being null,
19238         that code is broken.  We should not feed a null to begin with, if
19239         we do, then we should track the bug where the problem originates
19240         and not try to cover it up here.
19241
19242         Return a resolved expression of type UserImplicitCast on success
19243         rather than true/false.  Ravi: this is what I was talking about,
19244         the pattern is to use a static method as a "constructor" for
19245         objects. 
19246
19247         Also, do not create arguments until the very last minute,
19248         otherwise we always create the arguments even for lookups that
19249         will never be performed. 
19250
19251         (UserImplicitCast::Resolve): Eliminate, objects of type
19252         UserImplicitCast are born in a fully resolved state. 
19253
19254         * typemanager.cs (InitCoreTypes): Init also value_type
19255         (System.ValueType). 
19256
19257         * expression.cs (Cast::Resolve): First resolve the child expression.
19258
19259         (LValue): Add new method AddressOf to be used by
19260         the `&' operator.  
19261
19262         Change the argument of Store to take an EmitContext instead of an
19263         ILGenerator, because things like FieldExpr need to be able to call
19264         their children expression to generate the instance code. 
19265
19266         (Expression::Error, Expression::Warning): Sugar functions for
19267         reporting errors.
19268
19269         (Expression::MemberLookup): Accept a TypeContainer instead of a
19270         Report as the first argument.
19271
19272         (Expression::ResolvePrimary): Killed.  I still want to improve
19273         this as currently the code is just not right.
19274
19275         (Expression::ResolveMemberAccess): Simplify, but it is still
19276         wrong. 
19277
19278         (Unary::Resolve): Catch errors in AddressOf operators.
19279
19280         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19281         index to a byte for the short-version, or the compiler will choose
19282         the wrong Emit call, which generates the wrong data.
19283
19284         (ParameterReference::Emit, ::Store): same.
19285
19286         (FieldExpr::AddressOf): Implement.
19287
19288         * typemanager.cs: TypeManager: made public variable instead of
19289         property.
19290
19291         * driver.cs: document --fatal.
19292
19293         * report.cs (ErrorMessage, WarningMessage): new names for the old
19294         Error and Warning classes.
19295
19296         * cs-parser.jay (member_access): Turn built-in access to types
19297         into a normal simplename
19298
19299 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19300
19301         * expression.cs (Invocation::BetterConversion): Fix to cope
19302         with q being null, since this was introducing a bug.
19303
19304         * expression.cs (ConvertImplicit): Do built-in conversions first.
19305
19306 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19307
19308         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19309
19310 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19311
19312         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19313         I had introduced long ago (what's new ?).
19314
19315         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19316         the work of all the checking. 
19317         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19318         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19319
19320         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19321         that is the right way. 
19322
19323         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19324         overloading resolution. Use everywhere instead of cutting and pasting code.
19325
19326         (Binary::ResolveOperator): Use MakeUnionSet.
19327
19328         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19329         we have to convert to bool types. Not complete yet.
19330
19331 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * typemanager.cs (TypeManager::CSharpName): support ushort.
19334
19335         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19336         to provide an expression that performsn an implicit constant int
19337         conversion (section 6.1.6).
19338         (Expression::ConvertImplicitRequired): Reworked to include
19339         implicit constant expression conversions.
19340
19341         (Expression::ConvertNumericExplicit): Finished.
19342
19343         (Invocation::Emit): If InstanceExpression is null, then it means
19344         that we perform a call on this.
19345
19346 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * expression.cs (Unary::Emit): Remove some dead code.
19349         (Probe): Implement Resolve and Emit for `is'.
19350         (Expression::ConvertImplicitRequired): Attempt to do constant
19351         expression conversions here.  Maybe should be moved to
19352         ConvertImplicit, but I am not sure.
19353         (Expression::ImplicitLongConstantConversionPossible,
19354         Expression::ImplicitIntConstantConversionPossible): New functions
19355         that tell whether is it possible to apply an implicit constant
19356         expression conversion.
19357
19358         (ConvertNumericExplicit): Started work on explicit numeric
19359         conversions.
19360
19361         * cs-parser.jay: Update operator constants.
19362
19363         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19364         (Parameters::GetSignature): Hook up VerifyArgs here.
19365         (Parameters::VerifyArgs): Verifies that no two arguments have the
19366         same name. 
19367
19368         * class.cs (Operator): Update the operator names to reflect the
19369         ones that the spec expects (as we are just stringizing the
19370         operator names).
19371
19372         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19373         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19374         previous usage did only work for our methods.
19375         (Expression::ConvertImplicit): Handle decimal implicit numeric
19376         conversions as well.
19377         (Expression::InternalTypeConstructor): Used to invoke constructors
19378         on internal types for default promotions.
19379
19380         (Unary::Emit): Implement special handling for the pre/post
19381         increment/decrement for overloaded operators, as they need to have
19382         the same semantics as the other operators.
19383
19384         (Binary::ResolveOperator): ditto.
19385         (Invocation::ConversionExists): ditto.
19386         (UserImplicitCast::Resolve): ditto.
19387
19388 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19389
19390         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19391         operator, return after emitting body. Regression tests pass again !
19392
19393         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19394         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19395         (Invocation::OverloadResolve): Ditto.
19396         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19397
19398         * everywhere : update calls to the above methods accordingly.
19399
19400 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19401
19402         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19403
19404         * expression.cs (ExpressionStatement): New base class used for
19405         expressions that can appear in statements, so that we can provide
19406         an alternate path to generate expression that do not leave a value
19407         on the stack.
19408
19409         (Expression::Emit, and all the derivatives): We no longer return
19410         whether a value is left on the stack or not.  Every expression
19411         after being emitted leaves a single value on the stack.
19412
19413         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19414         facilties of ExpressionStatement if possible.
19415
19416         * cs-parser.jay: Update statement_expression.
19417
19418 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19419
19420         * driver.cs: Change the wording of message
19421
19422 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19423
19424         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19425         the type of the expression to the return type of the method if
19426         we have an overloaded operator match ! The regression tests pass again !
19427         (Unary::ResolveOperator): Ditto.
19428
19429         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19430         to find "op_Implicit", not "implicit" ;-)
19431         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19432         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19433
19434         * everywhere : Correct calls to the above accordingly.
19435
19436         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19437         (ConvertImplicit): Do user-defined conversion if it exists.
19438
19439 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * assign.cs: track location.
19442         (Resolve): Use implicit conversions on assignment.
19443
19444         * literal.cs: Oops.  Not good, Emit of short access values should
19445         pass (Bytes) or the wrong argument will be selected.
19446
19447         * expression.cs (Unary::Emit): Emit code for -expr.
19448
19449         (Unary::ResolveOperator): Handle `Substract' for non-constants
19450         (substract from zero from the non-constants).
19451         Deal with Doubles as well. 
19452
19453         (Expression::ConvertImplicitRequired): New routine that reports an
19454         error if no implicit conversion exists. 
19455
19456         (Invocation::OverloadResolve): Store the converted implicit
19457         expressions if we make them
19458
19459 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19460
19461         * class.cs (ConstructorInitializer): Take a Location argument.
19462         (ConstructorBaseInitializer): Same here.
19463         (ConstructorThisInitializer): Same here.
19464
19465         * cs-parser.jay : Update all calls accordingly.
19466
19467         * expression.cs (Unary, Binary, New): Take location argument.
19468         Update accordingly everywhere.
19469
19470         * cs-parser.jay : Update all calls to the above to take a location
19471         argument.
19472
19473         * class.cs : Ditto.
19474
19475 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19476
19477         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19478         (Invocation::BetterConversion): Same here
19479         (Invocation::ConversionExists): Ditto.
19480
19481         (Invocation::ConversionExists): Implement.
19482
19483 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19484
19485         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19486         Also take an additional TypeContainer argument.
19487
19488         * All over : Pass in TypeContainer as argument to OverloadResolve.
19489
19490         * typemanager.cs (CSharpName): Update to check for the string type and return
19491         that too.
19492
19493         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19494         a given method.
19495
19496 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19497
19498         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19499         (Invocation::BetterFunction): Implement.
19500         (Invocation::BetterConversion): Implement.
19501         (Invocation::ConversionExists): Skeleton, no implementation yet.
19502
19503         Okay, things work fine !
19504
19505 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19506
19507         * typemanager.cs: declare and load enum_type, delegate_type and
19508         void_type. 
19509
19510         * expression.cs (Expression::Emit): Now emit returns a value that
19511         tells whether a value is left on the stack or not.  This strategy
19512         might be reveted tomorrow with a mechanism that would address
19513         multiple assignments.
19514         (Expression::report118): Utility routine to report mismatches on
19515         the ExprClass.
19516
19517         (Unary::Report23): Report impossible type/operator combination
19518         utility function.
19519
19520         (Unary::IsIncrementableNumber): Whether the type can be
19521         incremented or decremented with add.
19522         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19523         complemented. 
19524         (Unary::ResolveOperator): Implement ++, !, ~,
19525
19526         (Invocation::Emit): Deal with new Emit convetion.
19527
19528         * All Expression derivatives: Updated their Emit method to return
19529         whether they leave values on the stack or not.
19530
19531         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19532         stack for expressions that are statements. 
19533
19534 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19535
19536         * expression.cs (LValue): New interface.  Must be implemented by
19537         LValue objects.
19538         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19539         LValue interface.
19540
19541         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19542         interface for generating code, simplifies the code.
19543
19544 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19545
19546         * expression.cs (everywhere): Comment out return statements in ::Resolve
19547         methods to avoid the warnings.
19548
19549 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19550
19551         * driver.cs (parse): Report error 2001 if we can not open the
19552         source file.
19553
19554         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19555         not resolve it.
19556
19557         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19558         object. 
19559
19560         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19561         otherwise nested blocks end up with the same index.
19562
19563         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19564
19565         * expression.cs:  Instead of having FIXMEs in the Resolve
19566         functions, throw exceptions so it is obvious that we are facing a
19567         bug. 
19568
19569         * cs-parser.jay (invocation_expression): Pass Location information.
19570
19571         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19572         Use a basename for those routines because .NET does not like paths
19573         on them. 
19574
19575         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19576         already defined.
19577
19578 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19579
19580         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19581         are loading the correct data types (throws an exception if not).
19582         (TypeManager::InitCoreTypes): Use CoreLookupType
19583
19584         * expression.cs (Unary::ResolveOperator): return the child
19585         expression for expressions which are just +expr.
19586         (Unary::ResolveOperator): Return negative literals for -LITERAL
19587         expressions (otherwise they are Unary {Literal}).
19588         (Invocation::Badness): Take into account `Implicit constant
19589         expression conversions'.
19590
19591         * literal.cs (LongLiteral): Implement long literal class.
19592         (IntLiteral): export the `Value' of the intliteral. 
19593
19594 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19595
19596         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19597
19598         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19599         instead of 'Operator'
19600
19601         * expression.cs (Binary::ResolveOperator): Update accordingly.
19602         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19603         and 'Minus'
19604
19605         * cs-parser.jay (unary_expression): Update to use the new names.
19606
19607         * gen-treedump.cs (GetUnary): Same here.
19608
19609         * expression.cs (Unary::Resolve): Implement.
19610         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19611         operators are found instead of making noise ;-)
19612         (Unary::ResolveOperator): New method to do precisely the same thing which
19613         Binary::ResolveOperator does for Binary expressions.
19614         (Unary.method, .Arguments): Add.
19615         (Unary::OperName): Implement.   
19616         (Unary::ForceConversion): Copy and Paste !
19617
19618         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19619         a unary operator.
19620
19621         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19622         for the inbuilt operators. Only overloading works for now ;-)
19623
19624 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19625
19626         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19627         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19628
19629         * expression.cs (This::Emit): Implement. 
19630         (This::Resolve): Implement.
19631         (TypeOf:Resolve): Implement.
19632         (Expression::ResolveSimpleName): Add an implicit this to instance
19633         field references. 
19634         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19635         Bind instance variable to Field expressions.
19636         (FieldExpr::Instance): New field used to track the expression that
19637         represents the object instance.
19638         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19639         binding 
19640         (FieldExpr::Emit): Implement.
19641
19642         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19643         the last instruction contains a return opcode to avoid generating
19644         the last `ret' instruction (this generates correct code, and it is
19645         nice to pass the peverify output).
19646
19647         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19648         initializer for static and instance variables.
19649         (Constructor::Emit): Allow initializer to be null in the case of
19650         static constructors.  Only emit initializer for instance
19651         constructors. 
19652
19653         (TypeContainer::FindMembers): Return a null array if there are no
19654         matches.
19655
19656         Also fix the code for the MemberTypes.Method branch, as it was not
19657         scanning that for operators (or tried to access null variables before).
19658
19659         * assign.cs (Assign::Emit): Handle instance and static fields. 
19660
19661         * TODO: Updated.
19662
19663         * driver.cs: Stop compilation if there are parse errors.
19664
19665         * cs-parser.jay (constructor_declaration): Provide default base
19666         initializer for non-static constructors.
19667         (constructor_declarator): Do not provide a default base
19668         initializers if none was specified.
19669         Catch the fact that constructors should not have parameters.
19670
19671         * class.cs: Do not emit parent class initializers for static
19672         constructors, that should be flagged as an error.
19673
19674 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19675
19676         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19677         Move back code into TypeContainer::Populate.
19678
19679 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19680
19681         * class.cs (TypeContainer::AddConstructor): Fix the check to
19682         compare against Name, not Basename. 
19683         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19684
19685         * cs-parser.jay : Update accordingly.
19686
19687         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19688         for methods, don't forget to look into the operators too.
19689         (RegisterMethodBuilder): Helper method to take care of this for
19690         methods, constructors and operators.
19691         (Operator::Define): Completely revamp.
19692         (Operator.OperatorMethod, MethodName): New fields.
19693         (TypeContainer::Populate): Move the registering of builders into
19694         RegisterMethodBuilder.
19695         (Operator::Emit): Re-write.
19696
19697         * expression.cs (Binary::Emit): Comment out code path to emit method
19698         invocation stuff for the case when we have a user defined operator. I am
19699         just not able to get it right !
19700
19701 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19702
19703         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19704         argument. 
19705
19706         (Expression::MemberLookup): Provide a version that allows to
19707         specify the MemberTypes and BindingFlags. 
19708
19709         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19710         so it was not fetching variable information from outer blocks.
19711
19712         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19713         Beforefieldinit as it was buggy.
19714
19715         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19716         that Ravi put here.  
19717
19718         * class.cs (Constructor::Emit): Only emit if block is not null.
19719         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19720         deal with this by semantically definining it as if the user had
19721         done it.
19722
19723         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19724         constructors as we now "emit" them at a higher level.
19725
19726         (TypeContainer::DefineDefaultConstructor): Used to define the
19727         default constructors if none was provided.
19728
19729         (ConstructorInitializer): Add methods Resolve and Emit. 
19730
19731         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19732
19733 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19734
19735         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19736         the default constructor builder with our hashtable for methodbuilders
19737         to methodcores.
19738
19739         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19740         and argument_count is 0 in which case we have a match.
19741         (Binary::ResolveOperator): More null checking and miscellaneous coding
19742         style cleanup.
19743
19744 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19745
19746         * rootcontext.cs (IsNameSpace): Compare against null.
19747
19748         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19749
19750         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19751         and Unary::Operator.
19752
19753         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19754         accordingly.
19755
19756         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19757         we have overloaded operators.
19758         (Binary::ResolveOperator): Implement the part which does the operator overload
19759         resolution.
19760
19761         * class.cs (Operator::Emit): Implement.
19762         (TypeContainer::Emit): Emit the operators we have too.
19763
19764         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19765         the case when we have a user-defined operator.
19766
19767 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19768
19769         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19770
19771 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19772
19773         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19774         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19775         (Constructor::Emit): Implement.
19776         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19777         if we have no work to do. 
19778         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19779         Emit method.
19780
19781         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19782         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19783
19784         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19785         of parent.parent.
19786
19787 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19788
19789         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19790         in the source.
19791         (Tree::RecordNamespace): Method to do what the name says ;-)
19792         (Tree::Namespaces): Property to get at the namespaces hashtable.
19793
19794         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19795         keep track.
19796
19797         * rootcontext.cs (IsNamespace): Fixed it :-)
19798
19799 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * class.cs (TypeContainer::FindMembers): Add support for
19802         constructors. 
19803         (MethodCore): New class that encapsulates both the shared aspects
19804         of a Constructor and a Method.  
19805         (Method, Constructor): Factored pieces into MethodCore.
19806
19807         * driver.cs: Added --fatal which makes errors throw exceptions.
19808         Load System assembly as well as part of the standard library.
19809
19810         * report.cs: Allow throwing exceptions on errors for debugging.
19811
19812         * modifiers.cs: Do not use `parent', instead use the real type
19813         container to evaluate permission settings.
19814
19815         * class.cs: Put Ravi's patch back in.  He is right, and we will
19816         have to cope with the
19817
19818 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19819
19820         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19821         FamORAssem, not FamANDAssem.
19822
19823 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19824
19825         * driver.cs: Added --parse option that only parses its input files
19826         and terminates.
19827
19828         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19829         incorrect.  IsTopLevel is not used to tell whether an object is
19830         root_types or not (that can be achieved by testing this ==
19831         root_types).  But to see if this is a top-level *class* (not
19832         necessarly our "toplevel" container). 
19833
19834 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19835
19836         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19837         parent instead of a direct call to GetType.
19838
19839 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19840
19841         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19842         Modifiers.TypeAttr. This should just be a call to that method.
19843
19844         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19845         object so that we can determine if we are top-level or not.
19846
19847         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19848         TypeContainer too.
19849
19850         * enum.cs (Enum::Define): Ditto.
19851
19852         * modifiers.cs (FieldAttr): Re-write.
19853
19854         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19855         (TypeContainer::HaveStaticConstructor): New property to provide access
19856         to precisely that info.
19857
19858         * modifiers.cs (MethodAttr): Re-write.
19859         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19860
19861         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19862         of top-level types as claimed.
19863
19864 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19865
19866         * expression.cs (MemberLookup): Fruitless attempt to lookup
19867         constructors.  Maybe I need to emit default constructors?  That
19868         might be it (currently .NET emits this for me automatically).
19869         (Invocation::OverloadResolve): Cope with Arguments == null.
19870         (Invocation::EmitArguments): new function, shared by the new
19871         constructor and us.
19872         (Invocation::Emit): Handle static and instance methods.  Emit
19873         proper call instruction for virtual or non-virtual invocations.
19874         (New::Emit): Implement.
19875         (New::Resolve): Implement.
19876         (MemberAccess:Resolve): Implement.
19877         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19878         to track instances.
19879         (FieldExpr::Resolve): Set type.
19880
19881         * support.cs: Handle empty arguments.
19882                 
19883         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19884         SimpleLookup): Auxiliary routines to help parse a qualifier
19885         identifier.  
19886
19887         Update qualifier_identifier rule.
19888
19889         * codegen.cs: Removed debugging messages.
19890
19891         * class.cs: Make this a global thing, this acts just as a "key" to
19892         objects that we might have around.
19893
19894         (Populate): Only initialize method_builders_to_methods once.
19895
19896         * expression.cs (PropertyExpr): Initialize type from the
19897         PropertyType. 
19898
19899         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19900         Resolve pattern.  Attempt to implicitly convert value to boolean.
19901         Emit code.
19902
19903         * expression.cs: Set the type for the int32/int32 argument case.
19904         (Binary::ResolveOperator): Set the return type to boolean for
19905         comparission operators
19906
19907         * typemanager.cs: Remove debugging print code.
19908
19909         (Invocation::Resolve): resolve type.
19910
19911         * class.cs: Allocate a MemberInfo of the correct size, as the code
19912         elsewhere depends on the test to reflect the correct contents.
19913
19914         (Method::) Keep track of parameters, due to System.Reflection holes
19915
19916         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19917         mapping here.
19918
19919         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19920         of the exact size and return that.
19921
19922         (Class::LookupMethodByBuilder): New function that maps
19923         MethodBuilders to its methods.  Required to locate the information
19924         on methods because System.Reflection bit us again.
19925
19926         * support.cs: New file, contains an interface ParameterData and
19927         two implementations: ReflectionParameters and InternalParameters
19928         used to access Parameter information.  We will need to grow this
19929         as required.
19930
19931         * expression.cs (Invocation::GetParameterData): implement a cache
19932         and a wrapper around the ParameterData creation for methods. 
19933         (Invocation::OverloadResolve): Use new code.
19934
19935 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19936
19937         * class.cs (TypeContainer::EmitField): Remove and move into 
19938         (Field::Define): here and modify accordingly.
19939         (Field.FieldBuilder): New member.
19940         (TypeContainer::Populate): Update accordingly.
19941         (TypeContainer::FindMembers): Implement.
19942
19943 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19944
19945         * statement.cs: (VariableInfo::VariableType): New field to be
19946         initialized with the full type once it is resolved. 
19947
19948 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19949
19950         * parameter.cs (GetParameterInfo): Use a type cache to compute
19951         things only once, and to reuse this information
19952
19953         * expression.cs (LocalVariableReference::Emit): Implement.
19954         (OpcodeCast::Emit): fix.
19955
19956         (ParameterReference::Resolve): Implement.
19957         (ParameterReference::Emit): Implement.
19958
19959         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19960         that are expressions need to stay as Expressions.
19961
19962         * typemanager.cs (CSharpName): Returns the C# name of a type if
19963         possible. 
19964
19965         * expression.cs (Expression::ConvertImplicit): New function that
19966         implements implicit type conversions.
19967
19968         (Expression::ImplicitReferenceConversion): Implements implicit
19969         reference conversions.
19970
19971         (EmptyCast): New type for transparent casts.
19972
19973         (OpcodeCast): New type for casts of types that are performed with
19974         a sequence of bytecodes.
19975
19976         (BoxedCast): New type used for casting value types into reference
19977         types.  Emits a box opcode.
19978
19979         (Binary::DoNumericPromotions): Implements numeric promotions of
19980         and computation of the Binary::Type.
19981
19982         (Binary::EmitBranchable): Optimization.
19983
19984         (Binary::Emit): Implement code emission for expressions.
19985
19986         * typemanager.cs (TypeManager): Added two new core types: sbyte
19987         and byte.
19988
19989 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19990
19991         * class.cs (TypeContainer::FindMembers): Method which does exactly
19992         what Type.FindMembers does, only we don't have to use reflection. No
19993         implementation yet.
19994
19995         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19996         typecontainer objects as we need to get at them.
19997         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19998
19999         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20000         typecontainer object.
20001
20002         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20003         of just a Report object.
20004
20005 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20006
20007         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20008         "remove_"
20009         (TypeContainer::Populate): Now define the delegates of the type too.
20010         (TypeContainer.Delegates): Property to access the list of delegates defined
20011         in the type.
20012
20013         * delegates.cs (Delegate::Define): Implement partially.
20014
20015         * modifiers.cs (TypeAttr): Handle more flags.
20016
20017 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20018
20019         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20020         and not <=
20021         (Operator::Define): Re-write logic to get types by using the LookupType method
20022         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20023         (Indexer::Define): Ditto.
20024         (Event::Define): Ditto.
20025         (Property::Define): Ditto.
20026
20027 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20028
20029         * class.cs (TypeContainer::Populate): Now define operators too. 
20030         (TypeContainer.Operators): New property to access the list of operators
20031         in a type.
20032         (Operator.OperatorMethodBuilder): New member to hold the method builder
20033         for the operator we are defining.
20034         (Operator::Define): Implement.
20035
20036 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20037
20038         * class.cs (Event::Define): Make the prefixes of the accessor methods
20039         addOn_ and removeOn_ 
20040
20041         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20042         of the location being passed in too. Ideally, this should go later since all
20043         error reporting should be done through the Report object.
20044
20045         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20046         (Populate): Iterate thru the indexers we have and define them too.
20047         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20048         for the get and set accessors.
20049         (Indexer::Define): Implement.
20050
20051 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20052
20053         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20054         my previous implementation, did not work.
20055
20056         * typemanager.cs: Add a couple of missing types (the longs).
20057
20058         * literal.cs: Use TypeManager.bool_type instead of getting it.
20059
20060         * expression.cs (EventExpr): New kind of expressions.
20061         (Expressio::ExprClassFromMemberInfo): finish
20062
20063 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20064
20065         * assign.cs: Emit stores to static fields differently.
20066
20067 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20068
20069         * Merge in changes and adjust code to tackle conflicts. Backed out my
20070         code in Assign::Resolve ;-) 
20071
20072 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20073
20074         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20075         instead Report.Error and also pass in the location.
20076         (CSharpParser::Lexer): New readonly property to return the reference
20077         to the Tokenizer object.
20078         (declare_local_variables): Use Report.Error with location instead of plain 
20079         old error.
20080         (CheckDef): Ditto.
20081
20082         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20083         (Operator.CheckBinaryOperator): Ditto.
20084
20085         * cs-parser.jay (operator_declarator): Update accordingly.
20086
20087         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20088         (CheckBinaryOperator): Same here.
20089
20090         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20091         on the name without any prefixes of namespace names etc. This is because we
20092         already might have something already fully qualified like 
20093         'System.Console.WriteLine'
20094
20095         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20096
20097 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20098
20099         * cs-tokenizer.cs (location): Return a string which also contains
20100         the file name.
20101
20102         * expression.cs (ElementAccess): New class for expressions of the
20103         type 'element access.'
20104         (BaseAccess): New class for expressions of the type 'base access.'
20105         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20106         respectively.
20107
20108         * cs-parser.jay (element_access): Implement action.
20109         (base_access): Implement actions.
20110         (checked_expression, unchecked_expression): Implement.
20111
20112         * cs-parser.jay (local_variable_type): Correct and implement.
20113         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20114
20115         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20116
20117         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20118         name and the specifiers.
20119
20120         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20121
20122         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20123         making them all public ;-)
20124
20125         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20126         class anyways.
20127
20128 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20129
20130         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20131         PropertyExprs.
20132         (FieldExpr, PropertyExprs): New resolved expressions.
20133         (SimpleName::MemberStaticCheck): Perform static checks for access
20134         to non-static fields on static methods. Maybe this should be
20135         generalized for MemberAccesses. 
20136         (SimpleName::ResolveSimpleName): More work on simple name
20137         resolution. 
20138
20139         * cs-parser.jay (primary_expression/qualified_identifier): track
20140         the parameter index.
20141
20142         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20143         (EmitContext::EmitBoolExpression): Chain to expression generation
20144         instead of temporary hack.
20145         (::EmitStatementExpression): Put generic expression code generation.
20146
20147         * assign.cs (Assign::Emit): Implement variable assignments to
20148         local variables, parameters and fields.
20149
20150 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20151
20152         * statement.cs (Block::GetVariableInfo): New method, returns the
20153         VariableInfo for a variable name in a block.
20154         (Block::GetVariableType): Implement in terms of GetVariableInfo
20155
20156         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20157         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20158
20159 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20160
20161         * cs-parser.jay (operator_declaration): Continue on my quest : update
20162         to take attributes argument.
20163         (event_declaration): Ditto.
20164         (enum_declaration): Ditto.
20165         (indexer_declaration): Ditto.
20166
20167         * class.cs (Operator::Operator): Update constructor accordingly.
20168         (Event::Event): Ditto.
20169
20170         * delegate.cs (Delegate::Delegate): Same here.
20171
20172         * enum.cs (Enum::Enum): Same here.
20173
20174 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20175
20176         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20177
20178         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20179
20180         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20181         being passed around as an arraylist.
20182         (Attributes::AddAttribute): Method to add attribute sections.
20183
20184         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20185         (struct_declaration): Update accordingly.
20186         (constant_declaration): Update.
20187         (field_declaration): Update.
20188         (method_header): Update.
20189         (fixed_parameter): Update.
20190         (parameter_array): Ditto.
20191         (property_declaration): Ditto.
20192         (destructor_declaration): Ditto.
20193
20194         * class.cs (Struct::Struct): Update constructors accordingly.
20195         (Class::Class): Ditto.
20196         (Field::Field): Ditto.
20197         (Method::Method): Ditto.
20198         (Property::Property): Ditto.
20199         (TypeContainer::OptAttribute): update property's return type.
20200
20201         * interface.cs (Interface.opt_attributes): New member.
20202         (Interface::Interface): Update to take the extra Attributes argument.
20203
20204         * parameter.cs (Parameter::Parameter): Ditto.
20205
20206         * constant.cs (Constant::Constant): Ditto.
20207
20208         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20209         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20210         the attributes as a parameter.
20211         (InterfaceProperty): Update constructor call.
20212         (InterfaceEvent): Ditto.
20213         (InterfaceMethod): Ditto.
20214         (InterfaceIndexer): Ditto.
20215
20216         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20217         pass the attributes too.
20218         (interface_event_declaration): Ditto.
20219         (interface_property_declaration): Ditto.
20220         (interface_method_declaration): Ditto.
20221         (interface_declaration): Ditto.
20222
20223 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * class.cs (Method::Define): Track the "static Main" definition to
20226         create an entry point. 
20227
20228         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20229         EntryPoint if we find it. 
20230
20231         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20232         (EmitContext::ig): Make this variable public.
20233
20234         * driver.cs: Make the default output file be the first file name
20235         with the .exe extension.  
20236
20237         Detect empty compilations
20238
20239         Handle various kinds of output targets.  Handle --target and
20240         rename -t to --dumper.
20241
20242         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20243         methods inherited from Expression return now an Expression.  This
20244         will is used during the tree rewriting as we resolve them during
20245         semantic analysis.
20246
20247         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20248         the spec.  Missing entirely is the information about
20249         accessability of elements of it.
20250
20251         (Expression::ExprClassFromMemberInfo): New constructor for
20252         Expressions that creates a fully initialized Expression based on
20253         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20254         a Type.
20255
20256         (Invocation::Resolve): Begin implementing resolution of invocations.
20257
20258         * literal.cs (StringLiteral):  Implement Emit.
20259
20260 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20261
20262         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20263         member.
20264
20265 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20266
20267         * cs-parser.jay (attribute_arguments): Implement actions.
20268         (attribute): Fix bug in production. Implement action.
20269         (attribute_list): Implement.
20270         (attribute_target): Implement.
20271         (attribute_target_specifier, opt_target_specifier): Implement
20272         (CheckAttributeTarget): New method to check if the attribute target
20273         is valid.
20274         (attribute_section): Implement.
20275         (opt_attributes): Implement.
20276
20277         * attribute.cs : New file to handle attributes.
20278         (Attribute): Class to hold attribute info.
20279
20280         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20281         (attribute_section): Modify production to use 2 different rules to 
20282         achieve the same thing. 1 s/r conflict down !
20283         Clean out commented, useless, non-reducing dimension_separator rules.
20284
20285         * class.cs (TypeContainer.attributes): New member to hold list
20286         of attributes for a type.
20287         (Struct::Struct): Modify to take one more argument, the attribute list.
20288         (Class::Class): Ditto.
20289         (Field::Field): Ditto.
20290         (Method::Method): Ditto.
20291         (Property::Property): Ditto.
20292
20293         * cs-parser.jay (struct_declaration): Update constructor call to
20294         pass in the attributes too.
20295         (class_declaration): Ditto.
20296         (constant_declaration): Ditto.
20297         (field_declaration): Ditto.
20298         (method_header): Ditto.
20299         (fixed_parameter): Ditto.
20300         (parameter_array): Ditto.
20301         (property_declaration): Ditto.
20302
20303         * constant.cs (Constant::Constant): Update constructor similarly.
20304         Use System.Collections.
20305
20306         * parameter.cs (Parameter::Parameter): Update as above.
20307
20308 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20309
20310         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20311         (TypeContainer.delegates): New member to hold list of delegates.
20312
20313         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20314         this time as I seem to be on crack ;-)
20315
20316 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20317
20318         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20319         tell whether an identifier represents a namespace.
20320
20321         * expression.cs (NamespaceExpr): A namespace expression, used only
20322         temporarly during expression resolution.
20323         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20324         utility functions to resolve names on expressions.
20325
20326 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * codegen.cs: Add hook for StatementExpressions. 
20329
20330         * class.cs: Fix inverted test for static flag in methods.
20331
20332 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20333
20334         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20335         to make it coincide with MS' number.
20336         (Operator::CheckBinaryOperator): Ditto.
20337
20338         * ../errors/errors.txt : Remove error numbers added earlier.
20339
20340         * ../errors/cs1019.cs : Test case for error # 1019
20341
20342         * ../errros/cs1020.cs : Test case for error # 1020
20343
20344         * cs-parser.jay : Clean out commented cruft.
20345         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20346         used anywhere - non-reducing rule.
20347         (namespace_declarations): Non-reducing rule - comment out.
20348
20349         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20350         with TypeContainer::AddEnum.
20351
20352         * delegate.cs : New file for delegate handling classes.
20353         (Delegate): Class for declaring delegates.
20354
20355         * makefile : Update.
20356
20357         * cs-parser.jay (delegate_declaration): Implement.
20358
20359 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20360
20361         * class.cs (Event::Define): Implement.
20362         (Event.EventBuilder): New member.
20363
20364         * class.cs (TypeContainer::Populate): Update to define all enums and events
20365         we have.
20366         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20367         readonly fields for all these cases ?
20368
20369 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20370
20371         * class.cs (Property): Revamp to use the convention of making fields readonly.
20372         Accordingly modify code elsewhere.
20373
20374         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20375         the Define method of the Property class.
20376
20377         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20378         trivial bug.
20379         (TypeContainer::Populate): Update to define all the properties we have. Also
20380         define all enumerations.
20381
20382         * enum.cs (Define): Implement.
20383
20384 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20385
20386         * cs-parser.jay (overloadable_operator): The semantic value is an
20387         enum of the Operator class.
20388         (operator_declarator): Implement actions.
20389         (operator_declaration): Implement.
20390
20391         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20392         validity of definitions.
20393         (Operator::CheckBinaryOperator): Static method to check for binary operators
20394         (TypeContainer::AddOperator): New method to add an operator to a type.
20395
20396         * cs-parser.jay (indexer_declaration): Added line to actually call the
20397         AddIndexer method so it gets added ;-)
20398
20399         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20400         already taken care of by the MS compiler ?  
20401
20402 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20403
20404         * class.cs (Operator): New class for operator declarations.
20405         (Operator::OpType): Enum for the various operators.
20406
20407 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20408
20409         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20410         ostensibly handle this in semantic analysis.
20411
20412         * cs-parser.jay (general_catch_clause): Comment out
20413         (specific_catch_clauses, specific_catch_clause): Ditto.
20414         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20415         (catch_args, opt_catch_args): New productions.
20416         (catch_clause): Rewrite to use the new productions above
20417         (catch_clauses): Modify accordingly.
20418         (opt_catch_clauses): New production to use in try_statement
20419         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20420         and re-write the code in the actions to extract the specific and
20421         general catch clauses by being a little smart ;-)
20422
20423         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20424         Hooray, try and catch statements parse fine !
20425
20426 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20427
20428         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20429         string from the hashtable of variables.
20430
20431         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20432         I end up making that mistake ;-)
20433         (catch_clauses): Fixed gross error which made Key and Value of the 
20434         DictionaryEntry the same : $1 !!
20435
20436 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20437
20438         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20439
20440         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20441         when the add and remove accessors are specified. 
20442
20443 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20444
20445         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20446         information about indexer_declarator.
20447         (indexer_declarator): Implement actions.
20448         (parsing_indexer): New local boolean used to keep track of whether
20449         we are parsing indexers or properties. This is necessary because 
20450         implicit_parameters come into picture even for the get accessor in the 
20451         case of an indexer.
20452         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20453
20454         * class.cs (Indexer): New class for indexer declarations.
20455         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20456         (TypeContainer::indexers): New member to hold list of indexers for the
20457         type.
20458
20459 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20460
20461         * cs-parser.jay (add_accessor_declaration): Implement action.
20462         (remove_accessor_declaration): Implement action.
20463         (event_accessors_declaration): Implement
20464         (variable_declarators): swap statements for first rule - trivial.
20465
20466         * class.cs (Event): New class to hold information about event
20467         declarations.
20468         (TypeContainer::AddEvent): New method to add an event to a type
20469         (TypeContainer::events): New member to hold list of events.
20470
20471         * cs-parser.jay (event_declaration): Implement actions.
20472
20473 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20474
20475         * cs-parser.jay (dim_separators): Implement. Make it a string
20476         concatenating all the commas together, just as they appear.
20477         (opt_dim_separators): Modify accordingly
20478         (rank_specifiers): Update accordingly. Basically do the same
20479         thing - instead, collect the brackets here.
20480         (opt_rank_sepcifiers): Modify accordingly.
20481         (array_type): Modify to actually return the complete type string
20482         instead of ignoring the rank_specifiers.
20483         (expression_list): Implement to collect the expressions
20484         (variable_initializer): Implement. We make it a list of expressions
20485         essentially so that we can handle the array_initializer case neatly too.
20486         (variable_initializer_list): Implement.
20487         (array_initializer): Make it a list of variable_initializers
20488         (opt_array_initializer): Modify accordingly.
20489
20490         * expression.cs (New::NType): Add enumeration to help us
20491         keep track of whether we have an object/delegate creation
20492         or an array creation.
20493         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20494         members to hold data about array creation.
20495         (New:New): Modify to update NewType
20496         (New:New): New Overloaded contructor for the array creation
20497         case.
20498
20499         * cs-parser.jay (array_creation_expression): Implement to call
20500         the overloaded New constructor.
20501
20502 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20503
20504         * class.cs (TypeContainer::Constructors): Return member
20505         constructors instead of returning null.
20506
20507 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20508
20509         * typemanager.cs (InitCoreTypes): Initialize the various core
20510         types after we have populated the type manager with the user
20511         defined types (this distinction will be important later while
20512         compiling corlib.dll)
20513
20514         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20515         on Expression Classification.  Now all expressions have a method
20516         `Resolve' and a method `Emit'.
20517
20518         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20519         generation from working.     Also add some temporary debugging
20520         code. 
20521
20522 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20523
20524         * codegen.cs: Lots of code generation pieces.  This is only the
20525         beginning, will continue tomorrow with more touches of polish.  We
20526         handle the fundamentals of if, while, do, for, return.  Others are
20527         trickier and I need to start working on invocations soon.
20528
20529         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20530         s.InitStatement. 
20531
20532         * codegen.cs (EmitContext): New struct, used during code
20533         emission to keep a context.   Most of the code generation will be
20534         here. 
20535
20536         * cs-parser.jay: Add embedded blocks to the list of statements of
20537         this block.  So code generation proceeds in a top down fashion.
20538
20539 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20540
20541         * statement.cs: Add support for multiple child blocks.
20542
20543 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20544
20545         * codegen.cs (EmitCode): New function, will emit the code for a
20546         Block of code given a TypeContainer and its ILGenerator. 
20547
20548         * statement.cs (Block): Standard public readonly optimization.
20549         (Block::Block constructors): Link children. 
20550         (Block::Child): Child Linker.
20551         (Block::EmitVariables): Emits IL variable declarations.
20552
20553         * class.cs: Drop support for MethodGroups here, delay until
20554         Semantic Analysis.
20555         (Method::): Applied the same simplification that I did before, and
20556         move from Properties to public readonly fields.
20557         (Method::ParameterTypes): Returns the parameter types for the
20558         function, and implements a cache that will be useful later when I
20559         do error checking and the semantic analysis on the methods is
20560         performed.
20561         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20562         and made a method, optional argument tells whether this is a class
20563         or a structure to apply the `has-this' bit.
20564         (Method::GetCallingConvention): Implement, returns the calling
20565         convention. 
20566         (Method::Define): Defines the type, a second pass is performed
20567         later to populate the methods.
20568
20569         (Constructor::ParameterTypes): implement a cache similar to the
20570         one on Method::ParameterTypes, useful later when we do semantic
20571         analysis. 
20572
20573         (TypeContainer::EmitMethod):  New method.  Emits methods.
20574
20575         * expression.cs: Removed MethodGroup class from here.
20576
20577         * parameter.cs (Parameters::GetCallingConvention): new method.
20578
20579 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20580
20581         * class.cs (TypeContainer::Populate): Drop RootContext from the
20582         argument. 
20583
20584         (Constructor::CallingConvention): Returns the calling convention.
20585         (Constructor::ParameterTypes): Returns the constructor parameter
20586         types. 
20587
20588         (TypeContainer::AddConstructor): Keep track of default constructor
20589         and the default static constructor.
20590
20591         (Constructor::) Another class that starts using `public readonly'
20592         instead of properties. 
20593
20594         (Constructor::IsDefault): Whether this is a default constructor. 
20595
20596         (Field::) use readonly public fields instead of properties also.
20597
20598         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20599         track of static constructors;  If none is used, turn on
20600         BeforeFieldInit in the TypeAttributes. 
20601
20602         * cs-parser.jay (opt_argument_list): now the return can be null
20603         for the cases where there are no arguments. 
20604
20605         (constructor_declarator): If there is no implicit `base' or
20606         `this', then invoke the default parent constructor. 
20607
20608         * modifiers.cs (MethodAttr): New static function maps a set of
20609         modifiers flags into a MethodAttributes enum
20610         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20611         MethodAttr, TypeAttr to represent the various mappings where the
20612         modifiers are used.
20613         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20614
20615 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20616
20617         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20618         method arguments.
20619
20620         * interface.cs (PopulateIndexer): Implemented the code generator
20621         for interface indexers.
20622
20623 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20624
20625         * interface.cs (InterfaceMemberBase): Now we track the new status
20626         here.  
20627
20628         (PopulateProperty): Implement property population.  Woohoo!  Got
20629         Methods and Properties going today. 
20630
20631         Removed all the properties for interfaces, and replaced them with
20632         `public readonly' fields. 
20633
20634 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20635
20636         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20637         initialize their hashtables/arraylists only when they are needed
20638         instead of doing this always.
20639
20640         * parameter.cs: Handle refs and out parameters.
20641
20642         * cs-parser.jay: Use an ArrayList to construct the arguments
20643         instead of the ParameterCollection, and then cast that to a
20644         Parameter[] array.
20645
20646         * parameter.cs: Drop the use of ParameterCollection and use
20647         instead arrays of Parameters.
20648
20649         (GetParameterInfo): Use the Type, not the Name when resolving
20650         types. 
20651
20652 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20653
20654         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20655         and instead use public readonly fields.
20656
20657         * class.cs: Put back walking code for type containers.
20658
20659 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20660
20661         * class.cs (MakeConstant): Code to define constants.
20662
20663         * rootcontext.cs (LookupType): New function.  Used to locate types 
20664
20665
20666 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20667
20668         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20669         this System.Reflection code is.  Kudos to Microsoft
20670
20671         * typemanager.cs: Implement a type cache and avoid loading all
20672         types at boot time.  Wrap in LookupType the internals.  This made
20673         the compiler so much faster.  Wow.  I rule!
20674
20675         * driver.cs: Make sure we always load mscorlib first (for
20676         debugging purposes, nothing really important).
20677
20678         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20679         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20680
20681         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20682         on namespaces that have been imported using the `using' keyword.
20683
20684         * class.cs (TypeContainer::TypeAttr): Virtualize.
20685         (Class::TypeAttr): Return attributes suitable for this bad boy.
20686         (Struct::TypeAttr): ditto.
20687         Handle nested classes.
20688         (TypeContainer::) Remove all the type visiting code, it is now
20689         replaced with the rootcontext.cs code
20690
20691         * rootcontext.cs (GetClassBases): Added support for structs. 
20692
20693 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20694
20695         * interface.cs, statement.cs, class.cs, parameter.cs,
20696         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20697         Drop use of TypeRefs, and use strings instead.
20698
20699 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20700
20701         * rootcontext.cs: 
20702
20703         * class.cs (Struct::Struct): set the SEALED flags after
20704         checking the modifiers.
20705         (TypeContainer::TypeAttr): new property, returns the
20706         TypeAttributes for a class.  
20707
20708         * cs-parser.jay (type_list): Oops, list production was creating a
20709         new list of base types.
20710
20711         * rootcontext.cs (StdLib): New property.
20712         (GetInterfaceTypeByName): returns an interface by type name, and
20713         encapsulates error handling here.
20714         (GetInterfaces): simplified.
20715         (ResolveTree): Encapsulated all the tree resolution here.
20716         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20717         types. 
20718
20719         * driver.cs: Add support for --nostdlib, to avoid loading the
20720         default assemblies.
20721         (Main): Do not put tree resolution here. 
20722
20723         * rootcontext.cs: Beginning of the class resolution.
20724
20725 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * rootcontext.cs: Provide better error reporting. 
20728
20729         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20730
20731         * rootcontext.cs (CreateInterface): Handle the case where there
20732         are no parent interfaces.
20733
20734         (CloseTypes): Routine to flush types at the end.
20735         (CreateInterface): Track types.
20736         (GetInterfaces): Returns an array of Types from the list of
20737         defined interfaces.
20738
20739         * typemanager.c (AddUserType): Mechanism to track user types (puts
20740         the type on the global type hash, and allows us to close it at the
20741         end). 
20742
20743 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20744
20745         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20746         RecordInterface instead.
20747
20748         * cs-parser.jay: Updated to reflect changes above.
20749
20750         * decl.cs (Definition): Keep track of the TypeBuilder type that
20751         represents this type here.  Not sure we will use it in the long
20752         run, but wont hurt for now.
20753
20754         * driver.cs: Smaller changes to accomodate the new code.
20755
20756         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20757         when done. 
20758
20759         * rootcontext.cs (CreateInterface):  New method, used to create
20760         the System.TypeBuilder type for interfaces.
20761         (ResolveInterfaces): new entry point to resolve the interface
20762         hierarchy. 
20763         (CodeGen): Property, used to keep track of the code generator.
20764
20765 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20766
20767         * cs-parser.jay: Add a second production for delegate_declaration
20768         with `VOID'.
20769
20770         (enum_body): Put an opt_comma here instead of putting it on
20771         enum_body or enum_member_declarations so we can handle trailing
20772         commas on enumeration members.  Gets rid of a shift/reduce.
20773
20774         (type_list): Need a COMMA in the middle.
20775
20776         (indexer_declaration): Tell tokenizer to recognize get/set
20777
20778         * Remove old targets.
20779
20780         * Re-add the parser target.
20781
20782 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20783
20784         * cs-parser.jay: Add precendence rules for a number of operators
20785         ot reduce the number of shift/reduce conflicts in the grammar.
20786
20787 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20790         and put it here.
20791
20792         Get rid of old crufty code.
20793
20794         * rootcontext.cs: Use this to keep track of the parsed
20795         representation and the defined types available to the program. 
20796
20797         * gen-treedump.cs: adjust for new convention.
20798
20799         * type.cs: Split out the type manager, and the assembly builder
20800         from here. 
20801
20802         * typemanager.cs: the type manager will live here now.
20803
20804         * cil-codegen.cs: And the code generator here. 
20805
20806 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20807
20808         * makefile: Fixed up for easy making.
20809
20810 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20811
20812         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20813         the 
20814
20815         (unary_expression): Expand pre_increment_expression and
20816         post_decrement_expression to reduce a shift/reduce.
20817
20818 2001-07-11  Simon Cozens
20819
20820         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20821
20822         Improve allow_keyword_as_indent name.
20823
20824 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20825
20826         * Adjustments for Beta2. 
20827
20828 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20829
20830         * decl.cs: Added `Define' abstract method.
20831         (InTransit): new property, used to catch recursive definitions. 
20832
20833         * interface.cs: Implement `Define'. 
20834
20835         * modifiers.cs: Map Modifiers.constants to
20836         System.Reflection.TypeAttribute flags.
20837
20838         * class.cs: Keep track of types and user-defined types.
20839         (BuilderInit): New method for creating an assembly
20840         (ResolveType): New function to launch the resolution process, only
20841         used by interfaces for now.
20842
20843         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20844         that are inserted into the name space. 
20845
20846 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20847
20848         * ARGH.  I have screwed up my tree so many times due to the use of
20849         rsync rather than using CVS.  Going to fix this at once. 
20850
20851         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20852         load types.
20853
20854 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * Experiment successful: Use System.Type rather that our own
20857         version of Type.  
20858
20859 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20860
20861         * cs-parser.jay: Removed nsAliases from here.
20862
20863         Use new namespaces, handle `using XXX;' 
20864
20865         * namespace.cs: Reimplemented namespace handling, use a recursive
20866         definition of the class.  Now we can keep track of using clauses
20867         and catch invalid using clauses.
20868
20869 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20870
20871         * gen-treedump.cs: Adapted for all the renaming.
20872
20873         * expression.cs (Expression): this class now has a Type property
20874         which returns an expression Type.
20875
20876         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20877         `Type', as this has a different meaning now in the base
20878
20879 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20880
20881         * interface.cs, class.cs: Removed from all the sources the
20882         references to signature computation, as we can not do method
20883         signature computation during the parsing time, as we are not
20884         trying to solve at that point distinguishing:
20885
20886         class X {
20887                 void a (Blah x) {}
20888                 void a (NS.Blah x) {}
20889         }
20890
20891         Which depending on the context might be valid or not, as we do not
20892         know if Blah is the same thing as NS.Blah at that point.
20893
20894         * Redid everything so the code uses TypeRefs now instead of
20895         Types.  TypeRefs are just temporary type placeholders, that need
20896         to be resolved.  They initially have a pointer to a string and the
20897         current scope in which they are used.  This is used later by the
20898         compiler to resolve the reference to an actual Type. 
20899
20900         * DeclSpace is no longer a CIR.Type, and neither are
20901         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20902         are all DeclSpaces, but no Types. 
20903
20904         * type.cs (TypeRefManager): This implements the TypeRef manager,
20905         which keeps track of all the types that need to be resolved after
20906         the parsing has finished. 
20907
20908 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20909
20910         * ARGH.  We are going to have to store `foreach' as a class rather
20911         than resolving it, as we need to verify error 1579 after name
20912         resolution.   *OR* we could keep a flag that says `This request to
20913         IEnumerator comes from a foreach statement' which we can then use
20914         to generate the error.
20915
20916 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20917
20918         * class.cs (TypeContainer.AddMethod): we now add methods to the
20919         MethodGroup instead of the method hashtable.  
20920
20921         * expression.cs: Add MethodGroup abstraction, which gets us one
20922         step closer to the specification in the way we handle method
20923         declarations.  
20924
20925         * cs-parser.jay (primary_expression): qualified_identifier now
20926         tried to match up an identifier to a local variable reference or
20927         to a parameter reference.
20928
20929         current_local_parameters is now a parser global variable that
20930         points to the current parameters for the block, used during name
20931         lookup.
20932
20933         (property_declaration): Now creates an implicit `value' argument to
20934         the set accessor.
20935
20936 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20937
20938         * parameter.cs: Do not use `param' arguments as part of the
20939         signature, per the spec.
20940
20941 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20942
20943         * decl.cs: Base class for classes, structs and interfaces.  This
20944         is the "Declaration Space" 
20945
20946         * cs-parser.jay: Use CheckDef for checking declaration errors
20947         instead of having one on each function.
20948
20949         * class.cs: Factor out some code for handling error handling in
20950         accordance to the "Declarations" section in the "Basic Concepts"
20951         chapter in the ECMA C# spec.
20952
20953         * interface.cs: Make all interface member classes derive from
20954         InterfaceMemberBase.
20955
20956 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20957
20958         * Many things: all interfaces are parsed and generated in
20959         gen-treedump.  Support for member variables, constructors,
20960         destructors, properties, constants is there.
20961
20962         Beginning of the IL backend, but very little done, just there for
20963         testing purposes. 
20964
20965 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20966
20967         * cs-parser.jay: Fix labeled statement.
20968
20969         * cs-tokenizer.cs (escape): Escape " and ' always.
20970         ref_line, ref_name: keep track of the line/filename as instructed
20971         by #line by the compiler.
20972         Parse #line.
20973
20974 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20975
20976         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20977         to match the values in System.CodeDOM.
20978
20979         Divid renamed to Divide.
20980
20981         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20982         statements. 
20983         (Statements.set): remove.
20984
20985         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20986         statements. 
20987
20988         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20989         falseStatements always have valid values. 
20990
20991         * cs-parser.jay: Use System.CodeDOM now.
20992