2005-09-02 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-09-02  Martin Baulig  <martin@ximian.com>
2
3         * class.cs: Make CS3005 a warning, not an error.
4
5 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
6
7         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8         New method, looking for lo-case imported cls type.
9
10         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11         here.
12
13         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
14
15         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
16
17         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
18         all_imported_types.
19         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
20
21         Optimized to save 3.5 MB for SWF compilation.
22
23 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
24
25         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
26         (PartialContainer.Create): Moved logic AddToContainer.
27         (PartialContainer.MarkForDuplicationCheck): Shares name.
28         
29         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
30         place.
31         
32         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
33         initialization.
34         (Namespace.GetSignatureForError): New method.
35         
36         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
37         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
38
39 2005-08-01  Raja R Harinath  <rharinath@novell.com>
40
41         Fix #75669.
42         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
43         member lookup rather than qualifier_type, since qualifier_type can
44         be null.
45
46 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
47
48         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
49         enum member.
50
51 2005-07-31  Miguel de Icaza  <miguel@novell.com>
52
53         * statement.cs: Copy the local exception into the exception
54         captured local.  Fixes 75674
55
56 2005-07-31  Raja R Harinath  <harinath@gmail.com>
57
58         Fix #75658.
59         * expression.cs (Invocation.OverloadResolve): Don't report error
60         CS1501 if error CS1502 has been reported.
61         (New.DoResolve): Delegate CS1501 reporting to
62         Invocation.OverloadResolve.
63
64         Fix #75656.
65         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
66         invariant-meaning-in-block property in an enclosing block if
67         necessary.
68
69 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
70
71         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
72         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
73         (Switch.CheckSwitch): Just save 50kb for SWF.
74
75 2005-07-27  Martin Baulig  <martin@ximian.com>
76
77         * anonymous.cs (CaptureContext.AddField): Added
78         `AnonymousContainer am' argument; compute its toplevel scope if
79         it's not already computed.  Fixes #75649.
80
81 2005-07-26  Raja R Harinath  <rharinath@novell.com>
82
83         Fix #75628.
84         * class.cs (Constructor.Emit): Reset block to null if the block
85         resolve fails.
86
87 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
88
89         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
90
91 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
92
93         * class.cs (MethodData.Define): Check whether accessor implementing
94         interface is public.
95
96         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
97
98 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
99
100         Fix #57245
101         * namespace.cs (LookupType): Moved same type check to...
102         
103         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
104         with the same name.
105
106 2005-07-21  Raja R Harinath  <rharinath@novell.com>
107
108         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
109         already found a typebuilder.
110         * class.cs (MethodCore.IsDuplicateImplementation): Compare
111         MemberNames, not strings.
112
113         * const.cs (Error_ExpressionMustBeConst): 
114         Rename from Error_EpressionMustBeConst.
115         * const.cs, class.cs, statement.cd: Update.
116
117 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
118
119         Fix #65573
120
121         * const.cs (Const.LookupConstantValue): Report missing contant expression
122         everytime.
123         (Error_EpressionMustBeConstant): Only one error method.
124
125         * class.cs, statement.c: Updated.
126
127 2005-07-20  Raja R Harinath  <rharinath@novell.com>
128
129         * statement.cs (Block.Flags): Add back HasVarargs.
130         (Block.flags): Make protected.
131         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
132
133         * typemanager.cs (types, typecontainers, user_types): Remove.
134         (UserTypes, TypeContainers): Likewise.
135         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
136         (CleanUp, Reset): Update.
137         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
138         (GetNestedType): Use Type.GetNestedType.
139         (CoreLookupType): Take two arguments, the namespace and the
140         basename of the type.  Update to use the Namespace.Lookup
141         mechanism.
142         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
143         (RealMemberLookup): Use IsNestedChildOf instead of playing with
144         string concatenation and substring matches.
145         * class.cs, enum.cs, delegate.cs: Update to changes.
146
147 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
148
149         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
150         Expression and made virtual.
151
152         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
153         (ImplicitStandardConversionExists): Fixed `byte' typo ?
154
155         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
156
157         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
158         error message.
159
160         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
161         change.
162
163 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
164
165         Fix #57707
166         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
167         AssemblyCultureAttribute is not used on executable.
168
169         * rootcontext.cs,
170         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
171
172 2005-07-16  Raja R Harinath  <rharinath@novell.com>
173
174         Fix #60638.
175         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
176         New.  Reports CS0252/CS0253.
177         Mostly taken from preliminary patch by Duncak Mak.
178         (Binary.DoResolveOperator): Store results of operator lookup.
179         Use them to detect if we need to warn about unintended reference
180         comparisons.
181
182 2005-07-15  Raja R Harinath  <rharinath@novell.com>
183
184         Fix #72969.
185         * namespace.cs (Namespace.Lookup): Add back location parameter.
186         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
187         * delegate.cs, ecore.cs, expression.cs: Update to changes.
188
189         * codegen.cs (EmitContext.DeclSpace): Make readonly.
190         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
191         (Namespace.LookupType): ... this.
192         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
193         of namespaces.
194         * typemanager.cs (LookupTypeReflection): Remove buggy code that
195         purported to handle pointers.
196         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
197         CoreLookupType.
198
199 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
200
201         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
202         type as namespace.
203
204 2005-07-15  Raja R Harinath  <rharinath@novell.com>
205
206         * namespace.cs (Namespace.Lookup): Drop location parameter.
207         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
208         (NamespaceEntry.Lookup): ... this.
209         (NamespaceEntry.Error_AmbiguousTypeReference):
210         Move here from DeclSpace.
211         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
212         names ...
213         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
214         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
215         Move to NamespaceEntry.
216         * delegate.cs, expression.cs: Update to changes.
217
218 2005-08-31  Martin Baulig  <martin@ximian.com>
219
220         Committing a patch from Atsushi Enomoto for #75850.
221
222         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
223         Prefer a generic enumerator over a non-generic one.
224
225 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
226
227         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
228         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
229
230 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
231
232         * driver.cs : reverting default encoding change as well as mcs.
233
234 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
235
236         * driver.cs, support.cs : merged r48826.
237           Marek Safer wrote:
238           > could you integrate your mcs changes to gmcs otherwise
239           > gmcs cannot compile some files.
240
241 2005-08-20  Martin Baulig  <martin@ximian.com>
242
243         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
244         scope if we don't already have it.
245
246         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
247         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
248         fixes #75867.
249
250 2005-07-31  Miguel de Icaza  <miguel@novell.com>
251
252         * statement.cs: Copy the local exception into the exception
253         captured local.  Fixes 75674
254
255 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
256
257         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
258         type as namespace.
259
260 2005-08-12  Martin Baulig  <martin@ximian.com>
261
262         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
263         for nested types here to avoid hitting the cache too early.
264
265 2005-08-09  Miguel de Icaza  <miguel@novell.com>
266
267         * enum.cs: On the new compiler CLS error 3005 is now a warning not
268         an error. 
269
270 2005-08-03  Martin Baulig  <martin@ximian.com>
271
272         Make iterators in generic methods work; see gtest-191.cs.
273
274         * generic.cs
275         (Constraints.Resolve): Protect against being called twice.
276
277         * class.cs
278         (TypeContainer.GetClassBases): Make this `protected virtual'.
279
280         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
281         (Iterator.GetClassBases): Override this and compute the base
282         classes here.
283         (Iterator.DefineNestedTypes): If we're a generic method, all our
284         method type parameters become class type parameters on the proxy
285         class.
286
287         * statement.cs
288         (ToplevelBlock.Parameters): Make this a property, not a field.
289         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
290
291 2005-08-03  Martin Baulig  <martin@ximian.com>
292
293         * typemanager.cs (TypeManager.IsSubclassOf): Use
294         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
295         (TypeManager.GetFullName_recursed): Improved.
296
297 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
298
299         Fix #75417
300         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
301         Private accessor case, using TypeManager.IsPrivateAccessible instead of
302         invocation_type == mi.DeclaringType, since the first one also checks
303         other condition used by generic instances.
304         
305 2005-07-27  Martin Baulig  <martin@ximian.com>
306
307         * anonymous.cs (CaptureContext.AddField): Added
308         `AnonymousContainer am' argument; compute its toplevel scope if
309         it's not already computed.  Fixes #75649.
310
311 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
312
313         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
314         CheckAttributeType and refactored.
315         (Attribute.ResolvePossibleAttributeType): Changed to reuse
316         ResolveAsTypeTerminal error handling.
317         (ResolveAsTypeTerminal): Introduced because of global attributes extra
318         handling.
319         (GetSignatureForError): Print errors in same way.
320
321         * class.cs,
322         * codegen.cs: Reflect attribute GetSignatureForError change.
323
324         * ecore.cs,
325         * expression.cs: Add silent parameter to ResolveAsTypeStep.
326
327         * namespace.cs (UsingEntry): Refactored to make fields private.
328
329         * assign.cs,
330         statement.cs: Error_UnexpectedKind has extra parameter.
331
332 2005-07-14  Raja R Harinath  <rharinath@novell.com>
333
334         * ecore.cs (IAlias): Remove.
335         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
336         that implement the interface.
337         * namespace.cs (Namespace): Likewise.
338         (Namespace.declspaces): Renamed from 'defined_names'.
339         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
340         DeclSpace instead of an IAlias.
341         * tree.cs (Tree.AddDecl): Update.
342
343 2005-07-12  Raja R Harinath  <rharinath@novell.com>
344
345         * statement.cs (Block.Flags); Remove HasVarargs.
346         (Block.HasVarargs): Move to ToplevelBlock.
347         (Block.ThisVariable, Block.AddThisVariable): Likewise.
348         (Block.Variables): Make protected.  Initialize variable hashtable
349         if necessary.
350         (Block.AddVariable): Update.
351         (Block.Resolve): Update to changes.
352         (ToplevelBlock.HasVarargs): New boolean.
353         (ToplevelBlock.ThisVariable): Move here from Block.
354         (ToplevelBlock.AddThisVariable): Likewise.
355         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
356         * expression.cs (This.ResolveBase): Update to changes.
357         (ArglistAccess.DoResolve): Likewise.
358
359 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
360
361         Fix #75321
362         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
363
364         * class.cs (TypeContainer.VerifyMembers): Distinguish between
365         not used and not used & assigned.
366         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
367
368 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
369
370         Fix #75053
371         * expression.cs (Is.DoResolve): null is never provided type.
372
373 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
374
375         Fix #52496
376         * cs-parser.jay: Less strict event error rule to catch more errors.
377
378 2005-07-11  Martin Baulig  <martin@ximian.com>
379
380         * generic.cs (ConstructedType.CheckConstraints): Improve the check
381         for the constructor constraint: we do not only have to check
382         whether the class has a public constructor, but also ensure that
383         it's parameterless.  Fixes #75492.
384
385 2005-07-11  Martin Baulig  <martin@ximian.com>
386
387         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
388         between type parameters if they either have the reference type
389         constraint or the class constraint.
390
391 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
392
393         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
394
395 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
396
397         Fix #74975
398         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
399         (ExtractSecurityPermissionSet): Cope with self referencing security
400         attributes properly.
401
402         * driver.cs (SetOutputFile): Made public property OutputFile.
403
404 2005-07-07  Raja R Harinath  <rharinath@novell.com>
405
406         Fix #75486.
407         * class.cs (TypeContainer.first_nonstatic_field): Rename from
408         has_nonstatic_fields.  Make into a FieldBase pointer.
409         (TypeContainer.AddField): Add CS0282 check.
410         (TypeContainer.EmitType): Update.
411
412 2005-07-06  Miguel de Icaza  <miguel@novell.com>
413
414         * cs-tokenizer.cs (consume_identifier): Do not create strings to
415         compare if they start with __.
416
417 2005-07-06  Raja R Harinath  <rharinath@novell.com>
418
419         * statement.cs (Switch.SwitchGoverningType): Only look at
420         UserCasts that don't need implicit standard conversions to one of
421         the allowed switch types (Fixes test-322.cs).
422         (LocalInfo.Resolve): Re-enable sanity-test.
423
424 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
425
426         * cs-tokenizer.cs (consume_identifier): Detect double undescores
427         
428         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
429         
430         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
431
432 2005-07-06  Raja R Harinath  <rharinath@novell.com>
433
434         Fix #75472.
435         * ecore.cs (SimpleName.GetSignatureForError): Add.
436         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
437         (MemberAccess.GetSignatureForError): Add.
438
439 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
440  
441         The big error and warning messages review.
442         
443         * anonymous.cs,
444         * assign.cs,
445         * attribute.cs,
446         * class.cs,
447         * codegen.cs,
448         * convert.cs,
449         * cs-parser.jay,
450         * cs-tokenizer.cs,
451         * decl.cs,
452         * delegate.cs,
453         * doc.cs,
454         * driver.cs,
455         * ecore.cs,
456         * enum.cs,
457         * expression.cs,
458         * flowanalysis.cs,
459         * iterators.cs,
460         * literal.cs,
461         * location.cs,
462         * modifiers.cs,
463         * namespace.cs,
464         * parameter.cs,
465         * pending.cs,
466         * report.cs,
467         * rootcontext.cs,
468         * statement.cs,
469         * support.cs,
470         * tree.cs,
471         * typemanager.cs: Updated.
472         
473         * class.cs: (MethodCore.SetYields): Moved here to share.
474         (PropertyMethod.Define): Moved iterator setup here.
475         
476         * iterators.cs: Add orig_method to have full access to parent
477         container.
478
479 2005-07-05  Raja R Harinath  <rharinath@novell.com>
480
481         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
482         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
483         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
484         variable of struct type.
485         * expression.cs (Unary.ResolveOperator): Update to change.
486         (Indirection.VerifyFixed): Likewise.
487         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
488         (ParameterReference.VerifyFixed): Value parameters are fixed.
489         (This.VerifyFixed): Treat 'this' as a value parameter.
490         * statement.cs (LocalInfo.IsFixed): Remove.
491
492 2005-07-01  Martin Baulig  <martin@ximian.com>
493
494         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
495         `ec.EmitThis ()' to get the correct scope.
496
497 2005-07-01  Martin Baulig  <martin@ximian.com>
498
499         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
500         instance is a ParameterReference; fixes #75299.
501
502 2005-06-30  Raja R Harinath  <rharinath@novell.com>
503
504         Fix #75412.
505         * expression.cs (Indexers.map): Remove.
506         (Indexers.Append): Filter out inaccessible setters and getters.
507         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
508
509         Fix #75283.
510         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
511         Refactored from ...
512         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
513         (FieldExpr.Emit, PropertyExpr.Emit): Update.
514         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
515         * expression.cs (Invocation.EmitCall): Add CS0120 check.
516
517 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
518
519         Fix #75322
520         * class.cs (FieldBase.GetInitializerExpression): One more field
521         for backup.
522
523 2005-06-28  Miguel de Icaza  <miguel@novell.com>
524
525         * pending.cs: Do not define a proxy if the base method is virtual,
526         it will be picked up by the runtime (bug 75270).
527
528 2005-07-08  Martin Baulig  <martin@ximian.com>
529
530         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
531         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
532
533 2005-07-07  Martin Baulig  <martin@ximian.com>
534
535         * generic.cs (ConstructedType.CheckConstraint): Use
536         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
537         called recursively; fixes #75329.
538
539 2005-07-06  Martin Baulig  <martin@ximian.com>
540
541         * generic.cs (TypeManager.InferTypeArguments): Added support for
542         anonymous methods; fixes #75461.
543
544 2005-07-01  Martin Baulig  <martin@ximian.com>
545
546         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
547         `ec.EmitThis ()' to get the correct scope.
548
549 2005-07-01  Martin Baulig  <martin@ximian.com>
550
551         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
552         instance is `This'; fixes #75299.
553
554 2005-06-30  Martin Baulig  <martin@ximian.com>
555
556         * class.cs (Indexer): Implement IIteratorContainer; added support
557         for iterators in indexers.
558
559         * codegen.cs
560         (EmitContext.CurrentIterator): Make this a property, not a field.
561
562         * anonymous.cs (AnonymousContainer.Iterator): New public property.
563
564 2005-06-28  Miguel de Icaza  <miguel@novell.com>
565
566         * pending.cs: Do not define a proxy if the base method is virtual,
567         it will be picked up by the runtime (bug 75270).
568
569 2005-06-28  Martin Baulig  <martin@ximian.com>
570
571         * cs-parser.jay (interface_method_declaration): Avoid a
572         reduce/reduce conflict by moving some of the code into a separate
573         `interface_method_declaration_body' rule; fixes #75368.
574
575 2005-06-28  Martin Baulig  <martin@ximian.com>
576
577         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
578         array check after the check for TypeBuilder's.
579
580 2005-06-21  Raja R Harinath  <rharinath@novell.com>
581
582         * convert.cs (FindMostEncompassedType): Add two trivial special
583         cases (number_of_types == 0 || number_of_types == 1).
584         (FindMostEncompasingType): Likewise.
585
586 2005-06-17  Raja R Harinath  <rharinath@novell.com>
587
588         Some cleanups preparing for the fix of #75283.
589         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
590         error testing.
591         (EventExpr.InstanceResolve): Likewise.
592         (EventExpr.DoResolve): Remove redundant checks.
593
594 2005-06-08  Miguel de Icaza  <miguel@novell.com>
595
596         * class.cs: Small fix.
597
598 2005-06-08  Raja R Harinath  <rharinath@novell.com>
599
600         Fix #75160.
601         * class.cs (GetPartialBases): Fix return value check of
602         part.GetClassBases.
603
604 2005-06-07  Raja R Harinath  <rharinath@novell.com>
605
606         Ensure that partial classes are registered in their enclosing
607         namespace.  Initial part of fix of #75160.
608         * tree.cs (Tree.RecordDecl): Add new namespace argument.
609         Register declspace with namespace here, not in
610         DeclSpace.RecordDecl.
611         * cs-parser.jay: Pass namespace to RecordDecl.
612         * class.cs (PartialContainer.Create): Likewise.
613         (ClassPart.DefineType): New sanity-check.  Throws an exception if
614         called.
615         * decl.cs (Declspace.RecordDecl): Remove.
616         * namespace.cs (NamespaceEntry.DefineName): Remove.
617
618 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
619
620         * rootcontext.cs: Reset TargetExt as well.
621
622 2005-06-03  Raja R Harinath  <rharinath@novell.com>
623
624         * ecore.cs (Expression.Resolve): Emit CS0654 error when
625         -langversion:ISO-1.
626
627 2005-06-02  Raja R Harinath  <rharinath@novell.com>
628
629         Fix #75080, cs0119.cs.
630         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
631         of ...
632         (Expression.Resolve): ... this.  Use it.  Remove bogus code
633         allowing ExprClass.Type and ExprClass.Namespace for
634         ResolveFlags.VariableOrValue.
635         (Expression.Resolve) [1-argument variant]: Change default resolve
636         flags based on language version.
637         (Expression.Error_UnexpectedKind): Use a simple string array
638         rather than an ArrayList.
639         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
640         not ExprClass.Type.
641         (TypeOfVoid.DoResolve): Likewise.
642         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
643         flags argument -- it always has the same value.
644
645 2005-05-31  Raja R Harinath  <rharinath@novell.com>
646
647         Fix #75081.
648         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
649         Use it in the error message.
650         * assign.cs, expression.cs, statement.cs: Update.
651
652 2005-05-30  Raja R Harinath  <rharinath@novell.com>
653
654         Fix #75088.
655         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
656         the "almostMatchedMember" case too.
657         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
658         that failed the accessibility checks to 'almost_match'.
659
660 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
661
662         * attribute.cs: Use internal MethodBuilder methods to set
663         ExactSpelling and SetLastError on PInvoke methods, instead
664         of passing them via charset.  Fixes #75060.
665
666 2005-05-27  Raja R Harinath  <rharinath@novell.com>
667
668         * parameter.cs (Parameter): Remove TODO comment.
669         (Parameter.DefineParameter): Remove Location parameter.
670         (Parameters.LabelParameters): Likewise.
671         * class.cs (Constructor.Emit): Update to change.
672         (MethodData.Emit): Likewise.
673         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
674         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
675
676 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
677
678         * parameter.cs,
679           Removed Parameters.Location and added Parameter.Location instead.
680           Removed Location parameter from Emit() and GetSignature().
681         * anonymous.cs,
682           class.cs,
683           cs-parser.jay,
684           delegate.cs,
685           iterators.cs,
686           statement.cs :
687           Modified all related calls.
688
689 2005-06-21  Martin Baulig  <martin@ximian.com>
690
691         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
692         left-hand side is not a nullable type; fixes #75328.
693
694 2005-06-21  Martin Baulig  <martin@ximian.com>
695
696         * typemanager.cs
697         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
698         (TypeManager.GetFullNameSignature): Likewise.
699
700         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
701         `source.FullName' and `target.FullName' to check whether there are
702         two conflicting definitions.
703
704 2005-06-21  Martin Baulig  <martin@ximian.com>
705
706         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
707         a BoxedCast - also for reference types - to be compatible with csc.
708
709 2005-06-21  Martin Baulig  <martin@ximian.com>
710
711         * expression.cs (MemberAccess.DoResolve): Add support for nested
712         types in a generic instance; fixes #75320.
713
714 2005-06-20  Martin Baulig  <martin@ximian.com>
715
716         * generic.cs (TypeManager.InferType): Also walk the class
717         hierarchy for generic instances; fixes #75261.
718
719 2005-06-17  Martin Baulig  <martin@ximian.com>
720
721         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
722         to make things work for corlib.
723
724 2005-06-15  Martin Baulig  <martin@ximian.com>
725
726         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
727         obsolete `SecurityAction' values.
728
729 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
730
731         * rootcontext.cs: Reset TargetExt as well.
732         
733 2005-06-09  Martin Baulig  <martin@ximian.com>
734
735         * delegate.cs (Delegate.VerifyMethod): Added
736         `MethodGroupExpr old_mg' argument; inherit its
737         `HasTypeParameters'; fix #75085.
738
739 2005-06-09  Martin Baulig  <martin@ximian.com>
740
741         * expression.cs (Invocation.OverloadResolve): Correctly handle
742         generic methods for the SetMemberIsUsed(); fix #75064.
743
744 2005-06-09  Martin Baulig  <martin@ximian.com>
745
746         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
747         fixes #75062.
748
749 2005-06-08  Martin Baulig  <martin@ximian.com>
750
751         * cs-parser.jay (nullable_type_or_conditional): If we put the
752         nullable back and our `type' is a `ComposedCast', remove the
753         nullable from it.  Fixes #75156.
754
755         * expression.cs (ComposedCast.RemoveNullable): New public method.
756
757 2005-06-08  Martin Baulig  <martin@ximian.com>
758
759         The big Iterators rewrite :-)
760
761         * iterators.cs: Rewrite this to use the anonymous methods framework.
762
763         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
764         before the TypeContainers; see 2test-21.cs.
765
766         * class.cs
767         (TypeContainer.DefineType): Don't create a new EmitContext if we
768         already have one (this only happens if we're an Iterator).
769         (TypeContainer.Define): Also call Define() on all our iterators.
770         (Method.CreateEmitContext): Added support for iterators.
771
772         * anonymous.cs
773         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
774         (AnonymousContainer.CreateMethodHost): Moved here from
775         AnonymousMethod and made abstract.
776         (AnonymousContainer.CreateScopeType): New abstract method.
777         (AnonymousContainer.IsIterator): New public property.
778         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
779         get the ScopeTypeBuilder rather than manually defining it here. 
780         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
781         iterators here.
782
783         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
784         before RootContext.DefineTypes().
785
786         * codegen.cs (EmitContext.RemapToProxy): Removed.
787         (EmitContext.CurrentAnonymousMethod): Changed type from
788         AnonymousMethod -> AnonymousContainer.
789         (EmitContext.ResolveTopBlock): Protect from being called twice.
790         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
791         (EmitContext.EmitThis): Removed the iterators hacks; use the
792         anonymous methods framework for that.
793
794         * statement.cs
795         (ToplevelBlock.Container): Make this a property, not a field.
796         (ToplevelBlock.ReParent): New public method; move the
797         ToplevelBlock into a new container.
798         (Foreach.TemporaryVariable): Simplify.
799
800 2005-06-05  Martin Baulig  <martin@ximian.com>
801
802         * statement.cs (LocalInfo.CompilerGenerated): New flag.
803         (Block.AddTemporaryVariable): New public method; creates a new
804         `LocalInfo' for a temporary variable.
805         (Block.EmitMeta): Create the LocalBuilders for all the temporary
806         variables here.
807         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
808         non-iterator variables.
809
810 2005-06-05  Martin Baulig  <martin@ximian.com>
811
812         * statement.cs (Foreach.TemporaryVariable): Create the
813         LocalBuilder in the Emit phase and not in Resolve since in some
814         situations, we don't have an ILGenerator during Resolve; see
815         2test-19.cs for an example.
816
817 2005-06-04  Martin Baulig  <martin@ximian.com>
818
819         The big Foreach rewrite - Part II.
820
821         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
822         with `PropertyInfo ienumerator_getcurrent'.
823
824         * codegen.cs (VariableStorage): Removed.
825
826         * statement.cs
827         (Foreach): Derive from Statement, not ExceptionStatement.
828         (Foreach.CollectionForeach): New nested class.  Moved all the code
829         dealing with collection foreach here.
830         (Foreach.ForeachHelperMethods): Removed.
831         (Foreach.TemporaryVariable): Implement IMemoryLocation.
832
833 2005-05-23  Martin Baulig  <martin@ximian.com>
834
835         * statement.cs (Try.DoResolve): Don't create a `finally' if we
836         don't need to.  Fix #75014.
837
838 2005-05-26  Raja R Harinath  <rharinath@novell.com>
839
840         Improve user-defined conversion handling.
841         * convert.cs (GetConversionOperators): Rewrite.  Return only the
842         applicable operators.
843         (AddConversionOperators): New.  Helper for GetConversionOperators.
844         (FindMostEncompassedType, FindMostEncompassingType): Verify that
845         there is only one most encompassed/encompassing type.
846         (FindMostSpecificSource, FindMostSpecificTarget): Remove
847         "applicable operator" handling.
848         (UserConversion): Move cache here from GetConversionOperators.
849         Directly cache the chosen operator, rather than the whole
850         MethodGroup.
851         (ExplicitNumericConversion): Fix buggy implementation of Decimal
852         case.  Allow conversion of decimal to sbyte and byte too.
853         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
854         New static methods.  Used to avoid allocating EmptyExpressions in
855         convert.cs.
856
857 2005-05-24  Duncan Mak  <duncan@novell.com>
858
859         * ecore.cs (CastFromDecimal): New class for casting a decimal to
860         another class, used in Convert.ExplicitNumericConversion.
861         (CastToDecimal): New class, similar to above, but casts to
862         System.Decimal, used in Convert.ImplicitNumericConversion and also
863         in explicit convesion from double/float to decimal.
864
865         * convert.cs (ImplicitNumericConversion): Handle implicit
866         conversions to System.Decimal.
867         (ExplicitNumericConversion): handle explicit conversions to
868         System.Decimal.
869
870         This fixes #68711.
871         
872 2005-05-20  Miguel de Icaza  <miguel@novell.com>
873
874         * typemanager.cs: Do not throw an exception in the TypeBuilder
875         case, we take care of it on the TypeCode.
876
877 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
878         
879         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
880         is back.
881         
882         * cs-parser.jay: Catch more lexical errors.
883         
884         * report.cs: Add one more Error method.
885         
886         * rootcontext.cs,
887         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
888
889 2005-05-20  Martin Baulig  <martin@ximian.com>
890
891         * class.cs (TypeContainer.CircularDepException): Removed.
892         (TypeContainer.DefineType): Removed the `InTransit' stuff.
893         (TypeContainer.CheckRecursiveDefinition): Check for circular class
894         (CS0146) and interface (CS0529) dependencies here.
895
896 2005-05-20  Martin Baulig  <martin@ximian.com>
897
898         * expression.cs (New.DoResolve): Move the CS0712 check above the
899         CS0144 check; otherwise it can never be reached.
900
901 2005-05-20  Martin Baulig  <martin@ximian.com>
902
903         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
904
905 2005-05-20  Martin Baulig  <martin@ximian.com>
906
907         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
908
909         * typemanager.cs (TypeManager.IsAttributeType): New public method.
910
911 2005-05-19  Martin Baulig  <martin@ximian.com>
912
913         * delegate.cs
914         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
915         to disable error reporting.
916
917         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
918         here since we don't want to report an error; see the new test-336.cs.
919
920 2005-05-19  Raja R Harinath  <rharinath@novell.com>
921
922         * statement.cs (ToplevelBlock.GetParameterReference)
923         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
924         Move here from class Block.
925         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
926         * expression.cs (ParameterReference.DoResolveBase): Likewise.
927
928 2005-05-18  Martin Baulig  <martin@ximian.com>
929
930         Fix #74978.
931
932         * flowanalysis.cs
933         (FlowBranching.Reachability): Add non-static public And() and Or()
934         methods.
935         (FlowBranchingSwitch): New class; do the `break_origins' thing
936         like in FlowBranchingLoop.
937         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
938         reachability, not just locals and parameters.
939         (FlowBranching.MergeChild): Remove some of the hacks for loop and
940         switch; MergeBreakOrigins() now takes care of that.
941
942 2005-05-18  Martin Baulig  <martin@ximian.com>
943
944         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
945         a loop and may leave it, reset the barrier; fixes #74974.
946
947 2005-05-16  Raja R Harinath  <rharinath@novell.com>
948
949         Fix test-382.cs.  Emit values of decimal constants.
950         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
951         Carved out of ...
952         (TypeContainer.AddField): ... this.
953         (TypeContainer.EmitFieldInitializers): Allow the list of fields
954         with initializers to include 'Const's.
955         (ClassPart.RegisterFieldForInitialization): Forward to
956         PartialContainer.
957         * const.cs (Const.Const): Pass initializer to base class.
958         (Const.Define): In case of decimal constants, register them for
959         initialization in a static constructor.
960
961 2005-05-14  Martin Baulig  <martin@ximian.com>
962
963         * statement.cs (Block.Resolve): Correctly handle unreachable code;
964         do not call ResolveUnreachable() on unreachable statements in
965         here, see the comment in the source code.
966
967 2005-05-13  Raja R Harinath  <rharinath@novell.com>
968
969         Fix #74934.
970         * expression.cs (BinaryResolveOperator): If one of the operands of
971         an equality comparison is 'null' and the other is a pointer type,
972         convert the null to a NullPointer.
973         * convert.cs (ImplicitReferenceConversion): If the expression is a
974         NullLiteral and the target type is a pointer type, return a
975         NullPointer instead.
976         (ImplicitConversionStandard): Likewise.
977
978 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
979         
980         * cs-parser.jay: Set readonly context based on special constructs.
981         
982         * expression.cs (LocalVariableReference.DoResolveBase): Improved
983         readonly variable error handling.
984         
985         * rootcontext.cs (EmitCode): Don't verify members when error
986         occurred.
987         
988         * statement.cs (LocalInfo): Add reaodnly context information.
989         (SetReadOnlyContext, GetReadOnlyContext): New methods.
990
991 2005-05-17  Martin Baulig  <martin@ximian.com>
992
993         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
994         #70970. 
995
996 2005-05-13  Martin Baulig  <martin@ximian.com>
997
998         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
999         handle unreachable blocks.
1000
1001 2005-05-13  Martin Baulig  <martin@ximian.com>
1002
1003         * class.cs
1004         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1005         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1006         #74905. 
1007
1008 2005-05-13  Martin Baulig  <martin@ximian.com>
1009
1010         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1011         instance variable, not a local.  Fix #74873.
1012         (Block.ResolveUnreachable): Set it to true here.
1013
1014 2005-05-12  Martin Baulig  <martin@ximian.com>
1015
1016         * cs-parser.jay (property_declaration): Pass the `current_class',
1017         not the `current_container' to Property's .ctor.  Fixes #74912.
1018
1019 2005-05-11  Martin Baulig  <martin@ximian.com>
1020
1021         * typemanager.cs (Closure): Copy this from MCS and merge all the
1022         GMCS-specific changes into it.
1023
1024 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1025
1026         Fix #74920.
1027         * typemanager.cs (unmanaged_enclosing_types): New.
1028         (IsUnmanagedType): Avoid infloops by using
1029         'unmanaged_enclosing_types' to talk with recursive invocations.
1030
1031 2005-05-11  Duncan Mak  <duncan@novell.com>
1032
1033         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1034         continuing to process for 'arg'.
1035         (handle_preprocessing_directive): Check the argument of the #endif
1036         directive and report error CS1025 if there are any trailing
1037         characters.
1038
1039         According to the C# spec, having even whitespace after the #endif
1040         directive is illegal; however, because we call arg.TrimEnd ()
1041         beforehand, we have the same behavior as csc, allowing whitespace
1042         after the directive.
1043
1044         Fixes #74892.
1045
1046 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1047
1048         Fix #74863.
1049         
1050         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1051         (Constructor.GetObsoleteAttribute): Implemented correctly.
1052
1053 2005-05-10  Martin Baulig  <martin@ximian.com>
1054
1055         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1056         resolve the type; fixes #74864.
1057         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1058         in DoResolve(); fixes #74862.
1059
1060 2005-05-10  Martin Baulig  <martin@ximian.com>
1061
1062         * support.cs (ReflectionParameters.ParameterModifier): Use
1063         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1064         and `ParameterAttributes.In'.  Fixes #74884.
1065
1066 2005-05-10  Martin Baulig  <martin@ximian.com>
1067
1068         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1069         the cache if we're just looking for `MemberTypes.NestedType' in a
1070         generic instance.
1071
1072         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1073         constraints if we're still resolving the type tree.
1074         (Expression.MemberLookup): If we're resolving the type tree, only
1075         look for `MemberTypes.NestedType' since we're only interested in
1076         getting types.
1077
1078         * class.cs (TypeContainer.DefineType): Don't resolve the type
1079         parameters here; do this later in ResolveType() after the type
1080         tree has been resolved.
1081         (TypeContainer.ResolveType): New public method; this is called
1082         after the type tree is resolved and before the types are being
1083         populated.  We resolve the generic constraints here.
1084         (TypeContainer.DoDefineMember): Check the constraints on our base
1085         class and interfaces.
1086
1087         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1088         set the `ResolvingTypeTree' flag on the EmitContext.
1089
1090         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1091
1092 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1093
1094         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1095         
1096         * expression.cs (Argument.GetParameterModifier): Turned to property.
1097         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1098         
1099         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1100         its C# equivalent.
1101         
1102 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1103
1104         Fix #74852.
1105         * decl.cs (MemberCache.AddMethods): Register override methods,
1106         rather than non-override methods.
1107         * typemanager.cs (RegisterOverride): New.
1108         (IsOverride): Update.
1109
1110 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1111
1112         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1113
1114 2005-05-06  Martin Baulig  <martin@ximian.com>
1115
1116         * attribute.cs
1117         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1118         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1119
1120 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1121
1122         Fix #73105.
1123         
1124         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1125         recursive declaration.
1126         
1127         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1128         
1129 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1130
1131         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1132         
1133         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1134
1135 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1136
1137         Fix #74797.
1138         * decl.cs (DeclSpace.FamilyAccessible): 
1139         Use TypeManager.IsNestedFamilyAccessible.
1140
1141         Fix reopened #64812.
1142         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1143         internal'.
1144
1145 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1146             Abin Thomas  <projectmonokochi@rediffmail.com>
1147             Anoob V E  <projectmonokochi@rediffmail.com>
1148             Harilal P R  <projectmonokochi@rediffmail.com>
1149
1150         Fix #64812.
1151         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1152         allow access to all static members.
1153
1154 2005-05-04  Martin Baulig  <martin@ximian.com>
1155
1156         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1157
1158 2005-05-04  Martin Baulig  <martin@ximian.com>
1159
1160         Fix #74655.
1161
1162         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1163         section at the end; make things work if `default' is not the last
1164         section.        
1165
1166 2005-05-04  Martin Baulig  <martin@ximian.com>
1167
1168         Fix #70400.
1169
1170         * statement.cs (Switch): Replaced the `got_default' field with a
1171         `default_section' one.
1172         (Switch.CheckSwitch): Set `default_section' here.
1173         (Switch.Resolve): If we're a constant switch and the constant is
1174         not found, use the default section.
1175
1176 2005-05-03  Martin Baulig  <martin@ximian.com>
1177
1178         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1179
1180         * statement.cs (Foreach.ArrayForeach): New nested class.
1181         (Foreach.TemporaryVariable): New nested class.
1182         (Foreach.EmitArrayForeach): Removed; this is now in the new
1183         ArrayForeach class.
1184
1185 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1186
1187         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1188         more conservative.
1189         (VerifyPendingMethods): Revert change below.
1190
1191         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1192         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1193         that used to trigger warning -28.  Remove warning -28.
1194         * expression.cs (Invocation.OverloadResolve): Use
1195         TypeManager.IsOverride to distinguish override methods.
1196
1197         Fix #74773.
1198         * pending.cs (VerifyPendingMethods): If a base type implements the
1199         requested interface, don't bother checking individual methods of
1200         the base type.  As a side-effect, this prevents the creation of
1201         unnecessary proxies.
1202
1203 2005-05-02  Martin Baulig  <martin@ximian.com>
1204
1205         Fix #70182.
1206
1207         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1208         Also `And' the locals if the old vector is null.
1209         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1210         null; in this case we basically reset all the variables.        
1211
1212 2005-05-02  Martin Baulig  <martin@ximian.com>
1213
1214         Fix #74529.
1215
1216         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1217         Added `FlowBranching branching' argument; always `and' the
1218         variables instead of `or'ing them unless we're an infinite loop.
1219
1220         * statement.cs (While.Resolve): Create a new sibling unless we're
1221         infinite.       
1222
1223 2005-05-02  Martin Baulig  <martin@ximian.com>
1224
1225         Fix #70140.
1226
1227         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1228         arguments; use it instead of creating a new TopLevelBlock.
1229         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1230         our ConstructorInitializer.
1231
1232         * statement.cs
1233         (TopLevelBlock.TopLevelBranching): New public property.
1234         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1235         and create our `TopLevelBranching'.
1236
1237         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1238         anonymous method host, use `block.TopLevelBranching' rather than
1239         creating a new branching.
1240
1241 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1242
1243         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1244         a ScopeInfo, if any of the current children is a child of the new
1245         entry, move those children there.
1246
1247 2005-04-30  Martin Baulig  <martin@ximian.com>
1248
1249         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1250         at the beginning of a SwitchSection.  Fix #73335.
1251
1252 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1253
1254         Fix #74378
1255         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1256         
1257         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1258         (FieldExpr.DoResolve): Obsolete members are ignored for field
1259         initializers.
1260         
1261 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1262
1263         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1264         of arrays detection.
1265
1266         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1267         verification.
1268         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1269
1270         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1271         arrays report.
1272
1273 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1274
1275         * cs-parser.jay: Use the prefered version of -unsafe in error
1276         message.
1277
1278 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1279
1280         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1281         circumstances.
1282
1283 2005-04-20  John Luke  <john.luke@gmail.com>
1284
1285         * driver.cs: fix typo in error message, --outout to --output
1286
1287 2005-04-30  Martin Baulig  <martin@ximian.com>
1288
1289         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1290         handle the .NET 2.x security attributes.
1291
1292 2005-04-30  Martin Baulig  <martin@ximian.com>
1293
1294         * typemanager.cs
1295         (TypeManager.ExpandInterfaces): Don't add things twice.
1296
1297         * class.cs
1298         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1299
1300 2005-04-29  Martin Baulig  <martin@ximian.com>
1301
1302         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1303
1304         * anonymous.cs: Added support for anonymous generic methods.
1305
1306 2005-04-29  Martin Baulig  <martin@ximian.com>
1307
1308         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1309         generic instances.
1310
1311 2005-04-29  Martin Baulig  <martin@ximian.com>
1312
1313         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1314
1315         * expression.cs (New.DoResolve): Fix the CS0304 check.
1316
1317 2005-04-29  Martin Baulig  <martin@ximian.com>
1318
1319         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1320         naming schema.
1321
1322         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1323         explicit interface implementation, compare the interface types.
1324         (MethodData.Define): Use the new naming scheme from the latest
1325         .NET 2.x beta2.
1326         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1327
1328         * decl.cs (MemberName.GetMemberName): Removed.
1329         (MemberName.MethodName, FullName): New properties.
1330
1331 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1332
1333         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1334
1335 2005-04-22  Martin Baulig  <martin@ximian.com>
1336
1337         * generic.cs (GenericMethod): Create the EmitContext in the
1338         `Define()'; in `Define(MethodBuilder)', create the type parameters
1339         before calling `Define()'.  Fixes #73933.
1340
1341 2005-04-22  Martin Baulig  <martin@ximian.com>
1342
1343         * generic.cs
1344         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1345         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1346
1347         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1348         ConstructedType, check its constraints.
1349
1350 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1351
1352         * codegen.cs (InRefOutArgumentResolving): New field.
1353         
1354         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1355         fields outside contructor.
1356         
1357         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1358         
1359 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1360
1361         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1362         parameter code was not completed ever, so it was not as up-to-date
1363         as local variables.  Must finish it.
1364
1365         The bug fix was to compare the Toplevel of the block, not the
1366         current block.  Thanks for Ben for pointing this out. 
1367
1368 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1369
1370         * decl.cs (AddMethods): Use the declaring type of the problem
1371         method to determine if we want to squash a warning.
1372
1373 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1374
1375         * attribute.cs: Removed debug output.
1376
1377         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1378         
1379         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1380         Report.Stderr.
1381         
1382 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1383
1384         Fix #74481.
1385         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1386         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1387         all null comparisons against reference types.
1388
1389 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1390
1391         Fix# 74565
1392         * class.cs (TypeContainer.CircularDepException) New nested
1393         exception class.
1394         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1395         (TypeContainer.DefineType): Removed error, reset InTransit before
1396         exit.
1397         (Class.DefineType): Throw exception when is in Transit.
1398         Catch exception and report error.
1399         (Struct.DefineType): Throw exception when is in Transit.
1400         Catch exception and report error.
1401         (Interface.DefineType): Throw exception when is in Transit.
1402         Catch exception and report error.
1403
1404         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1405         handle nested exception handlers.
1406
1407         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1408         a catch.
1409
1410         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1411         InFinally and InCatch storage.
1412
1413         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1414         (Catch.Resolve): Set and Restore ec.InCatch.
1415         (Try.Resolve): Set and Restore ec.InFinally.
1416         (Try.HasCatch): True when try has catch.
1417
1418 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1419
1420         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1421           for the same event member, so exclude such cases from warning 419.
1422           Fixed bug #74633.
1423
1424 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1425
1426         * expression.cs (Binary.ResolveOperator): Apply patch from John
1427         Luke to fix bug 59864: operators &, | and ^ on enumerations
1428         require that the same enum type on both sides.
1429
1430         * driver.cs: Add warnings to old flag usage, this is to assist
1431         people who produce Makefiles and hope that the Makefiles will be
1432         used on Windows.
1433
1434         * class.cs (TypeContainer.EmitType): Moved the definition of the
1435         special $PRIVATE$ field from the resolve phase to the Emit phase.
1436         During resolve we do not know if we are a struct with
1437         HasExplicitLayout, we know this only after the attributes for the
1438         type are emitted.
1439
1440         Set the FieldOffset to zero on the dummy field that we create for
1441         the class.   Fixes 74590.
1442
1443 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1444
1445         Fix #73834.
1446         * ecore.cs (PropertyExpr.resolved): New.
1447         (DoResolve): Use it to handle a case of double resolution here.
1448         Handle a case of identical-name-and-type-name.
1449         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1450         resolution by storing the results of expression resolution back
1451         into the "probes" array.
1452
1453 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1454
1455         Fix cs0208-7.cs and cs0208-8.cs.
1456         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1457         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1458         error reporting to point out the reason a struct is not unmanaged.
1459
1460 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1461
1462         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1463           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1464
1465 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1466
1467         Fix #74528.
1468         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1469         IdenticalNameAndTypeName here.
1470         (EventExpr.InstanceResolve): Likewise.
1471
1472 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1473
1474         C# 2.0 DefaultCharSetAttribute implementation
1475         
1476         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1477         which allows us to set GlobalNamespace for every resolve.
1478         (Attribute.ResolveArguments): Cut from Resolve.
1479         (Attribute.GetCharSetValue): Returns CharSet named argument.
1480         (Attribute.DefinePInvokeMethod): Gets default charset from
1481         module settings.
1482         (GlobalAttribute.ResolveAsTypeStep): Override.
1483         (GlobalAttribute.ResolveArguments): Override.
1484         
1485         * class.cs (TypeAttr): Is protected.
1486         
1487         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1488         (ModuleClass.DefaultCharSetType): New memeber.
1489         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1490         
1491         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1492         charset from module.
1493         
1494         * delegate.cs (TypeAttr): Override.
1495         (Delegate.DefineType): Use this TypeAttr.
1496         
1497         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1498         at very early stage (before types are defined) to resolve model
1499         module attributes. It will probably not work with corlib but it
1500         should be ok.
1501         
1502         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1503         charset from module.
1504         
1505         * typemanager.cs (default_charset_type): New type.
1506
1507 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1508
1509         * decl.cs (MemberCache.AddMethods): Don't warn if
1510         System.Object.Finalize has buggy MethodAttributes.
1511
1512         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1513         removed below.
1514
1515 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1516
1517         * doc.cs : detect ambiguous reference to overloaded members.
1518           Fixed bug #71603. MS 1.1 csc does not detect it.
1519
1520 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1521
1522         * doc.cs : delegates must not be referenced with parameters.
1523           Fixed bug #71605.
1524
1525 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1526
1527         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1528
1529 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1530
1531         * driver.cs (MainDriver): Stop processing if the CLS stage found
1532         errors. 
1533
1534         (CompilerCallableEntryPoint.InvokeCompiler): Always
1535         reset after execution;   Take a TextWriter argument for the
1536         output.
1537
1538         * report.cs: Use the error stream instead of hardcoding stderr. 
1539
1540 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1541
1542         * class.cs: Reduce code paths to test, too small of an
1543         optimization to make it worth the extra testing.  Always perform
1544         it. 
1545
1546 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1547
1548         Fix #74510.
1549         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1550         operators that had errors reported on them.
1551
1552 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1553
1554         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1555         argument types.
1556         (Attribute.Resolve): Add named argument type checking.
1557         
1558         * class.cs (FixedField.Define): Use IsPrimitiveType
1559         
1560         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1561         
1562         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1563         unsafe parameter types.
1564         
1565         * statement.cs (Using.ResolveExpression): Add better error description.
1566         
1567         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1568         
1569 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1570
1571         Fix #74484.
1572         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1573         AttributeUsageAttribute in the emitcontext of the attribute class,
1574         not in the emitcontext of the attributable entity it was attached to.
1575         * cs-parser.jay: Use 'current_class', not 'current_container',
1576         when creating a GlobalAttribute.
1577
1578 2005-04-08  Alp Toker  <alp@atoker.com>
1579
1580         * pending.cs: The fix to #58413 failed to compile methods implementing
1581         interfaces with/without params modifiers and vice versa, even though
1582         params modifiers aren't part of the signature. Make the modifier check
1583         less strict as in csc.
1584
1585 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1586             Anoob V E  <projectmonokochi@rediffmail.com>
1587             Harilal P R  <projectmonokochi@rediffmail.com>
1588
1589         Fix #58413.
1590         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1591         modifiers of pending methods.
1592         (PendingImplementation.PendingImplementation): Initialize it.
1593         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1594         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1595         with ParameterData.  Add check for modifiers.
1596         * class.cs (MethodData.Define): Update to changes.
1597
1598 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1599
1600         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1601
1602 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1603
1604         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1605         property.
1606         
1607         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1608         
1609         * rootcontext.cs,
1610         * typemanager.cs: Registered RequiredAttributeAttribute.
1611         
1612 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1613
1614         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1615         Warning CS0169 is back at level 3.
1616         (IMethodData.SetMemberIsUsed): New method.
1617         
1618         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1619         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1620         
1621         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1622
1623         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1624         contants.
1625         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1626         is used.
1627         
1628         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1629         is used.
1630         
1631         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1632         to avoid the problems with nested types.
1633
1634 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1635             Anoob V.E  <projectmonokochi@rediffmail.com>
1636             Harilal P.R  <projectmonokochi@rediffmail.com>
1637             Raja R Harinath  <rharinath@novell.com>
1638
1639         Fix #73820.
1640         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1641         attribute.
1642         * typemanager (GetConstructor): Make public.
1643
1644 2005-04-05  John Luke  <john.luke@gmail.com>
1645             Raja R Harinath  <rharinath@novell.com>
1646
1647         Fix #62232.
1648         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1649         struct too.  Return false quicker in a few cases.
1650         (VerifyUnManaged): Use it.
1651
1652 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1653
1654         Fix #74041.
1655         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1656         not 'unreachable_seen'.
1657
1658 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1659
1660         * attribute.cs (Attribute.GetValue): Removed unused.
1661         
1662         * codegen.cs (CodeGen.TrimExt): Removed unused.
1663         
1664         * cs-parser.jay (output): Removed unused.
1665         
1666         * cs-tokenizer.cs (hex_digits): Removed unused.
1667         
1668         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1669         
1670         * expression.cs (Indirection.LoadExprValue): Removed unused.
1671         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1672         
1673         * iterators.cs (Iterator.param_types): Removed unused.
1674         
1675         * statement.cs (Goto.block): Removed unused.
1676         (ToplevelBlock.did): Removed unused.
1677         (Switch.ResolveConstantSwitch): Removed unused.
1678
1679 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1680
1681         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1682         resetting thingy.
1683
1684 2005-04-19  Martin Baulig  <martin@ximian.com>
1685
1686         Merged r42462 from MCS and made it work for GMCS.
1687
1688         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1689
1690         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1691
1692 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1693
1694         Fix #74232 and cs0208-3.cs.
1695         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1696         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1697         unmanaged type.  Don't use FieldBuilders when 't' is a
1698         TypeBuilder.  Use ModFlags and MemberType fields.
1699         * class.cs (MemberBase.member_type): Rename from MemberType.
1700         (MemberBase.MemberType): New property.  Determines member_type on
1701         demand.
1702         (MemberBase.DoDefine): Don't initialize MemberType here.
1703         (FieldMember.Define): Likewise.
1704
1705 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1706
1707         Fix #74241
1708         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1709         Attributes are emitted there.
1710         
1711 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1712
1713         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1714         keyword in 'partial enum' too.
1715         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1716         is not allowed).
1717         Report from Kamil Skalski <nazgul@omega.pl>.
1718
1719         Fix #74309.
1720         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1721         have partial containers too.
1722
1723         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1724         in block' checks to Block.CheckInvariantMeaningInBlock.
1725         * statement.cs (Block.GetKnownVariableInfo): Make private.
1726         (Block.IsVariableUsedInChildBlock): Remove.
1727         (Block.IsVariableUsedInBlock): Likewise.
1728         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1729         conflicting declaration.
1730         (Block.AddVariable): Make error messages less long-winded and more
1731         specific.  Show location of conflicting declaration.
1732         * parameter.cs (Parameters.Location): New readonly property.
1733
1734 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1735
1736         Clean up semantics of invoking ResolveMemberAccess.
1737         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1738         can have an instance, ensure that we pass in a non-TypeExpression
1739         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1740         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1741         argument.  Update to changes and simplify.
1742         (FieldExpr.Emitinstance): Remove CS0120 check.
1743         (PropertyExpr.EmitInstance): Likewise.
1744         * expression.cs (Argument.Resolve): Likewise.
1745         (Invocation.DoResolve): Update to changes in semantics of
1746         InstanceExpression.
1747
1748 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1749
1750         Fix #74241
1751         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1752         customization.
1753         
1754         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1755
1756 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1757
1758         Fix difference in behaviour with commandline invocation.
1759         * driver.cs (Driver.Reset): New.
1760         (CompilerCallableEntryPoint): Call it.
1761
1762         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1763         variable" warnings if the boolean expression failed to resolve.
1764
1765 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1766
1767         * attribute.cs: Fix the union of several permissions when some of them
1768         are unrestricted (so the result isn't an unrestricted permission set).
1769         Fix #74036.
1770
1771 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1772
1773         * ecore.cs (MemberExpr): New class.  Convert from interface
1774         IMemberExpr.
1775         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1776         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1777         error checks.
1778         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1779         (MethodGroupExpr.IsExplicitImpl): Remove.
1780         (Expression.GetFieldFromEvent): Remove.
1781         (SimpleName.MemberStaticCheck): Remove.
1782         (SimpleName.DoSimpleNameResolve): Update to changes.
1783         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1784         (MemberAccess.IdenticalNameAndTypeName): Remove.
1785         (MemberAccess.error176): Move to MemberExpr.
1786         (MemberAccess.DoResolve): Update to changes.
1787         (BaseAccess.DoResolve): Likewise.
1788
1789 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1790
1791         C# 2.0 Conditional attribute class implementation
1792         
1793         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1794         Analyzes class whether it has attribute which has ConditionalAttribute
1795         and its condition is not defined.
1796         
1797         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1798         (Class.IsExcluded): New method. Search for at least one defined
1799         condition in ConditionalAttribute of attribute class.
1800
1801 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1802
1803         * ecore.cs (PropertyExpr): Derive from Expression, not
1804         ExpressionStatement.
1805         (PropertyExpr.EmitStatement): Remove.
1806
1807 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1808
1809         Fix #74060.
1810         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1811         internal field "value__" of an enum be private.  The examples for
1812         "value__" that I found on MSDN all used FieldAttributes.Private.
1813
1814         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1815         Don't mention IL method attribute names.
1816
1817         Fix #47991.  Remove a TODO.
1818         * statement.cs (Block.Toplevel): Make into a field.
1819         (Block.Parameters): Move into ToplevelBlock.
1820         (Block.known_variables): Rename from child_variable_names.
1821         (Block.Block): Remove variants that take Parameters.  Initialize
1822         'Toplevel' with the immediately surrounding toplevel block.
1823         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1824         LocalInfo parameter.
1825         (Block.GetKnownVariableInfo): New.
1826         (Block.IsVariableNameUsedInChildBlock): Update.
1827         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1828         the block, even though it may not be in scope.
1829         (Block.AddVariable): Remove Parameters parameter.  Use
1830         Toplevel.Parameters instead.
1831         (Block.AddConstant): Remove Parameters parameter.
1832         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1833         (Block.IsParamaterReference): Likewise.
1834         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1835         (ToplevelBlock.Parameters): New.  Moved from Block.
1836         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1837         initialize Parameters to a non-null value.
1838         * cs-parser.jay: Update to changes.
1839         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1840         simple names that mean different things in the same block.  Use
1841         Block.IsVariableNameUsedInBlock.
1842
1843 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1844
1845         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1846
1847 2005-03-26  Raja R Harinath  <harinath@acm.org>
1848
1849         Fix #73038.
1850         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1851         fails to resolve, ensure that the LHS is still resolved as an
1852         lvalue.
1853
1854 2005-03-25  Raja R Harinath  <harinath@acm.org>
1855
1856         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1857         ec.ContainerType.
1858         (Enum.current_ec): Remove.
1859         (Enum.LookupEnumValue): Remove EmitContext argument.
1860         Just uses the one created during DefineType.
1861         (Enum.FindMembers): Update.
1862         * expression.cs (MemberAccess.DoResolve): Update.
1863
1864 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1865
1866         * assign.cs (Assign.DoResolve): Check for CS1717 when
1867         source and target are same (uses Equals).
1868
1869         * expression.cs (LocalVariableReference, ParameterReference,
1870         This): Implemented Equals, GetHashCode.
1871
1872         * statement.cs (Block.GetParameterReference): Removed useless
1873         local variable.
1874
1875 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1876
1877         Fix cs0128.cs
1878         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1879         blocks before deciding whether the error is cs0136 or cs0128.
1880
1881         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1882         (using_alias_directive, using_namespace_directive): Pass
1883         MemberName, not an expression to Namespace.UsingAlias and
1884         Namespace.Using.
1885         (MakeName): Use the MemberName of the namespace.
1886         * namespace.cs (Namespace.MemberName): New.
1887         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1888         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1889         Likewise.
1890         * decl.cs (MemberName.Name): Make readonly.
1891         (MemberName.FromDotted): New "constructor".
1892         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1893         (MemberCore.Name): Compute from MemberName on demand.
1894         (MemberCore.SetMemberName): Provide a way to change the
1895         MemberName.
1896         (MemberCore.AddToContainer): Don't take a fullname parameter.
1897         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1898         fully qualified name of the container to the member name.
1899         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1900         only if the type is a member of the root container.
1901         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1902         MemberName.Left rather than searching for an embedded ".".
1903         (PartialContainer.CreatePart): Update to changes in RootContext.
1904         (MemberBase.ShortName): Turn into a property.  Use
1905         MemberCore.SetMemberName.
1906         (MemberBase.ExplicitInterfaceName): Remove.
1907         (MemberBase.UpdateMemberName): Remove.
1908         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1909         (PropertyBase.SetMemberName): New override.
1910         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1911         (Tree.GetDecl): New.
1912         (Tree.AllDecls): Rename from Decls.
1913         * attribute.cs, enum.cs, report.cs: Update to changes.
1914         * driver.cs (MainDriver): Use MemberName.FromDotted on
1915         RootContext.MainClass.
1916
1917 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1918
1919         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1920         checks.
1921
1922         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1923
1924 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1925
1926         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1927         property accessor modifiers.
1928
1929         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1930         fixed buffer attribute (CS1716).
1931         (PropertyMethod.HasCustomAccessModifier): When property accessor
1932         has custom modifier.
1933
1934         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1935         modifiers.
1936         (PropertyExpr.DoResolveLValue): Add CS0272.
1937
1938 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1939
1940         * convert.cs: When converting to a pointer, use the proper Conv.U
1941         or Conv.I depending on the source data type.
1942
1943         * cs-tokenizer.cs: Make the size for large decimal constants,
1944         fixes #72957.
1945
1946 2005-03-17  Martin Baulig  <martin@ximian.com>
1947
1948         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1949         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1950
1951 2005-03-17  Martin Baulig  <martin@ximian.com>
1952
1953         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1954         to bool so we can return an error condition.
1955         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1956         returned an error.
1957
1958 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1959
1960         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1961         attributes.
1962
1963 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1964
1965         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1966         Refactor to avoid traversing the list of assemblies, and to avoid
1967         string concatenation.
1968         * typemanager.cs (guid_attr_type): Remove.
1969         (negative_hits, pointers, references): Remove hashes.
1970         (type_hash): New.
1971         (GetConstructedType): New.  Uses type_hash to handle constructed
1972         types (arrays, references, pointers).
1973         (GetReferenceType, GetPointerType): Use it.
1974         (GetNestedType): New.  Uses type_hash to handle nested types of
1975         reflected types.
1976         (LookupType, LookupTypeDirect): Remove.
1977         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1978         'types' hash and LookupTypeReflection directly.
1979         (params_string, params_object): Use GetConstructedType.
1980         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1981         top-level types.
1982         (Namespace.Lookup): Use cached_types.
1983         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1984         provided by old TypeManager.LookupType.
1985         * rootcontext.cs (MakeFQN): Remove.
1986         * decl.cs (DeclSpace.MakeFQN): Likewise.
1987         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1988         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1989         TypeManager.GetConstructedType.
1990         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1991
1992 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1993
1994         * cs-parser.jay: Fix build.
1995
1996 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1997
1998         * class.cs (TypeContainer.CircularDepException) New nested
1999         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2000
2001         * cs-parser.jay: Reports CS1527 for any namespace element.
2002
2003         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2004         Added CS0407.
2005
2006         * expression.cs (ParameterReference.IsAssigned): Changed error to
2007         CS0269.
2008         (Error_WrongNumArguments): Moved CS0245 detection here.
2009
2010         * statement.cs (Return.Resolve): Add CS1622 report.
2011
2012 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2013
2014         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2015
2016 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2017
2018         * attribute.cs expression.cs: Get rid of some allocations.
2019
2020 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2021
2022         * doc.cs : just eliminate the latest change.
2023
2024 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2025
2026         * doc.cs : commented out the latest change. It breaks xml-030.cs
2027
2028 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2029
2030         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2031           fail. So invoke CreateType() in FindDocumentedType().
2032
2033 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2034
2035         * cs-tokenizer.cs : added IsKeyword().
2036         * doc.cs : Detect keyword incorrectly used as identifier.
2037           Allow identifiers prefixed by @.
2038
2039 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2040
2041         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2042         It caused exception in namespace resolving (again!).
2043         
2044         * class.cs (Class.ctor): Removed exit.
2045         (PropertyMethod.ctor): ditto.
2046         
2047         * codegen.cs (Codegen.Reset): Reset static data.
2048         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2049         
2050         * cs-tokenizer.cs (Cleanup): Removed.
2051         
2052         * driver.cs (GetSystemDir): Rewrote to one line command.
2053         It caused problem with unloaded dynamic modules.
2054         (UnixParseOption): Removed Exit.
2055         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2056         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2057         Now can be mcs used as library.
2058         
2059         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2060         empty location.
2061         
2062         * location.cs (Reset): Reset static data.
2063         
2064         * namespace.cs (Reset): Reset static data.
2065         
2066         * report.cs (Report.Reset): Reset static data.
2067         
2068         * rootcontext.cs (RootContext.Reset): Reset static data.
2069         
2070         * tree.cs (RootTypes.ctor): Use Location.Null
2071         
2072         * typemanager.cs (TypeManager.Reset): Reset static data.
2073         (CoreLookupType): Removed Exit.
2074         (TypeHandle.Reset): Reset static data.
2075         
2076 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2077
2078         Fix #73516.
2079         * typemanager.cs (ComputeNamespaces): Import namespaces from
2080         referenced modules too.
2081
2082 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2083
2084         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2085         than '.'.
2086
2087 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2088
2089         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2090         enclosing DeclSpace.  This ensures that a name-lookup populates
2091         more caches and there are fewer 'TypeExpression's.  Carve out
2092         nested type lookup into ...
2093         (LookupNestedTypeInHierarchy): ... this.
2094
2095 2005-04-15  Martin Baulig  <martin@ximian.com>
2096
2097         Merged r41590 from MCS and make it work in the generics land.
2098
2099         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2100         `check' argument.
2101
2102         * class.cs (PartialContainer.UpdateConstraints): Removed.
2103         (PartialContainer.CheckConstraints): Removed.
2104         (PartialContainer.SetParameterInfo): Store the constraints here.
2105         (PartialContainer.DefineTypeParameters): New public method;
2106         resolve the type parameter's constraints here.  Note that the
2107         PartialContainer doesn't have an EmitContext anymore, so we must
2108         do this in the ClassPart.
2109
2110 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2111
2112         Clean up a few partial-class semantics.  
2113         Fixes test-357.cs and cs1618-2.cs.
2114         * cs-parser.jay (struct_declaration): Use 'current_class' as
2115         parent of newly-created struct.  Remove call to Register ().
2116         Use 'pop_current_class' to complete handing the current struct.
2117         (interface_declaration): Likewise.
2118         (class_declaration): Likewise.
2119         (enum_declaration): Use 'current_class' as parent of newly created
2120         enum.
2121         (delegate_declaration): Likewise.
2122         (pop_current_class): New function.  This is used to handle closing
2123         up the 'current_class' and 'current_container', and pointing them
2124         to the enclosing class/container.
2125         (CSharpParser): Initialize 'current_class' too.
2126         * decl.cs (MemberCore): Add check for invariant: a partial
2127         container is not a parsed entity, and thus does not enclose any
2128         parsed members.
2129         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2130         (DeclSpace.BaseTypeExpr): Use it.
2131         (DeclSpace.LookupType): Add check for invariant.
2132         * class.cs (TypeContainer): Add check for invariant: a nested
2133         class should have the same NamespaceEntry as its enclosing class.
2134         (TypeContainer.EmitFieldInitializers): Make virtual.
2135         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2136         MemberCore.
2137         (TypeContainer.Register): Remove.
2138         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2139         null.  Use TypeResolveEmitContext for resolving base types and
2140         interfaces.  Move initialization of Parts.TypeBuilder here from
2141         ...
2142         (TypeContainer.DefineNestedTypes): ... here.
2143         (PartialContainer): Take a Namespace not a NamespaceEntry.
2144         (PartialContainer.Create): Don't use Register.  Call the
2145         appropriate Add... function directly.
2146         (ClassPart): Take both the PartialContainer and the enclosing
2147         class as constructor arguments.
2148         (ClassPart.EmitFieldInitializers): Override.
2149         (ClassPart.PartFindNestedTypes): Remove.
2150         (FieldBase.GetInitializerExpression): Resolve the initializer
2151         expression in the emit context of the enclosing class.
2152         * tree.cs (RootTypes): Remove Register ().
2153         
2154 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2155
2156         * cs-parser.jay: Removed CS0134.
2157         
2158         * driver.cs: Removed CS1901.
2159         
2160         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2161         for predefined types.
2162
2163 2005-03-07  Duncan Mak  <duncan@novell.com>
2164
2165         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2166         well. Fixes bug #73454.
2167
2168 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2169
2170         * cs-tokenizer.cs (xtoken): Add CS1035.
2171         
2172         * class.cs (MethodData.Define): Add CS0683.
2173         (FieldMember.ctor): Add CS0681.
2174
2175 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2176
2177         * ecore.cs (SimpleName.DoResolve): Rename from
2178         SimpleName.DoResolveAllowStatic.
2179         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2180         Pass 'intermediate' flag to MemberStaticCheck.
2181         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2182         of "intermediate" lookups via MemberAccess.
2183         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2184         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2185
2186 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2187
2188         Fix #73394.
2189         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2190         slipped in because of variable names that are identical to a
2191         builtin type's BCL equivalent ('string String;', 'int Int32;').
2192         (PropertyExpr.EmitInstance): Likewise.
2193
2194 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2195
2196         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2197         
2198         * report.cs (warning_ignore_table): Made public.
2199
2200 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2201
2202         Fix #73282.
2203         * class.cs (MethodData.Emit): Pass 'container' to
2204         container.GetObsoleteAttribute instead of 'container.Parent'.
2205
2206 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2207
2208         * cs-parser.jay: Add 1534 error test.
2209
2210         * iterators.cs (Yield.CheckContext): Add error 1629.
2211         (Iterator.ctor): Save unsafe modifier.
2212         (MoveNextMethod.DoEmit): Restore unsafe context.
2213
2214         * namespace.cs (UsingAlias): Better error message.
2215
2216 2005-03-03  Dan Winship  <danw@novell.com>
2217
2218         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2219         the warning message [#73219]
2220
2221 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2222
2223         Fix compile with MCS 1.0.0.0.
2224         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2225         w_restore to not depend on string constant folding.
2226
2227 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2228
2229         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2230         CS0246 check to users who passed 'silent = false'.
2231         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2232         check.
2233         (SimpleName.SimpleNameResolve): Update.
2234         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2235         (MemberAccess.IdenticalNameAndTypeName): Update.
2236         * doc.cs (FindDocumentedTypeNonArray): Update.
2237
2238 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2239
2240         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2241         * parameters.cs (ComputeAndDefineParameters): Remove.
2242         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2243         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2244         Use GetParameterInfo.
2245
2246 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2247
2248         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2249
2250 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2251
2252         Unify DeclSpace.LookupType and DeclSpace.FindType.
2253         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2254         is in charge of defining nested types on demand.
2255         (DeclSpace.LookupType): Use it when the current_type is a
2256         TypeBuilder.  Use LookupTypeDirect for reflected types.
2257         (DeclSpace.FindType): Remove.
2258         (DeclSpace.LookupInterfaceOrClass): Likewise.
2259         (DeclSpace.DefineTypeAndParents): Likewise.
2260         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2261         DeclSpace.LookupType.
2262         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2263         * typemanager.cs (LookupType): Simplify.
2264         (AddUserType): Remove type from negative_hits.
2265         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2266         * class.cs (TypeContainer.FindMembers): Move handling of nested
2267         types ...
2268         (TypeContainer.FindMembers_NestedTypes): ... here.
2269         (TypeContainer.FindNestedType): Implement override.
2270         (ClassPart.FindNestedType): Delegate to PartialContainer.
2271         (ClassPart.PartFindNestedType): Looks up the nested types of the
2272         part alone.
2273
2274 2005-04-14  Martin Baulig  <martin@ximian.com>
2275
2276         * generic.cs (ConstructedType): Moved all the type lookup and
2277         nested class logic into SimpleName.
2278         (ConstructedType.ResolveConstructedType): Our underlying type is
2279         already fully resolved; all the type lookup stuff is in
2280         SimpleName.
2281
2282         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2283         constructed types here instead of in ConstructedType.
2284
2285         * decl.cs (MemberName.GetTypeExpression): Always create a
2286         SimpleName, not a ConstructedType.
2287         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2288
2289 2005-03-02  Martin Baulig  <martin@ximian.com>
2290
2291         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2292         static constructor in static classes.
2293
2294 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2295
2296         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2297         sizeParamIndex is not specified.
2298
2299 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2300
2301         Fix #73117
2302         * report.cs (WarningMessage.IsEnabled): Missing null check.
2303
2304 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2305
2306         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2307         in the fields and not in the properties.
2308
2309 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2310
2311         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2312         fields as well.
2313
2314 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2315
2316         * attribute.cs: Small refactoring (improved robustness).
2317         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2318         (ValidateGuid): Removed.
2319         (Resolve): Removed referenced to above mentioned.
2320         (GetAttributeUsage): Made private and changed to work without
2321         class assistance.
2322         (GetIndexerAttributeValue): Don't crash.
2323         (GetConditionalAttributeValue): Ditto.
2324         (GetClsCompliantAttributeValue): Ditto.
2325         (ExtractSecurityPermissionSet): All attributes exceptions are
2326         error 648.
2327         (GetPropertyValue): New helper.
2328         (GetMethodImplOptions): New method.
2329         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2330         some missing properties.
2331         
2332         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2333         (Method.ApplyAttributeBuilder): Updated.
2334         
2335         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2336         exception.
2337
2338 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2339
2340         Fix #73052.
2341         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2342         non-simple types (array, pointer, reference).
2343
2344 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2345
2346         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2347
2348         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2349         for operators.
2350         (Method.CheckBase): Catch wrong destructor here.
2351         (MethodData.Define): Add errors 550, 668.
2352
2353         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2354
2355         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2356
2357         * pending.cs (VerifyPendingMethods): Add error 551.
2358
2359         * typemanager.cs (CSharpName): Next error report helper.
2360
2361 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2362
2363         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2364         attributes. Removed useless attribute double check.
2365         It saves almost 2MBs for corlib.
2366
2367 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2368
2369         Fix #72924.
2370         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2371         called twice in case of error.
2372
2373 2005-02-23  Chris Toshok  <toshok@ximian.com>
2374
2375         Fix compiler portions of #72827.
2376         * statement.cs (Block.Emit): call Begin/EndScope on the
2377         EmitContext instead of the ILGenerator.
2378
2379         * codegen.cs (EmitContext.BeginScope): new method, call
2380         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2381         we have one.)
2382         (EmitContext.BeginScope): same, but EndScope and CloseScope
2383
2384         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2385         offset and call the superclass's OpenScope(int) with it.
2386         (SymbolWriter.CloseScope): get the current il
2387         offset and call superclass's CloseScope(int) with it.
2388
2389 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2390
2391         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2392         CS1677 for out and ref as well.
2393
2394         * class.cs (Method.Define): Add error CS1599 detection.
2395         
2396         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2397         
2398         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2399         
2400         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2401         
2402         * support.cs.cs (ModifierDesc): New helper method.
2403
2404 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2405             Abin Thomas  <projectmonokochi@rediffmail.com>
2406             Anoob V E  <projectmonokochi@rediffmail.com>
2407             Harilal P R  <projectmonokochi@rediffmail.com>
2408
2409         Fix #57851, #72718.
2410         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2411         MemberLookup (used for error reporting) actually returns a result.
2412         Fix error report number (122, not 112).
2413
2414 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2415             Anoob V E  <projectmonokochi@rediffmail.com>
2416             Harilal P R  <projectmonokochi@rediffmail.com>
2417
2418         Fix #71134.
2419         * pending.cs (PendingImplementation.GetAbstractMethods):
2420         Find NonPublic members too.
2421
2422 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2423
2424         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2425         Fixed error 217.
2426         
2427         * class.cs (MethodCore.CheckMethodAgainstBase):
2428         Add error 239 report.
2429
2430 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2431
2432         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2433         
2434         * class.cs (Operator.Define): Add error 217 report.
2435         
2436 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2437
2438         Fix #68955.
2439         * expression.cs (Invocation.IsApplicable): Make public.
2440         (Invocation.IsParamsMethodApplicable): Likewise.
2441         * delegate.cs (Delegate.VerifyApplicability): Don't use
2442         Invocation.VerifyArgumentCompat for parameter applicability
2443         testing.  Use Invocation.IsApplicable and
2444         Invocation.IsParamsMethodApplicable.
2445
2446 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2447
2448         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2449         
2450         * class.cs (Operator.Define): Add error 217 report.
2451         
2452 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2453
2454         * namespace.cs (UsingEntry.Resolve): Undo change below.
2455
2456 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2457
2458         Fix #72756.
2459         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2460         disable the error message when the extended MemberLookup also
2461         fails.
2462         (Expression.MemberLookupFinal): Update.
2463         (SimpleName.DoSimpleNameResolve): Update.
2464         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2465         Don't use MemberLookupFinal.
2466         (New.DoResolve): Update.
2467         (BaseAccess.CommonResolve): Update.
2468
2469 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2470
2471         Fix #72732.
2472         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2473         occured previously, don't resolve again.
2474
2475 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2476
2477         Fix #69949
2478         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2479         argument. Call ResolveAttributeUsage for unresolved.
2480         when types doesn't match ctor arguments.
2481         
2482         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2483         for nested attribute classes.
2484         (Class.attribute_usage): Removed.
2485         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2486         for attribute class.
2487         
2488         * ecore.cs (IsAttribute): Removed.
2489         
2490         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2491         
2492         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2493         now normal types.
2494         (attribute_types): Removed.
2495         (EmitCode): Global attributes are emited as the latest.
2496
2497 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2498
2499         * class.cs (EmitFieldInitializers): Don't emit field initializer
2500         for default values when optimilization is on.
2501         
2502         * constant.cs (Constant.IsDefaultValue): New property.
2503         
2504         * driver.cs: Add /optimize handling.
2505         
2506         * constant.cs,
2507         * ecore.cs,
2508         * literal.cs: Implement new IsDefaultValue property.
2509         
2510         * rootcontext.cs (Optimize): New field, holds /optimize option.
2511
2512 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2513
2514         Fix crasher in re-opened #72347.
2515         * namespace.cs (Namespace.Lookup): Return null if
2516         DeclSpace.DefineType returns null.
2517
2518         Fix #72678.
2519         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2520
2521 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2522
2523         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2524         now returns null if it cannot resolve to an lvalue.
2525         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2526         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2527         returned null.  Remove check for SimpleName.
2528         (EventExpr.DoResolveLValue): New.
2529         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2530         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2531         error from ...
2532         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2533         avoid CS0131 error.
2534         (Unary.ResolveOperator): Move CS0211 check ...
2535         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2536         CS0131 error.
2537         (Unary.DoResolveLValue): Simplify.
2538         (AddressOf.DoResolveLValue): New.
2539         (ArrayAccess.DoResolveLValue): New.
2540
2541 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2542
2543         * attribute.cs (Attribute.Resolve): Add arguments casting for
2544         when types doesn't match ctor arguments.
2545
2546 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2547
2548         Fix parts of #63202.
2549         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2550         lookup of operator in base type.  Ensure that all checks happen
2551         when the operator resolves to an "op_..." method.
2552
2553 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2554
2555         Fix #71992.
2556         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2557         'ignore_cs0104' parameter.  Pass it to ...
2558         (NamespaceEntry.Lookup): ... this.
2559         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2560         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2561         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2562         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2563         Update.  Request that cs0104 errors be ignored.
2564         (ComposedCast.ResolveAsTypeStep): Update.
2565
2566 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2567
2568         Fix #59209.
2569         * expression.cs (Invocation.BetterFunction): Remove support for
2570         comparing virtual functions and their overrides.
2571         (Invocation.IsOverride): New.
2572         (Invocation.OverloadResolve): Don't consider 'override' functions
2573         during candidate selection.  Store them in a lookaside list.
2574         If the selected method is a 'virtual' function, use the list to
2575         find any overrides that are closer to the LHS type.
2576
2577 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2578
2579         * expression.cs (New.DoResolve): Add complex core type reduction.
2580         (New.Constantify): Converts complex core type syntax like 'new int ()'
2581         to simple constant.
2582         
2583 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2584
2585         * decl.cs (EntryType.EntryType): New constructor to create an
2586         updated copy of a cache entry.
2587         (MemberCache.AddMethods): Use it.
2588         (MemberCache.ClearDeclaredOnly): Remove.
2589         (MemberCache.MemberCache): Update.
2590
2591 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2592
2593         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2594         variable.  This one is represents the actual low-level declaration
2595         of the method, as opposed to the semantic level `IsStatic'.   
2596
2597         An anonymous method which is hosted into a static method might be
2598         actually an instance method.  IsStatic would reflect the
2599         container, while MethodIsStatic represents the actual code
2600         generated.
2601
2602         * expression.cs (ParameterReference): Use the new MethodIsStatic
2603         instead of IsStatic.
2604
2605         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2606         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2607         set on the current EmitContext. 
2608
2609         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2610         resolve our casted expression as an LValue.  This triggers the
2611         proper LValue processing that is later required by Assign.
2612
2613         This fixes 72347.
2614
2615         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2616
2617 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2618
2619         C# 2.0 Fixed buffer implementation
2620
2621         * anonymous.cs: Update after RegisterHelperClass renaming.
2622
2623         * attribute.cs (AttributeTester.fixed_buffer_cache):
2624         Cache of external fixed buffers.
2625         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2626         implementation if field is fixed buffer else null.
2627
2628         * class.cs
2629         (TypeContainer.AddField): Accept FieldMember instead of Field.
2630         (FieldBase.IsFieldClsCompliant): Extracted code from
2631         VerifyClsCompliance descendant customization.
2632         (FixedField): New class handles fixed buffer fields.
2633         (FixedFieldExternal): Keeps information about imported fixed
2634         buffer.
2635         (IFixedField): Make access to internal or external fixed buffer
2636         same.
2637
2638         * cs-parser.jay: Add fixed buffer parsing.
2639
2640         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2641         buffer.
2642
2643         * expression.cs (Indirection): Extended implementation to accept
2644         fixed buffer field.
2645         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2646         (ElementAccess.MakePointerAccess): Get type as parameter.
2647         (DoResolve): Add fixed buffer field expression conversion.
2648         (DoResolveLValue): Ditto.
2649         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2650         (ArrayPtr): Derives from FixedBufferPtr.
2651         (ArrayPtr.Emit): Add extra emit for array elements.
2652
2653         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2654
2655         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2656         for compiler generated types.
2657         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2658
2659         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2660         and consume less memory.
2661         (Fixed.Resolve): Add fixed buffer case.
2662
2663         * typemanager.cs (compiler_generated_attr_ctor,
2664         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2665         (HasElementType): Add our own implementation to work on every
2666         runtime.
2667
2668 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2669
2670         * anonymous.cs (CaptureContext): Track whether `this' has been
2671         referenced.   
2672
2673         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2674         only captured `this' if it was implicitly done (instance
2675         methods/variables were used). 
2676
2677         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2678         `this' must be captured.
2679
2680 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2681  
2682         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2683         is null it means that there has been no need to capture anything,
2684         so we just create a sibling.
2685
2686         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2687
2688         Just a partial fix.  The other half is fairly elusive.
2689         
2690 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2691
2692         Fix #52586, cs0121-4.cs.
2693         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2694         and return a hashtable.
2695         (MemberCache.ClearDeclaredOnly): New.
2696         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2697         the method_hash of a base type too.
2698         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2699         type methods.  Overwrite entries with the same MethodHandle so
2700         that the ReflectedType is correct.  The process leaves in base
2701         virtual functions and their overrides as distinct entries.
2702         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2703         matters since it was boxed in a ArrayList before.
2704         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2705         modifier.
2706         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2707         case of a virtual function and its override (choose the overload
2708         as better).
2709         (Invocation.OverloadResolve): Avoid 'override' members during
2710         'applicable_type' calculation.
2711
2712 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2713
2714         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2715         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2716         GetTypeHandle.  It is possible for a reflected type to derive from
2717         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2718         System.Array during mscorlib compilation).
2719         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2720         contain a method_hash, don't create one either.  Don't create a
2721         deep copy of the base cache's method_hash.
2722         (MemberCache.SetupCache): Rename back from DeepCopy.
2723         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2724         already initialized.  If we see an override function, add its
2725         underlying base virtual function to the member_hash too.
2726
2727 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2728
2729         Combine two near-redundant caches.
2730         * typemanager.cs (method_params): Rename from method_internal_params.
2731         (TypeManager.GetParameterData): New.  Replace
2732         Invocation.GetParameterData.
2733         (TypeManager.LookupParametersByBuilder): Remove.
2734         * expression.cs (Invocation.method_parameter_cache): Remove.
2735         (Invocation.GetParameterData): Remove.
2736         Update to changes.
2737         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2738         Update to changes.
2739
2740 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2741
2742         Fix #72015.
2743         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2744         TypeManager.multicast_delegate_type is null, resolve it by looking
2745         up "System.MulticastDelegate".
2746         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2747
2748 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2749             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2750             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2751
2752         Fix cs0164.cs.
2753         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2754         (LabeledStatement.AddReference): New.  Set 'referenced'.
2755         (Goto.Resolve): Use it.
2756
2757 2005-02-05  John Luke  <john.luke@gmail.com>
2758
2759         * driver.cs: remove duplicate -doc line in Usage ()
2760
2761 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2762
2763         * location.cs (Location.AddFile): Fix CS2002 error report.
2764
2765 2005-02-02  Martin Baulig  <martin@ximian.com>
2766
2767         * delegate.cs (Delegate.DefineType): Report an internal error if
2768         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2769         details.        
2770
2771 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2772
2773         Fix a crasher in a variant of #31984.
2774         * const.cs (Constant.CheckBase): New override that defers the
2775         new-or-override check in case the base type hasn't been populated
2776         yet.
2777         (Constant.Define): Ensure the new-or-override check is performed.
2778
2779 2005-02-01  Duncan Mak  <duncan@ximian.com>
2780
2781         * const.cs (LookupConstantValue): Check that `ce' is not null
2782         before calling GetValue ().
2783
2784 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2785
2786         Fix test-334.cs (#69519).
2787         * cs-parser.jay (using_alias_directive): Pass in an expression to
2788         NamespaceEntry.UsingAlias.
2789         (using_namespace_directive): Pass in an expression to
2790         NamespaceEntry.Using.
2791         (namespace_name): Don't flatten to a string.
2792         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2793         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2794         ResolveAsTypeStep.
2795         (NamespaceEntry.UsingEntry): Likewise.
2796         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2797         changes.
2798         (NamespaceEntry.LookupForUsing): Remove.
2799         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2800         names.
2801         (NamespaceEntry.Lookup): Remove support for dotted names.
2802
2803 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2804
2805         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2806         split into two.
2807         (NamespaceEntry.ImplicitParent): Compute on demand.
2808         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2809         parallels the current.
2810         (NamespaceEntry.LookupForUsing): Use it.
2811         (NamespaceEntry.Lookup): If the current namespace-entry is
2812         implicit, don't search aliases and using tables.
2813
2814 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2815
2816         Fix #31984.
2817         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2818         BaseCache here.
2819         (TypeContainer.BaseCache): Compute on demand.
2820         (TypeContainer.FindMembers): Define constants and types if they're
2821         not already created.
2822         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2823         check.
2824         * const.cs (Constant.Define): Make idempotent.
2825
2826 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2827
2828         * pending.cs: Produce better code (no nops produced by using Ldarg
2829         + value).
2830         
2831         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2832         i - 1' it should be arg + 1.
2833
2834         Fixes bug #71819.
2835
2836 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2837
2838         * attribute.cs (Attribute.CheckAttributeType): Make private
2839         non-virtual.
2840         (Attribute.ResolveType): Make virtual.
2841         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2842         handling of RootContext.Tree.Types.
2843
2844 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2845
2846         Update attribute-handling to use the SimpleName/MemberAccess
2847         mechanisms.
2848         * cs-parser.jay (attribute): Pass in an expression to the
2849         constructors of Attribute and GlobalAttribute.
2850         * attribute.cs (Attribute): Take an expression for the name.
2851         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2852         passed in attribute name expression.
2853         (Attribute.CheckAttributeType): Use it.
2854         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2855         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2856         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2857         argument to prevent error messages if the lookup fails.
2858
2859 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2860
2861         * expression.cs (Indirection): Implemented IVariable interface
2862         to support indirection in AddressOf operator.
2863         (PointerArithmetic.Emit): Add optimalization for case where
2864         result can be precomputed.
2865
2866 2005-01-26  Martin Baulig  <martin@ximian.com>
2867
2868         * class.cs (TypeContainer.AttributeTargets): Return the correct
2869         AttributeTargets depending on our `Kind' instead of throwing an
2870         exception; fixes #71632.
2871
2872 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2873
2874         Fix #71257
2875         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2876         constant members.
2877
2878 2005-03-17  Martin Baulig  <martin@ximian.com>
2879
2880         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2881         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2882
2883 2005-03-17  Martin Baulig  <martin@ximian.com>
2884
2885         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2886         to bool so we can return an error condition.
2887         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2888         returned an error.
2889
2890 2005-03-17  Martin Baulig  <martin@ximian.com>
2891
2892         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2893
2894         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2895         converting from an array-type of T to `IEnumerable<T>'.
2896
2897 2005-03-16  Martin Baulig  <martin@ximian.com>
2898
2899         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2900         (Nullable.LiftedUnaryMutator): New public class.
2901
2902         * expression.cs (UnaryMutator.DoResolve): Added support for
2903         Nullable Types.
2904
2905 2005-03-14  Martin Baulig  <martin@ximian.com>
2906
2907         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2908
2909 2005-03-14  Martin Baulig  <martin@ximian.com>
2910
2911         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2912         the comparision operators `<', `>', `<=' and `>='.
2913
2914 2005-03-13  Martin Baulig  <martin@ximian.com>
2915
2916         * generic.cs
2917         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2918         avoid confusion with the `NullLiteral'.
2919         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2920
2921 2005-03-13  Martin Baulig  <martin@ximian.com>
2922
2923         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2924         comparing arbitrary types with the null literal.
2925
2926 2005-03-13  Martin Baulig  <martin@ximian.com>
2927
2928         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2929         boolean operators '&&', '||', '&' and '|'.
2930         (Nullable.OperatorTrueOrFalse): New public class.
2931
2932         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2933         instead of a `StaticCallExpr'; added support for nullables.
2934
2935 2005-03-10  Martin Baulig  <martin@ximian.com>
2936
2937         * expression.cs
2938         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2939         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2940
2941 2005-03-07  Martin Baulig  <martin@ximian.com>
2942
2943         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2944         it work if `expr' is not an IMemoryLocation.
2945         (Nullable.Lifted): Implement IMemoryLocation.
2946         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2947         target type.
2948
2949 2005-03-05  Martin Baulig  <martin@ximian.com>
2950
2951         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2952         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2953         (Nullable): Added support for lifted unary and binary operators.
2954
2955         * expression.cs (Unary.DoResolve): Added support for nullable types.
2956         (Binary.DoResolve): Likewise.
2957         (Conditional.DoResolve): Likewise.
2958
2959 2005-03-02  Martin Baulig  <martin@ximian.com>
2960
2961         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2962
2963         * class.cs (ClassPart.SetParameterInfo): Override this.
2964         (PartialContainer.SetParameterInfo): Override this.
2965         (TypeContainer.CheckConstraints): New protected method.
2966         (PartialContainer.CheckConstraints): Override this and check
2967         whether the same contraints were specified in all parts of a
2968         partial generic type definition.
2969         (PartialContainer.UpdateConstraints): New public method.
2970
2971         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2972
2973 2005-03-02  Martin Baulig  <martin@ximian.com>
2974
2975         Committing a patch from Carlos Alberto Cortez to fix #72887.
2976
2977         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2978         casts from `T []' to `int []'.
2979
2980 2005-03-02  Martin Baulig  <martin@ximian.com>
2981
2982         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2983
2984         * expression.cs (Binary.ResolveOperator): When resolving a
2985         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2986         `=='.  Fixes #71866.  See gen-127.cs.
2987
2988 2005-03-02  Martin Baulig  <martin@ximian.com>
2989
2990         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2991         static constructor in static classes.
2992
2993 2005-03-02  Martin Baulig  <martin@ximian.com>
2994
2995         * generic.cs
2996         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2997         (Nullable.LiftedConversion): Added support for user-defined
2998         conversions.
2999
3000         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3001
3002         * cs-parser.jay: Use ComposedCast everywhere instead of
3003         NullableType, so we don't need to check for NullableType
3004         everywhere.
3005         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3006         case where we'll be resolved into a `parenthesized_expression_0'
3007         afterwards.
3008
3009         * convert.cs
3010         (Convert.UserDefinedConversion): Added nullable conversions.
3011
3012 2005-02-28  Martin Baulig  <martin@ximian.com>
3013
3014         * generic.cs (TypeManager.IsNullableType): New static method.
3015         (Nullable): New abstract class.
3016         (Nullable.NullLiteral): New public class.
3017         (Nullable.LiftedConversion): New public class.
3018
3019         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3020         `builtin_types opt_nullable'.
3021
3022         * convert.cs
3023         (Convert.ImplicitConversionStandard): Added nullable conversions.
3024         (Convert.ExplicitConversionStandard): Likewise.
3025         (Convert.ExplicitConversion): Likewise.
3026
3027 2005-02-26  Martin Baulig  <martin@ximian.com>
3028
3029         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3030         begin with a "?", for instance "?[]".  Don't do a type lookup if
3031         `dim' is empty.
3032
3033 2005-02-25  Martin Baulig  <martin@ximian.com>
3034
3035         The first part of Nullable Types :-)
3036
3037         * generic.cs (NullableType): New public class.
3038         (NullCoalescingOperator): New public class.
3039         (TypeArguments.Resolve): Add a CS0306 check.
3040
3041         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3042         (opt_nullable): New rule.
3043         (type): Added `opt_nullable' to `namespace_or_type_name',
3044         `builtin_types' and `pointer_type'.
3045         (array_type): Added `opt_nullable'.
3046         (opt_rank_specifier_or_nullable): New rule; this is the
3047         combination of `opt_rank_specifier' and `opt_nullable'.
3048         (opt_error): New rule; catch errors here.
3049         (nullable_type_or_conditional): New rule; we use this to check for
3050         nullable and still detect the conditional operator.
3051         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3052         instead `opt_rank_specifier'.
3053
3054         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3055         for nullables.
3056
3057 2005-02-24  Martin Baulig  <martin@ximian.com>
3058
3059         * README, README.Changes: Removed; they're old and obsolete.
3060
3061 2005-02-22  Martin Baulig  <martin@ximian.com>
3062
3063         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3064         returned an error, set `constraints' to null to avoid a crash
3065         later on.
3066         (TypeParameter.ResolveType): Likewise.
3067
3068 2005-02-22  Martin Baulig  <martin@ximian.com>
3069
3070         * generic.cs
3071         (Constraints.ResolveTypes): Protect against being called twice.
3072         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3073         (TypeParameter.ResolveType): New public method; calls
3074         constraints.ResolveTypes().
3075         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3076         into the new ResolveType().
3077         (GenericMethod.Define): Call ResolveType() on all our
3078         TypeParameter's.        
3079
3080 2005-02-21  Martin Baulig  <martin@ximian.com>
3081
3082         * generic.cs
3083         (TypeManager.generic_nullable_type): New static public field.
3084         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3085
3086         * rootcontext.cs
3087         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3088
3089 2005-02-15  Martin Baulig  <martin@ximian.com>
3090
3091         * generic.cs (ConstructedType.Constraints): Correctly check
3092         constraints if the argument type is a type parameter; fixes
3093         #72326. 
3094
3095 2005-02-02  Martin Baulig  <martin@ximian.com>
3096
3097         * delegate.cs (Delegate.DefineType): Report an internal error if
3098         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3099         details.        
3100
3101 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3102
3103         * pending.cs: Produce better code (no nops produced by using Ldarg
3104         + value).
3105         
3106         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3107         i - 1' it should be arg + 1.
3108
3109         Fixes bug #71819.
3110         
3111 2005-01-26  Martin Baulig  <martin@ximian.com>
3112
3113         * cs-parser.jay (indexer_declarator): Don't report an error if we
3114         have type parameters since we can be an explicit interface
3115         implementation; fixes #71449.
3116
3117 2005-01-26  Martin Baulig  <martin@ximian.com>
3118
3119         * class.cs (TypeContainer.AttributeTargets): Return the correct
3120         AttributeTargets depending on our `Kind' instead of throwing an
3121         exception; fixes #71632.
3122
3123 2005-01-26  Martin Baulig  <martin@ximian.com>
3124
3125         * delegate.cs (Delegate.DefineType): Correctly define our type
3126         parameters.  Fixes #71483.
3127
3128 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3129
3130         Fix #71602.
3131         * expression.cs (MemberAccess.DoResolve): Don't complain with
3132         cs0572 when the LHS of a member access has identical name and type
3133         name.
3134
3135 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3136
3137         Fix #71651, #71675
3138         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3139         CreatePermission.
3140         Create custom PermissionSet only for PermissionSetAttribute.
3141
3142 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3143
3144         Fix #71649
3145         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3146         delegates in static class.
3147
3148 2005-01-24  Martin Baulig  <martin@ximian.com>
3149
3150         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3151         merging an implicit block, just use its reachability.
3152
3153         * statement.cs (Block.Resolve): Make the unreachable code check
3154         work wrt. implicit blocks; see test-337 from #63842.
3155
3156 2005-01-21  Alp Toker  <alp@atoker.com>
3157  
3158         * cs-parser.jay: destructor_declaration's container is PartialContainer
3159         not Class when partial types are used, so use Kind prop instead of
3160         'is'.
3161         
3162 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3163
3164         * cs-parser.jay: Improve error reporting when an interface
3165         declares new types.
3166
3167 2005-01-20  Dick Porter  <dick@ximian.com>
3168
3169         * support.cs: SeekableStreamReader fix from Sandor Dobos
3170         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3171         chars are read.  Fixes bug 70369.
3172
3173 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3174
3175         * cs-parser.jay (catch_clause): Simplify current_block handling
3176         somewhat.
3177
3178 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3179
3180         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3181         code with ImplicitStandardConversion to handle the implicit
3182         conversion of method groups into valid delegate invocations. 
3183
3184         The problem is that in parameter handling we were using this code
3185         path.  Fixes bug #64698
3186
3187 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3188
3189         * cs-parser.jay: Fix several infelicities.
3190         - Avoid assigning to the parser value stack.  Code like 
3191           '$3 = null' is unclean.  Synthesize a value for the code block
3192           instead. 
3193         - Avoid using oob_stack for storing location information.  Use ...
3194         (_mark_): ... this.  New (empty) rule.  Saves the current location
3195         in $$.
3196         (foreach_statement): Avoid using oob_stack for current_block
3197         handling.  Use technique used in for_statement and
3198         using_statement.  Synthesize a value for the code block to store
3199         additional intermediate information.
3200
3201 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3202
3203         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3204         of a different type is only allowed to private fields of a
3205         containing type, not on fields of a base class.
3206
3207         See test-174.cs and error cs0122-9.cs
3208
3209 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3210
3211         Fix test-335.cs (bug #58126).
3212         * cs-parser.jay (argument): Split out non-expression parts of the
3213         rule into 'non_simple_argument'.
3214         (invocation_expression): Support parenthesized invocations with
3215         multiple arguments, and with single non-simple arguments.
3216
3217 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3218
3219         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3220         places.
3221
3222 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3223
3224         Fix cs0038-1.cs, cs1640-6.cs.
3225         * ecore.cs (Expression.Resolve): Remove special-case for
3226         SimpleName in error-handling.
3227         (Expression.almostMatchedMembers): Relax access permission to
3228         protected.
3229         (Expression.MemberLookupFailed): Handle duplicates in
3230         almostMatchedMembers list.
3231         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3232         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3233         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3234         overload if the passed in MemberInfo is a MethodBase.
3235
3236 2005-01-25  Martin Baulig  <martin@ximian.com>
3237
3238         * doc.cs
3239         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3240
3241 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3242
3243         Fix #70749
3244         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3245         for non-CAS & merge permission sets properly.
3246
3247 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3248
3249         Improve standard-compliance of simple name and member access 
3250         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3251         * ecore.cs (FullNamedExpression): New abstract base class 
3252         for Namespaces and TypeExpressions.
3253         (ResolveFlags.SimpleName): Remove.
3254         (SimpleName): Remove support for dotted names.
3255         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3256         DeclSpace.FindType and DeclSpace.LookupType.
3257         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3258         (Expression.ExprClassName): Make member function.
3259         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3260         a namespace.  Remove creation of dotted "SimpleName"s.
3261         (MemberAccess.DoResolve): Likewise.
3262         * decl.cs (DeclSpace.Cache): Make private.
3263         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3264         (DeclSpace.FindType): Update.
3265         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3266         FullNamedExpression.
3267         * namespace.cs (Namespace): Derive from FullNamedExpression
3268         so that it can be part of expression resolution.
3269         (Namespace.Lookup): Return an FullNamedExpression.
3270         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3271         namespace.
3272         * rootcontext.cs (NamespaceLookup): Remove.
3273         (LookupType): Move to DeclSpace.
3274         * attribute.cs (CheckAttributeType): Update.
3275         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3276         (FindDocumentedTypeNonArray): Likewise.
3277
3278 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3279
3280         Fix cs0509.cs, cs1632.cs.
3281         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3282         is the same as IsInterface.
3283         (TypeContainer.GetClassBases): Likewise.
3284         * statement.cs (LabeledStatement.ig): New field.
3285         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3286         label.
3287         (LabeledStatement.DoEmit): Check that the label was created with
3288         the same ILGenerator.
3289
3290 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3291
3292         Fix #71058
3293         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3294         accessors to its properties.
3295
3296         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3297         from accessors to property.
3298         
3299 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3300
3301         Fix #70722
3302         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3303         only for overrides.
3304         
3305 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3306
3307         * attribute.cs: Check for null and empty strings.  
3308
3309         I have lost another battle to Paolo.
3310
3311 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3312
3313         Fix #70942
3314         * class.cs (PropertyMethod): Set Parent field in ctors.
3315         (SetMethod.InternalParameters): Add unsafe switch hack.
3316         Override MarkForDuplicationCheck where it is appropriate.
3317
3318         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3319         It says whether container allows members with the same name.
3320         Base default is no.
3321         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3322         Removed is_method parameter.
3323
3324 2005-01-06  Duncan Mak  <duncan@ximian.com>
3325
3326         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3327         because the previous change led to incorrect reporting of CS1032
3328         ("Cannot define/undefine preprocessor symbols after first token in
3329         file"). Instead of using `tokens_seen' as the only flag that
3330         triggers CS1040, introduce `comments_seen'. This new flag is used
3331         to signify having seen comments on the current line, so it is
3332         unset after a newline.
3333
3334 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3335
3336         * doc.cs : When searching for a type, find nested type too.
3337           This fixes bug #71040.
3338
3339 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3340
3341         * doc.cs :
3342           - Warn missing member comment on those classes which also does not
3343             have doc comments. Fixed bug #71041.
3344           - Don't warn missing doc comment on default constructor.
3345             Fixed bug #71042.
3346
3347 2005-01-06  Duncan Mak  <duncan@ximian.com>
3348
3349         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3350         comments, set `tokens_seen' to true. This allows us to detect
3351         misplaced preprocessor directives (i.e. not at the beginning of
3352         the a line, nor after whitespaces). In that case, report error
3353         CS1040. This fixes bug #56460.
3354
3355         * cs-parser.jay (interface_member_declaration): Add checks for
3356         IsExplicitImpl, and report CS0541 error if an interface member is
3357         defined as an explicit interface declaration.
3358
3359 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3360
3361         Fix #70817
3362         * class.cs (PropertyMethod): Set Parent field in ctors.
3363         (SetMethod.InternalParameters): Add unsafe switch hack.
3364         
3365         * decl.cs (MemberCore.Parent): Cannot be readonly.
3366
3367 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3368
3369         * decl.cs (DeclSpace.ResolveType): Remove.
3370         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3371         Merge in code from ...
3372         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3373         * class.cs, enum.cs: Update to changes.
3374
3375 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3376
3377         * anonymous.cs: Ensure that we init the scope of our parent if it
3378         has not been initialized yet.
3379
3380 2004-12-30  Duncan Mak  <duncan@ximian.com>
3381
3382         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3383         if field.FieldBuilder is null. Fixes #70758.
3384
3385         * convert.cs: Fixed some typos and updated some of the comments.
3386         (ImplicitStandardConversionExists):
3387         (TryImplicitIntConversion): If `target_type' is an interface and
3388         the type of `ic' implements this interface, return true or a new
3389         BoxedCast instead of null. This fixes #70468.
3390
3391 2004-12-29  Duncan Mak  <duncan@ximian.com>
3392
3393         * expression.cs (Argument.Emit): Check that Expr is
3394         IMemoryLocation before casting to it, and report CS1510 otherwise.
3395
3396         This fixes #70402.
3397
3398 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3399
3400         * statement.cs (Block.ThisVariable): remove the recursion here, to
3401         make the --profile more sane.
3402
3403 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3404
3405         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3406         assembly, by JB Evain.
3407
3408 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3409
3410         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3411           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3412         "parent" refers to enclosing type/class.  "base" refers to superclass.
3413
3414 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3415
3416         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3417         Ensure that we only have GlobalAttributes.
3418         * attribute.cs (Attribute.Emit): Make non-virtual.
3419         (GlobalAttribute.Emit): Remove.
3420         (Attribute.Resolve): Make virtual.
3421         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3422         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3423         the argument. Don't create one.
3424         (Attribute.GetObsoleteAttribute): Likewise.
3425         (Attribute.GetClsCompliantAttributeValue): Likewise.
3426         * class.cs, decl.cs: Update to changes.
3427
3428 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3429
3430         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3431         
3432         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3433         
3434         * statement.cs (Foreach.Resolve): Add error 186 report.
3435
3436 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3437
3438         * expression.cs (Conditional.DoResolve): Add warning 429.
3439         
3440         * statement.cs (If.Resolve): Add warning 665.
3441
3442 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3443
3444         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3445         except when in the parser, and in GlobalAttribute.
3446         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3447         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3448         RootContext.Tree.Types.NamespaceEntry once work is done.
3449         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3450         and resets RootContext.Tree.Types.NamespaceEntry.
3451
3452 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3453
3454         * cs-parser.jay: Don't create a block for every variable.
3455
3456 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3457
3458         * location.cs: Provide extra information.
3459
3460         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3461         variables from the captured environment, it is the ldarg_0.
3462
3463 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3464
3465         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3466         find a conclusion.
3467         
3468         * class.cs: Changed warning level for 169 to avoid developer
3469         displeasure from warning flooding. It will be changed back when they
3470         fix most of current BCL warnings.
3471         
3472         * RootContext.cs: Pushed default WarningLevel to 3.
3473         
3474         * statement.cs: Removed unused variable.
3475
3476 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3477
3478         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3479         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3480         Add error 502 report.
3481         (StaticClass.DefineType): Add error 441 report.
3482         (Class.AllowedModifiersProp): New virtual property as temporary
3483         extension to AllowedModifiers.
3484         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3485         to share implementation with StaticClass and don't call virtual
3486         methods from ctor.
3487         
3488         * driver.cs (MainDriver): Add error 1558 test.
3489
3490         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3491         report. Moved error 36 test here.
3492
3493         * statement.cs (Throw.Resolve): Add error 724 report.
3494
3495         * typemanager.cs: Add out_attribute_type core type.
3496         
3497 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3498
3499         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3500         3018 report.
3501         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3502
3503         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3504         3017 report.
3505         
3506         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3507
3508         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3509         Add error 3023 report.
3510         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3511
3512         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3513         implementation.
3514
3515 2004-12-12  John Luke  <john.luke@gmail.com>
3516
3517         * driver.cs (AddArgs): take -- into account when
3518         adding arguments, fixes bug 65710 
3519
3520 2004-12-12  Martin Baulig  <martin@ximian.com>
3521
3522         * expression.cs (Unary.TryReduceNegative): Added support for
3523         SByteConstant and ByteConstant.
3524         (Unary.Reduce): Check error values from TryReduceNegative().
3525
3526 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3527
3528         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3529         and report exception as error 182.
3530
3531 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3532
3533         * driver.cs (Main): Fix message when there are warnings.
3534
3535 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3536
3537         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3538
3539 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3540
3541         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3542         Reduced number of warnings.
3543         
3544         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3545
3546 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3547
3548         * driver.cs: Removed message.
3549
3550         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3551
3552 2004-12-08    <vargaz@freemail.hu>
3553
3554         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3555
3556 2004-12-08  Martin Baulig  <martin@ximian.com>
3557
3558         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3559         instead of a CS3002 for properties and indexer.
3560
3561 2004-12-08  Martin Baulig  <martin@ximian.com>
3562
3563         * decl.cs (MemberName.ToString): Make this work again.
3564
3565 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3566
3567         * attribute.cs (Resolve): Add error 591 detection.
3568
3569         * class.cs (FieldMember.Define): Add error 1547 detection.
3570         (Indexer.Define): Add error 620 detection.
3571         (Operator.Define): Add error 590 detection.
3572
3573         * ecore.cs: Missing argument for error 79.
3574
3575         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3576         detection.
3577
3578 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3579
3580         Fix #70106
3581         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3582         only.
3583
3584 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3585
3586         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3587           Some operator comments were suppressed.
3588         * doc.cs : Implicit/explicit operator name in doc comments are like
3589           "op_Explicit(type)~returnType", so added suffix handling.
3590
3591 2005-01-21  Alp Toker  <alp@atoker.com>
3592
3593         * cs-parser.jay: destructor_declaration's container is PartialContainer
3594         not Class when partial types are used, so use Kind prop instead of 'is'.
3595
3596 2004-12-12  Martin Baulig  <martin@ximian.com>
3597
3598         * expression.cs (Unary.TryReduceNegative): Added support for
3599         SByteConstant and ByteConstant.
3600         (Unary.Reduce): Check error values from TryReduceNegative().
3601
3602 2004-12-11  Martin Baulig  <martin@ximian.com>
3603
3604         * support.cs (ReflectionParameters.ParameterName): If we have a
3605         `gpd', call `ParameterName' on it.
3606
3607         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3608
3609         * pending.cs (PendingImplementation.DefineProxy): Call
3610         DefineParameter() for all of the MethodBuilder's arguments.
3611
3612 2004-12-09  Martin Baulig  <martin@ximian.com>
3613
3614         * doc.cs (DocUtil): Make this a static class.
3615
3616 2004-12-09  Martin Baulig  <martin@ximian.com>
3617
3618         * expression.cs (Invocation.InferType): Moved the type inference
3619         implementation into TypeManager.
3620
3621         * generics.cs (TypeManager): Moved the type inference
3622         implementation here.
3623
3624 2004-12-09  Martin Baulig  <martin@ximian.com>
3625
3626         * typemanager.cs (TypeManager): Make this a partial class.
3627
3628         * generics.cs
3629         (TypeManager): Move the generics part of `TypeManager' here.
3630
3631 2004-12-08  Martin Baulig  <martin@ximian.com>
3632
3633         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3634         instead of a CS3002 for properties and indexer.  Added CS3024
3635         check for generic interfaces.
3636
3637         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3638         instances are not CLS-compliant.
3639
3640 2004-12-08  Martin Baulig  <martin@ximian.com>
3641
3642         * cs-parser.jay
3643         (void_pointer_expression): New rule for `void*', `void**' etc.
3644         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3645
3646 2004-12-08  Martin Baulig  <martin@ximian.com>
3647
3648         * expression.cs (Invocation.InferType): Removed the hack for
3649         MethodCore.MayUnify().  
3650
3651         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3652         this actually work.
3653
3654         * class.cs (MethodCore.MayUnify): Use
3655         TypeManager.MayBecomeEqualGenericTypes().       
3656
3657 2004-12-08  Martin Baulig  <martin@ximian.com>
3658
3659         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3660         parameter, box it.  Fixes #69233.
3661
3662 2004-12-08  Martin Baulig  <martin@ximian.com>
3663
3664         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3665         have the ctor constraint.  Fixes #68326.
3666
3667 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3668
3669         * cs-parser.jay : interface comment was not consumed because of
3670           extra opt_semicolon before doc handling.
3671
3672 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3673
3674         Fix test-327.cs, test-328.cs, and put in early infrastructure
3675         for eventually fixing #52697.
3676         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3677         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3678         from other methods.
3679         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3680         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3681         (VerifyUsing, error246): Update.
3682         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3683         'NamespaceEntry.LookupNamespaceOrType'.
3684
3685 2004-12-07  Martin Baulig  <martin@ximian.com>
3686
3687         * driver.cs: Call it "BETA SOFTWARE" :-)
3688
3689 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3690
3691         Fix crash on cs0657-17.cs.
3692         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3693         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3694         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3695         the case where the NamespaceEntry gets overwritten.
3696
3697 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3698
3699         Fixed #69195, #56821
3700         * ecore.cs (ResolveBoolean): Tiny refactoring.
3701
3702         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3703         of right expression resolving when left is false constant and
3704         operator is LogicalAnd OR true constant and operator is LogicalOr.
3705
3706         * statement.cs (ResolveUnreachable): Always reports warning.
3707
3708 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3709
3710         * class.cs: Distinguish between 1721 and 1722 (just a little help
3711         for the programmer).
3712
3713 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3714
3715         * delegate.cs: Only allow this on new versions of the language. 
3716
3717 2004-12-02  Duncan Mak  <duncan@ximian.com>
3718
3719         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3720         Expression class.
3721         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3722         here as a static method. Take an additional bool out parameter
3723         `must_do_cs1540_check' for signaling to InstanceResolve.
3724         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3725         member field from PropertyExpr class and made it an argument of
3726         the method instead.
3727         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3728         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3729         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3730         and `remove_accessor' as well as InstanceResolve: report CS0122
3731         where applicable.
3732
3733         Fixes #70129.
3734
3735 2004-12-07  Martin Baulig  <martin@ximian.com>
3736
3737         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3738         and CS0692 where appropriate.
3739
3740 2004-12-06  Martin Baulig  <martin@ximian.com>
3741
3742         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3743         IsDuplicateImplementation() and improved it.
3744
3745         * expression.cs (Invocation.InferTypeArguments): Added
3746         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3747         and removed the "ref" modifier from `infered_types'.
3748
3749         * decl.cs (MemberName.ToString): Removed the exception.
3750
3751 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3752
3753         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3754           comments are allowed.
3755
3756 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3757
3758         * delegate.cs: Add checks for subtypes in paramaters and return values
3759         in VerifyMethod () to add support for Covariance/Contravariance
3760         in delegates.
3761         
3762 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3763
3764         * report.cs: Remove extra closing parenthesis.
3765
3766         * convert.cs (Error_CannotImplicitConversion): If the name of the
3767         types are the same, provide some extra information.
3768
3769 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3770
3771         Fix bug #70102
3772         * attribute.cs (Resolve): Improved implementation of params
3773         attribute arguments.
3774
3775         * support.cs (ParameterData): Add HasParams to be faster.
3776
3777 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3778
3779         all things are for /doc support:
3780
3781         * doc.cs: new file that supports XML documentation generation.
3782         * mcs.exe.sources: added doc.cs.
3783         * driver.cs:
3784           Handle /doc command line option.
3785           Report error 2006 instead of 5 for missing file name for /doc.
3786           Generate XML documentation when required, after type resolution.
3787         * cs-tokenizer.cs:
3788           Added support for picking up documentation (/// and /** ... */),
3789           including a new XmlCommentState enumeration.
3790         * cs-parser.jay:
3791           Added lines to fill Documentation element for field, constant,
3792           property, indexer, method, constructor, destructor, operator, event
3793           and class, struct, interface, delegate, enum.
3794           Added lines to warn incorrect comment.
3795         * rootcontext.cs :
3796           Added Documentation field (passed only when /doc was specified).
3797         * decl.cs:
3798           Added DocComment, DocCommentHeader, GenerateDocComment() and
3799           OnGenerateDocComment() and some supporting private members for
3800           /doc feature to MemberCore.
3801         * class.cs:
3802           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3803         * delegate.cs:
3804           Added overriden DocCommentHeader.
3805         * enum.cs:
3806           Added overriden DocCommentHeader and GenerateDocComment().
3807
3808 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3809
3810         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3811         unwrapping the enumeration values, chain to
3812         DoConstantNumericPromotions again, so we can promote things to the
3813         fundamental types (takes care of enums that are bytes, sbytes).
3814
3815         Fixes bug #62054.
3816
3817 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3818
3819         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3820         Fix long-standing bug in type-lookup.  Use FindType instead of
3821         LookupType when ec.ResolvingTypeTree.
3822         (Attribute.ResolveType, Attribute.Resolve)
3823         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3824         Update to changes.
3825         (Attributes.Search): Remove internal version.  Update.
3826         (Attributes.SearchMulti): Update.
3827         (Attributes.GetClsCompliantAttribute): Remove.
3828         (Attributes.GetIndexerNameAttribute): Remove.
3829         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3830         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3831         * class.cs (Indexer.Define): Likewise.
3832
3833 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3834
3835         Fix bug #68790
3836         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3837         MarshallByReference members access.
3838
3839         * expression.cs: Use CheckMarshallByRefAccess;
3840         Better error CS0197 message.
3841
3842         * report.cs: Print whole related error message.
3843
3844 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3845
3846         * class (GetClassBases): Better error 60 report.
3847         (EventProperty): Disabled warning 67 detection.
3848
3849 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3850
3851         Fix bug #60324
3852         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3853
3854         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3855         precise values.
3856
3857 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3858
3859         Fix bug #49488
3860         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3861
3862         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3863
3864 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3865
3866         * attribute.cs (Attribute.Resolve): Refine error reporting and
3867         report a cs0117 if the identifier does not exist, to distinguish
3868         from 0617 which is a miss-use of the actual identifier.
3869
3870         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3871         between cs0070 and cs0079.
3872
3873         * class.cs (MemberBase.DoDefine): When reporting a wrong
3874         accessibility level, we use MethodCore to compare instead of
3875         Method (this was a regression in some refactoring effort).
3876
3877         So now we correctly report cs0056 again.
3878
3879         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3880         testing the target_type (which was known to be object_type) and
3881         not the source type (which is anonymous_method).
3882
3883         Fixed reporting of error cs1660.
3884
3885         * expression.cs (UserCast.Source): Expose the underlying cast.
3886
3887         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3888         allowed types to find a match to int32 first (most common).
3889
3890         In addition, it ignores any ImplicitUserConversions that did an
3891         internal implicit conversion (as the switch statement allows only
3892         one integral conversion to exist).
3893
3894         * class.cs (PartialContainer.Create): rename `name' to
3895         `member_name' for clarity.  Then replace the string calls with a
3896         call to MemberName.GetPartialName, as now using
3897         MemberName.ToString is an error (this is due to the side effects
3898         it had, that were fixed in the past).
3899
3900         This will restore the error reporting on a number of partial class
3901         errors that were missusing this (and getting an exception as a
3902         results, which is now just a plain textual warning, because
3903         yyparse debug output would crash otherwise).
3904
3905 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3906
3907         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3908
3909 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3910
3911         * rootcontext.cs (LookupType): Make sure to cache lookups that
3912         don't give us a negative result. This saves about 5% of corlib
3913         compilation time.
3914
3915 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3916
3917         * report.cs (AbstractMessage.Print): messages are sent to stderr
3918
3919         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3920         non-interface in the list of interfaces (at this point, either
3921         parent was properly set, or a base class is being listed in the
3922         interfaces section).
3923
3924         This flags error 1722, and resolves the crash from bug 69259.
3925
3926 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3927
3928         * statement.cs (Using.EmitExpressionFinally): make this work right
3929         for valuetypes. Fixes 69926.
3930
3931 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3932
3933         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3934         converted to an enum" here, before we try to change the underlying
3935         type.  This code exists, but it is a different code path than the
3936         one used while encoding constants.
3937
3938         (ImplicitReferenceConversionExists): In addition, resynchronized
3939         the code here, so it matches the same code in
3940         ImplicitReferenceConversionExists for the `from any class-type S
3941         to any interface-type T'.       
3942
3943 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3944
3945         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3946
3947 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3948
3949         * cs-parser.jay: Use verbosity accordingly. 
3950
3951 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3952
3953         * expression.cs (Unary.ResolveOperator): Do not report warning;
3954         AddressOf reads from variable.
3955         
3956         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3957
3958 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3959
3960         Fix bug #69462
3961
3962         * attribute.cs (Attributable): Removed CheckTargets.
3963         (Attributes.Emit): Explicit attribute targets are tested here.
3964
3965         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3966         not enabled for interfaces.
3967
3968         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3969         (GetAssemblyName): Ouch next bug there.
3970
3971 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3972
3973         * expression.cs: Error 275 added.
3974         
3975 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3976
3977         Fix bug #69177 (Implemented decimal constant support)
3978
3979         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3980         (BinaryFold): Add DecimalConstant.
3981
3982         * const.cs (Define): Decimal constant 
3983         (is not constant.
3984         (ChangeType): Add decimal type handling.
3985         (LookupConstantValue): Don't set value for decimal type but
3986         emit DecimalConstantAttribute. Needed for constant optimization.
3987
3988         * constant.cs (ToDecimal): New method.
3989         (ConvertToDecimal): New method.
3990         (IntConstant): Implemented ConvertToDecimal.
3991         (DecimalConstant.Emit): Emit optimized version for decimals in
3992         int range.
3993
3994         * expression.cs (ResolveOperator): Changed order of constant
3995         reduction to work correctly with native types which have
3996         overloaded operators.
3997         (ResolveMemberAccess): Extract constant value from attribute
3998         for decimal type.
3999
4000         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4001
4002         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4003         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4004         (ChangeType): Decimal is special.
4005         (TypeToCoreType): Add decimal type.
4006
4007 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4008
4009         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4010         decimal types.
4011
4012 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4013
4014         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4015         test cs1667-5.cs.
4016
4017 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4018
4019         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4020
4021         * pending.cs (PendingImplementation): Grab only interfaces.
4022
4023 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4024
4025         * statement.cs (ForeachHelperMethods): Add location member and
4026         error 202 detection.
4027
4028 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4029
4030         * expression.cs (DoResolveBase): Fixed wrong warning for out
4031         variables.
4032
4033 2004-12-04  Martin Baulig  <martin@ximian.com>
4034
4035         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4036         to check whether the conversion is ok.
4037
4038         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4039         `Type.EmptyTypes' if we're not a generic TypeContainer.
4040
4041 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4042
4043         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4044         old bug: when converting from the null literal to a pointer,
4045         return an EmptyCast, not the NullLiteral.
4046
4047         This fixes #69921, the recent null_type changes probably made this
4048         bug more prominent.
4049
4050 2004-12-03  Martin Baulig  <martin@ximian.com>
4051
4052         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4053         method as our child, call AnonymousMethod.Compatible() on it.
4054
4055 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4056
4057         * class.cs (FieldBase): Use an unused bit field from the field to
4058         encode the `has_offset' property from the FieldMember.  This saves
4059         a couple of Ks on bootstrap compilation.
4060
4061         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4062         method as our child, return the AnonymousMethod resolved
4063         expression.
4064
4065         * expression.cs (New.DoResolve): Allow return values from
4066         NewDelegate to also include AnonymousMethods.
4067
4068         Fixes #70150.
4069
4070 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4071
4072         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4073         cs1648 report.
4074         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4075         System.Runtime.InteropServices._Exception, since it's a base
4076         interface of the core type System.Exception in the net_2_0 profile.
4077
4078 2004-11-27  Martin Baulig  <martin@ximian.com>
4079
4080         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4081
4082 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4083
4084         * Makefile: Convert to use executable.make.
4085         * gmcs.exe.sources: New.
4086
4087 2004-11-25  Martin Baulig  <martin@ximian.com>
4088
4089         * expression.cs (Invocation.InferType): Added support for byref types.
4090
4091 2004-11-25  Martin Baulig  <martin@ximian.com>
4092
4093         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4094         in TypeManager.TypeToCoreType().
4095
4096 2004-11-25  Martin Baulig  <martin@ximian.com>
4097
4098         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4099         "Dispose" method from the `current_type'.
4100         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4101         DoDefineMembers() instead of using the MethodBuilder; this is
4102         required for generic iterators.
4103
4104         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4105
4106 2004-11-24  Martin Baulig  <martin@ximian.com>
4107
4108         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4109
4110 2004-11-20  Martin Baulig  <martin@ximian.com>
4111
4112         * expression.cs (Invocation.InferType): Correctly infer generic
4113         instances; see gen-103.cs.
4114         (Invocation.InferTypeArguments): If a generic method doesn't have
4115         any unbound type parameters, we don't need to infer anything.
4116
4117 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4118
4119         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4120
4121 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4122
4123         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4124         (TypeHandle.GetMemberCache): New.
4125         (TypeHandle.TypeHandle): Update.
4126         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4127         (TypeManager.LookupParentInterfacesCache):
4128         Rename from LookupInterfaceCache.  Optimize slightly.
4129         (TypeManager.MemberLookup_FindMembers): Update.
4130         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4131         multi-type variant.
4132         (AddCacheContents): Rename from AddHashtable.
4133         * class.cs (TypeContainer.parent_container): Remove.
4134         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4135         (TypeContainer.DoDefineMembers): Don't initialize it.
4136         Update to name changes.
4137         
4138 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4139
4140         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4141         that factors the code to check access modifiers on override.  
4142
4143         (PropertyBase): Use the code here.
4144
4145         Patch from Lluis S'anchez, fixes bug #69361.
4146
4147 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4148
4149         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4150         routine that is used to report the use of a captured variable
4151         whose address has been taken.
4152
4153         There are two checks: one when variables are being captured and
4154         the other check is when the address of a variable is taken. 
4155         
4156         (because an anonymous methods might be resolved before *or* after
4157         the address has been taken) and 
4158
4159         * expression.cs (Conditional.DoResolve): Remove the special
4160         casing that Martin added to trueExpr and falseExpr being both
4161         NullLiteral.  We get the right behavior now just by introducing
4162         the null_type into the compiler. 
4163
4164         * convert.cs (ExplicitConversion): Change the code to use
4165         null_type instead of testing `expr is NullLiteral'.
4166         (ImplicitConversionStandard): use null_type too.
4167         (ImplicitReferenceConversionExists): use null_type too.
4168         (ImplicitReferenceConversion): use null_type too.
4169
4170         * literal.cs: The type of `NullLiteral' is now null_type instead
4171         of object_type. 
4172         (Resolve): Set the type here.
4173
4174         * typemanager.cs: Introduce null_type.
4175
4176 2004-11-18  Martin Baulig  <martin@ximian.com>
4177
4178         * rootcontext.cs
4179         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4180
4181 2004-11-18  Martin Baulig  <martin@ximian.com>
4182
4183         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4184
4185 2004-11-18  Martin Baulig  <martin@ximian.com>
4186
4187         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4188         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
4189         call ResolveConstructedType() on it to resolve it without checking
4190         constraints.
4191         (Constraints.ResolveTypes): Check them here.
4192         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4193         but don't check constraints.
4194         (ConstructedType.ResolveAsTypeTerminal): Override this and also
4195         check constraints here.
4196         (ConstructedType.ResolveConstructedType): New public method.  This
4197         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4198         resolve ourselves without checking constraints.
4199
4200         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4201
4202 2004-11-18  Martin Baulig  <martin@ximian.com>
4203
4204         * decl.cs
4205         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4206
4207         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4208
4209 2004-11-18  Martin Baulig  <martin@ximian.com>
4210
4211         * ecore.cs (TypeExpr.ResolveType): Removed.
4212         (Expression.ResolveAsTypeTerminal): We always return a fully
4213         resolved `TypeExpr', so we can just access its `Type'.
4214
4215         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4216
4217 2004-11-17  Martin Baulig  <martin@ximian.com>
4218
4219         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4220         sure we don't return any unresolved TypeExpr's.
4221         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4222         a `TypeExpr'.
4223         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4224
4225         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4226         unresolved `ConstructedType's.
4227
4228 2004-11-17  Martin Baulig  <martin@ximian.com>
4229
4230         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4231
4232 2004-11-17  Martin Baulig  <martin@ximian.com>
4233
4234         * ecore.cs
4235         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4236
4237         * decl.cs (DeclSpace.ResolveType): Removed.
4238         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4239
4240 2004-11-17  Martin Baulig  <martin@ximian.com>
4241
4242         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4243         direction, like FindMembers() does.  Fixes #69546, testcase is in
4244         test-315.cs.    
4245
4246 2004-11-16  Martin Baulig  <martin@ximian.com>
4247
4248         This is based on a patch from Marek Safar, see bug #69082.
4249         Fixes bugs #63705 and #67130.
4250
4251         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4252         method; create a MemberCache for an interface type and cache the
4253         result.
4254
4255         * decl.cs (IMemberContainer.ParentContainer): Removed.
4256         (IMemberContainer.ParentCache): New property.
4257         (MemberCache.SetupCacheForInterface): Removed.
4258         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4259         to create a cache for an interface's "parent".
4260
4261         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4262         interfaces too.
4263
4264 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4265
4266         * statement.cs: Avoid adding bools to a hashtable.
4267
4268 2004-11-15  Martin Baulig  <martin@ximian.com>
4269
4270         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4271
4272 2004-11-11  Martin Baulig  <martin@ximian.com>
4273
4274         * typemanager.cs (TypeManager.GetMethodName): New method.
4275
4276         * class.cs (MethodData.Define): Include the generic arity in the
4277         name of an explicit interface; also add it to the method name.
4278
4279         * pending.cs (PendingImplementation.InterfaceMethod): The method
4280         name now includes the generic arity.
4281
4282 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4283
4284         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4285         calling an unsafe method from a safe location.
4286
4287 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4288
4289         Fix #69167
4290         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4291
4292 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4293
4294         * namespace.cs (VerifyUsing): use GetPartialName instead of
4295         ToString. 
4296
4297 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4298
4299         * statement.cs (Return.Resolve): Fix regression in typo: if
4300         `in_exc', we have to request a NeedReturnLabel, this was a typo
4301         introduced in the anonymous method check-in.  Fixes #69131.
4302
4303         * Indexers were using the ShortName when defining themselves,
4304         causing a regression in the compiler bootstrap when applying the
4305         patch from 2004-11-02 (first part), now they use their full name
4306         and the bug is gone.
4307
4308 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4309
4310         * driver.cs: Strip the path from the names of embedded resources. Fixes
4311         #68519.
4312
4313 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4314
4315         Fix error message regression: cs0104-2.cs.
4316         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4317         (AliasEntry.Resolve): Update.
4318         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4319         'silent' flag.
4320         (RootContext.LookupType): Update.
4321
4322 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4323
4324         * cs-parser.jay: Add support for handling accessor modifiers
4325         * class: Add support port accessor modifiers and error checking,
4326         define PropertyMethod.Define as virtual (not abstract anymore)
4327         * ecore.cs: Add checking for proeprties access with access modifiers
4328         * iterators.cs: Modify Accessor constructor call based in the modified
4329         constructor
4330 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4331
4332         * expression.cs (StringConcat): Handle being called twice,
4333         as when we have a concat in a field init with more than two
4334         ctors in the class
4335
4336 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4337
4338         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4339         special case explicit implementations, we should always produce
4340         the .property or .event declaration.
4341         
4342         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4343         since it will not return correct data if people use this
4344         unresolved in the presence of using statements (see test-313).
4345
4346         * class.cs (MethodData.Define): If we are an explicit interface
4347         implementation, set the method name to the full name of the
4348         interface plus the name of the method.  
4349
4350         Notice that using the method.MethodName.GetFullName() does not
4351         work, as it will only contain the name as declared on the source
4352         file (it can be a shorthand in the presence of using statements)
4353         and not the fully qualifed type name, for example:
4354
4355         using System;
4356
4357         class D : ICloneable {
4358                 object ICloneable.Clone ()  {
4359                 }
4360         }
4361
4362         Would produce a method called `ICloneable.Clone' instead of
4363         `System.ICloneable.Clone'.
4364
4365         * namespace.cs (Alias.Resolve): Use GetPartialName.
4366         
4367 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4368
4369         * cs-parser.jay: Add error 1055 report.
4370
4371 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4372
4373         * assign.cs (Assign.DoResolve): Only do the transform of
4374         assignment into a New if the types are compatible, if not, fall
4375         through and let the implicit code deal with the errors and with
4376         the necessary conversions. 
4377
4378 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4379
4380         * cs-parser.jay: Add error 1031 report.
4381
4382         * cs-tokenizer.cs: Add location for error 1038.
4383
4384 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4385
4386         * cs-parser.jay: Add error 1016 report.
4387
4388 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4389
4390         * cs-parser.jay: Add errors 1575,1611 report.
4391
4392 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4393
4394         * cs-parser.jay: Add error 1001 report.
4395
4396 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4397
4398         Fix #68850
4399         * attribute.cs (GetMarshal): Add method argument for
4400         caller identification.
4401
4402         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4403         agument for GetMarshal and RuntimeMissingSupport.
4404
4405 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4406
4407         * attribute.cs (ExtractSecurityPermissionSet): Removed
4408         TypeManager.code_access_permission_type.
4409
4410         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4411
4412 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4413
4414         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4415         for obsolete use of a variable here.   Fixes regression on errors
4416         cs0619-25 and cs0619-26.
4417
4418 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4419
4420         Fix #62358, implemented security attribute encoding.
4421
4422         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4423         Tests permitted SecurityAction for assembly or other types.
4424         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4425         data from SecurityPermissionAttribute to PermisionSet class.
4426
4427         * class.cs (ApplyAttributeBuilder): Added special handling
4428         for System.Security.Permissions.SecurityAttribute based types.
4429
4430         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4431         special handling for System.Security.Permissions.SecurityAttribute
4432         based types.
4433
4434         * enum.cs (ApplyAttributeBuilder): Added special handling
4435         for System.Security.Permissions.SecurityAttribute based types.
4436
4437         * parameter.cs (ApplyAttributeBuilder): Added special handling
4438         for System.Security.Permissions.SecurityAttribute based types.
4439
4440         * rootcontext.cs: Next 2 core types.
4441
4442         * typemanager.cs (TypeManager.security_permission_attr_type):
4443         Built in type for the SecurityPermission Attribute.
4444         (code_access_permission_type): Build in type.
4445
4446 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4447
4448         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4449         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4450         all of this information into
4451         EmitContext.EmitCapturedVariableInstance.
4452         
4453         * codegen.cs (EmitCapturedVariableInstance): move here the
4454         funcionality of emitting an ldarg.0 in the presence of a
4455         remapping.   This centralizes the instance emit code.
4456
4457         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4458         then emit a load of this: it means that we have reached the
4459         topmost ScopeInfo: the one that contains the pointer to the
4460         instance of the class hosting the anonymous method.
4461
4462         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4463         captures to the topmost CaptureContext.
4464
4465 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4466
4467         * expression.cs (LocalVariableReference): Move the knowledge about
4468         the iterators into codegen's EmitCapturedVariableInstance.
4469
4470 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4471
4472         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4473         all code paths return a value from an anonymous method (it is the
4474         same as the 161 error, but for anonymous methods).
4475
4476 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4477
4478         The introduction of anonymous methods in the compiler changed
4479         various ways of doing things in the compiler.  The most
4480         significant one is the hard split between the resolution phase
4481         and the emission phases of the compiler.
4482
4483         For instance, routines that referenced local variables no
4484         longer can safely create temporary variables during the
4485         resolution phase: they must do so from the emission phase,
4486         since the variable might have been "captured", hence access to
4487         it can not be done with the local-variable operations from the runtime.
4488         
4489         * statement.cs 
4490
4491         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4492         is a toplevel block.
4493
4494         (ToplevelBlock): A new kind of Block, these are the blocks that
4495         are created by the parser for all toplevel method bodies.  These
4496         include methods, accessors and anonymous methods.
4497
4498         These contain some extra information not found in regular blocks:
4499         A pointer to an optional CaptureContext (for tracking captured
4500         local variables and parameters).  A pointer to the parent
4501         ToplevelBlock.
4502         
4503         (Return.Resolve): Catch missmatches when returning a value from an
4504         anonymous method (error 1662).
4505         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4506         phase.
4507
4508         (Break.Resolve): ditto.
4509
4510         (SwitchLabel): instead of defining the labels during the
4511         resolution phase, we now turned the public ILLabel and ILLabelCode
4512         labels into methods called GetILLabelCode() and GetILLabel() that
4513         only define the label during the Emit phase.
4514
4515         (GotoCase): Track the SwitchLabel instead of the computed label
4516         (its contained therein).  Emit the code by using
4517         SwitchLabel.GetILLabelCode ().
4518
4519         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4520         whether the Local has been captured or not.
4521
4522         (LocalInfo.IsCaptured): New property, used to tell whether the
4523         local has been captured.
4524         
4525         * anonymous.cs: Vastly updated to contain the anonymous method
4526         support.
4527
4528         The main classes here are: CaptureContext which tracks any
4529         captured information for a toplevel block and ScopeInfo used to
4530         track the activation frames for various local variables.   
4531
4532         Each toplevel block has an optional capture context associated
4533         with it.  When a method contains an anonymous method both the
4534         toplevel method and the anonymous method will create a capture
4535         context.   When variables or parameters are captured, they are
4536         recorded on the CaptureContext that owns them, for example:
4537
4538         void Demo () {
4539              int a;
4540              MyDelegate d = delegate {
4541                  a = 1;
4542              }
4543         }
4544
4545         Here `a' will be recorded as captured on the toplevel
4546         CapturedContext, the inner captured context will not have anything
4547         (it will only have data if local variables or parameters from it
4548         are captured in a nested anonymous method.
4549
4550         The ScopeInfo is used to track the activation frames for local
4551         variables, for example:
4552
4553         for (int i = 0; i < 10; i++)
4554                 for (int j = 0; j < 10; j++){
4555                    MyDelegate d = delegate {
4556                         call (i, j);
4557                    }
4558                 }
4559
4560         At runtime this captures a single captured variable `i', but it
4561         captures 10 different versions of the variable `j'.  The variable
4562         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4563         recorded on a child.  
4564
4565         The toplevel ScopeInfo will also track information like the `this'
4566         pointer if instance variables were referenced (this is necessary
4567         as the anonymous method lives inside a nested class in the host
4568         type of the method). 
4569
4570         (AnonymousMethod): Expanded to track the Toplevel, implement
4571         `AnonymousMethod.Compatible' to tell whether an anonymous method
4572         can be converted to a target delegate type. 
4573
4574         The routine now also produces the anonymous method content
4575
4576         (AnonymousDelegate): A helper class that derives from
4577         DelegateCreation, this is used to generate the code necessary to
4578         produce the delegate for the anonymous method that was created. 
4579
4580         * assign.cs: API adjustments for new changes in
4581         Convert.ImplicitStandardConversionExists.
4582
4583         * class.cs: Adjustments to cope with the fact that now toplevel
4584         blocks are of type `ToplevelBlock'. 
4585
4586         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4587         insteda of standard blocks.
4588
4589         Flag errors if params arguments are passed to anonymous methods.
4590
4591         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4592         `CurrentAnonymousMethod' which points to the current Anonymous
4593         Method.  The variable points to the AnonymousMethod class that
4594         holds the code being compiled.  It is set in the new EmitContext
4595         created for the anonymous method.
4596
4597         (EmitContext.Phase): Introduce a variable and an enumeration to
4598         assist in enforcing some rules about when and where we are allowed
4599         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4600         only one that enfonces this right now).
4601
4602         (EmitContext.HaveCaptureInfo): new helper method that returns
4603         whether we have a CapturedContext initialized.
4604
4605         (EmitContext.CaptureVariable): New method used to register that a
4606         LocalInfo must be flagged for capturing. 
4607
4608         (EmitContext.CapturedParameter): New method used to register that a
4609         parameters must be flagged for capturing. 
4610         
4611         (EmitContext.CapturedField): New method used to register that a
4612         field must be flagged for capturing. 
4613
4614         (EmitContext.HaveCapturedVariables,
4615         EmitContext.HaveCapturedFields): Return whether there are captured
4616         variables or fields. 
4617
4618         (EmitContext.EmitMethodHostInstance): This is used to emit the
4619         instance for the anonymous method.  The instance might be null
4620         (static methods), this (for anonymous methods that capture nothing
4621         and happen to live side-by-side with the current method body) or a
4622         more complicated expression if the method has a CaptureContext.
4623
4624         (EmitContext.EmitTopBlock): Routine that drives the emission of
4625         code: it will first resolve the top block, then emit any metadata
4626         and then emit the code.  The split is done so that we can extract
4627         any anonymous methods and flag any captured variables/parameters.
4628         
4629         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4630         during this phase, the ILGenerator should not be used as labels
4631         and local variables declared here might not be accessible to any
4632         code that is part of an anonymous method.  
4633
4634         Exceptions to this include the temporary variables that are
4635         created by some statements internally for holding temporary
4636         variables. 
4637         
4638         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4639         metadata for a cb
4640
4641         (EmitContext.TemporaryReturn): This method is typically called
4642         from the Emit phase, and its the only place where we allow the
4643         ReturnLabel to be defined other than the EmitMeta.  The reason is
4644         that otherwise we would have to duplicate a lot of logic in the
4645         Resolve phases of various methods that today is on the Emit
4646         phase. 
4647
4648         (EmitContext.NeedReturnLabel): This no longer creates the label,
4649         as the ILGenerator is not valid during the resolve phase.
4650
4651         (EmitContext.EmitThis): Extended the knowledge in this class to
4652         work in anonymous methods in addition to iterators. 
4653
4654         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4655         code is necessary on the stack to access the instance to a local
4656         variable (the variable will be accessed as a field).
4657
4658         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4659         EmitContext.EmitAddressOfParameter): Routines to support
4660         parameters (not completed at this point). 
4661         
4662         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4663         will also remove the parameters.
4664
4665         * convert.cs (Convert): Define a `ConstantEC' which points to a
4666         null.  This is just to prefity some code that uses
4667         ImplicitStandardConversion code and do not have an EmitContext
4668         handy.
4669
4670         The idea is to flag explicitly that at that point in time, it is
4671         known that the conversion will not trigger the delegate checking
4672         code in implicit conversions (which requires a valid
4673         EmitContext). 
4674
4675         Everywhere: pass new EmitContext parameter since
4676         ImplicitStandardConversionExists now requires it to check for
4677         anonymous method conversions. 
4678
4679         (Convert.ImplicitStandardConversionExists): If the type of an
4680         expression is the anonymous_method_type, and the type is a
4681         delegate, we invoke the AnonymousMethod.Compatible method to check
4682         whether an implicit conversion is possible. 
4683
4684         (Convert.ImplicitConversionStandard): Only do implicit method
4685         group conversions if the language level is not ISO_1.
4686
4687         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4688         MethodInfo for the Invoke method.  used by Delegate and
4689         AnonymousDelegate.
4690
4691         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4692         method conversions if the target type is a delegate.
4693
4694         Removed extra debugging nops.
4695
4696         (LocalVariableReference): Turn the `local_info' into a public
4697         field. 
4698
4699         Add `prepared' field, the same hack used for FieldExprs to cope
4700         with composed assignments, as Local variables do not necessarily
4701         operate purely on the stack as they used to: they can be captured
4702         fields. 
4703
4704         Add `temp' for a temporary result, like fields.
4705
4706         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4707
4708         It now copes with Local variables that are captured and emits the
4709         proper instance variable to load it from a field in the captured
4710         case. 
4711
4712         (ParameterReference.DoResolveBase): During the resolve phase,
4713         capture parameters if we are in an anonymous method.
4714
4715         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4716         anonymous method, use the EmitContext helper routines to emit the
4717         parameter reference.
4718
4719         * iterators.cs: Set RemapToProxy to true/false during the
4720         EmitDispose class.
4721
4722         * parameters.cs (GetParameterByName): New helper method. 
4723
4724         * typemanager.cs (anonymous_method_type) a new type that
4725         represents an anonyous method.  This is always an internal type,
4726         used as a fencepost to test against the anonymous-methodness of an
4727         expression. 
4728         
4729 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4730
4731         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4732         561 report.
4733         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4734
4735 2004-11-10  Martin Baulig  <martin@ximian.com>
4736
4737         * expression.cs (Invocation.BetterFunction): If two methods have
4738         equal parameter types, but only one of them is generic, the
4739         non-generic one wins.
4740         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4741         instance; just use `Type.IsValueType' to determine whether
4742         something is a struct or not.
4743         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4744         so we can be called multiple times.
4745
4746 2004-11-10  Martin Baulig  <martin@ximian.com>
4747
4748         * generic.cs (TypeParameter.DefineConstraints): New public method.
4749         (TypeParameter.CheckAccessLevel): Override this and return true.
4750         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4751         override ResolveType() anymore.
4752         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4753
4754 2004-11-10  Martin Baulig  <martin@ximian.com>
4755
4756         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4757         call DeclSpace.ResolveNestedType() on it.
4758
4759 2004-11-10  Martin Baulig  <martin@ximian.com>
4760
4761         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4762         non-null, call ParameterModifier() on it.
4763
4764 2004-11-10  Martin Baulig  <martin@ximian.com>
4765
4766         * iterators.cs
4767         (Iterators): Added `current_type' and `this_type' fields.
4768         (Iterators.DefineIterator): Create a new EmitContext and store it
4769         in `ec'; compute `this_type'.
4770
4771 2004-11-10  Martin Baulig  <martin@ximian.com>
4772
4773         * typemanager.cs
4774         (TypeManager.IsPrivateAccessible): New public method.
4775         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4776
4777 2004-11-10  Martin Baulig  <martin@ximian.com>
4778
4779         * class.cs (TypeContainer.DefineType): Call
4780         TypeBuilder.DefineGenericParameters() before resolving the type
4781         parameters.
4782         (MethodData.parent_method): New protected field.
4783         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4784         (MethodData.Define): Compute `parent_method'.
4785
4786         * decl.cs
4787         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4788         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4789         (DeclSpace.ec): New protected field; store the EmitContext here.
4790         (DeclSpace.EmitContext): New public property.
4791         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4792         (DeclSpace.ResolveNestedType): New public method.
4793         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4794         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4795         (DeclSpace.FamilyAccessible): Likewise.
4796         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4797         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4798         EmitContext.
4799
4800         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4801         field.
4802
4803         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4804         (Enum.Emit): Don't create a new EmitContext.
4805
4806 2004-10-18  Martin Baulig  <martin@ximian.com>
4807
4808         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4809         `Type' directly, but call ResolveType() on it.
4810         (Catch.Resolve): Likewise.
4811         (Foreach.Resolve): Likewise.
4812
4813 2004-10-18  Martin Baulig  <martin@ximian.com>
4814
4815         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4816         `Type' directly, but call ResolveType() on it.
4817         (Probe.DoResolve): Likewise.
4818         (ArrayCreation.LookupType): Likewise.
4819         (TypeOf.DoResolve): Likewise.
4820         (SizeOf.DoResolve): Likewise.
4821
4822 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4823
4824         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4825         the ResolveType.
4826
4827 2004-10-17  John Luke  <john.luke@gmail.com>
4828
4829         * class.cs (Operator.GetSignatureForError): use CSharpName
4830
4831         * parameter.cs (Parameter.GetSignatureForError): Returns
4832         correct name even if was not defined.
4833
4834 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4835
4836         Fix #65816.
4837         * class.cs (TypeContainer.EmitContext): New property.
4838         (DefineNestedTypes): Create an emitcontext for each part.
4839         (MethodCore.DoDefineParameters): Use container's emitcontext.
4840         Pass type array to InternalParameters.
4841         (MemberBase.DoDefine): Use container's emitcontext.
4842         (FieldMember.Define): Likewise.
4843         (Event.Define): Likewise.
4844         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4845         Pass type array to InternalParameters.
4846         (SetIndexerMethod.GetParameterInfo): Likewise.
4847         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4848         * delegate.cs (Define): Pass emitcontext to
4849         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4850         array to InternalParameters.
4851         * expression.cs (ParameterReference.DoResolveBase): Pass
4852         emitcontext to GetParameterInfo.
4853         (ComposedCast.DoResolveAsTypeStep): Remove check on
4854         ec.ResolvingTypeTree.
4855         * parameter.cs (Parameter.Resolve): Change argument to
4856         EmitContext.  Use ResolveAsTypeTerminal.
4857         (Parameter.GetSignature): Change argument to EmitContext.
4858         (Parameters.ComputeSignature): Likewise.
4859         (Parameters.ComputeParameterTypes): Likewise.
4860         (Parameters.GetParameterInfo): Likewise.
4861         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4862         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4863         * support.cs (InternalParameters..ctor): Remove variant that takes
4864         a DeclSpace.
4865         * typemanager.cs (system_intptr_expr): New.
4866         (InitExpressionTypes): Initialize it.
4867
4868 2004-10-12  Chris Toshok  <toshok@ximian.com>
4869
4870         * cs-parser.jay: fix location for try_statement and catch_clause.
4871
4872 2004-10-18  Martin Baulig  <martin@ximian.com>
4873
4874         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4875         `Type' directly, but call ResolveType() on it.
4876         (MemberBase.DoDefine): Likewise.
4877
4878         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4879         `Type' directly, but call ResolveType() on it.
4880         (ComposedCast.DoResolveAsTypeStep): Likewise.
4881
4882         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4883         `Type' directly, but call ResolveType() on it.
4884
4885 2004-10-17  John Luke  <john.luke@gmail.com>
4886
4887         * class.cs (Operator.GetSignatureForError): use CSharpName
4888
4889         * parameter.cs (Parameter.GetSignatureForError): Returns
4890         correct name even if was not defined.
4891
4892 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4893
4894         Fix #65816.
4895         * class.cs (TypeContainer.EmitContext): New property.
4896         (DefineNestedTypes): Create an emitcontext for each part.
4897         (MethodCore.DoDefineParameters): Use container's emitcontext.
4898         Pass type array to InternalParameters.
4899         (MemberBase.DoDefine): Use container's emitcontext.
4900         (FieldMember.Define): Likewise.
4901         (Event.Define): Likewise.
4902         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4903         Pass type array to InternalParameters.
4904         (SetIndexerMethod.GetParameterInfo): Likewise.
4905         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4906         * delegate.cs (Define): Pass emitcontext to
4907         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4908         array to InternalParameters.
4909         * expression.cs (ParameterReference.DoResolveBase): Pass
4910         emitcontext to GetParameterInfo.
4911         (ComposedCast.DoResolveAsTypeStep): Remove check on
4912         ec.ResolvingTypeTree.
4913         * parameter.cs (Parameter.Resolve): Change argument to
4914         EmitContext.  Use ResolveAsTypeTerminal.
4915         (Parameter.GetSignature): Change argument to EmitContext.
4916         (Parameters.ComputeSignature): Likewise.
4917         (Parameters.ComputeParameterTypes): Likewise.
4918         (Parameters.GetParameterInfo): Likewise.
4919         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4920         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4921         * support.cs (InternalParameters..ctor): Remove variant that takes
4922         a DeclSpace.
4923         * typemanager.cs (system_intptr_expr): New.
4924         (InitExpressionTypes): Initialize it.
4925
4926 2004-10-12  Chris Toshok  <toshok@ximian.com>
4927
4928         * cs-parser.jay: fix location for try_statement and catch_clause.
4929
4930 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4931
4932         More DeclSpace.ResolveType avoidance.
4933         * decl.cs (MemberCore.InUnsafe): New property.
4934         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4935         with newly created EmitContext.
4936         (FieldMember.Define): Likewise.
4937         * delegate.cs (Delegate.Define): Likewise.
4938         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4939         only if normal name-lookup fails.
4940         (TypeExpr.DoResolve): Enable error-checking.
4941         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4942         (SizeOf.DoResolve): Likewise.
4943         (ComposedCast.DoResolveAsTypeStep): Likewise.
4944         (StackAlloc.DoResolve): Likewise.
4945         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4946         (Block.Unsafe): New property.
4947         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4948         (Unsafe): Set 'unsafe' flag of contained block.
4949         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4950         (Fixed.Resolve): Likewise.
4951         (Catch.Resolve): Likewise.
4952         (Using.ResolveLocalVariableDecls): Likewise.
4953         (Foreach.Resolve): Likewise.
4954
4955 2004-10-05  John Luke <john.luke@gmail.com>
4956
4957         * cs-parser.jay: add location to error CS0175
4958
4959 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4960
4961         * ecore.cs (Expression.Constantity): Add support for turning null
4962         into a constant.
4963
4964         * const.cs (Const.Define): Allow constants to be reference types
4965         as long as the value is Null.
4966
4967 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4968
4969         * namespace.cs (NamespaceEntry.Using): No matter which warning
4970         level is set, check if this namespace name has already been added.
4971
4972 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4973
4974         * expression.cs: reftype [!=]= null should always use br[true,false].
4975         # 67410
4976
4977 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4978
4979         Fix #67108
4980         * attribute.cs: Enum conversion moved to 
4981         GetAttributeArgumentExpression to be applied to the all
4982         expressions.
4983
4984 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4985
4986         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4987         * class.c (TypeContainer.DefineType): Flag error if
4988         base types aren't accessible due to access permissions.
4989         * decl.cs (DeclSpace.ResolveType): Move logic to
4990         Expression.ResolveAsTypeTerminal.
4991         (DeclSpace.ResolveTypeExpr): Thin layer over
4992         Expression.ResolveAsTypeTerminal.
4993         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4994         Refactor code into NestedAccess.  Use it.
4995         (DeclSpace.NestedAccess): New.
4996         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4997         argument to silence errors.  Check access permissions.
4998         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4999         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5000         (Cast.DoResolve): Likewise.
5001         (New.DoResolve): Likewise.
5002         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5003         (TypeOf.DoResolve): Likewise.
5004
5005         * expression.cs (Invocation.BetterConversion): Return the Type of
5006         the better conversion.  Implement section 14.4.2.3 more faithfully.
5007         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5008         section 14.4.2.2 explicit.
5009         (Invocation.OverloadResolve): Update.
5010         (Invocation): Remove is_base field.
5011         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5012         (Invocation.Emit): Likewise.
5013
5014 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5015
5016         * cs-parser.jay: Reverted 642 warning fix.
5017
5018 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5019
5020         Fix bug #66615
5021         * decl.cs (FindMemberWithSameName): Indexer can have more than
5022         1 argument.
5023
5024 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5025
5026         * expression.cs (LocalVariableReference.DoResolveLValue):
5027         Do not report warning 219 for out values.
5028         (EmptyExpression.Null): New member to avoid extra allocations.
5029
5030 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5031
5032         * cs-parser.jay: Fix wrong warning 642 report.
5033
5034         * cs-tokenizer.cs (CheckNextToken): New helper;
5035         Inspect next character if is same as expected.
5036
5037 2004-09-23  Martin Baulig  <martin@ximian.com>
5038
5039         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5040         (Convert.ImplicitReferenceConversionExists): Likewise.
5041
5042 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5043
5044         * Makefile (DISTFILES): Comment out a few missing files.
5045
5046 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5047
5048         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5049         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5050         (gmcs.exe): Invoke bootstrap-libs.
5051         (clean-local): Clean the net_2_0_bootstrap profile too.
5052         (PROGRAM_INSTALL_DIR): New.
5053         (install-local): Use it.
5054
5055 2004-10-13  Martin Baulig  <martin@ximian.com>
5056
5057         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5058         (TypeParameter.DefineType): If we're a method type parameter and
5059         that method is overriding something, "inflate" its constraints.
5060
5061 2004-10-12  Martin Baulig  <martin@ximian.com>
5062
5063         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5064         and have type arguments, create and resolve a ConstructedType.
5065
5066 2004-10-12  Martin Baulig  <martin@ximian.com>
5067
5068         * decl.cs (MemberCache.FindMemberToOverride): Use
5069         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5070         to compare the invocationType.
5071
5072         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5073         When comparing two type parameters, only do the signature-only
5074         comparision for method type parameters.
5075
5076 2004-10-11  Martin Baulig  <martin@ximian.com>
5077
5078         * report.cs: Don't make --fatal abort on warnings, we have
5079         -warnaserror for that.
5080
5081 2004-10-11  Martin Baulig  <martin@ximian.com>
5082
5083         * typemanager.cs
5084         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5085         (TypeManager.IsEqual): Call ourself recursively instead of using
5086         Type.IsEqual(). 
5087
5088 2004-10-11  Martin Baulig  <martin@ximian.com>
5089
5090         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5091         on our own type parameters, not on the ones we inherit from a containing
5092         class.
5093
5094         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5095         the comparision.
5096
5097         * generic.cs (TypeParameter.Define): We may only be called once.
5098
5099         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5100         instead of TypeManager.IsEqual().
5101
5102 2004-09-28  Martin Baulig  <martin@ximian.com>
5103
5104         * generic.cs
5105         (GenericConstraints.EffectiveBaseClass): New public property.
5106         (TypeParameter.GenericConstraints): New public property.
5107         (ConstructedType.CheckConstraints): Improved.
5108
5109         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5110         (Convert.TypeParameterConversion): New private method; use this in
5111         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5112         for all conversions related to type parameters.
5113
5114 2004-09-24  Martin Baulig  <martin@ximian.com>
5115
5116         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5117         type parameter conversions for type parameters which are known to
5118         be reference types.
5119
5120 2004-09-24  Martin Baulig  <martin@ximian.com>
5121
5122         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5123         `IsValueType' properties.
5124
5125         * support.cs (ReflectionConstraints): Use
5126         Type.GetGenericParameterConstraints() instead of the old hack.
5127
5128 2004-09-24  Martin Baulig  <martin@ximian.com>
5129
5130         * generic.cs (GenericConstraints): Moved here and made it an
5131         abstract class.
5132
5133         * support.cs (GenericConstraints): Moved to generic.cs.
5134
5135 2004-09-24  Martin Baulig  <martin@ximian.com>
5136
5137         * support.cs
5138         (ReflectionConstraints): Un-nested this class and made it public.
5139
5140         * typemanager.cs
5141         (TypeManager.GetTypeParameterConstraints): New public method.
5142         (TypeManager.HasConstructorConstraint): Use the attributes.
5143
5144 2004-09-24  Martin Baulig  <martin@ximian.com>
5145
5146         * support.cs (GenericConstraints): Replaced `HasConstructor',
5147         `IsReferenceType' and `IsValueType' with `Attributes'.
5148         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5149         method and made the .ctor public.
5150
5151         * generic.cs (Constraints.Attributes): New public property.
5152         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5153         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5154         `IsValueType' -> `HasValueTypeConstraint'.
5155
5156 2004-09-23  Martin Baulig  <martin@ximian.com>
5157
5158         * generic.cs (Constraints): Reflect latest runtime changes.
5159
5160 2004-09-23  Martin Baulig  <martin@ximian.com>
5161
5162         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5163         (Convert.ImplicitReferenceConversionExists): Likewise.
5164
5165 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5166
5167         * class.cs (Operator.Define): Add error 448 and 559 report.
5168         
5169 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5170
5171         * class.cs (MemberBase.IsTypePermitted): New protected
5172         method for checking error CS0610.
5173
5174 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5175
5176         * class.cs (TypeContainer.HasExplicitLayout): New property
5177         Returns whether container has StructLayout attribute set Explicit.
5178         (FieldMember): New abstract class for consts and fields.
5179         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5180         (Field): Reuse FieldMember.
5181
5182         * const.cs (Const): Reuse FieldMember.
5183
5184         * rootcontext.cs: EmitConstants call moved to class.
5185
5186 2004-09-22  Martin Baulig  <martin@ximian.com>
5187
5188         Marek and me just fixed one of our oldest bugs: #28562 :-)
5189
5190         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5191
5192         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5193         we're an EnumConstant, just return that.
5194         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5195         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5196         to get the value which'll actually be written into the attribute.
5197         However, we have to use GetValue() to access the attribute's value
5198         in the compiler.        
5199
5200 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5201
5202         * constant.cs (Constant.IsNegative): New abstract property
5203         IsNegative.
5204
5205         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5206         (StackAlloc.DoResolve): Reused IsNegative.
5207
5208 2004-09-22  Martin Baulig  <martin@ximian.com>
5209
5210         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5211         public method; like LookupTypeContainer, but also works for
5212         generic instances.
5213
5214         * report.cs (Report.SymbolRelatedToPreviousError): Use
5215         TypeManager.LookupGenericTypeContainer().       
5216
5217 2004-09-22  Martin Baulig  <martin@ximian.com>
5218
5219         Thanks to Peter Sestoft for this bug report.
5220
5221         * expression.cs (Conditional): If both the `trueExpr' and the
5222         `falseExpr' is a NullLiteral, return a NullLiteral.
5223
5224 2004-09-22  Martin Baulig  <martin@ximian.com>
5225
5226         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5227         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5228         for the "get_Current" call.
5229
5230 2004-09-21  Martin Baulig  <martin@ximian.com>
5231
5232         * convert.cs (Convert.ImplicitReferenceConversion): When
5233         converting to an interface type, first check whether we're
5234         converting from a reference type.
5235
5236 2004-09-14  Martin Baulig  <martin@ximian.com>
5237
5238         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5239
5240 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5241
5242         Fixed bug #61902
5243         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5244         called and is obsolete then this member suppress message
5245         when call is inside next [Obsolete] method or type.
5246
5247         * expression.cs: Use TestObsoleteMethodUsage member.
5248
5249 2004-09-14  Martin Baulig  <martin@ximian.com>
5250
5251         * genericparser.cs: Removed.
5252
5253 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5254
5255         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5256
5257 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5258
5259         * attribute.cs (Attribute.Resolve): Add error 653 report.
5260
5261         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5262         report.
5263         (Method.ApplyAttributeBuilder): Add error 685 report.
5264         (Operator.Define): Add error 564 report.
5265
5266         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5267
5268         * expression.cs (Invocation.DoResolve): Add error
5269         245 and 250 report.
5270
5271         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5272         error 674 report.
5273
5274 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5275
5276         * class.cs (ConstructorInitializer.Resolve):
5277         Wrong error number (515->516).
5278
5279 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5280
5281         * class.cs (Indexer.Define): Add error 631 report.
5282
5283 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5284
5285         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5286
5287 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5288
5289         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5290
5291 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5292
5293         * cs-parser.jay: Added error CS0241 report.
5294
5295 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5296
5297         * cs-parser.jay (fixed_statement): Introduce a scope for the
5298         declaration in the 'fixed' statement.
5299
5300 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5301
5302         * cs-parser.jay: Added CS0230 error report.
5303
5304 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5305
5306         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5307
5308 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5309
5310         * expression.cs (Argument.Resolve): Added error CS0192 and
5311         CS0199 report.
5312
5313 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5314
5315         C# 2.0 #pragma warning feature
5316
5317         * cs-tokenizer.cs (PreProcessPragma): New method; 
5318         Handles #pragma directive.
5319
5320         * report.cs (WarningRegions): New class; Support
5321         class for #pragma warning directive. It tests whether
5322         warning is enabled for a given line.
5323
5324 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5325
5326         * const.cs: Add more descriptive error report, tahnks to
5327         Sebastien. 
5328
5329 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5330
5331         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5332
5333 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5334
5335         * expression.cs: Apply patch from Ben: Remove dead code from
5336         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5337         as that code just threw an exception anwyays.
5338
5339         * const.cs: Remove the call to the turnintoconstant, for details
5340         see bug: #63144
5341         
5342         * literal.cs: The type of the null-literal is the null type;  So
5343         we use a placeholder type (literal.cs:System.Null, defined here)
5344         for it.
5345
5346         * expression.cs (Conditional.DoResolve): Remove some old code that
5347         is no longer needed, conversions have been fixed.
5348
5349         (ArrayCreationExpression.DoResolve): Return false if we fail to
5350         resolve the inner expression.
5351
5352 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5353
5354         Fix test-290.cs.
5355         * cs-parser.jay (delegate_declaration): Record a delegate
5356         declaration as a type declaration.
5357         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5358
5359 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5360
5361         * parameter.cs: Do not crash if the type can not be resolved. 
5362
5363         * expression.cs: Report errors with unsafe pointers, fixes #64896
5364
5365 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5366
5367         * expression.cs: Pointer arith always needs to do a conv.i
5368         if the operand is a long. fix 65320
5369
5370 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5371
5372         Fixed cs0619-37.cs, cs0619-38.cs
5373
5374         * enum.cs (GetObsoleteAttribute): Removed.
5375
5376         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5377         on Enum member is double staged. The first is tested member
5378         and then enum.
5379
5380 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5381
5382         Fixed #56986, #63631, #65231
5383
5384         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5385         adds member to name container.
5386         (TypeContainer.AddToTypeContainer): New method, adds type to
5387         name container.
5388         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5389         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5390         AddOperator): Simplified by reusing AddToMemberContainer.
5391         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5392         instead of field.
5393         (Method.CheckForDuplications): Fixed implementation to test all
5394         possibilities.
5395         (MemberBase): Detection whether member is explicit interface
5396         implementation is now in constructor.
5397         (MemberBase.UpdateMemberName): Handles IndexerName.
5398         (Accessor): Changed to keep also location information.
5399         (AbstractPropertyEventMethod): Is derived from MemberCore.
5400         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5401         will be emited or not.
5402         (PropertyBase.AreAccessorsDuplicateImplementation):
5403         Tests whether accessors are not in collision with some method.
5404         (Operator): Is derived from MethodCore to simplify common
5405         operations.
5406
5407         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5408         must be performed.
5409         (DeclSpace.AddToContainer): Adds the member to defined_names
5410         table. It tests for duplications and enclosing name conflicts.
5411
5412         * enum.cs (EnumMember): Clean up to reuse the base structures
5413
5414 2004-09-03  Martin Baulig  <martin@ximian.com>
5415
5416         Merged latest changes into gmcs.  Please keep this comment in
5417         here, it makes it easier for me to see what changed in MCS since
5418         the last time I merged.
5419
5420 2004-09-03  Martin Baulig  <martin@ximian.com>
5421
5422         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5423         into TypeContainer, to make partial classes work again.
5424
5425 2004-09-03  Martin Baulig  <martin@ximian.com>
5426
5427         * rootcontext.cs (RootContext.V2): Removed.
5428
5429 2004-03-23  Martin Baulig  <martin@ximian.com>
5430
5431         * expression.cs (Invocation.OverloadResolve): Added `bool
5432         may_fail' argument and use it instead of the Location.IsNull() hack.
5433
5434 2004-09-09  Martin Baulig  <martin@ximian.com>
5435
5436         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5437
5438 2004-09-09  Martin Baulig  <martin@ximian.com>
5439
5440         * generic.cs (TypeParameter.DefineType): Added support for
5441         explicit interface methods.
5442
5443 2004-09-09  Martin Baulig  <martin@ximian.com>
5444
5445         * README.Changes: New document.  Started to list important changes
5446         between MCS and GMCS here.
5447
5448 2004-09-08  Martin Baulig  <martin@ximian.com>
5449
5450         * class.cs
5451         (TypeContainer.CheckRecursiveDefinition): New protected method.
5452         (TypeContainer.DefineType): Move the CS0146 check into
5453         CheckRecursiveDefinition().     
5454
5455 2004-09-06  Martin Baulig  <martin@ximian.com>
5456
5457         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5458         types for the constructor constraint.
5459
5460 2004-09-03  Martin Baulig  <martin@ximian.com>
5461
5462         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5463         into TypeContainer, to make partial classes work again.
5464
5465 2004-09-03  Martin Baulig  <martin@ximian.com>
5466
5467         * rootcontext.cs (RootContext.V2): Removed.
5468
5469 2004-03-23  Martin Baulig  <martin@ximian.com>
5470
5471         * expression.cs (Invocation.OverloadResolve): Added `bool
5472         may_fail' argument and use it instead of the Location.IsNull() hack.
5473
5474 2004-09-03  Martin Baulig  <martin@ximian.com>
5475
5476         Merged latest changes into gmcs.  Please keep this comment in
5477         here, it makes it easier for me to see what changed in MCS since
5478         the last time I merged.
5479
5480 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5481
5482         Fix #61128.
5483         * expression.cs (BetterConversion): Don't allow either conversion 
5484         to be null.  Remove redundant implicit conversion test when 'q ==
5485         null' -- when this function is invoked, we already know that the
5486         implicit conversion exists.
5487         (BetterFunction): Assume that 'best' is non-null.  Remove
5488         redundant reimplementation of IsApplicable when 'best' is null.
5489         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5490         number of arguments.
5491         (IsAncestralType): Extract from OverloadResolve.
5492         (OverloadResolve): Make robust to the MethodGroupExpr being
5493         unsorted.  Implement all the logic of Section 14.5.5.1, and
5494         support overloading of methods from multiple applicable types.
5495         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5496
5497         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5498         (RealError, Warning): Append type of report to related symbol.
5499
5500 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5501
5502         * enum.cs: Fixed CLS-Compliance checks for enum members.
5503         Error tests cs3008-8.cs, cs3014-8.cs
5504
5505 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5506
5507         Fixed bug #62342, #63102
5508         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5509         like ImplementMethod.
5510
5511 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5512
5513         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5514         Fixed bug #65170.
5515
5516 2004-09-02  Martin Baulig  <martin@ximian.com>
5517
5518         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5519         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5520         on the MethodBase.
5521
5522 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5523
5524         C# 2.0 Static classes implemented
5525
5526         * class.cs (TypeContainer): instance_constructors,
5527         initialized_fields, initialized_static_fields,
5528         default_constructor, base_inteface_types are protected to be
5529         accessible from StaticClass.
5530         (TypeContainer.DefineDefaultConstructor): New virtual method
5531         for custom default constructor generating
5532         (StaticClass): New class to handle "Static classes" feature.
5533
5534         * cs-parser.jay: Handle static keyword on class like instance
5535         of StaticClass.
5536
5537         * driver.cs: Added "/langversion" command line switch with two
5538         options (iso-1, default).
5539
5540 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5541
5542         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5543
5544 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5545
5546         * delegate.cs: Style.
5547
5548 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5549
5550         * delegate.cs: Add seperate instance expr field for miguel.
5551
5552 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5553
5554         * PointerArithmetic (Resolve): make sure we are not doing
5555         pointer arith on void*. Also, make sure we are resolved
5556         by not setting eclass until resolve.
5557
5558         All callers: Make sure that PointerArithmetic gets resolved.
5559
5560 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5561
5562         * ArrayCreation (LookupType): If the type does not resolve 
5563         to an array, give an error.
5564
5565 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5566
5567         * statement.cs (Try.Resolve): Fixed bug #64222
5568
5569 2004-08-27  Martin Baulig  <martin@ximian.com>
5570
5571         * class.cs
5572         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5573         crash here.     
5574
5575 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5576
5577         * ecore.cs (Constantify): Get underlying type via
5578         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5579         Windows in special cases.
5580
5581 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5582
5583         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5584         for obtaining also private methods.
5585         (GetRemoveMethod): Used GetRemoveMethod (true)
5586         for obtaining also private methods.
5587
5588 2004-09-02  Martin Baulig  <martin@ximian.com>
5589
5590         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5591         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5592         on the MethodBase.
5593
5594 2004-08-27  Martin Baulig  <martin@ximian.com>
5595
5596         * class.cs
5597         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5598         crash here.     
5599
5600 2004-08-25  Martin Baulig  <martin@ximian.com>
5601
5602         * support.cs (ReflectionParameters..ctor): If this is a generic
5603         method, retrieve and store its type parameters.
5604         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5605         (ReflectionParameters.GenericConstraints): The argument specifies
5606         the type parameter, not the method parameter.
5607         (InternalParameters.GenericConstraints): Likewise.
5608
5609         * generic.cs (TypeParameter.DefineType): Correctly handle
5610         constraints wrt. generic methods in interfaces and their
5611         implementations.        
5612
5613 2004-08-24  Martin Baulig  <martin@ximian.com>
5614
5615         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5616         (Constraints.IsSubclassOf): New internal method.
5617
5618         * typemanager.cs (TypeManager.FindMembers): Added special support
5619         for GenericTypeParameterBuilder's.      
5620         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5621         type parameters.
5622
5623 2004-08-24  Martin Baulig  <martin@ximian.com>
5624
5625         * typemanager.cs
5626         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5627         this for accessibility checks.
5628         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5629         IsNestedFamilyAccessible.
5630         (TypeManager.IsSubclassOf): New method, do what the name actually
5631         says.   
5632
5633 2004-08-24  Martin Baulig  <martin@ximian.com>
5634
5635         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5636         as a SimpleName, include the generic arity.
5637
5638 2004-08-24  Martin Baulig  <martin@ximian.com>
5639
5640         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5641         MethodAttributes.HideBySig for operators.
5642
5643 2004-08-23  Martin Baulig  <martin@ximian.com>
5644
5645         Back to the old error reporting system :-)
5646
5647         * report.cs (Message): Removed.
5648         (Report.MessageData, ErrorData, WarningData): Removed.
5649         (Report.Error, Warning): Back to the old system.
5650
5651 2004-08-23  Martin Baulig  <martin@ximian.com>
5652
5653         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5654
5655         * class.cs (TypeContainer.ParentContainer): New public virtual
5656         method; replaces the explicit interface implementation.
5657         (ClassPart.ParentContainer): Override.
5658
5659 2004-08-23  Martin Baulig  <martin@ximian.com>
5660
5661         * statement.cs (Switch): Added support for constant switches; see
5662         #59428 or test-285.cs.
5663
5664 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5665
5666         Fixed bug #62740.
5667         * statement.cs (GetEnumeratorFilter): Removed useless
5668         logic because C# specs is strict. GetEnumerator must be
5669         public.
5670
5671 2004-08-22  Martin Baulig  <martin@ximian.com>
5672
5673         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5674         a switch and may break, reset the barrier.  Fixes #59867.
5675
5676 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5677
5678         CLS-Compliance speed up (~5% for corlib)
5679
5680         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5681         New method. Tests container for CLS-Compliant names
5682
5683         * class.cs (TypeContainer.VerifyClsName): New method.
5684         Checks whether container name is CLS Compliant.
5685         (Constructor): Implements IMethodData.
5686
5687         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5688         low-case table for CLS Compliance test.
5689         (MemberCache.VerifyClsParameterConflict): New method.
5690         Checks method parameters for CS3006 error.
5691
5692         * enum.cs (EnumMember): Is derived from MemberCore.
5693         (Enum.VerifyClsName): Optimized for better performance.
5694
5695 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5696
5697         * report.cs: Renamed Error_T to Error and changed all
5698         references.
5699
5700 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5701
5702         * class.cs (TypeContainer.IndexerArrayList): New inner class
5703         container for indexers.
5704         (TypeContainer.DefaultIndexerName): New constant for default
5705         indexer name. Replaced all "Item" with this constant.
5706         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5707
5708         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5709         DefaultMemberAttribute constructor.
5710
5711 2004-08-05  Martin Baulig  <martin@ximian.com>
5712
5713         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5714         Fix bug #59429.
5715
5716 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5717
5718         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5719         multi platforms problem.
5720
5721         * compiler.csproj: Included shared files.
5722
5723 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5724
5725         Fix bug 60333, 55971 in the more general way
5726         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5727         Added arg_type argument for constant conversion.
5728         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5729
5730 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5731
5732         Fix bug #59760
5733         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5734         OperatorArrayList, MethodCoreArrayList for typecontainer
5735         containers. Changed class member types to these new types.
5736         (MethodArrayList.DefineMembers): Added test for CS0659.
5737
5738 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5739
5740         * cfold.cs: Synchronize the folding with the code in expression.cs
5741         Binary.DoNumericPromotions for uint operands.
5742
5743         * attribute.cs: Revert patch from Raja, it introduced a regression
5744         while building Blam-1.2.1 (hard to isolate a test case).
5745
5746 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5747
5748         Fix for #55382
5749         * class.cs:
5750         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5751         name collision.
5752         (MethodCore.parent_method): New member. The method we're overriding
5753         if this is an override method.
5754         (MethodCore.CheckBase): Moved from Method class and made common.
5755         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5756         private.
5757         (MethodCore.CheckForDuplications): New abstract method. For custom
5758         member duplication search in a container
5759         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5760         method and its return type.
5761         (Event.conflict_symbol): New member. Symbol with same name in the
5762         parent class.
5763
5764         * decl.cs:
5765         (MemberCache.FindMemberWithSameName): New method. The method
5766         is looking for conflict with inherited symbols.
5767
5768 2004-08-04  Martin Baulig  <martin@ximian.com>
5769
5770         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5771
5772         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5773
5774 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5775
5776         * report.cs (Message): New enum for better error, warning reference in
5777         the code.
5778         (MessageData): New inner abstract class. It generally handles printing of
5779         error and warning messages.
5780         Removed unused Error, Warning, Message methods.
5781
5782 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5783
5784         Fix for cs0592-8.cs test
5785         * attribute.cs
5786         (Attributable.ValidAttributeTargets): Made public.
5787         (Attribute.ExplicitTarget): New member for explicit target value.
5788         (Attribute.CheckTargets): Now we translate explicit attribute
5789         target to Target here.
5790
5791 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5792
5793         * ecore.cs (MethodGroupExpr): new IsBase property.
5794
5795         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5796
5797         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5798         rather than an instance expr.
5799
5800         (DelegateCreation.Emit): Use the method group rather than
5801         the instance expression. Also, if you have base.Foo as the
5802         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5803
5804         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5805
5806         (NewDelegate.DoResolve): Only check for the existance of Invoke
5807         if the method is going to be needed. Use MethodGroupExpr.
5808
5809         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5810
5811         * expression.cs: For pointer arith., make sure to use
5812         the size of the type, not the size of the pointer to
5813         the type.
5814
5815 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5816
5817         Fix for #60722
5818         * class.cs (Class): Added error CS0502 test.
5819
5820 2004-08-03  John Luke  <jluke@cfl.rr.com>
5821             Raja R Harinath  <rharinath@novell.com>
5822
5823         Fix for #60997.
5824         * attribute.cs (Attribute.complained_before): New flag.
5825         (Attribute.ResolveType, Attribute.Resolve),
5826         (Attribute.DefinePInvokeMethod): Set it.
5827         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5828         
5829 2004-08-03  Martin Baulig  <martin@ximian.com>
5830
5831         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5832         use a user-defined operator; we still need to do numeric
5833         promotions in case one argument is a builtin type and the other
5834         one has an implicit conversion to that type.  Fixes #62322.
5835
5836 2004-08-18  Martin Baulig  <martin@ximian.com>
5837
5838         * class.cs (Method.Define): Use the correct method name when
5839         creating the MethodBuilder for a generic method.
5840
5841 2004-08-17  Martin Baulig  <martin@ximian.com>
5842
5843         * generic.cs (Constraints): Support type parameter constraints.
5844
5845 2004-08-16  Martin Baulig  <martin@ximian.com>
5846
5847         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5848         (Token.GENERIC_DIMENSION): New token; this is returned if we
5849         encounter an unbound generic type in a typeof() expression.
5850
5851         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5852         this token is only generated while parsing a typeof() expression.
5853         (typeof_expression): Removed the old unbound_type hack.
5854
5855         * generic.cs (TypeArguments.IsUnbound): New public property.
5856
5857         * decl.cs (MemberName): Added support for unbound types.
5858
5859 2004-08-14  Martin Baulig  <martin@ximian.com>
5860
5861         * typemanager.cs
5862         (TypeManager.IsEqualGenericInstance): New static method.
5863         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5864         just used to check accessibility, so follow the rules of 26.1.6.        
5865
5866         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5867         ConstructedType instead of a TypeExpression if we have type arguments.
5868
5869         * cs-parser.jay (typeof_expression): Support unbound generic types.
5870
5871         * ecore.cs (UnboundTypeExpression): New public class.
5872
5873 2004-08-12  Martin Baulig  <martin@ximian.com>
5874
5875         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5876         TypeManager.IsEqual() rather than `=='.
5877
5878         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5879         generic instances as well.
5880
5881 2004-08-12  Martin Baulig  <martin@ximian.com>
5882
5883         * expression.cs (Invocation.InferType): We can only infer method
5884         type parameters.  Fixes #62647.
5885
5886 2004-08-11  Martin Baulig  <martin@ximian.com>
5887
5888         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5889         before resolving the base classes.
5890
5891 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5892
5893         * Makefile: install .mdb file too.
5894
5895 2004-08-05  Martin Baulig  <martin@ximian.com>
5896
5897         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5898         initializer, the current type is just the TypeBuilder, not the
5899         instantiated generic type.
5900         (FieldExpr.IsFieldInitializer): New public property.
5901
5902 2004-08-04  Martin Baulig  <martin@ximian.com>
5903
5904         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5905
5906         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5907
5908 2004-08-03  Martin Baulig  <martin@ximian.com>
5909
5910         * class.cs (MethodData.Define): If we're an explicit
5911         implementation, remove the generic arity from the type name.
5912
5913 2004-08-03  Martin Baulig  <martin@ximian.com>
5914
5915         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5916         use a user-defined operator; we still need to do numeric
5917         promotions in case one argument is a builtin type and the other
5918         one has an implicit conversion to that type.  Fixes #62322.
5919
5920 2004-08-02  Martin Baulig  <martin@ximian.com>
5921
5922         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5923         `TypeExpr[]' array.
5924         (TypeContainer.GetClassBases): Return the unexpanded list of
5925         interfaces; we expand them later.
5926         (TypeContainer.DefineType): After creating the TypeBuilder, call
5927         TypeManager.ExpandInterfaces() to get an expanded and resolved
5928         list of interfaces.
5929
5930         * ecore.cs (TypeExpr.GetInterfaces): Removed
5931
5932         * generics.cs (Constraints.InterfaceConstraints): Remove.
5933         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5934         register the interface constraints.
5935
5936         * typemanager.cs
5937         (TypeManager.AddUserType): Removed the `ifaces' argument.
5938         (TypeManager.AddTypeParameter): Likewise.
5939         (TypeManager.AddUserInterface): Removed, was unused.
5940         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5941         `TypeExpr[]' array for the interfaces.
5942         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5943         has been defined, returns a list of the resolved interfaces types.
5944         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5945         (TypeManager.GetExplicitInterfaces): Likewise.  
5946
5947 2004-08-02  Martin Baulig  <martin@ximian.com>
5948
5949         * expression.cs (Invocation.EmitCall): If we're invoking a method
5950         on a type parameter, use the new `Constrained' prefix opcode.
5951
5952 2004-08-02  Martin Baulig  <martin@ximian.com>
5953
5954         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5955         (LocalInfo.IsThis): New public property.
5956         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5957
5958 2004-08-01  Martin Baulig  <martin@ximian.com>
5959
5960         * class.cs (TypeContainer.GetClassBases): Don't set the default
5961         here since we may get called from GetPartialBases().
5962         (TypeContainer.DefineType): If GetClassBases() didn't return a
5963         parent, use the default one.
5964
5965 2004-07-30  Martin Baulig  <martin@ximian.com>
5966
5967         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5968
5969         * class.cs (SourceMethod): New public class, derive from the
5970         symbol writer's ISourceMethod.
5971         (Method): Use the new symbol writer API.
5972
5973         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5974         as argument and use the new symbol writer.
5975
5976         * location.cs
5977         (SourceFile): Implement the symbol writer's ISourceFile.
5978         (Location.SymbolDocument): Removed.
5979         (Location.SourceFile): New public property.
5980
5981         * symbolwriter.cs: Use the new symbol writer API.
5982
5983 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5984
5985         * Makefile (install-local): Remove.  Functionality moved to
5986         executable.make.
5987
5988 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5989
5990         * Makefile: Install mcs.exe.config file together with mcs.exe.
5991         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5992         correct runtime version.
5993         
5994 2004-07-25  Martin Baulig  <martin@ximian.com>
5995
5996         * class.cs
5997         (TypeContainer.RegisterOrder): Removed, this was unused.
5998         (TypeContainer, interface_order): Removed.
5999         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6000         TypeContainer as argument since we can also be called with a
6001         `PartialContainer' for a partial class/struct/interface.
6002         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6003         of checking whether we're an `Interface' - we could be a
6004         `PartialContainer'.
6005         (PartialContainer.Register): Override; call
6006         AddClass()/AddStruct()/AddInterface() on our parent.
6007
6008         * cs-parser.jay (interface_member_declaration): Add things to the
6009         `current_container', not the `current_class'.
6010
6011         * rootcontext.cs (RegisterOrder): The overloaded version which
6012         takes an `Interface' was unused, removed.
6013
6014         * typemanager.cs (TypeManager.LookupInterface): Return a
6015         `TypeContainer', not an `Interface'.
6016         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6017         contain a `PartialContainer' for an interface, so check it's
6018         `Kind' to figure out what it is.
6019
6020 2004-07-25  Martin Baulig  <martin@ximian.com>
6021
6022         * class.cs (Class.DefaultTypeAttributes): New public constant.
6023         (Struct.DefaultTypeAttributes): Likewise.
6024         (Interface.DefaultTypeAttributes): Likewise.
6025         (PartialContainer.TypeAttr): Override this and add the
6026         DefaultTypeAttributes.
6027
6028 2004-07-25  Martin Baulig  <martin@ximian.com>
6029
6030         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6031         we can just use the `Parent' field instead.
6032
6033 2004-07-25  Martin Baulig  <martin@ximian.com>
6034
6035         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6036
6037 2004-07-25  Martin Baulig  <martin@ximian.com>
6038
6039         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6040         our parts before defining any methods.
6041         (TypeContainer.VerifyImplements): Make this virtual.
6042         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6043         on our PartialContainer.
6044
6045 2004-07-25  Martin Baulig  <martin@ximian.com>
6046
6047         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6048
6049         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6050         argument, we can just use the `Parent' field instead.
6051
6052         * class.cs
6053         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6054         (MemberBase.DoDefine): Likewise.
6055
6056 2004-07-24  Martin Baulig  <martin@ximian.com>
6057
6058         * decl.cs (MemberCore.Parent): New public field.
6059         (DeclSpace.Parent): Moved to MemberCore.
6060
6061         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6062         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6063         parent's .ctor.
6064         (FieldBase, Field, Operator): Likewise.
6065         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6066         (EventField, Event): Likewise.
6067
6068 2004-07-23  Martin Baulig  <martin@ximian.com>
6069
6070         * class.cs (PartialContainer): New public class.
6071         (ClassPart): New public class.
6072         (TypeContainer): Added support for partial classes.
6073         (TypeContainer.GetClassBases): Splitted some of the functionality
6074         out into GetNormalBases() and GetPartialBases().
6075
6076         * cs-tokenizer.cs (Token.PARTIAL): New token.
6077         (Tokenizer.consume_identifier): Added some hacks to recognize
6078         `partial', but only if it's immediately followed by `class',
6079         `struct' or `interface'.
6080
6081         * cs-parser.jay: Added support for partial clases.
6082
6083 2004-07-23  Martin Baulig  <martin@ximian.com>
6084
6085         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6086         a `DeclSpace' and also made it readonly.
6087         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6088         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6089         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6090
6091         * cs-parser.jay: Pass the `current_class', not the
6092         `current_container' (at the moment, this is still the same thing)
6093         to a new Method, Property, Event, Indexer or Constructor.
6094
6095 2004-07-23  Martin Baulig  <martin@ximian.com>
6096
6097         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6098         and removed the `current_interface' one.
6099         (struct_declaration, class_declaration, interface_declaration):
6100         Set `current_class' to the newly created class/struct/interface;
6101         set their `Bases' and call Register() before parsing their body.
6102
6103 2004-07-23  Martin Baulig  <martin@ximian.com>
6104
6105         * class.cs (Kind): New public enum.
6106         (TypeContainer): Made this class abstract.
6107         (TypeContainer.Kind): New public readonly field.
6108         (TypeContainer.CheckDef): New public method; moved here from
6109         cs-parser.jay.
6110         (TypeContainer.Register): New public abstract method.
6111         (TypeContainer.GetPendingImplementations): New public abstract
6112         method.
6113         (TypeContainer.GetClassBases): Removed the `is_class' and
6114         `is_iface' parameters.
6115         (TypeContainer.DefineNestedTypes): Formerly known as
6116         DoDefineType().
6117         (ClassOrStruct): Made this class abstract.
6118
6119         * tree.cs (RootTypes): New public type. 
6120
6121 2004-07-20  Martin Baulig  <martin@ximian.com>
6122
6123         * tree.cs (Tree.RecordNamespace): Removed.
6124         (Tree.Namespaces): Removed.
6125
6126         * rootcontext.cs (RootContext.IsNamespace): Removed.
6127
6128         * cs-parser.jay (namespace_declaration): Just create a new
6129         NamespaceEntry here.
6130
6131 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6132
6133         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6134         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6135         entry to make sure it runs in the correct runtime version.
6136         
6137 2004-07-18  Martin Baulig  <martin@ximian.com>
6138
6139         * generic.cs (ConstructedType.CheckConstraints): Improved
6140         constraints checking.
6141
6142 2004-07-18  Martin Baulig  <martin@ximian.com>
6143
6144         * expression.cs (Invocation.BetterMethod): Call
6145         TypeManager.TypeToCoreType() on all types and removed my previous
6146         hack; we're already doig the right thing here.
6147
6148 2004-07-17  Martin Baulig  <martin@ximian.com>
6149
6150         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6151
6152 2004-07-16  Martin Baulig  <martin@ximian.com>
6153
6154         * iterators.cs: Added generics support.
6155
6156 2004-07-16  Martin Baulig  <martin@ximian.com>
6157
6158         * iterators.cs: Rewrote this.  We're now using one single Proxy
6159         class for both the IEnumerable and the IEnumerator interface and
6160         `Iterator' derives from Class so we can use the high-level API.
6161
6162         * class.cs (TypeContainer.AddIterator): New method.
6163         (TypeContainer.DoDefineType): New protected virtual method, which
6164         is called from DefineType().
6165         (TypeContainer.DoDefineMembers): Call DefineType() and
6166         DefineMembers() on all our iterators.
6167         (TypeContainer.Emit): Call Emit() on all our iterators.
6168         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6169
6170         * codegen.cs (EmitContext.CurrentIterator): New public field.
6171
6172 2004-07-15  Martin Baulig  <martin@ximian.com>
6173
6174         * typemanager.cs
6175         (TypeManager.not_supported_exception_type): New type.   
6176
6177 2004-07-14  Martin Baulig  <martin@ximian.com>
6178
6179         * typemanager.cs
6180         (TypeManager.generic_ienumerable_type): New type.
6181         (TypeManager.generic_ienumerator_type): New type.
6182
6183         * rootcontext.cs
6184         (RootContext.interfaces_first_stage): Added
6185         "System.Collections.Generic.IEnumerator`1" and
6186         "System.Collections.Generic.IEnumerable`1".     
6187
6188 2004-07-14  Martin Baulig  <martin@ximian.com>
6189
6190         * iterators.cs: Use real error numbers.
6191
6192 2004-07-14  Martin Baulig  <martin@ximian.com>
6193
6194         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6195         requires this to be a System.Collection.IEnumerable and not a
6196         class implementing that interface.
6197         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6198
6199 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6200
6201         * class.cs: Fixed previous fix, it broke some error tests.
6202
6203 2004-07-12  Martin Baulig  <martin@ximian.com>
6204
6205         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6206         Fixes #61293.
6207
6208 2004-07-14  Martin Baulig  <martin@ximian.com>
6209
6210         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6211         an exclamation mark (!) for the generic arity to reflect the
6212         latest spec changes; ie. use "System.Collections.Generic.IList`1".
6213
6214 2004-07-13  Martin Baulig  <martin@ximian.com>
6215
6216         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6217         specifiers being part of a type argument.
6218
6219 2004-07-13  Martin Baulig  <martin@ximian.com>
6220
6221         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6222         name for generic types.
6223
6224 2004-07-13  Martin Baulig  <martin@ximian.com>
6225
6226         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6227         bit to fix #60119.
6228
6229 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6230
6231         * assign.cs (LocalTemporary): Add new argument: is_address,If
6232         `is_address' is true, then the value that we store is the address
6233         to the real value, and not the value itself.
6234         
6235         * ecore.cs (PropertyExpr): use the new local temporary
6236         stuff to allow us to handle X.Y += z (where X is a struct)
6237
6238 2004-07-08  Martin Baulig  <martin@ximian.com>
6239
6240         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6241         not always return, just like we're doing in Using.Resolve().
6242
6243 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6244
6245         * cs-parser.jay (fixed_statement): flag this as Pinned.
6246
6247 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6248
6249         * typemanager.cs (TypeManager): Removed MakePinned method, this
6250         mechanism is replaced with the .NET 2.x compatible mechanism of
6251         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6252
6253         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6254         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6255         `IsFixed' property which has a different meaning.
6256
6257 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6258
6259         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6260         visible from inside a nested class, not just the names of the
6261         immediately enclosing class.
6262         Fix for bug #60730.
6263
6264 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6265
6266         * expression.cs (BetterConversion): Remove buggy special-case
6267         handling of "implicit constant expression conversions".  At this
6268         point, we already know that the conversion is possible -- we're
6269         only checking to see which is better.
6270
6271 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6272
6273         * cs-parser.jay: Added error CS0210 test.
6274
6275 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6276
6277         * cs-parser.jay: Added error CS0134 test.
6278
6279 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6280
6281         Fix bug #52507
6282         * cs-parser.jay: Added error CS0145 test.
6283
6284 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6285
6286         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6287
6288 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6289         
6290         * expression.cs (StackAlloc.Resolve): The argument may not
6291         be a constant; deal with this case.
6292         
6293 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6294
6295         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6296         GetIndexerAttributeValue.
6297         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6298
6299         * class.cs (Indexer.Define): Added error tests for CS0415,
6300         CS0609.
6301
6302 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6303
6304         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6305         property code.
6306
6307 2004-06-23  Martin Baulig  <martin@ximian.com>
6308
6309         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6310         neither return nor throw, reset the barrier as well.  Fixes #60457.
6311
6312 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6313
6314         * class.cs : EventAttributes is now set to None by default.
6315           This fixes bug #60459.
6316
6317 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6318
6319         Fix bug #60219
6320         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6321         Don't throw exception but return null (it's sufficient now).
6322
6323 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6324
6325         * typemanager.cs (GetArgumentTypes): Faster implementation.
6326
6327 2004-06-18  Martin Baulig  <martin@ximian.com>
6328
6329         * attribute.cs (Attribute.Resolve): Check whether we're an
6330         EmptyCast which a Constant child.  Fixes #60333.
6331
6332 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6333
6334         * statement.cs (EmitCollectionForeach): Account for the fact that
6335         not all valuetypes are in areas which we can take the address of.
6336         For these variables, we store to a temporary variable. Also, make
6337         sure that we dont emit a `callvirt' on a valuetype method.
6338
6339 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6340
6341         * expression.cs (StackAlloc.DoReSolve): Added test for
6342         negative parameter (CS0247).
6343
6344 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6345
6346         Fix bug #59792
6347         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6348
6349 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6350
6351         Fix bug #59781
6352         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6353         ulong.
6354
6355 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6356
6357         Fix bug #58254 & cs1555.cs, cs1556.cs
6358         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6359
6360 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6361
6362         * cs-parser.jay: Added error CS1669 test for indexers.
6363
6364 2004-06-18  Martin Baulig  <martin@ximian.com>
6365
6366         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6367         argument.  Fixes #60441.
6368
6369 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6370         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6371         The name needs to have the actual name of the method in order
6372         for other tests (such as the one in OverloadResolve for Invoke
6373         on a delegate) to work. As well, it does not really help
6374         error reporting because the method group had multiple methods.
6375         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6376         Make profiling work.
6377         
6378 2004-06-13  Martin Baulig  <martin@ximian.com>
6379
6380         * cs-parser.jay: Don't allow generic attributes.
6381
6382 2004-06-13  Martin Baulig  <martin@ximian.com>
6383
6384         * class.cs (MemberBase.DoDefineBase): New protected method.
6385         (MemberBase.DoDefine): Compute the `flags' in the new
6386         DoDefineBase() which must be called first.
6387         (Method.Define): Call DoDefineBase() first so we have the flags
6388         when defining the generic method.
6389
6390         * cs-parser.jay (interface_method_declaration): Support generic methods.
6391
6392 2004-06-13  Martin Baulig  <martin@ximian.com>
6393
6394         * decl.cs (TypeName): Removed.
6395         (MemberName): Removed TypeName and MemberNow; now we just have
6396         MemberName.
6397
6398         * cs-parser.jay: Don't distinguish between type arguments and type
6399         parameters in the grammar and simplified the rules a bit.  The
6400         reduce/reduce conflicts are now gone (except the one we inherited
6401         from mcs).
6402
6403 2004-06-11  Martin Baulig  <martin@ximian.com>
6404
6405         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6406         call this twice: for params and varargs methods.
6407
6408 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6409
6410         * class.cs:
6411         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6412
6413 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6414
6415         * attribute.cs (Attribute.GetValidTargets): Made public.
6416
6417         * class.cs: 
6418         (AbstractPropertyEventMethod): New class for better code sharing.
6419         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6420         CS1667 report.
6421         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6422
6423 2004-06-09  Martin Baulig  <martin@ximian.com>
6424
6425         * cs-parser.jay: Removed a reduce/reduce conflict.
6426
6427 2004-06-03  Martin Baulig  <martin@ximian.com>
6428
6429         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6430         GetSimpleName() and return a SimpleName.
6431
6432         * ecore.cs (SimpleName.Arguments): New public field.
6433         (SimpleName): Added overloaded ctor which takes an additional
6434         TypeArguments argument.
6435         (SimpleName.SimpleNameResolve): Added support for generic methods.
6436         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6437         formerly in MemberAccess.DoResolve(), but we also need it in
6438         SimpleNameResolve().
6439
6440         * expression.cs (MemberAccess.DoResolve): Use the new
6441         MethodGroupExpr.ResolveGeneric().       
6442
6443 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6444
6445         * decl.cs: If possible, use lookuptypedirect here. We can only do
6446         this if there is no `.' after the namespace. Avoids using
6447         LookupType, which does lots of slow processing.
6448         (FindNestedType) New method, does what it says :-).
6449         * namespace.cs: use LookupTypeDirect.
6450         * rootcontext.cs: use membercache, if possible.
6451         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6452
6453 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6454
6455         * expression.cs:
6456         According to the spec, 
6457
6458         In a member access of the form E.I, if E is a single identifier,
6459         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6460         field, property, localvariable, or parameter with the same type as
6461         the meaning of E as a type-name (§3.8), then both possible
6462         meanings of E are permitted.
6463
6464         We did not check that E as a simple-name had the same type as E as
6465         a type name.
6466
6467         This trivial check gives us 5-7% on bootstrap time.
6468
6469 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6470
6471         * expression.cs (Invocation.OverloadResolve): Avoid the
6472         use of hashtables and boxing here by allocating on demand.
6473
6474 2004-05-30  Martin Baulig  <martin@ximian.com>
6475
6476         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6477         we're doing a silent lookup.  Don't try to lookup nested types in
6478         TypeManager.object_type (thanks to Ben Maurer).
6479
6480 2004-05-30  Martin Baulig  <martin@ximian.com>
6481
6482         Committing a patch from Ben Maurer.
6483
6484         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6485
6486 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6487
6488         * convert.cs: add a trivial cache for overload operator resolution.
6489
6490 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6491
6492         * attribute.cs
6493         (AttributeTester.GetObsoleteAttribute): Returns instance of
6494         ObsoleteAttribute when type is obsolete.
6495
6496         * class.cs
6497         (TypeContainer.VerifyObsoleteAttribute): Override.
6498         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6499         (MethodCode.VerifyObsoleteAttribute): Override.
6500         (MemberBase.VerifyObsoleteAttribute): Override.
6501
6502         * decl.cs
6503         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6504         and report proper error.
6505
6506         *delegate.cs
6507         (Delegate.VerifyObsoleteAttribute): Override.
6508
6509         * ecore.cs
6510         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6511         and report proper error.
6512         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6513
6514         * enum.cs
6515         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6516         and enum member.
6517
6518         * expression.cs
6519         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6520         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6521         Added test for ObsoleteAttribute.
6522
6523         * statement.cs
6524         (Catch): Derived from Statement.
6525
6526 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6527
6528         * decl.cs: If possible, use lookuptypedirect here. We can only do
6529         this if there is no `.' after the namespace. Avoids using
6530         LookupType, which does lots of slow processing.
6531         (FindNestedType) New method, does what it says :-).
6532         * namespace.cs: use LookupTypeDirect.
6533         * rootcontext.cs: use membercache, if possible.
6534         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6535
6536 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6537
6538         * expression.cs:
6539         According to the spec, 
6540
6541         In a member access of the form E.I, if E is a single identifier,
6542         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6543         field, property, localvariable, or parameter with the same type as
6544         the meaning of E as a type-name (§3.8), then both possible
6545         meanings of E are permitted.
6546
6547         We did not check that E as a simple-name had the same type as E as
6548         a type name.
6549
6550         This trivial check gives us 5-7% on bootstrap time.
6551
6552 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6553
6554         Fixed bug #59071 & cs0160.cs
6555         * statement.cs (Try.Resolve): Check here whether order of catch
6556         clauses matches their dependencies.
6557
6558 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6559
6560         Fixed bug #58624
6561         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6562         unsafe type.
6563
6564 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6565
6566         * expression.cs (Invocation.OverloadResolve): Avoid the
6567         use of hashtables and boxing here by allocating on demand.
6568
6569 2004-05-30  Martin Baulig  <martin@ximian.com>
6570
6571         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6572         we're doing a silent lookup.  Don't try to lookup nested types in
6573         TypeManager.object_type (thanks to Ben Maurer).
6574
6575 2004-05-30  Martin Baulig  <martin@ximian.com>
6576
6577         Committing a patch from Ben Maurer.
6578
6579         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6580
6581 2004-05-29  Martin Baulig  <martin@ximian.com>
6582
6583         * class.cs (IMethodData.ShouldIgnore): New method.
6584
6585         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6586         `Location' argument, we don't need it anywhere.  Use
6587         `IMethodData.ShouldIgnore ()' instead of
6588         `MethodData.GetMethodFlags ()'.
6589         (TypeManager.AddMethod): Removed.
6590         (TypeManager.AddMethod2): Renamed to AddMethod.
6591
6592 2004-05-29  Martin Baulig  <martin@ximian.com>
6593
6594         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6595
6596         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6597         converting from a class type S to an interface type and we already
6598         have an object on the stack, don't box it again.  Fixes #52578.
6599
6600 2004-05-29  Martin Baulig  <martin@ximian.com>
6601
6602         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6603         Added support for `params' parameters.  Fixes #59267.
6604
6605 2004-05-29  Martin Baulig  <martin@ximian.com>
6606
6607         * literal.cs (NullPointer): Provide a private .ctor which sets
6608         `type' to TypeManager.object_type.  Fixes #59048.
6609
6610 2004-05-29  Martin Baulig  <martin@ximian.com>
6611
6612         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6613         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6614
6615         * ecore.cs (EventExpr.instance_expr): Make the field private.
6616
6617 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6618
6619         Fixed bug #50080 & cs0214-2.cs
6620         * expression.cs (Cast.DoResolve): Check unsafe context here.
6621         
6622         * statement.cs (Resolve.DoResolve): Likewise.
6623
6624 2004-05-26  Martin Baulig  <martin@ximian.com>
6625
6626         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6627
6628         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6629         (RootContext.LookupType): Pass down the `silent' flag.
6630
6631 2004-05-25  Martin Baulig  <martin@ximian.com>
6632
6633         * expression.cs
6634         (MethodGroupExpr.IdenticalTypeName): New public property.
6635         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6636         expression actually refers to a type.
6637
6638 2004-05-25  Martin Baulig  <martin@ximian.com>
6639
6640         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6641         for #56176 and made it actually work.
6642
6643 2004-05-25  Martin Baulig  <martin@ximian.com>
6644
6645         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6646         (FieldExpr, PropertyExpr): Override and implement
6647         CacheTemporaries.  Fixes #52279.
6648
6649 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6650
6651         * location.cs: In the new compiler listing a file twice is a
6652         warning, not an error.
6653
6654 2004-05-24  Martin Baulig  <martin@ximian.com>
6655
6656         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6657         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6658
6659 2004-05-24  Martin Baulig  <martin@ximian.com>
6660
6661         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6662         walking the `using' list.  Fixes #53921.
6663
6664 2004-05-24  Martin Baulig  <martin@ximian.com>
6665
6666         * const.cs (Const.LookupConstantValue): Added support for
6667         EmptyCast's; fixes #55251.
6668
6669 2004-05-24  Martin Baulig  <martin@ximian.com>
6670
6671         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6672         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6673         which does the CS0135 check.  The reason is that we first need to
6674         check whether the variable actually exists.
6675
6676 2004-05-24  Martin Baulig  <martin@ximian.com>
6677
6678         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6679         than RootContext.LookupType() to find the explicit interface
6680         type.  Fixes #58584.
6681
6682 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6683
6684         * Makefile: Simplify.  Use executable.make.
6685         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6686
6687 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6688
6689         * decl.cs:
6690         * enum.cs:
6691         Use the invariant culture when doing String.Compare for CLS case
6692         sensitivity.
6693         
6694 2004-05-23  Martin Baulig  <martin@ximian.com>
6695
6696         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6697         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6698
6699         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6700
6701 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6702
6703         * class.cs (MemberBase.Define): Reuse MemberType member for 
6704         resolved type. Other methods can use it too.
6705
6706 2004-05-23  Martin Baulig  <martin@ximian.com>
6707
6708         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6709         the variable also exists in the current block (otherwise, we need
6710         to report a CS0103).  Fixes #58670.
6711
6712 2004-05-23  Martin Baulig  <martin@ximian.com>
6713
6714         * flowanalysis.cs (Reachability.Reachable): Compute this
6715         on-the-fly rather than storing it as a field.
6716
6717 2004-05-23  Martin Baulig  <martin@ximian.com>
6718
6719         * flowanalysis.cs (Reachability.And): Manually compute the
6720         resulting `barrier' from the reachability.      
6721        
6722 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6723
6724         Fix bug #57835
6725         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6726         instance of ObsoleteAttribute when symbol is obsolete.
6727
6728         * class.cs
6729         (IMethodData): Extended interface for ObsoleteAttribute support.
6730
6731 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6732
6733         * attribute.cs: Fix bug #55970
6734
6735 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6736
6737         Fix bug #52705
6738         * attribute.cs
6739         (GetObsoleteAttribute): New method. Creates the instance of
6740         ObsoleteAttribute.
6741         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6742         ObsoleteAttribute when member is obsolete.
6743         (AttributeTester.Report_ObsoleteMessage): Common method for
6744         Obsolete error/warning reporting.
6745
6746         * class.cs
6747         (TypeContainer.base_classs_type): New member for storing parent type.
6748
6749         * decl.cs
6750         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6751         for this MemberCore.
6752
6753 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6754
6755         * attribute.cs, const.cs: Fix bug #58590
6756
6757 2004-05-21  Martin Baulig  <martin@ximian.com>
6758
6759         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6760         out parameters if the end of the method is unreachable.  Fixes
6761         #58098. 
6762
6763 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6764
6765         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6766         Hari was right, why extra method.
6767
6768 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6769
6770         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6771
6772 2004-05-20  Martin Baulig  <martin@ximian.com>
6773
6774         * delegate.cs: Convert this file to Unix mode - like the original
6775         version in mcs is.
6776
6777 2004-05-20  Martin Baulig  <martin@ximian.com>
6778
6779         * attribute.cs: Convert this file to Unix mode - like the original
6780         version in mcs is.
6781
6782 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6783
6784        Fix bug #58688 (MCS does not report error when the same attribute
6785        is assigned twice)
6786
6787        * attribute.cs (Attribute.Emit): Distinction between null and default.
6788
6789 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6790
6791        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6792        of a top-level attribute without an attribute target.
6793        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6794        Make non-static.
6795        (Attribute.Conditional_GetConditionName), 
6796        (Attribute.Obsolete_GetObsoleteMessage): Update.
6797        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6798        part of ScanForIndexerName.
6799        (Attribute.CanIgnoreInvalidAttribute): New function.
6800        (Attribute.ScanForIndexerName): Move to ...
6801        (Attributes.ScanForIndexerName): ... here.
6802        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6803        (Attributes.Search): New internal variant that can choose not to
6804        complain if types aren't resolved.  The original signature now
6805        complains.
6806        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6807        complaints suppressed.
6808        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6809        only if it not useful.
6810        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6811        top-level for attributes that are shared between the assembly
6812        and a top-level class.
6813        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6814        * class.cs: Update to reflect changes.
6815        (DefineIndexers): Fuse loops.
6816        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6817        a couple more variants of attribute names.
6818
6819 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6820
6821         Fix bug #52585 (Implemented explicit attribute declaration)
6822
6823         * attribute.cs:
6824         (Attributable.ValidAttributeTargets): New abstract method. It gets
6825         list of valid attribute targets for explicit target declaration.
6826         (Attribute.Target): It holds target itself.
6827         (AttributeSection): Removed.
6828         (Attribute.CheckTargets): New method. It checks whether attribute
6829         target is valid for the current element.
6830
6831         * class.cs:
6832         (EventProperty): New class. For events that are declared like
6833         property (with add and remove accessors).
6834         (EventField): New class. For events that are declared like field.
6835         class.cs
6836
6837         * cs-parser.jay: Implemented explicit attribute target declaration.
6838
6839         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6840         Override ValidAttributeTargets.
6841
6842         * parameter.cs:
6843         (ReturnParameter): Class for applying custom attributes on 
6844         the return type.
6845         (ParameterAtribute): New class. Class for applying custom
6846         attributes on the parameter type.
6847
6848 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6849
6850         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6851         definitions. 
6852
6853         (Method): Allow UNSAFE here.
6854
6855         * modifiers.cs: Support unsafe reporting.
6856
6857 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6858
6859         * decl.cs: Fix bug #58478.
6860
6861 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6862
6863         * statement.cs: When checking for unreachable code on an EmptyStatement,
6864         set the location. Fixes bug #58488.
6865
6866 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6867
6868         * driver.cs: Add -pkg handling.
6869
6870         From Gonzalo: UseShelLExecute=false
6871
6872 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6873
6874         * attribute.cs:
6875         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6876         for attribute.
6877         (Attribute.IsClsCompliaceRequired): Moved to base for better
6878         accesibility.
6879         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6880         when attribute is AttributeUsageAttribute.
6881         (Attribute.GetValidTargets): Simplified.
6882         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6883         attribute for this type.
6884         (Attribute.ApplyAttributes): Method renamed to Emit and make
6885         non-static.
6886         (GlobalAttributeSection): New class for special handling of global
6887         attributes (assembly, module).
6888         (AttributeSection.Emit): New method.
6889
6890         * class.cs: Implemented Attributable abstract methods.
6891         (MethodCore.LabelParameters): Moved to Parameter class.
6892         (Accessor): Is back simple class.
6893         (PropertyMethod): Implemented Attributable abstract class.
6894         (DelegateMethod): Implemented Attributable abstract class.
6895         (Event): New constructor for disctintion between normal Event
6896         and Event with accessors.
6897
6898         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6899
6900         * codegen.cs, const.cs, decl.cs, delegate.cs:
6901         (CommonAssemblyModulClass): Implemented Attributable abstract class
6902         and simplified.
6903
6904         * enum.cs: Implement IAttributeSupport interface.
6905         (EnumMember): New class for emum members. Implemented Attributable
6906         abstract class
6907
6908         * parameter.cs:
6909         (ParameterBase): Is abstract.
6910         (ReturnParameter): New class for easier [return:] attribute handling.
6911
6912         * typemanager.cs: Removed builder_to_attr.
6913
6914 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6915
6916         Fix bug #57151.
6917         * attribute.cs (Attribute.GetPositionalValue): New function.
6918         * class.cs (TypeContainer.VerifyMembers): New function.
6919         (TypeContainer.Emit): Use it.
6920         (ClassOrStruct): New base class for Class and Struct.
6921         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6922         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6923         class.
6924         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6925         then each non-static field should have a FieldOffset attribute.
6926         Otherwise, none of the fields should have a FieldOffset attribute.
6927         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6928         and FieldOffset attributes.
6929         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6930         (TypeManager.field_offset_attribute_type): New core types.
6931         (TypeManager.InitCoreTypes): Initialize them.
6932
6933 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6934
6935         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6936         Return correct type.
6937         From bug #58270.
6938
6939 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6940
6941         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6942         be implicitly converted to ulong.
6943         
6944         * expression.cs: The logic for allowing operator &, | and ^ worked
6945         was wrong, it worked before because we did not report an error in
6946         an else branch.  Fixes 57895.
6947
6948         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6949         allow volatile fields to be reference types.
6950
6951 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6952
6953         * driver.cs: Add support for /debug-
6954
6955 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6956
6957         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6958         Add a 'complain' parameter to silence errors.
6959         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6960         silently overlooked type-resolutions.
6961         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6962         to reflect changes.
6963         (Attributes.Search): New function.
6964         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6965         (Attributes.GetAttributeFullName): Remove hack.
6966         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6967         Update to reflect changes.
6968         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6969         Use Attributes.Search instead of nested loops.
6970
6971 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6972
6973         * decl.cs:
6974         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6975         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6976         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6977
6978         * report.cs: (Report.Warning): Renamed to Warning_T because of
6979         parameter collision.
6980
6981 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6982
6983         * expression.cs (MemberAccess.ResolveMemberAccess):
6984         Exit with non-zero status after Report.Error.
6985         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6986         Likewise.
6987         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6988
6989 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6990
6991         * support.cs: Don't hang when the file is empty.
6992
6993 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6994
6995         * support.cs: In SeekableStreamReader, compute the preamble size of the
6996           underlying stream. Position changes should take into account that initial
6997           count of bytes.
6998
6999 2004-05-03  Todd Berman  <tberman@sevenl.net>
7000
7001         * driver.cs: remove unused GetSysVersion function.
7002
7003 2004-05-03  Todd Berman  <tberman@sevenl.net>
7004
7005         * driver.cs: Remove the hack from saturday, as well as the hack
7006         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7007         link_paths to get that bit proper.
7008
7009 2004-05-01  Todd Berman  <tberman@sevenl.net>
7010
7011         * driver.cs: Try a LoadFrom before a Load, this checks the current
7012         path. This is currently a bug in mono that is be fixed, however, this
7013         provides a workaround for now. This will be removed when the bug
7014         is fixed.
7015
7016 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7017
7018         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7019         incomplete key pairs (#57941).
7020
7021 2004-05-01  Todd Berman  <tberman@sevenl.net>
7022
7023         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7024         from the GAC
7025
7026 2004-04-30  Jackson Harper  <jackson@ximian.com>
7027
7028         * codegen.cs: Open keys readonly.
7029         
7030 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7031
7032         * typemanager.cs: don't report cyclic struct layout when a struct
7033         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7034         which has 2 Pango.Rectangle fields.
7035
7036 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7037
7038         * expression.cs: Handle IntPtr comparisons with IL code
7039         rather than a method call.
7040
7041 2004-04-29  Martin Baulig  <martin@ximian.com>
7042
7043         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7044         the list of PropertyInfo's in class hierarchy and find the
7045         accessor.  Fixes #56013.
7046
7047 2004-04-29  Martin Baulig  <martin@ximian.com>
7048
7049         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7050
7051 2004-04-29  Martin Baulig  <martin@ximian.com>
7052
7053         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7054
7055         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7056
7057 2004-04-29  Martin Baulig  <martin@ximian.com>
7058
7059         * class.cs (ConstructorInitializer.Resolve): Check whether the
7060         parent .ctor is accessible.  Fixes #52146.
7061
7062 2004-04-29  Martin Baulig  <martin@ximian.com>
7063
7064         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7065
7066         * statement.cs (Using.EmitLocalVariableDecls): Use
7067         TypeManager.idisposable_type, not typeof (IDisposable).
7068         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7069
7070 2004-04-29  Martin Baulig  <martin@ximian.com>
7071
7072         * class.cs (Event.Define): Don't emit the field and don't set
7073         RTSpecialName and SpecialName for events on interfaces.  Fixes
7074         #57703. 
7075
7076 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7077
7078         Refactor Attribute.ApplyAttributes.
7079         * attribute.cs (Attributable): New base class for objects that can
7080         have Attributes applied on them.
7081         (Attribute): Make AttributeUsage fields public.
7082         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7083         (Attribute.IsInternalCall): New property.
7084         (Attribute.UsageAttr): Convert to a public read-only property.
7085         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7086         (Attribute.ResolveType, Attribute.Resolve)
7087         (Attribute.ScanForIndexerName): Update to reflect changes.
7088         (Attribute.CheckAttributeTarget): Re-format.
7089         (Attribute.ApplyAttributes): Refactor, to various
7090         Attributable.ApplyAttributeBuilder methods.
7091         * decl.cs (MemberCore): Make Attributable.
7092         * class.cs (Accessor): Make Attributable.
7093         (MethodData.ApplyAttributes): Use proper attribute types, not
7094         attribute names.
7095         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7096         (TypeContainer.ApplyAttributeBuilder)
7097         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7098         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7099         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7100         (Operator.ApplyAttributeBuilder): New factored-out methods.
7101         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7102         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7103         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7104         * parameter.cs (ParameterBase): New Attributable base class
7105         that can also represent Return types.
7106         (Parameter): Update to the changes.
7107
7108 2004-04-29  Jackson Harper  <jackson@ximian.com>
7109
7110         * driver.cs: Prefer the corlib system version when looking for
7111         assemblies in the GAC. This is still a hack, but its a better hack
7112         now.
7113         
7114 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7115
7116         * decl.cs, enum.cs: Improved error 3005 reporting.
7117   
7118         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7119         (related_symbols): New private member for list of symbols
7120         related to reported error/warning.
7121         
7122         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7123
7124 2004-04-29  Martin Baulig  <martin@ximian.com>
7125
7126         * ecore.cs (Expression.Constantify): If we're an enum and
7127         TypeManager.TypeToCoreType() doesn't give us another type, use
7128         t.UnderlyingSystemType.  Fixes #56178.  
7129
7130 2004-04-29  Martin Baulig  <martin@ximian.com>
7131
7132         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7133         interfaces and for each interface, only add members directly
7134         declared in that interface.  Fixes #53255.
7135
7136 2004-04-28  Martin Baulig  <martin@ximian.com>
7137
7138         * expression.cs (ConditionalLogicalOperator): Use a temporary
7139         variable for `left' to avoid that we evaluate it more than once;
7140         bug #52588.
7141
7142 2004-04-28  Martin Baulig  <martin@ximian.com>
7143
7144         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7145         `void[]' (CS1547).
7146
7147 2004-04-28  Martin Baulig  <martin@ximian.com>
7148
7149         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7150         void (CS1547).
7151
7152         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7153         whether the type is not void (CS1547).
7154
7155 2004-04-28  Martin Baulig  <martin@ximian.com>
7156
7157         * expression.cs (Unary.DoResolveLValue): Override this and report
7158         CS0131 for anything but Operator.Indirection.
7159
7160 2004-04-28  Martin Baulig  <martin@ximian.com>
7161
7162         Committing a patch from Ben Maurer; see bug #50820.
7163
7164         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7165         check for classes.
7166
7167         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7168         classes.        
7169
7170 2004-04-28  Martin Baulig  <martin@ximian.com>
7171
7172         Committing a patch from Ben Maurer; see bug #50820.
7173
7174         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7175         check for classes.
7176
7177         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7178         classes.        
7179
7180 2004-04-28  Martin Baulig  <martin@ximian.com>
7181
7182         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7183         (Block.AddLabel): Call DoLookupLabel() to only search in the
7184         current block.
7185
7186 2004-04-28  Martin Baulig  <martin@ximian.com>
7187
7188         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7189         comparing StringConstants and NullLiterals in Equality and Inequality.
7190
7191 2004-04-28  Jackson Harper  <jackson@ximian.com>
7192
7193         * driver.cs: Attempt to load referenced assemblies from the
7194         GAC. This is the quick and dirty version of this method that
7195         doesnt take into account versions and just takes the first
7196         canidate found. Will be good enough for now as we will not have more
7197         then one version installed into the GAC until I update this method.
7198
7199 2004-04-28  Martin Baulig  <martin@ximian.com>
7200
7201         * typemanager.cs (TypeManager.CheckStructCycles): New public
7202         static method to check for cycles in the struct layout.
7203
7204         * rootcontext.cs (RootContext.PopulateTypes): Call
7205         TypeManager.CheckStructCycles() for each TypeContainer.
7206         [Note: We only need to visit each type once.]
7207
7208 2004-04-28  Martin Baulig  <martin@ximian.com>
7209
7210         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7211
7212         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7213         success and added `out object value'.  Use a `bool resolved' field
7214         to check whether we've already been called rather than
7215         `ConstantValue != null' since this breaks for NullLiterals.
7216
7217 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7218
7219         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7220         setting of this flag, since the 'set' method may be non-public.
7221
7222 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7223
7224         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7225         check on current_vector.Block.
7226
7227 2004-04-27  Martin Baulig  <martin@ximian.com>
7228
7229         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7230         a field initializer.  Fixes #56459.
7231
7232 2004-04-27  Martin Baulig  <martin@ximian.com>
7233
7234         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7235         we're not attempting to use an indexer.  Fixes #52154.
7236
7237 2004-04-27  Martin Baulig  <martin@ximian.com>
7238
7239         * statement.cs (Return): Don't create a return label if we don't
7240         need it; reverts my change from January 20th.  Thanks to Ben
7241         Maurer for this.
7242
7243 2004-04-27  Martin Baulig  <martin@ximian.com>
7244
7245         According to the spec, `goto' can only leave a nested scope, but
7246         never enter it.
7247
7248         * statement.cs (Block.LookupLabel): Only lookup in the current
7249         block, don't recurse into parent or child blocks.
7250         (Block.AddLabel): Check in parent and child blocks, report
7251         CS0140/CS0158 if we find a duplicate.
7252         (Block): Removed this indexer for label lookups.
7253         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7254         this already does the error reporting for us.
7255
7256         * flowanalysis.cs
7257         (FlowBranching.UsageVector.Block): New public variable; may be null.
7258         (FlowBranching.CreateSibling): Added `Block' argument.
7259         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7260         label for the target of a `goto' and check whether we're not
7261         leaving a `finally'.
7262
7263 2004-04-27  Martin Baulig  <martin@ximian.com>
7264
7265         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7266         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7267         just for returns).
7268
7269 2004-04-27  Martin Baulig  <martin@ximian.com>
7270
7271         * statement.cs (Block.AddLabel): Also check for implicit blocks
7272         and added a CS0158 check.
7273
7274 2004-04-27  Martin Baulig  <martin@ximian.com>
7275
7276         * flowanalysis.cs (FlowBranchingLoop): New class.
7277         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7278         UsageVector's instead of an ArrayList.
7279         (FlowBranching.Label): Likewise.
7280         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7281         (FlowBranching.AddBreakVector): New method.
7282
7283 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7284
7285         * attribute.cs: Small regression fix: only convert the type if we
7286         the type is different, fixes System.Drawing build.
7287
7288 2004-04-27  Martin Baulig  <martin@ximian.com>
7289
7290         * attribute.cs (Attribute.Resolve): If we have a constant value
7291         for a named field or property, implicity convert it to the correct
7292         type.
7293
7294 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7295
7296         * statement.cs (Block.Block): Implicit blocks share
7297         'child_variable_names' fields with parent blocks.
7298         (Block.AddChildVariableNames): Remove.
7299         (Block.AddVariable): Mark variable as "used by a child block" in
7300         every surrounding block.
7301         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7302         been used in a child block, complain about violation of "Invariant
7303         meaning in blocks" rule.
7304         * cs-parser.jay (declare_local_variables): Don't use
7305         AddChildVariableNames.
7306         (foreach_statement): Don't create an implicit block: 'foreach'
7307         introduces a scope.
7308
7309 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7310
7311         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7312         converting from 0L to ulong.  Fixes 57522.
7313
7314 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7315
7316         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7317         derived class hides via 'new' keyword field from base class (test-242.cs).
7318         TODO: Handle this in the more general way.
7319         
7320         * class.cs (CheckBase): Ditto.
7321
7322 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7323
7324         * decl.cs (caching_flags): New member for storing cached values
7325         as bit flags.
7326         (MemberCore.Flags): New enum where bit flags for caching_flags
7327         are defined.
7328         (MemberCore.cls_compliance): Moved to caching_flags.
7329         (DeclSpace.Created): Moved to caching_flags.
7330
7331         * class.cs: Use caching_flags instead of DeclSpace.Created
7332         
7333 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7334
7335         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7336         if we are only a derived class, not a nested class.
7337
7338         * typemanager.cs: Same as above, but do this at the MemberLookup
7339         level (used by field and methods, properties are handled in
7340         PropertyExpr).   Allow for the qualified access if we are a nested
7341         method. 
7342
7343 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7344
7345         * class.cs: Refactoring.
7346         (IMethodData): New inteface; Holds links to parent members
7347         to avoid member duplication (reduced memory allocation).
7348         (Method): Implemented IMethodData interface.
7349         (PropertyBase): New inner classes for get/set methods.
7350         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7351         (Event): New inner classes for add/remove methods.
7352         (Event.DelegateMethod): Implemented IMethodData interface.
7353
7354         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7355         EmitContext (related to class.cs refactoring).
7356
7357 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7358
7359         * delegate.cs (Delegate.VerifyApplicability): If the number of
7360         arguments are the same as the number of parameters, first try to
7361         verify applicability ignoring  any 'params' modifier on the last
7362         parameter.
7363         Fixes #56442.
7364
7365 2004-04-08  Martin Baulig  <martin@ximian.com>
7366
7367         Merged latest changes into gmcs.  Please keep this comment in
7368         here, it makes it easier for me to see what changed in MCS since
7369         the last time I merged.
7370
7371 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7372
7373         * class.cs (TypeContainer.AddIndexer): Use
7374         'ExplicitInterfaceName' to determine if interface name was
7375         explicitly specified.  'InterfaceType' is not initialized at this time.
7376         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7377         Indexers array is already in the required order.  Initialize
7378         'IndexerName' only if there are normal indexers.
7379         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7380         (TypeContainer.Emit): Emit DefaultMember attribute only if
7381         IndexerName is initialized.
7382         Fixes #56300.
7383
7384 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7385
7386         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7387         Fixes #57007
7388
7389 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7390
7391         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7392         attributes.
7393         Fix for #56456.
7394
7395         * attribute.cs (Attribute.Resolve): Check for duplicate named
7396         attributes.
7397         Fix for #56463.
7398
7399 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7400
7401         * iterators.cs (MarkYield): track whether we are in an exception,
7402         and generate code accordingly.  Use a temporary value to store the
7403         result for our state.
7404
7405         I had ignored a bit the interaction of try/catch with iterators
7406         since their behavior was not entirely obvious, but now it is
7407         possible to verify that our behavior is the same as MS .NET 2.0
7408
7409         Fixes 54814
7410
7411 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * iterators.cs: Avoid creating temporaries if there is no work to
7414         do. 
7415
7416         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7417         Enumerations, use TypeManager.EnumToUnderlying and call
7418         recursively. 
7419
7420         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7421         bug #57013
7422
7423         (This.Emit): Use EmitContext.EmitThis to emit our
7424         instance variable.
7425
7426         (This.EmitAssign): Ditto.
7427
7428         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7429         codepaths, we will move all the functionality into
7430         Mono.CSharp.This 
7431
7432         (FieldExpr.EmitAssign): Ditto.
7433
7434         This fixes several hidden bugs that I uncovered while doing a code
7435         review of this today.
7436
7437         * codegen.cs (EmitThis): reworked so the semantics are more clear
7438         and also support value types "this" instances.
7439
7440         * iterators.cs: Changed so that for iterators in value types, we
7441         do not pass the value type as a parameter.  
7442
7443         Initialization of the enumerator helpers is now done in the caller
7444         instead of passing the parameters to the constructors and having
7445         the constructor set the fields.
7446
7447         The fields have now `assembly' visibility instead of private.
7448
7449 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7450
7451         * expression.cs (Argument.Resolve): Check if fields passed as ref
7452         or out are contained in a MarshalByRefObject.
7453
7454         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7455         another compiler type.
7456
7457 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7458
7459         * class.cs (Indexer.Define): use the new name checking method.
7460         Also, return false on an error.
7461         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7462         (is_identifier_[start/part]_character): make static.
7463
7464 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7465
7466         * expression.cs (Binary.ResolveOperator): Do no append strings
7467         twice: since we can be invoked more than once (array evaluation)
7468         on the same concatenation, take care of this here.  Based on a fix
7469         from Ben (bug #56454)
7470
7471 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7472
7473         * codegen.cs: Fix another case where CS1548 must be reported (when 
7474         delay-sign isn't specified and no private is available #56564). Fix
7475         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7476         error when MCS is used on the MS runtime and we need to delay-sign 
7477         (which seems unsupported by AssemblyBuilder - see #56621).
7478
7479 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7480
7481         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7482         (TypeManager.ComputeNamespaces): Faster implementation for
7483         Microsoft runtime.
7484
7485         * compiler.csproj: Updated AssemblyName to mcs.
7486
7487 2004-05-11  Jackson Harper  <jackson@ximian.com>
7488
7489         * Makefile: Preserve MONO_PATH
7490         
7491 2004-05-11  Jackson Harper  <jackson@ximian.com>
7492
7493         * Makefile: Use mono and mcs to build gmcs
7494         
7495 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7496
7497         * codegen.cs: Add patch from Robert Shade
7498         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7499         sync with mcs.
7500
7501 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7502
7503         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7504         incomplete key pairs (#57941).
7505
7506 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7507
7508         * codegen.cs: Fix another case where CS1548 must be reported (when 
7509         delay-sign isn't specified and no private is available #56564). Fix
7510         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7511         error when MCS is used on the MS runtime and we need to delay-sign 
7512         (which seems unsupported by AssemblyBuilder - see #56621).
7513
7514 2004-04-29  Jackson Harper  <jackson@ximian.com>
7515
7516         * Makefile: Set MONO_PATH to use the bootstrap corlib
7517         * driver.cs: Check the GAC for referenced assemblies.
7518                 
7519 2004-04-29  Martin Baulig  <martin@ximian.com>
7520
7521         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7522
7523 2004-04-07  Martin Baulig  <martin@ximian.com>
7524
7525         * expression.cs (Binary.ResolveOperator): Added special case for
7526         Equality/Inequality between a type parameter and a null literal.
7527
7528 2004-04-07  Martin Baulig  <martin@ximian.com>
7529
7530         * convert.cs: Check null literal -> type parameter conversions.
7531
7532 2004-04-07  Martin Baulig  <martin@ximian.com>
7533
7534         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7535         `class' and `struct' constraints.
7536
7537 2004-04-07  Martin Baulig  <martin@ximian.com>
7538
7539         * generic.cs (SpecialConstraint): New public enum.
7540         (Constraints.Resolve): Added support for the `class' and `struct'
7541         constraints.
7542
7543         * cs-parser.jay (type_parameter_constraint): Added support for the
7544         `class' and `struct' constraints.
7545
7546 2004-04-07  Martin Baulig  <martin@ximian.com>
7547
7548         * support.cs (GenericConstraints): Replaced `Types' by
7549         `ClassConstraint' and `InterfaceConstraints'; added
7550         `HasClassConstraint'.   
7551
7552 2004-04-07  Martin Baulig  <martin@ximian.com>
7553
7554         * generic.cs
7555         (Constraints.InterfaceConstraints): New public property.
7556         (Constraints.Types): Make this property public
7557         (TypeParameter): Implement IMemberContainer.
7558         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7559         instead of a TypeBuilder/MethodBuilder; pass the interface
7560         constraints to TypeManager.AddTypeParameter().
7561         (TypeParameter.DefineType): Just take an EmitContext and no
7562         TypeBuilder/MethodBuilder.  Use the new public API.
7563
7564         * typemanager.cs (TypeManager.AddTypeParameter): Added
7565         `TypeExpr[]' argument; add the interfaces to the
7566         `builder_to_ifaces' hash.
7567         (TypeManager.LookupMemberContainer): For
7568         GenericTypeParameterBuilders, get the TypeParameter from the
7569         `builder_to_type_param'.
7570         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7571         the TypeParameter and call FindMembers on it.
7572
7573 2004-04-07  Martin Baulig  <martin@ximian.com>
7574
7575         * class.cs
7576         (MethodCore.GenericMethod): Moved this field here from Method.
7577         (MethodCore.IsDuplicateImplementation): Take the number of type
7578         parameters into account if we're a generic method.
7579
7580         * expression.cs (Invocation.InferTypeArguments): Don't return true
7581         if `arguments' is null; we still need to check whether we actually
7582         don't need to infer anything in this case.
7583         (MemberAccess): Merged the functionality from GenericMemberAccess
7584         into this class.
7585
7586         * generic.cs (GenericMemberAccess): Removed.
7587
7588 2004-04-05  Martin Baulig  <martin@ximian.com>
7589
7590         * decl.cs (MemberCore): For generic classes, interfaces and
7591         structs, `Name' now includes the number of type parameters
7592         ("Stack!1.Node!1").
7593         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7594         encode the number of type arguments in the type name.
7595
7596         * expression.cs (Expression.MemberLookup): Removed the
7597         `num_type_args' argument; we now encode the number of type
7598         arguments in the type name.
7599
7600         * ecore.cs (SimpleName): Encode the number of type arguments in
7601         the type name itself.
7602
7603         * generic.cs (ConstructedType): Likewise.
7604
7605         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7606         `MemberName'; we now include the number of type parameters in the
7607         type name.
7608
7609         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7610         (TypeManager.MemberLookup): Removed the
7611         `num_type_args' argument; we now encode the number of type
7612         arguments in the type name.     
7613
7614 2004-04-03  Martin Baulig  <martin@ximian.com>
7615
7616         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7617         (MemberCore.MemberName): Moved here from MemberBase.
7618         (DeclSpace.SetParameterInfo): Just take the constraints as an
7619         ArrayList; we already have the type parameters in our
7620         `MemberName'; also do the CS0080 reporting here.
7621
7622         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7623         `IDENTIFIER opt_type_parameter_list'; when constructing our
7624         `MemberName', it'll already include our type parameters.
7625         (class_declaration, interface_declaration): Likewise.
7626         (delegate_declaration): Likewise.
7627         (MakeName): Take a MemberName and return a MemberName.
7628         The following two changes are required to avoid shift/reduce conflicts:
7629         (member_name): Don't include a TypeName anymore; ie. this is now
7630         just 'IDENTIFIER opt_type_parameter_list'.
7631         (property_declaration, event_declaration): Use a
7632         `namespace_or_type_name' instead of a `member_name'.            
7633
7634 2004-04-03  Martin Baulig  <martin@ximian.com>
7635
7636         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7637         `MemberName' class.
7638         (TypeName): Formerly known as MemberName.
7639
7640         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7641         instead of a `MemberName'.
7642
7643         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7644         (member_name): New rule; create a MemberName.
7645
7646 2004-04-02  Martin Baulig  <martin@ximian.com>
7647
7648         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7649         (CS0305 and CS0308).
7650
7651 2004-04-02  Martin Baulig  <martin@ximian.com>
7652
7653         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7654         support for nested types.
7655
7656 2004-04-02  Martin Baulig  <martin@ximian.com>
7657
7658         * ecore.cs (IAlias): New public interface.
7659         (TypeExpr, TypeExpression): Implement IAlias.
7660         (TypeAliasExpression): New public class.
7661
7662         * namespace.cs (Namespace): Implement IAlias.
7663         (Namespace.Lookup): Return an IAlias instead on an object.
7664         (Namespace.DefineName): Take an IAlias instead of an object.
7665         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7666         an object.
7667         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7668         Expression.
7669         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7670         object.
7671         (NamespaceEntry.Lookup): Likewise.
7672
7673         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7674         instead of a Type.      
7675
7676         * decl.cs (DeclSpace): Implement IAlias.
7677         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7678
7679         * generic.cs (ConstructedType): Improved error checking.
7680
7681 2004-04-02  Martin Baulig  <martin@ximian.com>
7682
7683         * convert.cs: Added type parameter conversions.
7684
7685         * ecore.cs
7686         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7687         (ClassCast.Emit): If the source type is a type parameter, box it.
7688         If the target type is a type parameter, emit an `unbox.any'
7689         instead of a `classcast'.1      
7690
7691 2004-04-01  Martin Baulig  <martin@ximian.com>
7692
7693         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7694
7695 2004-04-01  Martin Baulig  <martin@ximian.com>
7696
7697         * generic.cs (ConstructedType.CheckConstraints): Use
7698         Convert.ImplicitStandardConversionExists(); user-defined implicit
7699         conversions are not allowed according to the spec.
7700
7701 2004-03-30  Martin Baulig  <martin@ximian.com>
7702
7703         * expression.cs (New): Added support for type parameters.
7704
7705         * typemanager.cs
7706         (TypeManager.activator_type): New public static field.
7707         (TypeManager.activator_create_instance): Likewise.
7708
7709 2004-03-30  Martin Baulig  <martin@ximian.com>
7710
7711         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7712         public method.
7713
7714 2004-03-30  Martin Baulig  <martin@ximian.com>
7715
7716         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7717         the spec here: the argument type must be convertible to the
7718         constraints.
7719
7720 2004-03-30  Martin Baulig  <martin@ximian.com>
7721
7722         * generic.cs
7723         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7724         TypeManager.AddTypeParameter().
7725         (ConstructedType.CheckConstraints): Re-enable this and actually
7726         check whether we have a constructor constraint.
7727
7728         * typemanager.cs
7729         (TypeManager.builder_to_type_param): New static field.
7730         (TypeManager.AddTypeParameter): New static method.
7731         (TypeManager.LookupTypeParameter): New public method.
7732
7733 2004-03-30  Martin Baulig  <martin@ximian.com>
7734
7735         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7736         the new API to actually define the constructor constraint.
7737
7738         * typemanager.cs
7739         (TypeManager.new_constraint_attr_type): New static field.
7740         (TypeManager.InitCoreTypes): Initialize it.
7741
7742 2004-03-30  Martin Baulig  <martin@ximian.com>
7743
7744         * generic.cs (Constraints): Completed error checking, use correct
7745         error numbers.
7746
7747 2004-03-29  Martin Baulig  <martin@ximian.com>
7748
7749         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7750
7751         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7752         public version which takes a `ParameterData pd' instead of an
7753         `ArrayList args'.
7754
7755 2004-03-29  Martin Baulig  <martin@ximian.com>
7756
7757         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7758         not a MethodInfo.       
7759
7760 2004-03-29  Martin Baulig  <martin@ximian.com>
7761
7762         * expression.cs (Argument.ResolveMethodGroup): If we're a
7763         ConstructedType, call GetMemberAccess() on it.  
7764
7765 2004-03-29  Martin Baulig  <martin@ximian.com>
7766
7767         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7768         (MethodCore.CheckGenericOverride): When overriding a generic
7769         method, check whether the constraints match.
7770
7771         * support.cs (GenericConstraints): New public interface.
7772         (ParameterData.GenericConstraints): New public method.
7773
7774         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7775         method parameter and compute our constraints if appropriate.
7776         (Parameter.GenericConstraints): New public property.
7777
7778         * generic.cs (Constraints): Implement GenericConstraints.
7779
7780 2004-03-29  Martin Baulig  <martin@ximian.com>
7781
7782         * decl.cs (MemberCache.FindMemberToOverride): Use
7783         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7784
7785 2004-03-29  Martin Baulig  <martin@ximian.com>
7786
7787         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7788
7789 2004-03-29  Martin Baulig  <martin@ximian.com>
7790
7791         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7792         not allowed on non-generic declarations").
7793
7794 2004-03-29  Martin Baulig  <martin@ximian.com>
7795
7796         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7797         public version of this method.
7798
7799         * class.cs (MethodCore.IsDuplicateImplementation): Use
7800         Invocation.InferTypeArguments() to check this.
7801
7802 2004-03-29  Martin Baulig  <martin@ximian.com>
7803
7804         * convert.cs: Use TypeManager.IsDelegateType() instead of
7805         comparing types correctly.
7806
7807 2004-03-29  Martin Baulig  <martin@ximian.com>
7808
7809         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7810         types directly to make it work for generic instances.
7811
7812         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7813
7814 2004-03-29  Martin Baulig  <martin@ximian.com>
7815
7816         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7817         support for arrays.     
7818
7819 2004-03-24  Martin Baulig  <martin@ximian.com>
7820
7821         * decl.cs (DeclSpace.FindType): Also use
7822         TypeManager.CheckGeneric() for types from the using clauses.
7823
7824 2004-03-23  Martin Baulig  <martin@ximian.com>
7825
7826         * expression.cs (Invocation.OverloadResolve): Added `bool
7827         may_fail' argument and use it instead of the Location.IsNull() hack.
7828
7829 2004-03-23  Martin Baulig  <martin@ximian.com>
7830
7831         * expression.cs (Invocation.InferType): Use correct type inference
7832         rules here.     
7833
7834 2004-03-23  Martin Baulig  <martin@ximian.com>
7835
7836         * ecore.cs (MethodGroupExpr.Name): Use
7837         TypeManager.CSharpSignature() instead of just the name.
7838
7839         * expression.cs (Invocation.OverloadResolve): Provide better error
7840         reporting.
7841         (Invocation.DoResolve): OverloadResolve() never returns null
7842         without reporting an error, so removed the error -6 reporting here.
7843
7844 2004-03-23  Martin Baulig  <martin@ximian.com>
7845
7846         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7847         generic methods.
7848
7849         * cs-parser.jay (delegate_declaration): Support generic delegates.
7850
7851         * delegate.cs: Support generic delegates.
7852
7853 2004-03-22  Martin Baulig  <martin@ximian.com>
7854
7855         * expression.cs (Invocation.InferParamsTypeArguments): New static
7856         method; does type inference for params arguments.
7857
7858 2004-03-21  Martin Baulig  <martin@ximian.com>
7859
7860         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7861         method; checks whether a method is a generic method.    
7862
7863         * expression.cs (Invocation.InferTypeArguments): New static method;
7864         infer type arguments for generic method invocation.
7865
7866         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7867         property; we set this to true if we're resolving a generic method
7868         invocation and the user specified type arguments, ie. we're not
7869         doing type inference.
7870
7871 2004-03-20  Martin Baulig  <martin@ximian.com>
7872
7873         * class.cs (MethodData.DeclaringType): New public property.
7874         (MethodData.Define): Set DeclaringType here.
7875         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7876         instead of OperatorMethodBuilder.DeclaringType.
7877
7878 2004-03-20  Martin Baulig  <martin@ximian.com>
7879
7880         * cs-tokenizer.cs (xtoken): Return a special
7881         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7882
7883         * cs-parser.jay (default_value_expression): Switch to the new
7884         syntax (14.5.13).
7885
7886 2004-03-19  Martin Baulig  <martin@ximian.com>
7887
7888         * decl.cs (MemberName): New class.  We use this to "construct"
7889         namespace_or_type_name's.
7890
7891         * generics.cs (TypeArguments.GetDeclarations): New public method;
7892         returns the type arguments as a string[] and reports a CS0081 if
7893         one of them is not an identifier.
7894
7895         * class.cs (MemberBase): The .ctor now takes the name as a
7896         MemberName instead of a string.
7897         (MemberBase.ExplicitInterfaceName): Changed type from string to
7898         Expression.
7899         (MemberBase.DoDefine): If we're an explicit implementation, the
7900         InterfaceType may be a generic instance.
7901
7902         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7903         (namespace_name): Call MemberName.GetName () to transform the
7904         MemberName into a string and ensure we don't have any type
7905         arguments.
7906         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7907         MemberName into an expression.
7908         (method_header): Use namespace_or_type_name instead of member_name.     
7909
7910 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7911
7912         * rootcontext.cs: Add new types to the boot resolution.
7913
7914         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7915         MulticastDelegate is not allowed.
7916
7917         * typemanager.cs: Add new types to lookup: System.TypedReference
7918         and ArgIterator.
7919
7920         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7921         check for TypedReference or ArgIterator, they are not allowed. 
7922
7923         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7924         makes us properly catch 1510 in some conditions (see bug 56016 for
7925         details). 
7926
7927 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7928
7929         * CryptoConvert.cs: update from corlib version
7930         with endian fixes.
7931
7932 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7933
7934         * class.cs (Indexer.Define): Check indexername declaration
7935
7936 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7937
7938         * attribute.cs (IsClsCompliant): Fixed problem with handling
7939         all three states (compliant, not-compliant, undetected).
7940
7941 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7942
7943         * attribute.cs (Attribute): Location is now public.
7944         (Resolve): Store resolved arguments (pos_values) in attribute class.
7945         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7946         (GetClsCompliantAttributeValue): New method that gets
7947         CLSCompliantAttribute value.
7948         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7949         if exists else null.
7950         (AttributeTester): New class for CLS-Compliant verification routines.
7951
7952         * class.cs (Emit): Add CLS-Compliant verification.
7953         (Method.GetSignatureForError): Implemented.
7954         (Constructor.GetSignatureForError): Implemented
7955         (Constructor.HasCompliantArgs): Returns if constructor has
7956         CLS-Compliant arguments.
7957         (Constructor.Emit): Override.
7958         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7959         is needed to test only parameters.
7960         (FieldBase.GetSignatureForError): Implemented.
7961         (TypeContainer): New member for storing base interfaces.
7962         (TypeContainer.FindMembers): Search in base interfaces too.
7963
7964         * codegen.cs (GetClsComplianceAttribute): New method that gets
7965         assembly or module CLSCompliantAttribute value.
7966         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7967         for assembly.
7968         (ModuleClass.Emit): Add error 3012 test.
7969
7970         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7971
7972         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7973         state for all decl types.
7974         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7975         if CLS-Compliant tests are required.
7976         (IsClsCompliaceRequired): New method. Analyze whether code
7977         must be CLS-Compliant.
7978         (IsExposedFromAssembly): New method. Returns true when MemberCore
7979         is exposed from assembly.
7980         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7981         value or gets cached value.
7982         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7983         is explicitly marked with CLSCompliantAttribute.
7984         (IsIdentifierClsCompliant): New abstract method. This method is
7985         used to testing error 3005.
7986         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7987         for identifier and parameters CLS-Compliant testing.
7988         (VerifyClsCompliance): New method. The main virtual method for
7989         CLS-Compliant verifications.
7990         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7991         null. I don't know why is null (too many public members !).
7992         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7993         and get value of first CLSCompliantAttribute that found.
7994
7995         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7996         (VerifyClsCompliance): Override and add extra tests.
7997
7998         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7999         clscheck- disable CLS-Compliant verification event if assembly is has
8000         CLSCompliantAttribute(true).
8001
8002         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8003         ApllyAttribute is now called in emit section as in the other cases.
8004         Possible future Emit integration.
8005         (IsIdentifierClsCompliant): New override.
8006         (VerifyClsCompliance): New override.
8007         (GetEnumeratorName): Returns full enum name.
8008
8009         * parameter.cs (GetSignatureForError): Implemented.
8010
8011         * report.cs (WarningData): New struct for Warning message information.
8012         (LocationOfPreviousError): New method.
8013         (Warning): New method. Reports warning based on the warning table.
8014         (Error_T): New method. Reports error based on the error table.
8015
8016         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8017         verifications are done here.
8018
8019         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8020
8021         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8022         CLSCompliantAttribute.
8023         (all_imported_types): New member holds all imported types from other
8024         assemblies.
8025         (LoadAllImportedTypes): New method fills static table with exported types
8026         from all referenced assemblies.
8027         (Modules): New property returns all assembly modules.
8028
8029 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8030
8031         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8032         throwing a parser error.
8033
8034         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8035         which removes the hardcoded get_/set_ prefixes for properties, as
8036         IL allows for the properties to be named something else.  
8037
8038         Bug #56013
8039
8040         * expression.cs: Do not override operand before we know if it is
8041         non-null.  Fix 56207
8042
8043 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8044
8045         * typemanager.cs: support for pinned variables.
8046
8047 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8048
8049         * decl.cs, typemanager.cs: Avoid using an arraylist
8050         as a buffer if there is only one result set.
8051
8052 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8053
8054         * expression.cs: Make sure you cant call a static method
8055         with an instance expression, bug #56174.
8056
8057 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8058
8059         * class.cs (IsDuplicateImplementation): Improve error reporting to
8060         flag 663 (method only differs in parameter modifier).
8061
8062         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8063         in preprocessor directives.
8064
8065         * location.cs (LookupFile): Allow for the empty path.
8066
8067         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8068         better approach for some of that patch, but its failing with the
8069         CharSet enumeration.  For now try/catch will do.
8070
8071         * typemanager.cs: Do not crash if a struct does not have fields.
8072         Fixes 56150.
8073
8074 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8075
8076         * expression.cs: cs0213, cant fix a fixed expression.
8077         fixes 50231.
8078
8079 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8080
8081         * cs-parser.jay: detect invalid embeded statements gracefully.
8082         bug #51113.
8083
8084 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8085
8086         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8087         As a regex:
8088         s/
8089         the invocation type may not be a subclass of the tye of the item/
8090         The type of the item must be a subclass of the invocation item.
8091         /g
8092
8093         Fixes bug #50820.
8094
8095 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8096
8097         * attribute.cs: Added methods to get a string and a bool from an
8098         attribute. Required to information from AssemblyKeyFileAttribute,
8099         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8100         * codegen.cs: Modified AssemblyName creation to include support for
8101         strongnames. Catch additional exceptions to report them as CS1548.
8102         * compiler.csproj: Updated include CryptoConvert.cs.
8103         * compiler.csproj.user: Removed file - user specific configuration.
8104         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8105         Mono.Security assembly. The original class is maintained and tested in
8106         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8107         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8108         like CSC 8.0 (C# v2) supports.
8109         * Makefile: Added CryptoConvert.cs to mcs sources.
8110         * rootcontext.cs: Added new options for strongnames.
8111
8112 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8113
8114         * driver.cs: For --expect-error, report error code `2'
8115         if the program compiled with no errors, error code `1' if
8116         it compiled with an error other than the one expected.
8117
8118 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8119
8120         * compiler.csproj: Updated for Visual Studio .NET 2003.
8121         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8122         * compiler.sln: Updated for Visual Studio .NET 2003.
8123
8124 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8125
8126         * expression.cs: Fix bug #47234. We basically need to apply the
8127         rule that we prefer the conversion of null to a reference type
8128         when faced with a conversion to 'object' (csc behaviour).
8129
8130 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8131
8132         * statement.cs: Shorter form for foreach, eliminates
8133         a local variable. r=Martin.
8134
8135 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8136
8137         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8138         checks if we can use brtrue/brfalse to test for 0.
8139         * expression.cs: use the above in the test for using brtrue/brfalse.
8140         cleanup code a bit.
8141
8142 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8143
8144         * expression.cs: Rewrite string concat stuff. Benefits:
8145
8146         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8147         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8148         rather than a concat chain.
8149
8150         * typemanager.cs: Add lookups for more concat overloads.
8151
8152 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8153
8154         * expression.cs: Emit shorter il code for array init.
8155
8156         newarr
8157         dup
8158         // set 1
8159
8160         // set 2
8161
8162         newarr
8163         stloc.x
8164
8165         ldloc.x
8166         // set 1
8167
8168         ldloc.x
8169         // set 2
8170
8171 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8172
8173         * statement.cs: Before, two switch blocks would be merged if the
8174         total size of the blocks (end_item - begin_item + 1) was less than
8175         two times the combined sizes of the blocks.
8176
8177         Now, it will only merge if after the merge at least half of the
8178         slots are filled.
8179
8180         fixes 55885.
8181
8182 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8183
8184         * class.cs : csc build fix for GetMethods(). See bug #52503.
8185
8186 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8187
8188         * expression.cs: Make sure fp comparisons work with NaN.
8189         This fixes bug #54303. Mig approved this patch a long
8190         time ago, but we were not able to test b/c the runtime
8191         had a related bug.
8192
8193 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8194
8195         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8196
8197 2004-03-19  Martin Baulig  <martin@ximian.com>
8198
8199         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8200         two overloads may unify for some type parameter substitutions and
8201         report a CS0408 if appropriate.
8202
8203 2004-03-19  Martin Baulig  <martin@ximian.com>
8204
8205         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8206         error here and not in our caller.
8207
8208 2004-03-19  Martin Baulig  <martin@ximian.com>
8209
8210         * interface.cs: Completely killed this file.
8211         (Interface): We're now a TypeContainer and live in class.cs.
8212
8213         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8214         argument; we're now also called for interfaces.
8215         (TypeContainer.DefineMembers): Allow this method being called
8216         multiple times.
8217         (TypeContainer.GetMethods): New public method; formerly known as
8218         Interface.GetMethod().  This is used by PendingImplementation.
8219         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8220         it's now private and non-static.
8221         (Interface): Moved this here; it's now implemented similar to
8222         Class and Struct.
8223         (Method, Property, Event, Indexer): Added `bool is_interface'
8224         argument to their .ctor's.
8225         (MemberBase.IsInterface): New public field.
8226
8227         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8228         instances instead of InterfaceMethod, InterfaceProperty, etc.
8229         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8230         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8231
8232 2004-03-19  Martin Baulig  <martin@ximian.com>
8233
8234         * class.cs (MethodCore.IsDuplicateImplementation): New private
8235         method which does the CS0111 checking.
8236         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8237         Use IsDuplicateImplementation().
8238
8239 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8240
8241         * decl.cs (FindMemberToOverride): New method to find the correct
8242         method or property to override in the base class.
8243         * class.cs
8244             - Make Method/Property use the above method to find the
8245               version in the base class.
8246             - Remove the InheritableMemberSignatureCompare as it is now
8247               dead code.
8248
8249         This patch makes large code bases much faster to compile, as it is
8250         O(n) rather than O(n^2) to do this validation.
8251
8252         Also, it fixes bug 52458 which is that nested classes are not
8253         taken into account when finding the base class member.
8254
8255         Reviewed/Approved by Martin.
8256
8257 2004-03-17  Martin Baulig  <martin@ximian.com>
8258
8259         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8260         of type arguments into account; use the `real_num_type_args'
8261         approach like in DoResolveAsTypeStep().
8262
8263         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8264         nested types.
8265
8266 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8267
8268         * interface.cs: In all interface classes removed redundant
8269         member initialization.
8270
8271 2004-03-16  Martin Baulig  <martin@ximian.com>
8272
8273         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8274
8275 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8276
8277         * decl.cs (DefineTypeAndParents): New helper method to define a
8278         type's containers before the type itself is defined;  This is a
8279         bug exposed by the recent changes to Windows.Forms when an
8280         implemented interface was defined inside a class that had not been
8281         built yet.   
8282
8283         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8284
8285         (Check): Loop correctly to report errors modifiers
8286         (UNSAFE was not in the loop, since it was the same as TOP).
8287
8288         * interface.cs: Every interface member now takes a ModFlags,
8289         instead of a "is_new" bool, which we set on the base MemberCore. 
8290
8291         Every place where we called "UnsafeOk" in the interface, now we
8292         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8293         the unsafe settings from the member declaration instead of the
8294         container interface. 
8295
8296         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8297
8298         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8299         `set_indexer_name' to the pending bits (one per type).
8300
8301         We fixed a bug today that was picking the wrong method to
8302         override, since for properties the existing InterfaceMethod code
8303         basically ignored the method name.  Now we make sure that the
8304         method name is one of the valid indexer names.
8305
8306 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8307  
8308         * support.cs (SeekableStreamReader): Keep track of stream byte
8309         positions and don't mix them with character offsets to the buffer.
8310
8311         Patch from Gustavo Giráldez
8312
8313 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8314
8315         * interface.cs (InterfaceSetGetBase): Removed double member
8316         initialization, base class does it as well.
8317
8318 2004-03-13  Martin Baulig  <martin@ximian.com>
8319
8320         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8321         when compiling corlib.
8322
8323 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8324
8325         * convert.cs (ExplicitConversion): We were reporting an error on
8326         certain conversions (object_type source to a value type, when the
8327         expression was `null') before we had a chance to pass it through
8328         the user defined conversions.
8329
8330         * driver.cs: Replace / and \ in resource specifications to dots.
8331         Fixes 50752
8332
8333         * class.cs: Add check for duplicate operators.  Fixes 52477
8334
8335 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8336
8337         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8338         that are in the middle of the statements, not only at the end.
8339         Fixes #54987
8340
8341         * class.cs (TypeContainer.AddField): No longer set the
8342         `HaveStaticConstructor' flag, now we call it
8343         `UserDefineStaticConstructor' to diferentiate the slightly
8344         semantic difference.
8345
8346         The situation is that we were not adding BeforeFieldInit (from
8347         Modifiers.TypeAttr) to classes that could have it.
8348         BeforeFieldInit should be set to classes that have no static
8349         constructor. 
8350
8351         See:
8352
8353         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8354
8355         And most importantly Zoltan's comment:
8356
8357         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8358
8359         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8360          before its static fields are used', i.e. initialization does not need
8361          to be triggered by the first access to the type. Setting this flag
8362          helps the JIT to compile better code, since it can run the static
8363          constructor at JIT time, and does not need to generate code to call it
8364          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8365          this flag for lots of classes like String. 
8366          
8367          csc sets this flag if the type does not have an explicit static 
8368          constructor. The reasoning seems to be that if there are only static
8369          initalizers for a type, and no static constructor, then the programmer
8370          does not care when this initialization happens, so beforefieldinit
8371          can be used.
8372          
8373          This bug prevents the AOT compiler from being usable, since it 
8374          generates so many calls to mono_runtime_class_init that the AOT code
8375          is much slower than the JITted code. The JITted code is faster, 
8376          because it does not generate these calls if the vtable is type is
8377          already initialized, which is true in the majority of cases. But the
8378          AOT compiler can't do this."
8379
8380 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8381
8382         * class.cs (MethodData.Emit): Refactor the code so symbolic
8383         information is generated for destructors;  For some reasons we
8384         were taking a code path that did not generate symbolic information
8385         before. 
8386
8387 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8388
8389         * class.cs: Create a Constructor.CheckBase method that
8390         takes care of all validation type code. The method
8391         contains some code that was moved from Define.
8392
8393         It also includes new code that checks for duplicate ctors.
8394         This fixes bug #55148.
8395
8396 2004-03-09  Joshua Tauberer <tauberer@for.net>
8397
8398         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8399         a { ... }-style array creation invokes EmitStaticInitializers
8400         which is not good for reference-type arrays.  String, decimal
8401         and now null constants (NullCast) are not counted toward
8402         static initializers.
8403
8404 2004-03-05  Martin Baulig  <martin@ximian.com>
8405
8406         * location.cs (SourceFile.HasLineDirective): New public field;
8407         specifies whether the file contains or is referenced by a "#line"
8408         directive.
8409         (Location.DefineSymbolDocuments): Ignore source files which
8410         either contain or are referenced by a "#line" directive.        
8411
8412 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8413
8414         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8415         direct access to our parent, so check the method inline there.
8416
8417 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8418
8419         * expression.cs (Invocation.EmitCall): Miguel's last commit
8420         caused a regression. If you had:
8421
8422             T t = null;
8423             t.Foo ();
8424
8425         In Foo the implict this would be null.
8426
8427 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8428
8429         * expression.cs (Invocation.EmitCall): If the method is not
8430         virtual, do not emit a CallVirt to it, use Call.
8431
8432         * typemanager.cs (GetFullNameSignature): Improve the method to
8433         cope with ".ctor" and replace it with the type name.
8434
8435         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8436         as an argument the ConstructorBuilder where it is being defined,
8437         to catch the recursive constructor invocations.
8438
8439 2004-03-16  Martin Baulig  <martin@ximian.com>
8440
8441         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8442         ConstructedType, call ResolveType() on it to get the type rather
8443         than just using `expr.Type'.
8444
8445 2004-03-16  Martin Baulig  <martin@ximian.com>
8446
8447         * generics.cs (ConstructedType.GetMemberAccess): Take the
8448         EmitContext instead on the TypeExpr and use
8449         ec.TypeContainer.CurrentType/ec.ContainerType.
8450
8451 2004-03-16  Martin Baulig  <martin@ximian.com>
8452
8453         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8454         parameters before aliases.
8455
8456 2004-03-16  Martin Baulig  <martin@ximian.com>
8457
8458         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8459         New oublic function; checks whether two generic instances may become
8460         equal under some instantiations (26.3.1).
8461
8462         * class.cs (TypeContainer.Define): Call
8463         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8464         error.
8465
8466 2004-03-16  Martin Baulig  <martin@ximian.com>
8467
8468         * class.cs (TypeContainer.GetClassBases): Moved
8469         Error_TypeParameterAsBase() here and also check whether the base
8470         class is not an attribute.
8471
8472 2004-03-16  Martin Baulig  <martin@ximian.com>
8473
8474         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8475
8476 2004-03-16  Martin Baulig  <martin@ximian.com>
8477
8478         * class.cs (Error_TypeParameterAsBase): Use correct error number
8479         here (CS0689).  
8480
8481 2004-03-16  Martin Baulig  <martin@ximian.com>
8482
8483         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8484         for generics.
8485
8486         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8487         error reporting.
8488
8489 2004-03-15  Martin Baulig  <martin@ximian.com>
8490
8491         * typemanager.cs (TypeManager.GetFullName): New public method.
8492         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8493         argument; only return members with the correct number of type
8494         arguments.
8495         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8496         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8497         whether the number of type arguments matches.
8498
8499         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8500         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8501
8502         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8503         field; it's set by the protected .ctor when we're actually a
8504         GenericMemberAccess.
8505         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8506         arguments and pass it to MemberLookupFinal ().
8507
8508         * ecore.cs (Expression.MemberLookup): Added `int
8509         num_type_arguments' argument; only return members with the correct
8510         number of type arguments.
8511         (Expression.MemberLookupFailed): Check whether the MemberLookup
8512         failed because we did not have the correct number of type
8513         arguments; report CS0305 in this case.
8514
8515         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8516         `e.ResolveAsTypeTerminal()' already did so.
8517
8518 2004-03-15  Martin Baulig  <martin@ximian.com>
8519
8520         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8521         we're a ConstructedType; in this case, the caller must report an
8522         error (for instance CS0131).
8523
8524         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8525         (TypeArguments.Resolve): Actually report errors here.
8526
8527 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8528
8529         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8530         `set_indexer_name' to the pending bits (one per type).
8531
8532         We fixed a bug today that was picking the wrong method to
8533         override, since for properties the existing InterfaceMethod code
8534         basically ignored the method name.  Now we make sure that the
8535         method name is one of the valid indexer names.
8536
8537 2004-03-15  Martin Baulig  <martin@ximian.com>
8538
8539         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8540         for generic instances.
8541
8542 2004-03-13  Martin Baulig  <martin@ximian.com>
8543
8544         * class.cs (TypeContainer.DefineType): Call
8545         TypeManager.AddUserType() immediately after creating the
8546         TypeBuilder; pass all type parameters when creating the
8547         CurrentType.
8548
8549         * decl.cs (DeclSpace.FindNestedType): New public method.
8550         (DeclSpace.FindType): Added `int num_type_args' argument; only
8551         return types with the correct number of type parameters.
8552         (DeclSpace.CountTypeParams): New public property.
8553
8554         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8555         the number of type parameters; defaults to zero.
8556
8557         * generic.cs (TypeArguments.Count): New public property.
8558         (ConstructedType.DoResolveAsTypeStep): First call
8559         ds.FindNestedType() to find out whether we're nested in the
8560         current generic type; in this case, we inherit all type parameters
8561         from the current class.
8562
8563         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8564         num_type_args' argument.
8565         (RootContext.LookupType): Added overloaded version which takes the
8566         number of type arguments; only return types with the correct
8567         number of type arguments.
8568
8569         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8570         checks whether `Type t' has `int num_type_args'.
8571
8572 2004-03-13  Martin Baulig  <martin@ximian.com>
8573
8574         * generic.cs (GenericMethod.DefineType): New method; calls
8575         DefineType() on all the type parameters.
8576
8577         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8578         (MethodData.Define): If we're a generic method, call
8579         GenericMethod.DefineType() to define the type parameters.       
8580
8581 2004-03-10  Martin Baulig  <martin@ximian.com>
8582
8583         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8584         instead of IsAssignableFrom.    
8585
8586 2004-03-10  Martin Baulig  <martin@ximian.com>
8587
8588         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8589
8590         * support.cs (ParameterData.HasArrayParameter): New property.
8591         (ReflectionParameters.ctor): Take a MethodBase instead of a
8592         ParameterInfo[].  If we have any type parameters, get the generic
8593         method definition and ask it whether we have variable arguments.
8594
8595 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8596
8597         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8598         routines to check if a type is an enumerable/enumerator allow
8599         classes that implement the IEnumerable or IEnumerator interfaces.
8600
8601         * class.cs (Property, Operator): Implement IIteratorContainer, and
8602         implement SetYields.
8603
8604         (Property.Define): Do the block swapping for get_methods in the
8605         context of iterators.   We need to check if Properties also
8606         include indexers or not.
8607
8608         (Operator): Assign the Block before invoking the
8609         OperatorMethod.Define, so we can trigger the Iterator code
8610         replacement. 
8611
8612         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8613         Property and Operator classes are not created when we parse the
8614         declarator but until we have the block completed, so we use a
8615         singleton SimpleIteratorContainer.Simple to flag whether the
8616         SetYields has been invoked.
8617
8618         We propagate this setting then to the Property or the Operator to
8619         allow the `yield' to function.
8620
8621 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8622
8623         * codegen.cs: Implemented attribute support for modules.
8624         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8625         Assembly/Module functionality.
8626
8627         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8628         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8629         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8630
8631 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8632
8633         * interface.cs (FindMembers): The operation is performed on all base
8634         interfaces and not only on the first. It is required for future CLS Compliance patch.
8635
8636 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8637
8638         * statement.cs, codegen.cs:
8639         This patch deals with patterns such as:
8640
8641         public class List : IEnumerable {
8642
8643                 public MyEnumerator GetEnumerator () {
8644                         return new MyEnumerator(this);
8645                 }
8646
8647                 IEnumerator IEnumerable.GetEnumerator () {
8648                         ...
8649                 }
8650                 
8651                 public struct MyEnumerator : IEnumerator {
8652                         ...
8653                 }
8654         }
8655
8656         Before, there were a few things we did wrong:
8657         1) we would emit callvirt on a struct, which is illegal
8658         2) we emited ldarg when we needed to emit ldarga
8659         3) we would mistakenly call the interface methods on an enumerator
8660         type that derived from IEnumerator and was in another assembly. For example:
8661
8662         public class MyEnumerator : IEnumerator
8663
8664         Would have the interface methods called, even if there were public impls of the
8665         method. In a struct, this lead to invalid IL code.
8666
8667 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8668
8669         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8670           renamed to Emit.
8671
8672         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8673
8674 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8675
8676         * cs-parser.jay: Fix small regression: we were not testing V2
8677         compiler features correctly.
8678
8679         * interface.cs: If the emit context is null, then create one
8680
8681 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8682
8683         * decl.cs (GetSignatureForError): New virtual method to get full name
8684           for error messages.
8685
8686         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8687           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8688
8689         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8690           Duplicated members and code in these classes has been removed.
8691           Better encapsulation in these classes.
8692
8693 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8694
8695         * assign.cs (Assign.DoResolve): When dealing with compound
8696         assignments, there is a new rule in ECMA C# 2.4 (might have been
8697         there before, but it is documented here) that states that in:
8698
8699         a op= b;
8700
8701         If b is of type int, and the `op' is a shift-operator, then the
8702         above is evaluated as:
8703
8704         a = (int) a op b 
8705
8706         * expression.cs (Binary.ResolveOperator): Instead of testing for
8707         int/uint/long/ulong, try to implicitly convert to any of those
8708         types and use that in pointer arithmetic.
8709
8710         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8711         method to print information for from the type, not from the
8712         null-method we were given.
8713
8714 2004-02-01  Duncan Mak  <duncan@ximian.com>
8715
8716         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8717         parsing for cmd, fixes bug #53694.
8718
8719 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8720
8721         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8722         in the member name duplication tests. Property and operator name duplication
8723         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8724
8725 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8726
8727         * interface.cs (PopulateMethod): Fixed crash when interface method
8728         returns not existing type (error test cs0246-3.cs).
8729
8730 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8731
8732         * cs-parser.jay (interface_accessors): Re-write actions to also
8733         store attributes attached to get and set methods. Fix spelling
8734         while at it.
8735
8736         (inteface_property_declaration): Modify accordingly.
8737
8738         (InterfaceAccessorInfo): New helper class to store information to pass
8739         around between rules that use interface_accessors.
8740
8741         * interface.cs (Emit): Apply attributes on the get and set
8742         accessors of properties and indexers too.
8743
8744         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8745         right MethodBuilder when applying attributes to the get and set accessors.
8746
8747 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8748
8749         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8750
8751 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8754
8755 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8756
8757         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8758         changes that treat `yield' specially when present before `break'
8759         or `return' tokens.
8760
8761         * cs-tokenizer.cs: yield is no longer a keyword.
8762
8763 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8764
8765         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8766         setting for default constructors.
8767         For default constructors are almost every time set wrong Modifier. The
8768         generated IL code has been alright. But inside mcs this values was
8769         wrong and this was reason why several of my CLS Compliance tests
8770         failed.
8771
8772 2004-02-27  Martin Baulig  <martin@ximian.com>
8773
8774         * generics.cs (ConstructedType.ResolveType): Make the nested type
8775         stuff actually work.
8776
8777 2004-02-25  Martin Baulig  <martin@ximian.com>
8778
8779         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8780         property; returns the type parameters just from the current type,
8781         ie. with the ones from outer classes.
8782         (DeclSpace.LookupGeneric): First search in the current class, then
8783         in outer classes.
8784         (DeclSpace.initialize_type_params): When hiding a type parameter
8785         from an outer class, put it into the `type_param_list' anyways.
8786
8787         * expression.cs (MemberAccess.expr): Made this field protected.
8788
8789         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8790         the type parameters from the current class.
8791
8792         * generic.cs (ConstructedType.ResolveType): Support nested generic
8793         types by taking the type parameters which we inherit from outer
8794         classes into account.
8795         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8796         support for nested generic types.
8797
8798 2004-02-23  Martin Baulig  <martin@ximian.com>
8799
8800         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8801         field and check whether we're nested inside a generic type.
8802         (DeclSpace.ResolveType): If we're resolving to a generic type
8803         definition, create a ConstructedType and return its resolved type.
8804         (DeclSpace.initialize_type_params): New private method;
8805         initializes the `type_param_list' field from the type parameters
8806         from this and all enclosing classes.
8807         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8808         we're already initialized.
8809
8810 2004-02-23  Martin Baulig  <martin@ximian.com>
8811
8812         * class.cs (Method.Define): Create the generic method before
8813         calling DoDefine().
8814         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8815         the TypeContainer one); we use this for generic methods.
8816
8817         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8818         parent's TypeBuilder.
8819
8820 2004-02-18  Martin Baulig  <martin@ximian.com>
8821
8822         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8823         to check for equality.
8824
8825 2004-02-05  Martin Baulig  <martin@ximian.com>
8826
8827         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8828         `ec.TypeContainer.CurrentType', use it instead of
8829         `ec.ContainerType' to check whether we're in the type's ctor.
8830
8831 2004-01-29  Martin Baulig  <martin@ximian.com>
8832
8833         * expression.cs (Invocation.DoResolve): If we're a
8834         `ConstructedType', then we're actually a generic method, so
8835         rewrite the expr as a GenericMemberAccess.
8836
8837         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8838         here; manually parse it into a string.
8839
8840 2004-01-28  Martin Baulig  <martin@ximian.com>
8841
8842         * typemanager.cs (TypeManager.IsEqual): New static method.
8843         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8844         check for equality instead of using `=='.
8845
8846 2004-01-26  Martin Baulig  <martin@ximian.com>
8847
8848         * decl.cs (DeclSpace.CurrentType): New public field.
8849
8850         * expression.cs (This.ResolveBase): If we have an
8851         `ec.TypeContainer.CurrentType', use it instead of
8852         `ec.ContainerType'.
8853
8854         * class.cs (TypeContainer.DefineType): If we're a generic type,
8855         create the `CurrentType' (unresolved).
8856         (TypeContainer.GenericType): New private field.
8857         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8858         it and store it in `GenericType' before creating the MemberCache.
8859         (TypeContainer.GetMembers): If we have a `GenericType', call
8860         TypeManager.FindMembers() on it.
8861
8862         * interface.cs (Interface.GenericType): New private field.
8863         (Interface.DefineType): If we're a generic type, create the
8864         `CurrentType' (unresolved).
8865         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8866         and store it in `GenericType' before creating the MemberCache.
8867         (Interface.GetMembers): If we have a `GenericType', call
8868         TypeManager.FindMembers() on it.
8869
8870 2004-01-22  Martin Baulig  <martin@ximian.com>
8871
8872         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8873         not a QualifiedIdentifier.  This is what `type_name_expression'
8874         was previously doing.
8875         (type_name_expression): Removed; the code is now in
8876         `namespace_or_type_name'.
8877         (qualified_identifier): Removed, use `namespace_or_type_name'
8878         instead.
8879         (QualifiedIdentifier): Removed this class.      
8880
8881 2004-01-22  Martin Baulig  <martin@ximian.com>
8882
8883         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8884         not a string as alias name.
8885
8886 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8887
8888         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8889         #52730 bug, and instead compute correctly the need to use a
8890         temporary variable when requesting an address based on the
8891         static/instace modified of the field and the constructor.
8892  
8893 2004-01-21  Martin Baulig  <martin@ximian.com>
8894
8895         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8896         class and namespace before looking up aliases.  Fixes #52517.
8897
8898 2004-01-21  Martin Baulig  <martin@ximian.com>
8899
8900         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8901         assinged in a 'try'; fixes exception4.cs.
8902
8903 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8904         * class.cs : Implemented parameter-less constructor for TypeContainer
8905
8906         * decl.cs: Attributes are now stored here. New property OptAttributes
8907
8908         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8909
8910         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8911
8912 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8913
8914         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8915           (CSharpSignature): New method for indexer and property signature.
8916
8917 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8918
8919         * pending.cs (IsVirtualFilter): Faster implementation.
8920
8921 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8922
8923         * typemanager.cs: Avoid inclusion of same assembly more than once.
8924
8925 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8926
8927         * cs-parser.jay: Fixed problem where the last assembly attribute
8928           has been applied also to following declaration (class, struct, etc.)
8929           
8930 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8931
8932         * class.cs: Added error CS0538, CS0539 reporting.
8933         Fixed crash on Microsoft runtime when field type is void.
8934
8935         * cs-parser.jay: Added error CS0537 reporting.
8936
8937         * pending.cs: Added error CS0535 reporting.
8938         Improved error report for errors CS0536, CS0534.
8939
8940 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8941
8942         Merge a few bits from the Anonymous Method MCS tree.
8943
8944         * statement.cs (ToplevelBlock): New class for toplevel methods,
8945         will hold anonymous methods, lifted variables.
8946
8947         * cs-parser.jay: Create toplevel blocks for delegates and for
8948         regular blocks of code. 
8949
8950 2004-01-20  Martin Baulig  <martin@ximian.com>
8951
8952         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8953         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8954         and `NeedExplicitReturn'; added `IsLastStatement'.
8955         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8956         have a `ReturnLabel' or we're not unreachable.
8957
8958         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8959         child's reachability; don't just override ours with it.  Fixes
8960         #58058 (lluis's example).
8961         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8962         InFinally(), InLoop(), InSwitch() and
8963         BreakCrossesTryCatchBoundary() methods.
8964
8965         * statement.cs (Return): Do all error checking in Resolve().
8966         Unless we are the last statement in a top-level block, always
8967         create a return label and jump to it.
8968         (Break, Continue): Do all error checking in Resolve(); also make
8969         sure we aren't leaving a `finally'.
8970         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8971         statement in a top-level block.
8972         (Block.Flags): Added `IsDestructor'.
8973         (Block.IsDestructor): New public property.
8974
8975 2004-01-20  Martin Baulig  <martin@ximian.com>
8976
8977         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8978
8979 2004-01-20  Martin Baulig  <martin@ximian.com>
8980
8981         * statement.cs (Statement.ResolveUnreachable): New public method.
8982         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8983         (Block.Resolve): Resolve unreachable statements.
8984
8985 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8986
8987         * expression.cs: We need to fix the case where we do
8988         not have a temp variable here.
8989
8990         * assign.cs: Only expression compound assignments need
8991         temporary variables.
8992
8993 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8994
8995         * flowanalysis.cs: Reduce memory allocation in a few ways:
8996           - A block with no variables should not allocate a bit
8997             vector for itself.
8998           - A method with no out parameters does not need any tracking
8999             for assignment of the parameters, so we need not allocate
9000             any data for it.
9001           - The arrays:
9002                 public readonly Type[] VariableTypes;
9003                 public readonly string[] VariableNames;
9004             Are redundant. The data is already stored in the variable
9005             map, so we need not allocate another array for it.
9006           - We need to add alot of checks for if (params | locals) == null
9007             due to the first two changes.
9008
9009 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9010
9011         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9012         implement IMemoryLocation, we store a copy on a local variable and
9013         take the address of it.  Patch from Benjamin Jemlich
9014
9015         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9016         to use a special "type_name_expression" rule which reduces the
9017         number of "QualifiedIdentifier" classes created, and instead
9018         directly creates MemberAccess expressions.
9019
9020 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9021
9022         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9023         that fixes #52853.  Null literal assignment to ValueType
9024
9025         * class.cs (MethodData.Emit): Instead of checking the name of the
9026         method to determine if its a destructor, create a new derived
9027         class from Method called Destructor, and test for that.  
9028
9029         * cs-parser.jay: Create a Destructor object instead of a Method.  
9030
9031         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9032
9033         Fixes: 52933
9034
9035 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9036
9037         * expression.cs (Binary.ResolveOperator): Perform an implicit
9038         conversion from MethodGroups to their delegate types on the
9039         Addition operation.
9040
9041         * delegate.cs: Introduce a new class DelegateCreation that is the
9042         base class for `NewDelegate' and `ImplicitDelegateCreation',
9043         factor some code in here.
9044
9045         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9046         conversion from MethodGroups to compatible delegate types. 
9047
9048         * ecore.cs (Expression.Resolve): Do not flag error 654
9049         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9050         we allow conversions from MethodGroups to delegate types now.
9051
9052         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9053         assignments in v2 either.
9054
9055 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9056
9057         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9058         static read-only fields in ctors.
9059
9060         Applied patch from Benjamin Jemlich 
9061
9062         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9063
9064 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9065
9066         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9067         here to return true, as they can be used like this:
9068
9069                 (XXX) int.MEMBER ()
9070
9071         Fixed 49836 and all the other dups
9072
9073 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9074
9075         * driver.cs: Implement /win32res and /win32icon.
9076
9077 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9078
9079         * cs-parser.jay: Add a rule to improve error handling for the
9080         common mistake of placing modifiers after the type.
9081
9082 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9083
9084         * cs-parser.jay (interface_event_declaration): Catch
9085         initialization of events on interfaces, and report cs0068
9086
9087         * cs-parser.jay (interface_event_declaration): Catch
9088         initialization of events. 
9089
9090         * ecore.cs: Better report missing constructors.
9091
9092         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9093         the error reporting done in the wrong place.  Fix.
9094
9095         * expression.cs (Binary.ResolveOperator): Catch the 
9096         operator + (E x, E y) error earlier, and later allow for implicit
9097         conversions in operator +/- (E e, U x) from U to the underlying
9098         type of E.
9099
9100         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9101         52596, if the container class is abstract, the default constructor
9102         is protected otherwise its public (before, we were always public).
9103
9104         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9105         fixed statement.
9106
9107         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9108         Jemlich that fixes bug #52597, MCS was generating invalid code for
9109         idisposable structs.   Thanks to Ben for following up with this
9110         bug as well.
9111
9112 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9113
9114         * driver.cs: Allow assemblies without code to be generated, fixes
9115         52230.
9116
9117 2004-01-07  Nick Drochak <ndrochak@gol.com>
9118
9119         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9120
9121 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9122
9123         * cs-parser.jay: Add rules to improve error reporting if fields or
9124         methods are declared at the namespace level (error 116)
9125
9126         * Add rules to catch event add/remove
9127
9128 2004-01-04  David Sheldon <dave-mono@earth.li>
9129
9130   * expression.cs: Added matching ")" to error message for 
9131   CS0077
9132
9133 2004-01-03 Todd Berman <tberman@gentoo.org>
9134
9135         * ecore.cs, attribute.cs:
9136         Applying fix from #52429.
9137
9138 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9139
9140         * ecore.cs, expression.cs, statement.cs:
9141         Total rewrite of how we handle branching. We
9142         now handle complex boolean expressions with fewer
9143         jumps. As well if (x == 0) no longer emits a ceq.
9144
9145         if (x is Foo) is much faster now, because we generate
9146         better code.
9147
9148         Overall, we get a pretty big improvement on our benchmark
9149         tests. The code we generate is smaller and more readable.
9150
9151         I did a full two-stage bootstrap. The patch was reviewed
9152         by Martin and Miguel.
9153
9154 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9155
9156         * cs-parser.jay: Make primary_expression not take a QI.
9157         we dont need this because the member_access rule covers
9158         us here. So we replace the rule with just IDENTIFIER.
9159
9160         This has two good effects. First, we remove a s/r conflict.
9161         Second, we allocate many fewer QualifiedIdentifier objects.
9162
9163 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9164
9165         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9166         set the correct information via SRE. This prevents
9167         hanging on the MS runtime. Fixes #29374.
9168
9169 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9170
9171         * convert.cs: correctly handle conversions to value types
9172         from Enum and ValueType as unboxing conversions.
9173
9174         Fixes bug #52569. Patch by Benjamin Jemlich.
9175
9176 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9177
9178         * expression.cs (BetterConversion): Prefer int -> uint
9179         over int -> ulong (csc's behaviour). This fixed bug #52046.
9180
9181 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9182
9183         * decl.cs (MemberCache.FindMembers): now returns a
9184         MemberInfo [].
9185
9186         * typemanager.cs: In general, go with with ^^.
9187         (CopyNewMethods): take an IList.
9188         (RealMemberLookup): Only allocate an arraylist
9189         if we copy from two sets of methods.
9190
9191         This change basically does two things:
9192         1) Fewer array lists allocated due to CopyNewMethods.
9193         2) the explicit cast in MemberList costed ALOT.
9194
9195 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9196
9197         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9198         a hashtable to avoid needless string allocations when an identifier is
9199         used more than once (the common case).
9200
9201 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9202
9203         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9204         is broken, it will not return anything. So, we
9205         have to use the information we have in mcs to
9206         do the task.
9207
9208         * typemanager.cs: Add a cache for GetInterfaces,
9209         since this will now be used more often (due to ^^)
9210
9211         (GetExplicitInterfaces) New method that gets the
9212         declared, not effective, interfaces on a type
9213         builder (eg, if you have interface IFoo, interface
9214         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9215         { IBar }.
9216
9217         This patch makes MCS able to bootstrap itself on
9218         Windows again.
9219
9220 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9221
9222         * expression.cs: Remove the Nop's that Miguel put
9223         in by mistake.
9224
9225 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9226
9227         * report.cs, codegen.cs: Give the real stack trace to
9228         the error when an exception is thrown.
9229
9230 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9231
9232         * decl.cs: only allocate hashtables for ifaces if 
9233         it is an iface!
9234
9235 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9236
9237         * expression.cs: fix the error from cs0121-2.cs
9238         (a parent interface has two child interfaces that
9239         have a function with the same name and 0 params
9240         and the function is called through the parent).
9241
9242 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9243
9244         * class.cs, rootcontext.cs, typmanager.cs: do not
9245         leak pointers.
9246
9247 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9248
9249         * codegen.cs: remove stack for the ec flow branching.
9250         It is already a linked list, so no need.
9251
9252 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9253
9254         * Makefile: Allow custom profiler here.
9255
9256 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9257
9258         * typemanager.cs (LookupType):
9259           - Use a static char [], because split takes
9260             a param array for args, so it was allocating
9261             every time.
9262           - Do not store true in a hashtable, it boxes.
9263
9264 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9265
9266         * flowanalysis.cs: bytify common enums.
9267
9268 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9269
9270         * modifiers.cs: Add a new set of flags for the
9271         flags allowed on explicit interface impls.
9272         * cs-parser.jay: catch the use of modifiers in
9273         interfaces correctly.
9274         * class.cs: catch private void IFoo.Blah ().
9275
9276         All related to bug #50572.
9277
9278 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9279
9280         * decl.cs: Rewrite the consistant accessability checking.
9281         Accessability is not linear, it must be implemented in
9282         a tableish way. Fixes #49704.
9283
9284 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9285
9286         * expression.cs: Handle negation in a checked context.
9287         We must use subtraction from zero. Fixes #38674.
9288
9289 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9290
9291         * class.cs: Ignore static void main in DLLs.
9292         * rootcontext.cs: Handle the target type here,
9293         since we are have to access it from class.cs
9294         * driver.cs: account for the above.
9295
9296 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9297
9298         * report.cs: Give line numbers and files if available.
9299
9300 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9301
9302         * driver.cs: Implement /addmodule.
9303
9304         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9305         ModuleBuilders.
9306
9307 2003-12-20  Martin Baulig  <martin@ximian.com>
9308
9309         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9310         (FieldBase.IsAssigned): Removed this field.
9311         (FieldBase.SetAssigned): New public method.
9312         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9313
9314 2003-12-20  Martin Baulig  <martin@ximian.com>
9315
9316         * expression.cs (LocalVariableReference.DoResolve): Don't set
9317         `vi.Used' if we're called from DoResolveLValue().
9318
9319         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9320         returns the usage vector it just merged into the current one -
9321         pass this one to UsageWarning().
9322         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9323         of the `EmitContext', don't call this recursively on our children.
9324
9325 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9326
9327         * driver.cs: Implement /target:module.
9328
9329 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9330
9331         * support.cs (CharArrayHashtable): New helper class.
9332
9333         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9334         char arrays, not strings, so we can avoid creating a string in
9335         consume_identifier if the identifier is a keyword.
9336
9337 2003-12-16  Martin Baulig  <martin@ximian.com>
9338
9339         * statement.cs (LocalInfo.Assigned): Removed this property.
9340         (LocalInfo.Flags): Removed `Assigned'.
9341         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9342         and uses flow analysis.
9343         (Block.UsageWarning): Made this method private.
9344         (Block.Resolve): Call UsageWarning() if appropriate.
9345
9346         * expression.cs (LocalVariableReference.DoResolve): Always set
9347         LocalInfo.Used here.
9348
9349 2003-12-13  Martin Baulig  <martin@ximian.com>
9350
9351         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9352         any value here; we're now using flow analysis to figure out
9353         whether a statement/block returns a value.
9354
9355 2003-12-13  Martin Baulig  <martin@ximian.com>
9356
9357         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9358         working again.
9359         (FlowBranching.MergeFinally): Don't call
9360         `branching.CheckOutParameters()' here, this is called in
9361         MergeTopBlock().
9362         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9363         when adding the `finally' vector.       
9364
9365 2003-12-13  Martin Baulig  <martin@ximian.com>
9366
9367         * flowanalysis.cs
9368         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9369         actually work and also fix #48962.
9370
9371 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9372
9373         * decl.cs: Do not check System.Object for nested types,
9374         since we know it does not have any. Big bang for buck:
9375
9376         BEFORE:
9377            Run 1:   8.35 seconds
9378            Run 2:   8.32 seconds
9379            corlib:  17.99 seconds
9380         AFTER:
9381            Run 1:   8.17 seconds
9382            Run 2:   8.17 seconds
9383            corlib:  17.39 seconds
9384
9385 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9386
9387         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9388         time we are returning 0 members, so we save alot here.
9389
9390 2003-12-11  Martin Baulig  <martin@ximian.com>
9391
9392         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9393         `MergeChild()', also just take the `FlowBranching' as argument;
9394         call Merge() on it and return the result.
9395         (FlowBranching.Merge): We don't need to do anything if we just
9396         have one sibling.
9397
9398 2003-12-11  Martin Baulig  <martin@ximian.com>
9399
9400         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9401         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9402         Maurer for this idea.
9403
9404 2003-12-11  Martin Baulig  <martin@ximian.com>
9405
9406         * flowanalysis.cs (MergeResult): This class is now gone; we now
9407         use the `UsageVector' for this.  The reason for this is that if a
9408         branching just has one sibling, we don't need to "merge" them at
9409         all - that's the next step to do.
9410         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9411         `MergeResult'.
9412
9413 2003-12-11  Martin Baulig  <martin@ximian.com>
9414
9415         Reworked flow analyis and made it more precise and bug-free.  The
9416         most important change is that we're now using a special `Reachability'
9417         class instead of having "magic" meanings of `FlowReturns'.  I'll
9418         do some more cleanups and optimizations and also add some more
9419         documentation this week.
9420
9421         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9422         largely reworked this class.
9423         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9424         the new `Reachability' class instead of having "magic" values here.
9425         (FlowBranching): We're now using an instance of `Reachability'
9426         instead of having separate `Returns', `Breaks' etc. fields.
9427
9428         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9429         based on flow analysis; ignore the return value of block.Emit ().
9430
9431 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9432
9433         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9434         if they are private.
9435
9436 2003-12-09  Martin Baulig  <martin@ximian.com>
9437
9438         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9439         call them directly on the UsageVector.
9440
9441 2003-12-09  Martin Baulig  <martin@ximian.com>
9442
9443         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9444         Changed return type from `FlowReturns' to `Reachability'.
9445
9446 2003-12-09  Martin Baulig  <martin@ximian.com>
9447
9448         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9449         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9450         `Reachable' fields with a single `Reachability' one.
9451
9452 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9453
9454         * class.cs (FindMembers): Remove foreach's.
9455
9456         Bootstrap times:
9457
9458         BEFORE
9459                 Run 1:   8.74 seconds
9460                 Run 2:   8.71 seconds
9461
9462         AFTER
9463                 Run 1:   8.64 seconds
9464                 Run 2:   8.58 seconds
9465
9466
9467 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9468
9469         * cs-parser.jay:
9470         * gen-treedump.cs:
9471         * statement.cs:
9472         This patch does a few things:
9473                 1. EmptyStatement is now a singleton, so it is never reallocated.
9474                 2. All blah is EmptyStatement constructs have been changed to
9475                    blah == EmptyStatement.Value, which is much faster and valid
9476                    now that EmptyStatement is a singleton.
9477                 3. When resolving a block, rather than allocating a new array for
9478                    the non-empty statements, empty statements are replaced with
9479                    EmptyStatement.Value
9480                 4. Some recursive functions have been made non-recursive.
9481         Mainly the performance impact is from (3), however (1) and (2) are needed for
9482         this to work. (4) does not make a big difference in normal situations, however
9483         it makes the profile look saner.
9484
9485         Bootstrap times:
9486
9487         BEFORE
9488         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9489         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9490         Total memory allocated: 56397 KB
9491
9492         AFTER
9493         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9494         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9495         Total memory allocated: 55666 KB
9496
9497 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9498
9499         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9500         than the hashtable in a hashtable version
9501
9502         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9503         we always end up concating a string. This results in a huge perf
9504         loss, because many strings have to be tracked by the GC. In this
9505         patch, we first use a hashtable that works with two keys, so that
9506         the strings do not need to be concat'ed.
9507
9508         Bootstrap times:
9509         BEFORE
9510                 Run 1:   8.74 seconds
9511                 Run 2:   8.71 seconds
9512
9513         AFTER
9514                 Run 1:   8.65 seconds
9515                 Run 2:   8.56 seconds
9516
9517 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9518
9519         * Makefile: Add a new target `do-time' that does a quick and simple
9520         profile, leaving easy to parse output.
9521
9522 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9523
9524         * codegen.cs (Init): Create the dynamic assembly with 
9525         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9526
9527 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9528
9529         * support.cs: Make the PtrHashtable use only one
9530         instance of its comparer.
9531
9532 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9533
9534         * typemanager.cs: Fix lookup of GetNamespaces.
9535
9536 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * expression.cs: Removed redundant line.
9539
9540         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9541         ArrayLists, use for loops with bounds.  
9542
9543         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9544         arraylist.
9545
9546         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9547         arraylists, use for loop with bounds.
9548
9549         The above three changes give us a 0.071 second performance
9550         improvement out of 3.294 seconds down to 3.223.  On my machine
9551         the above changes reduced the memory usage by 1,387 KB during
9552         compiler bootstrap.
9553
9554         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9555         QualifiedIdentifiers.  Before we created a new string through
9556         concatenation, and mostly later on, the result would be
9557         manipulated by DecomposeQI through string manipulation.
9558
9559         This reduced the compiler memory usage for bootstrapping from
9560         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9561         compile times in 0.05 seconds.
9562
9563 2003-11-28  Dick Porter  <dick@ximian.com>
9564
9565         * support.cs: Do string compares with the Invariant culture.
9566
9567         * rootcontext.cs: 
9568         * gen-treedump.cs: 
9569         * expression.cs: 
9570         * driver.cs: 
9571         * decl.cs: 
9572         * codegen.cs: 
9573         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9574         the comparison is done with the Invariant culture.
9575
9576 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9579         GetEnumerator method.
9580
9581         (ProbeCollectionType): Iterate starting at the most specific type
9582         upwards looking for a GetEnumerator
9583
9584         * expression.cs: Shift count can be up to 31 for int/uint and 63
9585         for long/ulong.
9586
9587 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9588
9589         * statement.cs (Block.LookupLabel): Also look for the label on the
9590         children blocks.  Use a hash table to keep track of visited
9591         nodes. 
9592
9593         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9594         we actually did transform the other operand, otherwise fall back
9595         to the common codepath that casts to long.
9596
9597         * cs-tokenizer.cs: Use the same code pattern as the int case.
9598         Maybe I should do the parsing myself, and avoid depending on the
9599         Parse routines to get this done.
9600
9601 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9602
9603         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9604         which fixes bug 51347.  This time test it.
9605
9606         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9607         attributes for example can not tell the difference between these.
9608         The difference was only a syntax feature of the language. 
9609
9610         * attribute.cs: Apply attributes to delegates.
9611
9612         * delegate.cs: Call the apply attributes method.
9613
9614 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9615
9616         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9617         comparing 0 vs Byte.MinValue, not the value
9618
9619         (ImplicitConversionRequired): When reporting a conversion error,
9620         use error 31 to print out the constant error instead of the
9621         simpler 29.
9622
9623         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9624         which fixes bug 51347.
9625
9626 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9627
9628         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9629         which fixes the -warnaserror command line option.
9630
9631 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * cfold.cs (DoNumericPromotions): During constant folding of
9634         additions on UIntConstant, special case intconstants with
9635         IntConstants like we do on the expression binary operator. 
9636
9637 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9638
9639         * convert.cs (ImplicitReferenceConversion): We were missing a case
9640         (System.Enum are not value types or class types, so we need to
9641         classify them separatedly).
9642
9643         * driver.cs: We do not support error 2007.
9644
9645 2003-11-12 Jackson Harper <jackson@ximian.com>
9646
9647         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9648         system directory. Also use the full file name so users can
9649         libraries names mscorlib-o-tron.dll in a non system dir.
9650         
9651 2004-01-04  David Sheldon <dave-mono@earth.li>
9652
9653         * expression.cs: Added matching ")" to error message for CS0077.
9654
9655 2003-12-19  Martin Baulig  <martin@ximian.com>
9656
9657         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9658         static method; see documentation in the method.
9659         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9660
9661         * convert.cs (Convert.ImplicitReferenceConversion,
9662         Convert.ImplicitReferenceConversionExists): Add support for
9663         generic type declarations; see gen-36.cs.
9664
9665 2003-12-19  Martin Baulig  <martin@ximian.com>
9666
9667         * pending.cs (Pending.InterfaceMethod): Use
9668         `Type.IsAssignableFrom()' instead of `=='.
9669
9670 2003-12-18  Martin Baulig  <martin@ximian.com>
9671
9672         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9673         byref types first.
9674
9675         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9676         `expr_type.Equals (target_type)' instead of `=='.
9677
9678 2003-12-08  Martin Baulig  <martin@ximian.com>
9679
9680         * generics.cs (Constraints.Types): Removed.
9681         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9682         to Type's.
9683         (Constraints.ResolveTypes): New public method; resolves the
9684         TypeExpr's to Type's.
9685         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9686         longer takes the constraints.
9687         (TypeParameter.DefineMethod): Likewise.
9688         (TypeParameter.DefineType): New public method.  Calls
9689         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9690         the constraints.
9691
9692 2003-12-08  Martin Baulig  <martin@ximian.com>
9693
9694         * convert.cs (Convert.ImplicitConversionStandard): Use
9695         `expr_type.Equals (target_type)' instead of `=='.
9696
9697 2003-12-08  Martin Baulig  <martin@ximian.com>
9698
9699         * typemanager.cs (TypeManager.GetReferenceType): Call
9700         `Type.MakeByRefType ()'.
9701
9702 2003-12-08  Martin Baulig  <martin@ximian.com>
9703
9704         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9705         just has some special meaning in some situations.  For instance,
9706         it is allowed to use `where' as the name of a variable etc.
9707
9708 2003-12-04  Martin Baulig  <martin@ximian.com>
9709
9710         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9711         `Type.MakeArrayType()' for array types.
9712
9713 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9714
9715         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9716         debugging message.
9717
9718         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9719         corlib to compile.
9720
9721 2003-11-16  Martin Baulig  <martin@ximian.com>
9722
9723         * codegen.cs (EmitContext.IsGeneric): Removed.
9724
9725         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9726         ResolveGeneric() on the DeclSpace.
9727
9728 2003-11-16  Martin Baulig  <martin@ximian.com>
9729
9730         * generic.cs (TypeArguments.Resolve):
9731         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9732         `ResolveType()' on it to get the Type.
9733
9734 2003-11-15  Martin Baulig  <martin@ximian.com>
9735
9736         * generic.cs (ConstructedType.GetInterfaces): Override this.
9737
9738 2003-11-14  Martin Baulig  <martin@ximian.com>
9739
9740         * interface.cs (Interface.DefineType): Define all type parameters
9741         before adding the interfaces we inherit.
9742
9743 2003-11-11  Martin Baulig  <martin@ximian.com>
9744
9745         * generic.cs (ConstructedType.ResolveType): Always call
9746         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9747
9748 2003-11-10  Martin Baulig  <martin@ximian.com>
9749
9750         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9751         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9752         calling `ResolveType()' on them, directly assign their `Type'.
9753
9754 2003-11-08  Martin Baulig  <martin@ximian.com>
9755
9756         * generic.cs (ConstructedType): Override `IsClass' etc.
9757
9758 2003-11-08  Martin Baulig  <martin@ximian.com>
9759
9760         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9761         return value and the `out parent' parameter.
9762         (TypeContainer.DefineType): Moved the CS0644 check into
9763         GetClassBases().  Don't pass the interface types to the
9764         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9765         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9766
9767         * ecore.cs (TypeExpr.IsAttribute): New property.
9768         (TypeExpr.GetInterfaces): New method.
9769
9770         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9771         TypeExpr instead of a Type.
9772         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9773         (Interface.DefineType): Don't pass the interface types to the
9774         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9775         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9776
9777         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9778         instead of a `Type[]'.
9779         (TypeManager.RegisterBuilder): Likewise.
9780         (TypeManager.AddUserInterface): Likewise.
9781         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9782         `Type[]' and also return a `TypeExpr[]'.
9783         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9784
9785 2003-11-08  Martin Baulig  <martin@ximian.com>
9786
9787         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9788         Expression.     
9789
9790 2003-11-08  Martin Baulig  <martin@ximian.com>
9791
9792         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9793         TypeManager.ResolveExpressionTypes().
9794
9795         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9796         instead of an Expression.
9797         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9798         (TypeExpression): New public class; formerly known as `TypeExpr'.
9799
9800         * expression.cs (ComposedCast): Derive from TypeExpr.
9801
9802         * typemanager.cs (TypeManager.system_*_expr): These are now
9803         TypExpr's instead of Expression's.
9804         (TypeManager.ResolveExpressionTypes): New public static function;
9805         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9806         of them.        
9807
9808 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9809
9810         * expression.cs (New.DoResolve): Do not dereference value that
9811         might be a null return.
9812
9813         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9814         sure that the constant value has the right type.  Fixes an
9815         unreported bug, similar to 50425.
9816
9817         * const.cs (Const.LookupConstantValue): Call
9818         ImplicitStandardConversionExists before doing a conversion to
9819         avoid havng the TypeManager.ChangeType do conversions.
9820
9821         Reduced the number of casts used
9822
9823         (Const.ChangeType): New routine to enable reuse of the constant
9824         type changing code from statement.
9825
9826         * typemanager.cs (ChangeType): Move common initialization to
9827         static global variables.
9828
9829         Fixes #50425.
9830
9831         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9832         every value type to go through, even if it was void.  Fix that. 
9833
9834         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9835         character of the define, and the is_identifier_part_character for
9836         the rest of the string.
9837
9838 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9839
9840         * expression.cs (UnaryMutator.EmitCode): When I updated
9841         LocalVariableReference.DoResolve, I overdid it, and dropped an
9842         optimization done on local variable references.
9843
9844 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * ecore.cs: Convert the return from Ldlen into an int.
9847
9848 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9849
9850         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9851         the accessibility, this is a special case for toplevel non-public
9852         classes (internal for instance).
9853
9854 2003-10-20  Nick Drochak <ndrochak@gol.com>
9855
9856         * ecore.cs: Fix typo and build.  Needed another right paren.
9857
9858 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9859
9860         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9861         `internal' case regular and protected, but not allowing protected
9862         to be evaluated later.  Bug 49840
9863
9864 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9865
9866         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9867         to kb.Nlast, and not the kb.nFirst to isolate the switch
9868         statement.
9869
9870         Extract the underlying type, so enumerations of long/ulong are
9871         treated like long/ulong.
9872
9873 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9874
9875         * expression.cs (New): Overload the meaning of RequestedType to
9876         track the possible creation of the NewDelegate type, since
9877         DoResolve is invoked more than once for new constructors on field
9878         initialization.
9879
9880         See bugs: #48800 and #37014
9881
9882         * cs-parser.jay (declare_local_constants): Take an arraylist
9883         instead of a single constant.
9884
9885         (local_constant_declaration): It should take a
9886         constant_declarators, not a constant_declarator.  Fixes 49487
9887
9888         * convert.cs: Fix error report.
9889
9890 2003-10-13 Jackson Harper <jackson@ximian.com>
9891
9892         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9893         bug #49611
9894         
9895 2003-11-03  Martin Baulig  <martin@ximian.com>
9896
9897         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9898         `out bool has_type_arg'; if set, we need to pass the type to
9899         ig.Emit().
9900         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9901         Stelem_Any/Ldelem_Any for generic parameters.   
9902
9903 2003-11-02  Martin Baulig  <martin@ximian.com>
9904
9905         * expression.cs (Invocation.EmitCall): Use
9906         `TypeManager.IsValueType()' to check whether it's a value type.
9907         Don't set `struct_call' when calling a method on a type parameter.
9908
9909 2003-11-02  Martin Baulig  <martin@ximian.com>
9910
9911         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9912         and removed the TypeBuilder argument.
9913
9914         * typemanager.cs (TypeManager.IsValueType): Return
9915         `t.IsGenericParameter || t.IsValueType'.
9916
9917 2003-10-25  Martin Baulig  <martin@ximian.com>
9918
9919         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9920         call ConstructedType.Resolve() on it.
9921
9922         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9923
9924 2003-10-25  Martin Baulig  <martin@ximian.com>
9925
9926         * class.cs (TypeContainer.GetClassBases): Changed
9927         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9928         CS8214 reporting here.
9929         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9930         instead of a `Type' for our parent.  In case of a recursive
9931         declaration (see tests/gen-23.cs for an example), our parent is a
9932         ConstructedType and it doesn't have its type set.  So, first
9933         create our own TypeBuilder, then call constructed.Resolve() to get
9934         the parent's type and finally TypeBuilder.SetParent() it.
9935
9936         * ecore.cs (TypeExpr.Name): New public virtual property.
9937
9938         * generic.cs
9939         (ConstructedType): We're now a TypeExpr and not just an Expression.
9940         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9941         arguments here; this is done later.
9942         (ConstructedType.Resolve): New public method to resolve the type
9943         arguments and bind them.
9944
9945 2003-10-21  Martin Baulig  <martin@ximian.com>
9946
9947         * convert.cs: Use `TypeManager.IsValueType' instead of
9948         'type.IsValueType' everywhere.
9949
9950         * typemanager.cs (TypeManager.IsValueType): Return true for type
9951         parameters.  The reason for this is that we need to box a type
9952         parameter when converting it to a reference type.
9953
9954         * cs-parser.jay: Added support for default value expressions.
9955
9956         * generics.cs (DefaultValueExpression): New public class.       
9957
9958 2003-10-17  Martin Baulig  <martin@ximian.com>
9959
9960         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9961         TypeContainer so we can also use this for Interfaces.
9962         (TypeParameter.Resolve): Likewise.
9963
9964         * interface.cs (Interface.DefineType): Added support for generic
9965         interfaces.
9966
9967         * cs-parser.jay: Added support for generic structs and interfaces.
9968
9969 2003-10-17  Martin Baulig  <martin@ximian.com>
9970
9971         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9972         call generic methods :-)
9973
9974 2003-10-16  Martin Baulig  <martin@ximian.com>
9975
9976         * cs-parser.jay (namespace_or_type_name): Only create a
9977         GenericMemberAccess if we actually have type arguments.
9978
9979 2003-10-13  Martin Baulig  <martin@ximian.com>
9980
9981         * class.cs (Method.Define): If we're a generic method, call
9982         TypeBuilder.DefineGenericMethod () before resolving
9983         the parameters.
9984         (MethodData): Added .ctor which takes an additional MethodBuilder
9985         argument; this is used for generic methods.
9986         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9987         we already have a MethodBuilder.
9988
9989 2003-10-10  Martin Baulig  <martin@ximian.com>
9990
9991         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9992         instead of a `DeclSpace'.  This is used for generic methods.
9993
9994         * cs-parser.jay (method_header): Added support for generic
9995         methods; create a `GenericMethod' instance and pass it to the
9996         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9997         parameters and locals.
9998
9999         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10000         since we already have the location.  Check whether we're a generic
10001         type declaration or a generic method and create the correct type
10002         parameter.
10003
10004         * generic.cs (TypeParameter.DefineMethod): New public method.
10005         (GenericMethod): New public class; derives from DeclSpace and is
10006         used for generic methods.       
10007
10008 2003-10-09  Martin Baulig  <martin@ximian.com>
10009
10010         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10011         to the .ctor.
10012         (MethodCore.DoDefineParameters): Removed the TypeContainer
10013         argument; use the DeclSpace which was passed to the .ctor instead.
10014         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10015         TypeContainer; we only need a DeclSpace here.
10016
10017 2003-10-09  Martin Baulig  <martin@ximian.com>
10018
10019         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10020         to the .ctor.
10021         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10022         EmitContext's .ctor.    
10023
10024 2003-10-09  Martin Baulig  <martin@ximian.com>
10025
10026         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10027         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10028         AsAccessible(), moved them as well.
10029
10030         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10031
10032 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10033
10034         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10035         generation for >=, as spotted by Paolo, bug 48679.  
10036         Patch from David Waite.
10037
10038         * cs-tokenizer.cs: Add handling for #pragma.
10039
10040         * cs-parser.jay: Allow for both yield and yield return in the
10041         syntax.  The anti-cobolization of C# fight will go on!
10042
10043         * class.cs (TypeBuilder.DefineType): Catch error condition here
10044         (Parent.DefineType erroring out and returning null).
10045
10046         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10047         coping with enumerations variables, we were mistakenly processing
10048         them as a regular value type instead of built-in types.  Fixes the
10049         bug #48063
10050
10051         * typemanager.cs (IsBuiltinOrEnum): New method.
10052
10053 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10054
10055         * cs-parser.jay: Upgrade: yield now needs the return clause.
10056
10057 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10058
10059         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10060
10061 2003-09-29  Martin Baulig  <martin@ximian.com>
10062
10063         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10064         inflated generic methods.
10065
10066         * generics.cs (ConstructedType): Distinguish between open and
10067         closed constructed types; correctly resolve the arguments.
10068
10069 2003-09-22  Martin Baulig  <martin@ximian.com>
10070
10071         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10072         all type arguments meet their constraints.
10073
10074 2003-09-19  Martin Baulig  <martin@ximian.com>
10075
10076         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10077         `MemberCache parent' argument.  Normally, an interface doesn't
10078         have a parent type except System.Object, but we use this in gmcs
10079         for generic type parameters.
10080
10081 2003-09-18  Martin Baulig  <martin@ximian.com>
10082
10083         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10084         on `type.IsInterface'; don't check whether the type has a parent
10085         to determine whether it's an interface.
10086
10087 2003-09-17  Martin Baulig  <martin@ximian.com>
10088
10089         * generic.cs (ConstructedType.ToString): Always use `name' as the
10090         type name.
10091
10092 2003-09-15  Martin Baulig  <martin@ximian.com>
10093
10094         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10095
10096         * generic.cs (Constraints.Resolve): New public method; this is
10097         called to resolve the constraint types and to check whether all
10098         the constraints are correct.
10099         (Constraints.Types): New public property.
10100         (TypeParameter.Resolve): New public method; resolves all the
10101         type's constraints.
10102
10103         * class.cs (TypeContainer.DefineType): Call
10104         TypeParameter.Resolve() before actually defining the type.
10105
10106 2003-09-15  Martin Baulig  <martin@ximian.com>
10107
10108         * class.cs (TypeContainer.DefineType): Added an error flag to
10109         avoid reporting duplicate CS0146's ("class definition is
10110         circular.").
10111
10112         * driver.cs (Driver.MainDriver): Abort if
10113         RootContext.ResolveTree() reported any errors.
10114
10115 2003-09-07  Martin Baulig  <martin@ximian.com>
10116
10117         * report.cs (Error, Warning): Added overloaded versions which take
10118         a `params object[] args' and call String.Format().
10119
10120 2003-09-07  Martin Baulig  <martin@ximian.com>
10121
10122         * decl.cs (DeclSpace..ctor): Don't call
10123         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10124         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10125         (DeclSpace.RecordDecl): New method.
10126
10127         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10128
10129 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10130
10131         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10132         value attributes to be applied to ParameterBuilders.
10133
10134         * class.cs (MethodCore.LabelParameters): Make static and more
10135         generic so that it can be used from other places - like interface
10136         methods, for instance.
10137
10138         * interface.cs (Interface.Emit): Call LabelParameters before
10139         emitting attributes on the InterfaceMethod.
10140
10141 2003-09-07  Martin Baulig  <martin@ximian.com>
10142
10143         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10144         if the number of type parameters doesn't match.
10145
10146 2003-09-04  Martin Baulig  <martin@ximian.com>
10147
10148         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10149         for arrays of generic type params (ie. `!0[]').
10150
10151 2003-09-04  Martin Baulig  <martin@ximian.com>
10152
10153         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10154         for the moment.
10155
10156 2003-09-04  Martin Baulig  <martin@ximian.com>
10157
10158         * decl.cs (DeclSpace.LookupGeneric): New method.
10159         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10160         moment.
10161
10162         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10163         argument, not just a string.
10164         (TypeParameter.Define): New public method; this is called to
10165         actually define the generic parameter; after this, you can use the
10166         new `Type' property to get the type.
10167
10168 2003-09-04  Martin Baulig  <martin@ximian.com>
10169
10170         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10171         is now an ArrayList; initialize the result of the `TypeParameters'
10172         property here.
10173         (DeclSpace.GetGenericData): Removed.
10174         (DeclSpace.LookupGeneric): Temporarily removed; we need to
10175         implement this in a different way.
10176         (DeclSpace.GetTypeParameters): Removed; there's now a
10177         `TypeParameters' property.
10178         (DeclSpace.TypeParameters): New public property.
10179
10180         * generic.cs (Constraints): Make this class public.
10181         (TypeParameter): New public class.
10182
10183 2003-09-04  Martin Baulig  <martin@ximian.com>
10184
10185         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10186         generic parameters.
10187
10188         * class.cs (TypeContainer.DefineType): Call
10189         TypeBuilder.DefineGenericParameter () on all generic parameters if
10190         this is a generic type.
10191
10192 2003-08-28  Martin Baulig  <martin@ximian.com>
10193
10194         * sample-stack.il: Compile this with ilasm: "ilasm /dll
10195         sample-stack.il".
10196
10197         * sample-hello.cs: Compile this with gmcs: "gmcs
10198         /r:sample-stack.dll sample-hello.cs".
10199
10200 2003-08-28  Martin Baulig  <martin@ximian.com>
10201
10202         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10203         the parameters to the generic type.
10204
10205 2003-08-28  Martin Baulig  <martin@ximian.com>
10206
10207         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10208
10209 2003-08-28  Martin Baulig  <martin@ximian.com>
10210
10211         * cs-parser.jay (opt_type_argument_list): Use
10212         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10213         (primary_expression): Replace `qualified_identifier' with `type_name'.
10214         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10215
10216         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10217         parser to check whether it is syntactically a type parameter list;
10218         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10219         this case.
10220
10221 2003-08-26  Martin Baulig  <martin@ximian.com>
10222
10223         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10224         resolving aliases; fixes #47927.
10225
10226 2003-08-26  Martin Baulig  <martin@ximian.com>
10227
10228         * statement.cs (Using.DoResolve): This is internally emitting a
10229         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10230         do not always return.  Fixes #47681.
10231
10232 2003-08-26  Martin Baulig  <martin@ximian.com>
10233
10234         * decl.cs (MemberCore): Moved WarningNotHiding(),
10235         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10236         into MemberBase.
10237         (AdditionResult): Make this nested in DeclSpace.
10238         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10239         argument; call NamespaceEntry.Define() unless we're nested in a
10240         class or struct.
10241
10242         * namespace.cs (Namespace.DefineName): New public function.  This
10243         is called from DeclSpace's .ctor to add 
10244         (Namespace.Lookup): Include DeclSpaces in the lookup.
10245
10246         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10247
10248         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10249
10250 2003-08-25  Martin Baulig  <martin@ximian.com>
10251
10252         * convert.cs (Convert.ExplicitReferenceConversion): When
10253         converting from an interface type to a class, unbox if the target
10254         type is a struct type.  Fixes #47822.
10255
10256 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10257
10258         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10259         #47854.
10260
10261 2003-08-22  Martin Baulig  <martin@ximian.com>
10262
10263         * class.cs (TypeManager.DefineType): When defining a nested type,
10264         call DefineType() on our parent; fixes #47801.
10265
10266 2003-08-22  Martin Baulig  <martin@ximian.com>
10267
10268         * class.cs (MethodData.Define): While checking if a method is an
10269         interface implementation, improve the test a bit more to fix #47654.
10270
10271 2003-08-22  Martin Baulig  <martin@ximian.com>
10272
10273         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10274         correctly; fixes #47722.
10275
10276 2003-08-22  Martin Baulig  <martin@ximian.com>
10277
10278         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10279         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10280
10281         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10282
10283 2003-08-22  Martin Baulig  <martin@ximian.com>
10284
10285         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10286         can only be assigned in static constructors.  Fixes #47161.
10287
10288 2003-08-22  Martin Baulig  <martin@ximian.com>
10289
10290         Rewrote and improved the flow analysis code.
10291
10292         * flowbranching.cs (FlowBranching): Make this class abstract.
10293         (FlowBranching.CreateBranching): New static function to create a
10294         new flow branching.
10295         (FlowBranchingBlock, FlowBranchingException): New classes.
10296         (FlowBranching.UsageVector.Type): New public readonly field.
10297         (FlowBranching.UsageVector.Breaks): Removed the setter.
10298         (FlowBranching.UsageVector.Returns): Removed the setter.
10299         (FlowBranching.UsageVector): Added Break(), Return(),
10300         NeverReachable() and Throw() methods to modify the reachability.
10301         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10302         done by FlowBranching.Merge().
10303         (FlowBranching.UsageVector.MergeChild): New method; merges the
10304         merge result into the current vector.
10305         (FlowBranching.Merge): New abstract method to merge a branching.
10306
10307 2003-08-12  Martin Baulig  <martin@ximian.com>
10308
10309         * expression.cs (Indirection.CacheTemporaries): Create the
10310         LocalTemporary with the pointer type, not its element type.
10311
10312 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10315         token was a keyword or not.
10316
10317         Add `error' options where an IDENTIFIER was expected;  Provide
10318         CheckToken and CheckIdentifierToken convenience error reporting
10319         functions. 
10320
10321         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10322
10323         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10324         NameSpaceEntry NameSpaceEntry.
10325
10326         (LookupInterfaceOrClass): Avoid creating a full qualified name
10327         from namespace and name: avoid doing lookups when we know the
10328         namespace is non-existant.   Use new Tree.LookupByNamespace which
10329         looks up DeclSpaces based on their namespace, name pair.
10330
10331         * driver.cs: Provide a new `parser verbose' to display the
10332         exception thrown during parsing.  This is turned off by default
10333         now, so the output of a failure from mcs is more graceful.
10334
10335         * namespace.cs: Track all the namespaces defined in a hashtable
10336         for quick lookup.
10337
10338         (IsNamespace): New method
10339
10340 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10341
10342         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10343         we know that we need to concatenate (full typename can never be
10344         null). 
10345
10346         * class.cs: ditto.
10347
10348         * statement.cs: Use a bitfield;  Do not initialize to null things
10349         which are done by the constructor by default.
10350
10351         * cs-parser.jay: bug fix, parameter was 4, not 3.
10352
10353         * expression.cs: Just use the property;
10354
10355         * statement.cs: No need for GetVariableInfo method.
10356
10357 2003-08-08  Martin Baulig  <martin@ximian.com>
10358
10359         * flowanalysis.cs (FlowReturns): This is now nested in the
10360         `FlowBranching' class.
10361         (MyBitVector): Moved this here from statement.cs.
10362         (FlowBranching.SiblingType): New enum type.
10363         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10364
10365 2003-08-07  Martin Baulig  <martin@ximian.com>
10366
10367         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10368         `FlowBranching' class and called `BranchingType'.
10369
10370 2003-08-07  Martin Baulig  <martin@ximian.com>
10371
10372         * flowanalysis.cs: Moved all the control flow analysis code into
10373         its own file.
10374
10375 2003-08-07  Martin Baulig  <martin@ximian.com>
10376
10377         * assign.cs (Assign.DoResolve): `target' must either be an
10378         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10379         #37319.
10380
10381 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10382
10383         * expression.cs (BinaryMethod): This kind of expression is created by the
10384         Binary class if it determines that the operator has to be handled
10385         by a method.
10386
10387         (BinaryDelegate): This kind of expression is created if we are
10388         dealing with a + or - operator on delegates.
10389
10390         (Binary): remove method, argumetns, and DelegateOperator: when
10391         dealing with methods, 
10392
10393         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10394
10395         * statement.cs (Block): use bitfields for the three extra booleans
10396         we had in use.   Remove unused topblock parameter.
10397
10398         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10399
10400         * assign.cs: Drop extra unneeded tests.
10401
10402 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10403
10404         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10405
10406         * statement.cs (Foreach): Use VariableStorage instead of
10407         LocalBuilders.   
10408
10409         * codegen.cs (VariableStorage): New class used by clients that
10410         require a variable stored: locals or fields for variables that
10411         need to live across yield.
10412
10413         Maybe provide a convenience api for EmitThis+EmitLoad?
10414
10415         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10416         these bad boys.
10417
10418 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10419
10420         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10421         RemapParameterLValue): New methods that are used to turn a
10422         precomputed FieldInfo into an expression like this:
10423
10424                 instance.FieldInfo
10425
10426         The idea is to use this instead of making LocalVariableReference
10427         have more than one meaning.
10428
10429         * cs-parser.jay: Add error production to BASE.
10430
10431         * ecore.cs: Deal with TypeManager.GetField returning null, which
10432         is now a valid return value.
10433
10434         (FieldExprNoAddress): New expression for Fields whose address can
10435         not be taken.
10436
10437         * expression.cs (LocalVariableReference): During the resolve
10438         phases, create new expressions if we are in a remapping context.
10439         Remove code that dealt with remapping here.
10440
10441         (ParameterReference): same.
10442
10443         (ProxyInstance): New expression, like the `This' expression, but
10444         it is born fully resolved.  We know what we are doing, so remove
10445         the errors that are targeted to user-provided uses of `this'.
10446
10447         * statement.cs (Foreach): our variable is now stored as an
10448         Expression;  During resolution, follow the protocol, dont just
10449         assume it will return this.
10450
10451 2003-08-06  Martin Baulig  <martin@ximian.com>
10452
10453         * support.cs (SeekableStreamReader.cs): New public class.
10454
10455         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10456         SeekableStreamReader instead of the normal StreamReader.
10457
10458 2003-08-04  Martin Baulig  <martin@ximian.com>
10459
10460         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10461         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10462         deambiguate casts and delegate invocations.
10463         (parenthesized_expression): Use the new tokens to ensure this is
10464         not a cast of method invocation.
10465
10466         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10467         when reading a `)' and Deambiguate_CloseParens () was previously
10468         called.
10469
10470         * expression.cs (ParenthesizedExpression): New class.  This is
10471         just used for the CS0075 test.
10472         (Binary.DoResolve): Check for CS0075.   
10473
10474 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10475
10476         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10477         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10478         reference comparison.
10479
10480         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10481         examine the ReturnType for equality - this is necessary in the
10482         cases of implicit and explicit operators whose signature also
10483         includes the return type.
10484
10485 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10486
10487         * namespace.cs: Cache the result of the namespace computation,
10488         instead of computing it every time.
10489
10490 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * decl.cs: Use a global arraylist that we reuse over invocations
10493         to avoid excesive memory consumption.  Reduces memory usage on an
10494         mcs compile by one meg (45 average).
10495
10496         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10497         private, work around that.
10498
10499 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10500
10501         * literal.cs (IntLiteral): Define Zero and One static literals. 
10502
10503         * cs-parser.jay (integer_literal): use static literals to reduce
10504         memory usage for the most used literals (0, 1 and -1).  211kb
10505         reduced in memory usage.
10506
10507         Replace all calls to `new ArrayList' with `new
10508         ArrayList(4)' which is a good average number for most allocations,
10509         and also requires only 16 bytes of memory for its buffer by
10510         default. 
10511
10512         This reduced MCS memory usage in seven megabytes for the RSS after
10513         bootstrapping.
10514
10515 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10516
10517         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10518         handle params methods the correct way by forming only one
10519         applicable set with params and normal methods in them. Earlier we
10520         were looking at params methods only if we found no normal methods
10521         which was not the correct thing to do.
10522
10523         (Invocation.BetterFunction): Take separate arguments indicating
10524         when candidate and the best method are params methods in their
10525         expanded form.
10526
10527         This fixes bugs #43367 and #46199.
10528
10529         * attribute.cs: Documentation updates.
10530
10531         (CheckAttribute): Rename to CheckAttributeTarget.
10532         (GetValidPlaces): Rename to GetValidTargets.
10533
10534         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10535         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10536
10537         Fixes bug #44468.
10538
10539 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10540
10541         * codegen.cs: Compute IsGeneric correctly.
10542
10543         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10544         resolution. 
10545
10546         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10547         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10548         regressions, and I was chasing more bugs than I required.
10549
10550         * interface.cs: Use expressions for base type names (like classes
10551         and structs have been doing for a while now), and resolve that.
10552         This patch should probably go into head as well.
10553
10554         This makes it one less user of FindType.
10555
10556 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10557
10558         This compiler can not self host currently.  Need to fix that.
10559         
10560         * Makefile: compile to `gmcs.exe'
10561
10562         * driver.cs: Turn on v2 by default on gmcs.
10563
10564         * generic.cs (ConstructedType): Does no longer take a container
10565         type argument;  That will be taken care of later.
10566
10567         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10568         Use SimpleName to resolve for now, so we can continue the work on
10569         the parser, until we get Type.GetType that understands generics.
10570
10571         (ConstructedType.ToString): Implement
10572
10573         (TypeArguments.Resolve): Resolve the child expressions as types. 
10574         
10575         * cs-parser.jay: Rename interface_constraints to
10576         type_parameter_constraints
10577
10578         (namespace_or_type_name): Only use constructed types for the basic
10579         construction, we will deal with identifier<...> later.
10580
10581         (type/type_name): No longer call DecomposeQI, as
10582         namespace_or_type_name is always decoded now.
10583         
10584 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10585
10586         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10587         closely: we eliminate methods in base types when we have an
10588         applicable method in a top-level type.
10589
10590         Please see section 14.5.5.1 for an exact description of what goes
10591         on. 
10592
10593         This fixes bug #45127 and a host of other related to corlib compilation.
10594
10595         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10596         array is the method corresponding to the top-level type (this is
10597         because of the changes made to icall.c) so we change this
10598         accordingly.
10599
10600         (MethodGroupExpr.Name): This too.
10601
10602         * typemanager.cs (GetElementType): New method which does the right
10603         thing when compiling corlib. 
10604
10605         * everywhere: Make use of the above in the relevant places.
10606
10607 2003-07-22  Martin Baulig  <martin@ximian.com>
10608
10609         * cs-parser.jay (invocation_expression): Moved
10610         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10611         `cast_expression', but create a InvocationOrCast which later
10612         resolves to either an Invocation or a Cast.
10613
10614         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10615         method; call this before EmitStatement() to make sure that this
10616         expression can be used as a statement.
10617
10618         * expression.cs (InvocationOrCast): New class; resolves to either
10619         an Invocation or a Cast.
10620
10621         * statement.cs (StatementExpression): Call ResolveStatement() on
10622         the ExpressionStatement before emitting it.
10623
10624 2003-07-21  Martin Baulig  <martin@ximian.com>
10625
10626         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10627         `ref' and `out' attributes match; fixes #46220.
10628         (MemberAccess.ResolveMemberAccess): You can't reference a type
10629         through an expression; fixes #33180.
10630         (Indexers.GetIndexersForType): Don't return the indexers from
10631         interfaces the class implements; fixes #46502.
10632
10633 2003-07-21  Martin Baulig  <martin@ximian.com>
10634
10635         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10636         CS0661 checks; fixes bug #30442.
10637
10638 2003-07-21  Martin Baulig  <martin@ximian.com>
10639
10640         * decl.cs (AdditionResult): Added `Error'.
10641
10642         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10643
10644         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10645         cs0031.cs actually work.
10646
10647  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10648  
10649         * cs-parser.jay (namespace_name): do not use
10650         namespace_or_type_name, use qualified_identifier, because
10651         namespace_or_type_name will soon return a composed expression
10652         instead of a string.
10653  
10654         (namespace_or_type_name): Instead of returning a string, now this
10655         production returns an expression.
10656  
10657         * codegen.cs (EmitContext): Setup IsGeneric property based on
10658         whether our DeclSpace is generic, our the method is generic.
10659  
10660         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10661         the method is generic.
10662  
10663         * cs-parser.jay (type_arguments, opt_type_argument_list,
10664         type_parameters, type_parameter_list, opt_type_parameter_list,
10665         type_parameter,, opt_type_parameter_constraints_clauses,
10666         type_parameter_constraints_clauses,
10667         type_parameter_constraint_clause, type_parameter_constraint,
10668         interface_constraints): Add new production
10669  
10670         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10671         DeclSpace is generic or not.
10672  
10673         (DeclSpace.SetParameterInfo): New routine, used to set the
10674         parameter info for a type.
10675  
10676         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10677         returns a GenericTypeExpr
10678  
10679         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10680         generic, lookup the generic argument.
10681  
10682         * attribute.cs: Do not allow TypeParameterExpressions in
10683         Attributes.
10684  
10685         * class.cs: Do not allow the Main method to be defined in a
10686         Generic container.
10687  
10688         * expression.cs (SizeOf): Do not allow generic types to be used as
10689         arguments to sizeof.
10690  
10691         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10692         it: whether a type is generic or not.  Only works for types we are
10693         currently building for now.
10694         
10695 2003-07-20  Martin Baulig  <martin@ximian.com>
10696
10697         * namespace.cs: Fixed that bug which caused a crash when compiling
10698         the debugger's GUI.
10699
10700 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10701
10702         * typemanager.cs (LookupTypeReflection): Never expose types which
10703         are NotPublic, NestedPrivate, NestedAssembly, or
10704         NestedFamANDAssem.  We used to return these, and later do a check
10705         that would report a meaningful error, but the problem is that we
10706         would not get the real match, if there was a name override.
10707
10708 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10709
10710         * namespace.cs (Namespace, Name): Do not compute the namespace
10711         name dynamically, compute it in the constructor.  This reduced
10712         memory usage by 1697 KB.
10713
10714         * driver.cs: Use --pause to pause at the end.
10715
10716 2003-07-17  Peter Williams  <peter@newton.cx>
10717
10718         * Makefile: Change the name of the test target so that it doesn't
10719         conflict with the recursive test target.
10720
10721 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10724         AddressOf): Do not use EmitThis, that was wrong, use the actual
10725         this pointer.
10726
10727 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10728
10729         * class.cs (MethodData.Define): While checking if a method is an
10730         interface implementation, improve the test: If we are not public
10731         (use new test here: use the computed MethodAttributes directly,
10732         instead of the parsed modifier flags) check if the `implementing'
10733         method comes from an interface or not.
10734
10735         * pending.cs (VerifyPendingMethods): Slightly better error
10736         message.
10737
10738         * makefile: add test target that does the mcs bootstrap.
10739
10740 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10741
10742         * interface.cs (Define): Do nothing here since there are no
10743         members to populate etc. Move the attribute emission out of here
10744         since this was just totally the wrong place to put it. Attribute
10745         application happens during the 'Emit' phase, not in the 'Define'
10746         phase.
10747
10748         (Emit): Add this method and move the attribute emission here
10749
10750         * rootcontext.cs (EmitCode): Call the Emit method on interface
10751         types too.
10752
10753 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10754
10755         * expression.cs (OverloadResolve): Report error only if Location
10756         is not 'Null' which means that there was a probe going on.
10757
10758 2003-07-14  Martin Baulig  <martin@ximian.com>
10759
10760         * expression.cs (ConditionalLogicalOperator): New public class to
10761         implement user defined conditional logical operators.
10762         This is section 14.11.2 in the spec and bug #40505.
10763
10764 2003-07-14  Martin Baulig  <martin@ximian.com>
10765
10766         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10767
10768 2003-07-14  Martin Baulig  <martin@ximian.com>
10769
10770         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10771
10772         * ecore.cs (IVariable.VerifyFixed): New interface method.
10773
10774         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10775         operator, check whether the variable is actually fixed.  Fixes bug
10776         #36055.  Set a variable definitely assigned when taking its
10777         address as required by the spec.
10778
10779         * statement.cs (LocalInfo.IsFixed): New field.
10780         (LocalInfo.MakePinned): Set `IsFixed' to true.
10781
10782 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10783
10784         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10785         for .ctors, ensure that we only ask for members declared in the
10786         attribute type (BindingFlags.DeclaredOnly).
10787
10788         Fixes bug #43632.
10789
10790         * expression.cs (Error_WrongNumArguments): Report error 1501
10791         correctly the way CSC does.
10792
10793 2003-07-13  Martin Baulig  <martin@ximian.com>
10794
10795         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10796         lookup on the fully qualified name, to make things like "X.X" work
10797         where "X.X" is a fully qualified type name, but we also have a
10798         namespace "X" in the using list.  Fixes #41975.
10799
10800 2003-07-13  Martin Baulig  <martin@ximian.com>
10801
10802         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10803         function. If we're a CompoundAssign, we need to create an embedded
10804         CompoundAssign, not an embedded Assign.
10805         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10806         Fixes #45854.
10807
10808 2003-07-13  Martin Baulig  <martin@ximian.com>
10809
10810         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10811         work to fix bug #46088.
10812
10813 2003-07-13  Ravi Pratap <ravi@ximian.com>
10814
10815         * class.cs (Operator.Emit): Do not emit attributes here - it is
10816         taken care of by the Method class that we delegate too. This takes
10817         care of bug #45876.
10818
10819 2003-07-10  Martin Baulig  <martin@ximian.com>
10820
10821         * expression.cs (TypeOfVoid): New class.
10822         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10823
10824 2003-07-10  Martin Baulig  <martin@ximian.com>
10825
10826         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10827         bug #35957.
10828
10829 2003-07-10  Martin Baulig  <martin@ximian.com>
10830
10831         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10832         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10833
10834         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10835
10836         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10837
10838 2003-07-10  Martin Baulig  <martin@ximian.com>
10839
10840         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10841         of decimal.  Fixes #42850.
10842
10843         NOTE: I also fixed the created byte blob, but this doesn't work on
10844         the MS runtime and csc never produces any byte blobs for decimal
10845         arrays.
10846
10847 2003-07-10  Martin Baulig  <martin@ximian.com>
10848
10849         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10850         structs; fixes #32068.
10851         (Block.AddChildVariableNames): Fixed #44302.
10852
10853 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10854
10855         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10856
10857 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10858
10859         * attribute.cs: And this test is onger needed.
10860
10861 2003-07-08  Martin Baulig  <martin@ximian.com>
10862
10863         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10864         inaccessible types.  Fixes #36313.
10865
10866         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10867
10868         * namespace.cs (NamespaceEntry): Create implicit entries for all
10869         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10870         implicit entries for N1.N2 and N1.
10871
10872 2003-07-08  Martin Baulig  <martin@ximian.com>
10873
10874         Rewrote the handling of namespaces to fix a lot of the issues
10875         wrt. `using' aliases etc.
10876
10877         * namespace.cs (Namespace): Splitted this class into a
10878         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10879
10880         * typemanager.cs (TypeManager.IsNamespace): Removed.
10881         (TypeManager.ComputeNamespaces): Only compute namespaces from
10882         loaded assemblies here, not the namespaces from the assembly we're
10883         currently compiling.
10884
10885 2003-07-08  Martin Baulig  <martin@ximian.com>
10886
10887         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10888
10889 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10890
10891         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10892         already fixed it.  
10893
10894         I thought about the memory savings here, but LookupTypeReflection
10895         is used under already very constrained scenarios.  Compiling
10896         corlib or mcs only exposes one hit, so it would not really reduce
10897         any memory consumption.
10898
10899 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10900
10901         * typemanager.cs: fixes bug #45889 by only adding public types from
10902         other assemblies to the list of known types.
10903
10904 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10905
10906         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10907         on the type we resolved.
10908
10909 2003-07-05  Martin Baulig  <martin@ximian.com>
10910
10911         * pending.cs (PendingImplementation.ParentImplements): Don't
10912         create the proxy if the parent is abstract.
10913
10914         * class.cs (TypeContainer.DefineIndexers): Process explicit
10915         interface implementations first.  Fixes #37714.
10916
10917 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10918
10919         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10920         defined recursively;  but since we modify the input parameters
10921         (left is set to `this' temporarily), we reset this value if the
10922         left_is_explicit is false, which gives the original semantics to
10923         the code.  
10924
10925         * literal.cs (NullPointer): new class used to represent a null
10926         literal in a pointer context.
10927
10928         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10929         type is a pointer, use a NullPointer object instead of a
10930         NullLiteral.   Closes 43687
10931
10932         (ExplicitConversion): Convert pointer values using
10933         the conv opcode to the proper type.
10934
10935         * ecore.cs (New): change ValueTypeVariable property into a method,
10936         that returns whether the valuetype is suitable for being used.
10937
10938         * expression.cs (Binary.DoNumericPromotions): Only return if we
10939         the int constant was a valid uint, and we can return both left and
10940         right as uints.  If not, we continue processing, to trigger the
10941         type conversion.  This fixes 39018.
10942
10943         * statement.cs (Block.EmitMeta): During constant resolution, set
10944         the CurrentBlock property on the emitcontext, so that we resolve
10945         constants propertly.
10946
10947 2003-07-02  Martin Baulig  <martin@ximian.com>
10948
10949         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10950         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10951
10952         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10953         than emitting it here.
10954
10955         * statement.cs: Fixed some more flow analysis bugs.
10956
10957 2003-07-02  Martin Baulig  <martin@ximian.com>
10958
10959         * class.cs (MethodData.Define): When implementing interface
10960         methods, set Final unless we're Virtual.
10961
10962         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10963         check work for interface methods.
10964
10965 2003-07-01  Martin Baulig  <martin@ximian.com>
10966
10967         * ecore.cs (EmitContext.This): Replaced this property with a
10968         GetThis() method which takes a Location argument.  This ensures
10969         that we get the correct error location for a CS0188.
10970
10971 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10974         ImplicitStandardConversion.
10975
10976         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10977
10978 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10979
10980         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10981         optimization.
10982
10983 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10984
10985         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10986         constructors.
10987
10988         (MethodData.Define): Turn off initlocals for unsafe methods.
10989
10990 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10991
10992         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10993         complete;  Fixes #37521.
10994
10995         * delegate.cs: Use Modifiers.TypeAttr to compute the
10996         TypeAttributes, instead of rolling our own.  This makes the flags
10997         correct for the delegates.
10998
10999 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11000
11001         * class.cs (Constructor.Define): Set the private flag for static
11002         constructors as well.
11003
11004         * cs-parser.jay (statement_expression): Set the return value to
11005         null, to avoid a crash when we catch an error.
11006
11007 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * cs-parser.jay: Applied patch from Jackson that adds support for
11010         extern and unsafe modifiers to destructor declarations.
11011
11012         * expression.cs: Report error 21 if the user is trying to index a
11013         System.Array.
11014
11015         * driver.cs: Add an error message, suggested by the bug report.
11016
11017         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11018         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11019
11020 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11021
11022         * namespace.cs: Add some information to reduce FAQs.
11023
11024 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11025
11026         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11027         underlying enumeration types.  Fixes #43915.
11028
11029         * expression.cs: Treat ushort/short as legal values to be used in
11030         bitwise operations.
11031
11032 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11033
11034         * delegate.cs: transfer custom attributes for paramenters from
11035         the delegate declaration to Invoke and BeginInvoke.
11036
11037 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11038
11039         * attribute.cs: handle custom marshalers and emit marshal info
11040         for fields, too.
11041
11042 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11043
11044         * makefile.gnu: Added anonymous.cs to the compiler sources.
11045
11046 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * iterators.cs: Change the name of the proxy class to include two
11049         underscores.
11050
11051         * cs-parser.jay: Update grammar to include anonymous methods.
11052
11053         * anonymous.cs: new file.
11054
11055 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * class.cs (Field.Define): Add missing test for pointers and
11058         safety. 
11059
11060 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11061
11062         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11063         we use the stobj opcode.
11064
11065         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11066         since it wasn't the correct fix. 
11067
11068         It still is puzzling that we are required to use stobj for IntPtr
11069         which seems to be a ValueType.
11070
11071 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11074         during regular simple name resolution.   Now, the trick is that
11075         instead of returning for processing the simplename, we do a
11076         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11077         contextual lookup type).   If a match is found, return that, if
11078         not, return for further composition.
11079
11080         This fixes long-standing 30485.
11081
11082         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11083         using the address to initialize an object, do an Stobj instead of
11084         using the regular Stelem.
11085
11086         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11087         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11088         Because if we are a BaseIndexerAccess that value will be true.
11089         Fixes 43643.
11090
11091         * statement.cs (GotoCase.Resolve): Return after reporting an
11092         error, do not attempt to continue. 
11093
11094         * expression.cs (PointerArithmetic.Emit): If our operand is a
11095         long, convert our constants to match the operand before
11096         multiplying.  Convert to I type before adding.   Fixes 43670.
11097
11098 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11099
11100         * enum.cs (ImplicitConversionExists) : Rename to
11101         ImplicitEnumConversionExists to remove ambiguity. 
11102
11103         * ecore.cs (NullCast): New type of cast expression class which
11104         basically is very similar to EmptyCast with the difference being
11105         it still is a constant since it is used only to cast a null to
11106         something else
11107         (eg. (string) null)
11108
11109         * convert.cs (ImplicitReferenceConversion): When casting a null
11110         literal, we return a NullCast.
11111
11112         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11113         should be around anymore.
11114
11115         The renaming (reported was slightly wrong). Corrections:
11116
11117         ConvertImplicitStandard -> ImplicitConversionStandard
11118         ConvertExplicitStandard -> ExplicitConversionStandard
11119
11120         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11121         before passing them in !
11122
11123         * convert.cs (ImplicitConversionStandard): When comparing for
11124         equal expr and target types, ensure that expr is not a
11125         NullLiteral.
11126
11127         In general, we must not be checking (expr_type ==
11128         target_type) in the top level conversion methods
11129         (ImplicitConversion, ExplicitConversion etc). This checking is
11130         done in the methods that they delegate to.
11131
11132 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11133
11134         * convert.cs: Move Error_CannotConvertType,
11135         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11136         ImplicitNumericConversion, ImplicitConversionExists,
11137         ImplicitUserConversionExists, StandardConversionExists,
11138         FindMostEncompassedType, FindMostSpecificSource,
11139         FindMostSpecificTarget, ImplicitUserConversion,
11140         ExplicitUserConversion, GetConversionOperators,
11141         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11142         TryImplicitIntConversion, Error_CannotConvertImplicit,
11143         ConvertImplicitRequired, ConvertNumericExplicit,
11144         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11145         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11146         its own file.
11147
11148         Perform the following renames:
11149
11150         StandardConversionExists -> ImplicitStandardConversionExists
11151         ConvertImplicit -> ImplicitConversion
11152         ConvertImplicitStandard -> ImplicitStandardConversion
11153         TryImplicitIntConversion -> ImplicitIntConversion
11154         ConvertImplicitRequired -> ImplicitConversionRequired
11155         ConvertNumericExplicit -> ExplicitNumericConversion
11156         ConvertReferenceExplicit -> ExplicitReferenceConversion
11157         ConvertExplicit -> ExplicitConversion
11158         ConvertExplicitStandard -> ExplicitStandardConversion
11159
11160 2003-05-19  Martin Baulig  <martin@ximian.com>
11161
11162         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11163         (TypeInfo): Added support for structs having structs as fields.
11164
11165         * ecore.cs (FieldExpr): Implement IVariable.
11166         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11167         VariableInfo for the field.
11168
11169 2003-05-18  Martin Baulig  <martin@ximian.com>
11170
11171         * expression.cs (This.DoResolve): Report a CS0027 if we're
11172         emitting a field initializer.
11173
11174 2003-05-18  Martin Baulig  <martin@ximian.com>
11175
11176         * expression.cs (This.ResolveBase): New public function.
11177         (This.DoResolve): Check for CS0188.
11178
11179         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11180         This.Resolve().
11181
11182         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11183         `instance_expression' to null if we don't have any non-static
11184         methods.
11185
11186 2003-05-18  Martin Baulig  <martin@ximian.com>
11187
11188         Reworked the way how local variables and parameters are handled by
11189         the flow analysis code.
11190
11191         * statement.cs (TypeInfo, VariableMap): New public classes.
11192         (VariableInfo): New public class.  This is now responsible for
11193         checking whether a variable has been assigned.  It is used for
11194         parameters and local variables.
11195         (Block.EmitMeta): Take the InternalParameters as argument; compute
11196         the layout of the flow vectors here.
11197         (Block.LocalMap, Block.ParameterMap): New public properties.
11198         (FlowBranching): The .ctor doesn't get the InternalParameters
11199         anymore since Block.EmitMeta() now computes the layout of the flow
11200         vector.
11201         (MyStructInfo): This class is now known as `StructInfo' and nested
11202         in `TypeInfo'; we don't access this directly anymore.
11203
11204         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11205         property and removed IsAssigned(), IsFieldAssigned(),
11206         SetAssigned() and SetFieldAssigned(); we now call them on the
11207         VariableInfo so we don't need to duplicate this code everywhere.
11208
11209         * expression.cs (ParameterReference): Added `Block block' argument
11210         to the .ctor.
11211         (LocalVariableReference, ParameterReference, This): The new
11212         VariableInfo class is now responsible for all the definite
11213         assignment stuff.
11214
11215         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11216         IsParameterAssigned, SetParameterAssigned): Removed.
11217
11218 2003-05-18  Martin Baulig  <martin@ximian.com>
11219
11220         * typemanager.cs (InitCoreTypes): Try calling
11221         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11222         the 3-args-version.  Corlib now also needs our `void_type'.
11223         (GetMethod): Added overloaded version which takes an optional
11224         `bool report_errors' to allow lookups of optional methods.
11225
11226 2003-05-12  Martin Baulig  <martin@ximian.com>
11227
11228         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11229         only used for locals and not for parameters.
11230
11231 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11232
11233         * support.cs (InternalParameters.ParameterType): Return the
11234         ExternalType of the parameter.
11235
11236         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11237         they were unused.
11238
11239 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * class.cs (MethodData.Define): Do not set the `newslot' on
11242         interface members, if they are also flagged as "override".
11243
11244         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11245         better code for ++i and i++.  This only works for static fields
11246         and local variables.
11247
11248         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11249         want to pull the DeclSpace out of the builder_to_declspace instead
11250         of the TypeBuilder (like in TypeContainer.FindMembers).
11251
11252         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11253         instead of LookupTypeContainer.  Fixes the crash on .NET for
11254         looking up interface members.
11255
11256         * const.cs: Create our own emit context during the Definition
11257         stage, so that constants are evaluated in the proper context, when
11258         a recursive definition happens.
11259
11260 2003-05-11  Martin Baulig  <martin@ximian.com>
11261
11262         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11263         new block for a switch section.
11264         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11265         the adding/lookup in the switch block.  Fixes #39828.
11266
11267 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11268
11269         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11270         functionality: I needed to convert the data after I had performed
11271         the add/sub operation into the operands type size.
11272
11273         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11274         pass the type for the box operation, otherwise the resulting
11275         object would have been of type object.
11276
11277         (BoxedCast): Add constructor to specify the type to box as.
11278
11279 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11280
11281         * iterators.cs: I was reusing the `count' variable inadvertently,
11282         take steps to not allow this to happen.
11283
11284 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11285
11286         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11287         by creating an array at the point where the params starts and
11288         putting all those arguments there, then adjusting the size of the
11289         array.
11290
11291 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11292
11293         * expression.cs (New.AddressOf): Implement interface
11294         IMemoryLocation.  This is used when the `new' operator is used in
11295         the context of an invocation to a method on a value type.
11296
11297         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11298         example. 
11299
11300         * namespace.cs: Also check the using aliases here.
11301
11302         * driver.cs: Move the test for using validity after the types have
11303         been entered, so we do a single pass that also includes the using
11304         aliases. 
11305
11306         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11307         in the regular case.   CreateSiblingForFinally is doing extra
11308         error checking.
11309
11310         * attribute.cs (GetAttributeArgumentExpression): Store the result
11311         on an out value, and use the return value to indicate failure
11312         instead of using null (which is a valid return for Constant.GetValue).
11313
11314         * statement.cs: Perform the analysis flow for the increment
11315         portion after the statement, because this will be the real flow of
11316         execution.  Fixes #42385
11317
11318         * codegen.cs (EmitContext.EmitArgument,
11319         EmitContext.EmitStoreArgument): New helper functions when the
11320         RemapToProxy flag is set.
11321
11322         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11323         function.
11324
11325         Add support for remapping parameters. 
11326
11327         * iterators.cs: Propagate parameter values;  Store parameter
11328         values in the proxy classes.
11329
11330 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11331
11332         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11333         need a proxy reference;  I do not know what I was thinking
11334
11335         * cs-parser.jay (constructor_initializer): catch another error,
11336         and display nice message.
11337
11338         (field_declaration): catch void field declaration
11339         to flag a better error. 
11340
11341         * class.cs (MemberBase.CheckBase): Report an error instead of a
11342         warning if a new protected member is declared in a struct. 
11343         (Field.Define): catch the error of readonly/volatile.
11344
11345         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11346
11347         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11348         volatile variable is taken
11349
11350 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11351
11352         * statement.cs (Fixed.Resolve): Report an error if we are not in
11353         an unsafe context.
11354
11355 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11356
11357         * typemanager.cs: reuse the code that handles type clashes for
11358         delegates and enumerations.
11359
11360         * class.cs (Report28): Always report.
11361
11362         * expression.cs (EncodeAsAttribute): Allow nulls here.
11363
11364 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11365
11366         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11367         the functionality for testing whether an expression is valid for
11368         an attribute here.  Also handle the case of arrays of elements
11369         being stored. 
11370
11371         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11372         encoding a linear array into an array of objects that are suitable
11373         to be passed to an CustomAttributeBuilder.
11374
11375         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11376
11377         * ecore.cs: (FieldExpr): Handle field remapping here.
11378
11379         * iteratators.cs: Pass the instance variable (if the method is an
11380         instance method) to the constructors, so we can access the field
11381         variables on the class.
11382
11383         TODO: Test this with structs.  I think the THIS variable on
11384         structs might have to be a pointer, and not a refenrece
11385
11386 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11387
11388         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11389         local variables to fields in a proxy class.
11390
11391         * iterators.cs (PopulateProxy): Rename our internal fields to
11392         <XXX>.  
11393         Create a <THIS> field if we are an instance method, so we can
11394         reference our parent container variables.
11395         (MapVariable): Called back from the EmitContext code to enter a
11396         new variable to field mapping into the proxy class (we just create
11397         a FieldBuilder).
11398
11399         * expression.cs
11400         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11401         for using the remapped locals to fields.
11402
11403         I placed the code here, because that gives the same semantics to
11404         local variables, and only changes the Emit code.
11405
11406         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11407         statements inside iterators.
11408         (VariableInfo): Add a FieldBuilder for the cases when we are
11409         remapping local variables to fields in a proxy class
11410
11411         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11412         current_block != null.
11413
11414         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11415         not cope with strings, as it has been moved to the
11416         TableSwitchEmit.  Fixed bug in switch generation.
11417
11418         * expression.cs (New.DoResolve): Provide more context for the user
11419         when reporting an error.
11420
11421         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11422         pointers. 
11423
11424         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11425         check the permissions for it.  Note than in a type-resolution
11426         context the check was already present in DeclSpace.ResolveType,
11427         but was missing from the MemberAccess.
11428
11429         (ArrayCreation.CheckIndices): warn if the user has
11430         more nested levels of expressions, but there are no more
11431         dimensions specified.  Avoids crash on bug 41906.
11432
11433 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11434
11435         * statement.cs (Block): replace Implicit bool, for a generic
11436         flags.   
11437         New flag: `Unchecked'.  This is used during the EmitMeta phase
11438         (which is out-of-line with the regular Resolve/Emit process for a
11439         statement, as this is done ahead of time, but still gets a chance
11440         to call constant resolve).
11441
11442         (Block.Flags): new enum for adding a new flag.
11443
11444         (Block.EmitMeta): track the state of unchecked.
11445
11446         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11447         to enable constant resolution to work there as well.
11448
11449 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11450
11451         * typemanager.cs (ienumerable_type): Also look up
11452         System.Collections.IEnumerable. 
11453
11454 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11455
11456         TODO: Test more than one conditional per method.
11457
11458         * class.cs (Indexer.Define): Report the location where the user is
11459         referencing the unsupported feature.
11460
11461         (MethodData): Overload the use of `conditionals' to
11462         minimize the creation of needless ArrayLists.   This saves roughly
11463         212kb on my machine.
11464
11465         (Method): Implement the new IIteratorContainer interface.
11466         (Method.SetYields): Implement the method by setting the ModFlags
11467         to contain METHOD_YIELDS.
11468
11469         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11470         which just got set to null.
11471
11472         * iterators.cs: New file.
11473
11474         (Yield, YieldBreak): New statements.
11475
11476         * statement.cs (Return.Resolve): Flag an error if we are used in
11477         an iterator method.
11478
11479         * codegen.cs (InIterator): New flag set if the code is being
11480         compiled in an iterator method.
11481
11482         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11483         internal modifier, and we just use it to avoid adding extra
11484         fields, as this is seldom used.  
11485
11486         * cs-parser.jay: Add yield_statement (yield and yield break).
11487
11488         * driver.cs: New flag -v2 to turn on version 2 features. 
11489
11490         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11491         hashtable when v2 is enabled.
11492
11493 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11494
11495         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11496         there is already a namespace defined with this name.
11497
11498         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11499         people upgraded their corlibs.
11500
11501         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11502         always use fully qualified types, no need to use the compiler
11503         front end.
11504
11505         (TypeManager.IsNamespace): Use binarysearch.
11506
11507         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11508         AddDelegate): I did not quite use the new IsValid API properly: I
11509         have to pass the short-name and the fullname.  I was passing only
11510         the basename instead of the fullname sometimes. 
11511
11512         (TypeContainer.DefineType): call NamespaceClash.
11513
11514         * interface.cs (Interface.DefineType): use NamespaceClash before
11515         defining the type.
11516
11517         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11518         defining the type.
11519
11520         * enum.cs: (Enum.DefineType): use NamespaceClash before
11521         defining the type.
11522
11523         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11524         speed increase.  First, use the negative_hits cache when we get a
11525         negative.  Second, add the type with its full original name
11526         instead of the new . and + encoded name (reflection uses + to
11527         separate type from a nested type).  Use LookupTypeReflection
11528         directly which bypasses the type->name hashtable (that we already
11529         know does not contain the type.
11530
11531         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11532         location/container type. 
11533
11534         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11535
11536 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11537
11538         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11539
11540         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11541         method is being referenced in the method group from a static
11542         context, and report error 120 if so.
11543
11544         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11545         Error118. 
11546
11547         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11548         is created, we create the A namespace).
11549
11550         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11551         Fixes #41591
11552
11553 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11556         invocation to ModuleBuilder.GetType with the same values will
11557         return a new type instance, so we need to cache its return
11558         values. 
11559
11560         * expression.cs (Binary.ResolveOperator): Only allow the compare
11561         operators on enums if they are of the same type.
11562
11563         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11564         types of ValueType on their own case.  Before we were giving them
11565         the same treatment as objects.
11566
11567         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11568         fullname.  Short name is used to compare against container name.
11569         Fullname is used to check against defined namespace names.
11570
11571         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11572         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11573
11574         (Method.CheckBase): Call parent.
11575         (MemberBase.CheckBase): Check for protected members on sealed
11576         classes.
11577         (PropertyBase.CheckBase): Call parent.
11578         (Field.Define): Call parent.
11579
11580         * report.cs: Negative error codes are now mapped to 8000 - code,
11581         so that the display is render more nicely.
11582
11583         * typemanager.cs: Do not use try/catch, instead report a regular
11584         error. 
11585
11586         (GetPointerType, GetReferenceType): These methods provide
11587         mechanisms to obtain the T* and T& from a T.  We had the code
11588         previously scattered around the code base, and it also used
11589         TypeManager.LookupType that would go through plenty of caches.
11590         This one goes directly to the type source.
11591
11592         In some places we did the Type.GetType followed by
11593         ModuleBuilder.GetType, but not in others, so this unifies the
11594         processing as well.
11595
11596         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11597         statements now that we have namespace information.
11598
11599         * typemanager.cs (IsNamespace): New method, returns whether the
11600         string presented is a namespace or not.
11601
11602         (ComputeNamespaces): New public entry point, computes the list of
11603         available namespaces, using the GetNamespaces API call in Mono, or
11604         the slower version in MS.NET.   
11605
11606         Now before we start the semantic analysis phase, we have a
11607         complete list of namespaces including everything that the user has
11608         provided.
11609
11610         Deleted old code to cache namespaces in .nsc files.
11611
11612 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11613
11614         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11615         class/struct location definition Location for the implicit
11616         constructor location.
11617
11618         (Operator.Define): Use the location of the operator for the
11619         implicit Method definition.
11620
11621         (Constructor.Emit): use the constructor location for the implicit
11622         base initializer constructor.
11623
11624         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11625         and the Expression class now contains two new methods:
11626
11627         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11628         isolate type lookup from the rest of the resolution process.
11629
11630         Since we use Expressions to hold type definitions due to the way
11631         we parse the input we have historically overloaded Resolve to
11632         perform the Type lookups if a special flag is passed.  Now this is
11633         eliminated and two methods take their place. 
11634
11635         The differences in the two methods between xStep and xTerminal is
11636         that xStep is involved in our current lookup system that uses
11637         SimpleNames to compose a name, while xTerminal is used just to
11638         catch the case where the simplename lookup failed.
11639
11640 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * expression.cs (ResolveMemberAccess): Remove redundant code.
11643         TypeExpr expressions are always born fully resolved.
11644
11645         * interface.cs (PopulateMethod): Do not lookup the types twice.
11646         We were doing it once during SemanticAnalysis and once during
11647         PopulateMethod.
11648
11649         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11650         in local variable type definitions, were being returned as a
11651         SimpleName (we decomposed everything into a string), that is
11652         because primary_expression was being used instead of a type in the
11653         grammar (reduce/reduce conflicts).
11654
11655         The part that was wrong is that we converted the expression into a
11656         string (an oversimplification in one hand, compounded with primary
11657         expressions doing string concatenation).
11658
11659         So things like:
11660
11661         A.B.C [] x;
11662
11663         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11664         using clauses from working on this particular context.  And a type
11665         was being matched directly against "A.B.C[]".
11666
11667         We now use the correct approach, and allow for ComposedCast to be
11668         part of the unary expression.  So the "A.B.C []" become a composed
11669         cast of "A.B.C" (as a nested group of MemberAccess with a
11670         SimpleName at the end) plus the rank composition "[]". 
11671
11672         Also fixes 35567
11673
11674 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11677         for the access level checking.
11678
11679         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11680         `TypeContainer container', because I kept getting confused when I
11681         was debugging this code.
11682
11683         * expression.cs (Indexers): Instead of tracking getters/setters,
11684         we now track them in parallel.  We create one arraylist less, but
11685         most importantly it is possible now for the LValue code to find a
11686         matching get for a set.
11687
11688         (IndexerAccess.DoResolveLValue): Update the code.
11689         GetIndexersForType has been modified already to extract all the
11690         indexers from a type.  The code assumed it did not.
11691
11692         Also make the code set the correct return type for the indexer.
11693         This was fixed a long time ago for properties, but was missing for
11694         indexers.  It used to be void_type.
11695
11696         (Binary.Emit): Test first for doubles instead of
11697         floats, as they are more common.
11698
11699         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11700         when dealing with floats and the <=, >= operators.  This fixes bug
11701         #39314 
11702
11703         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11704         to load the array value by emitting a load on the foreach variable
11705         type.  This was incorrect.  
11706
11707         We now emit the code to load an element using the the array
11708         variable type, and then we emit the conversion operator.
11709
11710         Fixed #40176
11711
11712 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11713
11714         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11715
11716 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11717
11718         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11719         test for protection before we test for signatures. 
11720
11721         (MethodSignature.ToString): implement.
11722
11723         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11724         to the case where we reduced into a LongConstant.
11725
11726         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11727         depend on whether the information is acurrate, because the
11728         Microsoft runtime will always claim that the array type is public,
11729         regardless of the real state.
11730
11731         If the type is a pointer, another problem happens: the type is
11732         reported as non-public in Microsoft.  
11733
11734         In both cases we have to call CheckAccessLevel recursively with
11735         the underlying type as the argument to be tested.
11736
11737 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11738
11739         * assign.cs (Assign.Emit): If we are dealing with a compound
11740         assignment expression, we should use the code path that stores the
11741         intermediate result in a temporary value.  This fixes #40903.
11742
11743         *expression.cs (Indirection.ToString): Provide ToString method for
11744         debugging. 
11745
11746 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11747
11748         * class.cs: Null out fields holding references to Block objects so
11749         they can be garbage collected.
11750
11751         * expression.cs (OverloadResolve): Remove unused local.
11752
11753 2003-04-07  Martin Baulig  <martin@ximian.com>
11754
11755         * codegen.cs (EmitContext.CurrentFile): New public field.
11756         (EmitContext.Mark): Use the CurrentFile to check whether the
11757         location is in the correct file.
11758         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11759
11760 2003-04-07  Martin Baulig  <martin@ximian.com>
11761
11762         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11763
11764         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11765         location.  [FIXME: The location argument which gets passed to this
11766         method is sometimes wrong!]
11767
11768 2003-04-07  Nick Drochak <ndrochak@gol.com>
11769
11770         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11771
11772 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * expression.cs (Indirection.EmitAssign): We were using the
11775         temporary, but returning immediately instead of continuing the
11776         EmitAssing flow.
11777
11778 2003-04-06  Martin Baulig  <martin@ximian.com>
11779
11780         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11781         if it's a nested child, but also deriving from the outer class.
11782         See test 190.cs.
11783
11784         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11785         nested child, but also deriving from the outer class.  See
11786         test-190.cs.
11787         (FilterWithClosure): We may access private members of the outer
11788         class if we're a nested child and deriving from the outer class.
11789         (RealMemberLookup): Only set `closure_private_ok' if the
11790         `original_bf' contained BindingFlags.NonPublic.
11791
11792 2003-04-05  Martin Baulig  <martin@ximian.com>
11793
11794         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11795         probe if its a type parameter, and if so, flag an error.
11796
11797         * decl.cs: Move here the SetParameterInfo code from class.cs.
11798         Handle IsGeneric here.
11799
11800         Handle a variety of errors in the parameter info definition.
11801
11802         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11803         type parameters here.
11804
11805         * cs-parser.jay (class_declaration): report errors for parameters
11806         here as well.
11807
11808 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11809
11810         * generic.cs: New file, contains support code for generics.
11811
11812         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11813         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11814
11815         Update parser for the above removals.
11816
11817         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11818         now taken care of in the parser.
11819
11820 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11821
11822         * class.cs (Event.Define): Do not allow abstract events to have
11823         initializers. 
11824
11825 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11826
11827         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11828         block in event declarations.
11829
11830         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11831         value type, get its address.
11832
11833         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11834         leaving a class on the stack instead of a boolean value (int
11835         0/1).  Change the code so we compare against null, and then the
11836         result against zero.
11837
11838         * class.cs (TypeContainer.GetClassBases): We were checking for the
11839         parent class being sealed too late.
11840
11841         * expression.cs (Binary.Emit): For <= and >= when dealing with
11842         floating point values, use cgt.un and clt.un instead of cgt and
11843         clt alone.
11844
11845 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11846
11847         * statement.cs: Apply the same optimization as MS: skip the 
11848         GetEnumerator returning an IEnumerator, and use the one returning a 
11849         CharEnumerator instead. This allows us to avoid the try-finally block 
11850         and the boxing.
11851
11852 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11853
11854         * cs-parser.jay: Attributes cannot be applied to
11855                          namespaces. Fixes #40473
11856
11857 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11858
11859         * class.cs:
11860         (Add*): check if the name is valid using the full name for constants,
11861         fields, properties and events.
11862
11863 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11864
11865         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11866         char constants to be part of the enumeration.
11867
11868         * expression.cs (Conditional.DoResolve): Add support for operator
11869         true. Implements the missing functionality from 14.12
11870
11871         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11872         operator true/false as required by the spec.
11873
11874         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11875         implicit conversion to boolean.
11876
11877         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11878         also one where the type implements `operator true'. 
11879
11880         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11881         get an expression that will invoke operator true based on an
11882         expression.  
11883
11884         (GetConversionOperators): Removed the hack that called op_True
11885         here.  
11886
11887         (Expression.ResolveBoolean): Move this from Statement.
11888
11889 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * ecore.cs (FieldExpr): do not allow initialization of initonly
11892         fields on derived classes
11893
11894 2003-03-13  Martin Baulig  <martin@ximian.com>
11895
11896         * statement.cs (Block.Emit): Call ig.BeginScope() and
11897         ig.EndScope() when compiling with debugging info; call
11898         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11899
11900 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11901
11902         * expression.cs (Indexers): Do not construct immediately, allow
11903         for new members to be appended as we go.  Fixes 38143
11904
11905 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11906
11907         * expression.cs: save/restore context when resolving an unchecked
11908         expression.
11909
11910 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * cfold.cs: Catch division by zero in modulus operator during
11913         constant folding.
11914
11915 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * interface.cs (Interface.DefineMembers): Avoid defining members
11918         twice. 
11919
11920 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11921
11922         * driver.cs: handle the +/- options for -noconfig
11923
11924         * statement.cs (Unckeched.Resolve): Also track the state of
11925         unchecked in the Resolve phase.
11926
11927 2003-02-27  Martin Baulig  <martin@ximian.com>
11928
11929         * ecore.cs (Expression.MemberLookup): Don't create a
11930         MethodGroupExpr for something which is not a method.  Fixes #38291.
11931
11932 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11933
11934         * class.cs (MemberBase.CheckParameters): Also check that the type
11935         is unmanaged if it is a pointer.
11936
11937         * expression.cs (SizeOf.Resolve): Add location information.
11938
11939         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11940         a managed type is declared.
11941
11942         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11943         parameter modifiers as well.  Fixes bug 38606
11944
11945         * class.cs: Very sad.  Am backing out the speed up changes
11946         introduced by the ArrayList -> Array in the TypeContainer, as they
11947         were not actually that much faster, and introduced a bug (no error
11948         reports on duplicated methods).
11949
11950         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11951         source first, this will guarantee that we have a valid expression
11952         before calling in lower levels functions that will require a
11953         resolved object.  Then use this original_source in the
11954         target.ResolveLValue instead of the original source that was
11955         passed to us.
11956
11957         Another change.  Use target.Resolve instead of LValueResolve.
11958         Although we are resolving for LValues, we will let the Assign code
11959         take care of that (it will be called again from Resolve).  This
11960         basically allows code like this:
11961
11962         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11963         class Y { void A (X x) { x [0] += o; }
11964
11965         The problem was that the indexer was trying to resolve for
11966         set_Item (idx, object o) and never finding one.  The real set_Item
11967         was set_Item (idx, X).  By delaying the process we get the right
11968         semantics. 
11969
11970         Fixes bug 36505
11971
11972 2003-02-23  Martin Baulig  <martin@ximian.com>
11973
11974         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11975         while calling DoEmit ().
11976
11977         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11978         source files; if you use the #line directive inside a method, the
11979         compiler stops emitting line numbers for the debugger until it
11980         reaches the end of the method or another #line directive which
11981         restores the original file.
11982
11983 2003-02-23  Martin Baulig  <martin@ximian.com>
11984
11985         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11986
11987 2003-02-23  Martin Baulig  <martin@ximian.com>
11988
11989         * statement.cs (Block.AddChildVariableNames): We need to call this
11990         recursively, not just for our immediate children.
11991
11992 2003-02-23  Martin Baulig  <martin@ximian.com>
11993
11994         * class.cs (Event.Define): Always make the field private, like csc does.
11995
11996         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11997         actually work, fixes bug #37521.
11998
11999 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * delegate.cs: When creating the various temporary "Parameters"
12002         classes, make sure that we call the ComputeAndDefineParameterTypes
12003         on those new parameters (just like we do with the formal ones), to
12004         allow them to be resolved in the context of the DeclSpace.
12005
12006         This fixes the bug that Dick observed in Bugzilla #38530.
12007
12008 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12009
12010         * expression.cs (ResolveMemberAccess): When resolving a constant,
12011         do not attempt to pull a constant if the value was not able to
12012         generate a valid constant.
12013
12014         * const.cs (LookupConstantValue): Do not report more errors than required.
12015
12016 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12017
12018         * expression.cs: fixes bug #38328.
12019
12020 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12021
12022         * class.cs: Changed all the various members that can be part of a
12023         class from being an ArrayList to be an Array of the right type.
12024         During the DefineType type_list, interface_list, delegate_list and
12025         enum_list are turned into types, interfaces, delegates and enums
12026         arrays.  
12027
12028         And during the member population, indexer_list, event_list,
12029         constant_list, field_list, instance_constructor_list, method_list,
12030         operator_list and property_list are turned into their real arrays.
12031
12032         Although we could probably perform this operation earlier, for
12033         good error reporting we need to keep the lists and remove the
12034         lists for longer than required.
12035
12036         This optimization was triggered by Paolo profiling the compiler
12037         speed on the output of `gen-sample-program.pl' perl script. 
12038
12039         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12040         not crash in methods like MemberLookupFailed that use this field.  
12041
12042         This problem arises when the compiler fails to resolve a type
12043         during interface type definition for example.
12044
12045 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12046
12047         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12048         inherit from System.Object, so we have to stop at null, not only
12049         when reaching System.Object.
12050
12051 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12052
12053         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12054         DeclaredOnly because the parent indexer might have had a different
12055         name, but did not loop until the top of the hierarchy was reached.
12056
12057         The problem this one fixes is 35492: when a class implemented an
12058         indexer from an interface, we were getting the interface method
12059         (which was abstract) and we were flagging an error (can not invoke
12060         abstract method).
12061
12062         This also keeps bug 33089 functioning, and test-148 functioning.
12063
12064         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12065         out if a method is special is to see if it is declared in a
12066         property or event, or whether it is one of the predefined operator
12067         names.   This should fix correctly #36804.
12068
12069 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12070
12071         The goal here is to remove the dependency on EmptyCast.Peel ().
12072         Killing it completely.
12073
12074         The problem is that currently in a number of places where
12075         constants are expected, we have to "probe" for an EmptyCast, and
12076         Peel, which is not the correct thing to do, as this will be
12077         repetitive and will likely lead to errors. 
12078
12079         The idea is to remove any EmptyCasts that are used in casts that
12080         can be reduced to constants, so we only have to cope with
12081         constants. 
12082
12083         This bug hunt was triggered by Bug 37363 and the desire to remove
12084         the duplicate pattern where we were "peeling" emptycasts to check
12085         whether they were constants.  Now constants will always be
12086         constants.
12087
12088         * ecore.cs: Use an enumconstant here instead of wrapping with
12089         EmptyCast.  
12090
12091         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12092         throwing me off.  By handling this we can get rid of a few hacks.
12093
12094         * statement.cs (Switch): Removed Peel() code.
12095
12096 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12097
12098         * class.cs: Location information for error 508
12099
12100         * expression.cs (New.DoResolve): Add a guard against double
12101         resolution of an expression.  
12102
12103         The New DoResolve might be called twice when initializing field
12104         expressions (see EmitFieldInitializers, the call to
12105         GetInitializerExpression will perform a resolve on the expression,
12106         and later the assign will trigger another resolution
12107
12108         This leads to bugs (#37014)
12109
12110         * delegate.cs: The signature for EndInvoke should contain any ref
12111         or out parameters as well.  We were not doing this in the past. 
12112
12113         * class.cs (Field.Define): Do not overwrite the type definition
12114         inside the `volatile' group.  Turns out that volatile enumerations
12115         were changing the type here to perform a validity test, which
12116         broke conversions. 
12117
12118 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12121         and structs, we do not want to load the instance variable
12122
12123         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12124         enum_type has to be handled like an object reference (implicit
12125         conversions exists from this to object), but the regular IsClass
12126         and IsValueType tests will never return true for this one.
12127
12128         Also we use TypeManager.IsValueType instead of type.IsValueType,
12129         just for consistency with the rest of the code (this is only
12130         needed if we ever use the construct exposed by test-180.cs inside
12131         corlib, which we dont today).
12132
12133 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12134
12135         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12136         just InternalCall.
12137
12138 2003-02-09  Martin Baulig  <martin@ximian.com>
12139
12140         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12141         (Namespace.DefineNamespaces): New static public method; this is
12142         called when we're compiling with debugging to add all namespaces
12143         to the symbol file.
12144
12145         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12146         pass it to the Namespace's .ctor.
12147
12148         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12149         and MethodBase arguments; pass the namespace ID to the symwriter;
12150         pass the MethodBase instead of the token to the symwriter.
12151         (SymbolWriter.DefineNamespace): New method to add a namespace to
12152         the symbol file.
12153
12154 2003-02-09  Martin Baulig  <martin@ximian.com>
12155
12156         * symbolwriter.cs: New file.  This is a wrapper around
12157         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12158         methods here in near future.
12159
12160 2003-02-09  Martin Baulig  <martin@ximian.com>
12161
12162         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12163         ILGenerator.MarkSequencePoint() which are actually used by the
12164         symbol writer.
12165
12166 2003-02-09  Martin Baulig  <martin@ximian.com>
12167
12168         * location.cs (SourceFile): New public sealed class.  This
12169         contains the name and an index which is used in the location's token.
12170         (Location): Reserve an appropriate number of bits in the token for
12171         the source file instead of walking over that list, this gives us a
12172         really huge performance improvement when compiling with debugging.
12173
12174         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12175         `SourceFile' argument instead of a string.
12176         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12177         but don't parse/tokenize here, we need to generate the list of all
12178         source files before we do that.
12179         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12180         the files.
12181
12182         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12183         instead of a string.
12184
12185         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12186         of a string.
12187
12188 2003-02-09  Martin Baulig  <martin@ximian.com>
12189
12190         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12191         filename on `#line default'.
12192
12193 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12194
12195         * statement.cs: don't clear the pinned var when the fixed statement
12196         returns from the method (fixes bug#37752).
12197
12198 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12199
12200         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12201         to IsValueType.
12202
12203 2003-02-07  Martin Baulig  <martin@ximian.com>
12204
12205         * driver.cs: Removed the `--debug-args' command line argument.
12206
12207         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12208         automatically by the AsssemblyBuilder.
12209         (CodeGen.InitializeSymbolWriter): We don't need to call any
12210         initialization function on the symbol writer anymore.  This method
12211         doesn't take any arguments.
12212
12213 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12214
12215         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12216         from referenced assemblies as well.
12217
12218 2003-02-02  Martin Baulig  <martin@ximian.com>
12219
12220         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12221
12222 2003-02-02  Martin Baulig  <martin@ximian.com>
12223
12224         * class.cs (Constructor.Emit): Open the symbol writer before
12225         emitting the constructor initializer.
12226         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12227         single-stepping through constructor initializers.
12228
12229 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * class.cs: Handle error 549: do not allow virtual methods in
12232         sealed classes. 
12233
12234 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12235
12236         * decl.cs: Check access levels when resolving types
12237
12238 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12239
12240         * statement.cs: Add parameters and locals set in catch blocks that might 
12241         return to set vector
12242
12243 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12244
12245         * class.cs (Operator): Set the SpecialName flags for operators.
12246
12247         * expression.cs (Invocation.DoResolve): Only block calls to
12248         accessors and operators on SpecialName methods.
12249
12250         (Cast.TryReduce): Handle conversions from char constants.
12251
12252
12253 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12254
12255         * statement.cs: small memory and time optimization in FlowBranching.
12256
12257 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12258
12259         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12260         problem that the last fix but in the other sid (Set).
12261
12262         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12263         access when there is no indexer in the hierarchy.
12264
12265 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12266
12267         * class.cs: Combine some if statements.
12268
12269 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12270
12271         * driver.cs: fixed bug #37187.
12272
12273 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12274
12275         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12276         any indexer, it's needed to build a list with all the indexers in the
12277         hierarchy (AllGetters), else we have problems. Fixes #35653.
12278
12279 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12280
12281         * class.cs (MethodData.Define): It is wrong for an interface
12282         implementation to be static in both cases: explicit and implicit.
12283         We were only handling this in one case.
12284
12285         Improve the if situation there to not have negations.
12286
12287         * class.cs (Field.Define): Turns out that we do not need to check
12288         the unsafe bit on field definition, only on usage.  Remove the test.
12289
12290 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12291
12292         * driver.cs: use assembly.Location instead of Codebase (the latest
12293         patch made mcs fail when using MS assemblies).
12294
12295 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12296
12297         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12298         get the path to *corlib.dll.
12299
12300 2003-01-21  Nick Drochak <ndrochak@gol.com>
12301
12302         * cs-tokenizer.cs:
12303         * pending.cs:
12304         * typemanager.cs: Remove compiler warnings
12305
12306 2003-01-20  Duncan Mak  <duncan@ximian.com>
12307
12308         * AssemblyInfo.cs: Bump the version number to 0.19.
12309
12310 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12311
12312         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12313
12314 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12315
12316         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12317
12318 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12319
12320         * cs-parser.jay: Small fix: we were not comparing the constructor
12321         name correctly.   Thanks to Zoltan for the initial pointer.
12322
12323 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12324
12325         * cs-tokenizer.cs: Set file name when specified with #line
12326
12327 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12328
12329         * cs-parser.jay: Only perform the constructor checks here if we
12330         are named like the class;  This will help provider a better
12331         error.  The constructor path is taken when a type definition is
12332         not found, but most likely the user forgot to add the type, so
12333         report that rather than the constructor error.
12334
12335 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12336
12337         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12338         allocations.
12339
12340 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12341
12342         * cs-parser.jay: Add cleanup call.
12343
12344 2003-01-13  Duncan Mak  <duncan@ximian.com>
12345
12346         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12347         consistent with other methods.
12348
12349 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12350
12351         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12352
12353 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12354
12355         * attribute.cs: only set GuidAttr to true when we have a
12356         GuidAttribute.
12357
12358 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12359
12360         * ecore.cs:
12361         * expression.cs:
12362         * typemanager.cs: fixes to allow mcs compile corlib with the new
12363         Type.IsSubclassOf fix.
12364
12365 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12366
12367         * expression.cs (LocalVariableReference.DoResolve): Classify a
12368         constant as a value, not as a variable.   Also, set the type for
12369         the variable.
12370
12371         * cs-parser.jay (fixed_statement): take a type instead of a
12372         pointer_type, so we can produce a better error message later.
12373
12374         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12375         as an error.  
12376
12377         (For.DoEmit): Make inifinite loops have a
12378         non-conditional branch back.
12379
12380         (Fixed.DoEmit): First populate the pinned variables, then emit the
12381         statement, then clear the variables.  Before I was emitting the
12382         code once for each fixed piece.
12383
12384
12385 2003-01-08  Martin Baulig  <martin@ximian.com>
12386
12387         * statement.cs (FlowBranching.MergeChild): A break in a
12388         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12389
12390 2003-01-08  Martin Baulig  <martin@ximian.com>
12391
12392         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12393         lives in the same number space than `param_map'.  Fixes #36154.
12394
12395 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12396
12397         * cs-parser.jay (constructor_declaration): Set the
12398         Constructor.ModFlags before probing for it.  This makes the
12399         compiler report 514, 515 and 132 (the code was there, but got
12400         broken). 
12401
12402         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12403         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12404         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12405
12406 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12407
12408         * enum.cs: create the enum static fields using the enum type.
12409
12410 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12411
12412         * class.cs: don't try to create the ParamBuilder for the return
12413         type if it's not needed (and handle it breaking for the ms runtime
12414         anyway).
12415
12416 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12417
12418         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12419
12420 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12421
12422         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12423         the command.   This showed up while compiling the JANET source
12424         code, which used \r as its only newline separator.
12425
12426 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12427
12428         * class.cs (Method.Define): If we are an operator (because it
12429         reuses our code), then set the SpecialName and HideBySig.  #36128
12430
12431 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12432
12433         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12434         exception, report error 120 `object reference required'.
12435
12436         * driver.cs: Add --pause option, used during to measure the size
12437         of the process as it goes with --timestamp.
12438
12439         * expression.cs (Invocation.DoResolve): Do not allow methods with
12440         SpecialName to be invoked.
12441
12442 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12443
12444         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12445         number before adding it.
12446
12447 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12448
12449         * ecore.cs (StandardImplicitConversion): When in an unsafe
12450         context, we allow conversion between void * to any other pointer
12451         type. This fixes bug #35973.
12452
12453 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12454
12455         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12456         is not thrown when extensionless outputs are used 
12457
12458 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12459
12460         * rootcontext.cs: fixed compilation of corlib.
12461
12462 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12463
12464         * attribute.cs (Attributes.Contains): Add new method.
12465
12466         * class.cs (MethodCore.LabelParameters): if the parameter is an
12467         `out' parameter, check that no attribute `[In]' has been passed.
12468
12469         * enum.cs: Handle the `value__' name in an enumeration.
12470
12471 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12472
12473         * decl.cs: Added special case to allow overrides on "protected
12474         internal" methods
12475
12476 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12477
12478         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12479         since it makes much more sense.
12480
12481         (Attributes.ctor): Don't require a Location parameter.
12482
12483         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12484
12485         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12486         since we already have that information per attribute.
12487
12488         * everywhere : make appropriate changes.
12489
12490         * class.cs (LabelParameters): Write the code which actually
12491         applies attributes to the return type. We can't do this on the MS
12492         .NET runtime so we flag a warning in the case an exception is
12493         thrown.
12494
12495 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12496
12497         * const.cs: Handle implicit null conversions here too.
12498
12499 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12500
12501         * class.cs (MethodCore.LabelParameters): Remove the extra
12502         Type [] parameter since it is completely unnecessary. Instead
12503         pass in the method's attributes so that we can extract
12504         the "return" attribute.
12505
12506 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12507
12508         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12509         of ignoring it and letting the compile continue.
12510
12511         * typemanager.cs (ChangeType): use an extra argument to return an
12512         error condition instead of throwing an exception.
12513
12514 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12515
12516         * expression.cs (Unary.TryReduce): mimic the code for the regular
12517         code path.  Perform an implicit cast in the cases where we can
12518         implicitly convert to one of the integral types, and then reduce
12519         based on that constant.   This fixes bug #35483.
12520
12521 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12522
12523         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12524
12525 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12526
12527         * namespace.cs: fixed bug #35489.
12528
12529 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12530
12531         * class.cs: Remove some dead code.
12532
12533         * cs-parser.jay: Estimate the number of methods needed
12534         (RootContext.MethodCount);
12535
12536         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12537         numbers instead of StringBuilders.
12538
12539         * support.cs (PtrHashtable): Add constructor with initial size;
12540         We can now reduce reallocations of the method table.
12541
12542 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12543
12544         * attribute.cs (ApplyAttributes): Keep track of the emitted
12545         attributes on a per-target basis. This fixes bug #35413.
12546
12547 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12548
12549         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12550         default to the Windows 1252 encoding.
12551
12552         (UnixParseOption): Support version, thanks to Alp for the missing
12553         pointer. 
12554
12555         * AssemblyInfo.cs: Add nice assembly information.
12556
12557         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12558         (bug 35169).
12559
12560         * cs-parser.jay: Allow a trailing comma before the close bracked
12561         in the attribute_section production.
12562
12563         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12564         address of the instance was being taken, I will take this out,
12565         because we take the address of the object immediately here.
12566
12567 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12568
12569         * typemanager.cs (AreMultipleAllowed): Take care of the most
12570         obvious case where attribute type is not in the current assembly -
12571         stupid me ;-)
12572
12573 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12574
12575         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12576         definitions, instead of doing that afterwards.  
12577
12578         Also we use a nice little hack, depending on the constructor, we
12579         know if we are a "composed" name or a simple name.  Hence, we
12580         avoid the IndexOf test, and we avoid 
12581
12582         * codegen.cs: Add code to assist in a bug reporter to track down
12583         the source of a compiler crash. 
12584
12585 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12586
12587         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12588         types have been emitted for a given element and flag an error
12589         if something which does not have AllowMultiple set is used more
12590         than once.
12591
12592         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12593         attribute types and their corresponding AllowMultiple properties
12594
12595         (AreMultipleAllowed): Check the property for a given type.
12596
12597         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12598         property in the case we have a TypeContainer.
12599
12600         (Attributes.AddAttribute): Detect duplicates and just skip on
12601         adding them. This trivial fix catches a pretty gross error in our
12602         attribute emission - global attributes were being emitted twice!
12603
12604         Bugzilla bug #33187 is now fixed.
12605
12606 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12607
12608         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12609         instead of pp_and).
12610
12611         * expression.cs (Binary.ResolveOperator): I can only use the
12612         Concat (string, string, string) and Concat (string, string,
12613         string, string) if the child is actually a concatenation of
12614         strings. 
12615
12616 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12617
12618         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12619         context where we need a 2-character lookahead.
12620
12621         * pending.cs (PendingImplementation): Rework so we can keep track
12622         of interface types all the time, and flag those which were
12623         implemented by parents as optional.
12624
12625 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12626
12627         * expression.cs (Binary.ResolveOperator): Use
12628         String.Concat(string,string,string) or
12629         String.Concat(string,string,string,string) when possible. 
12630
12631         * typemanager: More helper methods.
12632
12633
12634 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12635
12636         * pending.cs: remove the bogus return from GetMissingInterfaces()
12637         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12638
12639 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12640
12641         * namespace.cs: avoid duplicated 'using xxx' being added to
12642         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12643         when we get more than one 'using' statement for the same namespace.
12644         Report a CS0105 warning for it.
12645
12646 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12647
12648         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12649         of calling getChar/putback, uses internal knowledge of it.    
12650
12651         (xtoken): Reorder tokenizer so most common patterns are checked
12652         first.  This reduces the compilation time in another 5% (from 8.11s
12653         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12654
12655         The parsing time is 22% of the compilation in mcs, and from that
12656         64% is spent on the tokenization process.  
12657
12658         I tried using a binary search for keywords, but this is slower
12659         than the hashtable.  Another option would be to do a couple of
12660         things:
12661
12662                 * Not use a StringBuilder, instead use an array of chars,
12663                   with a set value.  Notice that this way we could catch
12664                   the 645 error without having to do it *afterwards*.
12665
12666                 * We could write a hand-parser to avoid the hashtable
12667                   compares altogether.
12668
12669         The identifier consumption process takes 37% of the tokenization
12670         time.  Another 15% is spent on is_number.  56% of the time spent
12671         on is_number is spent on Int64.Parse:
12672
12673                 * We could probably choose based on the string length to
12674                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12675                   computations. 
12676
12677         Another 3% is spend on wrapping `xtoken' in the `token' function.
12678
12679         Handle 0xa0 as whitespace (#34752)
12680
12681 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12682
12683         * typemanager.cs (IsCLRType): New routine to tell whether a type
12684         is one of the builtin types.  
12685
12686         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12687         typecode in more places instead of doing pointer comparissions.
12688         We could leverage some knowledge about the way the typecodes are
12689         laid out.
12690
12691         New code to cache namespaces in assemblies, it is currently not
12692         invoked, to be used soon.
12693
12694         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12695
12696         * expression.cs (Binary.ResolveOperator): specially handle
12697         strings, and do not perform user-defined operator overloading for
12698         built-in types.
12699
12700 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12701
12702         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12703         internalcall as it is a pretty simple operation;  Avoid whenever
12704         possible to call Char.IsLetter.
12705
12706         (consume_identifier): Cut by half the number of
12707         hashtable calls by merging the is_keyword and GetKeyword behavior.
12708
12709         Do not short-circuit, because if we do, we
12710         report errors (ie, #if false && true would produce an invalid
12711         directive error);
12712
12713
12714 2002-11-24  Martin Baulig  <martin@ximian.com>
12715
12716         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12717         check constant ranges and report a CS0221.  Fixes #33186.
12718
12719 2002-11-24  Martin Baulig  <martin@ximian.com>
12720
12721         * cs-parser.jay: Make this work for uninitialized variable
12722         declarations in the `for' initializer.  Fixes #32416.
12723
12724 2002-11-24  Martin Baulig  <martin@ximian.com>
12725
12726         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12727         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12728
12729 2002-11-24  Martin Baulig  <martin@ximian.com>
12730
12731         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12732         argument; if true, we also check for user-defined conversions.
12733         This is only needed if both arguments are of a user-defined type.
12734         Fixes #30443, added test-175.cs.
12735         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12736
12737         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12738
12739 2002-11-24  Martin Baulig  <martin@ximian.com>
12740
12741         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12742         function to get the store opcode.
12743         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12744         only emit the Ldelema if the store opcode is Stobj.  You must run
12745         both test-34 and test-167 to test this.  Fixes #34529.
12746
12747 2002-11-23  Martin Baulig  <martin@ximian.com>
12748
12749         * ecore.cs (Expression.MemberLookup): Added additional
12750         `qualifier_type' argument which is used when we're being called
12751         from MemberAccess.DoResolve() and null if we're called from a
12752         SimpleName lookup.
12753         (Expression.MemberLookupFailed): New method to report errors; this
12754         does the CS1540 check and reports the correct error message.
12755
12756         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12757         argument for the CS1540 check and redone the way how we're dealing
12758         with private members.  See the comment in the source code for details.
12759         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12760         `closure_start_type' to `closure_qualifier_type' and check whether
12761         it's not null.  It was not this filter being broken, it was just
12762         being called with the wrong arguments.
12763
12764         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12765         and pass it the correct `qualifier_type'; this also does the error
12766         handling for us.
12767
12768 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12769
12770         * expression.cs (Invocation.EmitParams): If the we are dealing
12771         with a non-built-in value type, load its address as well.
12772
12773         (ArrayCreation): Use a a pretty constant instead
12774         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12775         static initializers.  
12776
12777         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12778         because they are not really value types, just glorified integers. 
12779
12780         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12781
12782         * ecore.cs: Remove redundant code for enumerations, make them use
12783         the same code path as everything else, fixes the casting issue
12784         with enumerations in Windows.Forms.
12785
12786         * attribute.cs: Do only cast to string if it is a string, the
12787         validation happens later.
12788
12789         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12790         people upgrade their corlibs.
12791
12792         * ecore.cs: Oops, enumerations were not following the entire code path
12793
12794 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12795
12796         * typemanager.cs (FilterWithClosure): Commented out the test for
12797         1540 in typemanager.cs, as it has problems when accessing
12798         protected methods from a parent class (see test-174.cs). 
12799
12800         * attribute.cs (Attribute.ValidateGuid): new method.
12801         (Attribute.Resolve): Use above.
12802
12803 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12804
12805         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12806
12807         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12808         handling for enumerations, as we only needed the TypeContainer
12809         functionality to begin with (this is required for the fix below to
12810         work for enums that reference constants in a container class for
12811         example). 
12812
12813         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12814
12815         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12816         a valid TypeBuilder to perform lookups on.o
12817
12818         * class.cs (InheritableMemberSignatureCompare): Use true in the
12819         call to GetGetMethod and GetSetMethod, because we are comparing
12820         the signature, and we need to get the methods *even* if they are
12821         private. 
12822
12823         (PropertyBase.CheckBase): ditto.
12824
12825         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12826         GotoCase.Resolve): Use Peel on EmpytCasts.
12827
12828         * ecore.cs (EmptyCast): drop child, add Peel method.
12829
12830 2002-11-17  Martin Baulig  <martin@ximian.com>
12831
12832         * ecore.cs (EmptyCast.Child): New public property.
12833
12834         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12835         label resolved to an EmptyCast.  Fixes #34162.
12836         (GotoCase.Resolve): Likewise.
12837         (Block.EmitMeta): Likewise.
12838
12839 2002-11-17  Martin Baulig  <martin@ximian.com>
12840
12841         * expression.cs (Invocation.BetterConversion): Prefer int over
12842         uint; short over ushort; long over ulong for integer literals.
12843         Use ImplicitConversionExists instead of StandardConversionExists
12844         since we also need to check for user-defined implicit conversions.
12845         Fixes #34165.  Added test-173.cs.
12846
12847 2002-11-16  Martin Baulig  <martin@ximian.com>
12848
12849         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12850         with the `true' and `false' literals.  Fixes #33151.
12851
12852 2002-11-16  Martin Baulig  <martin@ximian.com>
12853
12854         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12855         October 22nd; don't do the cs1540 check for static members.
12856
12857         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12858         now using our own filter here and doing the cs1540 check again.
12859
12860 2002-11-16  Martin Baulig  <martin@ximian.com>
12861
12862         * support.cs (InternalParameters): Don't crash if we don't have
12863         any fixed parameters.  Fixes #33532.
12864
12865 2002-11-16  Martin Baulig  <martin@ximian.com>
12866
12867         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12868         when looking up static methods to make this work on Windows.
12869         Fixes #33773.
12870
12871 2002-11-16  Martin Baulig  <martin@ximian.com>
12872
12873         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12874         a setter rather than using PropertyInfo.CanWrite.
12875
12876 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12877
12878         * class.cs: Allow acces to block member by subclasses. Fixes build
12879         breaker.
12880
12881 2002-11-14  Martin Baulig  <martin@ximian.com>
12882
12883         * class.cs (Constructor.Emit): Added the extern/block check.
12884         Fixes bug #33678.
12885
12886 2002-11-14  Martin Baulig  <martin@ximian.com>
12887
12888         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12889         iteration while looking for indexers, this is needed because the
12890         indexer may have a different name in our base classes.  Fixed the
12891         error reporting (no indexers at all, not get accessor, no
12892         overloaded match).  Fixes bug #33089.
12893         (IndexerAccess.DoResolveLValue): Likewise.
12894
12895 2002-11-14  Martin Baulig  <martin@ximian.com>
12896
12897         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12898         indexers.  Fixes the first part of bug #33089.
12899         (MethodSignature.InheritableMemberSignatureCompare): Added support
12900         for properties.
12901
12902 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12903
12904         * attribute.cs (Attribute.Resolve): Catch the
12905         NullReferenceException and report it since it isn't supposed to
12906         happen. 
12907
12908 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12909
12910         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12911         LogicalOr and LogicalAnd that can benefit from recursively
12912         handling EmitBranchable.  The code now should be nice for Paolo.
12913
12914 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12915
12916         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12917         the Type lookups, as we perform quite a number of lookups on
12918         non-Types.  This can be removed once we can deterministically tell
12919         whether we have a type or a namespace in advance.
12920
12921         But this might require special hacks from our corlib.
12922
12923         * TODO: updated.
12924
12925         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12926         and double which avoids a conversion from an integer to a double.
12927
12928         * expression.cs: tiny optimization, avoid calling IsConstant,
12929         because it effectively performs the lookup twice.
12930
12931 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12932
12933         But a bogus return here to keep the semantics of the old code
12934         until the Mono runtime is fixed.
12935
12936         * pending.cs (GetMissingInterfaces): New method used to remove all
12937         the interfaces that are already implemented by our parent
12938         classes from the list of pending methods. 
12939
12940         * interface.cs: Add checks for calls after ResolveTypeExpr.
12941
12942 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12943
12944         * class.cs (Class.Emit): Report warning 67: event not used if the
12945         warning level is beyond 3.
12946
12947         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12948         being a NullLiteral.
12949
12950         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12951         specifiers. 
12952
12953         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12954         path that might fail if a type can not be resolved.
12955
12956         * expression.cs (Binary.Emit): Emit unsigned versions of the
12957         operators. 
12958
12959         * driver.cs: use error 5.
12960
12961 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12962
12963         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12964
12965 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12966
12967         * cs-parser.jay (switch_section): A beautiful patch from Martin
12968         Baulig that fixed 33094.
12969
12970 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12971
12972         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12973         Check whether the base is abstract and report an error if so.
12974
12975         * expression.cs (IndexerAccess.DoResolveLValue,
12976         IndexerAccess.DoResolve): ditto. 
12977
12978         (Invocation.DoResolve): ditto.
12979
12980         (Invocation.FullMethodDesc): Improve the report string.
12981
12982         * statement.cs (Block): Eliminate IsVariableDefined as it is
12983         basically just a wrapper for GetVariableInfo.
12984
12985         * ecore.cs (SimpleName): Use new 
12986
12987         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12988         type, as we return the actual parameter ref/unref state on a
12989         different call.
12990
12991 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12992
12993         * support.cs: Return proper flags REF/OUT fixing the previous
12994         commit.  
12995
12996         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12997         not used to mean `ref' but `ref or out' in ParameterReference
12998
12999         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13000         full type signature instead of calling TypeManger.CSharpName
13001         ourselves. 
13002
13003         * support.cs (InternalParameters.ParameterDesc): Do not compare
13004         directly to the modflags, because REF/OUT will actually be bitsets
13005         if set. 
13006
13007         * delegate.cs (VerifyMethod): Check also the modifiers.
13008
13009         * cs-tokenizer.cs: Fix bug where floating point values with an
13010         exponent where a sign was missing was ignored.
13011
13012         * driver.cs: Allow multiple assemblies to be specified in a single
13013         /r: argument
13014
13015 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13018         because identifiers after a parenthesis would end up in this kind
13019         of production, and we needed to desamiguate it for having casts
13020         like:
13021
13022                 (UserDefinedType *) xxx
13023
13024 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13025
13026         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13027         we should set on the Bindingflags.NonPublic, but not turn on
13028         private_ok.  private_ok controls whether a Private member is
13029         returned (this is chekced on the filter routine), while the
13030         BindingFlags.NonPublic just controls whether private/protected
13031         will be allowed.   This fixes the problem part of the problem of
13032         private properties being allowed to be used in derived classes.
13033
13034         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13035         so we can call the children DoResolveLValue method (this will
13036         properly signal errors on lvalue assignments to base properties)
13037
13038         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13039         getter are null, and we have a property info, we know that this
13040         happened because the lookup failed, so we report an error 122 for
13041         protection level violation.
13042
13043         We also silently return if setter and getter are null in the
13044         resolve functions, this condition only happens if we have flagged
13045         the error before.  This is the other half of the problem. 
13046
13047         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13048         not have accessibility information, that is why we were returning
13049         true in the filter function in typemanager.cs.
13050
13051         To properly report 122 (property is inaccessible because of its
13052         protection level) correctly, we report this error in ResolveAccess
13053         by failing if both the setter and the getter are lacking (ie, the
13054         lookup failed). 
13055
13056         DoResolve and DoLResolve have been modified to check for both
13057         setter/getter being null and returning silently, the reason being
13058         that I did not want to put the knowledge about this error in upper
13059         layers, like:
13060
13061         int old = Report.Errors;
13062         x = new PropertyExpr (...);
13063         if (old != Report.Errors)
13064                 return null;
13065         else
13066                 return x;
13067
13068         So the property expr is returned, but it is invalid, so the error
13069         will be flagged during the resolve process. 
13070
13071         * class.cs: Remove InheritablePropertySignatureCompare from the
13072         class, as we no longer depend on the property signature to compute
13073         whether it is possible to implement a method or not.
13074
13075         The reason is that calling PropertyInfo.GetGetMethod will return
13076         null (in .NET, in Mono it works, and we should change this), in
13077         cases where the Get Method does not exist in that particular
13078         class.
13079
13080         So this code:
13081
13082         class X { public virtual int A { get { return 1; } } }
13083         class Y : X { }
13084         class Z : Y { public override int A { get { return 2; } } }
13085
13086         Would fail in Z because the parent (Y) would not have the property
13087         defined.  So we avoid this completely now (because the alternative
13088         fix was ugly and slow), and we now depend exclusively on the
13089         method names.
13090
13091         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13092         reference method, instead of using the property.
13093
13094         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13095         routines are gone now.
13096
13097         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13098         names, they were incorrectly named.
13099
13100         * cs-tokenizer.cs: Return are more gentle token on failure. 
13101
13102         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13103         had an out-of-sync index variable, which caused it to remove from
13104         the list of pending methods the wrong method sometimes.
13105
13106 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13107
13108         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13109         CanWrite, because those refer to this particular instance of the
13110         property, and do not take into account the fact that we can
13111         override single members of a property.
13112
13113         Constructor requires an EmitContext.  The resolution process does
13114         not happen here, but we need to compute the accessors before,
13115         because the resolution does not always happen for properties.
13116
13117         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13118         subclass, before we did not update this flag, but we did update
13119         bindingflags. 
13120
13121         (GetAccessors): Drop this routine, as it did not work in the
13122         presence of partially overwritten set/get methods. 
13123
13124         Notice that this broke the cs1540 detection, but that will require
13125         more thinking. 
13126
13127 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13128
13129         * class.cs:
13130         * codegen.cs:
13131         * driver.cs: issue a warning instead of an error if we don't support
13132         debugging for the platform. Also ignore a couple of errors that may
13133         arise when trying to write the symbols. Undo my previous patch.
13134
13135 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13136
13137         * driver.cs: ignore /debug switch except for Unix platforms.
13138
13139 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13140
13141         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13142
13143 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13144
13145         * driver.cs: Do not make mcs-debug conditional, so we do not break
13146         builds that use it.
13147
13148         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13149         review this patch.  But basically after all the children variables
13150         have been merged, the value of "Breaks" was not being set to
13151         new_breaks for Switch blocks.  I think that it should be set after
13152         it has executed.  Currently I set this to the value of new_breaks,
13153         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13154         conservative, but I do not understand this code very well.
13155
13156         I did not break anything in the build, so that is good ;-)
13157
13158         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13159
13160 2002-10-20  Mark Crichton  <crichton@gimp.org>
13161
13162         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13163
13164 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13165
13166         * cfold.cs: Fixed compile blocker.
13167
13168 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13169
13170         * driver.cs: I was chekcing the key, not the file.
13171
13172 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13173
13174         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13175         message that we were generating - we just need to silently return
13176         a null.
13177
13178 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13179
13180         * class.cs (Event.Define): Change my previous commit, as this
13181         breaks the debugger.  This is a temporary hack, as it seems like
13182         the compiler is generating events incorrectly to begin with.
13183
13184         * expression.cs (Binary.ResolveOperator): Added support for 
13185         "U operator - (E x, E y)"
13186
13187         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13188         y)".
13189
13190         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13191         init-only variables, but this path did not take into account that
13192         there might be also instance readonly variables.  Correct this
13193         problem. 
13194
13195         This fixes bug 32253
13196
13197         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13198         delegates as well.
13199
13200         * driver.cs: Change the extension for modules to `netmodule'
13201
13202         * cs-parser.jay: Improved slightly the location tracking for
13203         the debugger symbols.
13204
13205         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13206         modifiers that were specified instead of the hardcoded value
13207         (FamAndAssem).  This was basically ignoring the static modifier,
13208         and others.  Fixes 32429.
13209
13210         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13211         fixed a bug in the process (32476)
13212
13213         * expression.cs (ArrayAccess.EmitAssign): Patch from
13214         hwang_rob@yahoo.ca that fixes bug 31834.3
13215
13216 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * driver.cs: Make the module extension .netmodule.
13219
13220 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13221
13222         * driver.cs: Report an error if the resource file is not found
13223         instead of crashing.
13224
13225         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13226         false, like Emit does.
13227
13228 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13229
13230         * typemanager.cs: Remove unused private member.  Also reported mcs
13231         bug to report this as a warning like csc.
13232
13233 2002-10-15  Martin Baulig  <martin@gnome.org>
13234
13235         * statement.cs (Statement.Emit): Made this a virtual method; emits
13236         the line number info and calls DoEmit().
13237         (Statement.DoEmit): New protected abstract method, formerly knows
13238         as Statement.Emit().
13239
13240         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13241
13242 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13243
13244         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13245         have fixed a remaining problem: not every AddXXXX was adding a
13246         fully qualified name.  
13247
13248         Now everyone registers a fully qualified name in the DeclSpace as
13249         being defined instead of the partial name.  
13250
13251         Downsides: we are slower than we need to be due to the excess
13252         copies and the names being registered this way.  
13253
13254         The reason for this is that we currently depend (on the corlib
13255         bootstrap for instance) that types are fully qualified, because
13256         we dump all the types in the namespace, and we should really have
13257         types inserted into the proper namespace, so we can only store the
13258         basenames in the defined_names array.
13259
13260 2002-10-10  Martin Baulig  <martin@gnome.org>
13261
13262         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13263         from bug #31834, see the bug report for a testcase which is
13264         miscompiled.
13265
13266 2002-10-10  Martin Baulig  <martin@gnome.org>
13267
13268         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13269         flow analysis code for this.
13270
13271         * statement.cs (Do, While, For): Tell the flow analysis code about
13272         infinite loops.
13273         (FlowBranching.UsageVector): Added support for infinite loops.
13274         (Block.Resolve): Moved the dead code elimination here and use flow
13275         analysis to do it.
13276
13277 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13278
13279         * class.cs (Field.Define): Catch cycles on struct type
13280         definitions. 
13281
13282         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13283         fields if the fields are static.  We only need to check instance
13284         fields. 
13285
13286         * expression.cs (As.DoResolve): Test for reference type.
13287
13288         * statement.cs (Using.ResolveExpression): Use
13289         ConvertImplicitRequired, not ConvertImplicit which reports an
13290         error on failture
13291         (Using.ResolveLocalVariableDecls): ditto.
13292
13293         * expression.cs (Binary.ResolveOperator): Report errors in a few
13294         places where we had to.
13295
13296         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13297
13298 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13299
13300         * expression.cs: Use StoreFromPtr instead of extracting the type
13301         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13302
13303         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13304         an enumeration value to a System.Enum, but System.Enum is not a
13305         value type, but an class type, so we need to box.
13306
13307         (Expression.ConvertExplicit): One codepath could return
13308         errors but not flag them.  Fix this.  Fixes #31853
13309
13310         * parameter.cs (Resolve): Do not allow void as a parameter type.
13311
13312 2002-10-06  Martin Baulig  <martin@gnome.org>
13313
13314         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13315         if it's a class type and not a struct.  Fixes #31815.
13316
13317 2002-10-06  Martin Baulig  <martin@gnome.org>
13318
13319         * statement.cs: Reworked the flow analysis code a bit to make it
13320         usable for dead code elimination.
13321
13322 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13323
13324         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13325
13326 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13329         to fix the test 165, will investigate deeper.
13330
13331 2002-10-04  Martin Baulig  <martin@gnome.org>
13332
13333         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13334         finally blocks actually work.
13335         (Try.Resolve): We don't need to create a sibling for `finally' if
13336         there is no finally block.
13337
13338 2002-10-04  Martin Baulig  <martin@gnome.org>
13339
13340         * class.cs (Constructor.Define): The default accessibility for a
13341         non-default constructor is private, not public.
13342
13343 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13344
13345         * class.cs (Constructor): Make AllowedModifiers public, add
13346         EXTERN.
13347
13348         * cs-parser.jay: Perform the modifiers test here, as the
13349         constructor for the Constructor class usually receives a zero
13350         because of the way we create it (first we create, later we
13351         customize, and we were never checking the modifiers).
13352
13353         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13354         is a version of LookupTypeReflection that includes the type-name
13355         cache.  This can be used as a fast path for functions that know
13356         the fully qualified name and are only calling into *.GetType() to
13357         obtain a composed type.
13358
13359         This is also used by TypeManager.LookupType during its type
13360         composition.
13361
13362         (LookupType): We now also track the real type name, as sometimes
13363         we can get a quey for the real type name from things like
13364         ComposedCast.  This fixes bug 31422.
13365
13366         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13367         complete type fullname, it does not have to go through the type
13368         resolution system to obtain the composed version of the type (for
13369         obtaining arrays or pointers).
13370
13371         (Conditional.Emit): Use the EmitBoolExpression to
13372         generate nicer code, as requested by Paolo.
13373
13374         (ArrayCreation.CheckIndices): Use the patch from
13375         hwang_rob@yahoo.ca to validate the array initializers. 
13376
13377 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13378
13379         * class.cs (ConstructorInitializer.Emit): simplify code by using
13380         Invocation.EmitCall, and at the same time, fix the bugs in calling
13381         parent constructors that took variable arguments. 
13382
13383         * ecore.cs (Expression.ConvertNumericExplicit,
13384         Expression.ImplicitNumericConversion): Remove the code that
13385         manually wrapped decimal (InternalTypeConstructor call is now gone
13386         as well).
13387
13388         * expression.cs (Cast.TryReduce): Also handle decimal types when
13389         trying to perform a constant fold on the type.
13390
13391         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13392
13393         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13394         that only turned off an error report, and did nothing else. 
13395
13396 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * driver.cs: Handle and ignore /fullpaths
13399
13400 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13401
13402         * expression.cs (Binary.ResolveOperator): Catch the case where
13403         DoNumericPromotions returns true, 
13404
13405         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13406
13407 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13410         report error 70.
13411
13412 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13415         conversion exists, but it is also required that the conversion be
13416         performed.  This manifested in "(Type64Enum) 2".  
13417
13418         * class.cs (TypeManager.AddMethod): The fix is not to change
13419         AddEnum, because that one was using a fully qualified name (every
13420         DeclSpace derivative does), but to change the AddMethod routine
13421         that was using an un-namespaced name.  This now correctly reports
13422         the duplicated name.
13423
13424         Revert patch until I can properly fix it.  The issue
13425         is that we have a shared Type space across all namespaces
13426         currently, which is wrong.
13427
13428         Options include making the Namespace a DeclSpace, and merge
13429         current_namespace/current_container in the parser.
13430
13431 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * cs-parser.jay: Improve error reporting when we get a different
13434         kind of expression in local_variable_type and
13435         local_variable_pointer_type. 
13436
13437         Propagate this to avoid missleading errors being reported.
13438
13439         * ecore.cs (ImplicitReferenceConversion): treat
13440         TypeManager.value_type as a target just like object_type.   As
13441         code like this:
13442
13443         ValueType v = 1;
13444
13445         Is valid, and needs to result in the int 1 being boxed before it
13446         is assigned to the value type v.
13447
13448         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13449         to validate the enumeration name.
13450
13451         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13452         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13453         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13454
13455         * ecore.cs (TryImplicitIntConversion): When doing an
13456         implicit-enumeration-conversion, check if the type is 64-bits and
13457         perform a conversion before passing to EnumConstant.
13458
13459 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13460
13461         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13462         report ambiguous type references.  Unlike the MS version, we
13463         report what the ambiguity is.   Innovation at work ;-)
13464
13465         (DeclSpace.FindType): Require a location argument to
13466         display when we display an ambiguous error.
13467
13468         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13469
13470         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13471
13472         * expression.cs (EmitDynamicInitializers): Apply patch from
13473         hwang_rob@yahoo.ca that fixes the order in which we emit our
13474         initializers. 
13475
13476 2002-09-21  Martin Baulig  <martin@gnome.org>
13477
13478         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13479         delegate takes no arguments.
13480
13481 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13482
13483         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13484         from integers.
13485
13486         * expression.cs: Extract the underlying type.
13487
13488         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13489
13490         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13491
13492 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13493
13494         * class.cs (TypeContainer.DefineType): We can not use the nice
13495         PackingSize with the size set to 1 DefineType method, because it
13496         will not allow us to define the interfaces that the struct
13497         implements.
13498
13499         This completes the fixing of bug 27287
13500
13501         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13502         means also structs.  This fixes part of the problem. 
13503         (Expresion.ImplicitReferenceConversionExists): ditto.
13504
13505         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13506         error if there were no errors reported during the type lookup
13507         process, to avoid duplicates or redundant errors.  Without this
13508         you would get an ambiguous errors plus a type not found.  We have
13509         beaten the user enough with the first error.  
13510
13511         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13512         reference. 
13513
13514         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13515         during the resolution process, stop the lookup, this avoids
13516         repeated error reports (same error twice).
13517
13518         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13519
13520         * typemanager.cs (LookupType): Redo the type lookup code to match
13521         the needs of System.Reflection.  
13522
13523         The issue is that System.Reflection requires references to nested
13524         types to begin with a "+" sign instead of a dot.  So toplevel
13525         types look like: "NameSpace.TopLevelClass", and nested ones look
13526         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13527         levels. 
13528
13529 2002-09-19  Martin Baulig  <martin@gnome.org>
13530
13531         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13532         says that a method always returns or always throws an exception,
13533         don't report the CS0161.
13534
13535         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13536         set `Returns = new_returns'.
13537
13538 2002-09-19  Martin Baulig  <martin@gnome.org>
13539
13540         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13541         to an enum constant, check for a CS0176.
13542
13543 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13544
13545         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13546         for operators that must be in pairs and report errors.
13547
13548         * ecore.cs (SimpleName.DoResolveType): During the initial type
13549         resolution process, when we define types recursively, we must
13550         check first for types in our current scope before we perform
13551         lookups in the enclosing scopes.
13552
13553         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13554
13555         (Invocation.VerifyArgumentsCompat): Call
13556         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13557         I thought we were supposed to always call this, but there are a
13558         few places in the code where we dont do it.
13559
13560 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13561
13562         * driver.cs: Add support in -linkres and -resource to specify the
13563         name of the identifier.
13564
13565 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13566
13567         * ecore.cs (StandardConversionExists): Sync with the conversion
13568         code: allow anything-* to void* conversions.
13569
13570         (FindMostSpecificSource): Use an Expression argument
13571         instead of a Type, because we might be handed over a Literal which
13572         gets a few more implicit conversions that plain types do not.  So
13573         this information was being lost.
13574
13575         Also, we drop the temporary type-holder expression when not
13576         required.
13577
13578 2002-09-17  Martin Baulig  <martin@gnome.org>
13579
13580         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13581         this is an explicit interface implementation.
13582
13583 2002-09-17  Martin Baulig  <martin@gnome.org>
13584
13585         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13586         different `IndexerName' attributes.
13587
13588         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13589         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13590         virtual CommonResolve().
13591
13592 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13593
13594         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13595         and convert that to the UnderlyingType.
13596
13597         * statement.cs (Foreach.Resolve): Indexers are just like variables
13598         or PropertyAccesses.
13599
13600         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13601         inside quoted strings, we were not doing this before.
13602
13603 2002-09-16  Martin Baulig  <martin@gnome.org>
13604
13605         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13606         resolve it.  This is needed for the definite assignment check of the
13607         instance expression, fixes bug #29846.
13608         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13609
13610 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13611
13612         * parameter.cs: Fix compile error.  Cannot reference static member
13613         from an instance object.  Is this an mcs bug?
13614
13615 2002-09-14  Martin Baulig  <martin@gnome.org>
13616
13617         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13618         multiple times.  Fixes bug #30295, added test-166.cs.
13619
13620 2002-09-14  Martin Baulig  <martin@gnome.org>
13621
13622         * statement.cs (Block.Emit): Don't emit unreachable code.
13623         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13624         `break' statements.
13625         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13626
13627 2002-09-14  Martin Baulig  <martin@gnome.org>
13628
13629         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13630         is set.
13631
13632 2002-09-14  Martin Baulig  <martin@gnome.org>
13633
13634         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13635         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13636         be false on the ms runtime.
13637
13638 2002-09-13  Martin Baulig  <martin@gnome.org>
13639
13640         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13641         the CS0038 error message.
13642
13643 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13644
13645         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13646         constant inside, return it.
13647
13648 2002-09-12  Martin Baulig  <martin@gnome.org>
13649
13650         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13651         implicit conversion can be done between enum types.
13652
13653         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13654         check whether an implicit conversion to the current enum's UnderlyingType
13655         exists and report an error if not.
13656
13657         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13658         without debugging support.
13659
13660         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13661         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13662
13663 2002-09-12  Martin Baulig  <martin@gnome.org>
13664
13665         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13666
13667         * ecore.cs (IMemberExpr.DeclaringType): New property.
13668         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13669         nonstatic member of an outer type (CS0038).
13670
13671 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13672
13673         * driver.cs: Activate the using-error detector at warning level
13674         4 (at least for MS-compatible APIs).
13675
13676         * namespace.cs (VerifyUsing): Small buglett fix.
13677
13678         * pending.cs (PendingImplementation): pass the container pointer. 
13679
13680         * interface.cs (GetMethods): Allow for recursive definition.  Long
13681         term, I would like to move every type to support recursive
13682         definitions, not the current ordering mechanism that we have right
13683         now.
13684
13685         The situation is this: Attributes are handled before interfaces,
13686         so we can apply attributes to interfaces.  But some attributes
13687         implement interfaces, we will now handle the simple cases
13688         (recursive definitions will just get an error).  
13689
13690         * parameter.cs: Only invalidate types at the end if we fail to
13691         lookup all types.  
13692
13693 2002-09-09  Martin Baulig  <martin@gnome.org>
13694
13695         * ecore.cs (PropertyExpr.Emit): Also check for
13696         TypeManager.system_int_array_get_length so this'll also work when
13697         compiling corlib.  Fixes #30003.
13698
13699 2002-09-09  Martin Baulig  <martin@gnome.org>
13700
13701         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13702         and throw an exception if we can't get the type's size.  Fixed #30040,
13703         added test-165.cs.
13704
13705 2002-09-09  Martin Baulig  <martin@gnome.org>
13706
13707         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13708
13709         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13710         context.  Fixes bug #30027.
13711
13712         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13713         virtual functions.  Fixes bug #30043, added test-164.cs.
13714
13715 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13716
13717         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13718
13719 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13720
13721         * driver.cs: Use an object to get the windows codepage since it's not a
13722         static property.
13723
13724 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13725
13726         * statement.cs (For.Emit): for infinite loops (test == null)
13727         return whether there is a break inside, not always "true".
13728
13729         * namespace.cs (UsingEntry): New struct to hold the name of the
13730         using definition, the location where it is defined, and whether it
13731         has been used in a successful type lookup.
13732
13733         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13734         strings.
13735
13736         * decl.cs: ditto.
13737
13738 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13739
13740         * attribute.cs : Fix incorrect code which relied on catching
13741         a NullReferenceException to detect a null being passed in
13742         where an object was expected.
13743
13744 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13745
13746         * statement.cs (Try): flag the catch variable as assigned
13747
13748         * expression.cs (Cast): Simplified by using ResolveType instead of
13749         manually resolving.
13750
13751         * statement.cs (Catch): Fix bug by using ResolveType.
13752
13753 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13754
13755         * expression.cs (BetterConversion): Special case for when we have
13756         a NullLiteral as the argument and we have to choose between string
13757         and object types - we choose string the way csc does.
13758
13759         * attribute.cs (Attribute.Resolve): Catch the
13760         NullReferenceException and report error #182 since the Mono
13761         runtime no more has the bug and having this exception raised means
13762         we tried to select a constructor which takes an object and is
13763         passed a null.
13764
13765 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13766
13767         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13768         message (1502, 1503) when we can't locate a method after overload
13769         resolution. This is much more informative and closes the bug
13770         Miguel reported.
13771
13772         * interface.cs (PopulateMethod): Return if there are no argument
13773         types. Fixes a NullReferenceException bug.
13774
13775         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13776         expressions too. Previously we were checking only in one place for
13777         positional arguments leaving out named arguments.
13778
13779         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13780         type to the enum type is not allowed. Remove code corresponding to
13781         that.
13782
13783         (ConvertNumericExplicit): Allow explicit conversions from
13784         the underlying type to enum type. This precisely follows the spec
13785         and closes a bug filed by Gonzalo.
13786
13787 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13788
13789         * compiler.csproj:
13790         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13791
13792 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13793
13794         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13795         it was important that we stored the right value after the
13796         reduction in `converted'.
13797
13798 2002-09-04  Martin Baulig  <martin@gnome.org>
13799
13800         * location.cs (Location.SymbolDocument): Use full pathnames for the
13801         source files.
13802
13803 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13804
13805         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13806         of the expression resolve mechanism, because that will catch the
13807         SimpleName error failures.
13808
13809         (Conditional): If we can not resolve the
13810         expression, return, do not crash.
13811
13812 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13813
13814         * cs-tokenizer.cs:
13815         (location): display token name instead of its number.
13816
13817 2002-08-28  Martin Baulig  <martin@gnome.org>
13818
13819         * expression.cs (Binary.ResolveOperator): Don't silently return
13820         but return an error if an operator cannot be applied between two
13821         enum types.
13822
13823 2002-08-28  Martin Baulig  <martin@gnome.org>
13824
13825         * class.cs (Constructor.Define): Set the permission attributes
13826         correctly instead of making all constructors public.
13827
13828 2002-08-28  Martin Baulig  <martin@gnome.org>
13829
13830         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13831         for private members before reporting a CS0103; if we find anything,
13832         it's a CS0122.
13833
13834 2002-08-28  Martin Baulig  <martin@gnome.org>
13835
13836         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13837         to check whether `closure_start_type == closure_invocation_type',
13838         we also need to check whether `m.DeclaringType == closure_invocation_type'
13839         before bypassing the permission checks.  We might be accessing
13840         protected/private members from the base class.
13841         (TypeManager.RealMemberLookup): Only set private_ok if private
13842         members were requested via BindingFlags.NonPublic.
13843
13844         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13845
13846         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13847         MethodGroupExpr.IsExplicitImpl if appropriate.
13848         (Invocation.DoResolve): Don't report the CS0120 for explicit
13849         interface implementations.
13850
13851 2002-08-27  Martin Baulig  <martin@gnome.org>
13852
13853         * expression.cs (Invocation.DoResolve): If this is a static
13854         method and we don't have an InstanceExpression, we must report
13855         a CS0120.
13856
13857 2002-08-25  Martin Baulig  <martin@gnome.org>
13858
13859         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13860         `==' between a valuetype and an object.
13861
13862 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13863
13864         * ecore.cs (TypeExpr): Provide a ToString method.
13865
13866 2002-08-24  Martin Baulig  <martin@gnome.org>
13867
13868         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13869         now called proggie.dbg and it's a binary file.
13870
13871 2002-08-23  Martin Baulig  <martin@gnome.org>
13872
13873         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13874
13875 2002-08-23  Martin Baulig  <martin@gnome.org>
13876
13877         * struct.cs (MyStructInfo.ctor): Make this work with empty
13878         structs; it's not allowed to use foreach() on null.
13879
13880 2002-08-23  Martin Baulig  <martin@gnome.org>
13881
13882         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13883         writer the full pathname of the generated assembly.
13884
13885 2002-08-23  Martin Baulig  <martin@gnome.org>
13886
13887         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13888         A `finally' block never returns or breaks; improved handling of
13889         unreachable code.
13890
13891 2002-08-23  Martin Baulig  <martin@gnome.org>
13892
13893         * statement.cs (Throw.Resolve): Allow `throw null'.
13894
13895 2002-08-23  Martin Baulig  <martin@gnome.org>
13896
13897         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13898         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13899         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13900         MemberLookup would return a wrong event if this is an explicit
13901         interface implementation and the class has an event with the same
13902         name.
13903
13904 2002-08-23  Martin Baulig  <martin@gnome.org>
13905
13906         * statement.cs (Block.AddChildVariableNames): New public method.
13907         (Block.AddChildVariableName): Likewise.
13908         (Block.IsVariableNameUsedInChildBlock): Likewise.
13909         (Block.AddVariable): Check whether a variable name has already
13910         been used in a child block.
13911
13912         * cs-parser.jay (declare_local_variables): Mark all variable names
13913         from the current block as being used in a child block in the
13914         implicit block.
13915
13916 2002-08-23  Martin Baulig  <martin@gnome.org>
13917
13918         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13919         find the symbol writer.
13920
13921         * driver.cs: csc also allows the arguments to /define being
13922         separated by commas, not only by semicolons.
13923
13924 2002-08-23  Martin Baulig  <martin@gnome.org>
13925
13926         * interface.cs (Interface.GetMembers): Added static check for events.
13927
13928 2002-08-15  Martin Baulig  <martin@gnome.org>
13929
13930         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13931         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13932
13933         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13934         why the MethodData.EmitDestructor() change was necessary.
13935
13936 2002-08-20  Martin Baulig  <martin@gnome.org>
13937
13938         * class.cs (TypeContainer.FindMembers): Added static check for events.
13939
13940         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13941
13942         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13943         use Type.GetEvents(), not Type.FindMembers().
13944
13945 2002-08-20  Martin Baulig  <martin@gnome.org>
13946
13947         * decl.cs (MemberCache): Added a special method cache which will
13948         be used for method-only searched.  This ensures that a method
13949         search will return a MethodInfo with the correct ReflectedType for
13950         inherited methods.      
13951
13952 2002-08-20  Martin Baulig  <martin@gnome.org>
13953
13954         * decl.cs (DeclSpace.FindMembers): Made this public.
13955
13956 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13957
13958         * delegate.cs: fixed build on windows.
13959         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13960
13961 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13962
13963         * ecore.cs (StandardConversionExists): Return a false
13964         if we are trying to convert the void type to anything else
13965         since that is not allowed.
13966
13967         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13968         we flag error 70 in the event an event is trying to be accessed
13969         directly from outside the declaring type.
13970
13971 2002-08-20  Martin Baulig  <martin@gnome.org>
13972
13973         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13974         MemberCache from typemanager.cs to decl.cs.
13975
13976 2002-08-19  Martin Baulig  <martin@gnome.org>
13977
13978         * class.cs (TypeContainer): Implement IMemberContainer.
13979         (TypeContainer.DefineMembers): Create the MemberCache.
13980         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13981         return public members if BindingFlags.Public was given, check
13982         whether members are static.
13983
13984 2002-08-16  Martin Baulig  <martin@gnome.org>
13985
13986         * decl.cs (DeclSpace.Define): Splitted this in Define and
13987         DefineMembers.  DefineMembers is called first and initializes the
13988         MemberCache.
13989
13990         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13991         DefineMembers() on all our DeclSpaces.
13992
13993         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13994         but call DefineMembers() on all nested interfaces.  We call their
13995         Define() in our new Define() function.
13996
13997         * interface.cs (Interface): Implement IMemberContainer.
13998         (Interface.Define): Moved all code except the attribute stuf to
13999         DefineMembers().
14000         (Interface.DefineMembers): Initialize the member cache.
14001
14002         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14003         need this anymore since we can use MemberCache.FindMembers directly.
14004
14005 2002-08-19  Martin Baulig  <martin@gnome.org>
14006
14007         * typemanager.cs (MemberCache): When creating the cache for an
14008         interface type, add all inherited members.
14009         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14010         to `out bool used_cache' and documented it.
14011         (TypeManager.MemberLookup): If we already used the cache in the first
14012         iteration, we don't need to do the interfaces check.
14013
14014 2002-08-19  Martin Baulig  <martin@gnome.org>
14015
14016         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14017         here from IMemberFinder and don't implement this interface anymore.
14018         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14019
14020         * typemanager.cs (IMemberFinder): This interface is now only used by
14021         classes which actually support the member cache.
14022         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14023         since we only put DeclSpaces into this Hashtable.
14024         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14025         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14026
14027 2002-08-16  Martin Baulig  <martin@gnome.org>
14028
14029         * typemanager.cs (ICachingMemberFinder): Removed.
14030         (IMemberFinder.MemberCache): New property.
14031         (TypeManager.FindMembers): Merged this with RealFindMembers().
14032         This function will never be called from TypeManager.MemberLookup()
14033         so we can't use the cache here, just the IMemberFinder.
14034         (TypeManager.MemberLookup_FindMembers): Check whether the
14035         IMemberFinder has a MemberCache and call the cache's FindMembers
14036         function.
14037         (MemberCache): Rewrote larger parts of this yet another time and
14038         cleaned it up a bit.
14039
14040 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * driver.cs (LoadArgs): Support quoting.
14043
14044         (Usage): Show the CSC-like command line arguments.
14045
14046         Improved a few error messages.
14047
14048 2002-08-15  Martin Baulig  <martin@gnome.org>
14049
14050         * typemanager.cs (IMemberContainer.Type): New property.
14051         (IMemberContainer.IsInterface): New property.
14052
14053         The following changes are conditional to BROKEN_RUNTIME, which is
14054         defined at the top of the file.
14055
14056         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14057         class'es members, but add all members from TypeHandle.ObjectType
14058         if we're an interface.
14059         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14060         is the current type.
14061         (MemberCache.CacheEntry.Container): Removed this field.
14062         (TypeHandle.GetMembers): Include inherited members.
14063
14064 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14065
14066         * typemanager.cs: fixed compilation and added a comment on a field that
14067         is never used.
14068
14069 2002-08-15  Martin Baulig  <martin@gnome.org>
14070
14071         * class.cs (ConstructorInitializer.Resolve): In the
14072         Expression.MemberLookup call, use the queried_type as
14073         invocation_type.
14074
14075         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14076         declared' attribute, it's always true.
14077         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14078         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14079         temporary wrapper for FindMembers which tells MemberLookup whether
14080         members from the base classes are included in the return value.
14081         This will go away soon.
14082         (TypeManager.MemberLookup): Use this temporary hack here; once the
14083         new MemberCache is completed, we don't need to do the DeclaredOnly
14084         looping here anymore since the MemberCache will take care of this.
14085         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14086         (MemberCache): When creating the MemberCache for a class, get
14087         members from the current class and all its base classes.
14088         (MemberCache.CacheEntry.Container): New field.  This is a
14089         temporary hack until the Mono runtime is fixed to distinguish
14090         between ReflectedType and DeclaringType.  It allows us to use MCS
14091         with both the MS runtime and the unfixed Mono runtime without
14092         problems and without accecting performance.
14093         (MemberCache.SearchMembers): The DeclaredOnly looping from
14094         TypeManager.MemberLookup is now done here.      
14095
14096 2002-08-14  Martin Baulig  <martin@gnome.org>
14097
14098         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14099         Type.GetFields on dynamic types but get the fields from the
14100         corresponding TypeContainer.
14101         (MyStructInfo.GetStructInfo): Added check for enum types.
14102
14103         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14104         (MemberList.SyncRoot): Implemented.
14105         (TypeManager.FilterWithClosure): No need to check permissions if
14106         closure_start_type == closure_invocation_type, don't crash if
14107         closure_invocation_type is null.
14108
14109 2002-08-13  Martin Baulig  <martin@gnome.org>
14110
14111         Rewrote TypeContainer.FindMembers to use a member cache.  This
14112         gives us a speed increase of about 35% for the self-hosting MCS
14113         build and of about 15-20% for the class libs (both on GNU/Linux).
14114
14115         * report.cs (Timer): New class to get enhanced profiling.  This
14116         whole class is "TIMER" conditional since it remarkably slows down
14117         compilation speed.
14118
14119         * class.cs (MemberList): New class.  This is an IList wrapper
14120         which we're now using instead of passing MemberInfo[]'s around to
14121         avoid copying this array unnecessarily.
14122         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14123         (ICachingMemberFinder, IMemberContainer): New interface.
14124         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14125         has already been checked, otherwise use it for the name comparision.
14126         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14127         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14128         if possible.  Returns a MemberList, not a MemberInfo [].
14129         (TypeHandle): New class, implements IMemberContainer.  We create
14130         one instance of this class per type, it contains a MemberCache
14131         which is used to do the member lookups.
14132         (MemberCache): New class.  Each instance of this class contains
14133         all members of a type and a name-based hash table.
14134         (MemberCache.FindMembers): This is our new member lookup
14135         function.  First, it looks up all members of the requested name in
14136         the hash table.  Then, it walks this list and sorts out all
14137         applicable members and returns them.
14138
14139 2002-08-13  Martin Baulig  <martin@gnome.org>
14140
14141         In addition to a nice code cleanup, this gives us a performance
14142         increase of about 1.4% on GNU/Linux - not much, but it's already
14143         half a second for the self-hosting MCS compilation.
14144
14145         * typemanager.cs (IMemberFinder): New interface.  It is used by
14146         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14147         Enum, Delegate or Interface.
14148         (TypeManager.finder_to_member_finder): New PtrHashtable.
14149         (TypeManager.finder_to_container): Removed.
14150         (TypeManager.finder_to_delegate): Removed.
14151         (TypeManager.finder_to_interface): Removed.
14152         (TypeManager.finder_to_enum): Removed.
14153
14154         * interface.cs (Interface): Implement IMemberFinder.
14155
14156         * delegate.cs (Delegate): Implement IMemberFinder.
14157
14158         * enum.cs (Enum): Implement IMemberFinder.
14159
14160         * class.cs (TypeContainer): Implement IMemberFinder.
14161
14162 2002-08-12  Martin Baulig  <martin@gnome.org>
14163
14164         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14165
14166 2002-08-12  Martin Baulig  <martin@gnome.org>
14167
14168         * ecore.cs (ITypeExpression): New interface for expressions which
14169         resolve to a type.
14170         (TypeExpression): Renamed to TypeLookupExpression.
14171         (Expression.DoResolve): If we're doing a types-only lookup, the
14172         expression must implement the ITypeExpression interface and we
14173         call DoResolveType() on it.
14174         (SimpleName): Implement the new ITypeExpression interface.
14175         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14176         hack, the situation that we're only looking up types can't happen
14177         anymore when this method is called.  Moved the type lookup code to
14178         DoResolveType() and call it.
14179         (SimpleName.DoResolveType): This ITypeExpression interface method
14180         is now doing the types-only lookup.
14181         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14182         (ResolveFlags): Added MaskExprClass.
14183
14184         * expression.cs (MemberAccess): Implement the ITypeExpression
14185         interface.
14186         (MemberAccess.DoResolve): Added support for a types-only lookup
14187         when we're called via ITypeExpression.DoResolveType().
14188         (ComposedCast): Implement the ITypeExpression interface.
14189
14190         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14191         Expression.Resolve() with ResolveFlags.Type instead.
14192
14193 2002-08-12  Martin Baulig  <martin@gnome.org>
14194
14195         * interface.cs (Interface.Define): Apply attributes.
14196
14197         * attribute.cs (Attribute.ApplyAttributes): Added support for
14198         interface attributes.
14199
14200 2002-08-11  Martin Baulig  <martin@gnome.org>
14201
14202         * statement.cs (Block.Emit): Only check the "this" variable if we
14203         do not always throw an exception.
14204
14205         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14206         whether the property has a set accessor.
14207
14208 2002-08-11  Martin Baulig  <martin@gnome.org>
14209
14210         Added control flow analysis support for structs.
14211
14212         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14213         with control flow analysis turned off.
14214         (IVariable): New interface.
14215         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14216         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14217         (FieldExpr.DoResolve): Resolve the instance expression with flow
14218         analysis turned off and do the definite assignment check after the
14219         resolving when we know what the expression will resolve to.
14220
14221         * expression.cs (LocalVariableReference, ParameterReference):
14222         Implement the new IVariable interface, only call the flow analysis
14223         code if ec.DoFlowAnalysis is true.
14224         (This): Added constructor which takes a Block argument.  Implement
14225         the new IVariable interface.
14226         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14227         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14228         This does the definite assignment checks for struct members.
14229
14230         * class.cs (Constructor.Emit): If this is a non-static `struct'
14231         constructor which doesn't have any initializer, call
14232         Block.AddThisVariable() to tell the flow analysis code that all
14233         struct elements must be initialized before control returns from
14234         the constructor.
14235
14236         * statement.cs (MyStructInfo): New public class.
14237         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14238         argument to this indexer.  If non-zero, check an individual struct
14239         member, not the whole struct.
14240         (FlowBranching.CheckOutParameters): Check struct members.
14241         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14242         overloaded versions of these methods which take an additional
14243         `int field_idx' argument to check struct members.
14244         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14245         overloaded versions of these methods which take an additional
14246         `string field_name' argument to check struct member.s
14247         (VariableInfo): Implement the IVariable interface.
14248         (VariableInfo.StructInfo): New public property.  Returns the
14249         MyStructInfo instance of the variable if it's a struct or null.
14250         (Block.AddThisVariable): New public method.  This is called from
14251         Constructor.Emit() for non-static `struct' constructor which do
14252         not have any initializer.  It creates a special variable for the
14253         "this" instance variable which will be checked by the flow
14254         analysis code to ensure that all of the struct's fields are
14255         initialized before control returns from the constructor.
14256         (UsageVector): Added support for struct members.  If a
14257         variable/parameter is a struct with N members, we reserve a slot
14258         in the usage vector for each member.  A struct is considered fully
14259         initialized if either the struct itself (slot 0) or all its
14260         members are initialized.
14261
14262 2002-08-08  Martin Baulig  <martin@gnome.org>
14263
14264         * driver.cs (Driver.MainDriver): Only report an error CS5001
14265         if there were no compilation errors.
14266
14267         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14268         `UnsafeContext' property to determine whether the parent is in
14269         unsafe context rather than checking the parent's ModFlags:
14270         classes nested in an unsafe class are unsafe as well.
14271
14272 2002-08-08  Martin Baulig  <martin@gnome.org>
14273
14274         * statement.cs (UsageVector.MergeChildren): Distinguish between
14275         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14276         we return.  Added test17() and test18() to test-154.cs.
14277
14278 2002-08-08  Martin Baulig  <martin@gnome.org>
14279
14280         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14281         Family access, make sure the invoking type isn't a subclass of the
14282         queried type (that'd be a CS1540).
14283
14284         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14285         this method which takes an additional `Type invocation_type'.
14286
14287         * expression.cs (BaseAccess.DoResolve): Use the base type as
14288         invocation and query type.
14289         (MemberAccess.DoResolve): If the lookup failed and we're about to
14290         report a CS0122, try a lookup with the ec.ContainerType - if this
14291         succeeds, we must report a CS1540.
14292
14293 2002-08-08  Martin Baulig  <martin@gnome.org>
14294
14295         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14296         (MethodGroupExpr): Implement the IMemberExpr interface.
14297
14298         * expression (MemberAccess.ResolveMemberAccess): No need to have
14299         any special code for MethodGroupExprs anymore, they're now
14300         IMemberExprs.   
14301
14302 2002-08-08  Martin Baulig  <martin@gnome.org>
14303
14304         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14305         Family, FamANDAssem and FamORAssem permissions.
14306         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14307
14308 2002-08-08  Martin Baulig  <martin@gnome.org>
14309
14310         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14311         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14312         or loop block.
14313
14314 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14315
14316         * driver.cs: implemented /resource option to embed managed resources.
14317
14318 2002-08-07  Martin Baulig  <martin@gnome.org>
14319
14320         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14321         (FieldBase.HasFieldInitializer): New public property.
14322         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14323         returns the field initializer and makes sure it is only resolved once.
14324         (TypeContainer.EmitFieldInitializers): Call
14325         FieldBase.GetInitializerExpression to get the initializer, this ensures
14326         that it isn't resolved multiple times.
14327
14328         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14329         the resolving process (SimpleName/MemberLookup) that we're currently
14330         emitting a field initializer (which must not access any instance members,
14331         this is an error CS0236).
14332
14333         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14334         argument, if the `IsFieldInitializer' flag is set, we must report and
14335         error CS0236 and not an error CS0120.   
14336
14337 2002-08-07  Martin Baulig  <martin@gnome.org>
14338
14339         * ecore.cs (IMemberExpr): New public interface.
14340         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14341         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14342         if the expression is an IMemberExpr.
14343
14344         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14345         to be null, implicitly default to `this' if we're non-static in
14346         this case.  Simplified the code a lot by using the new IMemberExpr
14347         interface.  Also fixed bug #28176 here.
14348
14349 2002-08-06  Martin Baulig  <martin@gnome.org>
14350
14351         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14352         ParameterReferences during semantic analysis so that we can do a
14353         type-only search when resolving Cast, TypeOf and SizeOf.
14354         (block): Pass the `current_local_parameters' to the Block's
14355         constructor.
14356
14357         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14358         argument to the constructor.
14359         (ConstructorInitializer.Resolve): Create a temporary implicit
14360         block with the parameters.
14361
14362         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14363         references here if we aren't doing a type-only search.
14364
14365         * statement.cs (Block): Added constructor which takes a
14366         `Parameters parameters' argument.
14367         (Block.Parameters): New public property.
14368
14369         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14370         to `Parameters' and made it public readonly.
14371
14372 2002-08-06  Martin Baulig  <martin@gnome.org>
14373
14374         * ecore.cs (Expression.Warning): Made this public as well.
14375
14376         * report.cs (Report.Debug): Print the contents of collections.
14377
14378 2002-08-06  Martin Baulig  <martin@gnome.org>
14379
14380         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14381         used to tell Resolve() which kinds of expressions it may return.
14382         (Expression.Resolve): Added overloaded version of this method which
14383         takes a `ResolveFlags flags' argument.  This can be used to tell
14384         Resolve() which kinds of expressions it may return.  Reports a
14385         CS0118 on error.
14386         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14387         ResolveFlags.SimpleName.
14388         (Expression.Error118): Added overloaded version of this method which
14389         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14390         which kinds of expressions are allowed.
14391
14392         * expression.cs (Argument.ResolveMethodGroup): New public method.
14393         Resolves an argument, but allows a MethodGroup to be returned.
14394         This is used when invoking a delegate.
14395
14396         * TODO: Updated a bit.
14397
14398 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14399
14400         Fixed compilation with csc.
14401
14402         * ecore.cs: Expression.Error made public. Is this correct? Should
14403         Warning be made public too?
14404
14405         * expression.cs: use ea.Location instead of ea.loc.
14406         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14407
14408 2002-08-06  Martin Baulig  <martin@gnome.org>
14409
14410         * ecore.cs (Expression.loc): Moved the location here instead of
14411         duplicating it in all derived classes.
14412         (Expression.Location): New public property.
14413         (Expression.Error, Expression.Warning): Made them non-static and
14414         removed the location argument.
14415         (Expression.Warning): Added overloaded version which takes an
14416         `int level' argument.
14417         (Expression.Error118): Make this non-static and removed the
14418         expression and location arguments.
14419         (TypeExpr): Added location argument to the constructor.
14420
14421         * expression.cs (StaticCallExpr): Added location argument to
14422         the constructor.
14423         (Indirection, PointerArithmetic): Likewise.
14424         (CheckedExpr, UnCheckedExpr): Likewise.
14425         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14426         (StringPtr): Likewise.
14427
14428
14429 2002-08-05  Martin Baulig  <martin@gnome.org>
14430
14431         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14432
14433         * assign.cs (Assign.DoResolve): Check whether the source
14434         expression is a value or variable.
14435
14436         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14437         while resolving the corresponding blocks.
14438
14439         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14440         an error, don't silently return null.
14441
14442         * statement.cs (Block.AddVariable): Do the error reporting here
14443         and distinguish between CS0128 and CS0136.
14444         (Block.DoResolve): Report all unused labels (warning CS0164).
14445         (LabeledStatement): Pass the location to the constructor.
14446         (LabeledStatement.HasBeenReferenced): New property.
14447         (LabeledStatement.Resolve): Set it to true here.
14448
14449         * statement.cs (Return.Emit): Return success even after reporting
14450         a type mismatch error (CS0126 or CS0127), this is what csc does and
14451         it avoids confusing the users with any consecutive errors.
14452
14453 2002-08-05  Martin Baulig  <martin@gnome.org>
14454
14455         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14456
14457         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14458
14459         * expression.cs (MemberAccess.DoResolve): Silently return if an
14460         error has already been reported.
14461
14462         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14463         error has already been reported.
14464
14465 2002-08-05  Martin Baulig  <martin@gnome.org>
14466
14467         * statement.cs (UsageVector): Only initialize the `parameters'
14468         vector if we actually have any "out" parameters.
14469
14470 2002-08-05  Martin Baulig  <martin@gnome.org>
14471
14472         * expression.cs (Binary.ResolveOperator): When combining delegates,
14473         they must have the same type.
14474
14475 2002-08-05  Martin Baulig  <martin@gnome.org>
14476
14477         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14478         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14479         work with the ms runtime and we also don't need it: if we're a
14480         PropertyBuilder and not in the `indexer_arguments' hash, then we
14481         are a property and not an indexer.
14482
14483         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14484         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14485         since the latter one doesn't work with the ms runtime.
14486
14487 2002-08-03  Martin Baulig  <martin@gnome.org>
14488
14489         Fixed bugs #27998 and #22735.
14490
14491         * class.cs (Method.IsOperator): New public field.
14492         (Method.CheckBase): Report CS0111 if there's already a method
14493         with the same parameters in the current class.  Report CS0508 when
14494         attempting to change the return type of an inherited method.
14495         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14496         and it's not marked abstract or extern.
14497         (PropertyBase): New abstract base class for Property and Indexer.
14498         (PropertyBase.CheckBase): Moved here from Property and made it work
14499         for indexers.
14500         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14501         the same so we can reuse it there.
14502         (Property, Indexer): Derive from PropertyBase.
14503         (MethodSignature.inheritable_property_signature_filter): New delegate
14504         to find properties and indexers.
14505
14506         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14507         argument and improved error reporting.
14508
14509         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14510         EmptyReadOnlyParameters and made it a property.
14511
14512         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14513         version of this method which takes a `PropertyInfo indexer'.
14514         (TypeManager.RegisterIndexer): New method.
14515
14516         * class.cs: Added myself as author of this file :-)
14517
14518 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14519
14520         * class.cs: fixed compilation on windoze.
14521
14522 2002-08-03  Martin Baulig  <martin@gnome.org>
14523
14524         * interface.cs (Interface.GetInterfaceBases): Check whether all
14525         base interfaces are at least as accessible than the current one.
14526
14527         * class.cs (TypeContainer.GetClassBases): Check whether base types
14528         are at least as accessible than the current type.
14529         (TypeContainer.AsAccessible): Implemented and made non-static.
14530         (MemberBase.CheckParameters): Report errors if the accessibility
14531         checks fail.
14532
14533         * delegate.cs (Delegate.Delegate): The default visibility is
14534         internal for top-level types and private for nested types.
14535         (Delegate.Define): Report errors if the accessibility checks fail.
14536
14537         * enum.cs (Enum.Enum): The default visibility is internal for
14538         top-level types and private for nested types.
14539         (Enum.DefineType): Compute the correct visibility.
14540
14541         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14542         function which takes a `bool is_toplevel' instead of a TypeContainer.
14543
14544         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14545         builtin type.
14546
14547 2002-08-02  Martin Baulig  <martin@gnome.org>
14548
14549         * expression.cs (LocalVariableReferenc): Added constructor which
14550         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14551         (LocalVariableReference.IsReadOnly): New property.
14552         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14553         variable is readonly, use our own readonly flag to do this; you can
14554         use the new constructor to get a writable reference to a read-only
14555         variable.
14556
14557         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14558         reference to the local variable.
14559
14560 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * rootcontext.cs (ResolveCore): Also include System.Exception
14563
14564         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14565         we reach an EmptyStatement.
14566
14567         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14568         is also fine.
14569
14570         * expression.cs (Binary.ResolveOperator): Check error result in
14571         two places.
14572
14573         use brtrue/brfalse directly and avoid compares to null.
14574
14575 2002-08-02  Martin Baulig  <martin@gnome.org>
14576
14577         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14578         Fixes bug #28407, added test-155.cs.
14579
14580 2002-08-01  Martin Baulig  <martin@gnome.org>
14581
14582         * class.cs (Event.EmitDefaultMethod): Make this work with static
14583         events.  Fixes #28311, added verify-3.cs.
14584
14585 2002-08-01  Martin Baulig  <martin@gnome.org>
14586
14587         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14588         `is_disposable' fields.
14589         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14590         `hm.is_disposable' if we're using the collection pattern.
14591         (Foreach.EmitCollectionForeach): Use the correct type for the
14592         enumerator's local variable, only emit the try/finally block if
14593         necessary (fixes #27713).
14594
14595 2002-08-01  Martin Baulig  <martin@gnome.org>
14596
14597         * ecore.cs (Expression.report118): Renamed to Error118 and made
14598         it public static.
14599
14600         * statement.cs (Throw.Resolve): Check whether the expression is of
14601         the correct type (CS0118) and whether the type derives from
14602         System.Exception (CS0155).
14603         (Catch.Resolve): New method.  Do the type lookup here and check
14604         whether it derives from System.Exception (CS0155).
14605         (Catch.CatchType, Catch.IsGeneral): New public properties.
14606
14607         * typemanager.cs (TypeManager.exception_type): Added.
14608
14609 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14610
14611         * driver.cs: Updated About function.
14612
14613 2002-07-31  Martin Baulig  <martin@gnome.org>
14614
14615         Implemented Control Flow Analysis.
14616
14617         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14618         (EmitContext.CurrentBranching): Added.
14619         (EmitContext.StartFlowBranching): Added.
14620         (EmitContext.EndFlowBranching): Added.
14621         (EmitContext.KillFlowBranching): Added.
14622         (EmitContext.IsVariableAssigned): Added.
14623         (EmitContext.SetVariableAssigned): Added.
14624         (EmitContext.IsParameterAssigned): Added.
14625         (EmitContext.SetParameterAssigned): Added.
14626         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14627         Added control flow analysis stuff here.
14628
14629         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14630         resolve the expression as lvalue.
14631         (LocalVariableReference.DoResolve): Check whether the variable has
14632         already been assigned.
14633         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14634         the parameter as assigned here.
14635         (ParameterReference.DoResolve): Check whether the parameter has already
14636         been assigned.
14637         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14638         expression as lvalue.
14639
14640         * statement.cs (FlowBranching): New class for the flow analysis code.
14641         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14642         (LabeledStatement.IsDefined): New public property.
14643         (LabeledStatement.AddUsageVector): New public method to tell flow
14644         analyis that the label may be reached via a forward jump.
14645         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14646         flow analysis.
14647         (VariableInfo.Number): New public field.  This is used by flow analysis
14648         to number all locals of a block.
14649         (Block.CountVariables): New public property.  This is the number of
14650         local variables in this block (including the locals from all parent
14651         blocks).
14652         (Block.EmitMeta): Number all the variables.
14653
14654         * statement.cs: Added flow analysis support to all classes.
14655
14656 2002-07-31  Martin Baulig  <martin@gnome.org>
14657
14658         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14659         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14660         then use this argument.
14661
14662         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14663
14664         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14665         use this to specify /define options.
14666
14667 2002-07-29  Martin Baulig  <martin@gnome.org>
14668
14669         * statement.cs (Fixed): Moved all code that does variable lookups
14670         and resolvings from Emit to Resolve.
14671
14672         * statement.cs (For): Moved all code that does variable lookups
14673         and resolvings from Emit to Resolve.
14674
14675         * statement.cs (Using): Moved all code that does variable lookups
14676         and resolvings from Emit to Resolve.
14677
14678 2002-07-29  Martin Baulig  <martin@gnome.org>
14679
14680         * attribute.cs (Attribute.Resolve): Explicitly catch a
14681         System.NullReferenceException when creating the
14682         CustromAttributeBuilder and report a different warning message.
14683
14684 2002-07-29  Martin Baulig  <martin@gnome.org>
14685
14686         * support.cs (ParameterData.ParameterName): Added method to
14687         get the name of a parameter.
14688
14689         * typemanager.cs (TypeManager.IsValueType): New public method.
14690
14691 2002-07-29  Martin Baulig  <martin@gnome.org>
14692
14693         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14694         is a flag which specifies that it's either ref or out.
14695         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14696         the out parameter to `out Parameter.Modifier mod', also set the
14697         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14698
14699         * support.cs (InternalParameters.ParameterModifier): Distinguish
14700         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14701         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14702
14703         * expression.cs (Argument.GetParameterModifier): Distinguish
14704         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14705         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14706
14707 2002-07-29  Martin Baulig  <martin@gnome.org>
14708
14709         * expression.cs (ParameterReference.ParameterReference): Added
14710         `Location loc' argument to the constructor.
14711
14712         * cs-parser.jay: Pass location to ParameterReference.
14713
14714 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * statement.cs (Try): Initialize the location.
14717
14718         * cs-parser.jay: pass location to Try.
14719
14720         * expression.cs (Unary.Reduce): Change the prototype to return
14721         whether a constant fold could be performed or not.  The result is
14722         returned in an out parameters.  In the case of Indirection and
14723         AddressOf, we want to perform the full tests.
14724
14725 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14726
14727         * statement.cs (Statement.Emit): Flag dead code.
14728
14729 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14730
14731         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14732
14733 2002-07-27  Martin Baulig  <martin@gnome.org>
14734
14735         * class.cs (MethodData.Define): Put back call to
14736         TypeManager.AddMethod(), accidentally commented this out.
14737
14738         * report.cs (Debug): New public method to print debugging information,
14739         this is `[Conditional ("DEBUG")]'.
14740
14741 2002-07-26  Martin Baulig  <martin@gnome.org>
14742
14743         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14744         (switch_statement): Push the current_block to the switch_stack and
14745         pop it again when we're done with the switch.
14746         (switch_section): The new block is a child of the current_block.
14747         Fixes bug #24007, added test-152.cs.
14748
14749 2002-07-27  Martin Baulig  <martin@gnome.org>
14750
14751         * expression.cs (Invocation.EmitArguments): When calling a varargs
14752         function with only its fixed arguments, we need to pass an empty
14753         array.
14754
14755 2002-07-27  Martin Baulig  <martin@gnome.org>
14756
14757         Mono 0.13 has been released.
14758
14759 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * driver.cs: Rename --resource to --linkres, because that is what
14762         we do currently, we dont support --resource yet.
14763
14764         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14765
14766 2002-07-25  Martin Baulig  <martin@gnome.org>
14767
14768         * class.cs (MethodData): New public class.  This is a `method builder'
14769         class for a method or one accessor of a Property/Indexer/Event.
14770         (MethodData.GetMethodFlags): Moved here from MemberBase.
14771         (MethodData.ApplyAttributes): Likewise.
14772         (MethodData.ApplyObsoleteAttribute): Likewise.
14773         (MethodData.ApplyConditionalAttribute): Likewise.
14774         (MethodData.ApplyDllImportAttribute): Likewise.
14775         (MethodData.CheckAbstractAndExternal): Likewise.
14776         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14777         (MethodData.Emit): Formerly known as Method.Emit().
14778         (MemberBase): Moved everything which was specific to a single
14779         accessor/method to MethodData.
14780         (Method): Create a new MethodData and call Define() and Emit() on it.
14781         (Property, Indexer, Event): Create a new MethodData objects for each
14782         accessor and call Define() and Emit() on them.
14783
14784 2002-07-25  Martin Baulig  <martin@gnome.org>
14785
14786         Made MethodCore derive from MemberBase to reuse the code from there.
14787         MemberBase now also checks for attributes.
14788
14789         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14790         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14791         as virtual.
14792         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14793         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14794         (MemberBase.ApplyAttributes): New virtual method; applies the
14795         attributes to a method or accessor.
14796         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14797         (MemberBase.ApplyConditionalAttribute): Likewise.
14798         (MemberBase.ApplyDllImportAttribute): Likewise.
14799         (MemberBase.CheckAbstractAndExternal): Likewise.
14800         (MethodCore.ParameterTypes): This is now a property instead of a
14801         method, it's initialized from DoDefineParameters().
14802         (MethodCore.ParameterInfo): Removed the set accessor.
14803         (MethodCore.DoDefineParameters): New protected virtual method to
14804         initialize ParameterTypes and ParameterInfo.
14805         (Method.GetReturnType): We can now simply return the MemberType.
14806         (Method.GetMethodFlags): Override the MemberBase version and add
14807         the conditional flags.
14808         (Method.CheckBase): Moved some code from Define() here, call
14809         DoDefineParameters() here.
14810         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14811         here to avoid some larger code duplication.
14812         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14813         ensure that abstract and external accessors don't declare a body.
14814
14815         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14816         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14817         lookup in the attribute's parent classes, so we need to abort as soon
14818         as we found the first match.
14819         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14820         the attribute has no arguments.
14821
14822         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14823         of a Method.
14824
14825 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14826
14827         * cs-parser.jay: reverted previous patch.
14828
14829 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14830
14831         * cs-parser.jay: fixed bug #22119.
14832
14833 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14834
14835         * attribute.cs: fixed compilation. The error was:
14836         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14837         be assigned to before control leaves the current method."
14838         [FIXME:  Filed as bug #28186: MCS must report this error.]
14839
14840 2002-07-25  Martin Baulig  <martin@gnome.org>
14841
14842         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14843         method to pull the condition name ouf of a Conditional attribute.
14844         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14845         the obsolete message and error flag out of an Obsolete attribute.
14846
14847         * class.cs (Method.GetMethodFlags): New public method to get the
14848         TypeManager.MethodFlags for this method.
14849         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14850         private methods.
14851         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14852         if we're overriding a virtual function, set the new private variable
14853         `parent_method'; call the new TypeManager.AddMethod().
14854
14855         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14856         the MethodBuilder and the Method in a PtrHashtable.
14857         (TypeManager.builder_to_method): Added for this purpose.
14858         (TypeManager.MethodFlags): Added IsObsoleteError.
14859         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14860         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14861         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14862         the message from the attribute.
14863
14864 2002-07-24  Martin Baulig  <martin@gnome.org>
14865
14866         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14867         preprocessor directives, ensure that the argument to #define/#undef is
14868         exactly one identifier and that it's actually an identifier.
14869
14870         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14871         did not work ....
14872
14873 2002-07-24  Martin Baulig  <martin@gnome.org>
14874
14875         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14876         initialize it to TypeManager.object_type in the constructor.
14877         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14878         of the `hm.get_current' method if we're using the collection pattern.
14879         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14880         for the explicit conversion to make it work when we're using the collection
14881         pattern and the `Current' property has a different return type than `object'.
14882         Fixes #27713.
14883
14884 2002-07-24  Martin Baulig  <martin@gnome.org>
14885
14886         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14887         does not match, but don't report any errors.  This method is called in
14888         order for all methods in a MethodGroupExpr until a matching method is
14889         found, so we don't want to bail out if the first method doesn't match.
14890         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14891         matches, report the 123.  Fixes #28070.
14892
14893 2002-07-24  Martin Baulig  <martin@gnome.org>
14894
14895         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14896         TypeManager.TypeToCoreType() to the top of the method so the
14897         following equality checks will work.  Fixes #28107.
14898
14899 2002-07-24  Martin Baulig  <martin@gnome.org>
14900
14901         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14902         operand is of type uint, and the other operand is of type sbyte,
14903         short or int, the operands are converted to type long." -
14904         Actually do what this comment already told us.  Fixes bug #28106,
14905         added test-150.cs.
14906
14907 2002-07-24  Martin Baulig  <martin@gnome.org>
14908
14909         * class.cs (MethodBase): New abstract class.  This is now a base
14910         class for Property, Indexer and Event to avoid some code duplication
14911         in their Define() and DefineMethods() methods.
14912         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14913         generic methods for Define() and DefineMethods().
14914         (FieldBase): Derive from MemberBase, not MemberCore.
14915         (Property): Derive from MemberBase, not MemberCore.
14916         (Property.DefineMethod): Moved all the code from this method to the
14917         new MethodBase.DefineAccessor(), just call it with appropriate
14918         argumetnts.
14919         (Property.Define): Call the new Property.DoDefine(), this does some
14920         sanity checks and we don't need to duplicate the code everywhere.
14921         (Event): Derive from MemberBase, not MemberCore.
14922         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14923         accessors, this will also make them work with interface events.
14924         (Indexer): Derive from MemberBase, not MemberCore.
14925         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14926         (Indexer.Define): Use the new MethodBase functions.
14927
14928         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14929         argument to the constructor.
14930         (Interface.FindMembers): Added support for interface events.
14931         (Interface.PopluateEvent): Implemented.
14932
14933         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14934
14935 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14936
14937         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14938         but this is required to check for a method name being the same as
14939         the containing class.  
14940
14941         Handle this now.
14942
14943 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14944
14945         * interface.cs: initialize variable.
14946
14947 2002-07-23  Martin Baulig  <martin@gnome.org>
14948
14949         Implemented the IndexerName attribute in interfaces.
14950
14951         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14952         name if this is an explicit interface implementation.
14953         (Indexer.InterfaceIndexerName): New public variable.  If we're
14954         implementing an interface indexer, this is the IndexerName in that
14955         interface.  Otherwise, it's the IndexerName.
14956         (Indexer.DefineMethod): If we're implementing interface indexer,
14957         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14958         and Pending.ImplementIndexer methods.
14959         (Indexer.Define): Also define the PropertyBuilder if we're
14960         implementing an interface indexer and this is neither an explicit
14961         interface implementation nor do the IndexerName match the one in
14962         the interface.
14963
14964         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14965         If a method is defined here, then we always need to create a proxy
14966         for it.  This is used when implementing interface indexers.
14967         (Pending.IsInterfaceIndexer): New public method.
14968         (Pending.ImplementIndexer): New public method.
14969         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14970         This is used when implementing interface indexers to define a proxy
14971         if necessary.
14972         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14973         define a proxy if necessary.
14974
14975         * interface.cs (Interface.IndexerName): New public variable.
14976         (Interface.PopulateIndexer): Set the IndexerName.
14977         (Interface.DefineIndexers): New private method.  Populate all the
14978         indexers and make sure their IndexerNames match.
14979
14980         * typemanager.cs (IndexerPropertyName): Added support for interface
14981         indexers.
14982
14983 2002-07-22  Martin Baulig  <martin@gnome.org>
14984
14985         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14986         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14987         ret if HasReturnLabel.
14988         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14989         variables.
14990
14991         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14992         and set the ec.LoopBeginTryCatchLevel.
14993         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14994         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14995         the current ec.TryCatchLevel, the branch goes out of an exception
14996         block.  In this case, we need to use Leave and not Br.
14997
14998 2002-07-22  Martin Baulig  <martin@gnome.org>
14999
15000         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15001         block unless the block does not always return or it is contained in
15002         another try { ... } catch { ... } block.  Fixes bug #26506.
15003         Added verify-1.cs to the test suite.
15004
15005 2002-07-22  Martin Baulig  <martin@gnome.org>
15006
15007         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15008         then we do not always return.  Fixes bug #24985.
15009
15010 2002-07-22  Martin Baulig  <martin@gnome.org>
15011
15012         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15013         lookup on a per-class level; ie. walk up the class hierarchy until we
15014         found at least one applicable method, then choose the best among them.
15015         Fixes bug #24463 and test-29.cs.
15016
15017 2002-07-22  Martin Baulig  <martin@gnome.org>
15018
15019         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15020         return types of the methods.  The return type is not part of the
15021         signature and we must not check it to make the `new' modifier work.
15022         Fixes bug #27999, also added test-147.cs.
15023         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15024
15025         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15026         on the method's return type.
15027
15028 2002-07-21  Martin Baulig  <martin@gnome.org>
15029
15030         * assign.cs: Make this work if the rightmost source is a constant and
15031         we need to do an implicit type conversion.  Also adding a few more tests
15032         to test-38.cs which should have caught this.
15033
15034         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15035         target in the makefile for this.  The makefile.gnu is primarily intended
15036         for end-users who don't want to debug the compiler.
15037
15038 2002-07-21  Martin Baulig  <martin@gnome.org>
15039
15040         * assign.cs: Improved the Assign class so it can now handle embedded
15041         assignments (X = Y = Z = something).  As a side-effect this'll now also
15042         consume less local variables.  test-38.cs now passes with MCS, added
15043         a few new test cases to that test.
15044
15045 2002-07-20  Martin Baulig  <martin@gnome.org>
15046
15047         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15048         instructions.  Fixes bug #27977, also added test-146.cs.
15049
15050 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15051
15052         * cs-tokenizer.cs: fixed getHex ().
15053
15054 2002-07-19  Martin Baulig  <martin@gnome.org>
15055
15056         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15057         not Type.GetType() to lookup the array type.  This is needed when
15058         we're constructing an array of a user-defined type.
15059         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15060         single-dimensional arrays, but also for single-dimensial arrays of
15061         type decimal.
15062
15063 2002-07-19  Martin Baulig  <martin@gnome.org>
15064
15065         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15066         this function is called, it's not allowed to share LocalBuilders
15067         among ILGenerators.
15068
15069 2002-07-19  Martin Baulig  <martin@gnome.org>
15070
15071         * expression.cs (Argument.Resolve): Report an error 118 when trying
15072         to pass a type as argument.
15073
15074 2002-07-18  Martin Baulig  <martin@gnome.org>
15075
15076         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15077         Conv_R_Un for the signed `long' type.
15078
15079 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15082         `expr' for the temporary result, as that will fail if we do
15083         multiple resolves on the same expression.
15084
15085 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15088         ec.TypeContainer for looking up aliases. 
15089
15090         * class.cs (TypeContainer): Remove LookupAlias from here.
15091
15092         * decl.cs (DeclSpace); Move here.
15093
15094 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15095
15096         * class.cs (FindMembers): Only call filter if the constructor
15097         bulider is not null.
15098
15099         Also handle delegates in `NestedTypes' now.  Now we will perform
15100         type lookups using the standard resolution process.  This also
15101         fixes a bug.
15102
15103         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15104         This uses Expressions (the limited kind that can be parsed by the
15105         tree) instead of strings.
15106
15107         * expression.cs (ComposedCast.ToString): Implement, used to flag
15108         errors since now we have to render expressions.
15109
15110         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15111         FormArrayType. 
15112
15113         * ecore.cs (SimpleName.ToString): ditto.
15114
15115         * cs-parser.jay: Instead of using strings to assemble types, use
15116         Expressions to assemble the type (using SimpleName, ComposedCast,
15117         MemberAccess).  This should fix the type lookups in declarations,
15118         because we were using a different code path for this.
15119
15120         * statement.cs (Block.Resolve): Continue processing statements
15121         even when there is an error.
15122
15123 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15124
15125         * class.cs (Event.Define): Also remove the `remove' method from
15126         the list of pending items.
15127
15128         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15129         generate more compact code. 
15130
15131 2002-07-17  Martin Baulig  <martin@gnome.org>
15132
15133         * const.cs (Const.LookupConstantValue): Add support for constant
15134         `unchecked' and `checked' expressions.
15135         Also adding test case test-140.cs for this.
15136
15137 2002-07-17  Martin Baulig  <martin@gnome.org>
15138
15139         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15140         check whether mi.ReturnType implements the IEnumerator interface; the
15141         `==' and the IsAssignableFrom() will fail in this situation.
15142
15143 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15144
15145         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15146         here too.
15147
15148 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15149
15150         * expression.cs: fixed bug #27811.
15151
15152 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15153
15154         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15155         Molaro: when we are a ref, the value already contains a pointer
15156         value, do not take the address of it.
15157
15158 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15159         * removed mb-parser.jay and mb-tokenizer.cs
15160
15161 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15162
15163         * expression.cs: check against the building corlib void type.
15164
15165 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15166
15167         * ecore.cs: fix for valuetype static readonly fields: when 
15168         initializing them, we need their address, not the address of a copy.
15169
15170 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15171
15172         * typemanager.cs: register also enum_type in corlib.
15173
15174 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15175
15176         * class.cs: allow calling this (but not base) initializers in structs.
15177
15178 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15179
15180         * ecore.cs: make sure we compare against the building base types
15181         in GetTypeSize ().
15182
15183 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15184
15185         * typemanager.cs: fix TypeToCoreType() to handle void and object
15186         (corlib gets no more typerefs after this change).
15187
15188 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15189
15190         * expression.cs (ArrayCreation.EmitArrayArguments): use
15191         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15192
15193         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15194         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15195         array indexes, the runtime actually forbids them.
15196
15197         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15198         for array arguments here.
15199
15200         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15201         instead of the default for ValueTypes.
15202
15203         (New.DoEmit): Use IsValueType instead of
15204         IsSubclassOf (value_type)
15205         (New.DoResolve): ditto.
15206         (Invocation.EmitCall): ditto.
15207
15208         * assign.cs (Assign): ditto.
15209
15210         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15211         Statements *are* currently doing part of their resolution during
15212         Emit.  
15213
15214         Expressions do always resolve during resolve, but statements are
15215         only required to propagate resolution to their children.
15216
15217 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15218
15219         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15220
15221         (LoadAssembly): Do not add the dll if it is already specified
15222
15223         (MainDriver): Add the System directory to the link path at the end,
15224         after all the other -L arguments. 
15225
15226         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15227         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15228         ldelem.u1) and using the opposite for sbytes.
15229
15230         This fixes Digger, and we can finally run it.
15231
15232         * driver.cs (UnixParseOption): Move the option parsing here.  
15233         (CSCParseOption): Implement CSC-like parsing of options.
15234
15235         We now support both modes of operation, the old Unix way, and the
15236         new CSC-like way.  This should help those who wanted to make cross
15237         platform makefiles.
15238
15239         The only thing broken is that /r:, /reference: and /lib: are not
15240         implemented, because I want to make those have the same semantics
15241         as the CSC compiler has, and kill once and for all the confussion
15242         around this.   Will be doing this tomorrow.
15243
15244         * statement.cs (Unsafe.Resolve): The state is checked during
15245         resolve, not emit, so we have to set the flags for IsUnsfe here.
15246
15247 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15248
15249         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15250         not catch the Error_ObjectRefRequired in SimpleName (as it is
15251         possible to have a class/instance variable name that later gets
15252         deambiguated), we have to check this here.      
15253
15254 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15255
15256         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15257         make static and put into Expression.
15258
15259         (Event.Define): Register the private field of the event with the 
15260         TypeManager so that GetFieldFromEvent can get at it.
15261
15262         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15263         keep track of the private field associated with an event which
15264         has no accessors.
15265
15266         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15267         private field.
15268
15269         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15270
15271 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15272
15273         * expression.cs (Binary.EmitBranchable): this routine emits the
15274         Binary expression in a branchable context.  This basically means:
15275         we need to branch somewhere, not just get the value on the stack.
15276
15277         This works together with Statement.EmitBoolExpression.
15278
15279         * statement.cs (Statement.EmitBoolExpression): Use
15280         EmitBranchable. 
15281
15282 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15283
15284         * statement.cs (For): Reduce the number of jumps in loops.
15285
15286         (For): Implement loop inversion for the For statement.
15287
15288         (Break): We can be breaking out of a Try/Catch controlled section
15289         (foreach might have an implicit try/catch clause), so we need to
15290         use Leave instead of Br.
15291
15292         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15293         now).  If the instace expression supports IMemoryLocation, we use
15294         the AddressOf method from the IMemoryLocation to extract the
15295         address instead of emitting the instance.
15296
15297         This showed up with `This', as we were emitting the instance
15298         always (Emit) instead of the Address of This.  Particularly
15299         interesting when This is a value type, as we dont want the Emit
15300         effect (which was to load the object).
15301
15302 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15303
15304         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15305
15306         * statement.cs (Checked): Set the CheckedState during the resolve
15307         process too, as the ConvCast operations track the checked state on
15308         the resolve process, and not emit.
15309
15310         * cs-parser.jay (namespace_member_declaration): Flag that we have
15311         found a declaration when we do.  This is used to flag error 1529
15312
15313         * driver.cs: Report ok when we display the help only.
15314
15315 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15316
15317         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15318
15319 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15320
15321         * cs-tokenizer.cs (define): We also have to track locally the
15322         defines.  AllDefines is just used for the Conditional Attribute,
15323         but we also need the local defines for the current source code. 
15324
15325 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * statement.cs (While, For, Do): These loops can exit through a
15328         Break statement, use this information to tell whether the
15329         statement is the last piece of code.
15330
15331         (Break): Flag that we break.
15332
15333         * codegen.cs (EmitContexts): New `Breaks' state variable.
15334
15335 2002-07-03  Martin Baulig  <martin@gnome.org>
15336
15337         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15338         modifiers in method declarations in structs.  Otherwise, you won't
15339         be able to override things like Object.Equals().
15340
15341 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15342
15343         * class.cs (Method, Property, Indexer): Do not allow the public
15344         modifier to be used in explicit interface implementations.
15345
15346         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15347         override modifiers in method declarations in structs
15348
15349 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15350
15351         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15352         integer or real overflow, report an error
15353
15354 2002-07-02  Martin Baulig  <martin@gnome.org>
15355
15356         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15357         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15358         to tell the runtime about our newly created System.Object and
15359         System.ValueType types.
15360
15361 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15362
15363         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15364         struct instead of Ldarg/Starg.
15365
15366 2002-07-02  Martin Baulig  <martin@gnome.org>
15367
15368         * expression.cs (Indirection.Indirection): Call
15369         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15370
15371 2002-07-02  Martin Baulig  <martin@gnome.org>
15372
15373         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15374         ValueType, call TypeManager.TypeToCoreType() on it.
15375         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15376         the OpCodes.Newarr argument.
15377
15378 2002-07-02  Martin Baulig  <martin@gnome.org>
15379
15380         * expression.cs (Invocation.EmitCall): When compiling corlib,
15381         replace all calls to the system's System.Array type to calls to
15382         the newly created one.
15383
15384         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15385         System.Array methods.
15386         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15387         from the system's System.Array type which must be replaced.
15388
15389 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15390
15391         * typemanager.cs: load unverifiable_code_ctor so we can build
15392         corlib using the correct type. Avoid using GetTypeCode() with
15393         TypeBuilders.
15394         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15395         TypeManager.object_type to allow building corlib.
15396
15397 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15398
15399         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15400
15401 2002-07-01  Martin Baulig  <martin@gnome.org>
15402
15403         * class.cs: Make the last change actually work, we need to check
15404         whether `ifaces != null' to avoid a crash.
15405
15406 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15407
15408         * class.cs: when we build structs without fields that implement
15409         interfaces, we need to add the interfaces separately, since there is
15410         no API to both set the size and add the interfaces at type creation
15411         time.
15412
15413 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15414
15415         * expression.cs: the dimension arguments to the array constructors
15416         need to be converted if they are a long.
15417
15418 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15419
15420         * class.cs: don't emit ldarg.0 if there is no parent constructor
15421         (fixes showstopper for corlib).
15422
15423 2002-06-29  Martin Baulig  <martin@gnome.org>
15424
15425         MCS now compiles corlib on GNU/Linux :-)
15426
15427         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15428         ie. check for MethodImplOptions.InternalCall.
15429
15430         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15431         and TypeManager.attribute_type are null, so we must explicitly check
15432         whether parent is not null to find out whether it's an attribute type.
15433         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15434         and SetBuilder, not only if the property is neither abstract nor external.
15435         This is necessary to set the MethodImplOptions on the accessor methods.
15436         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15437         SetBuilder, see Property.Emit().
15438
15439         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15440         populate "System.Object", "System.ValueType" and "System.Attribute" since
15441         they've already been populated from BootCorlib_PopulateCoreTypes().
15442
15443 2002-06-29  Martin Baulig  <martin@gnome.org>
15444
15445         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15446         is the NullLiteral, we also need to make sure that target_type is not
15447         an enum type.   
15448
15449 2002-06-29  Martin Baulig  <martin@gnome.org>
15450
15451         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15452         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15453         before calling BootstrapCorlib_ResolveDelegate ().
15454
15455 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15456
15457         * statement.cs: fixed build-breaker. All tests passed ok.
15458
15459 2002-06-27  Martin Baulig  <martin@gnome.org>
15460
15461         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15462         for System.Decimal when compiling corlib.
15463
15464 2002-06-27  Martin Baulig  <martin@gnome.org>
15465
15466         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15467         switch blocks which contain nothing but a default clause.
15468
15469 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15470
15471        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15472
15473 2002-06-27  Martin Baulig  <martin@gnome.org>
15474
15475         * ecore.cs (PropertyExpr.PropertyExpr): Call
15476         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15477
15478         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15479         is already a TypeBuilder.
15480
15481 2002-06-27  Martin Baulig  <martin@gnome.org>
15482
15483         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15484         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15485         the "from an array-type to System.Array" case.  This makes it work
15486         when compiling corlib.
15487
15488 2002-06-27  Martin Baulig  <martin@gnome.org>
15489
15490         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15491         non-static PropertyExpr, set its InstanceExpression.  This makes
15492         the `ICollection.Count' property work in System/Array.cs.
15493
15494 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15495
15496         * driver.cs: Made error handling more consistent.  Errors now
15497         tracked by Report class, so many methods which used to return int
15498         now return void.  Main() now prints success/failure and 
15499         errors/warnings message.
15500
15501         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15502         the magic number return values (123 and 124).  Now, if the
15503         expected error occurs, the compiler exits with success (exit value
15504         0).  If the compilation completes without seeing that particular
15505         error, the compiler exits with failure (exit value 1).  The
15506         makefile in mcs/errors has been changed to handle the new behaviour.
15507
15508         * report.cs: Made 'expected error' number a property and renamed
15509         it from 'Probe' to 'ExpectedError'.
15510
15511         * genericparser.cs: Removed error handling support, since it is
15512         now all done by Report class.
15513
15514         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15515         class, so parse() no longer returns an int.
15516
15517         * namespace.cs: Use Report.Error instead of GenericParser.error
15518
15519 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15520
15521         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15522         TypeContainer.AddOperator): At the front of the list put the
15523         explicit implementations, so they get resolved/defined first. 
15524
15525 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15526
15527         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15528         interface type is implemented by this TypeContainer.  Used during
15529         explicit interface implementation.
15530
15531         (Property.Define, Indexer.Define, Method.Define): Validate that
15532         the given interface in the explicit implementation is one of the
15533         base classes for the containing type.
15534
15535         Also if we are explicitly implementing an interface, but there is
15536         no match in the pending implementation table, report an error.
15537
15538         (Property.Define): Only define the property if we are
15539         not explicitly implementing a property from an interface.  Use the
15540         correct name also for those properties (the same CSC uses,
15541         although that is really not needed).
15542
15543         (Property.Emit): Do not emit attributes for explicitly implemented
15544         properties, as there is no TypeBuilder.
15545
15546         (Indexer.Emit): ditto.
15547
15548         Hiding then means that we do not really *implement* a pending
15549         implementation, which makes code fail.
15550
15551 2002-06-22  Martin Baulig  <martin@gnome.org>
15552
15553         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15554         the return value of Object.GetType().  [FIXME: we need to do this whenever
15555         we get a type back from the reflection library].
15556
15557 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15558
15559         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15560
15561 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15562
15563         * attribute.cs: Return null if we can not look up the type.
15564
15565         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15566         the interface types found.
15567
15568         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15569         interface types found.
15570
15571         * typemanager.cs (GetInterfaces): Make this routine returns alll
15572         the interfaces and work around the lame differences between
15573         System.Type and System.Reflection.Emit.TypeBuilder in the results
15574         result for GetInterfaces.
15575
15576         (ExpandInterfaces): Given an array of interface types, expand and
15577         eliminate repeated ocurrences of an interface.  This expands in
15578         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15579         be IA, IB, IC.
15580
15581 2002-06-21  Martin Baulig  <martin@gnome.org>
15582
15583         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15584         on System.Enum.
15585
15586 2002-06-21  Martin Baulig  <martin@gnome.org>
15587
15588         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15589         and called with one of the core types, return the corresponding typebuilder for
15590         that type.
15591
15592         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15593         element type.
15594
15595 2002-06-21  Martin Baulig  <martin@gnome.org>
15596
15597         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15598         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15599         (Expression.ConvertReferenceExplicit): Likewise.
15600
15601         * expression.cs (ElementAccess.DoResolve): Likewise.
15602         (ElementAccess.DoResolveLValue): Likewise.
15603
15604 2002-06-10  Martin Baulig  <martin@gnome.org>
15605
15606         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15607         add the "value" parameter to the parameter list.
15608
15609         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15610         to our caller.
15611
15612 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15613
15614         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15615         the argument to an int, uint, long or ulong, per the spec.  Also
15616         catch negative constants in array creation.
15617
15618 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15619
15620         * class.cs: do not allow the same interface to appear twice in
15621         the definition list.
15622
15623 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15624
15625         * ecore.cs: don't use ldlen with System.Array.
15626
15627 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15628
15629         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15630
15631 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15632
15633         * modifiers.cs: produce correct field attributes for protected
15634         internal. Easy fix so miguel can work on ther harder stuff:-)
15635
15636 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15637
15638         * pending.cs: New file.  Move the code from class.cs here.
15639         Support clearning the pending flag for all methods (when not doing
15640         explicit interface implementation).
15641
15642 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15643
15644         * rootcontext.cs: added a couple more types needed to bootstrap.
15645
15646 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15649         constructor in the type, instead of any constructor in the type
15650         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15651         a bug in the Mono runtime when applying the params attribute). 
15652
15653 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15654         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15655
15656 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15657
15658         * expression.cs (Unary.ResolveOperator): Use TypeManager
15659         to resolve the type.
15660
15661 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15662
15663         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15664         attached.
15665
15666         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15667         with each member too.
15668
15669         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15670         field builders too - this takes care of the enum member case.
15671
15672 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15673
15674         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15675         address-of operator on both value types and pointers.
15676
15677 2002-06-10  Martin Baulig  <martin@gnome.org>
15678
15679         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15680         PropertyBuilder to the `property_builders' list.
15681
15682         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15683         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15684         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15685         find any indexers which are inherited from an interface.
15686
15687 2002-06-09  Martin Baulig  <martin@gnome.org>
15688
15689         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15690         the same type as the constant if necessary.  There's also a test-130.cs
15691         for this.
15692
15693         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15694
15695         * typemanager.cs (TypeManager.ChangeType): Previously known as
15696         Enum.ChangeEnumType().
15697
15698 2002-06-09  Martin Baulig  <martin@gnome.org>
15699
15700         * expression.cs (Cast.TryReduce): Added support for consts.
15701
15702 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15703
15704         * class.cs (Accessor): Hold attributes information so we can pass
15705         it along.
15706
15707         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15708         Modify to pass in attributes attached to the methods.
15709
15710         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15711
15712         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15713         to handle the Accessor kind :-)
15714
15715         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15716
15717 2002-06-08  Martin Baulig  <martin@gnome.org>
15718
15719         * expression.cs (Unary.TryReduceNegative): Added support for
15720         ULongConstants.
15721
15722 2002-06-08  Martin Baulig  <martin@gnome.org>
15723
15724         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15725         name can't be found in the `defined_names' - the caller will do a
15726         MemberLookup in this case and thus find methods in System.Enum
15727         such as Enum.IsDefined().
15728
15729 2002-06-08  Martin Baulig  <martin@gnome.org>
15730
15731         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15732         Convert.ChangeType() which works with TypeBuilder created types.
15733         (Enum.LookupEnumValue, Enum.Define): Use it here.
15734
15735         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15736         `TypeBuilder.BaseType != null' check.
15737         (TypeContainer.FindMembers): Only lookup parent members if we
15738         actually have a parent.
15739         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15740         (ConstructorInitializer.Resolve): Likewise.
15741
15742         * interface.cs (Interface.FindMembers): Added
15743         `TypeBuilder.BaseType != null' check.
15744
15745         * rootcontext.cs (RootContext.ResolveCore): Added
15746         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15747         classes_second_stage.
15748
15749         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15750         debug_type and trace_type when compiling with --nostdlib.       
15751
15752 2002-06-07  Martin Baulig  <martin@gnome.org>
15753
15754         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15755         (AddField): Set it to true when adding a non-static field.
15756         (DefineType): Use `have_nonstatic_fields' to find out whether we
15757         have non-static fields, not `Fields != null'.
15758
15759 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15760
15761         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15762         dereferencing a null on the static-field code path)
15763
15764 2002-05-30  Martin Baulig  <martin@gnome.org>
15765
15766         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15767         to take command line arguments.  Use reflection to call the new
15768         custom `Initialize' function on the symbol writer and pass it the
15769         command line arguments.
15770
15771         * driver.cs (--debug-args): New command line argument to pass command
15772         line arguments to the symbol writer.
15773
15774 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15775
15776         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15777         the target type for indexers and properties.  Thanks to Joe for
15778         catching this.
15779
15780 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15781
15782         * typemanager.cs (MethodFlags): returns the method flags
15783         (Obsolete/ShouldIgnore) that control warning emission and whether
15784         the invocation should be made, or ignored. 
15785
15786         * expression.cs (Invocation.Emit): Remove previous hack, we should
15787         not do this on matching a base type, we should do this based on an attribute
15788
15789         Only emit calls to System.Diagnostics.Debug and
15790         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15791         on the command line.
15792
15793         * rootcontext.cs: Global settings for tracing and debugging.
15794
15795         * cs-tokenizer.cs (define): New utility function to track
15796         defines.   Set the global settings for TRACE and DEBUG if found.
15797
15798 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15799
15800         * interface.cs (Populate*): Pass in the TypeContainer as well as
15801         the DeclSpace as parameters so that we can create EmitContexts and
15802         then use that to apply attributes etc.
15803
15804         (PopulateMethod, PopulateEvent, PopulateProperty)
15805         (PopulateIndexer): Apply attributes everywhere.
15806
15807         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15808         etc.
15809
15810         (ApplyAttributes): Update accordingly.
15811
15812         We now apply interface attributes for all members too.
15813
15814 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15815
15816         * class.cs (Indexer.Define); Correctly check if we are explicit
15817         implementation (instead of checking the Name for a ".", we
15818         directly look up if the InterfaceType was specified).
15819
15820         Delay the creation of the PropertyBuilder.
15821
15822         Only create the PropertyBuilder if we are not an explicit
15823         interface implementation.   This means that explicit interface
15824         implementation members do not participate in regular function
15825         lookups, and hence fixes another major ambiguity problem in
15826         overload resolution (that was the visible effect).
15827
15828         (DefineMethod): Return whether we are doing an interface
15829         implementation. 
15830
15831         * typemanager.cs: Temporary hack until we get attributes in
15832         interfaces (Ravi is working on that) and we get IndexerName
15833         support in interfaces.
15834
15835         * interface.cs: Register the indexers as properties.
15836
15837         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15838         warning, I have verified that this is a bug in the .NET runtime
15839         (JavaScript suffers of the same problem).
15840
15841         * typemanager.cs (MemberLookup): When looking up members for
15842         interfaces, the parent of an interface is the implicit
15843         System.Object (so we succeed in searches of Object methods in an
15844         interface method invocation.  Example:  IEnumerable x;  x.ToString
15845         ()) 
15846
15847 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * class.cs (Event): Events should also register if they do
15850         implement the methods that an interface requires.
15851
15852         * typemanager.cs (MemberLookup); use the new GetInterfaces
15853         method. 
15854
15855         (GetInterfaces): The code used to lookup interfaces for a type is
15856         used in more than one place, factor it here. 
15857
15858         * driver.cs: Track the errors at the bottom of the file, we kept
15859         on going.
15860
15861         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15862         instance if the method we are calling is static!
15863
15864 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15865
15866         * attribute.cs (ApplyAttributes): Make this function filter out
15867         the IndexerName attribute (as that attribute in reality is never
15868         applied) and return the string constant for the IndexerName
15869         attribute. 
15870
15871         * class.cs (TypeContainer.Emit): Validate that all the indexers
15872         have the same IndexerName attribute, and if so, set the
15873         DefaultName attribute on the class. 
15874
15875         * typemanager.cs: The return value might contain other stuff (not
15876         only methods).  For instance, consider a method with an "Item"
15877         property and an Item method.
15878
15879         * class.cs: If there is a problem with the parameter types,
15880         return. 
15881
15882 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15883
15884         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15885         looks at user defined conversion after making a call to 
15886         StandardConversionExists - we need this for overload resolution.
15887
15888         * expression.cs : Update accordingly the various method calls.
15889
15890         This fixes 2 bugs filed against implicit user defined conversions 
15891
15892 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15893
15894         * statement.cs: Track the result of the assignment.
15895
15896 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15897
15898         * expression.cs (MemberAccess): Improved error reporting for
15899         inaccessible members.
15900
15901 2002-05-22  Martin Baulig  <martin@gnome.org>
15902
15903         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15904         itself with debugging support.
15905
15906 2002-05-22  Martin Baulig  <martin@gnome.org>
15907
15908         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15909         Removed, this isn't needed anymore.
15910
15911 2002-05-20  Martin Baulig  <martin@gnome.org>
15912
15913         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15914         be underlying type for an enum.
15915
15916 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15917
15918         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15919         that splits out the loading of just the core types.
15920
15921         * rootcontext.cs (ResolveCore): Split the struct resolution in
15922         two, so we can load the enumeration underlying types before any
15923         enums are used.
15924
15925         * expression.cs (Is): Bandaid until we fix properly Switch (see
15926         bug #24985 for details).
15927
15928         * typemanager.cs (ImplementsInterface): The hashtable will contain
15929         a null if there are no interfaces implemented.
15930
15931 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * cs-parser.jay (indexer_declarator): It is fine to have array
15934         parameters
15935
15936 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15937
15938         * typemanager.cs: (RegisterBuilder): New function used to register
15939         TypeBuilders that implement interfaces.  Since
15940         TypeBuilder.GetInterfaces (as usual) does not work with lame
15941         Reflection.Emit. 
15942         (AddUserType): register interfaces.
15943
15944         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15945         dealing with TypeBuilder.  Also, arrays are showing up as
15946         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15947         methods can not be invoked on them!
15948
15949         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15950         (ImplicitReferenceConversionExists): Split out from
15951         StandardConversionExists. 
15952
15953         * expression.cs (As): We were only implementing one of the three
15954         cases for the as operator.  We now implement them all.
15955         (Is): Implement the various other cases for Is as well.
15956
15957         * typemanager.cs (CACHE): New define used to control if we want or
15958         not the FindMembers cache.  Seems to have a negative impact on
15959         performance currently
15960
15961         (MemberLookup): Nested types have full acess to
15962         enclosing type members
15963
15964         Remove code that coped with instance/static returns for events, we
15965         now catch this in RealFindMembers.
15966
15967         (RealFindMembers): only perform static lookup if the instance
15968         lookup did not return a type or an event.  
15969
15970 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15971
15972         * assign.cs (CompoundAssign): We pass more semantic information
15973         now to Compound Assignments than we did before: now we have all
15974         the information at hand, and now we resolve the target *before* we
15975         do the expression expansion, which allows the "CacheValue" method
15976         to have the effect we intended (before, a [x] += 1 would generate
15977         two differen ArrayAccess expressions from the ElementAccess,
15978         during the resolution process).
15979
15980         (CompoundAssign.DoResolve): Resolve target and original_source here.
15981
15982 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15983
15984         * expression.cs (ArrayAccess): dropped debugging information. 
15985
15986         * typemanager.cs: Small bug fix: I was always returning i_members,
15987         instead of one of i_members or s_members (depending on which had
15988         the content).
15989
15990         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15991         method is invoked before any code generation takes place, and it
15992         is a mechanism to inform that the expression will be invoked more
15993         than once, and that the method should use temporary values to
15994         avoid having side effects
15995
15996         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15997
15998         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15999         implementation.
16000
16001         * expression.cs (Indirection, ArrayAccess): Add support for
16002         CacheTemporaries in these two bad boys. 
16003
16004         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16005         ldobj or ldind_ref.  
16006         (StoreFromPtr): Handle stobj as well.
16007
16008         * expression.cs (UnaryMutator): Share more code.
16009
16010         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16011         down: I was not tracking the Filter function as well, which
16012         was affecting the results of the cache.
16013
16014 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16015
16016         * attribute.cs: Remove the hack to handle the CharSet property on
16017         StructLayouts. 
16018
16019 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * attribute.cs (DoResolve): More uglyness, we now only try to
16022         resolve the attribute partially, to extract the CharSet
16023         information (only if we are a StructLayout attribute).  Otherwise 
16024
16025         (GetExtraTypeInfo): Add some code to conditionally kill in the
16026         future this.   I am more and more convinced that the .NET
16027         framework has special code to handle the attribute setting on
16028         certain elements.
16029
16030         * expression.cs (IsParamsMethodApplicable): Revert my previous
16031         foreach change here, it was wrong.
16032
16033 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16034
16035         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16036         (pp_expr): do not abort on unknown input, just return.
16037         (eval): abort if there are pending chars.
16038
16039         * attribute.cs (Attribute.Resolve): Positional parameters are
16040         optional.  Deal with that case.
16041
16042         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16043         the Ansi/Unicode/Auto information for the type.
16044
16045         (TypeContainer.DefineType): instantiate the EmitContext here, as
16046         we will be using it during the type definition (to resolve
16047         attributes) and during the emit phase.
16048
16049         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16050         to pull type information out of the attributes
16051
16052         (Attribute.Resolve): track the constructor builder, and allow for
16053         multiple invocations (structs and classes will use this).
16054
16055         * ecore.cs (MemberLookupFinal): new version with all the
16056         parameters customizable.
16057
16058         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16059         constructors.  Return if the result value is null (as the error
16060         would have been flagged already by MemberLookupFinal)
16061
16062         Do not allow instances of abstract classes or interfaces to be
16063         created.
16064
16065         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16066         We have to compare the assembly property here when dealing with
16067         FamANDAssem and Assembly access modifiers, because we might be
16068         creating an assembly from *modules* (that means that we are not
16069         getting TypeBuilders for types defined in other modules that are
16070         part of this assembly).
16071
16072         (Method.Emit): If the method is marked abstract and has a body,
16073         emit an error. 
16074
16075         (TypeContainer.DefineMembers): If both the defined member and the
16076         parent name match are methods, then do not emit any warnings: let
16077         the Method.Define routine take care of flagging warnings.  But if
16078         there is a mismatch (method overrides something else, or method is
16079         overriwritten by something, then emit warning).
16080
16081         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16082         set to null, this means `do not check for the return type on the
16083         signature'. 
16084
16085         (Method.Define): set the return type for the method signature to
16086         null, so that we get methods with the same name and parameters and
16087         different return types.  This is used to flag warning 114 (you are
16088         hiding a method, and you probably want to use the new/override
16089         keywords instead).
16090
16091         * typemanager.cs (MemberLookup): Implemented proper access
16092         control, closing a long standing set of bug reports.  The problem
16093         was that the Framework only has two bits: Public and NonPublic,
16094         and NonPublic includes private and protected methods, but we need
16095         to enforce the FamANDAssem, FamOrAssem and Family. 
16096
16097 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16098
16099         * statement.cs (GotoCase): Return true: Ammounts to giving up
16100         knowledge on whether we return or not, and letting the other case
16101         be responsible for it.
16102
16103 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * driver.cs: Do not load directories for each file processed, only
16106         do it if there is a pattern.
16107
16108         * ecore.cs: Report readonly assigns here as well, as we might have
16109         been resolved only by MemberAccess.
16110
16111         (SimpleName.SimpleNameResolve): Also be useful for LValue
16112         resolution.   We need this to propagate assign to local readonly variables
16113
16114         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16115         do not want to reuse potential criteria memory.
16116
16117         * class.cs (MyEventBuilder): Set reflected_type;
16118
16119         * ecore.cs (Constantify): Added support for constifying bools.
16120
16121         (RootContext.LookupType): Added a cache for values looked up in
16122         the declaration space.
16123
16124         * typemanager.cs (FindMembers): Now is a front-end to
16125         RealFindMembers, and provides a two-level hashtable-based cache to
16126         the request.  
16127
16128         15% performance improvement: from 22.5 to 19.2 seconds.
16129
16130         * expression.cs (IsParamsMethodApplicable): use foreach.
16131         (Invocation.DoResolve): ditto.
16132         (New.DoResolve): ditto.
16133         (ArrayCreation.DoResolve): ditto.
16134
16135         * ecore.cs (FindMostEncompassingType): use foreach.
16136
16137         * delegate.cs (NewDelegate.DoResolve): Use foreach
16138
16139         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16140         (RemoveMethods): use foreach.
16141
16142         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16143         nested foreach statements instead of for, and also break out of
16144         the inner loop once a match is found.
16145
16146         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16147
16148 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16149
16150         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16151         we actually unwrap the expression to allow for extra information
16152         to be extracted. 
16153
16154         * expression.cs: Use Shr_Un on unsigned operations. 
16155
16156 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16157
16158         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16159         applicable operators was not being considered correctly. This closes
16160         the bug Miguel reported.
16161
16162 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16163
16164         * attribute.cs: check that the type derives from System.Attribute
16165         and report the correct error in that case (moved the duplicate code to
16166         its own method, too).
16167
16168 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16169
16170         * attribute.cs: lookup attribute type name as the spec says: first the
16171         bare attribute name and then name + "Attribute" (nant compiles with
16172         mcs after this fix).
16173
16174 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16175
16176         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16177         Because of the way we parse things, we should try to see if a
16178         UIntConstant can fit in an integer.
16179
16180 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16181
16182         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16183         when we are in an explicit context.
16184
16185         (ConvertReferenceExplicit): When converting from Iface type S to Class
16186         T make sure the rules are implemented as an OR.
16187
16188         * parameter.cs (ParameterType): Make it a property for now although the
16189         purpose really isn't anything immediate.
16190
16191         * expression.cs (Is*Applicable): Do better checking on the parameter type
16192         of a ref/out parameter. The ones from the system assemblies are already 
16193         marked with the correct type so we don't need to do any correction.
16194
16195         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16196         the object type is standard too so include that.
16197
16198 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16199
16200         * ecore.cs (StandardConversionExists): Augment with missing code:
16201         deal with IntConstant, LongConstants and Enumerations.
16202
16203         * assign.cs: Report the error, instead of failing silently
16204
16205         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16206         typecontainer that they are declared, because the
16207         typecontainer/namespace will have the list of using clauses that
16208         need to be applied.
16209
16210         Assembly Attributes were escaping the normal registration
16211         mechanism. 
16212
16213         (EmitCode): Apply attributes within an EmitContext that represents
16214         the container they were declared on.
16215
16216         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16217
16218 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16219
16220         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16221         Revamp completely - make much cleaner as we now operate only
16222         on a set of Types.
16223
16224         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16225         to implement the logic detailed in the spec more correctly.
16226
16227         (UserDefinedConversion): Update accordingly.
16228
16229 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16230
16231         * statement.cs: Return flow analysis information up.
16232
16233         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16234         and the default.
16235
16236         (token): Do not consume an extra character before calling
16237         decimal_digits.
16238
16239 2002-05-06  Piers Haken <piersh@friskit.com>
16240
16241         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16242
16243 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16244
16245         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16246         EmitContext during the instance constructor initializer
16247         resolution, to stop access to instance variables.
16248
16249         This is mandated by the spec, last paragraph of the `constructor
16250         initializers' section. 
16251
16252 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16253
16254         * cs-parser.jay, class.cs (Accessor): new class used to represent
16255         an accessor (get or set).  In the past we used `null' to represent
16256         a missing accessor.  But this is ambiguous because there was no
16257         way to tell in abstract indexers/properties if one of them was
16258         specified.
16259
16260         Now there is a way of addressing that.
16261
16262         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16263         instead of FindMembers.
16264
16265         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16266         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16267
16268         * attribute.cs: Treat indexers and properties as the same in terms
16269         of applying attributes
16270
16271         * ecore.cs (FindMostEncompassedType): Use statically initialized
16272         EmptyExpressions()s like we do elsewhere to avoid creating useless
16273         objects (and we take this out of the tight loop).
16274
16275         (GetConversionOperators): Move the code to extract the actual
16276         operators to a separate routine to clean things up.
16277
16278 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16279
16280         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16281         events are always registered FieldBuilders.
16282
16283         * class.cs (FieldBase): New class shared by Fields 
16284
16285         * delegate.cs: If we are a toplevel delegate, use our full name.
16286         If we are a nested delegate, then only use our tail name.
16287
16288 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16289
16290         * expression.cs (IsApplicable): Ensure that we add the "&" to
16291         ref/out types before comparing it with the type of the argument.
16292
16293         (IsParamsMethodApplicable): Ditto.
16294
16295         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16296         silly me ;-)
16297
16298         * delegate.cs : Handle the case when we have more than one applicable
16299         method. Flag an error only when we finish checking all.
16300
16301 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * expression.cs: Add support for boolean static initializers.
16304
16305 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16306
16307         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16308
16309         * parameter.cs (ComputeParameterTypes,
16310         ComputeAndDefineParameterTypes): Better error handling: now we
16311         clear the `types' cache if we fail during any of the type lookups.
16312         We also return the status code correctly to our caller
16313
16314         * delegate.cs: If we fail to define a delegate, abort the extra
16315         steps. 
16316
16317         * expression.cs (Binary.ResolveOperator): for
16318         operator==(object,object) and operator !=(object, object) we also
16319         have to verify that there is an implicit conversion from one to
16320         the other.
16321
16322         (ArrayAccess.DoResolve): Array Access can operate on
16323         non-variables. 
16324
16325 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * assign.cs (CompoundAssign): A new class used as a "flag" that
16328         the assignment actually is happening as part of a compound
16329         assignment operator.
16330
16331         During compound assignment, a few new rules exist to enable things
16332         like:
16333
16334         byte b |= 1 + 2
16335
16336         From the spec:
16337
16338         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16339         to the type of x) if y is implicitly convertible to the type of x,
16340         and the operator is a builtin operator and the return type of the
16341         operator is explicitly convertible to the type of x. 
16342
16343         * rootcontext.cs: Reset warning level to 2.  4 catches various
16344         "interesting" features in mcs, we must clean this up at some
16345         point, but currently am trying to kill other bugs ;-)
16346
16347         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16348         in container classes as well.  
16349
16350         * expression.cs (Binary.ResolveOperator): Handle string case
16351         before anything else (as operator overloading does emit an error
16352         before doing anything else).
16353
16354         This code could go away when we move to a table driven model, but
16355         i could not come up with a good plan last night.
16356
16357 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16358
16359         * typemanager.cs (CSharpName): reimplementation using regex.
16360         * class.cs: added null check for fields in Emit
16361         * rootcontext.cs: set warninglevel to 4
16362
16363 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16364
16365         * typemanager.cs (CSharpName): reimplemented with Lupus
16366         suggestion.
16367
16368 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16369
16370         * statement.cs (If): correclty implement Resolve, because we were
16371         not catching sem errors in there.  The same process is needed
16372         everywhere else. 
16373         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16374
16375
16376         (Statement.Warning_DeadCodeFound): Factorize code.
16377         (While): Report dead code here too.
16378
16379         (Statement): Added Resolve virtual method to allow
16380         for resolution split from the emit code.
16381
16382 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16383
16384         * statement.cs (EmitBoolExpression): No longer try to resolve the
16385         expression here.    
16386         (MakeBoolean): New utility function that resolve, implicitly
16387         converts to boolean and tags the expression. 
16388
16389
16390         (If, Do): Implement dead code elimination.
16391         (While): Implement loop inversion
16392
16393         (Do, While, For, If): Resolve the expression prior to calling our
16394         code generation.
16395
16396 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16397
16398         * class.cs:
16399           - added method Report28 (warning: program has more than one entry point)
16400           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16401           - modified method Method.Define, the part at the end of the method
16402
16403         * rootcontext.cs: added static public Location EntryPointLocation;
16404           
16405         * ../errors/cs0028.cs : Add test case for the above warning.              
16406
16407         * typemanager.cs:
16408           - modified method CSharpName to allow arrays of primitive type to
16409             be printed nicely (e.g. instead of System.Int32[][] it now prints
16410             int[][])
16411           - added method CSharpSignature: returns the signature of a method
16412             in string format to be used in reporting errors, warnings, etc.
16413
16414         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16415         with String.Empty.
16416
16417 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16418
16419         * delegate.cs (Define): Fix extremely silly bug where I was
16420         setting the type of the 'object' parameter of the BeginInvoke
16421         method to System.IAsyncResult instead of System.Object ;-)
16422
16423 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16426         here. 
16427
16428         (Constructor.Emit): return if we fail to initialize the
16429         constructor.  Another door closed!  
16430
16431         * expression.cs (New.DoResolve): Improve error message (from -6 to
16432         1501).  Use DeclaredOnly lookup to find the exact constructor.
16433
16434         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16435         loop.  This is useful.
16436
16437         * cs-parser.jay: Adjust the default parameters so that destructors
16438         have the proper signature.
16439
16440 2002-04-26  Martin Baulig  <martin@gnome.org>
16441
16442         * driver.cs (LoadAssembly): If `assembly' contains any characters
16443         which are only valid in path names and not in assembly names
16444         (currently slash, backslash and point), use Assembly.LoadFrom ()
16445         instead of Assembly.Load () on the `assembly' (before iteration
16446         over the link_paths).
16447
16448 2002-04-26  Martin Baulig  <martin@gnome.org>
16449
16450         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16451
16452 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16453
16454         * class.cs (Property): use the new typemanager.MemberLookup
16455
16456         (TypeContainer.MemberLookup): Implement using the
16457         TypeManager.MemberLookup now. 
16458
16459         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16460         and return MemberInfos, so that these can be used without an
16461         EmitContext (what we had before).
16462
16463 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16464
16465         * expression.cs: Fix the case where the argument to params if the
16466         type of the params.  I omitted handling this before.   Fixed
16467
16468 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16469
16470         * driver.cs: Call BootCorlib_PopulateCoreType
16471
16472         * class.cs (Property.CheckBase): Check for properties only, not
16473         for all members. 
16474
16475         * interface.cs: Temporary hack: try/catch around the
16476         CustomAttributeBuilder, because I am getting an exception that I
16477         do not understand.
16478
16479         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16480         types whose definitions are required to be there (attributes are
16481         defined before standard types).
16482
16483         Compute definitions as we boot the various types, as they are used
16484         immediately (value_type class will need object_type, but if we do
16485         not initialize object_type, we will pass a null, which will let
16486         the runtime pick the System.Object from the existing corlib, which
16487         is not what we want).
16488
16489 2002-04-22  Patrik Torstensson <totte@labs2.com>
16490
16491         * cs-tokenizer.cs: fixed a number of trim() issues.
16492
16493 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16494
16495         * expression.cs (Argument.Type): Ensure that we return the correct
16496         type when we have out or ref parameters [in which case we 
16497         append a "&"].
16498
16499 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16500
16501         * class.cs (Property, Indexer): Allow extern modifier in there. 
16502
16503         * typemanager.cs (InitBaseTypes): Initializes object_type and
16504         value_type, since those will be used early on during the bootstrap
16505         process to compile corlib.
16506
16507         (InitCoreTypes): Move code from here to InitBaseTypes.
16508
16509 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16510
16511         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16512         single-dimension arrays as using the ldlen opcode.  
16513
16514         Daniel Lewis discovered this optimization.  
16515
16516         * typemanager.cs: Add signature for System.Array::get_Length
16517
16518 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16519
16520         * statement.cs: report the error when the foreach does not apply to an
16521         array nor a collection.
16522
16523 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16524
16525         * expression.cs: Add implicit conversions to the operator ~.
16526
16527         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16528
16529         * typemanager.cs: Locate the decimal constructor.
16530
16531 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16532
16533         * attribute.cs: use the new property of TypeOf.
16534         * expression.cs: added 'get' property around typearg.
16535
16536         These changes fix a build breaker reported by NickD. Is this the
16537         correct way to fix?  If not, please, revert my changes and make it
16538         work :-).
16539
16540 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * attribute.cs: Add support for typeof in attribute invocations.
16543         I am not sure that this is right though.
16544
16545 2002-04-14  Duncan Mak  <duncan@ximian.com>
16546
16547         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16548         Binary.Operator.Division case.
16549
16550 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16551
16552         * class.cs (DefineType): Ensure that we do a proper check on
16553         attribute types and also register it with the TypeManager.
16554
16555         (TypeContainer.Targets): The default for attribute types is
16556         AttributeTargets.All.
16557
16558         * attribute.cs (ApplyAttributes): Registering the attribute type
16559         is done elsewhere, not when we discover we have a Usage attribute.
16560
16561 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16562
16563         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16564         and get rid of is_delegate parameter.
16565
16566         * everywhere : update.
16567
16568 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16569
16570         * cs-parser.jay (compilation_unit): Revamp completely to use
16571         some new ideas that I got from Rhys' grammar to solve the problems
16572         with assembly level attributes.
16573
16574         (outer_declaration): New grammar production.
16575
16576         (attribute_sections): Add.
16577
16578         (opt_attributes): Base on attribute_sections
16579
16580         (namespace_declaration): Allow opt_attributes to tackle the case
16581         when we have assembly level attributes - we are clever in this
16582         regard now ;-)
16583
16584         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16585         attributes in the non-global context.
16586
16587         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16588         instead of SetGlobalAttributes.
16589
16590         * class.cs, rootcontext.cs : Ensure we define and generate 
16591         attribute types before anything else.
16592
16593         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16594         and flag the new error -20 for the case when the attribute type
16595         does not have valid targets specified. csc does not catch this.
16596
16597         * ../errors/errors.txt : update for error # -20
16598
16599 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16600
16601         * support.cs (InternalParameters.ParameterModifier): Do some null
16602         checking and return sane values.
16603
16604         * class.cs (Method.Define): If we are a PInvoke method, ensure
16605         that we are static and extern. Report error # 601
16606
16607         * ../errors/cs0601.cs : Add test case for the above error.
16608
16609 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16610
16611         * rootcontext.cs (attribute_types): We need to keep type of
16612         all attribute types separately and emit code for them first.
16613
16614         (RegisterAttribute) : Implement.
16615
16616         * class.cs (DefineType): Check if the current Type is a custom
16617         attribute type and register it accordingly.
16618
16619         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16620         adding the first attribute twice and rename to
16621
16622         (SetGlobalAttributes): this.
16623
16624         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16625         lookups.
16626
16627         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16628         if we are processing global arguments. Hmm, I am unsure of this.
16629
16630 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16631
16632         * expression.cs: added static array of strings to avoid calling
16633         Enum.ToString () for Operator in Binary. Significant recover of
16634         performance.
16635
16636 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * class.cs (FindMembers): Allow the Builders of the various
16639         members to be null.  If they are skip them.  This only happens
16640         during the PInvoke declaration.
16641
16642 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16643
16644         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16645         failure, so we do not keep going afterwards.
16646
16647         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16648         wanted to pass `false' as the `is_delegate' argument.  If this is
16649         the case, why not use delegate_type == null to mean `is_delegate =
16650         false' and anything else as is_delegate = true.
16651
16652 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16653
16654         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16655         code for the section, not the beginning of the tests.
16656
16657 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16658
16659         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16660
16661         * expression.cs (Binary): same.  Warn about errors where we have
16662         Enum/Enum in operator + as well.
16663
16664 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16665
16666         * statement.cs:
16667                 - added support for switch(bool)
16668                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16669                 - add TableSwitchEmit() to handle table-based switch statements
16670
16671 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16672
16673         * expression.cs (Invocation.OverloadResolve): Factor out code which
16674         does parameter compatibility checking with arguments so that we can 
16675         re-use the code even from Delegate.VerifyApplicability
16676
16677         (VerifyArgumentsCompat): Move above code here.
16678
16679         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16680         and instead make a call to the above method.
16681
16682 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16683
16684         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16685         We use it to keep track of classes which are attribute types.
16686
16687 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16688
16689         * delegate.cs (Delegate.Define): Correctly define the types in the
16690         presence of fixed and array parameters.
16691
16692         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16693         doing FindMembers.
16694
16695         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16696         include NonPublic after the first iteration.
16697
16698         * class.cs (Indexer.CheckBase): Only check if both parents are
16699         non-null. 
16700
16701         * cs-parser.jay (accessor_body): If empty, set to null.
16702
16703         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16704         same code path here to resolve constants names that we did have in
16705         MemberAccess.DoResolve.  There is too much code duplicated here.
16706
16707 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16710
16711         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16712         to MakeUnionSet.
16713
16714         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16715         tokens, numbers and strings.
16716
16717         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16718         parenthesis.
16719
16720         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16721         asyncronous parameters and the regular parameters.  
16722
16723         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16724         specify the target directory.
16725
16726         * expression.cs: (This.DoResolve): Simplify
16727         (As.Emit): Optimize, do not generate IsInst if the expression is
16728         always of the given type.
16729
16730         (Is.DoResolve): Bug fix, we were reporting both always/never for
16731         the is expression.
16732
16733         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16734         creating too many unnecessary arrays.
16735
16736 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16737
16738         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16739         fields instead of rolling our own initializer.   Takes care of all
16740         implicit conversions, and drops unnecessary static checks/argument.
16741
16742 2002-03-31  Dick Porter  <dick@ximian.com>
16743
16744         * driver.cs: use the GetDirectories() return values properly, and
16745         use "/" as path separator.
16746
16747 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16748
16749         * expression.cs (Unary): Optimize - - expr into expr.
16750         (Binary): Optimize a + (-b) into a -b.
16751
16752         * codegen.cs (CodeGen): Made all methods static.
16753
16754 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16755
16756         * rootcontext.cs: 
16757
16758         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16759         TypeBuilder property.
16760
16761         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16762         instead. 
16763
16764         * tree.cs: Removed the various RecordXXXX, and replaced with a
16765         single RecordDecl.  Removed all the accessor methods, and just
16766         left a single access point Type 
16767
16768         * enum.cs: Rename DefineEnum to DefineType.
16769
16770         * decl.cs: New abstract method `DefineType' used to unify the
16771         Defines for Enumerations, Interfaces, TypeContainers and
16772         Delegates.
16773
16774         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16775         LookupBaseClasses method that used to live in class.cs and
16776         interface.cs here, and renamed to FindType.
16777
16778         * delegate.cs: Implement DefineType.  Take advantage of the
16779         refactored pattern for locating the parent builder without taking
16780         the parent_builder argument (which we know does not work if we are
16781         nested, and triggering a toplevel definition).
16782
16783 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16784
16785         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16786         accessibility of a member has changed during override and report
16787         an error if so.
16788
16789         * class.cs (Method.Define, Property.Define): Only complain on
16790         overrides if the method is private, any other accessibility is
16791         fine (and since we just checked the permission is the same, we are
16792         good to go).
16793
16794         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16795         and elif are processed always.  The other pre-processing
16796         directives are only processed if we are "taking" the path
16797
16798 2002-03-29  Martin Baulig  <martin@gnome.org>
16799
16800         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16801         current location is not Null.
16802
16803         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16804         a separate method so we can profile it.
16805
16806         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16807         `span.Seconds' are just seconds, but no minutes or hours.
16808         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16809
16810 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16811
16812         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16813         Remove the gratuitous set of Final:
16814
16815                                 // If an interface implementation, then we can set Final.
16816                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16817                                     implementing.DeclaringType.IsInterface)
16818                                         flags |= MethodAttributes.Final;
16819
16820         I do not know what I was smoking when I used that.
16821
16822
16823         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16824         step into fixing the name resolution issues for delegates and
16825         unifying the toplevel name resolution.
16826
16827 2002-03-28  Martin Baulig  <martin@gnome.org>
16828
16829         * class.cs (Method.Emit): If we have a symbol writer, call its
16830         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16831         tell it about the current method.
16832
16833         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16834         writer that we're going to emit the first byte of IL code for a new
16835         statement (a new source line).
16836         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16837         EmitContext.Mark() before emitting any code.
16838
16839         * location.cs (SymbolDocument): Return null when we're Null.
16840
16841         * statement.cs (Statement): Moved the `Location loc' variable here.
16842         (Statement.EmitBoolExpression): If we have a symbol writer, call
16843         ec.Mark() before emitting any code to tell it that we're at the
16844         beginning of a new statement.
16845         (StatementExpression): Added `Location' argument to the constructor.
16846         (Block): Added public readonly variable `StartLocation' and public
16847         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16848         (Block): Added constructor which takes a start and end location.
16849         (Block.SetEndLocation): New method. This sets the end location.
16850         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16851         local variables we create.
16852         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16853         each statement and do also mark the begin and end of the block.
16854
16855         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16856         tell it the current lexer.Location, use Location.Null for the end of the
16857         block.
16858         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16859         current block, set its end location using SetEndLocation().
16860         (statement_expression): StatementExpression constructor now takes the
16861         lexer.Location as additional argument.
16862         (for_statement, declare_local_variables): Likewise.
16863         (declare_local_variables): When creating a new implicit block, use the
16864         new Block constructor and pass it the lexer.Location.
16865
16866 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16869         members also on the parent interfaces recursively.
16870
16871 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16872
16873         * report.cs: Use new formats, since Gonzalo finished the missing
16874         bits. 
16875
16876         * expression.cs (Binary.ResolveOperator): added missing operator|
16877         operator& and operator^ for bool/bool.
16878
16879         * cs-parser.jay: CheckDef now takes a Location argument that is
16880         used to report errors more precisly (instead of reporting the end
16881         of a definition, we try to track something which is a lot closer
16882         to the source of the problem).
16883
16884         * cs-tokenizer.cs: Track global token use, so we can properly flag
16885         the use of #define/#undef after the first token has been seen.
16886
16887         Also, rename the reportXXXX to Error_DescriptiveName
16888
16889         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16890         TypeContainer, so that Enum and Interface can use this too.
16891
16892         * class.cs (TypeContainer.LookupInterfaceOrClass,
16893         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16894         `builder' argument.  Typically this was used to pass the parent
16895         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16896         the definition).  
16897
16898         The problem is that a nested class could trigger the definition of
16899         a toplevel class, and the builder would be obviously wrong in that
16900         case. 
16901
16902         So we drop this argument, and we compute dynamically the
16903         TypeBuilder/ModuleBuilder (the correct information was available
16904         to us anyways from DeclSpace.Parent)
16905
16906         * interface.cs (Interface.DefineInterface): Drop builder
16907         parameter cleanup like class.cs
16908
16909         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16910         like class.cs
16911
16912         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16913         values. 
16914
16915         (Try.Emit): Propagate the returns value from the statement.
16916
16917         (Return.Emit): Even if we are leavning 
16918
16919         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16920
16921         * modifiers.cs: Fix the computation of MethodAttributes flags.
16922
16923 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16924
16925         * driver.cs: allow compilation of files that start with '/'.
16926         Add a default case when checking the argument of --target.
16927
16928 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16929
16930         * interface.cs: Implement the same search algorithm for types in
16931         the interface code.
16932
16933         * delegate.cs: Do not allow multiple definition.
16934
16935         * Recovered ChangeLog that got accidentally amputated
16936
16937         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16938
16939         * rootcontext.cs: Load manually enum to allow core classes to
16940         contain enumerations.
16941
16942         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16943         Update to new static methods in TypeManager.
16944
16945         * typemanager.cs (GetMethod, GetConstructor): Use our
16946         implementation of FindMembers to find the members, since during
16947         corlib compilation, the types are TypeBuilders and GetMethod and
16948         GetConstructor do not work.
16949
16950         Make all methods in TypeManager static.
16951
16952         (InitCodeHelpers): Split the functionality from
16953         the InitCodeTypes function.
16954
16955         * driver.cs: Call InitCodeHelpers after we have populated the
16956         types. 
16957
16958         * cs-parser.jay (delegate_declaration): we did not used to compute
16959         the delegate name correctly for void delegates.
16960
16961 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16962
16963         * rootcontext.cs (RootContext): Init the interface_resolve_order
16964         and type_container_resolve_order always.
16965
16966         (ResolveCore, BootstrapCorlib_ResolveClass,
16967         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16968         compiler when compiling with --nostdlib
16969
16970         * class.cs (TypeContainer.DefineType): Check that our parent is
16971         not null.  This test is most important when we are bootstraping
16972         the core types.
16973
16974         * codegen.cs: Split out the symbol writing code.
16975
16976 2002-03-25  Martin Baulig  <martin@gnome.org>
16977
16978         * driver.cs (-g): Made -g an alias for --debug.
16979
16980 2002-03-24  Martin Baulig  <martin@gnome.org>
16981
16982         * codegen.cs (SymbolWriter): New public variable. Returns the
16983         current symbol writer.
16984         (CodeGen): Added `bool want_debugging_support' argument to the
16985          constructor. If true, tell the ModuleBuild that we want debugging
16986         support and ask it for the ISymbolWriter.
16987         (Save): If we have a symbol writer, call it's Close() method after
16988         saving the assembly.
16989
16990         * driver.c (--debug): New command line argument to create a
16991         debugger information file.
16992
16993         * location.cs (SymbolDocument): New public property. Returns an
16994         ISymbolDocumentWriter object for the current source file or null
16995         if we don't have a symbol writer.
16996
16997 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * driver.cs (LoadAssembly): Correctly return when all the paths
17000         have been tried and not before.
17001
17002         * statement.cs (Switch.Emit): return the actual coverage for this
17003         statement (returns/not-returns)
17004
17005         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17006         switch of the statement if we are the last switch section.  That
17007         kills two problems: try/catch problems (we used to emit an empty
17008         nop at the end) and switch statements where all branches would
17009         return. 
17010
17011 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17012
17013         * driver.cs: Add default assemblies (the equivalent to the
17014         Microsoft CSC.RSP file)
17015
17016         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17017         also update tokens_seen and set it to false.
17018
17019         * driver.cs: Implement --recurse for Mike.
17020
17021         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17022         correctly splitting out the paths.
17023
17024 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * interface.cs (Interface.PopulateProperty): Instead of using
17027         `parent' as the declaration space for the set parameters, use
17028         `this' 
17029
17030         * support.cs (InternalParameters): InternalParameters constructor
17031         takes a DeclSpace instead of a TypeContainer.
17032
17033         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17034         types are being initialized, load the address of it before calling
17035         the function.  
17036
17037         (New): Provide a mechanism to disable the generation of local
17038         value type temporaries when the caller will be providing us with
17039         an address to store it.
17040
17041         (ArrayCreation.EmitDynamicInitializers): Use it.
17042
17043 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17044
17045         * expression.cs (Invocation.EmitArguments): Only probe for array
17046         property if there is more than one argument.  Sorry about that.
17047
17048         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17049         empty param arrays.
17050
17051         * class.cs (Method.LabelParameters): Fix incorrect code path that
17052         prevented the `ParamArrayAttribute' from being applied to the
17053         params attribute.
17054
17055 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17056
17057         * support.cs (ReflectionParameters): Correctly compute whether the
17058         last argument is a params array.  Fixes the problem with
17059         string.Split ('a')
17060
17061         * typemanager.cs: Make the assemblies array always be non-null
17062         (empty, but non-null)
17063
17064         * tree.cs (RecordDecl): New function that abstracts the recording
17065         of names.  This reports error 101, and provides a pointer to the
17066         previous declaration.  Fixes a crash in the compiler.
17067
17068         * cs-parser.jay (constructor_declaration): Update to new grammar,
17069         and provide a constructor_body that can be empty.
17070
17071 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17072
17073         * driver.cs: Add support for --resources.
17074
17075         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17076         Make all types for the various array helper methods be integer.
17077
17078         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17079         CheckState to ConvCast.
17080
17081         (ConvCast): Now it takes a `checked' state argument, to avoid
17082         depending on the emit context for the conversion, and just using
17083         the resolve time setting.
17084
17085         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17086         instead of Invocation.EmitArguments.  We do not emit the original
17087         arguments, instead we emit those which have been converted to
17088         unsigned int expressions.
17089
17090         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17091
17092         * codegen.cs: ditto.
17093
17094         * expression.cs (LocalVariableReference): Drop the use of the
17095         Store function that depended on the variable index.
17096
17097         * statement.cs (VariableInfo): Drop the `Idx' property from this
17098         class, as this is not taking into account the indexes for
17099         temporaries tat we generate during the execution, getting the
17100         indexes wrong.
17101
17102         * class.cs: First emit class initializers, then call the parent
17103         constructor. 
17104
17105         * expression.cs (Binary): Fix opcode emision.
17106         (UnaryMutator.EmitCode): Support checked code generation
17107
17108         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17109         matches for events for both the Static and Instance scans,
17110         pointing to the same element.   Fix that.
17111
17112 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17113
17114         * rootcontext.cs (ResolveTree): Always set the
17115         interface_resolve_order, because nested interfaces will be calling
17116         into us.
17117
17118         * class.cs (GetInterfaceOrClass): Track the same resolution
17119         process used by TypeManager.LookupType.  This fixes the nested
17120         type lookups in class declarations (separate path from
17121         LookupType). 
17122
17123         (TypeContainer.DefineType): Also define nested interfaces.
17124         (TypeContainer.RegisterOrder): New public function used to
17125         register the order in which child interfaces need to be closed.
17126
17127         Nested interfaces need to be closed after their parents have been
17128         created. 
17129
17130         * interface.cs (InterfaceAttr): Put all the logic for computing
17131         the interface attribute here. 
17132
17133         (DefineInterface): Register our interface order with the
17134         RootContext or with the TypeContainer depending on the case.
17135
17136 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17137
17138         * cs-parser.jay: rework foreach statement to work with the new
17139         changes to the policy on SimpleNames.
17140
17141         * report.cs: support Stacktrace on warnings as well.
17142
17143         * makefile: drop --unsafe and /unsafe from the compile.
17144
17145 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17146
17147         * ecore.cs (StandardConversionExists): Modify to take an Expression
17148         as the first parameter. Ensure we do null -> reference type conversion
17149         checking.
17150
17151         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17152         temporary Expression objects.
17153
17154 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17155
17156         * interface.cs: workaround bug in method overloading resolution
17157         (there is already a bugzilla bug for it).
17158
17159 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17160
17161         We could also solve this problem by having a separate path for
17162         performing type lookups, instead of DoResolve, we could have a
17163         ResolveType entry point, and only participating pieces of the
17164         production (simplename, deref, array) would implement this. 
17165
17166         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17167         signal SimpleName to only resolve type names and not attempt to
17168         resolve anything else.
17169
17170         * expression.cs (Cast): Set the flag.
17171
17172         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17173
17174         * class.cs: Only report 108 if there is no `new' modifier.
17175
17176         * cs-parser.jay: rework foreach statement to work with the new
17177         changes to the policy on SimpleNames.
17178         
17179         * report.cs: support Stacktrace on warnings as well.
17180
17181         * makefile: drop --unsafe and /unsafe from the compile.
17182
17183 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17184
17185         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17186         lookups here, instead of doing that at parse time.  This means
17187         that our grammar will not introduce `LocalVariableReferences' as
17188         expressions at this point.  That solves the problem of code like
17189         this:
17190
17191         class X {
17192            static void Main ()
17193            { int X = 1;
17194             { X x = null }}}
17195
17196         This is only half the fix.  The full fix requires parameters to
17197         also be handled in this way.
17198
17199         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17200         makes the use more obvious of the DeclSpace.  The
17201         ec.TypeContainer.TypeBuilder is now only used to pull the
17202         TypeBuilder for it.
17203
17204         My theory is that I can get rid of the TypeBuilder completely from
17205         the EmitContext, and have typecasts where it is used (from
17206         DeclSpace to where it matters).  
17207
17208         The only pending problem is that the code that implements Aliases
17209         is on TypeContainer, and probably should go in DeclSpace.
17210
17211         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17212         lookups here, instead of doing that at parse time.  This means
17213         that our grammar will not introduce `LocalVariableReferences' as
17214         expressions at this point.  That solves the problem of code like
17215         this:
17216
17217         class X {
17218            static void Main ()
17219            { int X = 1;
17220             { X x = null }}}
17221
17222         This is only half the fix.  The full fix requires parameters to
17223         also be handled in this way.
17224
17225         * class.cs (Property.DefineMethod): When implementing an interface
17226         method, set newslot, when implementing an abstract method, do not
17227         set the flag (before we tried never setting it, or always setting
17228         it, which is the difference).
17229         (Indexer.DefineMethod): same.
17230         (Method.DefineMethod): same.
17231
17232         * ecore.cs: Only set the status used flag if we get back a Field.
17233
17234         * attribute.cs: Temporary hack, so Paolo can keep working.
17235
17236 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17237
17238         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17239         the unmanaged type in the case we have a MarshalAs attribute.
17240
17241         (Resolve): Handle the case when we are parsing the special MarshalAs
17242         attribute [we need to store the unmanaged type to use later]
17243
17244         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17245         MarshalAs Attribute.
17246
17247         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17248         on parameters and accordingly set the marshalling info.
17249
17250 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17251
17252         * class.cs: Optimizing slightly by removing redundant code after
17253         we switched to the `NoTypes' return value.
17254         (Property.DefineMethod): use NoTypes here too.
17255
17256         This fixes the bug I introduced in my last batch of changes.
17257
17258 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17259
17260         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17261
17262         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17263         Enums since those are types too. 
17264
17265         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17266
17267         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17268         thanks to a call during the lookup process.
17269
17270 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17271
17272         * statement.cs (Foreach): Lots of work to accomodate a particular
17273         kind of foreach statement that I had not kept in mind.  It is
17274         possible to have foreachs on classes that provide a GetEnumerator
17275         method that return objects that implement the "pattern" for using
17276         a foreach, there is no need to support GetEnumerator
17277         specifically. 
17278
17279         This is needed to compile nant.
17280
17281         * decl.cs: Only report 114 if the member is not `Finalize' and if
17282         the warning level is at least 2.
17283
17284         * class.cs: Moved the compare function from Method to
17285         MethodSignature. 
17286
17287         (MethodSignature.InheritableMemberSignatureCompare): Add new
17288         filter function that is used to extract inheritable methods from a
17289         class. 
17290
17291         (Method.Define): Use the new `inheritable_method_signature_filter'
17292         delegate
17293
17294         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17295         command. 
17296
17297 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17298
17299         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17300
17301         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17302
17303         * expression.cs: Pass location information to
17304         ConvertImplicitStandard. 
17305
17306         * class.cs: Added debugging code to track return values from
17307         interfaces. 
17308
17309 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17310
17311         * expression.cs (Is.DoResolve): If either side of the `is' is an
17312         interface, do not flag the warning.
17313
17314         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17315         for interfaces
17316
17317         * report.cs: Allow for --fatal to be used with --probe.
17318
17319         * typemanager.cs (NoTypes): Move the definition for the empty Type
17320         array here. 
17321
17322         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17323         properties. 
17324         (TypeContainer.DefineProxy): New function used to proxy to parent
17325         implementations when implementing interfaces.
17326         (TypeContainer.ParentImplements): used to lookup if our parent
17327         implements a public function that is required by an interface.
17328         (TypeContainer.VerifyPendingMethods): Hook this up.
17329
17330         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17331         `modules' and `assemblies' arraylists into arrays.  We only grow
17332         these are the very early start up of the program, so this improves
17333         the speedof LookupType (nicely measured).
17334
17335         * expression.cs (MakeByteBlob): Replaced unsafe code with
17336         BitConverter, as suggested by Paolo.
17337
17338         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17339         folding of string concatenation, but if either side is a string,
17340         and the other is not, then return null, and let the runtime use
17341         the concatenation on the string plus the object (using
17342         `Object.ToString'). 
17343
17344 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17345
17346         Constant Folding has been implemented now.
17347
17348         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17349         the error instead on types that are not supported in one's
17350         complement. 
17351
17352         * constant.cs (Constant and all children): New set of functions to
17353         perform implict and explicit conversions.
17354
17355         * ecore.cs (EnumConstant): Implement the new functions to perform
17356         conversion by proxying to the child expression.
17357
17358         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17359         own separate setting that can not be turned off from the command
17360         line using --unchecked or --checked and is only controlled using
17361         the checked/unchecked statements and expressions.  This setting is
17362         used by the constant folder to flag errors.
17363
17364         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17365         ConstantCheckState as well.   
17366
17367         During Resolve, they also have to flag the state, because the
17368         constant folder runs completely in the Resolve phase.
17369
17370         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17371         well.
17372
17373 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17374
17375         * cfold.cs: New file, this file contains the constant folder.
17376
17377         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17378         argument to track whether we are using the resulting address to
17379         load or store a value and provide better error messages. 
17380
17381         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17382         new AddressOf arguments.
17383
17384         * statement.cs (Foreach.EmitCollectionForeach): Update
17385
17386         * expression.cs (Argument.Emit): Call AddressOf with proper
17387         arguments to track usage.
17388
17389         (New.DoEmit): Call AddressOf with new arguments.
17390
17391         (Unary.Emit): Adjust AddressOf call.
17392
17393 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17394
17395         * cs-parser.jay (member_access): Change the case for pre-defined types
17396         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17397         this suggestion.
17398
17399         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17400         a method body.
17401
17402         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17403         essentially like methods and apply attributes like MethodImplOptions to them too.
17404
17405         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17406         not being null.
17407
17408         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17409         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17410         is the DeclSpace.
17411
17412         * Update code everywhere accordingly.
17413
17414         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17415
17416         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17417
17418 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17419
17420         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17421         try performing lookups against those instead of jumping straight into using
17422         the 'using' clauses.
17423
17424         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17425
17426         (LookupType): Perform lookups in implicit parents too.
17427
17428         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17429         sequence as RootContext.LookupType. 
17430
17431         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17432         the various cases of namespace lookups into this method.
17433
17434 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17435
17436         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17437         in positional arguments)
17438
17439         * class.cs (Operator): Update the AllowedModifiers to contain
17440         extern. 
17441
17442         * cs-parser.jay: Update operator declaration to allow for the
17443         operator body to be empty.
17444
17445         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17446         values. 
17447
17448 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17449
17450         * class.cs (Method.Emit): Label parameters.
17451
17452         * driver.cs: Return 1 or 0 as the program exit code.
17453
17454 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17455
17456         * expression.cs: Special case the `null' object when trying to
17457         auto-compute the type, as anything can be explicitly converted to
17458         that. 
17459
17460         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17461         spotting this Paolo.
17462
17463         (Expression.ImplicitNumericConversion): Perform comparissions of
17464         the type using the underlying type in the case of an enumeration
17465         rather than using the enumeration type for the compare.
17466
17467         Cope with the underlying == type case, which is not possible to
17468         catch before. 
17469
17470         (Expression.ConvertNumericExplicit): Perform comparissions of
17471         the type using the underlying type in the case of an enumeration
17472         rather than using the enumeration type for the compare.
17473
17474         * driver.cs: If the user does not supply an extension, assume .exe
17475
17476         * cs-parser.jay (if_statement): Rewrote so that we can track the
17477         location for the if statement.
17478
17479         * expression.cs (Binary.ConstantFold): Only concat strings when
17480         the operation is "+", not everything ;-)
17481
17482         * statement.cs (Statement.EmitBoolExpression): Take a location
17483         argument. 
17484         (If, While, Do): Track location.
17485
17486         * expression.cs (Binary.ResolveOperator): In the object + string
17487         case, I was missing a call to ConvertImplicit
17488
17489 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17490
17491         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17492         Location arguments. Ensure we use RootContext.LookupType to do our work
17493         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17494
17495         * interface.cs (PopulateMethod): Handle the type of the parameter being
17496         null gracefully.
17497
17498         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17499         have a params method with no fixed arguments and a call is made with no
17500         arguments.
17501
17502 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17503
17504         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17505         the verbatim-string-literal
17506
17507         * support.cs (InternalParameters.ParameterModifier): handle null
17508         fixed parameters.
17509         (InternalParameters.ParameterType): ditto.
17510
17511         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17512         duplicating the name of the variable parameter.
17513         (GetParameterByName): Fix bug where we were not looking up array
17514         paramters if they were the only present (thanks Paolo!).
17515         (GetParameterInfo): We only have an empty set of types if both
17516         fixed and array are set to null.
17517         (GetParameterInfo-idx): Handle FixedParameter == null
17518
17519         * cs-parser.jay: Handle the case where there is no catch
17520         statements (missing null test).
17521
17522 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * driver.cs (MainDriver): Be conservative on our command line
17525         handling.
17526
17527         Catch DirectoryNotFoundException when calling GetFiles.
17528
17529         (SplitPathAndPattern): Used to split the input specification into
17530         a path and a pattern that we can feed to Directory.GetFiles.
17531
17532 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * statement.cs (Fixed): Implement the last case of the Fixed
17535         statement (string handling).
17536
17537         * expression.cs (StringPtr): New class used to return a char * to
17538         a string;  Used by the Fixed statement.
17539
17540         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17541
17542         * expression.cs (Binary.ResolveOperator): Remove redundant
17543         MemberLookup pn parent type.
17544         Optimize union call, we do not need a union if the types are the same.
17545         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17546         type.
17547
17548         Specialize the use of MemberLookup everywhere, instead of using
17549         the default settings. 
17550
17551         (StackAlloc): Implement stackalloc keyword.
17552
17553         * cs-parser.jay: Add rule to parse stackalloc.
17554
17555         * driver.cs: Handle /h, /help, /?
17556
17557         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17558         before we supported unsafe code.
17559
17560         * makefile: add --unsafe to the self compilation of mcs.
17561
17562 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17563
17564         * expression.cs (PointerArithmetic): New class that is used to
17565         perform pointer arithmetic.
17566         (Binary.Resolve): Handle pointer arithmetic
17567         Handle pointer comparission.
17568         (ArrayPtr): Utility expression class that is used to take the
17569         address of an array.
17570
17571         (ElementAccess): Implement array access for pointers
17572
17573         * statement.cs (Fixed): Implement fixed statement for arrays, we
17574         are missing one more case before we are done.
17575
17576         * expression.cs (Indirection): Implement EmitAssign and set the
17577         ExprClass to Variable.  This allows pointer dereferences to be
17578         treated as variables, and to have values assigned to them.
17579
17580         * ecore.cs (Expression.StoreFromPtr): New utility function to
17581         store values dereferencing.
17582
17583 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17584
17585         * expression.cs (Binary.ResolveOperator): Ensure that we are
17586         not trying to operate on a void type - this fixes the reported
17587         bug.
17588
17589         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17590         the parent implementation is sealed.
17591
17592         * ../errors/cs0239.cs : Add.
17593
17594         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17595
17596         * typemanager.cs (unverifiable_code_type): Corresponds to 
17597         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17598         which have unsafe code in them.
17599
17600         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17601         unsafe context.
17602
17603 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17604
17605         * cs-tokenizer.cs: Add support for @"litreal strings"
17606
17607         Make tokenizer accept pre-processor directives
17608         on any column (remove the old C-like limitation). 
17609
17610         * rootcontext.cs (EmitCode): Emit any global attributes.
17611         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17612
17613         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17614
17615         * cs-parser.jay: Add support for global attributes.  
17616
17617 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17618
17619         * expression.cs (Indirection): New helper class.  Unary will
17620         create Indirection classes to be able to implement the
17621         IMemoryLocation interface on it.
17622
17623 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17624
17625         * cs-parser.jay (fixed_statement): reference the right statement.
17626
17627         * statement.cs (Fixed.Emit): Finish implementing the fixed
17628         statement for the &x case.
17629
17630 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17631
17632         * class.cs (Property.Define, Method.Define): Remove newslot when
17633         `implementing'.  
17634
17635         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17636         wrong.  NewSlot should only be used if the `new' keyword is present.
17637
17638         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17639         locating our system dir.  Sorry about this.
17640
17641 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * driver.cs (GetSystemDir): Compute correctly the location of our
17644         system assemblies.  I was using the compiler directory instead of
17645         the library directory.
17646
17647 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17648
17649         * expression.cs (BetterFunction): Put back in what Miguel commented out
17650         since it is the correct fix. The problem is elsewhere ;-)
17651
17652         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17653         parameters of the parms method are themselves compatible or not !
17654
17655         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17656         to check that a class implements an interface before saying that an implicit
17657         conversion was allowed. Use ImplementsInterface to do the checking.
17658
17659 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17660
17661         * class.cs (Method.Define): Track whether we are an explicit
17662         implementation or not.  And only call DefineMethodOverride if we
17663         are an explicit implementation.
17664
17665         (Property.DefineMethod): Ditto.
17666
17667 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17668
17669         * expression.cs (BetterFunction): Catch hideous bug which was
17670          preventing us from detecting ambiguous calls due to implicit casts i.e
17671         cs0121.
17672
17673 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17674
17675         * support.cs (Pair): Remove un-needed method.  I figured why I was
17676         getting the error in cs-parser.jay, the variable in a foreach loop
17677         is readonly, and the compiler does not really treat this as a variable.
17678
17679         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17680         instead of EQUALS in grammar.  
17681
17682         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17683
17684         * expression.cs (Unary.DoResolve): Check whether the argument is
17685         managed or not.
17686
17687 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17688
17689         * support.cs: Api for Pair to set a value.  Despite the fact that
17690         the variables are public the MS C# compiler refuses to compile
17691         code that accesses the field if the variable is part of a foreach
17692         statement. 
17693
17694         * statement.cs (Fixed): Begin implementation of the fixed
17695         statement.
17696
17697         (Block.AddVariable): Return the VariableInfo on success and null
17698         on failure instead of true/false. 
17699
17700         * cs-parser.jay (foreach): Catch errors on variables already
17701         defined (we were ignoring this value before) and properly unwind
17702         the block hierarchy
17703
17704         (fixed_statement): grammar for the fixed statement.
17705
17706 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17707
17708         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17709         pointer types to be incretemented.
17710
17711         (SizeOf): Implement.
17712
17713         * cs-parser.jay (pointer_member_access): Implement
17714         expr->IDENTIFIER production.
17715
17716         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17717         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17718         on safe contexts.
17719
17720         (Unary): Implement indirection.
17721
17722         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17723         use in non-unsafe context).
17724
17725         (SimpleName.DoResolve): Check for pointers in field access on safe
17726         contexts. 
17727
17728         (Expression.LoadFromPtr): Factor the load-indirect code in this
17729         function.  This was duplicated in UnboxCast and ParameterReference
17730
17731 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17732
17733         * expression.cs (ComposedCast): report an error if a pointer cast
17734         is used in a safe region.
17735
17736         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17737         pointer type casts in unsafe context.
17738
17739         * codegen.cs (EmitContext): Set up IsUnsafe.
17740
17741         * cs-parser.jay (non_expression_type): Add productions for pointer
17742         casts. 
17743
17744         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17745         code.  We should not use force into static mode if the method is
17746         not virtual.  Fixes bug in MIS
17747
17748         * statement.cs (Do.Emit, While.Emit, For.Emit,
17749         Statement.EmitBoolExpression): Add support to Do and While to
17750         propagate infinite loop as `I do return' semantics.
17751
17752         Improve the For case to also test for boolean constants.
17753
17754         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17755         to the list of attributes we can add.
17756
17757         Remove `EmitContext' argument.
17758
17759         * class.cs (Method.Define): Apply parameter attributes.
17760         (Constructor.Define): Apply parameter attributes.
17761         (MethodCore.LabelParameters): Move here the core of labeling
17762         parameters. 
17763
17764         * support.cs (ReflectionParameters.ParameterModifier,
17765         InternalParameters.ParameterModifier): Use IsByRef on the type and
17766         only return the OUT bit for these parameters instead of in/out/ref
17767         flags.
17768
17769         This is because I miss-understood things.  The ParameterInfo.IsIn
17770         and IsOut represent whether the parameter has the [In] and [Out]
17771         attributes set.  
17772
17773 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * ecore.cs (FieldExpr.Emit): Release temporaries.
17776
17777         * assign.cs (LocalTemporary.Release): new function.
17778
17779         * codegen.cs (EmitContext.GetTemporaryStorage,
17780         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17781         temporary storage.  Now we can "put back" localbuilders when we
17782         are done with them
17783
17784 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17785
17786         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17787         need to make a copy of the variable to generate verifiable code.
17788
17789 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17790
17791         * driver.cs: Compute dynamically the system directory.
17792
17793         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17794         Slower, but more generally useful.  Used by the abstract
17795         registering implementation. 
17796
17797         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17798         the rules for the special rule on Type/instances.  First check if
17799         we have the same name, and if so, try that special static path
17800         rather than the instance path.
17801
17802 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17805         for, while and if.
17806
17807         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17808         Enum, ValueType, Delegate or Array for non-corlib compiles.
17809
17810         * cs-tokenizer.cs: Catch long identifiers (645)
17811
17812         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17813         piece of code.
17814
17815         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17816         fix, we were returning too early, so we were not registering
17817         pending methods from abstract classes.
17818
17819         Do not register pending methods if the class is abstract.
17820
17821         * expression.cs (Conditional.DoResolve): Report circular implicit
17822         conversions when we neecd to compute it for conditional
17823         expressions. 
17824
17825         (Is.DoResolve): If the expression is always of the provided type,
17826         flag warning 183.  If the expression can not ever be of the
17827         provided type flag warning 184.
17828
17829         * class.cs: Catch 169 as well.
17830
17831         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17832         read. 
17833
17834 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17835
17836         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17837
17838 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17839
17840         * interface.cs: (PopulateMethod): Check for pointers being defined
17841         only if the unsafe context is active.
17842         (PopulateProperty): ditto.
17843         (PopulateIndexer): ditto.
17844
17845         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17846         specified.  If pointers are present, make sure that they are
17847         present in an unsafe context.
17848         (Constructor, Constructor.Define): ditto.
17849         (Field, Field.Define): ditto.
17850         (Property, Property.Define): ditto.
17851         (Event, Event.Define): ditto.
17852
17853         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17854         hashtable if there are classes or structs defined.
17855
17856         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17857         code, as the constant resolution moved.
17858
17859         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17860         the metadata, so we can flag error 133. 
17861
17862         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17863         pointer is being declared in an unsafe context.
17864
17865 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17866
17867         * modifiers.cs (Modifiers.Check): Require a Location argument.
17868         Report error 227 for Unsafe use.
17869
17870         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17871
17872         * statement.cs (For.Emit): If the test is null, then report that
17873         we do `return', as we wont reach anything afterwards.
17874
17875         (Switch.SwitchGoverningType): Track the expression that matched
17876         the conversion.
17877
17878         * driver.cs: Allow negative numbers as an error code to flag.
17879
17880         * cs-parser.jay: Handle 1551.
17881
17882         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17883
17884 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17885
17886         * cs-parser.jay: Report 1518 (type declaration can only contain
17887         class, struct, interface, enum or delegate)
17888
17889         (switch_label): Report 1523 (keywords `case' or `default' must
17890         preced code)
17891
17892         (opt_switch_sections): Report 1522 (empty switch)
17893
17894         * driver.cs: Report 1515 (response file specified multiple times)
17895         Report 1516 (Source file specified multiple times).
17896
17897         * expression.cs (Argument.Resolve): Signal 1510
17898
17899         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17900         access not allowed in static code)
17901
17902 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17903
17904         * typemanager.cs (IsPointerType): Utility method which we are going
17905         to need a lot.
17906
17907         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17908         the object type, so we take care of that.
17909
17910         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17911
17912         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17913         added to non-params parameters :-)
17914
17915         * typemanager.cs (CSharpName): Include 'void' type too. 
17916
17917         (void_ptr_type): Include in the set of core types.
17918
17919         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17920         duplicating code.
17921
17922         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17923         an unsafe context.
17924
17925         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17926         completely forgotten about it.
17927
17928 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17929
17930         * cs-parser.jay (pointer_type): Add. This begins our implementation
17931         of parsing rules for unsafe code.
17932
17933         (unsafe_statement): Implement.
17934
17935         (embedded_statement): Modify to include the above.
17936
17937         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17938
17939         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17940         if the current context is an unsafe one.
17941
17942         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17943         are handled differently, we need separate rules for them.
17944
17945         (local_variable_declaration): Update to use local_variable_pointer_type
17946         to allow variable declarations of unmanaged pointer types.
17947
17948         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17949         in unsafe contexts.
17950
17951         * ../errors/cs0214.cs : Add.
17952
17953 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17954
17955         * makefile: remove 'response' file when cleaning.
17956
17957 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17958
17959         * cs-parser.jay: Report 1524.
17960
17961 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * typemanager.cs (RegisterMethod): drop checking if we have
17964         registered this from here
17965
17966 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17967
17968         * class.cs (Method.EmitDestructor): Implement calling our base
17969         destructor. 
17970
17971         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17972         value of InFinally.
17973
17974         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17975         this routine and will wrap the call in a try/catch block.  Deal
17976         with the case.
17977
17978 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17979
17980         * ecore.cs (Expression.MemberLookup): instead of taking a
17981         parameter `same_type' that was used to tell whether we could
17982         access private members we compute our containing type from the
17983         EmitContext.
17984
17985         (FieldExpr): Added partial support for volatile fields.  This does
17986         not work for volatile fields exposed from assemblies, as I can not
17987         figure out how to extract the modreq from it.
17988
17989         Updated all the source files to use this.
17990
17991         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17992         because it is referenced by MemberLookup very often. 
17993
17994 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17995
17996         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17997         TypeBuilder.GetCustomAttributes to retrieve what we need.
17998
17999         Get rid of redundant default_member_attr_type as this is the same as
18000         default_member_type which already exists.
18001
18002         * interface.cs, attribute.cs : Update accordingly.
18003
18004 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18005
18006         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18007         work for TYpeBuilders though.  Ravi, can you please fix this?
18008
18009         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18010
18011         * expression.cs (Argument.Emit): Handle the case of ref objects
18012         being passed to ref functions;  
18013
18014         (ParameterReference.EmitLoad): Loads the content of the pointer
18015         without dereferencing.
18016
18017 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18018
18019         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18020
18021 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18022
18023         * class.cs (Indexer.DefineMethod): Incorporate the interface
18024         type in the name of the method if we are doing explicit interface
18025         implementation.
18026
18027         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18028
18029         (BetterConversion): Fix extremely trivial bug where we were referring to
18030         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18031         again !
18032
18033         * ../errors/bug16.cs : Add although we have fixed it.
18034
18035 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18036
18037         * expression.cs (BaseIndexer): Begin implementation.
18038
18039         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18040
18041         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18042         production directly to remove a shift/reduce, and implement
18043         explicit interface implementation.
18044
18045         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18046         after a floating point suffix.
18047
18048         * expression.cs (DoNumericPromotions): Improved the conversion for
18049         uint/uint.  If we have a constant, we avoid doing a typecast to a
18050         larger type.
18051
18052         * class.cs (Indexer): Implement explicit interface implementation
18053         for indexers.
18054
18055 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18056
18057         * class.cs: make the default instance constructor public and hidebysig.
18058
18059 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18060
18061         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18062         so we can call it from elsewhere.
18063
18064         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18065         we emit it internally if the class has a defined indexer; otherwise the user
18066         emits it by decorating the class definition with the DefaultMemberAttribute.
18067
18068         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18069         attribute is not used on a type which defines an indexer.
18070
18071         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18072         character when we skip whitespace.
18073
18074         * ../errors/cs0646.cs : Add.
18075
18076 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18077
18078         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18079         again. 
18080
18081         * makefile: Add practical target `mcs3.exe' which builds the third
18082         generation compiler. 
18083
18084         * expression.cs (New): Fix structures constructor calling.
18085
18086         * class.cs (Property, Method, Indexer): Emit Final flag on the
18087         method if we are an interface implementation and we are not
18088         abstract. 
18089
18090         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18091         whether this property is referencing a `base' method.
18092
18093         * expression.cs (Invocation.EmitCall): take an extra argument:
18094         is_base, this is used to determine whether the `call' or
18095         `callvirt' opcode should be used.
18096
18097
18098         * delegate.cs: update EmitCall.
18099
18100         * class.cs (Method.Define): Set NewSlot for the cases where we are
18101         not implementing an interface method.
18102
18103         (Property.Define): ditto.
18104
18105 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18106
18107         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18108         'r'.  Allows mcs to parse itself fully.
18109
18110 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18111
18112         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18113         of the number of initializers that require the InitializeArray method.
18114
18115         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18116         update the above field where necessary.
18117
18118         (MakeByteBlob): Update accordingly.
18119
18120         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18121         greater than 2.
18122
18123         (EmitDynamicInitializers): Update in accordance with the new optimization.
18124
18125         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18126         same OpCode applies.
18127
18128         * cs-parser.jay : Fix some glaring errors I introduced.
18129
18130 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18131
18132         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18133         so that we can check for name clashes there too.
18134
18135         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18136         for interface indexers.
18137
18138         * interfaces.cs (Define): Emit the default member attribute.
18139
18140         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18141         variable was being referred to while setting the value ;-)
18142
18143 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18144
18145         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18146         byte-by-byte information when we know the data is zero.
18147
18148         Make the block always a multiple of 4, because
18149         DefineInitializedData has a bug.
18150
18151         * assign.cs: Fix, we should assign from the temporary, not from
18152         the source. 
18153
18154         * expression.cs (MakeByteBlob): Fix my incorrect code.
18155
18156 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18157
18158         * typemanager.cs (EnumToUnderlying): This function is used to get
18159         the underlying type from an enumeration, because it does not
18160         always work. 
18161
18162         * constant.cs: Use the I4_S form for values between -128 and 127.
18163
18164         * statement.cs (Block.LookupLabel): Looks up a label.
18165         (Block): Drop support for labeled blocks.
18166
18167         (LabeledStatement): New kind of statement that represents a label
18168         only.
18169
18170         (Goto): Finally implement this bad boy.
18171
18172         * cs-parser.jay: Update to reflect new mechanism to implement
18173         labels.
18174
18175 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18176
18177         * codegen.cs (EmitContext.This): a codegen property that keeps the
18178         a single instance of this instead of creating many different this
18179         instances. 
18180
18181         * delegate.cs (Delegate.DoResolve): Update to use the property;
18182
18183         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18184
18185         * expression.cs (BaseAccess.DoResolve): Ditto.
18186
18187 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18188
18189         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18190         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18191
18192         (InitCoreTypes): Update accordingly.
18193
18194         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18195         so we can quickly store the state.
18196
18197         (ApplyAttributes): Set the correct implementation flags
18198         for InternalCall methods.
18199
18200 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18201
18202         * expression.cs (EmitCall): if a method is not virtual, then do
18203         not use callvirt on it.
18204
18205         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18206         user defined stuff) requires the use of stobj, which takes an
18207         address on the stack instead of an array and an index.  So emit
18208         the Ldelema operation for it.
18209
18210         (EmitStoreOpcode): Use stobj for valuetypes.
18211
18212         (UnaryMutator.EmitCode): Use the right 1 value depending on
18213         whether we are dealing with int64/uint64, float or doubles.
18214
18215         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18216         constructors that I implemented last night.
18217
18218         (Constructor.IsDefault): Fix to work properly for static
18219         constructors.
18220
18221         * cs-parser.jay (CheckDef): report method signature errors.
18222         Update error number 103 to be 132.
18223
18224         * decl.cs: New AdditionResult enumeration value: MethodExists.
18225         Although we do this check for methods later on in the semantic
18226         analysis, catching repeated default constructors is so easy that
18227         we catch these here. 
18228
18229         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18230         promotions code.
18231
18232         (ParameterReference.EmitAssign, Emit): handle
18233         bools as bytes.
18234
18235         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18236         (ArrayAccess.EmitStoreOpcode): ditto.
18237
18238         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18239
18240         * expression.cs (MakeByteBlob): Complete all the missing types
18241         (uint, short, ushort, byte, sbyte)
18242
18243         * class.cs: Only init instance field initializers on instance
18244         constructors. 
18245
18246         Rename `constructors' to instance_constructors. 
18247
18248         (TypeContainer.AddConstructor): Only add constructors to the list
18249         if it is not static.
18250
18251         Make sure that we handle default_static_constructor independently
18252         everywhere where we handle instance_constructors
18253
18254 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * class.cs: Do not lookup or create a base initializer for a
18257         static constructor.
18258
18259         (ConstructorInitializer.Resolve): use the proper type to lookup
18260         for constructors.
18261
18262         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18263
18264         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18265         in DeclSpace. 
18266
18267         * decl.cs: CloseType is now an virtual method, the default
18268         implementation just closes this type.
18269
18270 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18271
18272         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18273         to PreserveSig by default. Also emit HideBySig on such methods.
18274
18275         Basically, set the defaults to standard values.
18276
18277         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18278         argument, if candidate is better, it can't be worse than the best !
18279
18280         (Invocation): Re-write bits to differentiate between methods being
18281         applicable in their expanded form and their normal form - for params
18282         methods of course.
18283
18284         Get rid of use_standard everywhere as only standard conversions are allowed
18285         in overload resolution. 
18286
18287         More spec conformance.
18288
18289 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18290
18291         * driver.cs: Add --timestamp, to see where the compiler spends
18292         most of its time.
18293
18294         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18295         `this' in static code.
18296
18297         (SimpleName.DoResolve): Implement in terms of a helper function
18298         that allows static-references to be passed upstream to
18299         MemberAccess.
18300
18301         (Expression.ResolveWithSimpleName): Resolve specially simple
18302         names when called by MemberAccess to implement the special
18303         semantics. 
18304
18305         (Expression.ImplicitReferenceConversion): Handle conversions from
18306         Null to reference types before others, as Null's type is
18307         System.Object. 
18308
18309         * expression.cs (Invocation.EmitCall): Handle the special case of
18310         calling methods declared on a reference type from a ValueType
18311         (Base classes System.Object and System.Enum)
18312
18313         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18314         the left hand side is a TypeExpr, not on every enumeration. 
18315
18316         (Binary.Resolve): If types are reference types, then do a cast to
18317         object on operators != and == of both arguments.
18318
18319         * typemanager.cs (FindMembers): Extract instance and static
18320         members if requested.
18321
18322         * interface.cs (PopulateProperty): Use void_type instead of null
18323         as the return type for the setter method.
18324
18325         (PopulateIndexer): ditto.
18326
18327 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18328
18329         * support.cs (ReflectionParameters): Fix minor bug where we
18330         were examining the wrong parameter for the ParamArray attribute.
18331
18332         Cope with requests for the type of the parameter at position
18333         greater than the params parameter's. We now return the element
18334         type of the params array as that makes more sense.
18335
18336         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18337         accordingly as we no longer have to extract the element type
18338         ourselves.
18339
18340         (Invocation.OverloadResolve): Update.
18341
18342 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18343
18344         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18345         against IEnumerator, test whether the return value is a descendant
18346         of the IEnumerator interface.
18347
18348         * class.cs (Indexer.Define): Use an auxiliary method to implement
18349         the other bits of the method definition.  Begin support for
18350         explicit interface implementation.
18351
18352         (Property.DefineMethod): Use TypeManager.void_type instead of null
18353         for an empty return value.
18354
18355 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18358         dealing with a FieldExpr which is composed of a FieldBuilder, in
18359         the code path we did extract the constant, but we should have
18360         obtained the underlying value to be able to cast it (otherwise we
18361         end up in an infinite loop, this is what Ravi was running into).
18362
18363         (ArrayCreation.UpdateIndices): Arrays might be empty.
18364
18365         (MemberAccess.ResolveMemberAccess): Add support for section
18366         14.5.4.1 that deals with the special case of E.I when E is a type
18367         and something else, that I can be a reference to a static member.
18368
18369         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18370         handle a particular array type to create byte blobs, it is just
18371         something we dont generate byteblobs for.
18372
18373         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18374         arguments. 
18375
18376         * location.cs (Push): remove the key from the hashtable that we
18377         are about to add.   This happens for empty files.
18378
18379         * driver.cs: Dispose files after we have parsed them.
18380
18381         (tokenize): new function that only runs the tokenizer on its
18382         input, for speed testing.
18383
18384 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18385
18386         * class.cs (Event.Define): Define the private field only if there
18387         are no accessors defined.
18388
18389         * expression.cs (ResolveMemberAccess): If there is no associated
18390         field with the event, that means we have an event defined with its
18391         own accessors and we should flag error cs0070 since transforming
18392         ourselves into a field is not valid in that case.
18393
18394         * ecore.cs (SimpleName.DoResolve): Same as above.
18395
18396         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18397         and charset to sane values.
18398
18399 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18400
18401         * assign.cs (DoResolve): Perform check on events only if they 
18402         are being accessed outside the declaring type.
18403
18404         * cs-parser.jay (event_declarations): Update rules to correctly
18405         set the type of the implicit parameter etc.
18406
18407         (add_accessor, remove_accessor): Set current local parameters.
18408
18409         * expression.cs (Binary): For delegate addition and subtraction,
18410         cast the return value from the method into the appropriate delegate
18411         type.
18412
18413 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18414
18415         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18416         of these as the workaround is unnecessary.
18417
18418         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18419         delegate data - none of that is needed at all.
18420
18421         Re-write bits to extract the instance expression and the delegate method
18422         correctly.
18423
18424         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18425         on delegates too.
18426
18427         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18428         of attaching attributes instead of duplicating code everywhere.
18429
18430         * everywhere : Update code to do attribute emission using the above method.
18431
18432 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18433
18434         * expression.cs (IsParamsMethodApplicable): if there are not
18435         parameters, return immediately.
18436
18437         * ecore.cs: The 0 literal can be implicity converted to an enum
18438         type. 
18439
18440         (SimpleName.DoResolve): First lookup the type, then lookup the
18441         members. 
18442
18443         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18444         want to get its address.  If the InstanceExpression is not
18445         addressable, store the result in a temporary variable, then get
18446         the address of it.
18447
18448         * codegen.cs: Only display 219 errors on warning level or above. 
18449
18450         * expression.cs (ArrayAccess): Make it implement the
18451         IMemoryLocation interface.
18452
18453         (Binary.DoResolve): handle the operator == (object a, object b)
18454         and operator != (object a, object b) without incurring into a
18455         BoxedCast (because 5 != o should never be performed).
18456
18457         Handle binary enumerator operators.
18458
18459         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18460         value type, otherwise use Ldelem_ref.
18461
18462         Use precomputed names;
18463
18464         (AddressOf): Implement address of
18465
18466         * cs-parser.jay (labeled_statement): Fix recursive block
18467         addition by reworking the production.
18468
18469         * expression.cs (New.DoEmit): New has a special case:
18470                 
18471                  If we are dealing with a ValueType, we have a few
18472                  situations to deal with:
18473                 
18474                     * The target of New is a ValueType variable, that is
18475                       easy, we just pass this as the variable reference
18476                 
18477                     * The target of New is being passed as an argument,
18478                       to a boxing operation or a function that takes a
18479                       ValueType.
18480                 
18481                       In this case, we need to create a temporary variable
18482                       that is the argument of New.
18483
18484
18485 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18486
18487         * rootcontext.cs (LookupType): Check that current_type is not null before
18488         going about looking at nested types.
18489
18490         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18491         not implement the IAssignMethod interface any more.
18492
18493         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18494         where we tranform them into FieldExprs if they are being resolved from within
18495         the declaring type.
18496
18497         * ecore.cs (SimpleName.DoResolve): Do the same here.
18498
18499         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18500
18501         * ../errors/bug10.cs : Add.
18502
18503         * ../errors/cs0070.cs : Add.
18504
18505         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18506
18507         * assign.cs : Get rid of EventIsLocal everywhere.
18508
18509 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18510
18511         * ecore.cs (ConvertIntLiteral): finished the implementation.
18512
18513         * statement.cs (SwitchLabel): Convert the value we are using as a
18514         key before looking up the table.
18515
18516 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18517
18518         * codegen.cs (EmitTopBlock): Require a Location argument now.
18519
18520         * cs-parser.jay (constructor_declarator): We need to setup
18521         current_local_parameters before we parse the
18522         opt_constructor_initializer, to allow the variables to be bound
18523         to the constructor arguments.
18524
18525         * rootcontext.cs (LookupType): First lookup nested classes in our
18526         class and our parents before we go looking outside our class.
18527
18528         * expression.cs (ConstantFold): Extract/debox the values at the
18529         beginnning. 
18530
18531         * rootcontext.cs (EmitCode): Resolve the constants first before we
18532         resolve the types.  This is not really needed, but it helps debugging.
18533
18534         * statement.cs: report location.
18535
18536         * cs-parser.jay: pass location to throw statement.
18537
18538         * driver.cs: Small bug fix.
18539
18540         * report.cs: Updated format to be 4-zero filled digits.
18541
18542 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18543
18544         * expression.cs (CheckIndices): Fix minor bug where the wrong
18545         variable was being referred to ;-)
18546
18547         (DoEmit): Do not call EmitStaticInitializers when the 
18548         underlying type is System.Object.
18549
18550 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18551
18552         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18553         and do the usual workaround for SRE.
18554
18555         * class.cs (MyEventBuilder.EventType): New member to get at the type
18556         of the event, quickly.
18557
18558         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18559
18560         * assign.cs (Assign.DoResolve): Handle the case when the target
18561         is an EventExpr and perform the necessary checks.
18562
18563         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18564         interface.
18565
18566         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18567
18568         (EventExpr): Set the type in the constructor itself since we 
18569         are meant to be born fully resolved.
18570
18571         (EventExpr.Define): Revert code I wrote earlier.
18572                 
18573         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18574         instance expression is null. The instance expression is a This in that case
18575         or a null, depending on whether it is a static method or not.
18576
18577         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18578         refers to more than one method.
18579
18580         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18581         and accordingly flag errors.
18582
18583 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18586
18587 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * location.cs (ToString): Provide useful rutine.
18590
18591 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18592
18593         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18594         objects, return the actual integral boxed.
18595
18596         * statement.cs (SwitchLabel): define an ILLabel for each
18597         SwitchLabel. 
18598
18599         (Switch.CheckSwitch): If the value is a Literal, extract
18600         the underlying literal.
18601
18602         Also in the unused hashtable we had, add the SwitchLabel so we can
18603         quickly look this value up.
18604
18605         * constant.cs: Implement a bunch of new constants.  Rewrite
18606         Literal based on this.  Made changes everywhere to adapt to this.
18607
18608         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18609         dereferencing array only once, and also copes with enumrations.
18610
18611         bytes are two bytes wide, not one.
18612
18613         (Cast): Perform constant conversions.
18614
18615         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18616         wrappers to the literals here.
18617
18618         * expression.cs (DoNumericPromotions): long literals can converted
18619         to ulong implicity (this is taken care of elsewhere, but I was
18620         missing this spot).
18621
18622         * ecore.cs (Expression.Literalize): Make the return type Literal,
18623         to improve type checking.
18624
18625         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18626
18627 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * literal.cs: Revert code from ravi that checked the bounds.  The
18630         bounds are sane by the definition of the type itself. 
18631
18632         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18633         need to actually look up in our parent hierarchy for interfaces
18634         implemented. 
18635
18636         * const.cs: Use the underlying type for enumerations
18637
18638         * delegate.cs: Compute the basename for the delegate creation,
18639         that should fix the delegate test case, and restore the correct
18640         Type Lookup semantics in rootcontext
18641
18642         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18643         referencing a nested type with the Reflection API is using the "+"
18644         sign. 
18645
18646         * cs-parser.jay: Do not require EOF token at the end.
18647
18648 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18649
18650         * rootcontext.cs (LookupType): Concatenate type names with
18651         a '.' instead of a '+' The test suite passes again.
18652
18653         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18654         field of the enumeration.
18655
18656         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18657         the case when the member is an EventExpr.
18658
18659         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18660         static has an associated instance expression.
18661
18662         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18663
18664         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18665
18666         * class.cs (Event.Define): Register event and perform appropriate checks
18667         for error #111.
18668
18669         We define the Add and Remove methods even if the use provides none because
18670         in that case, we provide default implementations ourselves.
18671
18672         Define a private field of the type of the event. This is done by the CSC compiler
18673         and we should be doing it too ;-)
18674
18675         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18676         More methods we use in code we generate.
18677
18678         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18679         is important.
18680
18681         (InitCoreTypes): Update accordingly for the above.
18682
18683         * class.cs (Event.Emit): Generate code for default accessors that we provide
18684
18685         (EmitDefaultMethod): Do the job in the above.
18686
18687         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18688         appropriate place.
18689
18690 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18691
18692         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18693         builders even if we were missing one.
18694
18695         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18696         pass the Basename as our class name instead of the Name.  The
18697         basename will be correctly composed for us.
18698
18699         * parameter.cs (Paramters): Now takes a Location argument.
18700
18701         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18702         make all the code call directly LookupType in RootContext and take
18703         this chance to pass the Location information everywhere.
18704
18705         * Everywhere: pass Location information.
18706
18707 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * class.cs (Constructor.Define): Updated way of detecting the
18710         length of the parameters.
18711
18712         (TypeContainer.DefineType): Use basename as the type name for
18713         nested types.
18714
18715         (TypeContainer.Define): Do not recursively define types here, as
18716         definition is taken care in order by the RootContext.
18717
18718         * tree.cs: Keep track of namespaces in a per-file basis.
18719
18720         * parameter.cs (Parameter.ComputeSignature): Update to use
18721         DeclSpace. 
18722
18723         (Parameters.GetSignature): ditto.
18724
18725         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18726         instead of a TypeContainer.
18727
18728         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18729         resolve names.  Because we need to be resolve in our context, not
18730         our parents.
18731
18732         * driver.cs: Implement response files.
18733
18734         * class.cs (TypeContainer.DefineType): If we are defined, do not
18735         redefine ourselves.
18736
18737         (Event.Emit): Emit the code for add/remove handlers.
18738         (Event.Define): Save the MethodBuilders for add/remove.
18739
18740         * typemanager.cs: Use pair here too.
18741
18742         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18743         DictionaryEntry requires the first argument to be non-null.  
18744
18745         (enum_declaration): Compute full name for registering the
18746         enumeration.
18747
18748         (delegate_declaration): Instead of using
18749         formal_parameter_list, use opt_formal_parameter_list as the list
18750         can be empty.
18751
18752         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18753         (EventParsing): New property that controls whether `add' and
18754         `remove' are returned as tokens or identifiers (for events);
18755
18756 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18757
18758         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18759         use MyEventBuilder only and let it wrap the real builder for us.
18760
18761         (MyEventBuilder): Revamp constructor etc.
18762
18763         Implement all operations that we perform on EventBuilder in precisely the same
18764         way here too.
18765
18766         (FindMembers): Update to use the EventBuilder member.
18767
18768         (Event.Emit): Update accordingly.
18769
18770 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18771
18772         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18773         by calling the appropriate methods.
18774
18775         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18776         useful.
18777
18778         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18779
18780 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18781
18782         * delegate.cs (Delegate.Populate): Check that the return type
18783         and various parameters types are indeed accessible.
18784
18785         * class.cs (Constructor.Define): Same here.
18786
18787         (Field.Define): Ditto.
18788
18789         (Event.Define): Ditto.
18790
18791         (Operator.Define): Check that the underlying Method defined itself
18792         correctly - so it's MethodBuilder should not be null.
18793
18794         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18795         expression happens to be null.
18796
18797         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18798         members but as of now we don't seem to be able to do anything really useful with it.
18799
18800         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18801         not the EventBuilder.
18802
18803 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18804
18805         * cs-tokenizer.cs: Add support for defines.
18806         Add support for #if, #elif, #else, #endif
18807
18808         (eval_var): evaluates a variable.
18809         (eval): stubbed for evaluating functions.
18810
18811         * cs-parser.jay: Pass the defines information
18812
18813         * driver.cs: Add --define command line option.
18814
18815         * decl.cs: Move MemberCore here.
18816
18817         Make it the base class for DeclSpace.  This allows us to catch and
18818         report 108 and 109 for everything now.
18819
18820         * class.cs (TypeContainer.Define): Extract all the members
18821         before populating and emit the warning 108 (new keyword required
18822         to override) instead of having each member implement this.
18823
18824         (MemberCore.Define): New abstract method, we will be using this in
18825         the warning reporting engine in Populate.
18826
18827         (Operator.Define): Adjust to new MemberCore protocol. 
18828
18829         * const.cs (Const): This does not derive from Expression, it is a
18830         temporary object we use to create fields, it is a MemberCore. 
18831
18832         * class.cs (Method.Define): Allow the entry point to be in a
18833         specific class.
18834
18835         * driver.cs: Rewrite the argument handler to clean it up a bit.
18836
18837         * rootcontext.cs: Made it just an auxiliary namespace feature by
18838         making everything static.
18839
18840         * driver.cs: Adapt code to use RootContext type name instead of
18841         instance variable.
18842
18843         * delegate.cs: Remove RootContext argument.
18844
18845         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18846         argument. 
18847
18848         * class.cs (Event.Define): The lookup can fail.
18849
18850         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18851
18852         * expression.cs: Resolve the this instance before invoking the code.
18853
18854 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * cs-parser.jay: Add a production in element_access that allows
18857         the thing to become a "type" reference.  This way we can parse
18858         things like "(string [])" as a type.
18859
18860         Note that this still does not handle the more complex rules of
18861         casts. 
18862
18863
18864         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18865
18866         * ecore.cs: (CopyNewMethods): new utility function used to
18867         assemble the list of methods from running FindMembers.
18868
18869         (MemberLookup): Rework FindMembers so that 
18870
18871 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18872
18873         * class.cs (TypeContainer): Remove Delegates who fail to be
18874         defined.
18875
18876         * delegate.cs (Populate): Verify that we dont get null return
18877         values.   TODO: Check for AsAccessible.
18878
18879         * cs-parser.jay: Use basename to emit error 574 (destructor should
18880         have the same name as container class), not the full name.
18881
18882         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18883         possible representation.  
18884
18885         Also implements integer type suffixes U and L.
18886
18887 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18888
18889         * expression.cs (ArrayCreation.DoResolve): We need to do the
18890         argument resolution *always*.
18891
18892         * decl.cs: Make this hold the namespace.  Hold the root context as
18893         well.
18894         (LookupType): Move here.
18895
18896         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18897
18898         * location.cs (Row, Name): Fixed the code, it was always returning
18899         references to the first file.
18900
18901         * interface.cs: Register properties defined through interfaces.
18902
18903         * driver.cs: Add support for globbing on the command line
18904
18905         * class.cs (Field): Make it derive from MemberCore as well.
18906         (Event): ditto.
18907
18908 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18909
18910         * class.cs (Event::Define): Check that the type of the event is a delegate
18911         type else flag error #66.
18912
18913         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18914         same.
18915
18916         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18917         values of EntryPoint, CharSet etc etc.
18918
18919         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18920
18921         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18922         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18923         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18924         which needs this to do its work.
18925
18926         * ../errors/cs0066.cs : Add.
18927
18928 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18929
18930         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18931         helper functions.
18932
18933         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18934         clears out the parameters field.
18935         (MemberSignatureCompare): Cleanup
18936
18937         (MemberCore): New base class used to share code between MethodCore
18938         and Property.
18939
18940         (RegisterRequiredImplementations) BindingFlags.Public requires
18941         either BindingFlags.Instace or Static.  Use instance here.
18942
18943         (Property): Refactored code to cope better with the full spec.
18944
18945         * parameter.cs (GetParameterInfo): Return an empty array instead
18946         of null on error.
18947
18948         * class.cs (Property): Abstract or extern properties have no bodies.
18949
18950         * parameter.cs (GetParameterInfo): return a zero-sized array.
18951
18952         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18953         method modifier validation to the typecontainer so we can reuse
18954         this on properties.
18955
18956         (MethodCore.ParameterTypes): return an empty sized array of types.
18957
18958         (Property.Define): Test property modifier validity.
18959
18960         Add tests for sealed/override too.
18961
18962         (Method.Emit): abstract or extern methods have no bodies.
18963
18964 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18965
18966         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18967         thing.
18968
18969         (Method::Define, ::Emit): Modify accordingly.
18970
18971         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18972
18973         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18974
18975         * makefile: Pass in /unsafe.
18976
18977 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * class.cs (MakeKey): Kill routine.
18980
18981         * class.cs (TypeContainer.Define): Correctly define explicit
18982         method implementations (they require the full interface name plus
18983         the method name).
18984
18985         * typemanager.cs: Deply the PtrHashtable here and stop using the
18986         lame keys.  Things work so much better.
18987
18988         This of course broke everyone who depended on `RegisterMethod' to
18989         do the `test for existance' test.  This has to be done elsewhere.
18990
18991         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18992         the object stupid Equals method (because, that like fails all over
18993         the place).  We still do not use it.
18994
18995         * class.cs (TypeContainer.SetRequiredInterface,
18996         TypeContainer.RequireMethods): Killed these two routines and moved
18997         all the functionality to RegisterRequiredImplementations.
18998
18999         (TypeContainer.RegisterRequiredImplementations): This routine now
19000         registers all the implementations required in an array for the
19001         interfaces and abstract methods.  We use an array of structures
19002         which can be computed ahead of time to reduce memory usage and we
19003         also assume that lookups are cheap as most classes will not
19004         implement too many interfaces.
19005
19006         We also avoid creating too many MethodSignatures.
19007
19008         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19009         clear the "pending" bit if we find that there are problems with
19010         the declaration.
19011
19012         (TypeContainer.VerifyPendingMethods): Update to report errors of
19013         methods that look like implementations but are not.
19014
19015         (TypeContainer.Define): Add support for explicit interface method
19016         implementation. 
19017
19018 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19019
19020         * typemanager.cs: Keep track of the parameters here instead of
19021         being a feature of the TypeContainer.
19022
19023         * class.cs: Drop the registration of parameters here, as
19024         InterfaceMethods are also interface declarations.
19025
19026         * delegate.cs: Register methods with the TypeManager not only with
19027         the TypeContainer.  This code was buggy.
19028
19029         * interface.cs: Full registation here.
19030
19031 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19032
19033         * expression.cs: Remove reducer for binary expressions, it can not
19034         be done this way.
19035
19036         * const.cs: Put here the code that used to go into constant.cs
19037
19038         * constant.cs: Put here the code for constants, this is a new base
19039         class for Literals.
19040
19041         * literal.cs: Make Literal derive from Constant.
19042
19043 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * statement.cs (Return.Emit): Report error 157 if the user
19046         attempts to return from a finally block.
19047
19048         (Return.Emit): Instead of emitting a return, jump to the end of
19049         the function.
19050
19051         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19052         LocalBuilder to store the result of the function.  ReturnLabel is
19053         the target where we jump.
19054
19055
19056 2001-12-09  Radek Doulik  <rodo@ximian.com>
19057
19058         * cs-parser.jay: remember alias in current namespace
19059
19060         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19061         namespaces
19062
19063         * class.cs (LookupAlias): lookup alias in my_namespace
19064
19065         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19066         aliases hashtable
19067         (LookupAlias): lookup alias in this and if needed in parent
19068         namespaces
19069
19070 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19071
19072         * support.cs: 
19073
19074         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19075         making things static.  I need this to avoid passing the
19076         TypeContainer when calling ParameterType.
19077
19078         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19079         that did string manipulation to compute the type and then call
19080         GetType.  Use Parameter.ParameterType instead.
19081
19082         * cs-tokenizer.cs: Consume the suffix for floating values.
19083
19084         * expression.cs (ParameterReference): figure out whether this is a
19085         reference parameter or not.  Kill an extra variable by computing
19086         the arg_idx during emission.
19087
19088         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19089         function that returns whether a parameter is an out/ref value or not.
19090
19091         (Parameter.ParameterType): The type of the parameter (base,
19092         without ref/out applied).
19093
19094         (Parameter.Resolve): Perform resolution here.
19095         (Parameter.ExternalType): The full type (with ref/out applied).
19096
19097         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19098         support for expressions on the using statement.
19099
19100 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * statement.cs (Using.EmitLocalVariableDecls): Split the
19103         localvariable handling of the using statement.
19104
19105         (Block.EmitMeta): Keep track of variable count across blocks.  We
19106         were reusing slots on separate branches of blocks.
19107
19108         (Try.Emit): Emit the general code block, we were not emitting it. 
19109
19110         Check the type of the declaration to be an IDisposable or
19111         something that can be implicity converted to it. 
19112
19113         Emit conversions if required.
19114
19115         * ecore.cs (EmptyExpression): New utility class.
19116         (Expression.ImplicitConversionExists): New utility function.
19117
19118 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19119
19120         * statement.cs (Using): Implement.
19121
19122         * expression.cs (LocalVariableReference): Support read only variables.
19123
19124         * statement.cs: Remove the explicit emit for the Leave opcode.
19125         (VariableInfo): Add a readonly field.
19126
19127 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19128
19129         * ecore.cs (ConvCast): new class used to encapsulate the various
19130         explicit integer conversions that works in both checked and
19131         unchecked contexts.
19132
19133         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19134         properly generate the overflow opcodes.
19135
19136 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * statement.cs: The correct type for the EmptyExpression is the
19139         element_type, not the variable type.  Ravi pointed this out.
19140
19141 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19142
19143         * class.cs (Method::Define): Handle PInvoke methods specially
19144         by using DefinePInvokeMethod instead of the usual one.
19145
19146         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19147         above to do the task of extracting information and defining the method.
19148
19149 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19150
19151         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19152         of the condition for string type.
19153
19154         (Emit): Move that here. 
19155
19156         (ArrayCreation::CheckIndices): Keep string literals in their expression
19157         form.
19158
19159         (EmitDynamicInitializers): Handle strings appropriately.
19160
19161 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19162
19163         * codegen.cs (EmitContext): Replace multiple variables with a
19164         single pointer to the current Switch statement.
19165
19166         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19167         EmitContext.
19168
19169 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * statement.cs 
19172
19173         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19174         default'.
19175
19176         (Foreach.Emit): Foreach on arrays was not setting
19177         up the loop variables (for break/continue).
19178
19179         (GotoCase): Semi-implented.
19180
19181 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19182
19183         * attribute.cs (CheckAttribute): Handle system attributes by using
19184         Attribute.GetAttributes to examine information we need.
19185
19186         (GetValidPlaces): Same here.
19187
19188         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19189
19190         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19191
19192         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19193
19194         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19195
19196         (Method::Emit): Handle the case when we are a PInvoke method.
19197
19198 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19199
19200         * expression.cs: Use ResolveWithSimpleName on compound names.
19201
19202 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19203
19204         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19205         before trying to reduce it.
19206
19207         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19208
19209         * constant.cs (LookupConstantValue): Implement.
19210
19211         (EmitConstant): Use the above in emitting the constant.
19212
19213         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19214         that are user-defined by doing a LookupConstantValue on them.
19215
19216         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19217         too, like above.
19218
19219 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19220
19221         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19222
19223         (BaseAccess.DoResolve): Implement.
19224
19225         (MemberAccess.DoResolve): Split this routine into a
19226         ResolveMemberAccess routine that can be used independently
19227
19228 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19229
19230         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19231         As that share bits of the implementation.  Is returns a boolean,
19232         while As returns the Type that is being probed.
19233
19234 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19235
19236         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19237         instead of a Literal - much easier.
19238
19239         (EnumInTransit): Remove - utterly useless :-)
19240
19241         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19242
19243         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19244
19245         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19246         chain when we have no associated expression.
19247
19248 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19249
19250         * constant.cs (Define): Use Location while reporting the errror.
19251
19252         Also emit a warning when 'new' is used and there is no inherited
19253         member to hide.
19254
19255         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19256         populated.
19257
19258         (LookupEnumValue): Implement to lookup an enum member's value and define it
19259         if necessary.
19260
19261         (Populate): Re-write accordingly to use the above routine.
19262
19263 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19264
19265         * expression.cs (This): Fix prototype for DoResolveLValue to
19266         override the base class DoResolveLValue.
19267
19268         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19269         declarations) 
19270
19271         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19272         (we need to load the address of the field here).  This fixes
19273         test-22. 
19274
19275         (FieldExpr.DoResolveLValue): Call the DoResolve
19276         function to initialize the Instance expression.
19277
19278         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19279         correctly the GetEnumerator operation on a value type.
19280
19281         * cs-parser.jay: Add more simple parsing error catches.
19282
19283         * statement.cs (Switch): Add support for string switches.
19284         Handle null specially.
19285
19286         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19287
19288 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19289
19290         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19291
19292         (declare_local_constant): New helper function.
19293
19294         * statement.cs (AddConstant): Keep a separate record of constants
19295
19296         (IsConstant): Implement to determine if a variable is a constant.
19297
19298         (GetConstantExpression): Implement.
19299
19300         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19301
19302         * statement.cs (IsVariableDefined): Re-write.
19303
19304 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19305
19306         * class.cs (TypeContainer::FindMembers): Look for constants
19307         in the case when we are looking for MemberTypes.Field
19308
19309         * expression.cs (MemberAccess::DoResolve): Check that in the
19310         case we are a FieldExpr and a Literal, we are not being accessed
19311         by an instance reference.
19312
19313         * cs-parser.jay (local_constant_declaration): Implement.
19314
19315         (declaration_statement): Implement for constant declarations.
19316
19317 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * statement.cs (Switch): Catch double defaults.
19320
19321         (Switch): More work on the switch() statement
19322         implementation.  It works for integral values now, need to finish
19323         string support.
19324
19325
19326 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19327
19328         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19329         integer literals into other integer literals.  To be used by
19330         switch. 
19331
19332 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19333
19334         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19335         some memory.
19336
19337         (EmitDynamicInitializers): Cope with the above since we extract data
19338         directly from ArrayData now.
19339
19340         (ExpectInitializers): Keep track of whether initializers are mandatory
19341         or not.
19342
19343         (Bounds): Make it a hashtable to prevent the same dimension being 
19344         recorded for every element in that dimension.
19345
19346         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19347         from being found.
19348
19349         Also fix bug which was causing the indices to be emitted in the reverse
19350         order.
19351
19352 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19353
19354         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19355         unfinished.  They do not work, because the underlying code is
19356         sloppy.
19357
19358 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19359
19360         * cs-parser.jay: Remove bogus fixme.
19361
19362         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19363         on Switch statement.
19364
19365 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19366
19367         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19368         the same. 
19369
19370         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19371         parameter. Apparently, any expression is allowed. 
19372
19373         (ValidateInitializers): Update accordingly.
19374
19375         (CheckIndices): Fix some tricky bugs thanks to recursion.
19376
19377         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19378         I was being completely brain-dead.
19379
19380         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19381         and re-write acordingly.
19382
19383         (DelegateInvocation): Re-write accordingly.
19384
19385         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19386
19387         (MakeByteBlob): Handle types more correctly.
19388
19389         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19390         initialization from expressions but it is incomplete because I am a complete
19391         Dodo :-|
19392
19393 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19394
19395         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19396         on If.  Basically, we have to return `true' (ie, we do return to
19397         our caller) only if both branches of the if return.
19398
19399         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19400         short-circuit operators, handle them as short circuit operators. 
19401
19402         (Cast.DoResolve): Resolve type.
19403         (Cast.Cast): Take an expression as the target type.
19404
19405         * cs-parser.jay (cast_expression): Remove old hack that only
19406         allowed a limited set of types to be handled.  Now we take a
19407         unary_expression and we resolve to a type during semantic
19408         analysis.
19409
19410         Use the grammar productions from Rhys to handle casts (this is
19411         not complete like Rhys syntax yet, we fail to handle that corner
19412         case that C# has regarding (-x), but we will get there.
19413
19414 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19415
19416         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19417         field which is an array type.
19418
19419         * cs-parser.jay (declare_local_variables): Support array initialization too.
19420
19421         * typemanager.cs (MakeKey): Implement.
19422
19423         (everywhere): Use the above appropriately.
19424
19425         * cs-parser.jay (for_statement): Update for array initialization while
19426         declaring variables.
19427
19428         * ecore.cs : The error message was correct, it's the variable's names that
19429         were misleading ;-) Make the code more readable.
19430
19431         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19432         the correct type etc.
19433
19434         (ConvertExplicit): Handle Enum types by examining the underlying type.
19435
19436 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19437
19438         * parameter.cs (GetCallingConvention): Always return
19439         CallingConventions.Standard for now.
19440
19441 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19442
19443         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19444         and `r' after calling DoNumericPromotions.
19445
19446         * ecore.cs: Fix error message (the types were in the wrong order).
19447
19448         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19449         BindingFlags.Instance as well 
19450
19451         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19452         implicit int literal conversion in an empty cast so that we
19453         propagate the right type upstream.
19454
19455         (UnboxCast): new class used to unbox value types.
19456         (Expression.ConvertExplicit): Add explicit type conversions done
19457         by unboxing.
19458
19459         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19460         the target type before applying the implicit LongLiterals to ULong
19461         literal cast.
19462
19463 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * cs-parser.jay (for_statement): Reworked the way For works: now
19466         we declare manually any variables that are introduced in
19467         for_initializer to solve the problem of having out-of-band code
19468         emition (that is what got for broken).
19469
19470         (declaration_statement): Perform the actual variable declaration
19471         that used to be done in local_variable_declaration here.
19472
19473         (local_variable_declaration): Do not declare anything, just pass
19474         the information on a DictionaryEntry
19475
19476 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19477
19478         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19479         re-write of the logic to now make it recursive.
19480
19481         (UpdateIndices): Re-write accordingly.
19482
19483         Store element data in a separate ArrayData list in the above methods.
19484
19485         (MakeByteBlob): Implement to dump the array data into a byte array.
19486
19487 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19488
19489         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19490         into CheckIndices.
19491
19492         * constant.cs (Define): Implement.
19493
19494         (EmitConstant): Re-write fully.
19495
19496         Pass in location info.
19497
19498         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19499         respectively.
19500
19501         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19502         DictionaryEntry since we need location info too.
19503
19504         (constant_declaration): Update accordingly.
19505
19506         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19507         code into another method : UpdateIndices.
19508
19509 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19510
19511         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19512         some type checking etc.
19513
19514 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19515
19516         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19517         bits to provide dimension info if the user skips doing that.
19518
19519         Update second constructor to store the rank correctly.
19520
19521 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19522
19523         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19524         and try to implement.
19525
19526         * ../errors/cs0150.cs : Add.
19527
19528         * ../errors/cs0178.cs : Add.
19529
19530 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19531
19532         * statement.cs: Implement foreach on multi-dimensional arrays. 
19533
19534         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19535         name of the params argument.
19536
19537         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19538         initializing the array.
19539
19540         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19541         we can use this elsewhere.
19542
19543         * statement.cs: Finish implementation of foreach for single
19544         dimension arrays.
19545
19546         * cs-parser.jay: Use an out-of-band stack to pass information
19547         around, I wonder why I need this.
19548
19549         foreach_block: Make the new foreach_block the current_block.
19550
19551         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19552         function used to return a static Parameters structure.  Used for
19553         empty parameters, as those are created very frequently.
19554
19555         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19556
19557 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19558
19559         * interface.cs : Default modifier is private, not public. The
19560         make verify test passes again.
19561
19562 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19563
19564         * support.cs (ReflectionParameters): Fix logic to determine
19565         whether the last parameter is a params one. Test 9 passes again.
19566
19567         * delegate.cs (Populate): Register the builders we define with
19568         RegisterParameterForBuilder. Test 19 passes again.
19569
19570         * cs-parser.jay (property_declaration): Reference $6 instead
19571         of $$ to get at the location.
19572
19573         (indexer_declaration): Similar stuff.
19574
19575         (attribute): Ditto.
19576
19577         * class.cs (Property): Register parameters for the Get and Set methods
19578         if they exist. Test 23 passes again.
19579
19580         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19581         call to EmitArguments as we are sure there aren't any params arguments. 
19582         Test 32 passes again.
19583
19584         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19585         IndexOutOfRangeException. 
19586
19587         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19588         Test 33 now passes again.
19589
19590 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19591
19592         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19593         broke a bunch of things.  Will have to come up with a better way
19594         of tracking locations.
19595
19596         * statement.cs: Implemented foreach for single dimension arrays.
19597
19598 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19601         an error.  This removes the lookup from the critical path.
19602
19603         * cs-parser.jay: Removed use of temporary_loc, which is completely
19604         broken. 
19605
19606 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19607
19608         * support.cs (ReflectionParameters.ParameterModifier): Report
19609         whether the argument is a PARAMS argument or not.
19610
19611         * class.cs: Set the attribute `ParamArrayAttribute' on the
19612         parameter argument.
19613
19614         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19615         and cons_param_array_attribute (ConstructorInfo for
19616         ParamArrayAttribute)., 
19617
19618         * codegen.cs: Emit the return using the `Return' statement, that
19619         way we can report the error correctly for missing return values. 
19620
19621         * class.cs (Method.Emit): Clean up.
19622
19623         * expression.cs (Argument.Resolve): Take another argument: the
19624         location where this argument is used.  Notice that this is not
19625         part of the "Argument" class as to reduce the size of the
19626         structure (we know the approximate location anyways).
19627
19628         Test if the argument is a variable-reference, if not, then
19629         complain with a 206.
19630
19631         (Argument.Emit): Emit addresses of variables.
19632
19633         (Argument.FullDesc): Simplify.
19634
19635         (Invocation.DoResolve): Update for Argument.Resolve.
19636
19637         (ElementAccess.DoResolve): ditto.
19638
19639         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19640         method should be virtual, as this method is always virtual.
19641
19642         (NewDelegate.DoResolve): Update for Argument.Resolve.
19643
19644         * class.cs (ConstructorInitializer.DoResolve): ditto.
19645
19646         * attribute.cs (Attribute.Resolve): ditto.
19647
19648 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19649
19650         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19651
19652         * expression.cs (ParameterReference): Drop IStackStorage and implement
19653         IAssignMethod instead. 
19654
19655         (LocalVariableReference): ditto.
19656
19657         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19658         IAssignMethod instead. 
19659
19660 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19661
19662         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19663         enumerations that are used in heavily used structures derive from
19664         byte in a laughable and pathetic attempt to reduce memory usage.
19665         This is the kind of pre-optimzations that you should not do at
19666         home without adult supervision.
19667
19668         * expression.cs (UnaryMutator): New class, used to handle ++ and
19669         -- separatedly from the other unary operators.  Cleans up the
19670         code, and kills the ExpressionStatement dependency in Unary.
19671
19672         (Unary): Removed `method' and `Arguments' from this class, making
19673         it smaller, and moving it all to SimpleCall, so I can reuse this
19674         code in other locations and avoid creating a lot of transient data
19675         strucutres when not required.
19676
19677         * cs-parser.jay: Adjust for new changes.
19678
19679 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * enum.cs (Enum.Populate): If there is a failure during
19682         definition, return
19683
19684         * cs-parser.jay (opt_enum_base): we used to catch type errors
19685         here, but this is really incorrect.  The type error should be
19686         catched during semantic analysis.
19687
19688 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19689
19690         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19691         current_local_parameters as expected since I, in my stupidity, had forgotten
19692         to do this :-)
19693
19694         * attribute.cs (GetValidPlaces): Fix stupid bug.
19695
19696         * class.cs (Method::Emit): Perform check on applicability of attributes.
19697
19698         (Constructor::Emit): Ditto.
19699
19700         (Field::Emit): Ditto.
19701
19702         (Field.Location): Store location information.
19703
19704         (Property, Event, Indexer, Operator): Ditto.
19705
19706         * cs-parser.jay (field_declaration): Pass in location for each field.
19707
19708         * ../errors/cs0592.cs : Add.
19709
19710 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19711
19712         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19713
19714         (InitCoreTypes): Update accordingly.
19715
19716         (RegisterAttrType, LookupAttr): Implement.
19717
19718         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19719         info about the same.
19720
19721         (Resolve): Update to populate the above as necessary.
19722
19723         (Error592): Helper.
19724
19725         (GetValidPlaces): Helper to the above.
19726
19727         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19728
19729         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19730
19731 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19732
19733         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19734
19735         * ../errors/cs0617.cs : Add.
19736
19737 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19738
19739         * enum.cs (Emit): Rename to Populate to be more consistent with what
19740         we expect it to do and when exactly it is called.
19741
19742         * class.cs, rootcontext.cs : Update accordingly.
19743
19744         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19745         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19746
19747         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19748
19749         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19750         of a fieldinfo using the above, when dealing with a FieldBuilder.
19751
19752 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19753
19754         * ../errors/cs0031.cs : Add.
19755
19756         * ../errors/cs1008.cs : Add.
19757
19758         * ../errrors/cs0543.cs : Add.
19759
19760         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19761         enum type.
19762
19763         (FindMembers): Implement.
19764
19765         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19766         enums and delegates too.
19767
19768         (enum_types): Rename to builder_to_enum.
19769
19770         (delegate_types): Rename to builder_to_delegate.
19771
19772         * delegate.cs (FindMembers): Implement.
19773
19774 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19775
19776         * typemanager.cs (IsEnumType): Implement.
19777
19778         * enum.cs (Emit): Re-write parts to account for the underlying type
19779         better and perform checking etc.
19780
19781         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19782         of the underlying type.
19783
19784         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19785         value
19786
19787         * enum.cs (error31): Helper to report error #31.
19788
19789         * cs-parser.jay (enum_declaration): Store location of each member too.
19790
19791         * enum.cs (member_to_location): New hashtable. 
19792
19793         (AddEnumMember): Update location hashtable.
19794
19795         (Emit): Use the location of each member while reporting errors.
19796
19797 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * cs-parser.jay: A for_initializer if is a
19800         local_variable_declaration really ammount to have an implicit
19801         block with the variable declaration and no initializer for for.
19802
19803         * statement.cs (For.Emit): Cope with null initializers.
19804
19805         This fixes the infinite loop on for initializers.
19806
19807 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19808
19809         * enum.cs: More cleanup.
19810
19811         * ecore.cs: Remove dead code.
19812
19813         * class.cs (Property.Emit): More simplification.
19814         (Event.Emit): ditto.
19815
19816         Reworked to have less levels of indentation.
19817
19818 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19819
19820         * class.cs (Property): Emit attributes.
19821
19822         (Field): Ditto.
19823
19824         (Event): Ditto.
19825
19826         (Indexer): Ditto.
19827
19828         (Operator): Ditto.
19829
19830         * enum.cs (Emit): Ditto.
19831
19832         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19833         Enums too.
19834
19835         * class.cs (Field, Event, etc.): Move attribute generation into the
19836         Emit method everywhere.
19837
19838         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19839         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19840         as we had no way of defining nested enums !
19841
19842         * rootcontext.cs : Adjust code accordingly.
19843
19844         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19845
19846 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19847
19848         * expression.cs (EvalConstantExpression): Move into ecore.cs
19849
19850         * enum.cs (Enum): Rename some members and make them public and readonly
19851         according to our convention.
19852
19853         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19854         nothing else.
19855
19856         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19857
19858         (Enum::Emit): Write a simple version for now which doesn't try to compute
19859         expressions. I shall modify this to be more robust in just a while.
19860
19861         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19862
19863         (TypeContainer::CloseType): Create the Enum types too.
19864
19865         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19866
19867         * expression.cs (EvalConstantExpression): Get rid of completely.
19868
19869         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19870         user-defined values and other cases.
19871
19872         (IsValidEnumLiteral): Helper function.
19873
19874         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19875         out there in the case we had a literal FieldExpr.
19876
19877         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19878
19879         (Literalize): Revamp a bit to take two arguments.
19880
19881         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19882
19883 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19884
19885         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19886
19887         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19888
19889         (Resolve): Use the above to ensure we have proper initializers.
19890
19891 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19892
19893         * expression.cs (Expression::EvalConstantExpression): New method to 
19894         evaluate constant expressions.
19895
19896         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19897
19898 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19899
19900         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19901         in an array.
19902
19903         (Binary.ResolveOperator): Handle operator != (object a, object b)
19904         and operator == (object a, object b);
19905
19906         (Binary.DoNumericPromotions): Indicate whether the numeric
19907         promotion was possible.
19908
19909         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19910         Implement.  
19911
19912         Made the ArrayAccess implement interface IAssignMethod instead of
19913         IStackStore as the order in which arguments are passed reflects
19914         this.
19915
19916         * assign.cs: Instead of using expr.ExprClass to select the way of
19917         assinging, probe for the IStackStore/IAssignMethod interfaces.
19918
19919         * typemanager.cs: Load InitializeArray definition.
19920
19921         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19922         static data that can be used to initialize arrays. 
19923
19924 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * expression.cs: Handle operator== and operator!= for booleans.
19927
19928         (Conditioal.Reduce): Implement reducer for the ?: operator.
19929
19930         (Conditional.Resolve): Implement dead code elimination.
19931
19932         (Binary.Resolve): Catch string literals and return a new
19933         concatenated string.
19934
19935         (Unary.Reduce): Implement reduction of unary expressions.
19936
19937         * ecore.cs: Split out the expression core handling here.
19938
19939         (Expression.Reduce): New method used to perform constant folding
19940         and CSE.  This is needed to support constant-expressions. 
19941
19942         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19943         targets, and optimize for !x.
19944
19945 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19946
19947         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19948         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19949         set custom atttributes.
19950
19951         * literal.cs (Literal::GetValue): New abstract method to return the actual
19952         value of the literal, cast as an object.
19953
19954         (*Literal): Implement GetValue method.
19955
19956         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19957         expressions to the arraylist but objects of type Argument.
19958
19959         * class.cs (TypeContainer::Emit): Emit our attributes too.
19960
19961         (Method::Emit, Constructor::Emit): Ditto.
19962
19963         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19964         to be ignoring earlier.
19965
19966 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19967
19968         * attribute.cs (AttributeSection::Define): Implement to do the business
19969         of constructing a CustomAttributeBuilder.
19970
19971         (Attribute): New trivial class. Increases readability of code.  
19972
19973         * cs-parser.jay : Update accordingly.
19974
19975         (positional_argument_list, named_argument_list, named_argument): New rules
19976
19977         (attribute_arguments): Use the above so that we are more correct.
19978
19979 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19980
19981         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19982         to perform all checks for a method with a params parameter.
19983
19984         (Invocation::OverloadResolve): Update to use the above method and therefore
19985         cope correctly with params method invocations.
19986
19987         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19988         params too.
19989
19990         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19991         constructors in our parent too because we can't afford to miss out on 
19992         protected ones ;-)
19993
19994         * attribute.cs (AttributeSection): New name for the class Attribute
19995
19996         Other trivial changes to improve readability.
19997
19998         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19999         use the new class names.
20000
20001 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20002
20003         * class.cs (Method::Define): Complete definition for params types too
20004
20005         (Indexer::Define): Ditto.
20006
20007         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20008         Cope everywhere with a request for info about the array parameter.
20009
20010 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20011
20012         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20013
20014         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20015         local_variable_type to extract the string corresponding to the type.
20016
20017         (local_variable_type): Fixup the action to use the new helper method.
20018
20019         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20020         go.
20021
20022         * expression.cs : Clean out code which uses the above.
20023
20024 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20025
20026         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20027         and bale out if necessary by returning a false.
20028
20029         (RegisterProperty): Ditto.
20030
20031         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20032         and print out appropriate error messages.
20033
20034         * interface.cs (everywhere): Ditto.
20035
20036         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20037         location to constructor.
20038
20039         * class.cs (Property, Event, Indexer): Update accordingly.
20040
20041         * ../errors/cs111.cs : Added.
20042
20043         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20044         of a method, as laid down by the spec.
20045
20046         (Invocation::OverloadResolve): Use the above method.
20047
20048 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20049
20050         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20051         now take a TypeContainer and a Parameters object.
20052
20053         (ParameterData): Modify return type of ParameterModifier method to be 
20054         Parameter.Modifier and not a string.
20055
20056         (ReflectionParameters, InternalParameters): Update accordingly.
20057
20058         * expression.cs (Argument::GetParameterModifier): Same here.
20059
20060         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20061         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20062         symbol in it at all so maybe this is only for now.
20063
20064 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20065
20066         * support.cs (InternalParameters): Constructor now takes an extra argument 
20067         which is the actual Parameters class.
20068
20069         (ParameterDesc): Update to provide info on ref/out modifiers.
20070
20071         * class.cs (everywhere): Update call to InternalParameters to pass in
20072         the second argument too.
20073
20074         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20075         to return the modifier info [ref/out etc]
20076
20077         (InternalParameters, ReflectionParameters): Implement the above.
20078
20079         * expression.cs (Argument::ParameterModifier): Similar function to return
20080         info about the argument's modifiers.
20081
20082         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20083         too.
20084
20085         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20086         a new SetFormalParameters object which we pass to InternalParameters.
20087
20088 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20089
20090         * expression.cs (NewArray): Merge into the ArrayCreation class.
20091
20092 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20093
20094         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20095         NewUserdefinedArray into one as there wasn't much of a use in having
20096         two separate ones.
20097
20098         * expression.cs (Argument): Change field's name to ArgType from Type.
20099
20100         (Type): New readonly property which returns the proper type, taking into 
20101         account ref/out modifiers.
20102
20103         (everywhere): Adjust code accordingly for the above.
20104
20105         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20106         whether we are emitting for a ref or out parameter.
20107
20108         * expression.cs (Argument::Emit): Use the above field to set the state.
20109
20110         (LocalVariableReference::Emit): Update to honour the flag and emit the
20111         right stuff.
20112
20113         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20114
20115         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20116
20117         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20118
20119         (ReflectionParameters, InternalParameters): Implement the above method.
20120
20121         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20122         reporting errors.
20123
20124         (Invocation::FullMethodDesc): Ditto. 
20125
20126 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * cs-parser.jay: Add extra production for the second form of array
20129         creation. 
20130
20131         * expression.cs (ArrayCreation): Update to reflect the above
20132         change. 
20133
20134         * Small changes to prepare for Array initialization.
20135
20136 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20137
20138         * typemanager.cs (ImplementsInterface): interface might be null;
20139         Deal with this problem;
20140
20141         Also, we do store negative hits on the cache (null values), so use
20142         this instead of calling t.GetInterfaces on the type everytime.
20143
20144 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20145
20146         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20147
20148         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20149         split functionality out into different classes.
20150
20151         (New::FormArrayType): Move into NewBuiltinArray.
20152
20153         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20154         quite useless.
20155
20156         (NewBuiltinArray): New class to handle creation of built-in arrays.
20157
20158         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20159         account creation of one-dimensional arrays.
20160
20161         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20162
20163         (NewUserdefinedArray::DoResolve): Implement.
20164
20165         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20166
20167         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20168         we maintain inside the TypeManager. This is necessary to perform lookups on the
20169         module builder.
20170
20171         (LookupType): Update to perform GetType on the module builders too.     
20172
20173         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20174
20175         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20176
20177 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20178
20179         * expression.cs (New::DoResolve): Implement guts of array creation.
20180
20181         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20182
20183 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20184
20185         * expression.cs: Fix bug I introduced lsat night that broke
20186         Delegates. 
20187
20188         (Expression.Resolve): Report a 246 error (can not resolve name)
20189         if we find a SimpleName in the stream.
20190
20191         (Expression.ResolveLValue): Ditto.
20192
20193         (Expression.ResolveWithSimpleName): This function is a variant of
20194         ResolveName, this one allows SimpleNames to be returned without a
20195         warning.  The only consumer of SimpleNames is MemberAccess
20196
20197 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20198
20199         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20200         might arrive here.  I have my doubts that this is correct.
20201
20202         * statement.cs (Lock): Implement lock statement.
20203
20204         * cs-parser.jay: Small fixes to support `lock' and `using'
20205
20206         * cs-tokenizer.cs: Remove extra space
20207
20208         * driver.cs: New flag --checked, allows to turn on integer math
20209         checking. 
20210
20211         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20212         Threading.Monitor.Exit 
20213
20214 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20215
20216         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20217         Expression Class to be IndexerAccess.
20218
20219         Notice that Indexer::DoResolve sets the eclass to Value.
20220
20221 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20222
20223         * class.cs (TypeContainer::Emit): Emit code for indexers.
20224
20225         * assign.cs (IAssignMethod): New interface implemented by Indexers
20226         and Properties for handling assignment.
20227
20228         (Assign::Emit): Simplify and reuse code. 
20229
20230         * expression.cs (IndexerAccess, PropertyExpr): Implement
20231         IAssignMethod, clean up old code. 
20232
20233 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20234
20235         * typemanager.cs (ImplementsInterface): New method to determine if a type
20236         implements a given interface. Provides a nice cache too.
20237
20238         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20239         method.
20240
20241         (ConvertReferenceExplicit): Ditto.
20242
20243         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20244         various methods, with correct names etc.
20245
20246         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20247         Operator.UnaryNegation.
20248
20249         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20250         we have a unary plus or minus operator.
20251
20252         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20253         UnaryMinus.
20254
20255         * everywhere : update accordingly.
20256
20257         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20258         respectively.
20259
20260         * class.cs (Method::Define): For the case where we are implementing a method
20261         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20262         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20263
20264 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20265
20266         * interface.cs (FindMembers): Implement to work around S.R.E
20267         lameness.
20268
20269         * typemanager.cs (IsInterfaceType): Implement.
20270
20271         (FindMembers): Update to handle interface types too.
20272
20273         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20274         use IsAssignableFrom as that is not correct - it doesn't work.
20275
20276         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20277         and accordingly override EmitStatement.
20278
20279         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20280         using the correct logic :-)
20281
20282 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20283
20284         * ../errors/cs-11.cs : Add to demonstrate error -11 
20285
20286 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20287
20288         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20289         then pass this as a hint to ResolveLValue.
20290
20291         * expression.cs (FieldExpr): Add Location information
20292
20293         (FieldExpr::LValueResolve): Report assignment to readonly
20294         variable. 
20295
20296         (Expression::ExprClassFromMemberInfo): Pass location information.
20297
20298         (Expression::ResolveLValue): Add new method that resolves an
20299         LValue. 
20300
20301         (Expression::DoResolveLValue): Default invocation calls
20302         DoResolve. 
20303
20304         (Indexers): New class used to keep track of indexers in a given
20305         Type. 
20306
20307         (IStackStore): Renamed from LValue, as it did not really describe
20308         what this did.  Also ResolveLValue is gone from this interface and
20309         now is part of Expression.
20310
20311         (ElementAccess): Depending on the element access type
20312
20313         * typemanager.cs: Add `indexer_name_type' as a Core type
20314         (System.Runtime.CompilerServices.IndexerNameAttribute)
20315
20316         * statement.cs (Goto): Take a location.
20317
20318 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20319
20320         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20321         if two delegates are compatible.
20322
20323         (NewDelegate::DoResolve): Update to take care of the case when
20324         we instantiate a delegate from another delegate.
20325
20326         * typemanager.cs (FindMembers): Don't even try to look up members
20327         of Delegate types for now.
20328
20329 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20330
20331         * delegate.cs (NewDelegate): New class to take care of delegate
20332         instantiation.
20333
20334         * expression.cs (New): Split the delegate related code out into 
20335         the NewDelegate class.
20336
20337         * delegate.cs (DelegateInvocation): New class to handle delegate 
20338         invocation.
20339
20340         * expression.cs (Invocation): Split out delegate related code into
20341         the DelegateInvocation class.
20342
20343 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20344
20345         * expression.cs (New::DoResolve): Implement delegate creation fully
20346         and according to the spec.
20347
20348         (New::DoEmit): Update to handle delegates differently.
20349
20350         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20351         because of which we were printing out arguments in reverse order !
20352
20353         * delegate.cs (VerifyMethod): Implement to check if the given method
20354         matches the delegate.
20355
20356         (FullDelegateDesc): Implement.
20357
20358         (VerifyApplicability): Implement.
20359
20360         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20361         delegate invocations too.
20362
20363         (Invocation::Emit): Ditto.
20364
20365         * ../errors/cs1593.cs : Added.
20366
20367         * ../errors/cs1594.cs : Added.
20368
20369         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20370
20371 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20372
20373         * typemanager.cs (intptr_type): Core type for System.IntPtr
20374
20375         (InitCoreTypes): Update for the same.
20376
20377         (iasyncresult_type, asynccallback_type): Ditto.
20378
20379         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20380         correct.
20381
20382         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20383         too.
20384
20385         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20386         the builders for the 4 members of a delegate type :-)
20387
20388         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20389         type.
20390
20391         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20392
20393         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20394
20395 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20396
20397         * statement.cs (Break::Emit): Implement.   
20398         (Continue::Emit): Implement.
20399
20400         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20401         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20402         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20403         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20404         end loop
20405
20406         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20407         properties that track the label for the current loop (begin of the
20408         loop and end of the loop).
20409
20410 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20411
20412         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20413         use of emitting anything at all.
20414
20415         * class.cs, rootcontext.cs : Get rid of calls to the same.
20416
20417         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20418
20419         (Populate): Define the constructor correctly and set the implementation
20420         attributes.
20421
20422         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20423         have been defined.
20424
20425         (AddDelegateType): Implement.
20426
20427         (IsDelegateType): Implement helper method.
20428
20429         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20430
20431         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20432         and accordingly handle it.
20433
20434         * delegate.cs (Populate): Take TypeContainer argument.
20435         Implement bits to define the Invoke method. However, I still haven't figured out
20436         how to take care of the native int bit :-(
20437
20438         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20439         Qualify the name of the delegate, not its return type !
20440
20441         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20442         conversion.
20443
20444         (StandardConversionExists): Checking for array types turns out to be recursive.
20445
20446         (ConvertReferenceExplicit): Implement array conversion.
20447
20448         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20449
20450 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20451
20452         * cs-parser.jay (delegate_declaration): Store the fully qualified
20453         name as it is a type declaration.
20454
20455         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20456         readonly.
20457
20458         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20459         as TypeContainer::DefineType.
20460
20461         (Populate): Method in which all the definition of the various methods (Invoke)
20462         etc is done.
20463
20464         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20465         see.
20466
20467         (CloseDelegate): Finally creates the delegate.
20468
20469         * class.cs (TypeContainer::DefineType): Update to define delegates.
20470         (Populate, Emit and CloseType): Do the same thing here too.
20471
20472         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20473         delegates in all these operations.
20474
20475 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * expression.cs: LocalTemporary: a new expression used to
20478         reference a temporary that has been created.
20479
20480         * assign.cs: Handle PropertyAccess back here, so that we can
20481         provide the proper semantic access to properties.
20482
20483         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20484         a few more explicit conversions. 
20485
20486         * modifiers.cs: `NEW' modifier maps to HideBySig.
20487
20488         * expression.cs (PropertyExpr): Make this into an
20489         ExpressionStatement, and support the EmitStatement code path. 
20490
20491         Perform get/set error checking, clean up the interface.
20492
20493         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20494         them into toplevel access objects.
20495
20496 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20497
20498         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20499         SRE.
20500
20501         * typemanager.cs: Keep track here of our PropertyBuilders again to
20502         work around lameness in SRE.
20503
20504 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20505
20506         * expression.cs (LValue::LValueResolve): New method in the
20507         interface, used to perform a second resolution pass for LValues. 
20508
20509         (This::DoResolve): Catch the use of this in static methods.
20510
20511         (This::LValueResolve): Implement.
20512
20513         (This::Store): Remove warning, assigning to `this' in structures
20514         is 
20515
20516         (Invocation::Emit): Deal with invocation of
20517         methods on value types.  We need to pass the address to structure
20518         methods rather than the object itself.  (The equivalent code to
20519         emit "this" for structures leaves the entire structure on the
20520         stack instead of a pointer to it). 
20521
20522         (ParameterReference::DoResolve): Compute the real index for the
20523         argument based on whether the method takes or not a `this' pointer
20524         (ie, the method is static).
20525
20526         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20527         value types returned from functions when we need to invoke a
20528         method on the sturcture.
20529
20530
20531 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20532
20533         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20534         defining the type in the Modulebuilder or Typebuilder. This is to take
20535         care of nested types which need to be defined on the TypeBuilder using
20536         DefineNestedMethod.
20537
20538         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20539         methods in RootContext, only ported to be part of TypeContainer.
20540
20541         (TypeContainer::GetInterfaceOrClass): Ditto.
20542
20543         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20544
20545         * interface.cs (Interface::DefineInterface): New method. Does exactly
20546         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20547         too.
20548
20549         (Interface::GetInterfaces): Move from RootContext here and port.
20550
20551         (Interface::GetInterfaceByName): Same here.
20552
20553         * rootcontext.cs (ResolveTree): Re-write.
20554
20555         (PopulateTypes): Re-write.
20556
20557         * class.cs (TypeContainer::Populate): Populate nested types too.
20558         (TypeContainer::Emit): Emit nested members too.
20559
20560         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20561         instead just use the name argument passed in as it is already fully
20562         qualified.
20563
20564         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20565         to TypeContainer mapping to see if a type is user-defined.
20566
20567         * class.cs (TypeContainer::CloseType): Implement. 
20568
20569         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20570         the default constructor.
20571
20572         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20573         twice.
20574
20575         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20576
20577         * interface.cs (CloseType): Create the type here.
20578
20579         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20580         the hierarchy.
20581
20582         Remove all the methods which are now in TypeContainer.
20583
20584 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20585
20586         * delegate.cs (Define): Re-write bits to define the delegate
20587         correctly.
20588
20589 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20590
20591         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20592
20593         * expression.cs (ImplicitReferenceConversion): handle null as well
20594         as a source to convert to any reference type.
20595
20596         * statement.cs (Return): Perform any implicit conversions to
20597         expected return type.  
20598
20599         Validate use of return statement.  
20600
20601         * codegen.cs (EmitContext): Pass the expected return type here.
20602
20603         * class.cs (Method, Constructor, Property): Pass expected return
20604         type to EmitContext.
20605
20606 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20607
20608         * expression.cs: Make DoResolve take an EmitContext instead of a
20609         TypeContainer.
20610
20611         Replaced `l' and `location' for `loc', for consistency.
20612
20613         (Error, Warning): Remove unneeded Tc argument.
20614
20615         * assign.cs, literal.cs, constant.cs: Update to new calling
20616         convention. 
20617
20618         * codegen.cs: EmitContext now contains a flag indicating whether
20619         code is being generated in a static method or not.
20620
20621         * cs-parser.jay: DecomposeQI, new function that replaces the old
20622         QualifiedIdentifier.  Now we always decompose the assembled
20623         strings from qualified_identifier productions into a group of
20624         memberaccesses.
20625
20626 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * rootcontext.cs: Deal with field-less struct types correctly now
20629         by passing the size option to Define Type.
20630
20631         * class.cs: Removed hack that created one static field. 
20632
20633 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20634
20635         * statement.cs: Moved most of the code generation here. 
20636
20637 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20638
20639         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20640         seem very right.
20641
20642         (ElementAccess): Remove useless bits for now - keep checks as the spec
20643         says.
20644
20645 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20646
20647         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20648         and start performing checks according to the spec.
20649
20650 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20651
20652         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20653         rank_specifiers instead.
20654
20655         (rank_specifiers): Change the order in which the rank specifiers are stored
20656
20657         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20658
20659         * expression.cs (ElementAccess): Implement the LValue interface too.
20660
20661 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20662
20663         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20664         except that user defined conversions are not included.
20665
20666         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20667         perform the conversion of the return type, if necessary.
20668
20669         (New::DoResolve): Check whether we are creating an array or an object
20670         and accordingly do the needful.
20671
20672         (New::Emit): Same here.
20673
20674         (New::DoResolve): Implement guts of array creation.
20675
20676         (New::FormLookupType): Helper function.
20677
20678 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20679
20680         * codegen.cs: Removed most of the code generation here, and move the
20681         corresponding code generation bits to the statement classes. 
20682
20683         Added support for try/catch/finalize and throw.
20684
20685         * cs-parser.jay: Added support for try/catch/finalize.
20686
20687         * class.cs: Catch static methods having the flags override,
20688         virtual or abstract.
20689
20690         * expression.cs (UserCast): This user cast was not really doing
20691         what it was supposed to do.  Which is to be born in fully resolved
20692         state.  Parts of the resolution were being performed at Emit time! 
20693
20694         Fixed this code.
20695
20696 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20697
20698         * expression.cs: Implicity convert the result from UserCast.
20699
20700 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20701
20702         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20703         prevented it from working correctly. 
20704
20705         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20706         merely ConvertImplicit.
20707
20708 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20709
20710         * typemanager.cs: Make the LookupTypeContainer function static,
20711         and not per-instance.  
20712
20713         * class.cs: Make static FindMembers (the one that takes a Type
20714         argument). 
20715
20716         * codegen.cs: Add EmitForeach here.
20717
20718         * cs-parser.jay: Make foreach a toplevel object instead of the
20719         inline expansion, as we need to perform semantic analysis on it. 
20720
20721 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20722
20723         * expression.cs (Expression::ImplicitUserConversion): Rename to
20724         UserDefinedConversion.
20725
20726         (Expression::UserDefinedConversion): Take an extra argument specifying 
20727         whether we look for explicit user conversions too.
20728
20729         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20730
20731         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20732
20733         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20734         with the appropriate arguments.
20735
20736         * cs-parser.jay (cast_expression): Record location too.
20737
20738         * expression.cs (Cast): Record location info.
20739
20740         (Expression::ConvertExplicit): Take location argument.
20741
20742         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20743         to determine if we are doing explicit conversions.
20744
20745         (UserCast::Emit): Update accordingly.
20746
20747         (Expression::ConvertExplicit): Report an error if everything fails.
20748
20749         * ../errors/cs0030.cs : Add.
20750
20751 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20752
20753         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20754         virtual and newslot bits. 
20755
20756         * class.cs (TypeContainer::RegisterRequiredImplementations):
20757         Record methods we need.
20758
20759         (TypeContainer::MakeKey): Helper function to make keys for
20760         MethodBases, since the Methodbase key is useless.
20761
20762         (TypeContainer::Populate): Call RegisterRequiredImplementations
20763         before defining the methods.   
20764
20765         Create a mapping for method_builders_to_methods ahead of time
20766         instead of inside a tight loop.
20767
20768         (::RequireMethods):  Accept an object as the data to set into the
20769         hashtable so we can report interface vs abstract method mismatch.
20770
20771 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20772
20773         * report.cs: Make all of it static.
20774
20775         * rootcontext.cs: Drop object_type and value_type computations, as
20776         we have those in the TypeManager anyways.
20777
20778         Drop report instance variable too, now it is a global.
20779
20780         * driver.cs: Use try/catch on command line handling.
20781
20782         Add --probe option to debug the error reporting system with a test
20783         suite. 
20784
20785         * report.cs: Add support for exiting program when a probe
20786         condition is reached.
20787
20788 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20789
20790         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20791         we do a forcible conversion regardless of type, to check if 
20792         ForceConversion returns a null.
20793
20794         (Binary::error19): Use location to report error.
20795
20796         (Unary::error23): Use location here too.
20797
20798         * ../errors/cs0019.cs : Check in.
20799
20800         * ../errors/cs0023.cs : Check in.
20801
20802         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20803         case of a non-null MethodInfo object with a length of 0 !
20804
20805         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20806         an applicable member - according to the spec :-)
20807         Also fix logic to find members in base types.
20808
20809         (Unary::ResolveOperator): Same here.
20810
20811         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20812         as I was getting thoroughly confused between this and error19 :-)
20813
20814         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20815         (::FindMostEncompassedType): Implement.
20816         (::FindMostEncompassingType): Implement.
20817         (::StandardConversionExists): Implement.
20818
20819         (UserImplicitCast): Re-vamp. We now need info about most specific
20820         source and target types so that we can do the necessary conversions.
20821
20822         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20823         mathematical union with no duplicates.
20824
20825 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20828         in order from base classes to child classes, so that we can in
20829         child classes look up in our parent for method names and
20830         attributes (required for handling abstract, virtual, new, override
20831         constructs: we need to instrospect our base class, and if we dont
20832         populate the classes in order, the introspection might be
20833         incorrect.  For example, a method could query its parent before
20834         the parent has any methods and would determine that the parent has
20835         no abstract methods (while it could have had them)).
20836
20837         (RootContext::CreateType): Record the order in which we define the
20838         classes.
20839
20840 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * class.cs (TypeContainer::Populate): Also method definitions can
20843         fail now, keep track of this.
20844
20845         (TypeContainer::FindMembers): Implement support for
20846         DeclaredOnly/noDeclaredOnly flag.
20847
20848         (Constructor::Emit) Return the ConstructorBuilder.
20849
20850         (Method::Emit) Return the MethodBuilder. 
20851         Check for abstract or virtual methods to be public.
20852
20853         * rootcontext.cs (RootContext::CreateType): Register all the
20854         abstract methods required for the class to be complete and the
20855         interface methods that must be implemented. 
20856
20857         * cs-parser.jay: Report error 501 (method requires body if it is
20858         not marked abstract or extern).
20859
20860         * expression.cs (TypeOf::Emit): Implement.
20861
20862         * typemanager.cs: runtime_handle_type, new global type.
20863
20864         * class.cs (Property::Emit): Generate code for properties.
20865
20866 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20867
20868         * expression.cs (Unary::ResolveOperator): Find operators on base type
20869         too - we now conform exactly to the spec.
20870
20871         (Binary::ResolveOperator): Same here.
20872
20873         * class.cs (Operator::Define): Fix minor quirk in the tests.
20874
20875         * ../errors/cs0215.cs : Added.
20876
20877         * ../errors/cs0556.cs : Added.
20878
20879         * ../errors/cs0555.cs : Added.
20880
20881 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20882
20883         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20884         single integer which is really efficient
20885
20886 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20887
20888         *  expression.cs (Expression::ImplicitUserConversion): Use location
20889         even in the case when we are examining True operators.
20890  
20891         * class.cs (Operator::Define): Perform extensive checks to conform
20892         with the rules for operator overloading in the spec.
20893
20894         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20895         some of the other conversions mentioned in the spec.
20896
20897         * typemanager.cs (array_type): New static member for the System.Array built-in
20898         type.
20899
20900         (cloneable_interface): For System.ICloneable interface.
20901
20902         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20903         we start resolving the tree and populating types.
20904
20905         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20906  
20907 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20908
20909         * expression.cs (Expression::ExprClassFromMemberInfo,
20910         Expression::Literalize): Create literal expressions from
20911         FieldInfos which are literals.
20912
20913         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20914         type casts, because they were wrong.  The test suite in tests
20915         caught these ones.
20916
20917         (ImplicitNumericConversion): ushort to ulong requires a widening
20918         cast. 
20919
20920         Int32 constant to long requires widening cast as well.
20921
20922         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20923         for integers because the type on the stack is not i4.
20924
20925 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20926
20927         * expression.cs (report118): require location argument. 
20928
20929         * parameter.cs: Do not dereference potential null value.
20930
20931         * class.cs: Catch methods that lack the `new' keyword when
20932         overriding a name.  Report warnings when `new' is used without
20933         anything being there to override.
20934
20935         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20936
20937         * class.cs: Only add constructor to hashtable if it is non-null
20938         (as now constructors can fail on define).
20939
20940         (TypeManager, Class, Struct): Take location arguments.
20941
20942         Catch field instance initialization in structs as errors.
20943
20944         accepting_filter: a new filter for FindMembers that is static so
20945         that we dont create an instance per invocation.
20946
20947         (Constructor::Define): Catch errors where a struct constructor is
20948         parameterless 
20949
20950         * cs-parser.jay: Pass location information for various new
20951         constructs. 
20952
20953         * delegate.cs (Delegate): take a location argument.
20954
20955         * driver.cs: Do not call EmitCode if there were problesm in the
20956         Definition of the types, as many Builders wont be there. 
20957
20958         * decl.cs (Decl::Decl): Require a location argument.
20959
20960         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20961         into integers, and find the most appropiate integer for it.
20962
20963         * literal.cs: Implement ULongLiteral.
20964
20965         * rootcontext.cs: Provide better information about the location of
20966         failure when CreateType fails.
20967
20968 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20969
20970         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20971         as well.
20972
20973         * expression.cs (Binary::CheckShiftArguments): Add missing type
20974         computation.
20975         (Binary::ResolveOperator): Add type to the logical and and logical
20976         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20977         before.
20978
20979         (Binary::DoNumericPromotions): In the case where either argument
20980         is ulong (and most signed types combined with ulong cause an
20981         error) perform implicit integer constant conversions as well.
20982
20983 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20984
20985         * expression.cs (UserImplicitCast): Method should always be
20986         non-null. 
20987         (Invocation::BetterConversion): Simplified test for IntLiteral.
20988
20989         (Expression::ImplicitNumericConversion): Split this routine out.
20990         Put the code that performs implicit constant integer conversions
20991         here. 
20992
20993         (Expression::Resolve): Become a wrapper around DoResolve so we can
20994         check eclass and type being set after resolve.
20995
20996         (Invocation::Badness): Remove this dead function
20997
20998         (Binary::ResolveOperator): Do not compute the expensive argumnets
20999         unless we have a union for it.
21000
21001         (Probe::Emit): Is needs to do an isinst and then
21002         compare against null.
21003
21004         (::CanConvert): Added Location argument.  If the Location argument
21005         is null (Location.Null), then we do not report errors.  This is
21006         used by the `probe' mechanism of the Explicit conversion.  We do
21007         not want to generate an error for something that the user
21008         explicitly requested to be casted.  But the pipeline for an
21009         explicit cast first tests for potential implicit casts.
21010
21011         So for now, if the Location is null, it means `Probe only' to
21012         avoid adding another argument.   Might have to revise this
21013         strategy later.
21014
21015         (ClassCast): New class used to type cast objects into arbitrary
21016         classes (used in Explicit Reference Conversions).
21017
21018         Implement `as' as well.
21019
21020         Reverted all the patches from Ravi below: they were broken:
21021
21022                 * The use of `level' as a mechanism to stop recursive
21023                   invocations is wrong.  That was there just to catch the
21024                   bug with a strack trace but not as a way of addressing
21025                   the problem.
21026
21027                   To fix the problem we have to *understand* what is going
21028                   on and the interactions and come up with a plan, not
21029                   just get things going.
21030
21031                 * The use of the type conversion cache that I proposed
21032                   last night had an open topic: How does this work across
21033                   protection domains.  A user defined conversion might not
21034                   be public in the location where we are applying the
21035                   conversion, a different conversion might be selected
21036                   (ie, private A->B (better) but public B->A (worse),
21037                   inside A, A->B applies, but outside it, B->A will
21038                   apply).
21039
21040                 * On top of that (ie, even if the above is solved),
21041                   conversions in a cache need to be abstract.  Ie, `To
21042                   convert from an Int to a Short use an OpcodeCast', not
21043                   `To convert from an Int to a Short use the OpcodeCast on
21044                   the variable 5' (which is what this patch was doing).
21045
21046 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21047
21048         * expression.cs (Invocation::ConversionExists): Re-write to use
21049         the conversion cache
21050
21051         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21052         cache all conversions done, not just user-defined ones.
21053
21054         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21055         to determine if a conversion exists instead of acutually trying to 
21056         perform the conversion. It's faster too.
21057
21058         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21059         and only then attempt the implicit conversion.
21060
21061 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21062
21063         * expression.cs (ConvertImplicit): Use a cache for conversions
21064         already found. Check level of recursion and bail out if necessary.
21065
21066 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21067
21068         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21069         Export standard methods that we expect for string operations.
21070
21071         * statement.cs (Block::UsageWarning): Track usage of variables and
21072         report the errors for not used variables.
21073
21074         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21075         operator. 
21076
21077 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * codegen.cs: remove unnneded code 
21080
21081         * expression.cs: Removed BuiltinTypeAccess class
21082
21083         Fix the order in which implicit conversions are
21084         done.  
21085
21086         The previous fixed dropped support for boxed conversions (adding a
21087         test to the test suite now)
21088
21089         (UserImplicitCast::CanConvert): Remove test for source being null,
21090         that code is broken.  We should not feed a null to begin with, if
21091         we do, then we should track the bug where the problem originates
21092         and not try to cover it up here.
21093
21094         Return a resolved expression of type UserImplicitCast on success
21095         rather than true/false.  Ravi: this is what I was talking about,
21096         the pattern is to use a static method as a "constructor" for
21097         objects. 
21098
21099         Also, do not create arguments until the very last minute,
21100         otherwise we always create the arguments even for lookups that
21101         will never be performed. 
21102
21103         (UserImplicitCast::Resolve): Eliminate, objects of type
21104         UserImplicitCast are born in a fully resolved state. 
21105
21106         * typemanager.cs (InitCoreTypes): Init also value_type
21107         (System.ValueType). 
21108
21109         * expression.cs (Cast::Resolve): First resolve the child expression.
21110
21111         (LValue): Add new method AddressOf to be used by
21112         the `&' operator.  
21113
21114         Change the argument of Store to take an EmitContext instead of an
21115         ILGenerator, because things like FieldExpr need to be able to call
21116         their children expression to generate the instance code. 
21117
21118         (Expression::Error, Expression::Warning): Sugar functions for
21119         reporting errors.
21120
21121         (Expression::MemberLookup): Accept a TypeContainer instead of a
21122         Report as the first argument.
21123
21124         (Expression::ResolvePrimary): Killed.  I still want to improve
21125         this as currently the code is just not right.
21126
21127         (Expression::ResolveMemberAccess): Simplify, but it is still
21128         wrong. 
21129
21130         (Unary::Resolve): Catch errors in AddressOf operators.
21131
21132         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21133         index to a byte for the short-version, or the compiler will choose
21134         the wrong Emit call, which generates the wrong data.
21135
21136         (ParameterReference::Emit, ::Store): same.
21137
21138         (FieldExpr::AddressOf): Implement.
21139
21140         * typemanager.cs: TypeManager: made public variable instead of
21141         property.
21142
21143         * driver.cs: document --fatal.
21144
21145         * report.cs (ErrorMessage, WarningMessage): new names for the old
21146         Error and Warning classes.
21147
21148         * cs-parser.jay (member_access): Turn built-in access to types
21149         into a normal simplename
21150
21151 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21152
21153         * expression.cs (Invocation::BetterConversion): Fix to cope
21154         with q being null, since this was introducing a bug.
21155
21156         * expression.cs (ConvertImplicit): Do built-in conversions first.
21157
21158 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21159
21160         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21161
21162 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21163
21164         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21165         I had introduced long ago (what's new ?).
21166
21167         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21168         the work of all the checking. 
21169         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21170         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21171
21172         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21173         that is the right way. 
21174
21175         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21176         overloading resolution. Use everywhere instead of cutting and pasting code.
21177
21178         (Binary::ResolveOperator): Use MakeUnionSet.
21179
21180         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21181         we have to convert to bool types. Not complete yet.
21182
21183 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21184
21185         * typemanager.cs (TypeManager::CSharpName): support ushort.
21186
21187         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21188         to provide an expression that performsn an implicit constant int
21189         conversion (section 6.1.6).
21190         (Expression::ConvertImplicitRequired): Reworked to include
21191         implicit constant expression conversions.
21192
21193         (Expression::ConvertNumericExplicit): Finished.
21194
21195         (Invocation::Emit): If InstanceExpression is null, then it means
21196         that we perform a call on this.
21197
21198 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21199
21200         * expression.cs (Unary::Emit): Remove some dead code.
21201         (Probe): Implement Resolve and Emit for `is'.
21202         (Expression::ConvertImplicitRequired): Attempt to do constant
21203         expression conversions here.  Maybe should be moved to
21204         ConvertImplicit, but I am not sure.
21205         (Expression::ImplicitLongConstantConversionPossible,
21206         Expression::ImplicitIntConstantConversionPossible): New functions
21207         that tell whether is it possible to apply an implicit constant
21208         expression conversion.
21209
21210         (ConvertNumericExplicit): Started work on explicit numeric
21211         conversions.
21212
21213         * cs-parser.jay: Update operator constants.
21214
21215         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21216         (Parameters::GetSignature): Hook up VerifyArgs here.
21217         (Parameters::VerifyArgs): Verifies that no two arguments have the
21218         same name. 
21219
21220         * class.cs (Operator): Update the operator names to reflect the
21221         ones that the spec expects (as we are just stringizing the
21222         operator names).
21223
21224         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21225         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21226         previous usage did only work for our methods.
21227         (Expression::ConvertImplicit): Handle decimal implicit numeric
21228         conversions as well.
21229         (Expression::InternalTypeConstructor): Used to invoke constructors
21230         on internal types for default promotions.
21231
21232         (Unary::Emit): Implement special handling for the pre/post
21233         increment/decrement for overloaded operators, as they need to have
21234         the same semantics as the other operators.
21235
21236         (Binary::ResolveOperator): ditto.
21237         (Invocation::ConversionExists): ditto.
21238         (UserImplicitCast::Resolve): ditto.
21239
21240 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21241
21242         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21243         operator, return after emitting body. Regression tests pass again !
21244
21245         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21246         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21247         (Invocation::OverloadResolve): Ditto.
21248         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21249
21250         * everywhere : update calls to the above methods accordingly.
21251
21252 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21253
21254         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21255
21256         * expression.cs (ExpressionStatement): New base class used for
21257         expressions that can appear in statements, so that we can provide
21258         an alternate path to generate expression that do not leave a value
21259         on the stack.
21260
21261         (Expression::Emit, and all the derivatives): We no longer return
21262         whether a value is left on the stack or not.  Every expression
21263         after being emitted leaves a single value on the stack.
21264
21265         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21266         facilties of ExpressionStatement if possible.
21267
21268         * cs-parser.jay: Update statement_expression.
21269
21270 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21271
21272         * driver.cs: Change the wording of message
21273
21274 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21275
21276         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21277         the type of the expression to the return type of the method if
21278         we have an overloaded operator match ! The regression tests pass again !
21279         (Unary::ResolveOperator): Ditto.
21280
21281         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21282         to find "op_Implicit", not "implicit" ;-)
21283         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21284         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21285
21286         * everywhere : Correct calls to the above accordingly.
21287
21288         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21289         (ConvertImplicit): Do user-defined conversion if it exists.
21290
21291 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21292
21293         * assign.cs: track location.
21294         (Resolve): Use implicit conversions on assignment.
21295
21296         * literal.cs: Oops.  Not good, Emit of short access values should
21297         pass (Bytes) or the wrong argument will be selected.
21298
21299         * expression.cs (Unary::Emit): Emit code for -expr.
21300
21301         (Unary::ResolveOperator): Handle `Substract' for non-constants
21302         (substract from zero from the non-constants).
21303         Deal with Doubles as well. 
21304
21305         (Expression::ConvertImplicitRequired): New routine that reports an
21306         error if no implicit conversion exists. 
21307
21308         (Invocation::OverloadResolve): Store the converted implicit
21309         expressions if we make them
21310
21311 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21312
21313         * class.cs (ConstructorInitializer): Take a Location argument.
21314         (ConstructorBaseInitializer): Same here.
21315         (ConstructorThisInitializer): Same here.
21316
21317         * cs-parser.jay : Update all calls accordingly.
21318
21319         * expression.cs (Unary, Binary, New): Take location argument.
21320         Update accordingly everywhere.
21321
21322         * cs-parser.jay : Update all calls to the above to take a location
21323         argument.
21324
21325         * class.cs : Ditto.
21326
21327 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21328
21329         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21330         (Invocation::BetterConversion): Same here
21331         (Invocation::ConversionExists): Ditto.
21332
21333         (Invocation::ConversionExists): Implement.
21334
21335 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21336
21337         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21338         Also take an additional TypeContainer argument.
21339
21340         * All over : Pass in TypeContainer as argument to OverloadResolve.
21341
21342         * typemanager.cs (CSharpName): Update to check for the string type and return
21343         that too.
21344
21345         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21346         a given method.
21347
21348 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21349
21350         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21351         (Invocation::BetterFunction): Implement.
21352         (Invocation::BetterConversion): Implement.
21353         (Invocation::ConversionExists): Skeleton, no implementation yet.
21354
21355         Okay, things work fine !
21356
21357 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21358
21359         * typemanager.cs: declare and load enum_type, delegate_type and
21360         void_type. 
21361
21362         * expression.cs (Expression::Emit): Now emit returns a value that
21363         tells whether a value is left on the stack or not.  This strategy
21364         might be reveted tomorrow with a mechanism that would address
21365         multiple assignments.
21366         (Expression::report118): Utility routine to report mismatches on
21367         the ExprClass.
21368
21369         (Unary::Report23): Report impossible type/operator combination
21370         utility function.
21371
21372         (Unary::IsIncrementableNumber): Whether the type can be
21373         incremented or decremented with add.
21374         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21375         complemented. 
21376         (Unary::ResolveOperator): Implement ++, !, ~,
21377
21378         (Invocation::Emit): Deal with new Emit convetion.
21379
21380         * All Expression derivatives: Updated their Emit method to return
21381         whether they leave values on the stack or not.
21382
21383         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21384         stack for expressions that are statements. 
21385
21386 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21387
21388         * expression.cs (LValue): New interface.  Must be implemented by
21389         LValue objects.
21390         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21391         LValue interface.
21392
21393         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21394         interface for generating code, simplifies the code.
21395
21396 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21397
21398         * expression.cs (everywhere): Comment out return statements in ::Resolve
21399         methods to avoid the warnings.
21400
21401 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21402
21403         * driver.cs (parse): Report error 2001 if we can not open the
21404         source file.
21405
21406         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21407         not resolve it.
21408
21409         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21410         object. 
21411
21412         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21413         otherwise nested blocks end up with the same index.
21414
21415         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21416
21417         * expression.cs:  Instead of having FIXMEs in the Resolve
21418         functions, throw exceptions so it is obvious that we are facing a
21419         bug. 
21420
21421         * cs-parser.jay (invocation_expression): Pass Location information.
21422
21423         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21424         Use a basename for those routines because .NET does not like paths
21425         on them. 
21426
21427         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21428         already defined.
21429
21430 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21431
21432         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21433         are loading the correct data types (throws an exception if not).
21434         (TypeManager::InitCoreTypes): Use CoreLookupType
21435
21436         * expression.cs (Unary::ResolveOperator): return the child
21437         expression for expressions which are just +expr.
21438         (Unary::ResolveOperator): Return negative literals for -LITERAL
21439         expressions (otherwise they are Unary {Literal}).
21440         (Invocation::Badness): Take into account `Implicit constant
21441         expression conversions'.
21442
21443         * literal.cs (LongLiteral): Implement long literal class.
21444         (IntLiteral): export the `Value' of the intliteral. 
21445
21446 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21447
21448         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21449
21450         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21451         instead of 'Operator'
21452
21453         * expression.cs (Binary::ResolveOperator): Update accordingly.
21454         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21455         and 'Minus'
21456
21457         * cs-parser.jay (unary_expression): Update to use the new names.
21458
21459         * gen-treedump.cs (GetUnary): Same here.
21460
21461         * expression.cs (Unary::Resolve): Implement.
21462         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21463         operators are found instead of making noise ;-)
21464         (Unary::ResolveOperator): New method to do precisely the same thing which
21465         Binary::ResolveOperator does for Binary expressions.
21466         (Unary.method, .Arguments): Add.
21467         (Unary::OperName): Implement.   
21468         (Unary::ForceConversion): Copy and Paste !
21469
21470         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21471         a unary operator.
21472
21473         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21474         for the inbuilt operators. Only overloading works for now ;-)
21475
21476 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21479         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21480
21481         * expression.cs (This::Emit): Implement. 
21482         (This::Resolve): Implement.
21483         (TypeOf:Resolve): Implement.
21484         (Expression::ResolveSimpleName): Add an implicit this to instance
21485         field references. 
21486         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21487         Bind instance variable to Field expressions.
21488         (FieldExpr::Instance): New field used to track the expression that
21489         represents the object instance.
21490         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21491         binding 
21492         (FieldExpr::Emit): Implement.
21493
21494         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21495         the last instruction contains a return opcode to avoid generating
21496         the last `ret' instruction (this generates correct code, and it is
21497         nice to pass the peverify output).
21498
21499         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21500         initializer for static and instance variables.
21501         (Constructor::Emit): Allow initializer to be null in the case of
21502         static constructors.  Only emit initializer for instance
21503         constructors. 
21504
21505         (TypeContainer::FindMembers): Return a null array if there are no
21506         matches.
21507
21508         Also fix the code for the MemberTypes.Method branch, as it was not
21509         scanning that for operators (or tried to access null variables before).
21510
21511         * assign.cs (Assign::Emit): Handle instance and static fields. 
21512
21513         * TODO: Updated.
21514
21515         * driver.cs: Stop compilation if there are parse errors.
21516
21517         * cs-parser.jay (constructor_declaration): Provide default base
21518         initializer for non-static constructors.
21519         (constructor_declarator): Do not provide a default base
21520         initializers if none was specified.
21521         Catch the fact that constructors should not have parameters.
21522
21523         * class.cs: Do not emit parent class initializers for static
21524         constructors, that should be flagged as an error.
21525
21526 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21527
21528         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21529         Move back code into TypeContainer::Populate.
21530
21531 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21532
21533         * class.cs (TypeContainer::AddConstructor): Fix the check to
21534         compare against Name, not Basename. 
21535         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21536
21537         * cs-parser.jay : Update accordingly.
21538
21539         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21540         for methods, don't forget to look into the operators too.
21541         (RegisterMethodBuilder): Helper method to take care of this for
21542         methods, constructors and operators.
21543         (Operator::Define): Completely revamp.
21544         (Operator.OperatorMethod, MethodName): New fields.
21545         (TypeContainer::Populate): Move the registering of builders into
21546         RegisterMethodBuilder.
21547         (Operator::Emit): Re-write.
21548
21549         * expression.cs (Binary::Emit): Comment out code path to emit method
21550         invocation stuff for the case when we have a user defined operator. I am
21551         just not able to get it right !
21552
21553 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21554
21555         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21556         argument. 
21557
21558         (Expression::MemberLookup): Provide a version that allows to
21559         specify the MemberTypes and BindingFlags. 
21560
21561         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21562         so it was not fetching variable information from outer blocks.
21563
21564         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21565         Beforefieldinit as it was buggy.
21566
21567         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21568         that Ravi put here.  
21569
21570         * class.cs (Constructor::Emit): Only emit if block is not null.
21571         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21572         deal with this by semantically definining it as if the user had
21573         done it.
21574
21575         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21576         constructors as we now "emit" them at a higher level.
21577
21578         (TypeContainer::DefineDefaultConstructor): Used to define the
21579         default constructors if none was provided.
21580
21581         (ConstructorInitializer): Add methods Resolve and Emit. 
21582
21583         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21584
21585 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21586
21587         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21588         the default constructor builder with our hashtable for methodbuilders
21589         to methodcores.
21590
21591         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21592         and argument_count is 0 in which case we have a match.
21593         (Binary::ResolveOperator): More null checking and miscellaneous coding
21594         style cleanup.
21595
21596 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21597
21598         * rootcontext.cs (IsNameSpace): Compare against null.
21599
21600         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21601
21602         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21603         and Unary::Operator.
21604
21605         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21606         accordingly.
21607
21608         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21609         we have overloaded operators.
21610         (Binary::ResolveOperator): Implement the part which does the operator overload
21611         resolution.
21612
21613         * class.cs (Operator::Emit): Implement.
21614         (TypeContainer::Emit): Emit the operators we have too.
21615
21616         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21617         the case when we have a user-defined operator.
21618
21619 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21620
21621         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21622
21623 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21624
21625         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21626         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21627         (Constructor::Emit): Implement.
21628         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21629         if we have no work to do. 
21630         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21631         Emit method.
21632
21633         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21634         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21635
21636         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21637         of parent.parent.
21638
21639 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21640
21641         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21642         in the source.
21643         (Tree::RecordNamespace): Method to do what the name says ;-)
21644         (Tree::Namespaces): Property to get at the namespaces hashtable.
21645
21646         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21647         keep track.
21648
21649         * rootcontext.cs (IsNamespace): Fixed it :-)
21650
21651 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21652
21653         * class.cs (TypeContainer::FindMembers): Add support for
21654         constructors. 
21655         (MethodCore): New class that encapsulates both the shared aspects
21656         of a Constructor and a Method.  
21657         (Method, Constructor): Factored pieces into MethodCore.
21658
21659         * driver.cs: Added --fatal which makes errors throw exceptions.
21660         Load System assembly as well as part of the standard library.
21661
21662         * report.cs: Allow throwing exceptions on errors for debugging.
21663
21664         * modifiers.cs: Do not use `parent', instead use the real type
21665         container to evaluate permission settings.
21666
21667         * class.cs: Put Ravi's patch back in.  He is right, and we will
21668         have to cope with the
21669
21670 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21671
21672         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21673         FamORAssem, not FamANDAssem.
21674
21675 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21676
21677         * driver.cs: Added --parse option that only parses its input files
21678         and terminates.
21679
21680         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21681         incorrect.  IsTopLevel is not used to tell whether an object is
21682         root_types or not (that can be achieved by testing this ==
21683         root_types).  But to see if this is a top-level *class* (not
21684         necessarly our "toplevel" container). 
21685
21686 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21687
21688         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21689         parent instead of a direct call to GetType.
21690
21691 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21692
21693         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21694         Modifiers.TypeAttr. This should just be a call to that method.
21695
21696         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21697         object so that we can determine if we are top-level or not.
21698
21699         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21700         TypeContainer too.
21701
21702         * enum.cs (Enum::Define): Ditto.
21703
21704         * modifiers.cs (FieldAttr): Re-write.
21705
21706         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21707         (TypeContainer::HaveStaticConstructor): New property to provide access
21708         to precisely that info.
21709
21710         * modifiers.cs (MethodAttr): Re-write.
21711         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21712
21713         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21714         of top-level types as claimed.
21715
21716 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21717
21718         * expression.cs (MemberLookup): Fruitless attempt to lookup
21719         constructors.  Maybe I need to emit default constructors?  That
21720         might be it (currently .NET emits this for me automatically).
21721         (Invocation::OverloadResolve): Cope with Arguments == null.
21722         (Invocation::EmitArguments): new function, shared by the new
21723         constructor and us.
21724         (Invocation::Emit): Handle static and instance methods.  Emit
21725         proper call instruction for virtual or non-virtual invocations.
21726         (New::Emit): Implement.
21727         (New::Resolve): Implement.
21728         (MemberAccess:Resolve): Implement.
21729         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21730         to track instances.
21731         (FieldExpr::Resolve): Set type.
21732
21733         * support.cs: Handle empty arguments.
21734                 
21735         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21736         SimpleLookup): Auxiliary routines to help parse a qualifier
21737         identifier.  
21738
21739         Update qualifier_identifier rule.
21740
21741         * codegen.cs: Removed debugging messages.
21742
21743         * class.cs: Make this a global thing, this acts just as a "key" to
21744         objects that we might have around.
21745
21746         (Populate): Only initialize method_builders_to_methods once.
21747
21748         * expression.cs (PropertyExpr): Initialize type from the
21749         PropertyType. 
21750
21751         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21752         Resolve pattern.  Attempt to implicitly convert value to boolean.
21753         Emit code.
21754
21755         * expression.cs: Set the type for the int32/int32 argument case.
21756         (Binary::ResolveOperator): Set the return type to boolean for
21757         comparission operators
21758
21759         * typemanager.cs: Remove debugging print code.
21760
21761         (Invocation::Resolve): resolve type.
21762
21763         * class.cs: Allocate a MemberInfo of the correct size, as the code
21764         elsewhere depends on the test to reflect the correct contents.
21765
21766         (Method::) Keep track of parameters, due to System.Reflection holes
21767
21768         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21769         mapping here.
21770
21771         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21772         of the exact size and return that.
21773
21774         (Class::LookupMethodByBuilder): New function that maps
21775         MethodBuilders to its methods.  Required to locate the information
21776         on methods because System.Reflection bit us again.
21777
21778         * support.cs: New file, contains an interface ParameterData and
21779         two implementations: ReflectionParameters and InternalParameters
21780         used to access Parameter information.  We will need to grow this
21781         as required.
21782
21783         * expression.cs (Invocation::GetParameterData): implement a cache
21784         and a wrapper around the ParameterData creation for methods. 
21785         (Invocation::OverloadResolve): Use new code.
21786
21787 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21788
21789         * class.cs (TypeContainer::EmitField): Remove and move into 
21790         (Field::Define): here and modify accordingly.
21791         (Field.FieldBuilder): New member.
21792         (TypeContainer::Populate): Update accordingly.
21793         (TypeContainer::FindMembers): Implement.
21794
21795 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21796
21797         * statement.cs: (VariableInfo::VariableType): New field to be
21798         initialized with the full type once it is resolved. 
21799
21800 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21801
21802         * parameter.cs (GetParameterInfo): Use a type cache to compute
21803         things only once, and to reuse this information
21804
21805         * expression.cs (LocalVariableReference::Emit): Implement.
21806         (OpcodeCast::Emit): fix.
21807
21808         (ParameterReference::Resolve): Implement.
21809         (ParameterReference::Emit): Implement.
21810
21811         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21812         that are expressions need to stay as Expressions.
21813
21814         * typemanager.cs (CSharpName): Returns the C# name of a type if
21815         possible. 
21816
21817         * expression.cs (Expression::ConvertImplicit): New function that
21818         implements implicit type conversions.
21819
21820         (Expression::ImplicitReferenceConversion): Implements implicit
21821         reference conversions.
21822
21823         (EmptyCast): New type for transparent casts.
21824
21825         (OpcodeCast): New type for casts of types that are performed with
21826         a sequence of bytecodes.
21827
21828         (BoxedCast): New type used for casting value types into reference
21829         types.  Emits a box opcode.
21830
21831         (Binary::DoNumericPromotions): Implements numeric promotions of
21832         and computation of the Binary::Type.
21833
21834         (Binary::EmitBranchable): Optimization.
21835
21836         (Binary::Emit): Implement code emission for expressions.
21837
21838         * typemanager.cs (TypeManager): Added two new core types: sbyte
21839         and byte.
21840
21841 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21842
21843         * class.cs (TypeContainer::FindMembers): Method which does exactly
21844         what Type.FindMembers does, only we don't have to use reflection. No
21845         implementation yet.
21846
21847         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21848         typecontainer objects as we need to get at them.
21849         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21850
21851         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21852         typecontainer object.
21853
21854         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21855         of just a Report object.
21856
21857 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21858
21859         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21860         "remove_"
21861         (TypeContainer::Populate): Now define the delegates of the type too.
21862         (TypeContainer.Delegates): Property to access the list of delegates defined
21863         in the type.
21864
21865         * delegates.cs (Delegate::Define): Implement partially.
21866
21867         * modifiers.cs (TypeAttr): Handle more flags.
21868
21869 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21870
21871         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21872         and not <=
21873         (Operator::Define): Re-write logic to get types by using the LookupType method
21874         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21875         (Indexer::Define): Ditto.
21876         (Event::Define): Ditto.
21877         (Property::Define): Ditto.
21878
21879 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21880
21881         * class.cs (TypeContainer::Populate): Now define operators too. 
21882         (TypeContainer.Operators): New property to access the list of operators
21883         in a type.
21884         (Operator.OperatorMethodBuilder): New member to hold the method builder
21885         for the operator we are defining.
21886         (Operator::Define): Implement.
21887
21888 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21889
21890         * class.cs (Event::Define): Make the prefixes of the accessor methods
21891         addOn_ and removeOn_ 
21892
21893         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21894         of the location being passed in too. Ideally, this should go later since all
21895         error reporting should be done through the Report object.
21896
21897         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21898         (Populate): Iterate thru the indexers we have and define them too.
21899         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21900         for the get and set accessors.
21901         (Indexer::Define): Implement.
21902
21903 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21904
21905         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21906         my previous implementation, did not work.
21907
21908         * typemanager.cs: Add a couple of missing types (the longs).
21909
21910         * literal.cs: Use TypeManager.bool_type instead of getting it.
21911
21912         * expression.cs (EventExpr): New kind of expressions.
21913         (Expressio::ExprClassFromMemberInfo): finish
21914
21915 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21916
21917         * assign.cs: Emit stores to static fields differently.
21918
21919 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21920
21921         * Merge in changes and adjust code to tackle conflicts. Backed out my
21922         code in Assign::Resolve ;-) 
21923
21924 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21925
21926         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21927         instead Report.Error and also pass in the location.
21928         (CSharpParser::Lexer): New readonly property to return the reference
21929         to the Tokenizer object.
21930         (declare_local_variables): Use Report.Error with location instead of plain 
21931         old error.
21932         (CheckDef): Ditto.
21933
21934         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21935         (Operator.CheckBinaryOperator): Ditto.
21936
21937         * cs-parser.jay (operator_declarator): Update accordingly.
21938
21939         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21940         (CheckBinaryOperator): Same here.
21941
21942         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21943         on the name without any prefixes of namespace names etc. This is because we
21944         already might have something already fully qualified like 
21945         'System.Console.WriteLine'
21946
21947         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21948
21949 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21950
21951         * cs-tokenizer.cs (location): Return a string which also contains
21952         the file name.
21953
21954         * expression.cs (ElementAccess): New class for expressions of the
21955         type 'element access.'
21956         (BaseAccess): New class for expressions of the type 'base access.'
21957         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21958         respectively.
21959
21960         * cs-parser.jay (element_access): Implement action.
21961         (base_access): Implement actions.
21962         (checked_expression, unchecked_expression): Implement.
21963
21964         * cs-parser.jay (local_variable_type): Correct and implement.
21965         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21966
21967         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21968
21969         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21970         name and the specifiers.
21971
21972         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21973
21974         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21975         making them all public ;-)
21976
21977         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21978         class anyways.
21979
21980 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21981
21982         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21983         PropertyExprs.
21984         (FieldExpr, PropertyExprs): New resolved expressions.
21985         (SimpleName::MemberStaticCheck): Perform static checks for access
21986         to non-static fields on static methods. Maybe this should be
21987         generalized for MemberAccesses. 
21988         (SimpleName::ResolveSimpleName): More work on simple name
21989         resolution. 
21990
21991         * cs-parser.jay (primary_expression/qualified_identifier): track
21992         the parameter index.
21993
21994         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21995         (EmitContext::EmitBoolExpression): Chain to expression generation
21996         instead of temporary hack.
21997         (::EmitStatementExpression): Put generic expression code generation.
21998
21999         * assign.cs (Assign::Emit): Implement variable assignments to
22000         local variables, parameters and fields.
22001
22002 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22003
22004         * statement.cs (Block::GetVariableInfo): New method, returns the
22005         VariableInfo for a variable name in a block.
22006         (Block::GetVariableType): Implement in terms of GetVariableInfo
22007
22008         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22009         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22010
22011 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22012
22013         * cs-parser.jay (operator_declaration): Continue on my quest : update
22014         to take attributes argument.
22015         (event_declaration): Ditto.
22016         (enum_declaration): Ditto.
22017         (indexer_declaration): Ditto.
22018
22019         * class.cs (Operator::Operator): Update constructor accordingly.
22020         (Event::Event): Ditto.
22021
22022         * delegate.cs (Delegate::Delegate): Same here.
22023
22024         * enum.cs (Enum::Enum): Same here.
22025
22026 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22027
22028         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22029
22030         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22031
22032         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22033         being passed around as an arraylist.
22034         (Attributes::AddAttribute): Method to add attribute sections.
22035
22036         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22037         (struct_declaration): Update accordingly.
22038         (constant_declaration): Update.
22039         (field_declaration): Update.
22040         (method_header): Update.
22041         (fixed_parameter): Update.
22042         (parameter_array): Ditto.
22043         (property_declaration): Ditto.
22044         (destructor_declaration): Ditto.
22045
22046         * class.cs (Struct::Struct): Update constructors accordingly.
22047         (Class::Class): Ditto.
22048         (Field::Field): Ditto.
22049         (Method::Method): Ditto.
22050         (Property::Property): Ditto.
22051         (TypeContainer::OptAttribute): update property's return type.
22052
22053         * interface.cs (Interface.opt_attributes): New member.
22054         (Interface::Interface): Update to take the extra Attributes argument.
22055
22056         * parameter.cs (Parameter::Parameter): Ditto.
22057
22058         * constant.cs (Constant::Constant): Ditto.
22059
22060         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22061         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22062         the attributes as a parameter.
22063         (InterfaceProperty): Update constructor call.
22064         (InterfaceEvent): Ditto.
22065         (InterfaceMethod): Ditto.
22066         (InterfaceIndexer): Ditto.
22067
22068         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22069         pass the attributes too.
22070         (interface_event_declaration): Ditto.
22071         (interface_property_declaration): Ditto.
22072         (interface_method_declaration): Ditto.
22073         (interface_declaration): Ditto.
22074
22075 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22076
22077         * class.cs (Method::Define): Track the "static Main" definition to
22078         create an entry point. 
22079
22080         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22081         EntryPoint if we find it. 
22082
22083         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22084         (EmitContext::ig): Make this variable public.
22085
22086         * driver.cs: Make the default output file be the first file name
22087         with the .exe extension.  
22088
22089         Detect empty compilations
22090
22091         Handle various kinds of output targets.  Handle --target and
22092         rename -t to --dumper.
22093
22094         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22095         methods inherited from Expression return now an Expression.  This
22096         will is used during the tree rewriting as we resolve them during
22097         semantic analysis.
22098
22099         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22100         the spec.  Missing entirely is the information about
22101         accessability of elements of it.
22102
22103         (Expression::ExprClassFromMemberInfo): New constructor for
22104         Expressions that creates a fully initialized Expression based on
22105         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22106         a Type.
22107
22108         (Invocation::Resolve): Begin implementing resolution of invocations.
22109
22110         * literal.cs (StringLiteral):  Implement Emit.
22111
22112 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22113
22114         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22115         member.
22116
22117 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22118
22119         * cs-parser.jay (attribute_arguments): Implement actions.
22120         (attribute): Fix bug in production. Implement action.
22121         (attribute_list): Implement.
22122         (attribute_target): Implement.
22123         (attribute_target_specifier, opt_target_specifier): Implement
22124         (CheckAttributeTarget): New method to check if the attribute target
22125         is valid.
22126         (attribute_section): Implement.
22127         (opt_attributes): Implement.
22128
22129         * attribute.cs : New file to handle attributes.
22130         (Attribute): Class to hold attribute info.
22131
22132         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22133         (attribute_section): Modify production to use 2 different rules to 
22134         achieve the same thing. 1 s/r conflict down !
22135         Clean out commented, useless, non-reducing dimension_separator rules.
22136
22137         * class.cs (TypeContainer.attributes): New member to hold list
22138         of attributes for a type.
22139         (Struct::Struct): Modify to take one more argument, the attribute list.
22140         (Class::Class): Ditto.
22141         (Field::Field): Ditto.
22142         (Method::Method): Ditto.
22143         (Property::Property): Ditto.
22144
22145         * cs-parser.jay (struct_declaration): Update constructor call to
22146         pass in the attributes too.
22147         (class_declaration): Ditto.
22148         (constant_declaration): Ditto.
22149         (field_declaration): Ditto.
22150         (method_header): Ditto.
22151         (fixed_parameter): Ditto.
22152         (parameter_array): Ditto.
22153         (property_declaration): Ditto.
22154
22155         * constant.cs (Constant::Constant): Update constructor similarly.
22156         Use System.Collections.
22157
22158         * parameter.cs (Parameter::Parameter): Update as above.
22159
22160 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22161
22162         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22163         (TypeContainer.delegates): New member to hold list of delegates.
22164
22165         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22166         this time as I seem to be on crack ;-)
22167
22168 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22169
22170         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22171         tell whether an identifier represents a namespace.
22172
22173         * expression.cs (NamespaceExpr): A namespace expression, used only
22174         temporarly during expression resolution.
22175         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22176         utility functions to resolve names on expressions.
22177
22178 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22179
22180         * codegen.cs: Add hook for StatementExpressions. 
22181
22182         * class.cs: Fix inverted test for static flag in methods.
22183
22184 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22185
22186         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22187         to make it coincide with MS' number.
22188         (Operator::CheckBinaryOperator): Ditto.
22189
22190         * ../errors/errors.txt : Remove error numbers added earlier.
22191
22192         * ../errors/cs1019.cs : Test case for error # 1019
22193
22194         * ../errros/cs1020.cs : Test case for error # 1020
22195
22196         * cs-parser.jay : Clean out commented cruft.
22197         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22198         used anywhere - non-reducing rule.
22199         (namespace_declarations): Non-reducing rule - comment out.
22200
22201         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22202         with TypeContainer::AddEnum.
22203
22204         * delegate.cs : New file for delegate handling classes.
22205         (Delegate): Class for declaring delegates.
22206
22207         * makefile : Update.
22208
22209         * cs-parser.jay (delegate_declaration): Implement.
22210
22211 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22212
22213         * class.cs (Event::Define): Implement.
22214         (Event.EventBuilder): New member.
22215
22216         * class.cs (TypeContainer::Populate): Update to define all enums and events
22217         we have.
22218         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22219         readonly fields for all these cases ?
22220
22221 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22222
22223         * class.cs (Property): Revamp to use the convention of making fields readonly.
22224         Accordingly modify code elsewhere.
22225
22226         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22227         the Define method of the Property class.
22228
22229         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22230         trivial bug.
22231         (TypeContainer::Populate): Update to define all the properties we have. Also
22232         define all enumerations.
22233
22234         * enum.cs (Define): Implement.
22235
22236 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22237
22238         * cs-parser.jay (overloadable_operator): The semantic value is an
22239         enum of the Operator class.
22240         (operator_declarator): Implement actions.
22241         (operator_declaration): Implement.
22242
22243         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22244         validity of definitions.
22245         (Operator::CheckBinaryOperator): Static method to check for binary operators
22246         (TypeContainer::AddOperator): New method to add an operator to a type.
22247
22248         * cs-parser.jay (indexer_declaration): Added line to actually call the
22249         AddIndexer method so it gets added ;-)
22250
22251         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22252         already taken care of by the MS compiler ?  
22253
22254 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22255
22256         * class.cs (Operator): New class for operator declarations.
22257         (Operator::OpType): Enum for the various operators.
22258
22259 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22260
22261         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22262         ostensibly handle this in semantic analysis.
22263
22264         * cs-parser.jay (general_catch_clause): Comment out
22265         (specific_catch_clauses, specific_catch_clause): Ditto.
22266         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22267         (catch_args, opt_catch_args): New productions.
22268         (catch_clause): Rewrite to use the new productions above
22269         (catch_clauses): Modify accordingly.
22270         (opt_catch_clauses): New production to use in try_statement
22271         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22272         and re-write the code in the actions to extract the specific and
22273         general catch clauses by being a little smart ;-)
22274
22275         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22276         Hooray, try and catch statements parse fine !
22277
22278 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22279
22280         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22281         string from the hashtable of variables.
22282
22283         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22284         I end up making that mistake ;-)
22285         (catch_clauses): Fixed gross error which made Key and Value of the 
22286         DictionaryEntry the same : $1 !!
22287
22288 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22289
22290         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22291
22292         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22293         when the add and remove accessors are specified. 
22294
22295 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22296
22297         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22298         information about indexer_declarator.
22299         (indexer_declarator): Implement actions.
22300         (parsing_indexer): New local boolean used to keep track of whether
22301         we are parsing indexers or properties. This is necessary because 
22302         implicit_parameters come into picture even for the get accessor in the 
22303         case of an indexer.
22304         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22305
22306         * class.cs (Indexer): New class for indexer declarations.
22307         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22308         (TypeContainer::indexers): New member to hold list of indexers for the
22309         type.
22310
22311 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22312
22313         * cs-parser.jay (add_accessor_declaration): Implement action.
22314         (remove_accessor_declaration): Implement action.
22315         (event_accessors_declaration): Implement
22316         (variable_declarators): swap statements for first rule - trivial.
22317
22318         * class.cs (Event): New class to hold information about event
22319         declarations.
22320         (TypeContainer::AddEvent): New method to add an event to a type
22321         (TypeContainer::events): New member to hold list of events.
22322
22323         * cs-parser.jay (event_declaration): Implement actions.
22324
22325 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22326
22327         * cs-parser.jay (dim_separators): Implement. Make it a string
22328         concatenating all the commas together, just as they appear.
22329         (opt_dim_separators): Modify accordingly
22330         (rank_specifiers): Update accordingly. Basically do the same
22331         thing - instead, collect the brackets here.
22332         (opt_rank_sepcifiers): Modify accordingly.
22333         (array_type): Modify to actually return the complete type string
22334         instead of ignoring the rank_specifiers.
22335         (expression_list): Implement to collect the expressions
22336         (variable_initializer): Implement. We make it a list of expressions
22337         essentially so that we can handle the array_initializer case neatly too.
22338         (variable_initializer_list): Implement.
22339         (array_initializer): Make it a list of variable_initializers
22340         (opt_array_initializer): Modify accordingly.
22341
22342         * expression.cs (New::NType): Add enumeration to help us
22343         keep track of whether we have an object/delegate creation
22344         or an array creation.
22345         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22346         members to hold data about array creation.
22347         (New:New): Modify to update NewType
22348         (New:New): New Overloaded contructor for the array creation
22349         case.
22350
22351         * cs-parser.jay (array_creation_expression): Implement to call
22352         the overloaded New constructor.
22353
22354 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22355
22356         * class.cs (TypeContainer::Constructors): Return member
22357         constructors instead of returning null.
22358
22359 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22360
22361         * typemanager.cs (InitCoreTypes): Initialize the various core
22362         types after we have populated the type manager with the user
22363         defined types (this distinction will be important later while
22364         compiling corlib.dll)
22365
22366         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22367         on Expression Classification.  Now all expressions have a method
22368         `Resolve' and a method `Emit'.
22369
22370         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22371         generation from working.     Also add some temporary debugging
22372         code. 
22373
22374 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22375
22376         * codegen.cs: Lots of code generation pieces.  This is only the
22377         beginning, will continue tomorrow with more touches of polish.  We
22378         handle the fundamentals of if, while, do, for, return.  Others are
22379         trickier and I need to start working on invocations soon.
22380
22381         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22382         s.InitStatement. 
22383
22384         * codegen.cs (EmitContext): New struct, used during code
22385         emission to keep a context.   Most of the code generation will be
22386         here. 
22387
22388         * cs-parser.jay: Add embedded blocks to the list of statements of
22389         this block.  So code generation proceeds in a top down fashion.
22390
22391 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22392
22393         * statement.cs: Add support for multiple child blocks.
22394
22395 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22396
22397         * codegen.cs (EmitCode): New function, will emit the code for a
22398         Block of code given a TypeContainer and its ILGenerator. 
22399
22400         * statement.cs (Block): Standard public readonly optimization.
22401         (Block::Block constructors): Link children. 
22402         (Block::Child): Child Linker.
22403         (Block::EmitVariables): Emits IL variable declarations.
22404
22405         * class.cs: Drop support for MethodGroups here, delay until
22406         Semantic Analysis.
22407         (Method::): Applied the same simplification that I did before, and
22408         move from Properties to public readonly fields.
22409         (Method::ParameterTypes): Returns the parameter types for the
22410         function, and implements a cache that will be useful later when I
22411         do error checking and the semantic analysis on the methods is
22412         performed.
22413         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22414         and made a method, optional argument tells whether this is a class
22415         or a structure to apply the `has-this' bit.
22416         (Method::GetCallingConvention): Implement, returns the calling
22417         convention. 
22418         (Method::Define): Defines the type, a second pass is performed
22419         later to populate the methods.
22420
22421         (Constructor::ParameterTypes): implement a cache similar to the
22422         one on Method::ParameterTypes, useful later when we do semantic
22423         analysis. 
22424
22425         (TypeContainer::EmitMethod):  New method.  Emits methods.
22426
22427         * expression.cs: Removed MethodGroup class from here.
22428
22429         * parameter.cs (Parameters::GetCallingConvention): new method.
22430
22431 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22432
22433         * class.cs (TypeContainer::Populate): Drop RootContext from the
22434         argument. 
22435
22436         (Constructor::CallingConvention): Returns the calling convention.
22437         (Constructor::ParameterTypes): Returns the constructor parameter
22438         types. 
22439
22440         (TypeContainer::AddConstructor): Keep track of default constructor
22441         and the default static constructor.
22442
22443         (Constructor::) Another class that starts using `public readonly'
22444         instead of properties. 
22445
22446         (Constructor::IsDefault): Whether this is a default constructor. 
22447
22448         (Field::) use readonly public fields instead of properties also.
22449
22450         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22451         track of static constructors;  If none is used, turn on
22452         BeforeFieldInit in the TypeAttributes. 
22453
22454         * cs-parser.jay (opt_argument_list): now the return can be null
22455         for the cases where there are no arguments. 
22456
22457         (constructor_declarator): If there is no implicit `base' or
22458         `this', then invoke the default parent constructor. 
22459
22460         * modifiers.cs (MethodAttr): New static function maps a set of
22461         modifiers flags into a MethodAttributes enum
22462         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22463         MethodAttr, TypeAttr to represent the various mappings where the
22464         modifiers are used.
22465         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22466
22467 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22468
22469         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22470         method arguments.
22471
22472         * interface.cs (PopulateIndexer): Implemented the code generator
22473         for interface indexers.
22474
22475 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22476
22477         * interface.cs (InterfaceMemberBase): Now we track the new status
22478         here.  
22479
22480         (PopulateProperty): Implement property population.  Woohoo!  Got
22481         Methods and Properties going today. 
22482
22483         Removed all the properties for interfaces, and replaced them with
22484         `public readonly' fields. 
22485
22486 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22487
22488         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22489         initialize their hashtables/arraylists only when they are needed
22490         instead of doing this always.
22491
22492         * parameter.cs: Handle refs and out parameters.
22493
22494         * cs-parser.jay: Use an ArrayList to construct the arguments
22495         instead of the ParameterCollection, and then cast that to a
22496         Parameter[] array.
22497
22498         * parameter.cs: Drop the use of ParameterCollection and use
22499         instead arrays of Parameters.
22500
22501         (GetParameterInfo): Use the Type, not the Name when resolving
22502         types. 
22503
22504 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22505
22506         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22507         and instead use public readonly fields.
22508
22509         * class.cs: Put back walking code for type containers.
22510
22511 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22512
22513         * class.cs (MakeConstant): Code to define constants.
22514
22515         * rootcontext.cs (LookupType): New function.  Used to locate types 
22516
22517
22518 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22519
22520         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22521         this System.Reflection code is.  Kudos to Microsoft
22522
22523         * typemanager.cs: Implement a type cache and avoid loading all
22524         types at boot time.  Wrap in LookupType the internals.  This made
22525         the compiler so much faster.  Wow.  I rule!
22526
22527         * driver.cs: Make sure we always load mscorlib first (for
22528         debugging purposes, nothing really important).
22529
22530         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22531         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22532
22533         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22534         on namespaces that have been imported using the `using' keyword.
22535
22536         * class.cs (TypeContainer::TypeAttr): Virtualize.
22537         (Class::TypeAttr): Return attributes suitable for this bad boy.
22538         (Struct::TypeAttr): ditto.
22539         Handle nested classes.
22540         (TypeContainer::) Remove all the type visiting code, it is now
22541         replaced with the rootcontext.cs code
22542
22543         * rootcontext.cs (GetClassBases): Added support for structs. 
22544
22545 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22546
22547         * interface.cs, statement.cs, class.cs, parameter.cs,
22548         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22549         Drop use of TypeRefs, and use strings instead.
22550
22551 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22552
22553         * rootcontext.cs: 
22554
22555         * class.cs (Struct::Struct): set the SEALED flags after
22556         checking the modifiers.
22557         (TypeContainer::TypeAttr): new property, returns the
22558         TypeAttributes for a class.  
22559
22560         * cs-parser.jay (type_list): Oops, list production was creating a
22561         new list of base types.
22562
22563         * rootcontext.cs (StdLib): New property.
22564         (GetInterfaceTypeByName): returns an interface by type name, and
22565         encapsulates error handling here.
22566         (GetInterfaces): simplified.
22567         (ResolveTree): Encapsulated all the tree resolution here.
22568         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22569         types. 
22570
22571         * driver.cs: Add support for --nostdlib, to avoid loading the
22572         default assemblies.
22573         (Main): Do not put tree resolution here. 
22574
22575         * rootcontext.cs: Beginning of the class resolution.
22576
22577 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22578
22579         * rootcontext.cs: Provide better error reporting. 
22580
22581         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22582
22583         * rootcontext.cs (CreateInterface): Handle the case where there
22584         are no parent interfaces.
22585
22586         (CloseTypes): Routine to flush types at the end.
22587         (CreateInterface): Track types.
22588         (GetInterfaces): Returns an array of Types from the list of
22589         defined interfaces.
22590
22591         * typemanager.c (AddUserType): Mechanism to track user types (puts
22592         the type on the global type hash, and allows us to close it at the
22593         end). 
22594
22595 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22596
22597         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22598         RecordInterface instead.
22599
22600         * cs-parser.jay: Updated to reflect changes above.
22601
22602         * decl.cs (Definition): Keep track of the TypeBuilder type that
22603         represents this type here.  Not sure we will use it in the long
22604         run, but wont hurt for now.
22605
22606         * driver.cs: Smaller changes to accomodate the new code.
22607
22608         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22609         when done. 
22610
22611         * rootcontext.cs (CreateInterface):  New method, used to create
22612         the System.TypeBuilder type for interfaces.
22613         (ResolveInterfaces): new entry point to resolve the interface
22614         hierarchy. 
22615         (CodeGen): Property, used to keep track of the code generator.
22616
22617 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22618
22619         * cs-parser.jay: Add a second production for delegate_declaration
22620         with `VOID'.
22621
22622         (enum_body): Put an opt_comma here instead of putting it on
22623         enum_body or enum_member_declarations so we can handle trailing
22624         commas on enumeration members.  Gets rid of a shift/reduce.
22625
22626         (type_list): Need a COMMA in the middle.
22627
22628         (indexer_declaration): Tell tokenizer to recognize get/set
22629
22630         * Remove old targets.
22631
22632         * Re-add the parser target.
22633
22634 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22635
22636         * cs-parser.jay: Add precendence rules for a number of operators
22637         ot reduce the number of shift/reduce conflicts in the grammar.
22638
22639 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22640
22641         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22642         and put it here.
22643
22644         Get rid of old crufty code.
22645
22646         * rootcontext.cs: Use this to keep track of the parsed
22647         representation and the defined types available to the program. 
22648
22649         * gen-treedump.cs: adjust for new convention.
22650
22651         * type.cs: Split out the type manager, and the assembly builder
22652         from here. 
22653
22654         * typemanager.cs: the type manager will live here now.
22655
22656         * cil-codegen.cs: And the code generator here. 
22657
22658 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22659
22660         * makefile: Fixed up for easy making.
22661
22662 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22663
22664         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22665         the 
22666
22667         (unary_expression): Expand pre_increment_expression and
22668         post_decrement_expression to reduce a shift/reduce.
22669
22670 2001-07-11  Simon Cozens
22671
22672         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22673
22674         Improve allow_keyword_as_indent name.
22675
22676 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22677
22678         * Adjustments for Beta2. 
22679
22680 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22681
22682         * decl.cs: Added `Define' abstract method.
22683         (InTransit): new property, used to catch recursive definitions. 
22684
22685         * interface.cs: Implement `Define'. 
22686
22687         * modifiers.cs: Map Modifiers.constants to
22688         System.Reflection.TypeAttribute flags.
22689
22690         * class.cs: Keep track of types and user-defined types.
22691         (BuilderInit): New method for creating an assembly
22692         (ResolveType): New function to launch the resolution process, only
22693         used by interfaces for now.
22694
22695         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22696         that are inserted into the name space. 
22697
22698 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22699
22700         * ARGH.  I have screwed up my tree so many times due to the use of
22701         rsync rather than using CVS.  Going to fix this at once. 
22702
22703         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22704         load types.
22705
22706 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22707
22708         * Experiment successful: Use System.Type rather that our own
22709         version of Type.  
22710
22711 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22712
22713         * cs-parser.jay: Removed nsAliases from here.
22714
22715         Use new namespaces, handle `using XXX;' 
22716
22717         * namespace.cs: Reimplemented namespace handling, use a recursive
22718         definition of the class.  Now we can keep track of using clauses
22719         and catch invalid using clauses.
22720
22721 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22722
22723         * gen-treedump.cs: Adapted for all the renaming.
22724
22725         * expression.cs (Expression): this class now has a Type property
22726         which returns an expression Type.
22727
22728         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22729         `Type', as this has a different meaning now in the base
22730
22731 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22732
22733         * interface.cs, class.cs: Removed from all the sources the
22734         references to signature computation, as we can not do method
22735         signature computation during the parsing time, as we are not
22736         trying to solve at that point distinguishing:
22737
22738         class X {
22739                 void a (Blah x) {}
22740                 void a (NS.Blah x) {}
22741         }
22742
22743         Which depending on the context might be valid or not, as we do not
22744         know if Blah is the same thing as NS.Blah at that point.
22745
22746         * Redid everything so the code uses TypeRefs now instead of
22747         Types.  TypeRefs are just temporary type placeholders, that need
22748         to be resolved.  They initially have a pointer to a string and the
22749         current scope in which they are used.  This is used later by the
22750         compiler to resolve the reference to an actual Type. 
22751
22752         * DeclSpace is no longer a CIR.Type, and neither are
22753         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22754         are all DeclSpaces, but no Types. 
22755
22756         * type.cs (TypeRefManager): This implements the TypeRef manager,
22757         which keeps track of all the types that need to be resolved after
22758         the parsing has finished. 
22759
22760 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22761
22762         * ARGH.  We are going to have to store `foreach' as a class rather
22763         than resolving it, as we need to verify error 1579 after name
22764         resolution.   *OR* we could keep a flag that says `This request to
22765         IEnumerator comes from a foreach statement' which we can then use
22766         to generate the error.
22767
22768 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22769
22770         * class.cs (TypeContainer.AddMethod): we now add methods to the
22771         MethodGroup instead of the method hashtable.  
22772
22773         * expression.cs: Add MethodGroup abstraction, which gets us one
22774         step closer to the specification in the way we handle method
22775         declarations.  
22776
22777         * cs-parser.jay (primary_expression): qualified_identifier now
22778         tried to match up an identifier to a local variable reference or
22779         to a parameter reference.
22780
22781         current_local_parameters is now a parser global variable that
22782         points to the current parameters for the block, used during name
22783         lookup.
22784
22785         (property_declaration): Now creates an implicit `value' argument to
22786         the set accessor.
22787
22788 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22789
22790         * parameter.cs: Do not use `param' arguments as part of the
22791         signature, per the spec.
22792
22793 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22794
22795         * decl.cs: Base class for classes, structs and interfaces.  This
22796         is the "Declaration Space" 
22797
22798         * cs-parser.jay: Use CheckDef for checking declaration errors
22799         instead of having one on each function.
22800
22801         * class.cs: Factor out some code for handling error handling in
22802         accordance to the "Declarations" section in the "Basic Concepts"
22803         chapter in the ECMA C# spec.
22804
22805         * interface.cs: Make all interface member classes derive from
22806         InterfaceMemberBase.
22807
22808 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22809
22810         * Many things: all interfaces are parsed and generated in
22811         gen-treedump.  Support for member variables, constructors,
22812         destructors, properties, constants is there.
22813
22814         Beginning of the IL backend, but very little done, just there for
22815         testing purposes. 
22816
22817 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22818
22819         * cs-parser.jay: Fix labeled statement.
22820
22821         * cs-tokenizer.cs (escape): Escape " and ' always.
22822         ref_line, ref_name: keep track of the line/filename as instructed
22823         by #line by the compiler.
22824         Parse #line.
22825
22826 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22827
22828         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22829         to match the values in System.CodeDOM.
22830
22831         Divid renamed to Divide.
22832
22833         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22834         statements. 
22835         (Statements.set): remove.
22836
22837         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22838         statements. 
22839
22840         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22841         falseStatements always have valid values. 
22842
22843         * cs-parser.jay: Use System.CodeDOM now.
22844