**** Merged r47904 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2
3         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4         New method, looking for lo-case imported cls type.
5
6         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7         here.
8
9         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10
11         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12
13         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
14         all_imported_types.
15         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
16
17         Optimized to save 3.5 MB for SWF compilation.
18
19 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
20
21         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
22         (PartialContainer.Create): Moved logic AddToContainer.
23         (PartialContainer.MarkForDuplicationCheck): Shares name.
24         
25         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
26         place.
27         
28         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
29         initialization.
30         (Namespace.GetSignatureForError): New method.
31         
32         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
33         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
34
35 2005-08-01  Raja R Harinath  <rharinath@novell.com>
36
37         Fix #75669.
38         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
39         member lookup rather than qualifier_type, since qualifier_type can
40         be null.
41
42 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
43
44         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
45         enum member.
46
47 2005-07-31  Miguel de Icaza  <miguel@novell.com>
48
49         * statement.cs: Copy the local exception into the exception
50         captured local.  Fixes 75674
51
52 2005-07-31  Raja R Harinath  <harinath@gmail.com>
53
54         Fix #75658.
55         * expression.cs (Invocation.OverloadResolve): Don't report error
56         CS1501 if error CS1502 has been reported.
57         (New.DoResolve): Delegate CS1501 reporting to
58         Invocation.OverloadResolve.
59
60         Fix #75656.
61         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
62         invariant-meaning-in-block property in an enclosing block if
63         necessary.
64
65 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
66
67         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
68         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
69         (Switch.CheckSwitch): Just save 50kb for SWF.
70
71 2005-07-27  Martin Baulig  <martin@ximian.com>
72
73         * anonymous.cs (CaptureContext.AddField): Added
74         `AnonymousContainer am' argument; compute its toplevel scope if
75         it's not already computed.  Fixes #75649.
76
77 2005-07-26  Raja R Harinath  <rharinath@novell.com>
78
79         Fix #75628.
80         * class.cs (Constructor.Emit): Reset block to null if the block
81         resolve fails.
82
83 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
84
85         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
86
87 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
88
89         * class.cs (MethodData.Define): Check whether accessor implementing
90         interface is public.
91
92         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
93
94 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
95
96         Fix #57245
97         * namespace.cs (LookupType): Moved same type check to...
98         
99         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
100         with the same name.
101
102 2005-07-21  Raja R Harinath  <rharinath@novell.com>
103
104         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
105         already found a typebuilder.
106         * class.cs (MethodCore.IsDuplicateImplementation): Compare
107         MemberNames, not strings.
108
109         * const.cs (Error_ExpressionMustBeConst): 
110         Rename from Error_EpressionMustBeConst.
111         * const.cs, class.cs, statement.cd: Update.
112
113 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
114
115         Fix #65573
116
117         * const.cs (Const.LookupConstantValue): Report missing contant expression
118         everytime.
119         (Error_EpressionMustBeConstant): Only one error method.
120
121         * class.cs, statement.c: Updated.
122
123 2005-07-20  Raja R Harinath  <rharinath@novell.com>
124
125         * statement.cs (Block.Flags): Add back HasVarargs.
126         (Block.flags): Make protected.
127         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
128
129         * typemanager.cs (types, typecontainers, user_types): Remove.
130         (UserTypes, TypeContainers): Likewise.
131         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
132         (CleanUp, Reset): Update.
133         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
134         (GetNestedType): Use Type.GetNestedType.
135         (CoreLookupType): Take two arguments, the namespace and the
136         basename of the type.  Update to use the Namespace.Lookup
137         mechanism.
138         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
139         (RealMemberLookup): Use IsNestedChildOf instead of playing with
140         string concatenation and substring matches.
141         * class.cs, enum.cs, delegate.cs: Update to changes.
142
143 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
144
145         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
146         Expression and made virtual.
147
148         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
149         (ImplicitStandardConversionExists): Fixed `byte' typo ?
150
151         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
152
153         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
154         error message.
155
156         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
157         change.
158
159 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
160
161         Fix #57707
162         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
163         AssemblyCultureAttribute is not used on executable.
164
165         * rootcontext.cs,
166         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
167
168 2005-07-16  Raja R Harinath  <rharinath@novell.com>
169
170         Fix #60638.
171         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
172         New.  Reports CS0252/CS0253.
173         Mostly taken from preliminary patch by Duncak Mak.
174         (Binary.DoResolveOperator): Store results of operator lookup.
175         Use them to detect if we need to warn about unintended reference
176         comparisons.
177
178 2005-07-15  Raja R Harinath  <rharinath@novell.com>
179
180         Fix #72969.
181         * namespace.cs (Namespace.Lookup): Add back location parameter.
182         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
183         * delegate.cs, ecore.cs, expression.cs: Update to changes.
184
185         * codegen.cs (EmitContext.DeclSpace): Make readonly.
186         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
187         (Namespace.LookupType): ... this.
188         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
189         of namespaces.
190         * typemanager.cs (LookupTypeReflection): Remove buggy code that
191         purported to handle pointers.
192         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
193         CoreLookupType.
194
195 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
196
197         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
198         type as namespace.
199
200 2005-07-15  Raja R Harinath  <rharinath@novell.com>
201
202         * namespace.cs (Namespace.Lookup): Drop location parameter.
203         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
204         (NamespaceEntry.Lookup): ... this.
205         (NamespaceEntry.Error_AmbiguousTypeReference):
206         Move here from DeclSpace.
207         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
208         names ...
209         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
210         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
211         Move to NamespaceEntry.
212         * delegate.cs, expression.cs: Update to changes.
213
214 2005-08-31  Martin Baulig  <martin@ximian.com>
215
216         Committing a patch from Atsushi Enomoto for #75850.
217
218         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
219         Prefer a generic enumerator over a non-generic one.
220
221 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
222
223         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
224         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
225
226 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
227
228         * driver.cs : reverting default encoding change as well as mcs.
229
230 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
231
232         * driver.cs, support.cs : merged r48826.
233           Marek Safer wrote:
234           > could you integrate your mcs changes to gmcs otherwise
235           > gmcs cannot compile some files.
236
237 2005-08-20  Martin Baulig  <martin@ximian.com>
238
239         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
240         scope if we don't already have it.
241
242         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
243         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
244         fixes #75867.
245
246 2005-07-31  Miguel de Icaza  <miguel@novell.com>
247
248         * statement.cs: Copy the local exception into the exception
249         captured local.  Fixes 75674
250
251 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
252
253         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
254         type as namespace.
255
256 2005-08-12  Martin Baulig  <martin@ximian.com>
257
258         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
259         for nested types here to avoid hitting the cache too early.
260
261 2005-08-09  Miguel de Icaza  <miguel@novell.com>
262
263         * enum.cs: On the new compiler CLS error 3005 is now a warning not
264         an error. 
265
266 2005-08-03  Martin Baulig  <martin@ximian.com>
267
268         Make iterators in generic methods work; see gtest-191.cs.
269
270         * generic.cs
271         (Constraints.Resolve): Protect against being called twice.
272
273         * class.cs
274         (TypeContainer.GetClassBases): Make this `protected virtual'.
275
276         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
277         (Iterator.GetClassBases): Override this and compute the base
278         classes here.
279         (Iterator.DefineNestedTypes): If we're a generic method, all our
280         method type parameters become class type parameters on the proxy
281         class.
282
283         * statement.cs
284         (ToplevelBlock.Parameters): Make this a property, not a field.
285         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
286
287 2005-08-03  Martin Baulig  <martin@ximian.com>
288
289         * typemanager.cs (TypeManager.IsSubclassOf): Use
290         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
291         (TypeManager.GetFullName_recursed): Improved.
292
293 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
294
295         Fix #75417
296         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
297         Private accessor case, using TypeManager.IsPrivateAccessible instead of
298         invocation_type == mi.DeclaringType, since the first one also checks
299         other condition used by generic instances.
300         
301 2005-07-27  Martin Baulig  <martin@ximian.com>
302
303         * anonymous.cs (CaptureContext.AddField): Added
304         `AnonymousContainer am' argument; compute its toplevel scope if
305         it's not already computed.  Fixes #75649.
306
307 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
308
309         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
310         CheckAttributeType and refactored.
311         (Attribute.ResolvePossibleAttributeType): Changed to reuse
312         ResolveAsTypeTerminal error handling.
313         (ResolveAsTypeTerminal): Introduced because of global attributes extra
314         handling.
315         (GetSignatureForError): Print errors in same way.
316
317         * class.cs,
318         * codegen.cs: Reflect attribute GetSignatureForError change.
319
320         * ecore.cs,
321         * expression.cs: Add silent parameter to ResolveAsTypeStep.
322
323         * namespace.cs (UsingEntry): Refactored to make fields private.
324
325         * assign.cs,
326         statement.cs: Error_UnexpectedKind has extra parameter.
327
328 2005-07-14  Raja R Harinath  <rharinath@novell.com>
329
330         * ecore.cs (IAlias): Remove.
331         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
332         that implement the interface.
333         * namespace.cs (Namespace): Likewise.
334         (Namespace.declspaces): Renamed from 'defined_names'.
335         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
336         DeclSpace instead of an IAlias.
337         * tree.cs (Tree.AddDecl): Update.
338
339 2005-07-12  Raja R Harinath  <rharinath@novell.com>
340
341         * statement.cs (Block.Flags); Remove HasVarargs.
342         (Block.HasVarargs): Move to ToplevelBlock.
343         (Block.ThisVariable, Block.AddThisVariable): Likewise.
344         (Block.Variables): Make protected.  Initialize variable hashtable
345         if necessary.
346         (Block.AddVariable): Update.
347         (Block.Resolve): Update to changes.
348         (ToplevelBlock.HasVarargs): New boolean.
349         (ToplevelBlock.ThisVariable): Move here from Block.
350         (ToplevelBlock.AddThisVariable): Likewise.
351         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
352         * expression.cs (This.ResolveBase): Update to changes.
353         (ArglistAccess.DoResolve): Likewise.
354
355 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
356
357         Fix #75321
358         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
359
360         * class.cs (TypeContainer.VerifyMembers): Distinguish between
361         not used and not used & assigned.
362         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
363
364 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
365
366         Fix #75053
367         * expression.cs (Is.DoResolve): null is never provided type.
368
369 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
370
371         Fix #52496
372         * cs-parser.jay: Less strict event error rule to catch more errors.
373
374 2005-07-11  Martin Baulig  <martin@ximian.com>
375
376         * generic.cs (ConstructedType.CheckConstraints): Improve the check
377         for the constructor constraint: we do not only have to check
378         whether the class has a public constructor, but also ensure that
379         it's parameterless.  Fixes #75492.
380
381 2005-07-11  Martin Baulig  <martin@ximian.com>
382
383         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
384         between type parameters if they either have the reference type
385         constraint or the class constraint.
386
387 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
388
389         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
390
391 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
392
393         Fix #74975
394         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
395         (ExtractSecurityPermissionSet): Cope with self referencing security
396         attributes properly.
397
398         * driver.cs (SetOutputFile): Made public property OutputFile.
399
400 2005-07-07  Raja R Harinath  <rharinath@novell.com>
401
402         Fix #75486.
403         * class.cs (TypeContainer.first_nonstatic_field): Rename from
404         has_nonstatic_fields.  Make into a FieldBase pointer.
405         (TypeContainer.AddField): Add CS0282 check.
406         (TypeContainer.EmitType): Update.
407
408 2005-07-06  Miguel de Icaza  <miguel@novell.com>
409
410         * cs-tokenizer.cs (consume_identifier): Do not create strings to
411         compare if they start with __.
412
413 2005-07-06  Raja R Harinath  <rharinath@novell.com>
414
415         * statement.cs (Switch.SwitchGoverningType): Only look at
416         UserCasts that don't need implicit standard conversions to one of
417         the allowed switch types (Fixes test-322.cs).
418         (LocalInfo.Resolve): Re-enable sanity-test.
419
420 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
421
422         * cs-tokenizer.cs (consume_identifier): Detect double undescores
423         
424         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
425         
426         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
427
428 2005-07-06  Raja R Harinath  <rharinath@novell.com>
429
430         Fix #75472.
431         * ecore.cs (SimpleName.GetSignatureForError): Add.
432         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
433         (MemberAccess.GetSignatureForError): Add.
434
435 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
436  
437         The big error and warning messages review.
438         
439         * anonymous.cs,
440         * assign.cs,
441         * attribute.cs,
442         * class.cs,
443         * codegen.cs,
444         * convert.cs,
445         * cs-parser.jay,
446         * cs-tokenizer.cs,
447         * decl.cs,
448         * delegate.cs,
449         * doc.cs,
450         * driver.cs,
451         * ecore.cs,
452         * enum.cs,
453         * expression.cs,
454         * flowanalysis.cs,
455         * iterators.cs,
456         * literal.cs,
457         * location.cs,
458         * modifiers.cs,
459         * namespace.cs,
460         * parameter.cs,
461         * pending.cs,
462         * report.cs,
463         * rootcontext.cs,
464         * statement.cs,
465         * support.cs,
466         * tree.cs,
467         * typemanager.cs: Updated.
468         
469         * class.cs: (MethodCore.SetYields): Moved here to share.
470         (PropertyMethod.Define): Moved iterator setup here.
471         
472         * iterators.cs: Add orig_method to have full access to parent
473         container.
474
475 2005-07-05  Raja R Harinath  <rharinath@novell.com>
476
477         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
478         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
479         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
480         variable of struct type.
481         * expression.cs (Unary.ResolveOperator): Update to change.
482         (Indirection.VerifyFixed): Likewise.
483         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
484         (ParameterReference.VerifyFixed): Value parameters are fixed.
485         (This.VerifyFixed): Treat 'this' as a value parameter.
486         * statement.cs (LocalInfo.IsFixed): Remove.
487
488 2005-07-01  Martin Baulig  <martin@ximian.com>
489
490         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
491         `ec.EmitThis ()' to get the correct scope.
492
493 2005-07-01  Martin Baulig  <martin@ximian.com>
494
495         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
496         instance is a ParameterReference; fixes #75299.
497
498 2005-06-30  Raja R Harinath  <rharinath@novell.com>
499
500         Fix #75412.
501         * expression.cs (Indexers.map): Remove.
502         (Indexers.Append): Filter out inaccessible setters and getters.
503         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
504
505         Fix #75283.
506         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
507         Refactored from ...
508         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
509         (FieldExpr.Emit, PropertyExpr.Emit): Update.
510         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
511         * expression.cs (Invocation.EmitCall): Add CS0120 check.
512
513 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
514
515         Fix #75322
516         * class.cs (FieldBase.GetInitializerExpression): One more field
517         for backup.
518
519 2005-06-28  Miguel de Icaza  <miguel@novell.com>
520
521         * pending.cs: Do not define a proxy if the base method is virtual,
522         it will be picked up by the runtime (bug 75270).
523
524 2005-07-08  Martin Baulig  <martin@ximian.com>
525
526         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
527         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
528
529 2005-07-07  Martin Baulig  <martin@ximian.com>
530
531         * generic.cs (ConstructedType.CheckConstraint): Use
532         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
533         called recursively; fixes #75329.
534
535 2005-07-06  Martin Baulig  <martin@ximian.com>
536
537         * generic.cs (TypeManager.InferTypeArguments): Added support for
538         anonymous methods; fixes #75461.
539
540 2005-07-01  Martin Baulig  <martin@ximian.com>
541
542         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
543         `ec.EmitThis ()' to get the correct scope.
544
545 2005-07-01  Martin Baulig  <martin@ximian.com>
546
547         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
548         instance is `This'; fixes #75299.
549
550 2005-06-30  Martin Baulig  <martin@ximian.com>
551
552         * class.cs (Indexer): Implement IIteratorContainer; added support
553         for iterators in indexers.
554
555         * codegen.cs
556         (EmitContext.CurrentIterator): Make this a property, not a field.
557
558         * anonymous.cs (AnonymousContainer.Iterator): New public property.
559
560 2005-06-28  Miguel de Icaza  <miguel@novell.com>
561
562         * pending.cs: Do not define a proxy if the base method is virtual,
563         it will be picked up by the runtime (bug 75270).
564
565 2005-06-28  Martin Baulig  <martin@ximian.com>
566
567         * cs-parser.jay (interface_method_declaration): Avoid a
568         reduce/reduce conflict by moving some of the code into a separate
569         `interface_method_declaration_body' rule; fixes #75368.
570
571 2005-06-28  Martin Baulig  <martin@ximian.com>
572
573         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
574         array check after the check for TypeBuilder's.
575
576 2005-06-21  Raja R Harinath  <rharinath@novell.com>
577
578         * convert.cs (FindMostEncompassedType): Add two trivial special
579         cases (number_of_types == 0 || number_of_types == 1).
580         (FindMostEncompasingType): Likewise.
581
582 2005-06-17  Raja R Harinath  <rharinath@novell.com>
583
584         Some cleanups preparing for the fix of #75283.
585         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
586         error testing.
587         (EventExpr.InstanceResolve): Likewise.
588         (EventExpr.DoResolve): Remove redundant checks.
589
590 2005-06-08  Miguel de Icaza  <miguel@novell.com>
591
592         * class.cs: Small fix.
593
594 2005-06-08  Raja R Harinath  <rharinath@novell.com>
595
596         Fix #75160.
597         * class.cs (GetPartialBases): Fix return value check of
598         part.GetClassBases.
599
600 2005-06-07  Raja R Harinath  <rharinath@novell.com>
601
602         Ensure that partial classes are registered in their enclosing
603         namespace.  Initial part of fix of #75160.
604         * tree.cs (Tree.RecordDecl): Add new namespace argument.
605         Register declspace with namespace here, not in
606         DeclSpace.RecordDecl.
607         * cs-parser.jay: Pass namespace to RecordDecl.
608         * class.cs (PartialContainer.Create): Likewise.
609         (ClassPart.DefineType): New sanity-check.  Throws an exception if
610         called.
611         * decl.cs (Declspace.RecordDecl): Remove.
612         * namespace.cs (NamespaceEntry.DefineName): Remove.
613
614 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
615
616         * rootcontext.cs: Reset TargetExt as well.
617
618 2005-06-03  Raja R Harinath  <rharinath@novell.com>
619
620         * ecore.cs (Expression.Resolve): Emit CS0654 error when
621         -langversion:ISO-1.
622
623 2005-06-02  Raja R Harinath  <rharinath@novell.com>
624
625         Fix #75080, cs0119.cs.
626         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
627         of ...
628         (Expression.Resolve): ... this.  Use it.  Remove bogus code
629         allowing ExprClass.Type and ExprClass.Namespace for
630         ResolveFlags.VariableOrValue.
631         (Expression.Resolve) [1-argument variant]: Change default resolve
632         flags based on language version.
633         (Expression.Error_UnexpectedKind): Use a simple string array
634         rather than an ArrayList.
635         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
636         not ExprClass.Type.
637         (TypeOfVoid.DoResolve): Likewise.
638         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
639         flags argument -- it always has the same value.
640
641 2005-05-31  Raja R Harinath  <rharinath@novell.com>
642
643         Fix #75081.
644         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
645         Use it in the error message.
646         * assign.cs, expression.cs, statement.cs: Update.
647
648 2005-05-30  Raja R Harinath  <rharinath@novell.com>
649
650         Fix #75088.
651         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
652         the "almostMatchedMember" case too.
653         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
654         that failed the accessibility checks to 'almost_match'.
655
656 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
657
658         * attribute.cs: Use internal MethodBuilder methods to set
659         ExactSpelling and SetLastError on PInvoke methods, instead
660         of passing them via charset.  Fixes #75060.
661
662 2005-05-27  Raja R Harinath  <rharinath@novell.com>
663
664         * parameter.cs (Parameter): Remove TODO comment.
665         (Parameter.DefineParameter): Remove Location parameter.
666         (Parameters.LabelParameters): Likewise.
667         * class.cs (Constructor.Emit): Update to change.
668         (MethodData.Emit): Likewise.
669         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
670         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
671
672 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
673
674         * parameter.cs,
675           Removed Parameters.Location and added Parameter.Location instead.
676           Removed Location parameter from Emit() and GetSignature().
677         * anonymous.cs,
678           class.cs,
679           cs-parser.jay,
680           delegate.cs,
681           iterators.cs,
682           statement.cs :
683           Modified all related calls.
684
685 2005-06-21  Martin Baulig  <martin@ximian.com>
686
687         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
688         left-hand side is not a nullable type; fixes #75328.
689
690 2005-06-21  Martin Baulig  <martin@ximian.com>
691
692         * typemanager.cs
693         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
694         (TypeManager.GetFullNameSignature): Likewise.
695
696         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
697         `source.FullName' and `target.FullName' to check whether there are
698         two conflicting definitions.
699
700 2005-06-21  Martin Baulig  <martin@ximian.com>
701
702         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
703         a BoxedCast - also for reference types - to be compatible with csc.
704
705 2005-06-21  Martin Baulig  <martin@ximian.com>
706
707         * expression.cs (MemberAccess.DoResolve): Add support for nested
708         types in a generic instance; fixes #75320.
709
710 2005-06-20  Martin Baulig  <martin@ximian.com>
711
712         * generic.cs (TypeManager.InferType): Also walk the class
713         hierarchy for generic instances; fixes #75261.
714
715 2005-06-17  Martin Baulig  <martin@ximian.com>
716
717         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
718         to make things work for corlib.
719
720 2005-06-15  Martin Baulig  <martin@ximian.com>
721
722         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
723         obsolete `SecurityAction' values.
724
725 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
726
727         * rootcontext.cs: Reset TargetExt as well.
728         
729 2005-06-09  Martin Baulig  <martin@ximian.com>
730
731         * delegate.cs (Delegate.VerifyMethod): Added
732         `MethodGroupExpr old_mg' argument; inherit its
733         `HasTypeParameters'; fix #75085.
734
735 2005-06-09  Martin Baulig  <martin@ximian.com>
736
737         * expression.cs (Invocation.OverloadResolve): Correctly handle
738         generic methods for the SetMemberIsUsed(); fix #75064.
739
740 2005-06-09  Martin Baulig  <martin@ximian.com>
741
742         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
743         fixes #75062.
744
745 2005-06-08  Martin Baulig  <martin@ximian.com>
746
747         * cs-parser.jay (nullable_type_or_conditional): If we put the
748         nullable back and our `type' is a `ComposedCast', remove the
749         nullable from it.  Fixes #75156.
750
751         * expression.cs (ComposedCast.RemoveNullable): New public method.
752
753 2005-06-08  Martin Baulig  <martin@ximian.com>
754
755         The big Iterators rewrite :-)
756
757         * iterators.cs: Rewrite this to use the anonymous methods framework.
758
759         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
760         before the TypeContainers; see 2test-21.cs.
761
762         * class.cs
763         (TypeContainer.DefineType): Don't create a new EmitContext if we
764         already have one (this only happens if we're an Iterator).
765         (TypeContainer.Define): Also call Define() on all our iterators.
766         (Method.CreateEmitContext): Added support for iterators.
767
768         * anonymous.cs
769         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
770         (AnonymousContainer.CreateMethodHost): Moved here from
771         AnonymousMethod and made abstract.
772         (AnonymousContainer.CreateScopeType): New abstract method.
773         (AnonymousContainer.IsIterator): New public property.
774         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
775         get the ScopeTypeBuilder rather than manually defining it here. 
776         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
777         iterators here.
778
779         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
780         before RootContext.DefineTypes().
781
782         * codegen.cs (EmitContext.RemapToProxy): Removed.
783         (EmitContext.CurrentAnonymousMethod): Changed type from
784         AnonymousMethod -> AnonymousContainer.
785         (EmitContext.ResolveTopBlock): Protect from being called twice.
786         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
787         (EmitContext.EmitThis): Removed the iterators hacks; use the
788         anonymous methods framework for that.
789
790         * statement.cs
791         (ToplevelBlock.Container): Make this a property, not a field.
792         (ToplevelBlock.ReParent): New public method; move the
793         ToplevelBlock into a new container.
794         (Foreach.TemporaryVariable): Simplify.
795
796 2005-06-05  Martin Baulig  <martin@ximian.com>
797
798         * statement.cs (LocalInfo.CompilerGenerated): New flag.
799         (Block.AddTemporaryVariable): New public method; creates a new
800         `LocalInfo' for a temporary variable.
801         (Block.EmitMeta): Create the LocalBuilders for all the temporary
802         variables here.
803         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
804         non-iterator variables.
805
806 2005-06-05  Martin Baulig  <martin@ximian.com>
807
808         * statement.cs (Foreach.TemporaryVariable): Create the
809         LocalBuilder in the Emit phase and not in Resolve since in some
810         situations, we don't have an ILGenerator during Resolve; see
811         2test-19.cs for an example.
812
813 2005-06-04  Martin Baulig  <martin@ximian.com>
814
815         The big Foreach rewrite - Part II.
816
817         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
818         with `PropertyInfo ienumerator_getcurrent'.
819
820         * codegen.cs (VariableStorage): Removed.
821
822         * statement.cs
823         (Foreach): Derive from Statement, not ExceptionStatement.
824         (Foreach.CollectionForeach): New nested class.  Moved all the code
825         dealing with collection foreach here.
826         (Foreach.ForeachHelperMethods): Removed.
827         (Foreach.TemporaryVariable): Implement IMemoryLocation.
828
829 2005-05-23  Martin Baulig  <martin@ximian.com>
830
831         * statement.cs (Try.DoResolve): Don't create a `finally' if we
832         don't need to.  Fix #75014.
833
834 2005-05-26  Raja R Harinath  <rharinath@novell.com>
835
836         Improve user-defined conversion handling.
837         * convert.cs (GetConversionOperators): Rewrite.  Return only the
838         applicable operators.
839         (AddConversionOperators): New.  Helper for GetConversionOperators.
840         (FindMostEncompassedType, FindMostEncompassingType): Verify that
841         there is only one most encompassed/encompassing type.
842         (FindMostSpecificSource, FindMostSpecificTarget): Remove
843         "applicable operator" handling.
844         (UserConversion): Move cache here from GetConversionOperators.
845         Directly cache the chosen operator, rather than the whole
846         MethodGroup.
847         (ExplicitNumericConversion): Fix buggy implementation of Decimal
848         case.  Allow conversion of decimal to sbyte and byte too.
849         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
850         New static methods.  Used to avoid allocating EmptyExpressions in
851         convert.cs.
852
853 2005-05-24  Duncan Mak  <duncan@novell.com>
854
855         * ecore.cs (CastFromDecimal): New class for casting a decimal to
856         another class, used in Convert.ExplicitNumericConversion.
857         (CastToDecimal): New class, similar to above, but casts to
858         System.Decimal, used in Convert.ImplicitNumericConversion and also
859         in explicit convesion from double/float to decimal.
860
861         * convert.cs (ImplicitNumericConversion): Handle implicit
862         conversions to System.Decimal.
863         (ExplicitNumericConversion): handle explicit conversions to
864         System.Decimal.
865
866         This fixes #68711.
867         
868 2005-05-20  Miguel de Icaza  <miguel@novell.com>
869
870         * typemanager.cs: Do not throw an exception in the TypeBuilder
871         case, we take care of it on the TypeCode.
872
873 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
874         
875         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
876         is back.
877         
878         * cs-parser.jay: Catch more lexical errors.
879         
880         * report.cs: Add one more Error method.
881         
882         * rootcontext.cs,
883         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
884
885 2005-05-20  Martin Baulig  <martin@ximian.com>
886
887         * class.cs (TypeContainer.CircularDepException): Removed.
888         (TypeContainer.DefineType): Removed the `InTransit' stuff.
889         (TypeContainer.CheckRecursiveDefinition): Check for circular class
890         (CS0146) and interface (CS0529) dependencies here.
891
892 2005-05-20  Martin Baulig  <martin@ximian.com>
893
894         * expression.cs (New.DoResolve): Move the CS0712 check above the
895         CS0144 check; otherwise it can never be reached.
896
897 2005-05-20  Martin Baulig  <martin@ximian.com>
898
899         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
900
901 2005-05-20  Martin Baulig  <martin@ximian.com>
902
903         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
904
905         * typemanager.cs (TypeManager.IsAttributeType): New public method.
906
907 2005-05-19  Martin Baulig  <martin@ximian.com>
908
909         * delegate.cs
910         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
911         to disable error reporting.
912
913         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
914         here since we don't want to report an error; see the new test-336.cs.
915
916 2005-05-19  Raja R Harinath  <rharinath@novell.com>
917
918         * statement.cs (ToplevelBlock.GetParameterReference)
919         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
920         Move here from class Block.
921         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
922         * expression.cs (ParameterReference.DoResolveBase): Likewise.
923
924 2005-05-18  Martin Baulig  <martin@ximian.com>
925
926         Fix #74978.
927
928         * flowanalysis.cs
929         (FlowBranching.Reachability): Add non-static public And() and Or()
930         methods.
931         (FlowBranchingSwitch): New class; do the `break_origins' thing
932         like in FlowBranchingLoop.
933         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
934         reachability, not just locals and parameters.
935         (FlowBranching.MergeChild): Remove some of the hacks for loop and
936         switch; MergeBreakOrigins() now takes care of that.
937
938 2005-05-18  Martin Baulig  <martin@ximian.com>
939
940         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
941         a loop and may leave it, reset the barrier; fixes #74974.
942
943 2005-05-16  Raja R Harinath  <rharinath@novell.com>
944
945         Fix test-382.cs.  Emit values of decimal constants.
946         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
947         Carved out of ...
948         (TypeContainer.AddField): ... this.
949         (TypeContainer.EmitFieldInitializers): Allow the list of fields
950         with initializers to include 'Const's.
951         (ClassPart.RegisterFieldForInitialization): Forward to
952         PartialContainer.
953         * const.cs (Const.Const): Pass initializer to base class.
954         (Const.Define): In case of decimal constants, register them for
955         initialization in a static constructor.
956
957 2005-05-14  Martin Baulig  <martin@ximian.com>
958
959         * statement.cs (Block.Resolve): Correctly handle unreachable code;
960         do not call ResolveUnreachable() on unreachable statements in
961         here, see the comment in the source code.
962
963 2005-05-13  Raja R Harinath  <rharinath@novell.com>
964
965         Fix #74934.
966         * expression.cs (BinaryResolveOperator): If one of the operands of
967         an equality comparison is 'null' and the other is a pointer type,
968         convert the null to a NullPointer.
969         * convert.cs (ImplicitReferenceConversion): If the expression is a
970         NullLiteral and the target type is a pointer type, return a
971         NullPointer instead.
972         (ImplicitConversionStandard): Likewise.
973
974 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
975         
976         * cs-parser.jay: Set readonly context based on special constructs.
977         
978         * expression.cs (LocalVariableReference.DoResolveBase): Improved
979         readonly variable error handling.
980         
981         * rootcontext.cs (EmitCode): Don't verify members when error
982         occurred.
983         
984         * statement.cs (LocalInfo): Add reaodnly context information.
985         (SetReadOnlyContext, GetReadOnlyContext): New methods.
986
987 2005-05-17  Martin Baulig  <martin@ximian.com>
988
989         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
990         #70970. 
991
992 2005-05-13  Martin Baulig  <martin@ximian.com>
993
994         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
995         handle unreachable blocks.
996
997 2005-05-13  Martin Baulig  <martin@ximian.com>
998
999         * class.cs
1000         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1001         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1002         #74905. 
1003
1004 2005-05-13  Martin Baulig  <martin@ximian.com>
1005
1006         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1007         instance variable, not a local.  Fix #74873.
1008         (Block.ResolveUnreachable): Set it to true here.
1009
1010 2005-05-12  Martin Baulig  <martin@ximian.com>
1011
1012         * cs-parser.jay (property_declaration): Pass the `current_class',
1013         not the `current_container' to Property's .ctor.  Fixes #74912.
1014
1015 2005-05-11  Martin Baulig  <martin@ximian.com>
1016
1017         * typemanager.cs (Closure): Copy this from MCS and merge all the
1018         GMCS-specific changes into it.
1019
1020 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1021
1022         Fix #74920.
1023         * typemanager.cs (unmanaged_enclosing_types): New.
1024         (IsUnmanagedType): Avoid infloops by using
1025         'unmanaged_enclosing_types' to talk with recursive invocations.
1026
1027 2005-05-11  Duncan Mak  <duncan@novell.com>
1028
1029         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1030         continuing to process for 'arg'.
1031         (handle_preprocessing_directive): Check the argument of the #endif
1032         directive and report error CS1025 if there are any trailing
1033         characters.
1034
1035         According to the C# spec, having even whitespace after the #endif
1036         directive is illegal; however, because we call arg.TrimEnd ()
1037         beforehand, we have the same behavior as csc, allowing whitespace
1038         after the directive.
1039
1040         Fixes #74892.
1041
1042 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1043
1044         Fix #74863.
1045         
1046         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1047         (Constructor.GetObsoleteAttribute): Implemented correctly.
1048
1049 2005-05-10  Martin Baulig  <martin@ximian.com>
1050
1051         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1052         resolve the type; fixes #74864.
1053         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1054         in DoResolve(); fixes #74862.
1055
1056 2005-05-10  Martin Baulig  <martin@ximian.com>
1057
1058         * support.cs (ReflectionParameters.ParameterModifier): Use
1059         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1060         and `ParameterAttributes.In'.  Fixes #74884.
1061
1062 2005-05-10  Martin Baulig  <martin@ximian.com>
1063
1064         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1065         the cache if we're just looking for `MemberTypes.NestedType' in a
1066         generic instance.
1067
1068         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1069         constraints if we're still resolving the type tree.
1070         (Expression.MemberLookup): If we're resolving the type tree, only
1071         look for `MemberTypes.NestedType' since we're only interested in
1072         getting types.
1073
1074         * class.cs (TypeContainer.DefineType): Don't resolve the type
1075         parameters here; do this later in ResolveType() after the type
1076         tree has been resolved.
1077         (TypeContainer.ResolveType): New public method; this is called
1078         after the type tree is resolved and before the types are being
1079         populated.  We resolve the generic constraints here.
1080         (TypeContainer.DoDefineMember): Check the constraints on our base
1081         class and interfaces.
1082
1083         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1084         set the `ResolvingTypeTree' flag on the EmitContext.
1085
1086         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1087
1088 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1089
1090         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1091         
1092         * expression.cs (Argument.GetParameterModifier): Turned to property.
1093         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1094         
1095         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1096         its C# equivalent.
1097         
1098 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1099
1100         Fix #74852.
1101         * decl.cs (MemberCache.AddMethods): Register override methods,
1102         rather than non-override methods.
1103         * typemanager.cs (RegisterOverride): New.
1104         (IsOverride): Update.
1105
1106 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1107
1108         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1109
1110 2005-05-06  Martin Baulig  <martin@ximian.com>
1111
1112         * attribute.cs
1113         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1114         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1115
1116 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1117
1118         Fix #73105.
1119         
1120         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1121         recursive declaration.
1122         
1123         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1124         
1125 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1126
1127         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1128         
1129         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1130
1131 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1132
1133         Fix #74797.
1134         * decl.cs (DeclSpace.FamilyAccessible): 
1135         Use TypeManager.IsNestedFamilyAccessible.
1136
1137         Fix reopened #64812.
1138         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1139         internal'.
1140
1141 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1142             Abin Thomas  <projectmonokochi@rediffmail.com>
1143             Anoob V E  <projectmonokochi@rediffmail.com>
1144             Harilal P R  <projectmonokochi@rediffmail.com>
1145
1146         Fix #64812.
1147         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1148         allow access to all static members.
1149
1150 2005-05-04  Martin Baulig  <martin@ximian.com>
1151
1152         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1153
1154 2005-05-04  Martin Baulig  <martin@ximian.com>
1155
1156         Fix #74655.
1157
1158         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1159         section at the end; make things work if `default' is not the last
1160         section.        
1161
1162 2005-05-04  Martin Baulig  <martin@ximian.com>
1163
1164         Fix #70400.
1165
1166         * statement.cs (Switch): Replaced the `got_default' field with a
1167         `default_section' one.
1168         (Switch.CheckSwitch): Set `default_section' here.
1169         (Switch.Resolve): If we're a constant switch and the constant is
1170         not found, use the default section.
1171
1172 2005-05-03  Martin Baulig  <martin@ximian.com>
1173
1174         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1175
1176         * statement.cs (Foreach.ArrayForeach): New nested class.
1177         (Foreach.TemporaryVariable): New nested class.
1178         (Foreach.EmitArrayForeach): Removed; this is now in the new
1179         ArrayForeach class.
1180
1181 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1182
1183         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1184         more conservative.
1185         (VerifyPendingMethods): Revert change below.
1186
1187         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1188         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1189         that used to trigger warning -28.  Remove warning -28.
1190         * expression.cs (Invocation.OverloadResolve): Use
1191         TypeManager.IsOverride to distinguish override methods.
1192
1193         Fix #74773.
1194         * pending.cs (VerifyPendingMethods): If a base type implements the
1195         requested interface, don't bother checking individual methods of
1196         the base type.  As a side-effect, this prevents the creation of
1197         unnecessary proxies.
1198
1199 2005-05-02  Martin Baulig  <martin@ximian.com>
1200
1201         Fix #70182.
1202
1203         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1204         Also `And' the locals if the old vector is null.
1205         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1206         null; in this case we basically reset all the variables.        
1207
1208 2005-05-02  Martin Baulig  <martin@ximian.com>
1209
1210         Fix #74529.
1211
1212         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1213         Added `FlowBranching branching' argument; always `and' the
1214         variables instead of `or'ing them unless we're an infinite loop.
1215
1216         * statement.cs (While.Resolve): Create a new sibling unless we're
1217         infinite.       
1218
1219 2005-05-02  Martin Baulig  <martin@ximian.com>
1220
1221         Fix #70140.
1222
1223         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1224         arguments; use it instead of creating a new TopLevelBlock.
1225         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1226         our ConstructorInitializer.
1227
1228         * statement.cs
1229         (TopLevelBlock.TopLevelBranching): New public property.
1230         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1231         and create our `TopLevelBranching'.
1232
1233         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1234         anonymous method host, use `block.TopLevelBranching' rather than
1235         creating a new branching.
1236
1237 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1238
1239         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1240         a ScopeInfo, if any of the current children is a child of the new
1241         entry, move those children there.
1242
1243 2005-04-30  Martin Baulig  <martin@ximian.com>
1244
1245         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1246         at the beginning of a SwitchSection.  Fix #73335.
1247
1248 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1249
1250         Fix #74378
1251         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1252         
1253         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1254         (FieldExpr.DoResolve): Obsolete members are ignored for field
1255         initializers.
1256         
1257 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1258
1259         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1260         of arrays detection.
1261
1262         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1263         verification.
1264         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1265
1266         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1267         arrays report.
1268
1269 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1270
1271         * cs-parser.jay: Use the prefered version of -unsafe in error
1272         message.
1273
1274 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1275
1276         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1277         circumstances.
1278
1279 2005-04-20  John Luke  <john.luke@gmail.com>
1280
1281         * driver.cs: fix typo in error message, --outout to --output
1282
1283 2005-04-30  Martin Baulig  <martin@ximian.com>
1284
1285         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1286         handle the .NET 2.x security attributes.
1287
1288 2005-04-30  Martin Baulig  <martin@ximian.com>
1289
1290         * typemanager.cs
1291         (TypeManager.ExpandInterfaces): Don't add things twice.
1292
1293         * class.cs
1294         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1295
1296 2005-04-29  Martin Baulig  <martin@ximian.com>
1297
1298         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1299
1300         * anonymous.cs: Added support for anonymous generic methods.
1301
1302 2005-04-29  Martin Baulig  <martin@ximian.com>
1303
1304         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1305         generic instances.
1306
1307 2005-04-29  Martin Baulig  <martin@ximian.com>
1308
1309         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1310
1311         * expression.cs (New.DoResolve): Fix the CS0304 check.
1312
1313 2005-04-29  Martin Baulig  <martin@ximian.com>
1314
1315         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1316         naming schema.
1317
1318         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1319         explicit interface implementation, compare the interface types.
1320         (MethodData.Define): Use the new naming scheme from the latest
1321         .NET 2.x beta2.
1322         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1323
1324         * decl.cs (MemberName.GetMemberName): Removed.
1325         (MemberName.MethodName, FullName): New properties.
1326
1327 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1328
1329         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1330
1331 2005-04-22  Martin Baulig  <martin@ximian.com>
1332
1333         * generic.cs (GenericMethod): Create the EmitContext in the
1334         `Define()'; in `Define(MethodBuilder)', create the type parameters
1335         before calling `Define()'.  Fixes #73933.
1336
1337 2005-04-22  Martin Baulig  <martin@ximian.com>
1338
1339         * generic.cs
1340         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1341         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1342
1343         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1344         ConstructedType, check its constraints.
1345
1346 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1347
1348         * codegen.cs (InRefOutArgumentResolving): New field.
1349         
1350         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1351         fields outside contructor.
1352         
1353         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1354         
1355 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1356
1357         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1358         parameter code was not completed ever, so it was not as up-to-date
1359         as local variables.  Must finish it.
1360
1361         The bug fix was to compare the Toplevel of the block, not the
1362         current block.  Thanks for Ben for pointing this out. 
1363
1364 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1365
1366         * decl.cs (AddMethods): Use the declaring type of the problem
1367         method to determine if we want to squash a warning.
1368
1369 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1370
1371         * attribute.cs: Removed debug output.
1372
1373         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1374         
1375         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1376         Report.Stderr.
1377         
1378 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1379
1380         Fix #74481.
1381         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1382         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1383         all null comparisons against reference types.
1384
1385 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1386
1387         Fix# 74565
1388         * class.cs (TypeContainer.CircularDepException) New nested
1389         exception class.
1390         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1391         (TypeContainer.DefineType): Removed error, reset InTransit before
1392         exit.
1393         (Class.DefineType): Throw exception when is in Transit.
1394         Catch exception and report error.
1395         (Struct.DefineType): Throw exception when is in Transit.
1396         Catch exception and report error.
1397         (Interface.DefineType): Throw exception when is in Transit.
1398         Catch exception and report error.
1399
1400         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1401         handle nested exception handlers.
1402
1403         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1404         a catch.
1405
1406         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1407         InFinally and InCatch storage.
1408
1409         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1410         (Catch.Resolve): Set and Restore ec.InCatch.
1411         (Try.Resolve): Set and Restore ec.InFinally.
1412         (Try.HasCatch): True when try has catch.
1413
1414 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1415
1416         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1417           for the same event member, so exclude such cases from warning 419.
1418           Fixed bug #74633.
1419
1420 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1421
1422         * expression.cs (Binary.ResolveOperator): Apply patch from John
1423         Luke to fix bug 59864: operators &, | and ^ on enumerations
1424         require that the same enum type on both sides.
1425
1426         * driver.cs: Add warnings to old flag usage, this is to assist
1427         people who produce Makefiles and hope that the Makefiles will be
1428         used on Windows.
1429
1430         * class.cs (TypeContainer.EmitType): Moved the definition of the
1431         special $PRIVATE$ field from the resolve phase to the Emit phase.
1432         During resolve we do not know if we are a struct with
1433         HasExplicitLayout, we know this only after the attributes for the
1434         type are emitted.
1435
1436         Set the FieldOffset to zero on the dummy field that we create for
1437         the class.   Fixes 74590.
1438
1439 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1440
1441         Fix #73834.
1442         * ecore.cs (PropertyExpr.resolved): New.
1443         (DoResolve): Use it to handle a case of double resolution here.
1444         Handle a case of identical-name-and-type-name.
1445         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1446         resolution by storing the results of expression resolution back
1447         into the "probes" array.
1448
1449 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1450
1451         Fix cs0208-7.cs and cs0208-8.cs.
1452         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1453         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1454         error reporting to point out the reason a struct is not unmanaged.
1455
1456 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1457
1458         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1459           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1460
1461 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1462
1463         Fix #74528.
1464         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1465         IdenticalNameAndTypeName here.
1466         (EventExpr.InstanceResolve): Likewise.
1467
1468 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1469
1470         C# 2.0 DefaultCharSetAttribute implementation
1471         
1472         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1473         which allows us to set GlobalNamespace for every resolve.
1474         (Attribute.ResolveArguments): Cut from Resolve.
1475         (Attribute.GetCharSetValue): Returns CharSet named argument.
1476         (Attribute.DefinePInvokeMethod): Gets default charset from
1477         module settings.
1478         (GlobalAttribute.ResolveAsTypeStep): Override.
1479         (GlobalAttribute.ResolveArguments): Override.
1480         
1481         * class.cs (TypeAttr): Is protected.
1482         
1483         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1484         (ModuleClass.DefaultCharSetType): New memeber.
1485         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1486         
1487         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1488         charset from module.
1489         
1490         * delegate.cs (TypeAttr): Override.
1491         (Delegate.DefineType): Use this TypeAttr.
1492         
1493         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1494         at very early stage (before types are defined) to resolve model
1495         module attributes. It will probably not work with corlib but it
1496         should be ok.
1497         
1498         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1499         charset from module.
1500         
1501         * typemanager.cs (default_charset_type): New type.
1502
1503 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1504
1505         * decl.cs (MemberCache.AddMethods): Don't warn if
1506         System.Object.Finalize has buggy MethodAttributes.
1507
1508         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1509         removed below.
1510
1511 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1512
1513         * doc.cs : detect ambiguous reference to overloaded members.
1514           Fixed bug #71603. MS 1.1 csc does not detect it.
1515
1516 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1517
1518         * doc.cs : delegates must not be referenced with parameters.
1519           Fixed bug #71605.
1520
1521 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1522
1523         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1524
1525 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1526
1527         * driver.cs (MainDriver): Stop processing if the CLS stage found
1528         errors. 
1529
1530         (CompilerCallableEntryPoint.InvokeCompiler): Always
1531         reset after execution;   Take a TextWriter argument for the
1532         output.
1533
1534         * report.cs: Use the error stream instead of hardcoding stderr. 
1535
1536 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1537
1538         * class.cs: Reduce code paths to test, too small of an
1539         optimization to make it worth the extra testing.  Always perform
1540         it. 
1541
1542 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1543
1544         Fix #74510.
1545         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1546         operators that had errors reported on them.
1547
1548 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1549
1550         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1551         argument types.
1552         (Attribute.Resolve): Add named argument type checking.
1553         
1554         * class.cs (FixedField.Define): Use IsPrimitiveType
1555         
1556         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1557         
1558         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1559         unsafe parameter types.
1560         
1561         * statement.cs (Using.ResolveExpression): Add better error description.
1562         
1563         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1564         
1565 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1566
1567         Fix #74484.
1568         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1569         AttributeUsageAttribute in the emitcontext of the attribute class,
1570         not in the emitcontext of the attributable entity it was attached to.
1571         * cs-parser.jay: Use 'current_class', not 'current_container',
1572         when creating a GlobalAttribute.
1573
1574 2005-04-08  Alp Toker  <alp@atoker.com>
1575
1576         * pending.cs: The fix to #58413 failed to compile methods implementing
1577         interfaces with/without params modifiers and vice versa, even though
1578         params modifiers aren't part of the signature. Make the modifier check
1579         less strict as in csc.
1580
1581 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1582             Anoob V E  <projectmonokochi@rediffmail.com>
1583             Harilal P R  <projectmonokochi@rediffmail.com>
1584
1585         Fix #58413.
1586         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1587         modifiers of pending methods.
1588         (PendingImplementation.PendingImplementation): Initialize it.
1589         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1590         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1591         with ParameterData.  Add check for modifiers.
1592         * class.cs (MethodData.Define): Update to changes.
1593
1594 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1595
1596         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1597
1598 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1599
1600         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1601         property.
1602         
1603         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1604         
1605         * rootcontext.cs,
1606         * typemanager.cs: Registered RequiredAttributeAttribute.
1607         
1608 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1609
1610         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1611         Warning CS0169 is back at level 3.
1612         (IMethodData.SetMemberIsUsed): New method.
1613         
1614         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1615         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1616         
1617         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1618
1619         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1620         contants.
1621         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1622         is used.
1623         
1624         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1625         is used.
1626         
1627         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1628         to avoid the problems with nested types.
1629
1630 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1631             Anoob V.E  <projectmonokochi@rediffmail.com>
1632             Harilal P.R  <projectmonokochi@rediffmail.com>
1633             Raja R Harinath  <rharinath@novell.com>
1634
1635         Fix #73820.
1636         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1637         attribute.
1638         * typemanager (GetConstructor): Make public.
1639
1640 2005-04-05  John Luke  <john.luke@gmail.com>
1641             Raja R Harinath  <rharinath@novell.com>
1642
1643         Fix #62232.
1644         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1645         struct too.  Return false quicker in a few cases.
1646         (VerifyUnManaged): Use it.
1647
1648 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1649
1650         Fix #74041.
1651         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1652         not 'unreachable_seen'.
1653
1654 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1655
1656         * attribute.cs (Attribute.GetValue): Removed unused.
1657         
1658         * codegen.cs (CodeGen.TrimExt): Removed unused.
1659         
1660         * cs-parser.jay (output): Removed unused.
1661         
1662         * cs-tokenizer.cs (hex_digits): Removed unused.
1663         
1664         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1665         
1666         * expression.cs (Indirection.LoadExprValue): Removed unused.
1667         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1668         
1669         * iterators.cs (Iterator.param_types): Removed unused.
1670         
1671         * statement.cs (Goto.block): Removed unused.
1672         (ToplevelBlock.did): Removed unused.
1673         (Switch.ResolveConstantSwitch): Removed unused.
1674
1675 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1676
1677         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1678         resetting thingy.
1679
1680 2005-04-19  Martin Baulig  <martin@ximian.com>
1681
1682         Merged r42462 from MCS and made it work for GMCS.
1683
1684         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1685
1686         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1687
1688 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1689
1690         Fix #74232 and cs0208-3.cs.
1691         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1692         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1693         unmanaged type.  Don't use FieldBuilders when 't' is a
1694         TypeBuilder.  Use ModFlags and MemberType fields.
1695         * class.cs (MemberBase.member_type): Rename from MemberType.
1696         (MemberBase.MemberType): New property.  Determines member_type on
1697         demand.
1698         (MemberBase.DoDefine): Don't initialize MemberType here.
1699         (FieldMember.Define): Likewise.
1700
1701 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1702
1703         Fix #74241
1704         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1705         Attributes are emitted there.
1706         
1707 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1708
1709         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1710         keyword in 'partial enum' too.
1711         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1712         is not allowed).
1713         Report from Kamil Skalski <nazgul@omega.pl>.
1714
1715         Fix #74309.
1716         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1717         have partial containers too.
1718
1719         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1720         in block' checks to Block.CheckInvariantMeaningInBlock.
1721         * statement.cs (Block.GetKnownVariableInfo): Make private.
1722         (Block.IsVariableUsedInChildBlock): Remove.
1723         (Block.IsVariableUsedInBlock): Likewise.
1724         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1725         conflicting declaration.
1726         (Block.AddVariable): Make error messages less long-winded and more
1727         specific.  Show location of conflicting declaration.
1728         * parameter.cs (Parameters.Location): New readonly property.
1729
1730 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1731
1732         Clean up semantics of invoking ResolveMemberAccess.
1733         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1734         can have an instance, ensure that we pass in a non-TypeExpression
1735         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1736         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1737         argument.  Update to changes and simplify.
1738         (FieldExpr.Emitinstance): Remove CS0120 check.
1739         (PropertyExpr.EmitInstance): Likewise.
1740         * expression.cs (Argument.Resolve): Likewise.
1741         (Invocation.DoResolve): Update to changes in semantics of
1742         InstanceExpression.
1743
1744 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1745
1746         Fix #74241
1747         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1748         customization.
1749         
1750         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1751
1752 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1753
1754         Fix difference in behaviour with commandline invocation.
1755         * driver.cs (Driver.Reset): New.
1756         (CompilerCallableEntryPoint): Call it.
1757
1758         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1759         variable" warnings if the boolean expression failed to resolve.
1760
1761 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1762
1763         * attribute.cs: Fix the union of several permissions when some of them
1764         are unrestricted (so the result isn't an unrestricted permission set).
1765         Fix #74036.
1766
1767 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1768
1769         * ecore.cs (MemberExpr): New class.  Convert from interface
1770         IMemberExpr.
1771         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1772         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1773         error checks.
1774         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1775         (MethodGroupExpr.IsExplicitImpl): Remove.
1776         (Expression.GetFieldFromEvent): Remove.
1777         (SimpleName.MemberStaticCheck): Remove.
1778         (SimpleName.DoSimpleNameResolve): Update to changes.
1779         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1780         (MemberAccess.IdenticalNameAndTypeName): Remove.
1781         (MemberAccess.error176): Move to MemberExpr.
1782         (MemberAccess.DoResolve): Update to changes.
1783         (BaseAccess.DoResolve): Likewise.
1784
1785 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1786
1787         C# 2.0 Conditional attribute class implementation
1788         
1789         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1790         Analyzes class whether it has attribute which has ConditionalAttribute
1791         and its condition is not defined.
1792         
1793         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1794         (Class.IsExcluded): New method. Search for at least one defined
1795         condition in ConditionalAttribute of attribute class.
1796
1797 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1798
1799         * ecore.cs (PropertyExpr): Derive from Expression, not
1800         ExpressionStatement.
1801         (PropertyExpr.EmitStatement): Remove.
1802
1803 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1804
1805         Fix #74060.
1806         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1807         internal field "value__" of an enum be private.  The examples for
1808         "value__" that I found on MSDN all used FieldAttributes.Private.
1809
1810         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1811         Don't mention IL method attribute names.
1812
1813         Fix #47991.  Remove a TODO.
1814         * statement.cs (Block.Toplevel): Make into a field.
1815         (Block.Parameters): Move into ToplevelBlock.
1816         (Block.known_variables): Rename from child_variable_names.
1817         (Block.Block): Remove variants that take Parameters.  Initialize
1818         'Toplevel' with the immediately surrounding toplevel block.
1819         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1820         LocalInfo parameter.
1821         (Block.GetKnownVariableInfo): New.
1822         (Block.IsVariableNameUsedInChildBlock): Update.
1823         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1824         the block, even though it may not be in scope.
1825         (Block.AddVariable): Remove Parameters parameter.  Use
1826         Toplevel.Parameters instead.
1827         (Block.AddConstant): Remove Parameters parameter.
1828         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1829         (Block.IsParamaterReference): Likewise.
1830         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1831         (ToplevelBlock.Parameters): New.  Moved from Block.
1832         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1833         initialize Parameters to a non-null value.
1834         * cs-parser.jay: Update to changes.
1835         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1836         simple names that mean different things in the same block.  Use
1837         Block.IsVariableNameUsedInBlock.
1838
1839 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1840
1841         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1842
1843 2005-03-26  Raja R Harinath  <harinath@acm.org>
1844
1845         Fix #73038.
1846         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1847         fails to resolve, ensure that the LHS is still resolved as an
1848         lvalue.
1849
1850 2005-03-25  Raja R Harinath  <harinath@acm.org>
1851
1852         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1853         ec.ContainerType.
1854         (Enum.current_ec): Remove.
1855         (Enum.LookupEnumValue): Remove EmitContext argument.
1856         Just uses the one created during DefineType.
1857         (Enum.FindMembers): Update.
1858         * expression.cs (MemberAccess.DoResolve): Update.
1859
1860 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1861
1862         * assign.cs (Assign.DoResolve): Check for CS1717 when
1863         source and target are same (uses Equals).
1864
1865         * expression.cs (LocalVariableReference, ParameterReference,
1866         This): Implemented Equals, GetHashCode.
1867
1868         * statement.cs (Block.GetParameterReference): Removed useless
1869         local variable.
1870
1871 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1872
1873         Fix cs0128.cs
1874         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1875         blocks before deciding whether the error is cs0136 or cs0128.
1876
1877         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1878         (using_alias_directive, using_namespace_directive): Pass
1879         MemberName, not an expression to Namespace.UsingAlias and
1880         Namespace.Using.
1881         (MakeName): Use the MemberName of the namespace.
1882         * namespace.cs (Namespace.MemberName): New.
1883         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1884         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1885         Likewise.
1886         * decl.cs (MemberName.Name): Make readonly.
1887         (MemberName.FromDotted): New "constructor".
1888         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1889         (MemberCore.Name): Compute from MemberName on demand.
1890         (MemberCore.SetMemberName): Provide a way to change the
1891         MemberName.
1892         (MemberCore.AddToContainer): Don't take a fullname parameter.
1893         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1894         fully qualified name of the container to the member name.
1895         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1896         only if the type is a member of the root container.
1897         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1898         MemberName.Left rather than searching for an embedded ".".
1899         (PartialContainer.CreatePart): Update to changes in RootContext.
1900         (MemberBase.ShortName): Turn into a property.  Use
1901         MemberCore.SetMemberName.
1902         (MemberBase.ExplicitInterfaceName): Remove.
1903         (MemberBase.UpdateMemberName): Remove.
1904         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1905         (PropertyBase.SetMemberName): New override.
1906         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1907         (Tree.GetDecl): New.
1908         (Tree.AllDecls): Rename from Decls.
1909         * attribute.cs, enum.cs, report.cs: Update to changes.
1910         * driver.cs (MainDriver): Use MemberName.FromDotted on
1911         RootContext.MainClass.
1912
1913 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1914
1915         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1916         checks.
1917
1918         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1919
1920 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1921
1922         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1923         property accessor modifiers.
1924
1925         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1926         fixed buffer attribute (CS1716).
1927         (PropertyMethod.HasCustomAccessModifier): When property accessor
1928         has custom modifier.
1929
1930         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1931         modifiers.
1932         (PropertyExpr.DoResolveLValue): Add CS0272.
1933
1934 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1935
1936         * convert.cs: When converting to a pointer, use the proper Conv.U
1937         or Conv.I depending on the source data type.
1938
1939         * cs-tokenizer.cs: Make the size for large decimal constants,
1940         fixes #72957.
1941
1942 2005-03-17  Martin Baulig  <martin@ximian.com>
1943
1944         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1945         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1946
1947 2005-03-17  Martin Baulig  <martin@ximian.com>
1948
1949         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1950         to bool so we can return an error condition.
1951         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1952         returned an error.
1953
1954 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1955
1956         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1957         attributes.
1958
1959 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1960
1961         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1962         Refactor to avoid traversing the list of assemblies, and to avoid
1963         string concatenation.
1964         * typemanager.cs (guid_attr_type): Remove.
1965         (negative_hits, pointers, references): Remove hashes.
1966         (type_hash): New.
1967         (GetConstructedType): New.  Uses type_hash to handle constructed
1968         types (arrays, references, pointers).
1969         (GetReferenceType, GetPointerType): Use it.
1970         (GetNestedType): New.  Uses type_hash to handle nested types of
1971         reflected types.
1972         (LookupType, LookupTypeDirect): Remove.
1973         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1974         'types' hash and LookupTypeReflection directly.
1975         (params_string, params_object): Use GetConstructedType.
1976         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1977         top-level types.
1978         (Namespace.Lookup): Use cached_types.
1979         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1980         provided by old TypeManager.LookupType.
1981         * rootcontext.cs (MakeFQN): Remove.
1982         * decl.cs (DeclSpace.MakeFQN): Likewise.
1983         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1984         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1985         TypeManager.GetConstructedType.
1986         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1987
1988 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1989
1990         * cs-parser.jay: Fix build.
1991
1992 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1993
1994         * class.cs (TypeContainer.CircularDepException) New nested
1995         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1996
1997         * cs-parser.jay: Reports CS1527 for any namespace element.
1998
1999         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2000         Added CS0407.
2001
2002         * expression.cs (ParameterReference.IsAssigned): Changed error to
2003         CS0269.
2004         (Error_WrongNumArguments): Moved CS0245 detection here.
2005
2006         * statement.cs (Return.Resolve): Add CS1622 report.
2007
2008 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2009
2010         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2011
2012 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2013
2014         * attribute.cs expression.cs: Get rid of some allocations.
2015
2016 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2017
2018         * doc.cs : just eliminate the latest change.
2019
2020 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2021
2022         * doc.cs : commented out the latest change. It breaks xml-030.cs
2023
2024 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2025
2026         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2027           fail. So invoke CreateType() in FindDocumentedType().
2028
2029 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2030
2031         * cs-tokenizer.cs : added IsKeyword().
2032         * doc.cs : Detect keyword incorrectly used as identifier.
2033           Allow identifiers prefixed by @.
2034
2035 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2036
2037         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2038         It caused exception in namespace resolving (again!).
2039         
2040         * class.cs (Class.ctor): Removed exit.
2041         (PropertyMethod.ctor): ditto.
2042         
2043         * codegen.cs (Codegen.Reset): Reset static data.
2044         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2045         
2046         * cs-tokenizer.cs (Cleanup): Removed.
2047         
2048         * driver.cs (GetSystemDir): Rewrote to one line command.
2049         It caused problem with unloaded dynamic modules.
2050         (UnixParseOption): Removed Exit.
2051         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2052         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2053         Now can be mcs used as library.
2054         
2055         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2056         empty location.
2057         
2058         * location.cs (Reset): Reset static data.
2059         
2060         * namespace.cs (Reset): Reset static data.
2061         
2062         * report.cs (Report.Reset): Reset static data.
2063         
2064         * rootcontext.cs (RootContext.Reset): Reset static data.
2065         
2066         * tree.cs (RootTypes.ctor): Use Location.Null
2067         
2068         * typemanager.cs (TypeManager.Reset): Reset static data.
2069         (CoreLookupType): Removed Exit.
2070         (TypeHandle.Reset): Reset static data.
2071         
2072 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2073
2074         Fix #73516.
2075         * typemanager.cs (ComputeNamespaces): Import namespaces from
2076         referenced modules too.
2077
2078 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2079
2080         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2081         than '.'.
2082
2083 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2084
2085         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2086         enclosing DeclSpace.  This ensures that a name-lookup populates
2087         more caches and there are fewer 'TypeExpression's.  Carve out
2088         nested type lookup into ...
2089         (LookupNestedTypeInHierarchy): ... this.
2090
2091 2005-04-15  Martin Baulig  <martin@ximian.com>
2092
2093         Merged r41590 from MCS and make it work in the generics land.
2094
2095         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2096         `check' argument.
2097
2098         * class.cs (PartialContainer.UpdateConstraints): Removed.
2099         (PartialContainer.CheckConstraints): Removed.
2100         (PartialContainer.SetParameterInfo): Store the constraints here.
2101         (PartialContainer.DefineTypeParameters): New public method;
2102         resolve the type parameter's constraints here.  Note that the
2103         PartialContainer doesn't have an EmitContext anymore, so we must
2104         do this in the ClassPart.
2105
2106 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2107
2108         Clean up a few partial-class semantics.  
2109         Fixes test-357.cs and cs1618-2.cs.
2110         * cs-parser.jay (struct_declaration): Use 'current_class' as
2111         parent of newly-created struct.  Remove call to Register ().
2112         Use 'pop_current_class' to complete handing the current struct.
2113         (interface_declaration): Likewise.
2114         (class_declaration): Likewise.
2115         (enum_declaration): Use 'current_class' as parent of newly created
2116         enum.
2117         (delegate_declaration): Likewise.
2118         (pop_current_class): New function.  This is used to handle closing
2119         up the 'current_class' and 'current_container', and pointing them
2120         to the enclosing class/container.
2121         (CSharpParser): Initialize 'current_class' too.
2122         * decl.cs (MemberCore): Add check for invariant: a partial
2123         container is not a parsed entity, and thus does not enclose any
2124         parsed members.
2125         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2126         (DeclSpace.BaseTypeExpr): Use it.
2127         (DeclSpace.LookupType): Add check for invariant.
2128         * class.cs (TypeContainer): Add check for invariant: a nested
2129         class should have the same NamespaceEntry as its enclosing class.
2130         (TypeContainer.EmitFieldInitializers): Make virtual.
2131         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2132         MemberCore.
2133         (TypeContainer.Register): Remove.
2134         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2135         null.  Use TypeResolveEmitContext for resolving base types and
2136         interfaces.  Move initialization of Parts.TypeBuilder here from
2137         ...
2138         (TypeContainer.DefineNestedTypes): ... here.
2139         (PartialContainer): Take a Namespace not a NamespaceEntry.
2140         (PartialContainer.Create): Don't use Register.  Call the
2141         appropriate Add... function directly.
2142         (ClassPart): Take both the PartialContainer and the enclosing
2143         class as constructor arguments.
2144         (ClassPart.EmitFieldInitializers): Override.
2145         (ClassPart.PartFindNestedTypes): Remove.
2146         (FieldBase.GetInitializerExpression): Resolve the initializer
2147         expression in the emit context of the enclosing class.
2148         * tree.cs (RootTypes): Remove Register ().
2149         
2150 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2151
2152         * cs-parser.jay: Removed CS0134.
2153         
2154         * driver.cs: Removed CS1901.
2155         
2156         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2157         for predefined types.
2158
2159 2005-03-07  Duncan Mak  <duncan@novell.com>
2160
2161         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2162         well. Fixes bug #73454.
2163
2164 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2165
2166         * cs-tokenizer.cs (xtoken): Add CS1035.
2167         
2168         * class.cs (MethodData.Define): Add CS0683.
2169         (FieldMember.ctor): Add CS0681.
2170
2171 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2172
2173         * ecore.cs (SimpleName.DoResolve): Rename from
2174         SimpleName.DoResolveAllowStatic.
2175         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2176         Pass 'intermediate' flag to MemberStaticCheck.
2177         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2178         of "intermediate" lookups via MemberAccess.
2179         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2180         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2181
2182 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2183
2184         Fix #73394.
2185         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2186         slipped in because of variable names that are identical to a
2187         builtin type's BCL equivalent ('string String;', 'int Int32;').
2188         (PropertyExpr.EmitInstance): Likewise.
2189
2190 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2191
2192         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2193         
2194         * report.cs (warning_ignore_table): Made public.
2195
2196 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2197
2198         Fix #73282.
2199         * class.cs (MethodData.Emit): Pass 'container' to
2200         container.GetObsoleteAttribute instead of 'container.Parent'.
2201
2202 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2203
2204         * cs-parser.jay: Add 1534 error test.
2205
2206         * iterators.cs (Yield.CheckContext): Add error 1629.
2207         (Iterator.ctor): Save unsafe modifier.
2208         (MoveNextMethod.DoEmit): Restore unsafe context.
2209
2210         * namespace.cs (UsingAlias): Better error message.
2211
2212 2005-03-03  Dan Winship  <danw@novell.com>
2213
2214         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2215         the warning message [#73219]
2216
2217 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2218
2219         Fix compile with MCS 1.0.0.0.
2220         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2221         w_restore to not depend on string constant folding.
2222
2223 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2224
2225         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2226         CS0246 check to users who passed 'silent = false'.
2227         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2228         check.
2229         (SimpleName.SimpleNameResolve): Update.
2230         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2231         (MemberAccess.IdenticalNameAndTypeName): Update.
2232         * doc.cs (FindDocumentedTypeNonArray): Update.
2233
2234 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2235
2236         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2237         * parameters.cs (ComputeAndDefineParameters): Remove.
2238         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2239         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2240         Use GetParameterInfo.
2241
2242 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2243
2244         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2245
2246 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2247
2248         Unify DeclSpace.LookupType and DeclSpace.FindType.
2249         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2250         is in charge of defining nested types on demand.
2251         (DeclSpace.LookupType): Use it when the current_type is a
2252         TypeBuilder.  Use LookupTypeDirect for reflected types.
2253         (DeclSpace.FindType): Remove.
2254         (DeclSpace.LookupInterfaceOrClass): Likewise.
2255         (DeclSpace.DefineTypeAndParents): Likewise.
2256         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2257         DeclSpace.LookupType.
2258         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2259         * typemanager.cs (LookupType): Simplify.
2260         (AddUserType): Remove type from negative_hits.
2261         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2262         * class.cs (TypeContainer.FindMembers): Move handling of nested
2263         types ...
2264         (TypeContainer.FindMembers_NestedTypes): ... here.
2265         (TypeContainer.FindNestedType): Implement override.
2266         (ClassPart.FindNestedType): Delegate to PartialContainer.
2267         (ClassPart.PartFindNestedType): Looks up the nested types of the
2268         part alone.
2269
2270 2005-04-14  Martin Baulig  <martin@ximian.com>
2271
2272         * generic.cs (ConstructedType): Moved all the type lookup and
2273         nested class logic into SimpleName.
2274         (ConstructedType.ResolveConstructedType): Our underlying type is
2275         already fully resolved; all the type lookup stuff is in
2276         SimpleName.
2277
2278         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2279         constructed types here instead of in ConstructedType.
2280
2281         * decl.cs (MemberName.GetTypeExpression): Always create a
2282         SimpleName, not a ConstructedType.
2283         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2284
2285 2005-03-02  Martin Baulig  <martin@ximian.com>
2286
2287         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2288         static constructor in static classes.
2289
2290 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2291
2292         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2293         sizeParamIndex is not specified.
2294
2295 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2296
2297         Fix #73117
2298         * report.cs (WarningMessage.IsEnabled): Missing null check.
2299
2300 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2301
2302         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2303         in the fields and not in the properties.
2304
2305 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2306
2307         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2308         fields as well.
2309
2310 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2311
2312         * attribute.cs: Small refactoring (improved robustness).
2313         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2314         (ValidateGuid): Removed.
2315         (Resolve): Removed referenced to above mentioned.
2316         (GetAttributeUsage): Made private and changed to work without
2317         class assistance.
2318         (GetIndexerAttributeValue): Don't crash.
2319         (GetConditionalAttributeValue): Ditto.
2320         (GetClsCompliantAttributeValue): Ditto.
2321         (ExtractSecurityPermissionSet): All attributes exceptions are
2322         error 648.
2323         (GetPropertyValue): New helper.
2324         (GetMethodImplOptions): New method.
2325         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2326         some missing properties.
2327         
2328         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2329         (Method.ApplyAttributeBuilder): Updated.
2330         
2331         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2332         exception.
2333
2334 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2335
2336         Fix #73052.
2337         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2338         non-simple types (array, pointer, reference).
2339
2340 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2341
2342         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2343
2344         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2345         for operators.
2346         (Method.CheckBase): Catch wrong destructor here.
2347         (MethodData.Define): Add errors 550, 668.
2348
2349         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2350
2351         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2352
2353         * pending.cs (VerifyPendingMethods): Add error 551.
2354
2355         * typemanager.cs (CSharpName): Next error report helper.
2356
2357 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2358
2359         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2360         attributes. Removed useless attribute double check.
2361         It saves almost 2MBs for corlib.
2362
2363 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2364
2365         Fix #72924.
2366         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2367         called twice in case of error.
2368
2369 2005-02-23  Chris Toshok  <toshok@ximian.com>
2370
2371         Fix compiler portions of #72827.
2372         * statement.cs (Block.Emit): call Begin/EndScope on the
2373         EmitContext instead of the ILGenerator.
2374
2375         * codegen.cs (EmitContext.BeginScope): new method, call
2376         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2377         we have one.)
2378         (EmitContext.BeginScope): same, but EndScope and CloseScope
2379
2380         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2381         offset and call the superclass's OpenScope(int) with it.
2382         (SymbolWriter.CloseScope): get the current il
2383         offset and call superclass's CloseScope(int) with it.
2384
2385 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2386
2387         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2388         CS1677 for out and ref as well.
2389
2390         * class.cs (Method.Define): Add error CS1599 detection.
2391         
2392         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2393         
2394         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2395         
2396         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2397         
2398         * support.cs.cs (ModifierDesc): New helper method.
2399
2400 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2401             Abin Thomas  <projectmonokochi@rediffmail.com>
2402             Anoob V E  <projectmonokochi@rediffmail.com>
2403             Harilal P R  <projectmonokochi@rediffmail.com>
2404
2405         Fix #57851, #72718.
2406         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2407         MemberLookup (used for error reporting) actually returns a result.
2408         Fix error report number (122, not 112).
2409
2410 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2411             Anoob V E  <projectmonokochi@rediffmail.com>
2412             Harilal P R  <projectmonokochi@rediffmail.com>
2413
2414         Fix #71134.
2415         * pending.cs (PendingImplementation.GetAbstractMethods):
2416         Find NonPublic members too.
2417
2418 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2419
2420         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2421         Fixed error 217.
2422         
2423         * class.cs (MethodCore.CheckMethodAgainstBase):
2424         Add error 239 report.
2425
2426 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2427
2428         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2429         
2430         * class.cs (Operator.Define): Add error 217 report.
2431         
2432 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2433
2434         Fix #68955.
2435         * expression.cs (Invocation.IsApplicable): Make public.
2436         (Invocation.IsParamsMethodApplicable): Likewise.
2437         * delegate.cs (Delegate.VerifyApplicability): Don't use
2438         Invocation.VerifyArgumentCompat for parameter applicability
2439         testing.  Use Invocation.IsApplicable and
2440         Invocation.IsParamsMethodApplicable.
2441
2442 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2443
2444         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2445         
2446         * class.cs (Operator.Define): Add error 217 report.
2447         
2448 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2449
2450         * namespace.cs (UsingEntry.Resolve): Undo change below.
2451
2452 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2453
2454         Fix #72756.
2455         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2456         disable the error message when the extended MemberLookup also
2457         fails.
2458         (Expression.MemberLookupFinal): Update.
2459         (SimpleName.DoSimpleNameResolve): Update.
2460         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2461         Don't use MemberLookupFinal.
2462         (New.DoResolve): Update.
2463         (BaseAccess.CommonResolve): Update.
2464
2465 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2466
2467         Fix #72732.
2468         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2469         occured previously, don't resolve again.
2470
2471 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2472
2473         Fix #69949
2474         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2475         argument. Call ResolveAttributeUsage for unresolved.
2476         when types doesn't match ctor arguments.
2477         
2478         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2479         for nested attribute classes.
2480         (Class.attribute_usage): Removed.
2481         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2482         for attribute class.
2483         
2484         * ecore.cs (IsAttribute): Removed.
2485         
2486         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2487         
2488         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2489         now normal types.
2490         (attribute_types): Removed.
2491         (EmitCode): Global attributes are emited as the latest.
2492
2493 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2494
2495         * class.cs (EmitFieldInitializers): Don't emit field initializer
2496         for default values when optimilization is on.
2497         
2498         * constant.cs (Constant.IsDefaultValue): New property.
2499         
2500         * driver.cs: Add /optimize handling.
2501         
2502         * constant.cs,
2503         * ecore.cs,
2504         * literal.cs: Implement new IsDefaultValue property.
2505         
2506         * rootcontext.cs (Optimize): New field, holds /optimize option.
2507
2508 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2509
2510         Fix crasher in re-opened #72347.
2511         * namespace.cs (Namespace.Lookup): Return null if
2512         DeclSpace.DefineType returns null.
2513
2514         Fix #72678.
2515         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2516
2517 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2518
2519         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2520         now returns null if it cannot resolve to an lvalue.
2521         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2522         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2523         returned null.  Remove check for SimpleName.
2524         (EventExpr.DoResolveLValue): New.
2525         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2526         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2527         error from ...
2528         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2529         avoid CS0131 error.
2530         (Unary.ResolveOperator): Move CS0211 check ...
2531         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2532         CS0131 error.
2533         (Unary.DoResolveLValue): Simplify.
2534         (AddressOf.DoResolveLValue): New.
2535         (ArrayAccess.DoResolveLValue): New.
2536
2537 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2538
2539         * attribute.cs (Attribute.Resolve): Add arguments casting for
2540         when types doesn't match ctor arguments.
2541
2542 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2543
2544         Fix parts of #63202.
2545         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2546         lookup of operator in base type.  Ensure that all checks happen
2547         when the operator resolves to an "op_..." method.
2548
2549 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2550
2551         Fix #71992.
2552         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2553         'ignore_cs0104' parameter.  Pass it to ...
2554         (NamespaceEntry.Lookup): ... this.
2555         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2556         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2557         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2558         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2559         Update.  Request that cs0104 errors be ignored.
2560         (ComposedCast.ResolveAsTypeStep): Update.
2561
2562 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2563
2564         Fix #59209.
2565         * expression.cs (Invocation.BetterFunction): Remove support for
2566         comparing virtual functions and their overrides.
2567         (Invocation.IsOverride): New.
2568         (Invocation.OverloadResolve): Don't consider 'override' functions
2569         during candidate selection.  Store them in a lookaside list.
2570         If the selected method is a 'virtual' function, use the list to
2571         find any overrides that are closer to the LHS type.
2572
2573 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2574
2575         * expression.cs (New.DoResolve): Add complex core type reduction.
2576         (New.Constantify): Converts complex core type syntax like 'new int ()'
2577         to simple constant.
2578         
2579 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2580
2581         * decl.cs (EntryType.EntryType): New constructor to create an
2582         updated copy of a cache entry.
2583         (MemberCache.AddMethods): Use it.
2584         (MemberCache.ClearDeclaredOnly): Remove.
2585         (MemberCache.MemberCache): Update.
2586
2587 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2588
2589         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2590         variable.  This one is represents the actual low-level declaration
2591         of the method, as opposed to the semantic level `IsStatic'.   
2592
2593         An anonymous method which is hosted into a static method might be
2594         actually an instance method.  IsStatic would reflect the
2595         container, while MethodIsStatic represents the actual code
2596         generated.
2597
2598         * expression.cs (ParameterReference): Use the new MethodIsStatic
2599         instead of IsStatic.
2600
2601         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2602         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2603         set on the current EmitContext. 
2604
2605         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2606         resolve our casted expression as an LValue.  This triggers the
2607         proper LValue processing that is later required by Assign.
2608
2609         This fixes 72347.
2610
2611         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2612
2613 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2614
2615         C# 2.0 Fixed buffer implementation
2616
2617         * anonymous.cs: Update after RegisterHelperClass renaming.
2618
2619         * attribute.cs (AttributeTester.fixed_buffer_cache):
2620         Cache of external fixed buffers.
2621         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2622         implementation if field is fixed buffer else null.
2623
2624         * class.cs
2625         (TypeContainer.AddField): Accept FieldMember instead of Field.
2626         (FieldBase.IsFieldClsCompliant): Extracted code from
2627         VerifyClsCompliance descendant customization.
2628         (FixedField): New class handles fixed buffer fields.
2629         (FixedFieldExternal): Keeps information about imported fixed
2630         buffer.
2631         (IFixedField): Make access to internal or external fixed buffer
2632         same.
2633
2634         * cs-parser.jay: Add fixed buffer parsing.
2635
2636         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2637         buffer.
2638
2639         * expression.cs (Indirection): Extended implementation to accept
2640         fixed buffer field.
2641         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2642         (ElementAccess.MakePointerAccess): Get type as parameter.
2643         (DoResolve): Add fixed buffer field expression conversion.
2644         (DoResolveLValue): Ditto.
2645         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2646         (ArrayPtr): Derives from FixedBufferPtr.
2647         (ArrayPtr.Emit): Add extra emit for array elements.
2648
2649         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2650
2651         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2652         for compiler generated types.
2653         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2654
2655         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2656         and consume less memory.
2657         (Fixed.Resolve): Add fixed buffer case.
2658
2659         * typemanager.cs (compiler_generated_attr_ctor,
2660         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2661         (HasElementType): Add our own implementation to work on every
2662         runtime.
2663
2664 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2665
2666         * anonymous.cs (CaptureContext): Track whether `this' has been
2667         referenced.   
2668
2669         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2670         only captured `this' if it was implicitly done (instance
2671         methods/variables were used). 
2672
2673         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2674         `this' must be captured.
2675
2676 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2677  
2678         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2679         is null it means that there has been no need to capture anything,
2680         so we just create a sibling.
2681
2682         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2683
2684         Just a partial fix.  The other half is fairly elusive.
2685         
2686 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2687
2688         Fix #52586, cs0121-4.cs.
2689         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2690         and return a hashtable.
2691         (MemberCache.ClearDeclaredOnly): New.
2692         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2693         the method_hash of a base type too.
2694         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2695         type methods.  Overwrite entries with the same MethodHandle so
2696         that the ReflectedType is correct.  The process leaves in base
2697         virtual functions and their overrides as distinct entries.
2698         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2699         matters since it was boxed in a ArrayList before.
2700         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2701         modifier.
2702         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2703         case of a virtual function and its override (choose the overload
2704         as better).
2705         (Invocation.OverloadResolve): Avoid 'override' members during
2706         'applicable_type' calculation.
2707
2708 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2709
2710         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2711         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2712         GetTypeHandle.  It is possible for a reflected type to derive from
2713         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2714         System.Array during mscorlib compilation).
2715         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2716         contain a method_hash, don't create one either.  Don't create a
2717         deep copy of the base cache's method_hash.
2718         (MemberCache.SetupCache): Rename back from DeepCopy.
2719         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2720         already initialized.  If we see an override function, add its
2721         underlying base virtual function to the member_hash too.
2722
2723 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2724
2725         Combine two near-redundant caches.
2726         * typemanager.cs (method_params): Rename from method_internal_params.
2727         (TypeManager.GetParameterData): New.  Replace
2728         Invocation.GetParameterData.
2729         (TypeManager.LookupParametersByBuilder): Remove.
2730         * expression.cs (Invocation.method_parameter_cache): Remove.
2731         (Invocation.GetParameterData): Remove.
2732         Update to changes.
2733         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2734         Update to changes.
2735
2736 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2737
2738         Fix #72015.
2739         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2740         TypeManager.multicast_delegate_type is null, resolve it by looking
2741         up "System.MulticastDelegate".
2742         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2743
2744 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2745             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2746             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2747
2748         Fix cs0164.cs.
2749         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2750         (LabeledStatement.AddReference): New.  Set 'referenced'.
2751         (Goto.Resolve): Use it.
2752
2753 2005-02-05  John Luke  <john.luke@gmail.com>
2754
2755         * driver.cs: remove duplicate -doc line in Usage ()
2756
2757 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2758
2759         * location.cs (Location.AddFile): Fix CS2002 error report.
2760
2761 2005-02-02  Martin Baulig  <martin@ximian.com>
2762
2763         * delegate.cs (Delegate.DefineType): Report an internal error if
2764         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2765         details.        
2766
2767 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2768
2769         Fix a crasher in a variant of #31984.
2770         * const.cs (Constant.CheckBase): New override that defers the
2771         new-or-override check in case the base type hasn't been populated
2772         yet.
2773         (Constant.Define): Ensure the new-or-override check is performed.
2774
2775 2005-02-01  Duncan Mak  <duncan@ximian.com>
2776
2777         * const.cs (LookupConstantValue): Check that `ce' is not null
2778         before calling GetValue ().
2779
2780 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2781
2782         Fix test-334.cs (#69519).
2783         * cs-parser.jay (using_alias_directive): Pass in an expression to
2784         NamespaceEntry.UsingAlias.
2785         (using_namespace_directive): Pass in an expression to
2786         NamespaceEntry.Using.
2787         (namespace_name): Don't flatten to a string.
2788         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2789         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2790         ResolveAsTypeStep.
2791         (NamespaceEntry.UsingEntry): Likewise.
2792         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2793         changes.
2794         (NamespaceEntry.LookupForUsing): Remove.
2795         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2796         names.
2797         (NamespaceEntry.Lookup): Remove support for dotted names.
2798
2799 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2800
2801         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2802         split into two.
2803         (NamespaceEntry.ImplicitParent): Compute on demand.
2804         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2805         parallels the current.
2806         (NamespaceEntry.LookupForUsing): Use it.
2807         (NamespaceEntry.Lookup): If the current namespace-entry is
2808         implicit, don't search aliases and using tables.
2809
2810 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2811
2812         Fix #31984.
2813         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2814         BaseCache here.
2815         (TypeContainer.BaseCache): Compute on demand.
2816         (TypeContainer.FindMembers): Define constants and types if they're
2817         not already created.
2818         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2819         check.
2820         * const.cs (Constant.Define): Make idempotent.
2821
2822 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2823
2824         * pending.cs: Produce better code (no nops produced by using Ldarg
2825         + value).
2826         
2827         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2828         i - 1' it should be arg + 1.
2829
2830         Fixes bug #71819.
2831
2832 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2833
2834         * attribute.cs (Attribute.CheckAttributeType): Make private
2835         non-virtual.
2836         (Attribute.ResolveType): Make virtual.
2837         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2838         handling of RootContext.Tree.Types.
2839
2840 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2841
2842         Update attribute-handling to use the SimpleName/MemberAccess
2843         mechanisms.
2844         * cs-parser.jay (attribute): Pass in an expression to the
2845         constructors of Attribute and GlobalAttribute.
2846         * attribute.cs (Attribute): Take an expression for the name.
2847         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2848         passed in attribute name expression.
2849         (Attribute.CheckAttributeType): Use it.
2850         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2851         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2852         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2853         argument to prevent error messages if the lookup fails.
2854
2855 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2856
2857         * expression.cs (Indirection): Implemented IVariable interface
2858         to support indirection in AddressOf operator.
2859         (PointerArithmetic.Emit): Add optimalization for case where
2860         result can be precomputed.
2861
2862 2005-01-26  Martin Baulig  <martin@ximian.com>
2863
2864         * class.cs (TypeContainer.AttributeTargets): Return the correct
2865         AttributeTargets depending on our `Kind' instead of throwing an
2866         exception; fixes #71632.
2867
2868 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2869
2870         Fix #71257
2871         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2872         constant members.
2873
2874 2005-03-17  Martin Baulig  <martin@ximian.com>
2875
2876         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2877         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2878
2879 2005-03-17  Martin Baulig  <martin@ximian.com>
2880
2881         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2882         to bool so we can return an error condition.
2883         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2884         returned an error.
2885
2886 2005-03-17  Martin Baulig  <martin@ximian.com>
2887
2888         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2889
2890         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2891         converting from an array-type of T to `IEnumerable<T>'.
2892
2893 2005-03-16  Martin Baulig  <martin@ximian.com>
2894
2895         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2896         (Nullable.LiftedUnaryMutator): New public class.
2897
2898         * expression.cs (UnaryMutator.DoResolve): Added support for
2899         Nullable Types.
2900
2901 2005-03-14  Martin Baulig  <martin@ximian.com>
2902
2903         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2904
2905 2005-03-14  Martin Baulig  <martin@ximian.com>
2906
2907         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2908         the comparision operators `<', `>', `<=' and `>='.
2909
2910 2005-03-13  Martin Baulig  <martin@ximian.com>
2911
2912         * generic.cs
2913         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2914         avoid confusion with the `NullLiteral'.
2915         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2916
2917 2005-03-13  Martin Baulig  <martin@ximian.com>
2918
2919         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2920         comparing arbitrary types with the null literal.
2921
2922 2005-03-13  Martin Baulig  <martin@ximian.com>
2923
2924         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2925         boolean operators '&&', '||', '&' and '|'.
2926         (Nullable.OperatorTrueOrFalse): New public class.
2927
2928         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2929         instead of a `StaticCallExpr'; added support for nullables.
2930
2931 2005-03-10  Martin Baulig  <martin@ximian.com>
2932
2933         * expression.cs
2934         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2935         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2936
2937 2005-03-07  Martin Baulig  <martin@ximian.com>
2938
2939         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2940         it work if `expr' is not an IMemoryLocation.
2941         (Nullable.Lifted): Implement IMemoryLocation.
2942         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2943         target type.
2944
2945 2005-03-05  Martin Baulig  <martin@ximian.com>
2946
2947         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2948         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2949         (Nullable): Added support for lifted unary and binary operators.
2950
2951         * expression.cs (Unary.DoResolve): Added support for nullable types.
2952         (Binary.DoResolve): Likewise.
2953         (Conditional.DoResolve): Likewise.
2954
2955 2005-03-02  Martin Baulig  <martin@ximian.com>
2956
2957         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2958
2959         * class.cs (ClassPart.SetParameterInfo): Override this.
2960         (PartialContainer.SetParameterInfo): Override this.
2961         (TypeContainer.CheckConstraints): New protected method.
2962         (PartialContainer.CheckConstraints): Override this and check
2963         whether the same contraints were specified in all parts of a
2964         partial generic type definition.
2965         (PartialContainer.UpdateConstraints): New public method.
2966
2967         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2968
2969 2005-03-02  Martin Baulig  <martin@ximian.com>
2970
2971         Committing a patch from Carlos Alberto Cortez to fix #72887.
2972
2973         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2974         casts from `T []' to `int []'.
2975
2976 2005-03-02  Martin Baulig  <martin@ximian.com>
2977
2978         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2979
2980         * expression.cs (Binary.ResolveOperator): When resolving a
2981         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2982         `=='.  Fixes #71866.  See gen-127.cs.
2983
2984 2005-03-02  Martin Baulig  <martin@ximian.com>
2985
2986         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2987         static constructor in static classes.
2988
2989 2005-03-02  Martin Baulig  <martin@ximian.com>
2990
2991         * generic.cs
2992         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2993         (Nullable.LiftedConversion): Added support for user-defined
2994         conversions.
2995
2996         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2997
2998         * cs-parser.jay: Use ComposedCast everywhere instead of
2999         NullableType, so we don't need to check for NullableType
3000         everywhere.
3001         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3002         case where we'll be resolved into a `parenthesized_expression_0'
3003         afterwards.
3004
3005         * convert.cs
3006         (Convert.UserDefinedConversion): Added nullable conversions.
3007
3008 2005-02-28  Martin Baulig  <martin@ximian.com>
3009
3010         * generic.cs (TypeManager.IsNullableType): New static method.
3011         (Nullable): New abstract class.
3012         (Nullable.NullLiteral): New public class.
3013         (Nullable.LiftedConversion): New public class.
3014
3015         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3016         `builtin_types opt_nullable'.
3017
3018         * convert.cs
3019         (Convert.ImplicitConversionStandard): Added nullable conversions.
3020         (Convert.ExplicitConversionStandard): Likewise.
3021         (Convert.ExplicitConversion): Likewise.
3022
3023 2005-02-26  Martin Baulig  <martin@ximian.com>
3024
3025         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3026         begin with a "?", for instance "?[]".  Don't do a type lookup if
3027         `dim' is empty.
3028
3029 2005-02-25  Martin Baulig  <martin@ximian.com>
3030
3031         The first part of Nullable Types :-)
3032
3033         * generic.cs (NullableType): New public class.
3034         (NullCoalescingOperator): New public class.
3035         (TypeArguments.Resolve): Add a CS0306 check.
3036
3037         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3038         (opt_nullable): New rule.
3039         (type): Added `opt_nullable' to `namespace_or_type_name',
3040         `builtin_types' and `pointer_type'.
3041         (array_type): Added `opt_nullable'.
3042         (opt_rank_specifier_or_nullable): New rule; this is the
3043         combination of `opt_rank_specifier' and `opt_nullable'.
3044         (opt_error): New rule; catch errors here.
3045         (nullable_type_or_conditional): New rule; we use this to check for
3046         nullable and still detect the conditional operator.
3047         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3048         instead `opt_rank_specifier'.
3049
3050         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3051         for nullables.
3052
3053 2005-02-24  Martin Baulig  <martin@ximian.com>
3054
3055         * README, README.Changes: Removed; they're old and obsolete.
3056
3057 2005-02-22  Martin Baulig  <martin@ximian.com>
3058
3059         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3060         returned an error, set `constraints' to null to avoid a crash
3061         later on.
3062         (TypeParameter.ResolveType): Likewise.
3063
3064 2005-02-22  Martin Baulig  <martin@ximian.com>
3065
3066         * generic.cs
3067         (Constraints.ResolveTypes): Protect against being called twice.
3068         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3069         (TypeParameter.ResolveType): New public method; calls
3070         constraints.ResolveTypes().
3071         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3072         into the new ResolveType().
3073         (GenericMethod.Define): Call ResolveType() on all our
3074         TypeParameter's.        
3075
3076 2005-02-21  Martin Baulig  <martin@ximian.com>
3077
3078         * generic.cs
3079         (TypeManager.generic_nullable_type): New static public field.
3080         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3081
3082         * rootcontext.cs
3083         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3084
3085 2005-02-15  Martin Baulig  <martin@ximian.com>
3086
3087         * generic.cs (ConstructedType.Constraints): Correctly check
3088         constraints if the argument type is a type parameter; fixes
3089         #72326. 
3090
3091 2005-02-02  Martin Baulig  <martin@ximian.com>
3092
3093         * delegate.cs (Delegate.DefineType): Report an internal error if
3094         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3095         details.        
3096
3097 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3098
3099         * pending.cs: Produce better code (no nops produced by using Ldarg
3100         + value).
3101         
3102         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3103         i - 1' it should be arg + 1.
3104
3105         Fixes bug #71819.
3106         
3107 2005-01-26  Martin Baulig  <martin@ximian.com>
3108
3109         * cs-parser.jay (indexer_declarator): Don't report an error if we
3110         have type parameters since we can be an explicit interface
3111         implementation; fixes #71449.
3112
3113 2005-01-26  Martin Baulig  <martin@ximian.com>
3114
3115         * class.cs (TypeContainer.AttributeTargets): Return the correct
3116         AttributeTargets depending on our `Kind' instead of throwing an
3117         exception; fixes #71632.
3118
3119 2005-01-26  Martin Baulig  <martin@ximian.com>
3120
3121         * delegate.cs (Delegate.DefineType): Correctly define our type
3122         parameters.  Fixes #71483.
3123
3124 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3125
3126         Fix #71602.
3127         * expression.cs (MemberAccess.DoResolve): Don't complain with
3128         cs0572 when the LHS of a member access has identical name and type
3129         name.
3130
3131 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3132
3133         Fix #71651, #71675
3134         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3135         CreatePermission.
3136         Create custom PermissionSet only for PermissionSetAttribute.
3137
3138 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3139
3140         Fix #71649
3141         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3142         delegates in static class.
3143
3144 2005-01-24  Martin Baulig  <martin@ximian.com>
3145
3146         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3147         merging an implicit block, just use its reachability.
3148
3149         * statement.cs (Block.Resolve): Make the unreachable code check
3150         work wrt. implicit blocks; see test-337 from #63842.
3151
3152 2005-01-21  Alp Toker  <alp@atoker.com>
3153  
3154         * cs-parser.jay: destructor_declaration's container is PartialContainer
3155         not Class when partial types are used, so use Kind prop instead of
3156         'is'.
3157         
3158 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3159
3160         * cs-parser.jay: Improve error reporting when an interface
3161         declares new types.
3162
3163 2005-01-20  Dick Porter  <dick@ximian.com>
3164
3165         * support.cs: SeekableStreamReader fix from Sandor Dobos
3166         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3167         chars are read.  Fixes bug 70369.
3168
3169 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3170
3171         * cs-parser.jay (catch_clause): Simplify current_block handling
3172         somewhat.
3173
3174 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3175
3176         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3177         code with ImplicitStandardConversion to handle the implicit
3178         conversion of method groups into valid delegate invocations. 
3179
3180         The problem is that in parameter handling we were using this code
3181         path.  Fixes bug #64698
3182
3183 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3184
3185         * cs-parser.jay: Fix several infelicities.
3186         - Avoid assigning to the parser value stack.  Code like 
3187           '$3 = null' is unclean.  Synthesize a value for the code block
3188           instead. 
3189         - Avoid using oob_stack for storing location information.  Use ...
3190         (_mark_): ... this.  New (empty) rule.  Saves the current location
3191         in $$.
3192         (foreach_statement): Avoid using oob_stack for current_block
3193         handling.  Use technique used in for_statement and
3194         using_statement.  Synthesize a value for the code block to store
3195         additional intermediate information.
3196
3197 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3198
3199         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3200         of a different type is only allowed to private fields of a
3201         containing type, not on fields of a base class.
3202
3203         See test-174.cs and error cs0122-9.cs
3204
3205 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3206
3207         Fix test-335.cs (bug #58126).
3208         * cs-parser.jay (argument): Split out non-expression parts of the
3209         rule into 'non_simple_argument'.
3210         (invocation_expression): Support parenthesized invocations with
3211         multiple arguments, and with single non-simple arguments.
3212
3213 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3214
3215         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3216         places.
3217
3218 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3219
3220         Fix cs0038-1.cs, cs1640-6.cs.
3221         * ecore.cs (Expression.Resolve): Remove special-case for
3222         SimpleName in error-handling.
3223         (Expression.almostMatchedMembers): Relax access permission to
3224         protected.
3225         (Expression.MemberLookupFailed): Handle duplicates in
3226         almostMatchedMembers list.
3227         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3228         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3229         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3230         overload if the passed in MemberInfo is a MethodBase.
3231
3232 2005-01-25  Martin Baulig  <martin@ximian.com>
3233
3234         * doc.cs
3235         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3236
3237 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3238
3239         Fix #70749
3240         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3241         for non-CAS & merge permission sets properly.
3242
3243 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3244
3245         Improve standard-compliance of simple name and member access 
3246         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3247         * ecore.cs (FullNamedExpression): New abstract base class 
3248         for Namespaces and TypeExpressions.
3249         (ResolveFlags.SimpleName): Remove.
3250         (SimpleName): Remove support for dotted names.
3251         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3252         DeclSpace.FindType and DeclSpace.LookupType.
3253         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3254         (Expression.ExprClassName): Make member function.
3255         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3256         a namespace.  Remove creation of dotted "SimpleName"s.
3257         (MemberAccess.DoResolve): Likewise.
3258         * decl.cs (DeclSpace.Cache): Make private.
3259         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3260         (DeclSpace.FindType): Update.
3261         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3262         FullNamedExpression.
3263         * namespace.cs (Namespace): Derive from FullNamedExpression
3264         so that it can be part of expression resolution.
3265         (Namespace.Lookup): Return an FullNamedExpression.
3266         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3267         namespace.
3268         * rootcontext.cs (NamespaceLookup): Remove.
3269         (LookupType): Move to DeclSpace.
3270         * attribute.cs (CheckAttributeType): Update.
3271         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3272         (FindDocumentedTypeNonArray): Likewise.
3273
3274 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3275
3276         Fix cs0509.cs, cs1632.cs.
3277         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3278         is the same as IsInterface.
3279         (TypeContainer.GetClassBases): Likewise.
3280         * statement.cs (LabeledStatement.ig): New field.
3281         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3282         label.
3283         (LabeledStatement.DoEmit): Check that the label was created with
3284         the same ILGenerator.
3285
3286 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3287
3288         Fix #71058
3289         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3290         accessors to its properties.
3291
3292         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3293         from accessors to property.
3294         
3295 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3296
3297         Fix #70722
3298         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3299         only for overrides.
3300         
3301 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3302
3303         * attribute.cs: Check for null and empty strings.  
3304
3305         I have lost another battle to Paolo.
3306
3307 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3308
3309         Fix #70942
3310         * class.cs (PropertyMethod): Set Parent field in ctors.
3311         (SetMethod.InternalParameters): Add unsafe switch hack.
3312         Override MarkForDuplicationCheck where it is appropriate.
3313
3314         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3315         It says whether container allows members with the same name.
3316         Base default is no.
3317         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3318         Removed is_method parameter.
3319
3320 2005-01-06  Duncan Mak  <duncan@ximian.com>
3321
3322         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3323         because the previous change led to incorrect reporting of CS1032
3324         ("Cannot define/undefine preprocessor symbols after first token in
3325         file"). Instead of using `tokens_seen' as the only flag that
3326         triggers CS1040, introduce `comments_seen'. This new flag is used
3327         to signify having seen comments on the current line, so it is
3328         unset after a newline.
3329
3330 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3331
3332         * doc.cs : When searching for a type, find nested type too.
3333           This fixes bug #71040.
3334
3335 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3336
3337         * doc.cs :
3338           - Warn missing member comment on those classes which also does not
3339             have doc comments. Fixed bug #71041.
3340           - Don't warn missing doc comment on default constructor.
3341             Fixed bug #71042.
3342
3343 2005-01-06  Duncan Mak  <duncan@ximian.com>
3344
3345         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3346         comments, set `tokens_seen' to true. This allows us to detect
3347         misplaced preprocessor directives (i.e. not at the beginning of
3348         the a line, nor after whitespaces). In that case, report error
3349         CS1040. This fixes bug #56460.
3350
3351         * cs-parser.jay (interface_member_declaration): Add checks for
3352         IsExplicitImpl, and report CS0541 error if an interface member is
3353         defined as an explicit interface declaration.
3354
3355 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3356
3357         Fix #70817
3358         * class.cs (PropertyMethod): Set Parent field in ctors.
3359         (SetMethod.InternalParameters): Add unsafe switch hack.
3360         
3361         * decl.cs (MemberCore.Parent): Cannot be readonly.
3362
3363 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3364
3365         * decl.cs (DeclSpace.ResolveType): Remove.
3366         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3367         Merge in code from ...
3368         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3369         * class.cs, enum.cs: Update to changes.
3370
3371 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3372
3373         * anonymous.cs: Ensure that we init the scope of our parent if it
3374         has not been initialized yet.
3375
3376 2004-12-30  Duncan Mak  <duncan@ximian.com>
3377
3378         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3379         if field.FieldBuilder is null. Fixes #70758.
3380
3381         * convert.cs: Fixed some typos and updated some of the comments.
3382         (ImplicitStandardConversionExists):
3383         (TryImplicitIntConversion): If `target_type' is an interface and
3384         the type of `ic' implements this interface, return true or a new
3385         BoxedCast instead of null. This fixes #70468.
3386
3387 2004-12-29  Duncan Mak  <duncan@ximian.com>
3388
3389         * expression.cs (Argument.Emit): Check that Expr is
3390         IMemoryLocation before casting to it, and report CS1510 otherwise.
3391
3392         This fixes #70402.
3393
3394 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3395
3396         * statement.cs (Block.ThisVariable): remove the recursion here, to
3397         make the --profile more sane.
3398
3399 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3400
3401         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3402         assembly, by JB Evain.
3403
3404 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3405
3406         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3407           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3408         "parent" refers to enclosing type/class.  "base" refers to superclass.
3409
3410 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3411
3412         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3413         Ensure that we only have GlobalAttributes.
3414         * attribute.cs (Attribute.Emit): Make non-virtual.
3415         (GlobalAttribute.Emit): Remove.
3416         (Attribute.Resolve): Make virtual.
3417         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3418         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3419         the argument. Don't create one.
3420         (Attribute.GetObsoleteAttribute): Likewise.
3421         (Attribute.GetClsCompliantAttributeValue): Likewise.
3422         * class.cs, decl.cs: Update to changes.
3423
3424 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3425
3426         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3427         
3428         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3429         
3430         * statement.cs (Foreach.Resolve): Add error 186 report.
3431
3432 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3433
3434         * expression.cs (Conditional.DoResolve): Add warning 429.
3435         
3436         * statement.cs (If.Resolve): Add warning 665.
3437
3438 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3439
3440         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3441         except when in the parser, and in GlobalAttribute.
3442         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3443         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3444         RootContext.Tree.Types.NamespaceEntry once work is done.
3445         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3446         and resets RootContext.Tree.Types.NamespaceEntry.
3447
3448 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3449
3450         * cs-parser.jay: Don't create a block for every variable.
3451
3452 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3453
3454         * location.cs: Provide extra information.
3455
3456         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3457         variables from the captured environment, it is the ldarg_0.
3458
3459 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3460
3461         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3462         find a conclusion.
3463         
3464         * class.cs: Changed warning level for 169 to avoid developer
3465         displeasure from warning flooding. It will be changed back when they
3466         fix most of current BCL warnings.
3467         
3468         * RootContext.cs: Pushed default WarningLevel to 3.
3469         
3470         * statement.cs: Removed unused variable.
3471
3472 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3473
3474         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3475         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3476         Add error 502 report.
3477         (StaticClass.DefineType): Add error 441 report.
3478         (Class.AllowedModifiersProp): New virtual property as temporary
3479         extension to AllowedModifiers.
3480         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3481         to share implementation with StaticClass and don't call virtual
3482         methods from ctor.
3483         
3484         * driver.cs (MainDriver): Add error 1558 test.
3485
3486         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3487         report. Moved error 36 test here.
3488
3489         * statement.cs (Throw.Resolve): Add error 724 report.
3490
3491         * typemanager.cs: Add out_attribute_type core type.
3492         
3493 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3494
3495         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3496         3018 report.
3497         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3498
3499         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3500         3017 report.
3501         
3502         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3503
3504         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3505         Add error 3023 report.
3506         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3507
3508         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3509         implementation.
3510
3511 2004-12-12  John Luke  <john.luke@gmail.com>
3512
3513         * driver.cs (AddArgs): take -- into account when
3514         adding arguments, fixes bug 65710 
3515
3516 2004-12-12  Martin Baulig  <martin@ximian.com>
3517
3518         * expression.cs (Unary.TryReduceNegative): Added support for
3519         SByteConstant and ByteConstant.
3520         (Unary.Reduce): Check error values from TryReduceNegative().
3521
3522 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3523
3524         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3525         and report exception as error 182.
3526
3527 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3528
3529         * driver.cs (Main): Fix message when there are warnings.
3530
3531 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3532
3533         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3534
3535 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3536
3537         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3538         Reduced number of warnings.
3539         
3540         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3541
3542 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3543
3544         * driver.cs: Removed message.
3545
3546         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3547
3548 2004-12-08    <vargaz@freemail.hu>
3549
3550         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3551
3552 2004-12-08  Martin Baulig  <martin@ximian.com>
3553
3554         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3555         instead of a CS3002 for properties and indexer.
3556
3557 2004-12-08  Martin Baulig  <martin@ximian.com>
3558
3559         * decl.cs (MemberName.ToString): Make this work again.
3560
3561 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3562
3563         * attribute.cs (Resolve): Add error 591 detection.
3564
3565         * class.cs (FieldMember.Define): Add error 1547 detection.
3566         (Indexer.Define): Add error 620 detection.
3567         (Operator.Define): Add error 590 detection.
3568
3569         * ecore.cs: Missing argument for error 79.
3570
3571         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3572         detection.
3573
3574 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3575
3576         Fix #70106
3577         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3578         only.
3579
3580 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3581
3582         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3583           Some operator comments were suppressed.
3584         * doc.cs : Implicit/explicit operator name in doc comments are like
3585           "op_Explicit(type)~returnType", so added suffix handling.
3586
3587 2005-01-21  Alp Toker  <alp@atoker.com>
3588
3589         * cs-parser.jay: destructor_declaration's container is PartialContainer
3590         not Class when partial types are used, so use Kind prop instead of 'is'.
3591
3592 2004-12-12  Martin Baulig  <martin@ximian.com>
3593
3594         * expression.cs (Unary.TryReduceNegative): Added support for
3595         SByteConstant and ByteConstant.
3596         (Unary.Reduce): Check error values from TryReduceNegative().
3597
3598 2004-12-11  Martin Baulig  <martin@ximian.com>
3599
3600         * support.cs (ReflectionParameters.ParameterName): If we have a
3601         `gpd', call `ParameterName' on it.
3602
3603         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3604
3605         * pending.cs (PendingImplementation.DefineProxy): Call
3606         DefineParameter() for all of the MethodBuilder's arguments.
3607
3608 2004-12-09  Martin Baulig  <martin@ximian.com>
3609
3610         * doc.cs (DocUtil): Make this a static class.
3611
3612 2004-12-09  Martin Baulig  <martin@ximian.com>
3613
3614         * expression.cs (Invocation.InferType): Moved the type inference
3615         implementation into TypeManager.
3616
3617         * generics.cs (TypeManager): Moved the type inference
3618         implementation here.
3619
3620 2004-12-09  Martin Baulig  <martin@ximian.com>
3621
3622         * typemanager.cs (TypeManager): Make this a partial class.
3623
3624         * generics.cs
3625         (TypeManager): Move the generics part of `TypeManager' here.
3626
3627 2004-12-08  Martin Baulig  <martin@ximian.com>
3628
3629         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3630         instead of a CS3002 for properties and indexer.  Added CS3024
3631         check for generic interfaces.
3632
3633         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3634         instances are not CLS-compliant.
3635
3636 2004-12-08  Martin Baulig  <martin@ximian.com>
3637
3638         * cs-parser.jay
3639         (void_pointer_expression): New rule for `void*', `void**' etc.
3640         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3641
3642 2004-12-08  Martin Baulig  <martin@ximian.com>
3643
3644         * expression.cs (Invocation.InferType): Removed the hack for
3645         MethodCore.MayUnify().  
3646
3647         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3648         this actually work.
3649
3650         * class.cs (MethodCore.MayUnify): Use
3651         TypeManager.MayBecomeEqualGenericTypes().       
3652
3653 2004-12-08  Martin Baulig  <martin@ximian.com>
3654
3655         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3656         parameter, box it.  Fixes #69233.
3657
3658 2004-12-08  Martin Baulig  <martin@ximian.com>
3659
3660         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3661         have the ctor constraint.  Fixes #68326.
3662
3663 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3664
3665         * cs-parser.jay : interface comment was not consumed because of
3666           extra opt_semicolon before doc handling.
3667
3668 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3669
3670         Fix test-327.cs, test-328.cs, and put in early infrastructure
3671         for eventually fixing #52697.
3672         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3673         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3674         from other methods.
3675         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3676         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3677         (VerifyUsing, error246): Update.
3678         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3679         'NamespaceEntry.LookupNamespaceOrType'.
3680
3681 2004-12-07  Martin Baulig  <martin@ximian.com>
3682
3683         * driver.cs: Call it "BETA SOFTWARE" :-)
3684
3685 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3686
3687         Fix crash on cs0657-17.cs.
3688         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3689         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3690         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3691         the case where the NamespaceEntry gets overwritten.
3692
3693 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3694
3695         Fixed #69195, #56821
3696         * ecore.cs (ResolveBoolean): Tiny refactoring.
3697
3698         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3699         of right expression resolving when left is false constant and
3700         operator is LogicalAnd OR true constant and operator is LogicalOr.
3701
3702         * statement.cs (ResolveUnreachable): Always reports warning.
3703
3704 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3705
3706         * class.cs: Distinguish between 1721 and 1722 (just a little help
3707         for the programmer).
3708
3709 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3710
3711         * delegate.cs: Only allow this on new versions of the language. 
3712
3713 2004-12-02  Duncan Mak  <duncan@ximian.com>
3714
3715         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3716         Expression class.
3717         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3718         here as a static method. Take an additional bool out parameter
3719         `must_do_cs1540_check' for signaling to InstanceResolve.
3720         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3721         member field from PropertyExpr class and made it an argument of
3722         the method instead.
3723         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3724         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3725         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3726         and `remove_accessor' as well as InstanceResolve: report CS0122
3727         where applicable.
3728
3729         Fixes #70129.
3730
3731 2004-12-07  Martin Baulig  <martin@ximian.com>
3732
3733         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3734         and CS0692 where appropriate.
3735
3736 2004-12-06  Martin Baulig  <martin@ximian.com>
3737
3738         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3739         IsDuplicateImplementation() and improved it.
3740
3741         * expression.cs (Invocation.InferTypeArguments): Added
3742         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3743         and removed the "ref" modifier from `infered_types'.
3744
3745         * decl.cs (MemberName.ToString): Removed the exception.
3746
3747 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3748
3749         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3750           comments are allowed.
3751
3752 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3753
3754         * delegate.cs: Add checks for subtypes in paramaters and return values
3755         in VerifyMethod () to add support for Covariance/Contravariance
3756         in delegates.
3757         
3758 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3759
3760         * report.cs: Remove extra closing parenthesis.
3761
3762         * convert.cs (Error_CannotImplicitConversion): If the name of the
3763         types are the same, provide some extra information.
3764
3765 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3766
3767         Fix bug #70102
3768         * attribute.cs (Resolve): Improved implementation of params
3769         attribute arguments.
3770
3771         * support.cs (ParameterData): Add HasParams to be faster.
3772
3773 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3774
3775         all things are for /doc support:
3776
3777         * doc.cs: new file that supports XML documentation generation.
3778         * mcs.exe.sources: added doc.cs.
3779         * driver.cs:
3780           Handle /doc command line option.
3781           Report error 2006 instead of 5 for missing file name for /doc.
3782           Generate XML documentation when required, after type resolution.
3783         * cs-tokenizer.cs:
3784           Added support for picking up documentation (/// and /** ... */),
3785           including a new XmlCommentState enumeration.
3786         * cs-parser.jay:
3787           Added lines to fill Documentation element for field, constant,
3788           property, indexer, method, constructor, destructor, operator, event
3789           and class, struct, interface, delegate, enum.
3790           Added lines to warn incorrect comment.
3791         * rootcontext.cs :
3792           Added Documentation field (passed only when /doc was specified).
3793         * decl.cs:
3794           Added DocComment, DocCommentHeader, GenerateDocComment() and
3795           OnGenerateDocComment() and some supporting private members for
3796           /doc feature to MemberCore.
3797         * class.cs:
3798           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3799         * delegate.cs:
3800           Added overriden DocCommentHeader.
3801         * enum.cs:
3802           Added overriden DocCommentHeader and GenerateDocComment().
3803
3804 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3805
3806         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3807         unwrapping the enumeration values, chain to
3808         DoConstantNumericPromotions again, so we can promote things to the
3809         fundamental types (takes care of enums that are bytes, sbytes).
3810
3811         Fixes bug #62054.
3812
3813 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3814
3815         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3816         Fix long-standing bug in type-lookup.  Use FindType instead of
3817         LookupType when ec.ResolvingTypeTree.
3818         (Attribute.ResolveType, Attribute.Resolve)
3819         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3820         Update to changes.
3821         (Attributes.Search): Remove internal version.  Update.
3822         (Attributes.SearchMulti): Update.
3823         (Attributes.GetClsCompliantAttribute): Remove.
3824         (Attributes.GetIndexerNameAttribute): Remove.
3825         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3826         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3827         * class.cs (Indexer.Define): Likewise.
3828
3829 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3830
3831         Fix bug #68790
3832         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3833         MarshallByReference members access.
3834
3835         * expression.cs: Use CheckMarshallByRefAccess;
3836         Better error CS0197 message.
3837
3838         * report.cs: Print whole related error message.
3839
3840 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3841
3842         * class (GetClassBases): Better error 60 report.
3843         (EventProperty): Disabled warning 67 detection.
3844
3845 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3846
3847         Fix bug #60324
3848         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3849
3850         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3851         precise values.
3852
3853 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3854
3855         Fix bug #49488
3856         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3857
3858         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3859
3860 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3861
3862         * attribute.cs (Attribute.Resolve): Refine error reporting and
3863         report a cs0117 if the identifier does not exist, to distinguish
3864         from 0617 which is a miss-use of the actual identifier.
3865
3866         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3867         between cs0070 and cs0079.
3868
3869         * class.cs (MemberBase.DoDefine): When reporting a wrong
3870         accessibility level, we use MethodCore to compare instead of
3871         Method (this was a regression in some refactoring effort).
3872
3873         So now we correctly report cs0056 again.
3874
3875         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3876         testing the target_type (which was known to be object_type) and
3877         not the source type (which is anonymous_method).
3878
3879         Fixed reporting of error cs1660.
3880
3881         * expression.cs (UserCast.Source): Expose the underlying cast.
3882
3883         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3884         allowed types to find a match to int32 first (most common).
3885
3886         In addition, it ignores any ImplicitUserConversions that did an
3887         internal implicit conversion (as the switch statement allows only
3888         one integral conversion to exist).
3889
3890         * class.cs (PartialContainer.Create): rename `name' to
3891         `member_name' for clarity.  Then replace the string calls with a
3892         call to MemberName.GetPartialName, as now using
3893         MemberName.ToString is an error (this is due to the side effects
3894         it had, that were fixed in the past).
3895
3896         This will restore the error reporting on a number of partial class
3897         errors that were missusing this (and getting an exception as a
3898         results, which is now just a plain textual warning, because
3899         yyparse debug output would crash otherwise).
3900
3901 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3902
3903         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3904
3905 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3906
3907         * rootcontext.cs (LookupType): Make sure to cache lookups that
3908         don't give us a negative result. This saves about 5% of corlib
3909         compilation time.
3910
3911 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3912
3913         * report.cs (AbstractMessage.Print): messages are sent to stderr
3914
3915         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3916         non-interface in the list of interfaces (at this point, either
3917         parent was properly set, or a base class is being listed in the
3918         interfaces section).
3919
3920         This flags error 1722, and resolves the crash from bug 69259.
3921
3922 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3923
3924         * statement.cs (Using.EmitExpressionFinally): make this work right
3925         for valuetypes. Fixes 69926.
3926
3927 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3928
3929         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3930         converted to an enum" here, before we try to change the underlying
3931         type.  This code exists, but it is a different code path than the
3932         one used while encoding constants.
3933
3934         (ImplicitReferenceConversionExists): In addition, resynchronized
3935         the code here, so it matches the same code in
3936         ImplicitReferenceConversionExists for the `from any class-type S
3937         to any interface-type T'.       
3938
3939 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3940
3941         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3942
3943 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3944
3945         * cs-parser.jay: Use verbosity accordingly. 
3946
3947 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3948
3949         * expression.cs (Unary.ResolveOperator): Do not report warning;
3950         AddressOf reads from variable.
3951         
3952         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3953
3954 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3955
3956         Fix bug #69462
3957
3958         * attribute.cs (Attributable): Removed CheckTargets.
3959         (Attributes.Emit): Explicit attribute targets are tested here.
3960
3961         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3962         not enabled for interfaces.
3963
3964         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3965         (GetAssemblyName): Ouch next bug there.
3966
3967 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3968
3969         * expression.cs: Error 275 added.
3970         
3971 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3972
3973         Fix bug #69177 (Implemented decimal constant support)
3974
3975         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3976         (BinaryFold): Add DecimalConstant.
3977
3978         * const.cs (Define): Decimal constant 
3979         (is not constant.
3980         (ChangeType): Add decimal type handling.
3981         (LookupConstantValue): Don't set value for decimal type but
3982         emit DecimalConstantAttribute. Needed for constant optimization.
3983
3984         * constant.cs (ToDecimal): New method.
3985         (ConvertToDecimal): New method.
3986         (IntConstant): Implemented ConvertToDecimal.
3987         (DecimalConstant.Emit): Emit optimized version for decimals in
3988         int range.
3989
3990         * expression.cs (ResolveOperator): Changed order of constant
3991         reduction to work correctly with native types which have
3992         overloaded operators.
3993         (ResolveMemberAccess): Extract constant value from attribute
3994         for decimal type.
3995
3996         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3997
3998         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3999         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4000         (ChangeType): Decimal is special.
4001         (TypeToCoreType): Add decimal type.
4002
4003 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4004
4005         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4006         decimal types.
4007
4008 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4009
4010         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4011         test cs1667-5.cs.
4012
4013 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4014
4015         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4016
4017         * pending.cs (PendingImplementation): Grab only interfaces.
4018
4019 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4020
4021         * statement.cs (ForeachHelperMethods): Add location member and
4022         error 202 detection.
4023
4024 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4025
4026         * expression.cs (DoResolveBase): Fixed wrong warning for out
4027         variables.
4028
4029 2004-12-04  Martin Baulig  <martin@ximian.com>
4030
4031         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4032         to check whether the conversion is ok.
4033
4034         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4035         `Type.EmptyTypes' if we're not a generic TypeContainer.
4036
4037 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4038
4039         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4040         old bug: when converting from the null literal to a pointer,
4041         return an EmptyCast, not the NullLiteral.
4042
4043         This fixes #69921, the recent null_type changes probably made this
4044         bug more prominent.
4045
4046 2004-12-03  Martin Baulig  <martin@ximian.com>
4047
4048         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4049         method as our child, call AnonymousMethod.Compatible() on it.
4050
4051 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4052
4053         * class.cs (FieldBase): Use an unused bit field from the field to
4054         encode the `has_offset' property from the FieldMember.  This saves
4055         a couple of Ks on bootstrap compilation.
4056
4057         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4058         method as our child, return the AnonymousMethod resolved
4059         expression.
4060
4061         * expression.cs (New.DoResolve): Allow return values from
4062         NewDelegate to also include AnonymousMethods.
4063
4064         Fixes #70150.
4065
4066 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4067
4068         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4069         cs1648 report.
4070         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4071         System.Runtime.InteropServices._Exception, since it's a base
4072         interface of the core type System.Exception in the net_2_0 profile.
4073
4074 2004-11-27  Martin Baulig  <martin@ximian.com>
4075
4076         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4077
4078 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4079
4080         * Makefile: Convert to use executable.make.
4081         * gmcs.exe.sources: New.
4082
4083 2004-11-25  Martin Baulig  <martin@ximian.com>
4084
4085         * expression.cs (Invocation.InferType): Added support for byref types.
4086
4087 2004-11-25  Martin Baulig  <martin@ximian.com>
4088
4089         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4090         in TypeManager.TypeToCoreType().
4091
4092 2004-11-25  Martin Baulig  <martin@ximian.com>
4093
4094         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4095         "Dispose" method from the `current_type'.
4096         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4097         DoDefineMembers() instead of using the MethodBuilder; this is
4098         required for generic iterators.
4099
4100         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4101
4102 2004-11-24  Martin Baulig  <martin@ximian.com>
4103
4104         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4105
4106 2004-11-20  Martin Baulig  <martin@ximian.com>
4107
4108         * expression.cs (Invocation.InferType): Correctly infer generic
4109         instances; see gen-103.cs.
4110         (Invocation.InferTypeArguments): If a generic method doesn't have
4111         any unbound type parameters, we don't need to infer anything.
4112
4113 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4114
4115         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4116
4117 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4118
4119         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4120         (TypeHandle.GetMemberCache): New.
4121         (TypeHandle.TypeHandle): Update.
4122         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4123         (TypeManager.LookupParentInterfacesCache):
4124         Rename from LookupInterfaceCache.  Optimize slightly.
4125         (TypeManager.MemberLookup_FindMembers): Update.
4126         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4127         multi-type variant.
4128         (AddCacheContents): Rename from AddHashtable.
4129         * class.cs (TypeContainer.parent_container): Remove.
4130         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4131         (TypeContainer.DoDefineMembers): Don't initialize it.
4132         Update to name changes.
4133         
4134 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4135
4136         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4137         that factors the code to check access modifiers on override.  
4138
4139         (PropertyBase): Use the code here.
4140
4141         Patch from Lluis S'anchez, fixes bug #69361.
4142
4143 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4144
4145         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4146         routine that is used to report the use of a captured variable
4147         whose address has been taken.
4148
4149         There are two checks: one when variables are being captured and
4150         the other check is when the address of a variable is taken. 
4151         
4152         (because an anonymous methods might be resolved before *or* after
4153         the address has been taken) and 
4154
4155         * expression.cs (Conditional.DoResolve): Remove the special
4156         casing that Martin added to trueExpr and falseExpr being both
4157         NullLiteral.  We get the right behavior now just by introducing
4158         the null_type into the compiler. 
4159
4160         * convert.cs (ExplicitConversion): Change the code to use
4161         null_type instead of testing `expr is NullLiteral'.
4162         (ImplicitConversionStandard): use null_type too.
4163         (ImplicitReferenceConversionExists): use null_type too.
4164         (ImplicitReferenceConversion): use null_type too.
4165
4166         * literal.cs: The type of `NullLiteral' is now null_type instead
4167         of object_type. 
4168         (Resolve): Set the type here.
4169
4170         * typemanager.cs: Introduce null_type.
4171
4172 2004-11-18  Martin Baulig  <martin@ximian.com>
4173
4174         * rootcontext.cs
4175         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4176
4177 2004-11-18  Martin Baulig  <martin@ximian.com>
4178
4179         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4180
4181 2004-11-18  Martin Baulig  <martin@ximian.com>
4182
4183         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4184         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
4185         call ResolveConstructedType() on it to resolve it without checking
4186         constraints.
4187         (Constraints.ResolveTypes): Check them here.
4188         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4189         but don't check constraints.
4190         (ConstructedType.ResolveAsTypeTerminal): Override this and also
4191         check constraints here.
4192         (ConstructedType.ResolveConstructedType): New public method.  This
4193         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4194         resolve ourselves without checking constraints.
4195
4196         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4197
4198 2004-11-18  Martin Baulig  <martin@ximian.com>
4199
4200         * decl.cs
4201         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4202
4203         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4204
4205 2004-11-18  Martin Baulig  <martin@ximian.com>
4206
4207         * ecore.cs (TypeExpr.ResolveType): Removed.
4208         (Expression.ResolveAsTypeTerminal): We always return a fully
4209         resolved `TypeExpr', so we can just access its `Type'.
4210
4211         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4212
4213 2004-11-17  Martin Baulig  <martin@ximian.com>
4214
4215         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4216         sure we don't return any unresolved TypeExpr's.
4217         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4218         a `TypeExpr'.
4219         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4220
4221         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4222         unresolved `ConstructedType's.
4223
4224 2004-11-17  Martin Baulig  <martin@ximian.com>
4225
4226         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4227
4228 2004-11-17  Martin Baulig  <martin@ximian.com>
4229
4230         * ecore.cs
4231         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4232
4233         * decl.cs (DeclSpace.ResolveType): Removed.
4234         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4235
4236 2004-11-17  Martin Baulig  <martin@ximian.com>
4237
4238         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4239         direction, like FindMembers() does.  Fixes #69546, testcase is in
4240         test-315.cs.    
4241
4242 2004-11-16  Martin Baulig  <martin@ximian.com>
4243
4244         This is based on a patch from Marek Safar, see bug #69082.
4245         Fixes bugs #63705 and #67130.
4246
4247         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4248         method; create a MemberCache for an interface type and cache the
4249         result.
4250
4251         * decl.cs (IMemberContainer.ParentContainer): Removed.
4252         (IMemberContainer.ParentCache): New property.
4253         (MemberCache.SetupCacheForInterface): Removed.
4254         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4255         to create a cache for an interface's "parent".
4256
4257         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4258         interfaces too.
4259
4260 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4261
4262         * statement.cs: Avoid adding bools to a hashtable.
4263
4264 2004-11-15  Martin Baulig  <martin@ximian.com>
4265
4266         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4267
4268 2004-11-11  Martin Baulig  <martin@ximian.com>
4269
4270         * typemanager.cs (TypeManager.GetMethodName): New method.
4271
4272         * class.cs (MethodData.Define): Include the generic arity in the
4273         name of an explicit interface; also add it to the method name.
4274
4275         * pending.cs (PendingImplementation.InterfaceMethod): The method
4276         name now includes the generic arity.
4277
4278 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4279
4280         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4281         calling an unsafe method from a safe location.
4282
4283 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4284
4285         Fix #69167
4286         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4287
4288 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4289
4290         * namespace.cs (VerifyUsing): use GetPartialName instead of
4291         ToString. 
4292
4293 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4294
4295         * statement.cs (Return.Resolve): Fix regression in typo: if
4296         `in_exc', we have to request a NeedReturnLabel, this was a typo
4297         introduced in the anonymous method check-in.  Fixes #69131.
4298
4299         * Indexers were using the ShortName when defining themselves,
4300         causing a regression in the compiler bootstrap when applying the
4301         patch from 2004-11-02 (first part), now they use their full name
4302         and the bug is gone.
4303
4304 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4305
4306         * driver.cs: Strip the path from the names of embedded resources. Fixes
4307         #68519.
4308
4309 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4310
4311         Fix error message regression: cs0104-2.cs.
4312         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4313         (AliasEntry.Resolve): Update.
4314         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4315         'silent' flag.
4316         (RootContext.LookupType): Update.
4317
4318 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4319
4320         * cs-parser.jay: Add support for handling accessor modifiers
4321         * class: Add support port accessor modifiers and error checking,
4322         define PropertyMethod.Define as virtual (not abstract anymore)
4323         * ecore.cs: Add checking for proeprties access with access modifiers
4324         * iterators.cs: Modify Accessor constructor call based in the modified
4325         constructor
4326 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4327
4328         * expression.cs (StringConcat): Handle being called twice,
4329         as when we have a concat in a field init with more than two
4330         ctors in the class
4331
4332 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4333
4334         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4335         special case explicit implementations, we should always produce
4336         the .property or .event declaration.
4337         
4338         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4339         since it will not return correct data if people use this
4340         unresolved in the presence of using statements (see test-313).
4341
4342         * class.cs (MethodData.Define): If we are an explicit interface
4343         implementation, set the method name to the full name of the
4344         interface plus the name of the method.  
4345
4346         Notice that using the method.MethodName.GetFullName() does not
4347         work, as it will only contain the name as declared on the source
4348         file (it can be a shorthand in the presence of using statements)
4349         and not the fully qualifed type name, for example:
4350
4351         using System;
4352
4353         class D : ICloneable {
4354                 object ICloneable.Clone ()  {
4355                 }
4356         }
4357
4358         Would produce a method called `ICloneable.Clone' instead of
4359         `System.ICloneable.Clone'.
4360
4361         * namespace.cs (Alias.Resolve): Use GetPartialName.
4362         
4363 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4364
4365         * cs-parser.jay: Add error 1055 report.
4366
4367 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4368
4369         * assign.cs (Assign.DoResolve): Only do the transform of
4370         assignment into a New if the types are compatible, if not, fall
4371         through and let the implicit code deal with the errors and with
4372         the necessary conversions. 
4373
4374 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4375
4376         * cs-parser.jay: Add error 1031 report.
4377
4378         * cs-tokenizer.cs: Add location for error 1038.
4379
4380 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4381
4382         * cs-parser.jay: Add error 1016 report.
4383
4384 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4385
4386         * cs-parser.jay: Add errors 1575,1611 report.
4387
4388 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4389
4390         * cs-parser.jay: Add error 1001 report.
4391
4392 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4393
4394         Fix #68850
4395         * attribute.cs (GetMarshal): Add method argument for
4396         caller identification.
4397
4398         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4399         agument for GetMarshal and RuntimeMissingSupport.
4400
4401 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4402
4403         * attribute.cs (ExtractSecurityPermissionSet): Removed
4404         TypeManager.code_access_permission_type.
4405
4406         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4407
4408 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4409
4410         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4411         for obsolete use of a variable here.   Fixes regression on errors
4412         cs0619-25 and cs0619-26.
4413
4414 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4415
4416         Fix #62358, implemented security attribute encoding.
4417
4418         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4419         Tests permitted SecurityAction for assembly or other types.
4420         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4421         data from SecurityPermissionAttribute to PermisionSet class.
4422
4423         * class.cs (ApplyAttributeBuilder): Added special handling
4424         for System.Security.Permissions.SecurityAttribute based types.
4425
4426         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4427         special handling for System.Security.Permissions.SecurityAttribute
4428         based types.
4429
4430         * enum.cs (ApplyAttributeBuilder): Added special handling
4431         for System.Security.Permissions.SecurityAttribute based types.
4432
4433         * parameter.cs (ApplyAttributeBuilder): Added special handling
4434         for System.Security.Permissions.SecurityAttribute based types.
4435
4436         * rootcontext.cs: Next 2 core types.
4437
4438         * typemanager.cs (TypeManager.security_permission_attr_type):
4439         Built in type for the SecurityPermission Attribute.
4440         (code_access_permission_type): Build in type.
4441
4442 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4443
4444         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4445         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4446         all of this information into
4447         EmitContext.EmitCapturedVariableInstance.
4448         
4449         * codegen.cs (EmitCapturedVariableInstance): move here the
4450         funcionality of emitting an ldarg.0 in the presence of a
4451         remapping.   This centralizes the instance emit code.
4452
4453         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4454         then emit a load of this: it means that we have reached the
4455         topmost ScopeInfo: the one that contains the pointer to the
4456         instance of the class hosting the anonymous method.
4457
4458         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4459         captures to the topmost CaptureContext.
4460
4461 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4462
4463         * expression.cs (LocalVariableReference): Move the knowledge about
4464         the iterators into codegen's EmitCapturedVariableInstance.
4465
4466 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4467
4468         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4469         all code paths return a value from an anonymous method (it is the
4470         same as the 161 error, but for anonymous methods).
4471
4472 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4473
4474         The introduction of anonymous methods in the compiler changed
4475         various ways of doing things in the compiler.  The most
4476         significant one is the hard split between the resolution phase
4477         and the emission phases of the compiler.
4478
4479         For instance, routines that referenced local variables no
4480         longer can safely create temporary variables during the
4481         resolution phase: they must do so from the emission phase,
4482         since the variable might have been "captured", hence access to
4483         it can not be done with the local-variable operations from the runtime.
4484         
4485         * statement.cs 
4486
4487         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4488         is a toplevel block.
4489
4490         (ToplevelBlock): A new kind of Block, these are the blocks that
4491         are created by the parser for all toplevel method bodies.  These
4492         include methods, accessors and anonymous methods.
4493
4494         These contain some extra information not found in regular blocks:
4495         A pointer to an optional CaptureContext (for tracking captured
4496         local variables and parameters).  A pointer to the parent
4497         ToplevelBlock.
4498         
4499         (Return.Resolve): Catch missmatches when returning a value from an
4500         anonymous method (error 1662).
4501         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4502         phase.
4503
4504         (Break.Resolve): ditto.
4505
4506         (SwitchLabel): instead of defining the labels during the
4507         resolution phase, we now turned the public ILLabel and ILLabelCode
4508         labels into methods called GetILLabelCode() and GetILLabel() that
4509         only define the label during the Emit phase.
4510
4511         (GotoCase): Track the SwitchLabel instead of the computed label
4512         (its contained therein).  Emit the code by using
4513         SwitchLabel.GetILLabelCode ().
4514
4515         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4516         whether the Local has been captured or not.
4517
4518         (LocalInfo.IsCaptured): New property, used to tell whether the
4519         local has been captured.
4520         
4521         * anonymous.cs: Vastly updated to contain the anonymous method
4522         support.
4523
4524         The main classes here are: CaptureContext which tracks any
4525         captured information for a toplevel block and ScopeInfo used to
4526         track the activation frames for various local variables.   
4527
4528         Each toplevel block has an optional capture context associated
4529         with it.  When a method contains an anonymous method both the
4530         toplevel method and the anonymous method will create a capture
4531         context.   When variables or parameters are captured, they are
4532         recorded on the CaptureContext that owns them, for example:
4533
4534         void Demo () {
4535              int a;
4536              MyDelegate d = delegate {
4537                  a = 1;
4538              }
4539         }
4540
4541         Here `a' will be recorded as captured on the toplevel
4542         CapturedContext, the inner captured context will not have anything
4543         (it will only have data if local variables or parameters from it
4544         are captured in a nested anonymous method.
4545
4546         The ScopeInfo is used to track the activation frames for local
4547         variables, for example:
4548
4549         for (int i = 0; i < 10; i++)
4550                 for (int j = 0; j < 10; j++){
4551                    MyDelegate d = delegate {
4552                         call (i, j);
4553                    }
4554                 }
4555
4556         At runtime this captures a single captured variable `i', but it
4557         captures 10 different versions of the variable `j'.  The variable
4558         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4559         recorded on a child.  
4560
4561         The toplevel ScopeInfo will also track information like the `this'
4562         pointer if instance variables were referenced (this is necessary
4563         as the anonymous method lives inside a nested class in the host
4564         type of the method). 
4565
4566         (AnonymousMethod): Expanded to track the Toplevel, implement
4567         `AnonymousMethod.Compatible' to tell whether an anonymous method
4568         can be converted to a target delegate type. 
4569
4570         The routine now also produces the anonymous method content
4571
4572         (AnonymousDelegate): A helper class that derives from
4573         DelegateCreation, this is used to generate the code necessary to
4574         produce the delegate for the anonymous method that was created. 
4575
4576         * assign.cs: API adjustments for new changes in
4577         Convert.ImplicitStandardConversionExists.
4578
4579         * class.cs: Adjustments to cope with the fact that now toplevel
4580         blocks are of type `ToplevelBlock'. 
4581
4582         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4583         insteda of standard blocks.
4584
4585         Flag errors if params arguments are passed to anonymous methods.
4586
4587         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4588         `CurrentAnonymousMethod' which points to the current Anonymous
4589         Method.  The variable points to the AnonymousMethod class that
4590         holds the code being compiled.  It is set in the new EmitContext
4591         created for the anonymous method.
4592
4593         (EmitContext.Phase): Introduce a variable and an enumeration to
4594         assist in enforcing some rules about when and where we are allowed
4595         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4596         only one that enfonces this right now).
4597
4598         (EmitContext.HaveCaptureInfo): new helper method that returns
4599         whether we have a CapturedContext initialized.
4600
4601         (EmitContext.CaptureVariable): New method used to register that a
4602         LocalInfo must be flagged for capturing. 
4603
4604         (EmitContext.CapturedParameter): New method used to register that a
4605         parameters must be flagged for capturing. 
4606         
4607         (EmitContext.CapturedField): New method used to register that a
4608         field must be flagged for capturing. 
4609
4610         (EmitContext.HaveCapturedVariables,
4611         EmitContext.HaveCapturedFields): Return whether there are captured
4612         variables or fields. 
4613
4614         (EmitContext.EmitMethodHostInstance): This is used to emit the
4615         instance for the anonymous method.  The instance might be null
4616         (static methods), this (for anonymous methods that capture nothing
4617         and happen to live side-by-side with the current method body) or a
4618         more complicated expression if the method has a CaptureContext.
4619
4620         (EmitContext.EmitTopBlock): Routine that drives the emission of
4621         code: it will first resolve the top block, then emit any metadata
4622         and then emit the code.  The split is done so that we can extract
4623         any anonymous methods and flag any captured variables/parameters.
4624         
4625         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4626         during this phase, the ILGenerator should not be used as labels
4627         and local variables declared here might not be accessible to any
4628         code that is part of an anonymous method.  
4629
4630         Exceptions to this include the temporary variables that are
4631         created by some statements internally for holding temporary
4632         variables. 
4633         
4634         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4635         metadata for a cb
4636
4637         (EmitContext.TemporaryReturn): This method is typically called
4638         from the Emit phase, and its the only place where we allow the
4639         ReturnLabel to be defined other than the EmitMeta.  The reason is
4640         that otherwise we would have to duplicate a lot of logic in the
4641         Resolve phases of various methods that today is on the Emit
4642         phase. 
4643
4644         (EmitContext.NeedReturnLabel): This no longer creates the label,
4645         as the ILGenerator is not valid during the resolve phase.
4646
4647         (EmitContext.EmitThis): Extended the knowledge in this class to
4648         work in anonymous methods in addition to iterators. 
4649
4650         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4651         code is necessary on the stack to access the instance to a local
4652         variable (the variable will be accessed as a field).
4653
4654         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4655         EmitContext.EmitAddressOfParameter): Routines to support
4656         parameters (not completed at this point). 
4657         
4658         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4659         will also remove the parameters.
4660
4661         * convert.cs (Convert): Define a `ConstantEC' which points to a
4662         null.  This is just to prefity some code that uses
4663         ImplicitStandardConversion code and do not have an EmitContext
4664         handy.
4665
4666         The idea is to flag explicitly that at that point in time, it is
4667         known that the conversion will not trigger the delegate checking
4668         code in implicit conversions (which requires a valid
4669         EmitContext). 
4670
4671         Everywhere: pass new EmitContext parameter since
4672         ImplicitStandardConversionExists now requires it to check for
4673         anonymous method conversions. 
4674
4675         (Convert.ImplicitStandardConversionExists): If the type of an
4676         expression is the anonymous_method_type, and the type is a
4677         delegate, we invoke the AnonymousMethod.Compatible method to check
4678         whether an implicit conversion is possible. 
4679
4680         (Convert.ImplicitConversionStandard): Only do implicit method
4681         group conversions if the language level is not ISO_1.
4682
4683         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4684         MethodInfo for the Invoke method.  used by Delegate and
4685         AnonymousDelegate.
4686
4687         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4688         method conversions if the target type is a delegate.
4689
4690         Removed extra debugging nops.
4691
4692         (LocalVariableReference): Turn the `local_info' into a public
4693         field. 
4694
4695         Add `prepared' field, the same hack used for FieldExprs to cope
4696         with composed assignments, as Local variables do not necessarily
4697         operate purely on the stack as they used to: they can be captured
4698         fields. 
4699
4700         Add `temp' for a temporary result, like fields.
4701
4702         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4703
4704         It now copes with Local variables that are captured and emits the
4705         proper instance variable to load it from a field in the captured
4706         case. 
4707
4708         (ParameterReference.DoResolveBase): During the resolve phase,
4709         capture parameters if we are in an anonymous method.
4710
4711         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4712         anonymous method, use the EmitContext helper routines to emit the
4713         parameter reference.
4714
4715         * iterators.cs: Set RemapToProxy to true/false during the
4716         EmitDispose class.
4717
4718         * parameters.cs (GetParameterByName): New helper method. 
4719
4720         * typemanager.cs (anonymous_method_type) a new type that
4721         represents an anonyous method.  This is always an internal type,
4722         used as a fencepost to test against the anonymous-methodness of an
4723         expression. 
4724         
4725 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4726
4727         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4728         561 report.
4729         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4730
4731 2004-11-10  Martin Baulig  <martin@ximian.com>
4732
4733         * expression.cs (Invocation.BetterFunction): If two methods have
4734         equal parameter types, but only one of them is generic, the
4735         non-generic one wins.
4736         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4737         instance; just use `Type.IsValueType' to determine whether
4738         something is a struct or not.
4739         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4740         so we can be called multiple times.
4741
4742 2004-11-10  Martin Baulig  <martin@ximian.com>
4743
4744         * generic.cs (TypeParameter.DefineConstraints): New public method.
4745         (TypeParameter.CheckAccessLevel): Override this and return true.
4746         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4747         override ResolveType() anymore.
4748         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4749
4750 2004-11-10  Martin Baulig  <martin@ximian.com>
4751
4752         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4753         call DeclSpace.ResolveNestedType() on it.
4754
4755 2004-11-10  Martin Baulig  <martin@ximian.com>
4756
4757         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4758         non-null, call ParameterModifier() on it.
4759
4760 2004-11-10  Martin Baulig  <martin@ximian.com>
4761
4762         * iterators.cs
4763         (Iterators): Added `current_type' and `this_type' fields.
4764         (Iterators.DefineIterator): Create a new EmitContext and store it
4765         in `ec'; compute `this_type'.
4766
4767 2004-11-10  Martin Baulig  <martin@ximian.com>
4768
4769         * typemanager.cs
4770         (TypeManager.IsPrivateAccessible): New public method.
4771         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4772
4773 2004-11-10  Martin Baulig  <martin@ximian.com>
4774
4775         * class.cs (TypeContainer.DefineType): Call
4776         TypeBuilder.DefineGenericParameters() before resolving the type
4777         parameters.
4778         (MethodData.parent_method): New protected field.
4779         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4780         (MethodData.Define): Compute `parent_method'.
4781
4782         * decl.cs
4783         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4784         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4785         (DeclSpace.ec): New protected field; store the EmitContext here.
4786         (DeclSpace.EmitContext): New public property.
4787         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4788         (DeclSpace.ResolveNestedType): New public method.
4789         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4790         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4791         (DeclSpace.FamilyAccessible): Likewise.
4792         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4793         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4794         EmitContext.
4795
4796         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4797         field.
4798
4799         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4800         (Enum.Emit): Don't create a new EmitContext.
4801
4802 2004-10-18  Martin Baulig  <martin@ximian.com>
4803
4804         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4805         `Type' directly, but call ResolveType() on it.
4806         (Catch.Resolve): Likewise.
4807         (Foreach.Resolve): Likewise.
4808
4809 2004-10-18  Martin Baulig  <martin@ximian.com>
4810
4811         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4812         `Type' directly, but call ResolveType() on it.
4813         (Probe.DoResolve): Likewise.
4814         (ArrayCreation.LookupType): Likewise.
4815         (TypeOf.DoResolve): Likewise.
4816         (SizeOf.DoResolve): Likewise.
4817
4818 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4819
4820         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4821         the ResolveType.
4822
4823 2004-10-17  John Luke  <john.luke@gmail.com>
4824
4825         * class.cs (Operator.GetSignatureForError): use CSharpName
4826
4827         * parameter.cs (Parameter.GetSignatureForError): Returns
4828         correct name even if was not defined.
4829
4830 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4831
4832         Fix #65816.
4833         * class.cs (TypeContainer.EmitContext): New property.
4834         (DefineNestedTypes): Create an emitcontext for each part.
4835         (MethodCore.DoDefineParameters): Use container's emitcontext.
4836         Pass type array to InternalParameters.
4837         (MemberBase.DoDefine): Use container's emitcontext.
4838         (FieldMember.Define): Likewise.
4839         (Event.Define): Likewise.
4840         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4841         Pass type array to InternalParameters.
4842         (SetIndexerMethod.GetParameterInfo): Likewise.
4843         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4844         * delegate.cs (Define): Pass emitcontext to
4845         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4846         array to InternalParameters.
4847         * expression.cs (ParameterReference.DoResolveBase): Pass
4848         emitcontext to GetParameterInfo.
4849         (ComposedCast.DoResolveAsTypeStep): Remove check on
4850         ec.ResolvingTypeTree.
4851         * parameter.cs (Parameter.Resolve): Change argument to
4852         EmitContext.  Use ResolveAsTypeTerminal.
4853         (Parameter.GetSignature): Change argument to EmitContext.
4854         (Parameters.ComputeSignature): Likewise.
4855         (Parameters.ComputeParameterTypes): Likewise.
4856         (Parameters.GetParameterInfo): Likewise.
4857         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4858         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4859         * support.cs (InternalParameters..ctor): Remove variant that takes
4860         a DeclSpace.
4861         * typemanager.cs (system_intptr_expr): New.
4862         (InitExpressionTypes): Initialize it.
4863
4864 2004-10-12  Chris Toshok  <toshok@ximian.com>
4865
4866         * cs-parser.jay: fix location for try_statement and catch_clause.
4867
4868 2004-10-18  Martin Baulig  <martin@ximian.com>
4869
4870         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4871         `Type' directly, but call ResolveType() on it.
4872         (MemberBase.DoDefine): Likewise.
4873
4874         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4875         `Type' directly, but call ResolveType() on it.
4876         (ComposedCast.DoResolveAsTypeStep): Likewise.
4877
4878         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4879         `Type' directly, but call ResolveType() on it.
4880
4881 2004-10-17  John Luke  <john.luke@gmail.com>
4882
4883         * class.cs (Operator.GetSignatureForError): use CSharpName
4884
4885         * parameter.cs (Parameter.GetSignatureForError): Returns
4886         correct name even if was not defined.
4887
4888 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4889
4890         Fix #65816.
4891         * class.cs (TypeContainer.EmitContext): New property.
4892         (DefineNestedTypes): Create an emitcontext for each part.
4893         (MethodCore.DoDefineParameters): Use container's emitcontext.
4894         Pass type array to InternalParameters.
4895         (MemberBase.DoDefine): Use container's emitcontext.
4896         (FieldMember.Define): Likewise.
4897         (Event.Define): Likewise.
4898         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4899         Pass type array to InternalParameters.
4900         (SetIndexerMethod.GetParameterInfo): Likewise.
4901         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4902         * delegate.cs (Define): Pass emitcontext to
4903         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4904         array to InternalParameters.
4905         * expression.cs (ParameterReference.DoResolveBase): Pass
4906         emitcontext to GetParameterInfo.
4907         (ComposedCast.DoResolveAsTypeStep): Remove check on
4908         ec.ResolvingTypeTree.
4909         * parameter.cs (Parameter.Resolve): Change argument to
4910         EmitContext.  Use ResolveAsTypeTerminal.
4911         (Parameter.GetSignature): Change argument to EmitContext.
4912         (Parameters.ComputeSignature): Likewise.
4913         (Parameters.ComputeParameterTypes): Likewise.
4914         (Parameters.GetParameterInfo): Likewise.
4915         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4916         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4917         * support.cs (InternalParameters..ctor): Remove variant that takes
4918         a DeclSpace.
4919         * typemanager.cs (system_intptr_expr): New.
4920         (InitExpressionTypes): Initialize it.
4921
4922 2004-10-12  Chris Toshok  <toshok@ximian.com>
4923
4924         * cs-parser.jay: fix location for try_statement and catch_clause.
4925
4926 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4927
4928         More DeclSpace.ResolveType avoidance.
4929         * decl.cs (MemberCore.InUnsafe): New property.
4930         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4931         with newly created EmitContext.
4932         (FieldMember.Define): Likewise.
4933         * delegate.cs (Delegate.Define): Likewise.
4934         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4935         only if normal name-lookup fails.
4936         (TypeExpr.DoResolve): Enable error-checking.
4937         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4938         (SizeOf.DoResolve): Likewise.
4939         (ComposedCast.DoResolveAsTypeStep): Likewise.
4940         (StackAlloc.DoResolve): Likewise.
4941         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4942         (Block.Unsafe): New property.
4943         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4944         (Unsafe): Set 'unsafe' flag of contained block.
4945         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4946         (Fixed.Resolve): Likewise.
4947         (Catch.Resolve): Likewise.
4948         (Using.ResolveLocalVariableDecls): Likewise.
4949         (Foreach.Resolve): Likewise.
4950
4951 2004-10-05  John Luke <john.luke@gmail.com>
4952
4953         * cs-parser.jay: add location to error CS0175
4954
4955 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4956
4957         * ecore.cs (Expression.Constantity): Add support for turning null
4958         into a constant.
4959
4960         * const.cs (Const.Define): Allow constants to be reference types
4961         as long as the value is Null.
4962
4963 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4964
4965         * namespace.cs (NamespaceEntry.Using): No matter which warning
4966         level is set, check if this namespace name has already been added.
4967
4968 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4969
4970         * expression.cs: reftype [!=]= null should always use br[true,false].
4971         # 67410
4972
4973 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4974
4975         Fix #67108
4976         * attribute.cs: Enum conversion moved to 
4977         GetAttributeArgumentExpression to be applied to the all
4978         expressions.
4979
4980 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4981
4982         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4983         * class.c (TypeContainer.DefineType): Flag error if
4984         base types aren't accessible due to access permissions.
4985         * decl.cs (DeclSpace.ResolveType): Move logic to
4986         Expression.ResolveAsTypeTerminal.
4987         (DeclSpace.ResolveTypeExpr): Thin layer over
4988         Expression.ResolveAsTypeTerminal.
4989         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4990         Refactor code into NestedAccess.  Use it.
4991         (DeclSpace.NestedAccess): New.
4992         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4993         argument to silence errors.  Check access permissions.
4994         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4995         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4996         (Cast.DoResolve): Likewise.
4997         (New.DoResolve): Likewise.
4998         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4999         (TypeOf.DoResolve): Likewise.
5000
5001         * expression.cs (Invocation.BetterConversion): Return the Type of
5002         the better conversion.  Implement section 14.4.2.3 more faithfully.
5003         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5004         section 14.4.2.2 explicit.
5005         (Invocation.OverloadResolve): Update.
5006         (Invocation): Remove is_base field.
5007         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5008         (Invocation.Emit): Likewise.
5009
5010 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5011
5012         * cs-parser.jay: Reverted 642 warning fix.
5013
5014 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5015
5016         Fix bug #66615
5017         * decl.cs (FindMemberWithSameName): Indexer can have more than
5018         1 argument.
5019
5020 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5021
5022         * expression.cs (LocalVariableReference.DoResolveLValue):
5023         Do not report warning 219 for out values.
5024         (EmptyExpression.Null): New member to avoid extra allocations.
5025
5026 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5027
5028         * cs-parser.jay: Fix wrong warning 642 report.
5029
5030         * cs-tokenizer.cs (CheckNextToken): New helper;
5031         Inspect next character if is same as expected.
5032
5033 2004-09-23  Martin Baulig  <martin@ximian.com>
5034
5035         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5036         (Convert.ImplicitReferenceConversionExists): Likewise.
5037
5038 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5039
5040         * Makefile (DISTFILES): Comment out a few missing files.
5041
5042 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5043
5044         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5045         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5046         (gmcs.exe): Invoke bootstrap-libs.
5047         (clean-local): Clean the net_2_0_bootstrap profile too.
5048         (PROGRAM_INSTALL_DIR): New.
5049         (install-local): Use it.
5050
5051 2004-10-13  Martin Baulig  <martin@ximian.com>
5052
5053         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5054         (TypeParameter.DefineType): If we're a method type parameter and
5055         that method is overriding something, "inflate" its constraints.
5056
5057 2004-10-12  Martin Baulig  <martin@ximian.com>
5058
5059         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5060         and have type arguments, create and resolve a ConstructedType.
5061
5062 2004-10-12  Martin Baulig  <martin@ximian.com>
5063
5064         * decl.cs (MemberCache.FindMemberToOverride): Use
5065         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5066         to compare the invocationType.
5067
5068         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5069         When comparing two type parameters, only do the signature-only
5070         comparision for method type parameters.
5071
5072 2004-10-11  Martin Baulig  <martin@ximian.com>
5073
5074         * report.cs: Don't make --fatal abort on warnings, we have
5075         -warnaserror for that.
5076
5077 2004-10-11  Martin Baulig  <martin@ximian.com>
5078
5079         * typemanager.cs
5080         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5081         (TypeManager.IsEqual): Call ourself recursively instead of using
5082         Type.IsEqual(). 
5083
5084 2004-10-11  Martin Baulig  <martin@ximian.com>
5085
5086         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5087         on our own type parameters, not on the ones we inherit from a containing
5088         class.
5089
5090         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5091         the comparision.
5092
5093         * generic.cs (TypeParameter.Define): We may only be called once.
5094
5095         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5096         instead of TypeManager.IsEqual().
5097
5098 2004-09-28  Martin Baulig  <martin@ximian.com>
5099
5100         * generic.cs
5101         (GenericConstraints.EffectiveBaseClass): New public property.
5102         (TypeParameter.GenericConstraints): New public property.
5103         (ConstructedType.CheckConstraints): Improved.
5104
5105         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5106         (Convert.TypeParameterConversion): New private method; use this in
5107         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5108         for all conversions related to type parameters.
5109
5110 2004-09-24  Martin Baulig  <martin@ximian.com>
5111
5112         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5113         type parameter conversions for type parameters which are known to
5114         be reference types.
5115
5116 2004-09-24  Martin Baulig  <martin@ximian.com>
5117
5118         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5119         `IsValueType' properties.
5120
5121         * support.cs (ReflectionConstraints): Use
5122         Type.GetGenericParameterConstraints() instead of the old hack.
5123
5124 2004-09-24  Martin Baulig  <martin@ximian.com>
5125
5126         * generic.cs (GenericConstraints): Moved here and made it an
5127         abstract class.
5128
5129         * support.cs (GenericConstraints): Moved to generic.cs.
5130
5131 2004-09-24  Martin Baulig  <martin@ximian.com>
5132
5133         * support.cs
5134         (ReflectionConstraints): Un-nested this class and made it public.
5135
5136         * typemanager.cs
5137         (TypeManager.GetTypeParameterConstraints): New public method.
5138         (TypeManager.HasConstructorConstraint): Use the attributes.
5139
5140 2004-09-24  Martin Baulig  <martin@ximian.com>
5141
5142         * support.cs (GenericConstraints): Replaced `HasConstructor',
5143         `IsReferenceType' and `IsValueType' with `Attributes'.
5144         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5145         method and made the .ctor public.
5146
5147         * generic.cs (Constraints.Attributes): New public property.
5148         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5149         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5150         `IsValueType' -> `HasValueTypeConstraint'.
5151
5152 2004-09-23  Martin Baulig  <martin@ximian.com>
5153
5154         * generic.cs (Constraints): Reflect latest runtime changes.
5155
5156 2004-09-23  Martin Baulig  <martin@ximian.com>
5157
5158         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5159         (Convert.ImplicitReferenceConversionExists): Likewise.
5160
5161 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5162
5163         * class.cs (Operator.Define): Add error 448 and 559 report.
5164         
5165 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5166
5167         * class.cs (MemberBase.IsTypePermitted): New protected
5168         method for checking error CS0610.
5169
5170 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5171
5172         * class.cs (TypeContainer.HasExplicitLayout): New property
5173         Returns whether container has StructLayout attribute set Explicit.
5174         (FieldMember): New abstract class for consts and fields.
5175         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5176         (Field): Reuse FieldMember.
5177
5178         * const.cs (Const): Reuse FieldMember.
5179
5180         * rootcontext.cs: EmitConstants call moved to class.
5181
5182 2004-09-22  Martin Baulig  <martin@ximian.com>
5183
5184         Marek and me just fixed one of our oldest bugs: #28562 :-)
5185
5186         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5187
5188         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5189         we're an EnumConstant, just return that.
5190         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5191         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5192         to get the value which'll actually be written into the attribute.
5193         However, we have to use GetValue() to access the attribute's value
5194         in the compiler.        
5195
5196 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5197
5198         * constant.cs (Constant.IsNegative): New abstract property
5199         IsNegative.
5200
5201         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5202         (StackAlloc.DoResolve): Reused IsNegative.
5203
5204 2004-09-22  Martin Baulig  <martin@ximian.com>
5205
5206         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5207         public method; like LookupTypeContainer, but also works for
5208         generic instances.
5209
5210         * report.cs (Report.SymbolRelatedToPreviousError): Use
5211         TypeManager.LookupGenericTypeContainer().       
5212
5213 2004-09-22  Martin Baulig  <martin@ximian.com>
5214
5215         Thanks to Peter Sestoft for this bug report.
5216
5217         * expression.cs (Conditional): If both the `trueExpr' and the
5218         `falseExpr' is a NullLiteral, return a NullLiteral.
5219
5220 2004-09-22  Martin Baulig  <martin@ximian.com>
5221
5222         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5223         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5224         for the "get_Current" call.
5225
5226 2004-09-21  Martin Baulig  <martin@ximian.com>
5227
5228         * convert.cs (Convert.ImplicitReferenceConversion): When
5229         converting to an interface type, first check whether we're
5230         converting from a reference type.
5231
5232 2004-09-14  Martin Baulig  <martin@ximian.com>
5233
5234         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5235
5236 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5237
5238         Fixed bug #61902
5239         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5240         called and is obsolete then this member suppress message
5241         when call is inside next [Obsolete] method or type.
5242
5243         * expression.cs: Use TestObsoleteMethodUsage member.
5244
5245 2004-09-14  Martin Baulig  <martin@ximian.com>
5246
5247         * genericparser.cs: Removed.
5248
5249 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5250
5251         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5252
5253 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5254
5255         * attribute.cs (Attribute.Resolve): Add error 653 report.
5256
5257         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5258         report.
5259         (Method.ApplyAttributeBuilder): Add error 685 report.
5260         (Operator.Define): Add error 564 report.
5261
5262         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5263
5264         * expression.cs (Invocation.DoResolve): Add error
5265         245 and 250 report.
5266
5267         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5268         error 674 report.
5269
5270 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5271
5272         * class.cs (ConstructorInitializer.Resolve):
5273         Wrong error number (515->516).
5274
5275 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5276
5277         * class.cs (Indexer.Define): Add error 631 report.
5278
5279 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5280
5281         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5282
5283 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5284
5285         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5286
5287 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5288
5289         * cs-parser.jay: Added error CS0241 report.
5290
5291 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5292
5293         * cs-parser.jay (fixed_statement): Introduce a scope for the
5294         declaration in the 'fixed' statement.
5295
5296 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5297
5298         * cs-parser.jay: Added CS0230 error report.
5299
5300 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5301
5302         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5303
5304 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5305
5306         * expression.cs (Argument.Resolve): Added error CS0192 and
5307         CS0199 report.
5308
5309 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5310
5311         C# 2.0 #pragma warning feature
5312
5313         * cs-tokenizer.cs (PreProcessPragma): New method; 
5314         Handles #pragma directive.
5315
5316         * report.cs (WarningRegions): New class; Support
5317         class for #pragma warning directive. It tests whether
5318         warning is enabled for a given line.
5319
5320 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5321
5322         * const.cs: Add more descriptive error report, tahnks to
5323         Sebastien. 
5324
5325 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5326
5327         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5328
5329 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5330
5331         * expression.cs: Apply patch from Ben: Remove dead code from
5332         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5333         as that code just threw an exception anwyays.
5334
5335         * const.cs: Remove the call to the turnintoconstant, for details
5336         see bug: #63144
5337         
5338         * literal.cs: The type of the null-literal is the null type;  So
5339         we use a placeholder type (literal.cs:System.Null, defined here)
5340         for it.
5341
5342         * expression.cs (Conditional.DoResolve): Remove some old code that
5343         is no longer needed, conversions have been fixed.
5344
5345         (ArrayCreationExpression.DoResolve): Return false if we fail to
5346         resolve the inner expression.
5347
5348 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5349
5350         Fix test-290.cs.
5351         * cs-parser.jay (delegate_declaration): Record a delegate
5352         declaration as a type declaration.
5353         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5354
5355 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5356
5357         * parameter.cs: Do not crash if the type can not be resolved. 
5358
5359         * expression.cs: Report errors with unsafe pointers, fixes #64896
5360
5361 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5362
5363         * expression.cs: Pointer arith always needs to do a conv.i
5364         if the operand is a long. fix 65320
5365
5366 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5367
5368         Fixed cs0619-37.cs, cs0619-38.cs
5369
5370         * enum.cs (GetObsoleteAttribute): Removed.
5371
5372         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5373         on Enum member is double staged. The first is tested member
5374         and then enum.
5375
5376 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5377
5378         Fixed #56986, #63631, #65231
5379
5380         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5381         adds member to name container.
5382         (TypeContainer.AddToTypeContainer): New method, adds type to
5383         name container.
5384         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5385         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5386         AddOperator): Simplified by reusing AddToMemberContainer.
5387         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5388         instead of field.
5389         (Method.CheckForDuplications): Fixed implementation to test all
5390         possibilities.
5391         (MemberBase): Detection whether member is explicit interface
5392         implementation is now in constructor.
5393         (MemberBase.UpdateMemberName): Handles IndexerName.
5394         (Accessor): Changed to keep also location information.
5395         (AbstractPropertyEventMethod): Is derived from MemberCore.
5396         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5397         will be emited or not.
5398         (PropertyBase.AreAccessorsDuplicateImplementation):
5399         Tests whether accessors are not in collision with some method.
5400         (Operator): Is derived from MethodCore to simplify common
5401         operations.
5402
5403         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5404         must be performed.
5405         (DeclSpace.AddToContainer): Adds the member to defined_names
5406         table. It tests for duplications and enclosing name conflicts.
5407
5408         * enum.cs (EnumMember): Clean up to reuse the base structures
5409
5410 2004-09-03  Martin Baulig  <martin@ximian.com>
5411
5412         Merged latest changes into gmcs.  Please keep this comment in
5413         here, it makes it easier for me to see what changed in MCS since
5414         the last time I merged.
5415
5416 2004-09-03  Martin Baulig  <martin@ximian.com>
5417
5418         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5419         into TypeContainer, to make partial classes work again.
5420
5421 2004-09-03  Martin Baulig  <martin@ximian.com>
5422
5423         * rootcontext.cs (RootContext.V2): Removed.
5424
5425 2004-03-23  Martin Baulig  <martin@ximian.com>
5426
5427         * expression.cs (Invocation.OverloadResolve): Added `bool
5428         may_fail' argument and use it instead of the Location.IsNull() hack.
5429
5430 2004-09-09  Martin Baulig  <martin@ximian.com>
5431
5432         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5433
5434 2004-09-09  Martin Baulig  <martin@ximian.com>
5435
5436         * generic.cs (TypeParameter.DefineType): Added support for
5437         explicit interface methods.
5438
5439 2004-09-09  Martin Baulig  <martin@ximian.com>
5440
5441         * README.Changes: New document.  Started to list important changes
5442         between MCS and GMCS here.
5443
5444 2004-09-08  Martin Baulig  <martin@ximian.com>
5445
5446         * class.cs
5447         (TypeContainer.CheckRecursiveDefinition): New protected method.
5448         (TypeContainer.DefineType): Move the CS0146 check into
5449         CheckRecursiveDefinition().     
5450
5451 2004-09-06  Martin Baulig  <martin@ximian.com>
5452
5453         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5454         types for the constructor constraint.
5455
5456 2004-09-03  Martin Baulig  <martin@ximian.com>
5457
5458         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5459         into TypeContainer, to make partial classes work again.
5460
5461 2004-09-03  Martin Baulig  <martin@ximian.com>
5462
5463         * rootcontext.cs (RootContext.V2): Removed.
5464
5465 2004-03-23  Martin Baulig  <martin@ximian.com>
5466
5467         * expression.cs (Invocation.OverloadResolve): Added `bool
5468         may_fail' argument and use it instead of the Location.IsNull() hack.
5469
5470 2004-09-03  Martin Baulig  <martin@ximian.com>
5471
5472         Merged latest changes into gmcs.  Please keep this comment in
5473         here, it makes it easier for me to see what changed in MCS since
5474         the last time I merged.
5475
5476 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5477
5478         Fix #61128.
5479         * expression.cs (BetterConversion): Don't allow either conversion 
5480         to be null.  Remove redundant implicit conversion test when 'q ==
5481         null' -- when this function is invoked, we already know that the
5482         implicit conversion exists.
5483         (BetterFunction): Assume that 'best' is non-null.  Remove
5484         redundant reimplementation of IsApplicable when 'best' is null.
5485         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5486         number of arguments.
5487         (IsAncestralType): Extract from OverloadResolve.
5488         (OverloadResolve): Make robust to the MethodGroupExpr being
5489         unsorted.  Implement all the logic of Section 14.5.5.1, and
5490         support overloading of methods from multiple applicable types.
5491         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5492
5493         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5494         (RealError, Warning): Append type of report to related symbol.
5495
5496 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5497
5498         * enum.cs: Fixed CLS-Compliance checks for enum members.
5499         Error tests cs3008-8.cs, cs3014-8.cs
5500
5501 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5502
5503         Fixed bug #62342, #63102
5504         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5505         like ImplementMethod.
5506
5507 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5508
5509         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5510         Fixed bug #65170.
5511
5512 2004-09-02  Martin Baulig  <martin@ximian.com>
5513
5514         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5515         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5516         on the MethodBase.
5517
5518 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5519
5520         C# 2.0 Static classes implemented
5521
5522         * class.cs (TypeContainer): instance_constructors,
5523         initialized_fields, initialized_static_fields,
5524         default_constructor, base_inteface_types are protected to be
5525         accessible from StaticClass.
5526         (TypeContainer.DefineDefaultConstructor): New virtual method
5527         for custom default constructor generating
5528         (StaticClass): New class to handle "Static classes" feature.
5529
5530         * cs-parser.jay: Handle static keyword on class like instance
5531         of StaticClass.
5532
5533         * driver.cs: Added "/langversion" command line switch with two
5534         options (iso-1, default).
5535
5536 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5537
5538         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5539
5540 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5541
5542         * delegate.cs: Style.
5543
5544 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5545
5546         * delegate.cs: Add seperate instance expr field for miguel.
5547
5548 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5549
5550         * PointerArithmetic (Resolve): make sure we are not doing
5551         pointer arith on void*. Also, make sure we are resolved
5552         by not setting eclass until resolve.
5553
5554         All callers: Make sure that PointerArithmetic gets resolved.
5555
5556 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5557
5558         * ArrayCreation (LookupType): If the type does not resolve 
5559         to an array, give an error.
5560
5561 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5562
5563         * statement.cs (Try.Resolve): Fixed bug #64222
5564
5565 2004-08-27  Martin Baulig  <martin@ximian.com>
5566
5567         * class.cs
5568         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5569         crash here.     
5570
5571 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5572
5573         * ecore.cs (Constantify): Get underlying type via
5574         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5575         Windows in special cases.
5576
5577 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5578
5579         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5580         for obtaining also private methods.
5581         (GetRemoveMethod): Used GetRemoveMethod (true)
5582         for obtaining also private methods.
5583
5584 2004-09-02  Martin Baulig  <martin@ximian.com>
5585
5586         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5587         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5588         on the MethodBase.
5589
5590 2004-08-27  Martin Baulig  <martin@ximian.com>
5591
5592         * class.cs
5593         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5594         crash here.     
5595
5596 2004-08-25  Martin Baulig  <martin@ximian.com>
5597
5598         * support.cs (ReflectionParameters..ctor): If this is a generic
5599         method, retrieve and store its type parameters.
5600         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5601         (ReflectionParameters.GenericConstraints): The argument specifies
5602         the type parameter, not the method parameter.
5603         (InternalParameters.GenericConstraints): Likewise.
5604
5605         * generic.cs (TypeParameter.DefineType): Correctly handle
5606         constraints wrt. generic methods in interfaces and their
5607         implementations.        
5608
5609 2004-08-24  Martin Baulig  <martin@ximian.com>
5610
5611         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5612         (Constraints.IsSubclassOf): New internal method.
5613
5614         * typemanager.cs (TypeManager.FindMembers): Added special support
5615         for GenericTypeParameterBuilder's.      
5616         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5617         type parameters.
5618
5619 2004-08-24  Martin Baulig  <martin@ximian.com>
5620
5621         * typemanager.cs
5622         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5623         this for accessibility checks.
5624         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5625         IsNestedFamilyAccessible.
5626         (TypeManager.IsSubclassOf): New method, do what the name actually
5627         says.   
5628
5629 2004-08-24  Martin Baulig  <martin@ximian.com>
5630
5631         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5632         as a SimpleName, include the generic arity.
5633
5634 2004-08-24  Martin Baulig  <martin@ximian.com>
5635
5636         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5637         MethodAttributes.HideBySig for operators.
5638
5639 2004-08-23  Martin Baulig  <martin@ximian.com>
5640
5641         Back to the old error reporting system :-)
5642
5643         * report.cs (Message): Removed.
5644         (Report.MessageData, ErrorData, WarningData): Removed.
5645         (Report.Error, Warning): Back to the old system.
5646
5647 2004-08-23  Martin Baulig  <martin@ximian.com>
5648
5649         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5650
5651         * class.cs (TypeContainer.ParentContainer): New public virtual
5652         method; replaces the explicit interface implementation.
5653         (ClassPart.ParentContainer): Override.
5654
5655 2004-08-23  Martin Baulig  <martin@ximian.com>
5656
5657         * statement.cs (Switch): Added support for constant switches; see
5658         #59428 or test-285.cs.
5659
5660 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5661
5662         Fixed bug #62740.
5663         * statement.cs (GetEnumeratorFilter): Removed useless
5664         logic because C# specs is strict. GetEnumerator must be
5665         public.
5666
5667 2004-08-22  Martin Baulig  <martin@ximian.com>
5668
5669         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5670         a switch and may break, reset the barrier.  Fixes #59867.
5671
5672 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5673
5674         CLS-Compliance speed up (~5% for corlib)
5675
5676         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5677         New method. Tests container for CLS-Compliant names
5678
5679         * class.cs (TypeContainer.VerifyClsName): New method.
5680         Checks whether container name is CLS Compliant.
5681         (Constructor): Implements IMethodData.
5682
5683         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5684         low-case table for CLS Compliance test.
5685         (MemberCache.VerifyClsParameterConflict): New method.
5686         Checks method parameters for CS3006 error.
5687
5688         * enum.cs (EnumMember): Is derived from MemberCore.
5689         (Enum.VerifyClsName): Optimized for better performance.
5690
5691 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5692
5693         * report.cs: Renamed Error_T to Error and changed all
5694         references.
5695
5696 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5697
5698         * class.cs (TypeContainer.IndexerArrayList): New inner class
5699         container for indexers.
5700         (TypeContainer.DefaultIndexerName): New constant for default
5701         indexer name. Replaced all "Item" with this constant.
5702         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5703
5704         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5705         DefaultMemberAttribute constructor.
5706
5707 2004-08-05  Martin Baulig  <martin@ximian.com>
5708
5709         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5710         Fix bug #59429.
5711
5712 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5713
5714         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5715         multi platforms problem.
5716
5717         * compiler.csproj: Included shared files.
5718
5719 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5720
5721         Fix bug 60333, 55971 in the more general way
5722         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5723         Added arg_type argument for constant conversion.
5724         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5725
5726 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5727
5728         Fix bug #59760
5729         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5730         OperatorArrayList, MethodCoreArrayList for typecontainer
5731         containers. Changed class member types to these new types.
5732         (MethodArrayList.DefineMembers): Added test for CS0659.
5733
5734 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5735
5736         * cfold.cs: Synchronize the folding with the code in expression.cs
5737         Binary.DoNumericPromotions for uint operands.
5738
5739         * attribute.cs: Revert patch from Raja, it introduced a regression
5740         while building Blam-1.2.1 (hard to isolate a test case).
5741
5742 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5743
5744         Fix for #55382
5745         * class.cs:
5746         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5747         name collision.
5748         (MethodCore.parent_method): New member. The method we're overriding
5749         if this is an override method.
5750         (MethodCore.CheckBase): Moved from Method class and made common.
5751         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5752         private.
5753         (MethodCore.CheckForDuplications): New abstract method. For custom
5754         member duplication search in a container
5755         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5756         method and its return type.
5757         (Event.conflict_symbol): New member. Symbol with same name in the
5758         parent class.
5759
5760         * decl.cs:
5761         (MemberCache.FindMemberWithSameName): New method. The method
5762         is looking for conflict with inherited symbols.
5763
5764 2004-08-04  Martin Baulig  <martin@ximian.com>
5765
5766         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5767
5768         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5769
5770 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5771
5772         * report.cs (Message): New enum for better error, warning reference in
5773         the code.
5774         (MessageData): New inner abstract class. It generally handles printing of
5775         error and warning messages.
5776         Removed unused Error, Warning, Message methods.
5777
5778 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5779
5780         Fix for cs0592-8.cs test
5781         * attribute.cs
5782         (Attributable.ValidAttributeTargets): Made public.
5783         (Attribute.ExplicitTarget): New member for explicit target value.
5784         (Attribute.CheckTargets): Now we translate explicit attribute
5785         target to Target here.
5786
5787 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5788
5789         * ecore.cs (MethodGroupExpr): new IsBase property.
5790
5791         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5792
5793         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5794         rather than an instance expr.
5795
5796         (DelegateCreation.Emit): Use the method group rather than
5797         the instance expression. Also, if you have base.Foo as the
5798         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5799
5800         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5801
5802         (NewDelegate.DoResolve): Only check for the existance of Invoke
5803         if the method is going to be needed. Use MethodGroupExpr.
5804
5805         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5806
5807         * expression.cs: For pointer arith., make sure to use
5808         the size of the type, not the size of the pointer to
5809         the type.
5810
5811 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5812
5813         Fix for #60722
5814         * class.cs (Class): Added error CS0502 test.
5815
5816 2004-08-03  John Luke  <jluke@cfl.rr.com>
5817             Raja R Harinath  <rharinath@novell.com>
5818
5819         Fix for #60997.
5820         * attribute.cs (Attribute.complained_before): New flag.
5821         (Attribute.ResolveType, Attribute.Resolve),
5822         (Attribute.DefinePInvokeMethod): Set it.
5823         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5824         
5825 2004-08-03  Martin Baulig  <martin@ximian.com>
5826
5827         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5828         use a user-defined operator; we still need to do numeric
5829         promotions in case one argument is a builtin type and the other
5830         one has an implicit conversion to that type.  Fixes #62322.
5831
5832 2004-08-18  Martin Baulig  <martin@ximian.com>
5833
5834         * class.cs (Method.Define): Use the correct method name when
5835         creating the MethodBuilder for a generic method.
5836
5837 2004-08-17  Martin Baulig  <martin@ximian.com>
5838
5839         * generic.cs (Constraints): Support type parameter constraints.
5840
5841 2004-08-16  Martin Baulig  <martin@ximian.com>
5842
5843         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5844         (Token.GENERIC_DIMENSION): New token; this is returned if we
5845         encounter an unbound generic type in a typeof() expression.
5846
5847         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5848         this token is only generated while parsing a typeof() expression.
5849         (typeof_expression): Removed the old unbound_type hack.
5850
5851         * generic.cs (TypeArguments.IsUnbound): New public property.
5852
5853         * decl.cs (MemberName): Added support for unbound types.
5854
5855 2004-08-14  Martin Baulig  <martin@ximian.com>
5856
5857         * typemanager.cs
5858         (TypeManager.IsEqualGenericInstance): New static method.
5859         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5860         just used to check accessibility, so follow the rules of 26.1.6.        
5861
5862         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5863         ConstructedType instead of a TypeExpression if we have type arguments.
5864
5865         * cs-parser.jay (typeof_expression): Support unbound generic types.
5866
5867         * ecore.cs (UnboundTypeExpression): New public class.
5868
5869 2004-08-12  Martin Baulig  <martin@ximian.com>
5870
5871         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5872         TypeManager.IsEqual() rather than `=='.
5873
5874         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5875         generic instances as well.
5876
5877 2004-08-12  Martin Baulig  <martin@ximian.com>
5878
5879         * expression.cs (Invocation.InferType): We can only infer method
5880         type parameters.  Fixes #62647.
5881
5882 2004-08-11  Martin Baulig  <martin@ximian.com>
5883
5884         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5885         before resolving the base classes.
5886
5887 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5888
5889         * Makefile: install .mdb file too.
5890
5891 2004-08-05  Martin Baulig  <martin@ximian.com>
5892
5893         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5894         initializer, the current type is just the TypeBuilder, not the
5895         instantiated generic type.
5896         (FieldExpr.IsFieldInitializer): New public property.
5897
5898 2004-08-04  Martin Baulig  <martin@ximian.com>
5899
5900         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5901
5902         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5903
5904 2004-08-03  Martin Baulig  <martin@ximian.com>
5905
5906         * class.cs (MethodData.Define): If we're an explicit
5907         implementation, remove the generic arity from the type name.
5908
5909 2004-08-03  Martin Baulig  <martin@ximian.com>
5910
5911         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5912         use a user-defined operator; we still need to do numeric
5913         promotions in case one argument is a builtin type and the other
5914         one has an implicit conversion to that type.  Fixes #62322.
5915
5916 2004-08-02  Martin Baulig  <martin@ximian.com>
5917
5918         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5919         `TypeExpr[]' array.
5920         (TypeContainer.GetClassBases): Return the unexpanded list of
5921         interfaces; we expand them later.
5922         (TypeContainer.DefineType): After creating the TypeBuilder, call
5923         TypeManager.ExpandInterfaces() to get an expanded and resolved
5924         list of interfaces.
5925
5926         * ecore.cs (TypeExpr.GetInterfaces): Removed
5927
5928         * generics.cs (Constraints.InterfaceConstraints): Remove.
5929         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5930         register the interface constraints.
5931
5932         * typemanager.cs
5933         (TypeManager.AddUserType): Removed the `ifaces' argument.
5934         (TypeManager.AddTypeParameter): Likewise.
5935         (TypeManager.AddUserInterface): Removed, was unused.
5936         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5937         `TypeExpr[]' array for the interfaces.
5938         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5939         has been defined, returns a list of the resolved interfaces types.
5940         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5941         (TypeManager.GetExplicitInterfaces): Likewise.  
5942
5943 2004-08-02  Martin Baulig  <martin@ximian.com>
5944
5945         * expression.cs (Invocation.EmitCall): If we're invoking a method
5946         on a type parameter, use the new `Constrained' prefix opcode.
5947
5948 2004-08-02  Martin Baulig  <martin@ximian.com>
5949
5950         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5951         (LocalInfo.IsThis): New public property.
5952         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5953
5954 2004-08-01  Martin Baulig  <martin@ximian.com>
5955
5956         * class.cs (TypeContainer.GetClassBases): Don't set the default
5957         here since we may get called from GetPartialBases().
5958         (TypeContainer.DefineType): If GetClassBases() didn't return a
5959         parent, use the default one.
5960
5961 2004-07-30  Martin Baulig  <martin@ximian.com>
5962
5963         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5964
5965         * class.cs (SourceMethod): New public class, derive from the
5966         symbol writer's ISourceMethod.
5967         (Method): Use the new symbol writer API.
5968
5969         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5970         as argument and use the new symbol writer.
5971
5972         * location.cs
5973         (SourceFile): Implement the symbol writer's ISourceFile.
5974         (Location.SymbolDocument): Removed.
5975         (Location.SourceFile): New public property.
5976
5977         * symbolwriter.cs: Use the new symbol writer API.
5978
5979 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5980
5981         * Makefile (install-local): Remove.  Functionality moved to
5982         executable.make.
5983
5984 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5985
5986         * Makefile: Install mcs.exe.config file together with mcs.exe.
5987         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5988         correct runtime version.
5989         
5990 2004-07-25  Martin Baulig  <martin@ximian.com>
5991
5992         * class.cs
5993         (TypeContainer.RegisterOrder): Removed, this was unused.
5994         (TypeContainer, interface_order): Removed.
5995         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5996         TypeContainer as argument since we can also be called with a
5997         `PartialContainer' for a partial class/struct/interface.
5998         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5999         of checking whether we're an `Interface' - we could be a
6000         `PartialContainer'.
6001         (PartialContainer.Register): Override; call
6002         AddClass()/AddStruct()/AddInterface() on our parent.
6003
6004         * cs-parser.jay (interface_member_declaration): Add things to the
6005         `current_container', not the `current_class'.
6006
6007         * rootcontext.cs (RegisterOrder): The overloaded version which
6008         takes an `Interface' was unused, removed.
6009
6010         * typemanager.cs (TypeManager.LookupInterface): Return a
6011         `TypeContainer', not an `Interface'.
6012         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6013         contain a `PartialContainer' for an interface, so check it's
6014         `Kind' to figure out what it is.
6015
6016 2004-07-25  Martin Baulig  <martin@ximian.com>
6017
6018         * class.cs (Class.DefaultTypeAttributes): New public constant.
6019         (Struct.DefaultTypeAttributes): Likewise.
6020         (Interface.DefaultTypeAttributes): Likewise.
6021         (PartialContainer.TypeAttr): Override this and add the
6022         DefaultTypeAttributes.
6023
6024 2004-07-25  Martin Baulig  <martin@ximian.com>
6025
6026         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6027         we can just use the `Parent' field instead.
6028
6029 2004-07-25  Martin Baulig  <martin@ximian.com>
6030
6031         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6032
6033 2004-07-25  Martin Baulig  <martin@ximian.com>
6034
6035         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6036         our parts before defining any methods.
6037         (TypeContainer.VerifyImplements): Make this virtual.
6038         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6039         on our PartialContainer.
6040
6041 2004-07-25  Martin Baulig  <martin@ximian.com>
6042
6043         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6044
6045         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6046         argument, we can just use the `Parent' field instead.
6047
6048         * class.cs
6049         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6050         (MemberBase.DoDefine): Likewise.
6051
6052 2004-07-24  Martin Baulig  <martin@ximian.com>
6053
6054         * decl.cs (MemberCore.Parent): New public field.
6055         (DeclSpace.Parent): Moved to MemberCore.
6056
6057         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6058         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6059         parent's .ctor.
6060         (FieldBase, Field, Operator): Likewise.
6061         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6062         (EventField, Event): Likewise.
6063
6064 2004-07-23  Martin Baulig  <martin@ximian.com>
6065
6066         * class.cs (PartialContainer): New public class.
6067         (ClassPart): New public class.
6068         (TypeContainer): Added support for partial classes.
6069         (TypeContainer.GetClassBases): Splitted some of the functionality
6070         out into GetNormalBases() and GetPartialBases().
6071
6072         * cs-tokenizer.cs (Token.PARTIAL): New token.
6073         (Tokenizer.consume_identifier): Added some hacks to recognize
6074         `partial', but only if it's immediately followed by `class',
6075         `struct' or `interface'.
6076
6077         * cs-parser.jay: Added support for partial clases.
6078
6079 2004-07-23  Martin Baulig  <martin@ximian.com>
6080
6081         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6082         a `DeclSpace' and also made it readonly.
6083         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6084         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6085         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6086
6087         * cs-parser.jay: Pass the `current_class', not the
6088         `current_container' (at the moment, this is still the same thing)
6089         to a new Method, Property, Event, Indexer or Constructor.
6090
6091 2004-07-23  Martin Baulig  <martin@ximian.com>
6092
6093         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6094         and removed the `current_interface' one.
6095         (struct_declaration, class_declaration, interface_declaration):
6096         Set `current_class' to the newly created class/struct/interface;
6097         set their `Bases' and call Register() before parsing their body.
6098
6099 2004-07-23  Martin Baulig  <martin@ximian.com>
6100
6101         * class.cs (Kind): New public enum.
6102         (TypeContainer): Made this class abstract.
6103         (TypeContainer.Kind): New public readonly field.
6104         (TypeContainer.CheckDef): New public method; moved here from
6105         cs-parser.jay.
6106         (TypeContainer.Register): New public abstract method.
6107         (TypeContainer.GetPendingImplementations): New public abstract
6108         method.
6109         (TypeContainer.GetClassBases): Removed the `is_class' and
6110         `is_iface' parameters.
6111         (TypeContainer.DefineNestedTypes): Formerly known as
6112         DoDefineType().
6113         (ClassOrStruct): Made this class abstract.
6114
6115         * tree.cs (RootTypes): New public type. 
6116
6117 2004-07-20  Martin Baulig  <martin@ximian.com>
6118
6119         * tree.cs (Tree.RecordNamespace): Removed.
6120         (Tree.Namespaces): Removed.
6121
6122         * rootcontext.cs (RootContext.IsNamespace): Removed.
6123
6124         * cs-parser.jay (namespace_declaration): Just create a new
6125         NamespaceEntry here.
6126
6127 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6128
6129         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6130         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6131         entry to make sure it runs in the correct runtime version.
6132         
6133 2004-07-18  Martin Baulig  <martin@ximian.com>
6134
6135         * generic.cs (ConstructedType.CheckConstraints): Improved
6136         constraints checking.
6137
6138 2004-07-18  Martin Baulig  <martin@ximian.com>
6139
6140         * expression.cs (Invocation.BetterMethod): Call
6141         TypeManager.TypeToCoreType() on all types and removed my previous
6142         hack; we're already doig the right thing here.
6143
6144 2004-07-17  Martin Baulig  <martin@ximian.com>
6145
6146         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6147
6148 2004-07-16  Martin Baulig  <martin@ximian.com>
6149
6150         * iterators.cs: Added generics support.
6151
6152 2004-07-16  Martin Baulig  <martin@ximian.com>
6153
6154         * iterators.cs: Rewrote this.  We're now using one single Proxy
6155         class for both the IEnumerable and the IEnumerator interface and
6156         `Iterator' derives from Class so we can use the high-level API.
6157
6158         * class.cs (TypeContainer.AddIterator): New method.
6159         (TypeContainer.DoDefineType): New protected virtual method, which
6160         is called from DefineType().
6161         (TypeContainer.DoDefineMembers): Call DefineType() and
6162         DefineMembers() on all our iterators.
6163         (TypeContainer.Emit): Call Emit() on all our iterators.
6164         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6165
6166         * codegen.cs (EmitContext.CurrentIterator): New public field.
6167
6168 2004-07-15  Martin Baulig  <martin@ximian.com>
6169
6170         * typemanager.cs
6171         (TypeManager.not_supported_exception_type): New type.   
6172
6173 2004-07-14  Martin Baulig  <martin@ximian.com>
6174
6175         * typemanager.cs
6176         (TypeManager.generic_ienumerable_type): New type.
6177         (TypeManager.generic_ienumerator_type): New type.
6178
6179         * rootcontext.cs
6180         (RootContext.interfaces_first_stage): Added
6181         "System.Collections.Generic.IEnumerator`1" and
6182         "System.Collections.Generic.IEnumerable`1".     
6183
6184 2004-07-14  Martin Baulig  <martin@ximian.com>
6185
6186         * iterators.cs: Use real error numbers.
6187
6188 2004-07-14  Martin Baulig  <martin@ximian.com>
6189
6190         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6191         requires this to be a System.Collection.IEnumerable and not a
6192         class implementing that interface.
6193         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6194
6195 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6196
6197         * class.cs: Fixed previous fix, it broke some error tests.
6198
6199 2004-07-12  Martin Baulig  <martin@ximian.com>
6200
6201         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6202         Fixes #61293.
6203
6204 2004-07-14  Martin Baulig  <martin@ximian.com>
6205
6206         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6207         an exclamation mark (!) for the generic arity to reflect the
6208         latest spec changes; ie. use "System.Collections.Generic.IList`1".
6209
6210 2004-07-13  Martin Baulig  <martin@ximian.com>
6211
6212         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6213         specifiers being part of a type argument.
6214
6215 2004-07-13  Martin Baulig  <martin@ximian.com>
6216
6217         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6218         name for generic types.
6219
6220 2004-07-13  Martin Baulig  <martin@ximian.com>
6221
6222         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6223         bit to fix #60119.
6224
6225 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6226
6227         * assign.cs (LocalTemporary): Add new argument: is_address,If
6228         `is_address' is true, then the value that we store is the address
6229         to the real value, and not the value itself.
6230         
6231         * ecore.cs (PropertyExpr): use the new local temporary
6232         stuff to allow us to handle X.Y += z (where X is a struct)
6233
6234 2004-07-08  Martin Baulig  <martin@ximian.com>
6235
6236         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6237         not always return, just like we're doing in Using.Resolve().
6238
6239 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6240
6241         * cs-parser.jay (fixed_statement): flag this as Pinned.
6242
6243 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6244
6245         * typemanager.cs (TypeManager): Removed MakePinned method, this
6246         mechanism is replaced with the .NET 2.x compatible mechanism of
6247         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6248
6249         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6250         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6251         `IsFixed' property which has a different meaning.
6252
6253 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6254
6255         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6256         visible from inside a nested class, not just the names of the
6257         immediately enclosing class.
6258         Fix for bug #60730.
6259
6260 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6261
6262         * expression.cs (BetterConversion): Remove buggy special-case
6263         handling of "implicit constant expression conversions".  At this
6264         point, we already know that the conversion is possible -- we're
6265         only checking to see which is better.
6266
6267 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6268
6269         * cs-parser.jay: Added error CS0210 test.
6270
6271 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6272
6273         * cs-parser.jay: Added error CS0134 test.
6274
6275 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6276
6277         Fix bug #52507
6278         * cs-parser.jay: Added error CS0145 test.
6279
6280 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6281
6282         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6283
6284 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6285         
6286         * expression.cs (StackAlloc.Resolve): The argument may not
6287         be a constant; deal with this case.
6288         
6289 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6290
6291         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6292         GetIndexerAttributeValue.
6293         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6294
6295         * class.cs (Indexer.Define): Added error tests for CS0415,
6296         CS0609.
6297
6298 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6299
6300         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6301         property code.
6302
6303 2004-06-23  Martin Baulig  <martin@ximian.com>
6304
6305         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6306         neither return nor throw, reset the barrier as well.  Fixes #60457.
6307
6308 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6309
6310         * class.cs : EventAttributes is now set to None by default.
6311           This fixes bug #60459.
6312
6313 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6314
6315         Fix bug #60219
6316         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6317         Don't throw exception but return null (it's sufficient now).
6318
6319 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6320
6321         * typemanager.cs (GetArgumentTypes): Faster implementation.
6322
6323 2004-06-18  Martin Baulig  <martin@ximian.com>
6324
6325         * attribute.cs (Attribute.Resolve): Check whether we're an
6326         EmptyCast which a Constant child.  Fixes #60333.
6327
6328 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6329
6330         * statement.cs (EmitCollectionForeach): Account for the fact that
6331         not all valuetypes are in areas which we can take the address of.
6332         For these variables, we store to a temporary variable. Also, make
6333         sure that we dont emit a `callvirt' on a valuetype method.
6334
6335 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6336
6337         * expression.cs (StackAlloc.DoReSolve): Added test for
6338         negative parameter (CS0247).
6339
6340 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6341
6342         Fix bug #59792
6343         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6344
6345 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6346
6347         Fix bug #59781
6348         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6349         ulong.
6350
6351 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6352
6353         Fix bug #58254 & cs1555.cs, cs1556.cs
6354         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6355
6356 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6357
6358         * cs-parser.jay: Added error CS1669 test for indexers.
6359
6360 2004-06-18  Martin Baulig  <martin@ximian.com>
6361
6362         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6363         argument.  Fixes #60441.
6364
6365 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6366         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6367         The name needs to have the actual name of the method in order
6368         for other tests (such as the one in OverloadResolve for Invoke
6369         on a delegate) to work. As well, it does not really help
6370         error reporting because the method group had multiple methods.
6371         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6372         Make profiling work.
6373         
6374 2004-06-13  Martin Baulig  <martin@ximian.com>
6375
6376         * cs-parser.jay: Don't allow generic attributes.
6377
6378 2004-06-13  Martin Baulig  <martin@ximian.com>
6379
6380         * class.cs (MemberBase.DoDefineBase): New protected method.
6381         (MemberBase.DoDefine): Compute the `flags' in the new
6382         DoDefineBase() which must be called first.
6383         (Method.Define): Call DoDefineBase() first so we have the flags
6384         when defining the generic method.
6385
6386         * cs-parser.jay (interface_method_declaration): Support generic methods.
6387
6388 2004-06-13  Martin Baulig  <martin@ximian.com>
6389
6390         * decl.cs (TypeName): Removed.
6391         (MemberName): Removed TypeName and MemberNow; now we just have
6392         MemberName.
6393
6394         * cs-parser.jay: Don't distinguish between type arguments and type
6395         parameters in the grammar and simplified the rules a bit.  The
6396         reduce/reduce conflicts are now gone (except the one we inherited
6397         from mcs).
6398
6399 2004-06-11  Martin Baulig  <martin@ximian.com>
6400
6401         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6402         call this twice: for params and varargs methods.
6403
6404 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6405
6406         * class.cs:
6407         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6408
6409 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * attribute.cs (Attribute.GetValidTargets): Made public.
6412
6413         * class.cs: 
6414         (AbstractPropertyEventMethod): New class for better code sharing.
6415         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6416         CS1667 report.
6417         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6418
6419 2004-06-09  Martin Baulig  <martin@ximian.com>
6420
6421         * cs-parser.jay: Removed a reduce/reduce conflict.
6422
6423 2004-06-03  Martin Baulig  <martin@ximian.com>
6424
6425         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6426         GetSimpleName() and return a SimpleName.
6427
6428         * ecore.cs (SimpleName.Arguments): New public field.
6429         (SimpleName): Added overloaded ctor which takes an additional
6430         TypeArguments argument.
6431         (SimpleName.SimpleNameResolve): Added support for generic methods.
6432         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6433         formerly in MemberAccess.DoResolve(), but we also need it in
6434         SimpleNameResolve().
6435
6436         * expression.cs (MemberAccess.DoResolve): Use the new
6437         MethodGroupExpr.ResolveGeneric().       
6438
6439 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6440
6441         * decl.cs: If possible, use lookuptypedirect here. We can only do
6442         this if there is no `.' after the namespace. Avoids using
6443         LookupType, which does lots of slow processing.
6444         (FindNestedType) New method, does what it says :-).
6445         * namespace.cs: use LookupTypeDirect.
6446         * rootcontext.cs: use membercache, if possible.
6447         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6448
6449 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6450
6451         * expression.cs:
6452         According to the spec, 
6453
6454         In a member access of the form E.I, if E is a single identifier,
6455         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6456         field, property, localvariable, or parameter with the same type as
6457         the meaning of E as a type-name (§3.8), then both possible
6458         meanings of E are permitted.
6459
6460         We did not check that E as a simple-name had the same type as E as
6461         a type name.
6462
6463         This trivial check gives us 5-7% on bootstrap time.
6464
6465 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6466
6467         * expression.cs (Invocation.OverloadResolve): Avoid the
6468         use of hashtables and boxing here by allocating on demand.
6469
6470 2004-05-30  Martin Baulig  <martin@ximian.com>
6471
6472         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6473         we're doing a silent lookup.  Don't try to lookup nested types in
6474         TypeManager.object_type (thanks to Ben Maurer).
6475
6476 2004-05-30  Martin Baulig  <martin@ximian.com>
6477
6478         Committing a patch from Ben Maurer.
6479
6480         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6481
6482 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6483
6484         * convert.cs: add a trivial cache for overload operator resolution.
6485
6486 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6487
6488         * attribute.cs
6489         (AttributeTester.GetObsoleteAttribute): Returns instance of
6490         ObsoleteAttribute when type is obsolete.
6491
6492         * class.cs
6493         (TypeContainer.VerifyObsoleteAttribute): Override.
6494         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6495         (MethodCode.VerifyObsoleteAttribute): Override.
6496         (MemberBase.VerifyObsoleteAttribute): Override.
6497
6498         * decl.cs
6499         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6500         and report proper error.
6501
6502         *delegate.cs
6503         (Delegate.VerifyObsoleteAttribute): Override.
6504
6505         * ecore.cs
6506         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6507         and report proper error.
6508         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6509
6510         * enum.cs
6511         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6512         and enum member.
6513
6514         * expression.cs
6515         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6516         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6517         Added test for ObsoleteAttribute.
6518
6519         * statement.cs
6520         (Catch): Derived from Statement.
6521
6522 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6523
6524         * decl.cs: If possible, use lookuptypedirect here. We can only do
6525         this if there is no `.' after the namespace. Avoids using
6526         LookupType, which does lots of slow processing.
6527         (FindNestedType) New method, does what it says :-).
6528         * namespace.cs: use LookupTypeDirect.
6529         * rootcontext.cs: use membercache, if possible.
6530         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6531
6532 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6533
6534         * expression.cs:
6535         According to the spec, 
6536
6537         In a member access of the form E.I, if E is a single identifier,
6538         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6539         field, property, localvariable, or parameter with the same type as
6540         the meaning of E as a type-name (§3.8), then both possible
6541         meanings of E are permitted.
6542
6543         We did not check that E as a simple-name had the same type as E as
6544         a type name.
6545
6546         This trivial check gives us 5-7% on bootstrap time.
6547
6548 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6549
6550         Fixed bug #59071 & cs0160.cs
6551         * statement.cs (Try.Resolve): Check here whether order of catch
6552         clauses matches their dependencies.
6553
6554 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6555
6556         Fixed bug #58624
6557         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6558         unsafe type.
6559
6560 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6561
6562         * expression.cs (Invocation.OverloadResolve): Avoid the
6563         use of hashtables and boxing here by allocating on demand.
6564
6565 2004-05-30  Martin Baulig  <martin@ximian.com>
6566
6567         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6568         we're doing a silent lookup.  Don't try to lookup nested types in
6569         TypeManager.object_type (thanks to Ben Maurer).
6570
6571 2004-05-30  Martin Baulig  <martin@ximian.com>
6572
6573         Committing a patch from Ben Maurer.
6574
6575         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6576
6577 2004-05-29  Martin Baulig  <martin@ximian.com>
6578
6579         * class.cs (IMethodData.ShouldIgnore): New method.
6580
6581         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6582         `Location' argument, we don't need it anywhere.  Use
6583         `IMethodData.ShouldIgnore ()' instead of
6584         `MethodData.GetMethodFlags ()'.
6585         (TypeManager.AddMethod): Removed.
6586         (TypeManager.AddMethod2): Renamed to AddMethod.
6587
6588 2004-05-29  Martin Baulig  <martin@ximian.com>
6589
6590         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6591
6592         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6593         converting from a class type S to an interface type and we already
6594         have an object on the stack, don't box it again.  Fixes #52578.
6595
6596 2004-05-29  Martin Baulig  <martin@ximian.com>
6597
6598         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6599         Added support for `params' parameters.  Fixes #59267.
6600
6601 2004-05-29  Martin Baulig  <martin@ximian.com>
6602
6603         * literal.cs (NullPointer): Provide a private .ctor which sets
6604         `type' to TypeManager.object_type.  Fixes #59048.
6605
6606 2004-05-29  Martin Baulig  <martin@ximian.com>
6607
6608         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6609         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6610
6611         * ecore.cs (EventExpr.instance_expr): Make the field private.
6612
6613 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6614
6615         Fixed bug #50080 & cs0214-2.cs
6616         * expression.cs (Cast.DoResolve): Check unsafe context here.
6617         
6618         * statement.cs (Resolve.DoResolve): Likewise.
6619
6620 2004-05-26  Martin Baulig  <martin@ximian.com>
6621
6622         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6623
6624         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6625         (RootContext.LookupType): Pass down the `silent' flag.
6626
6627 2004-05-25  Martin Baulig  <martin@ximian.com>
6628
6629         * expression.cs
6630         (MethodGroupExpr.IdenticalTypeName): New public property.
6631         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6632         expression actually refers to a type.
6633
6634 2004-05-25  Martin Baulig  <martin@ximian.com>
6635
6636         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6637         for #56176 and made it actually work.
6638
6639 2004-05-25  Martin Baulig  <martin@ximian.com>
6640
6641         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6642         (FieldExpr, PropertyExpr): Override and implement
6643         CacheTemporaries.  Fixes #52279.
6644
6645 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6646
6647         * location.cs: In the new compiler listing a file twice is a
6648         warning, not an error.
6649
6650 2004-05-24  Martin Baulig  <martin@ximian.com>
6651
6652         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6653         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6654
6655 2004-05-24  Martin Baulig  <martin@ximian.com>
6656
6657         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6658         walking the `using' list.  Fixes #53921.
6659
6660 2004-05-24  Martin Baulig  <martin@ximian.com>
6661
6662         * const.cs (Const.LookupConstantValue): Added support for
6663         EmptyCast's; fixes #55251.
6664
6665 2004-05-24  Martin Baulig  <martin@ximian.com>
6666
6667         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6668         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6669         which does the CS0135 check.  The reason is that we first need to
6670         check whether the variable actually exists.
6671
6672 2004-05-24  Martin Baulig  <martin@ximian.com>
6673
6674         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6675         than RootContext.LookupType() to find the explicit interface
6676         type.  Fixes #58584.
6677
6678 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6679
6680         * Makefile: Simplify.  Use executable.make.
6681         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6682
6683 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6684
6685         * decl.cs:
6686         * enum.cs:
6687         Use the invariant culture when doing String.Compare for CLS case
6688         sensitivity.
6689         
6690 2004-05-23  Martin Baulig  <martin@ximian.com>
6691
6692         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6693         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6694
6695         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6696
6697 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6698
6699         * class.cs (MemberBase.Define): Reuse MemberType member for 
6700         resolved type. Other methods can use it too.
6701
6702 2004-05-23  Martin Baulig  <martin@ximian.com>
6703
6704         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6705         the variable also exists in the current block (otherwise, we need
6706         to report a CS0103).  Fixes #58670.
6707
6708 2004-05-23  Martin Baulig  <martin@ximian.com>
6709
6710         * flowanalysis.cs (Reachability.Reachable): Compute this
6711         on-the-fly rather than storing it as a field.
6712
6713 2004-05-23  Martin Baulig  <martin@ximian.com>
6714
6715         * flowanalysis.cs (Reachability.And): Manually compute the
6716         resulting `barrier' from the reachability.      
6717        
6718 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6719
6720         Fix bug #57835
6721         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6722         instance of ObsoleteAttribute when symbol is obsolete.
6723
6724         * class.cs
6725         (IMethodData): Extended interface for ObsoleteAttribute support.
6726
6727 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6728
6729         * attribute.cs: Fix bug #55970
6730
6731 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6732
6733         Fix bug #52705
6734         * attribute.cs
6735         (GetObsoleteAttribute): New method. Creates the instance of
6736         ObsoleteAttribute.
6737         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6738         ObsoleteAttribute when member is obsolete.
6739         (AttributeTester.Report_ObsoleteMessage): Common method for
6740         Obsolete error/warning reporting.
6741
6742         * class.cs
6743         (TypeContainer.base_classs_type): New member for storing parent type.
6744
6745         * decl.cs
6746         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6747         for this MemberCore.
6748
6749 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6750
6751         * attribute.cs, const.cs: Fix bug #58590
6752
6753 2004-05-21  Martin Baulig  <martin@ximian.com>
6754
6755         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6756         out parameters if the end of the method is unreachable.  Fixes
6757         #58098. 
6758
6759 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6760
6761         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6762         Hari was right, why extra method.
6763
6764 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6765
6766         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6767
6768 2004-05-20  Martin Baulig  <martin@ximian.com>
6769
6770         * delegate.cs: Convert this file to Unix mode - like the original
6771         version in mcs is.
6772
6773 2004-05-20  Martin Baulig  <martin@ximian.com>
6774
6775         * attribute.cs: Convert this file to Unix mode - like the original
6776         version in mcs is.
6777
6778 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6779
6780        Fix bug #58688 (MCS does not report error when the same attribute
6781        is assigned twice)
6782
6783        * attribute.cs (Attribute.Emit): Distinction between null and default.
6784
6785 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6786
6787        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6788        of a top-level attribute without an attribute target.
6789        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6790        Make non-static.
6791        (Attribute.Conditional_GetConditionName), 
6792        (Attribute.Obsolete_GetObsoleteMessage): Update.
6793        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6794        part of ScanForIndexerName.
6795        (Attribute.CanIgnoreInvalidAttribute): New function.
6796        (Attribute.ScanForIndexerName): Move to ...
6797        (Attributes.ScanForIndexerName): ... here.
6798        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6799        (Attributes.Search): New internal variant that can choose not to
6800        complain if types aren't resolved.  The original signature now
6801        complains.
6802        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6803        complaints suppressed.
6804        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6805        only if it not useful.
6806        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6807        top-level for attributes that are shared between the assembly
6808        and a top-level class.
6809        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6810        * class.cs: Update to reflect changes.
6811        (DefineIndexers): Fuse loops.
6812        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6813        a couple more variants of attribute names.
6814
6815 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6816
6817         Fix bug #52585 (Implemented explicit attribute declaration)
6818
6819         * attribute.cs:
6820         (Attributable.ValidAttributeTargets): New abstract method. It gets
6821         list of valid attribute targets for explicit target declaration.
6822         (Attribute.Target): It holds target itself.
6823         (AttributeSection): Removed.
6824         (Attribute.CheckTargets): New method. It checks whether attribute
6825         target is valid for the current element.
6826
6827         * class.cs:
6828         (EventProperty): New class. For events that are declared like
6829         property (with add and remove accessors).
6830         (EventField): New class. For events that are declared like field.
6831         class.cs
6832
6833         * cs-parser.jay: Implemented explicit attribute target declaration.
6834
6835         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6836         Override ValidAttributeTargets.
6837
6838         * parameter.cs:
6839         (ReturnParameter): Class for applying custom attributes on 
6840         the return type.
6841         (ParameterAtribute): New class. Class for applying custom
6842         attributes on the parameter type.
6843
6844 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6845
6846         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6847         definitions. 
6848
6849         (Method): Allow UNSAFE here.
6850
6851         * modifiers.cs: Support unsafe reporting.
6852
6853 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6854
6855         * decl.cs: Fix bug #58478.
6856
6857 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6858
6859         * statement.cs: When checking for unreachable code on an EmptyStatement,
6860         set the location. Fixes bug #58488.
6861
6862 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6863
6864         * driver.cs: Add -pkg handling.
6865
6866         From Gonzalo: UseShelLExecute=false
6867
6868 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6869
6870         * attribute.cs:
6871         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6872         for attribute.
6873         (Attribute.IsClsCompliaceRequired): Moved to base for better
6874         accesibility.
6875         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6876         when attribute is AttributeUsageAttribute.
6877         (Attribute.GetValidTargets): Simplified.
6878         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6879         attribute for this type.
6880         (Attribute.ApplyAttributes): Method renamed to Emit and make
6881         non-static.
6882         (GlobalAttributeSection): New class for special handling of global
6883         attributes (assembly, module).
6884         (AttributeSection.Emit): New method.
6885
6886         * class.cs: Implemented Attributable abstract methods.
6887         (MethodCore.LabelParameters): Moved to Parameter class.
6888         (Accessor): Is back simple class.
6889         (PropertyMethod): Implemented Attributable abstract class.
6890         (DelegateMethod): Implemented Attributable abstract class.
6891         (Event): New constructor for disctintion between normal Event
6892         and Event with accessors.
6893
6894         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6895
6896         * codegen.cs, const.cs, decl.cs, delegate.cs:
6897         (CommonAssemblyModulClass): Implemented Attributable abstract class
6898         and simplified.
6899
6900         * enum.cs: Implement IAttributeSupport interface.
6901         (EnumMember): New class for emum members. Implemented Attributable
6902         abstract class
6903
6904         * parameter.cs:
6905         (ParameterBase): Is abstract.
6906         (ReturnParameter): New class for easier [return:] attribute handling.
6907
6908         * typemanager.cs: Removed builder_to_attr.
6909
6910 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6911
6912         Fix bug #57151.
6913         * attribute.cs (Attribute.GetPositionalValue): New function.
6914         * class.cs (TypeContainer.VerifyMembers): New function.
6915         (TypeContainer.Emit): Use it.
6916         (ClassOrStruct): New base class for Class and Struct.
6917         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6918         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6919         class.
6920         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6921         then each non-static field should have a FieldOffset attribute.
6922         Otherwise, none of the fields should have a FieldOffset attribute.
6923         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6924         and FieldOffset attributes.
6925         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6926         (TypeManager.field_offset_attribute_type): New core types.
6927         (TypeManager.InitCoreTypes): Initialize them.
6928
6929 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6930
6931         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6932         Return correct type.
6933         From bug #58270.
6934
6935 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6936
6937         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6938         be implicitly converted to ulong.
6939         
6940         * expression.cs: The logic for allowing operator &, | and ^ worked
6941         was wrong, it worked before because we did not report an error in
6942         an else branch.  Fixes 57895.
6943
6944         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6945         allow volatile fields to be reference types.
6946
6947 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6948
6949         * driver.cs: Add support for /debug-
6950
6951 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6952
6953         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6954         Add a 'complain' parameter to silence errors.
6955         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6956         silently overlooked type-resolutions.
6957         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6958         to reflect changes.
6959         (Attributes.Search): New function.
6960         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6961         (Attributes.GetAttributeFullName): Remove hack.
6962         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6963         Update to reflect changes.
6964         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6965         Use Attributes.Search instead of nested loops.
6966
6967 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6968
6969         * decl.cs:
6970         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6971         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6972         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6973
6974         * report.cs: (Report.Warning): Renamed to Warning_T because of
6975         parameter collision.
6976
6977 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6978
6979         * expression.cs (MemberAccess.ResolveMemberAccess):
6980         Exit with non-zero status after Report.Error.
6981         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6982         Likewise.
6983         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6984
6985 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6986
6987         * support.cs: Don't hang when the file is empty.
6988
6989 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6990
6991         * support.cs: In SeekableStreamReader, compute the preamble size of the
6992           underlying stream. Position changes should take into account that initial
6993           count of bytes.
6994
6995 2004-05-03  Todd Berman  <tberman@sevenl.net>
6996
6997         * driver.cs: remove unused GetSysVersion function.
6998
6999 2004-05-03  Todd Berman  <tberman@sevenl.net>
7000
7001         * driver.cs: Remove the hack from saturday, as well as the hack
7002         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7003         link_paths to get that bit proper.
7004
7005 2004-05-01  Todd Berman  <tberman@sevenl.net>
7006
7007         * driver.cs: Try a LoadFrom before a Load, this checks the current
7008         path. This is currently a bug in mono that is be fixed, however, this
7009         provides a workaround for now. This will be removed when the bug
7010         is fixed.
7011
7012 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7013
7014         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7015         incomplete key pairs (#57941).
7016
7017 2004-05-01  Todd Berman  <tberman@sevenl.net>
7018
7019         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7020         from the GAC
7021
7022 2004-04-30  Jackson Harper  <jackson@ximian.com>
7023
7024         * codegen.cs: Open keys readonly.
7025         
7026 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7027
7028         * typemanager.cs: don't report cyclic struct layout when a struct
7029         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7030         which has 2 Pango.Rectangle fields.
7031
7032 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7033
7034         * expression.cs: Handle IntPtr comparisons with IL code
7035         rather than a method call.
7036
7037 2004-04-29  Martin Baulig  <martin@ximian.com>
7038
7039         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7040         the list of PropertyInfo's in class hierarchy and find the
7041         accessor.  Fixes #56013.
7042
7043 2004-04-29  Martin Baulig  <martin@ximian.com>
7044
7045         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7046
7047 2004-04-29  Martin Baulig  <martin@ximian.com>
7048
7049         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7050
7051         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7052
7053 2004-04-29  Martin Baulig  <martin@ximian.com>
7054
7055         * class.cs (ConstructorInitializer.Resolve): Check whether the
7056         parent .ctor is accessible.  Fixes #52146.
7057
7058 2004-04-29  Martin Baulig  <martin@ximian.com>
7059
7060         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7061
7062         * statement.cs (Using.EmitLocalVariableDecls): Use
7063         TypeManager.idisposable_type, not typeof (IDisposable).
7064         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7065
7066 2004-04-29  Martin Baulig  <martin@ximian.com>
7067
7068         * class.cs (Event.Define): Don't emit the field and don't set
7069         RTSpecialName and SpecialName for events on interfaces.  Fixes
7070         #57703. 
7071
7072 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7073
7074         Refactor Attribute.ApplyAttributes.
7075         * attribute.cs (Attributable): New base class for objects that can
7076         have Attributes applied on them.
7077         (Attribute): Make AttributeUsage fields public.
7078         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7079         (Attribute.IsInternalCall): New property.
7080         (Attribute.UsageAttr): Convert to a public read-only property.
7081         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7082         (Attribute.ResolveType, Attribute.Resolve)
7083         (Attribute.ScanForIndexerName): Update to reflect changes.
7084         (Attribute.CheckAttributeTarget): Re-format.
7085         (Attribute.ApplyAttributes): Refactor, to various
7086         Attributable.ApplyAttributeBuilder methods.
7087         * decl.cs (MemberCore): Make Attributable.
7088         * class.cs (Accessor): Make Attributable.
7089         (MethodData.ApplyAttributes): Use proper attribute types, not
7090         attribute names.
7091         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7092         (TypeContainer.ApplyAttributeBuilder)
7093         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7094         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7095         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7096         (Operator.ApplyAttributeBuilder): New factored-out methods.
7097         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7098         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7099         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7100         * parameter.cs (ParameterBase): New Attributable base class
7101         that can also represent Return types.
7102         (Parameter): Update to the changes.
7103
7104 2004-04-29  Jackson Harper  <jackson@ximian.com>
7105
7106         * driver.cs: Prefer the corlib system version when looking for
7107         assemblies in the GAC. This is still a hack, but its a better hack
7108         now.
7109         
7110 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7111
7112         * decl.cs, enum.cs: Improved error 3005 reporting.
7113   
7114         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7115         (related_symbols): New private member for list of symbols
7116         related to reported error/warning.
7117         
7118         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7119
7120 2004-04-29  Martin Baulig  <martin@ximian.com>
7121
7122         * ecore.cs (Expression.Constantify): If we're an enum and
7123         TypeManager.TypeToCoreType() doesn't give us another type, use
7124         t.UnderlyingSystemType.  Fixes #56178.  
7125
7126 2004-04-29  Martin Baulig  <martin@ximian.com>
7127
7128         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7129         interfaces and for each interface, only add members directly
7130         declared in that interface.  Fixes #53255.
7131
7132 2004-04-28  Martin Baulig  <martin@ximian.com>
7133
7134         * expression.cs (ConditionalLogicalOperator): Use a temporary
7135         variable for `left' to avoid that we evaluate it more than once;
7136         bug #52588.
7137
7138 2004-04-28  Martin Baulig  <martin@ximian.com>
7139
7140         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7141         `void[]' (CS1547).
7142
7143 2004-04-28  Martin Baulig  <martin@ximian.com>
7144
7145         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7146         void (CS1547).
7147
7148         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7149         whether the type is not void (CS1547).
7150
7151 2004-04-28  Martin Baulig  <martin@ximian.com>
7152
7153         * expression.cs (Unary.DoResolveLValue): Override this and report
7154         CS0131 for anything but Operator.Indirection.
7155
7156 2004-04-28  Martin Baulig  <martin@ximian.com>
7157
7158         Committing a patch from Ben Maurer; see bug #50820.
7159
7160         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7161         check for classes.
7162
7163         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7164         classes.        
7165
7166 2004-04-28  Martin Baulig  <martin@ximian.com>
7167
7168         Committing a patch from Ben Maurer; see bug #50820.
7169
7170         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7171         check for classes.
7172
7173         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7174         classes.        
7175
7176 2004-04-28  Martin Baulig  <martin@ximian.com>
7177
7178         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7179         (Block.AddLabel): Call DoLookupLabel() to only search in the
7180         current block.
7181
7182 2004-04-28  Martin Baulig  <martin@ximian.com>
7183
7184         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7185         comparing StringConstants and NullLiterals in Equality and Inequality.
7186
7187 2004-04-28  Jackson Harper  <jackson@ximian.com>
7188
7189         * driver.cs: Attempt to load referenced assemblies from the
7190         GAC. This is the quick and dirty version of this method that
7191         doesnt take into account versions and just takes the first
7192         canidate found. Will be good enough for now as we will not have more
7193         then one version installed into the GAC until I update this method.
7194
7195 2004-04-28  Martin Baulig  <martin@ximian.com>
7196
7197         * typemanager.cs (TypeManager.CheckStructCycles): New public
7198         static method to check for cycles in the struct layout.
7199
7200         * rootcontext.cs (RootContext.PopulateTypes): Call
7201         TypeManager.CheckStructCycles() for each TypeContainer.
7202         [Note: We only need to visit each type once.]
7203
7204 2004-04-28  Martin Baulig  <martin@ximian.com>
7205
7206         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7207
7208         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7209         success and added `out object value'.  Use a `bool resolved' field
7210         to check whether we've already been called rather than
7211         `ConstantValue != null' since this breaks for NullLiterals.
7212
7213 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7214
7215         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7216         setting of this flag, since the 'set' method may be non-public.
7217
7218 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7219
7220         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7221         check on current_vector.Block.
7222
7223 2004-04-27  Martin Baulig  <martin@ximian.com>
7224
7225         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7226         a field initializer.  Fixes #56459.
7227
7228 2004-04-27  Martin Baulig  <martin@ximian.com>
7229
7230         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7231         we're not attempting to use an indexer.  Fixes #52154.
7232
7233 2004-04-27  Martin Baulig  <martin@ximian.com>
7234
7235         * statement.cs (Return): Don't create a return label if we don't
7236         need it; reverts my change from January 20th.  Thanks to Ben
7237         Maurer for this.
7238
7239 2004-04-27  Martin Baulig  <martin@ximian.com>
7240
7241         According to the spec, `goto' can only leave a nested scope, but
7242         never enter it.
7243
7244         * statement.cs (Block.LookupLabel): Only lookup in the current
7245         block, don't recurse into parent or child blocks.
7246         (Block.AddLabel): Check in parent and child blocks, report
7247         CS0140/CS0158 if we find a duplicate.
7248         (Block): Removed this indexer for label lookups.
7249         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7250         this already does the error reporting for us.
7251
7252         * flowanalysis.cs
7253         (FlowBranching.UsageVector.Block): New public variable; may be null.
7254         (FlowBranching.CreateSibling): Added `Block' argument.
7255         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7256         label for the target of a `goto' and check whether we're not
7257         leaving a `finally'.
7258
7259 2004-04-27  Martin Baulig  <martin@ximian.com>
7260
7261         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7262         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7263         just for returns).
7264
7265 2004-04-27  Martin Baulig  <martin@ximian.com>
7266
7267         * statement.cs (Block.AddLabel): Also check for implicit blocks
7268         and added a CS0158 check.
7269
7270 2004-04-27  Martin Baulig  <martin@ximian.com>
7271
7272         * flowanalysis.cs (FlowBranchingLoop): New class.
7273         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7274         UsageVector's instead of an ArrayList.
7275         (FlowBranching.Label): Likewise.
7276         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7277         (FlowBranching.AddBreakVector): New method.
7278
7279 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7280
7281         * attribute.cs: Small regression fix: only convert the type if we
7282         the type is different, fixes System.Drawing build.
7283
7284 2004-04-27  Martin Baulig  <martin@ximian.com>
7285
7286         * attribute.cs (Attribute.Resolve): If we have a constant value
7287         for a named field or property, implicity convert it to the correct
7288         type.
7289
7290 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7291
7292         * statement.cs (Block.Block): Implicit blocks share
7293         'child_variable_names' fields with parent blocks.
7294         (Block.AddChildVariableNames): Remove.
7295         (Block.AddVariable): Mark variable as "used by a child block" in
7296         every surrounding block.
7297         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7298         been used in a child block, complain about violation of "Invariant
7299         meaning in blocks" rule.
7300         * cs-parser.jay (declare_local_variables): Don't use
7301         AddChildVariableNames.
7302         (foreach_statement): Don't create an implicit block: 'foreach'
7303         introduces a scope.
7304
7305 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7306
7307         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7308         converting from 0L to ulong.  Fixes 57522.
7309
7310 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7311
7312         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7313         derived class hides via 'new' keyword field from base class (test-242.cs).
7314         TODO: Handle this in the more general way.
7315         
7316         * class.cs (CheckBase): Ditto.
7317
7318 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7319
7320         * decl.cs (caching_flags): New member for storing cached values
7321         as bit flags.
7322         (MemberCore.Flags): New enum where bit flags for caching_flags
7323         are defined.
7324         (MemberCore.cls_compliance): Moved to caching_flags.
7325         (DeclSpace.Created): Moved to caching_flags.
7326
7327         * class.cs: Use caching_flags instead of DeclSpace.Created
7328         
7329 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7330
7331         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7332         if we are only a derived class, not a nested class.
7333
7334         * typemanager.cs: Same as above, but do this at the MemberLookup
7335         level (used by field and methods, properties are handled in
7336         PropertyExpr).   Allow for the qualified access if we are a nested
7337         method. 
7338
7339 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7340
7341         * class.cs: Refactoring.
7342         (IMethodData): New inteface; Holds links to parent members
7343         to avoid member duplication (reduced memory allocation).
7344         (Method): Implemented IMethodData interface.
7345         (PropertyBase): New inner classes for get/set methods.
7346         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7347         (Event): New inner classes for add/remove methods.
7348         (Event.DelegateMethod): Implemented IMethodData interface.
7349
7350         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7351         EmitContext (related to class.cs refactoring).
7352
7353 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7354
7355         * delegate.cs (Delegate.VerifyApplicability): If the number of
7356         arguments are the same as the number of parameters, first try to
7357         verify applicability ignoring  any 'params' modifier on the last
7358         parameter.
7359         Fixes #56442.
7360
7361 2004-04-08  Martin Baulig  <martin@ximian.com>
7362
7363         Merged latest changes into gmcs.  Please keep this comment in
7364         here, it makes it easier for me to see what changed in MCS since
7365         the last time I merged.
7366
7367 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7368
7369         * class.cs (TypeContainer.AddIndexer): Use
7370         'ExplicitInterfaceName' to determine if interface name was
7371         explicitly specified.  'InterfaceType' is not initialized at this time.
7372         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7373         Indexers array is already in the required order.  Initialize
7374         'IndexerName' only if there are normal indexers.
7375         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7376         (TypeContainer.Emit): Emit DefaultMember attribute only if
7377         IndexerName is initialized.
7378         Fixes #56300.
7379
7380 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7381
7382         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7383         Fixes #57007
7384
7385 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7386
7387         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7388         attributes.
7389         Fix for #56456.
7390
7391         * attribute.cs (Attribute.Resolve): Check for duplicate named
7392         attributes.
7393         Fix for #56463.
7394
7395 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7396
7397         * iterators.cs (MarkYield): track whether we are in an exception,
7398         and generate code accordingly.  Use a temporary value to store the
7399         result for our state.
7400
7401         I had ignored a bit the interaction of try/catch with iterators
7402         since their behavior was not entirely obvious, but now it is
7403         possible to verify that our behavior is the same as MS .NET 2.0
7404
7405         Fixes 54814
7406
7407 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7408
7409         * iterators.cs: Avoid creating temporaries if there is no work to
7410         do. 
7411
7412         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7413         Enumerations, use TypeManager.EnumToUnderlying and call
7414         recursively. 
7415
7416         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7417         bug #57013
7418
7419         (This.Emit): Use EmitContext.EmitThis to emit our
7420         instance variable.
7421
7422         (This.EmitAssign): Ditto.
7423
7424         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7425         codepaths, we will move all the functionality into
7426         Mono.CSharp.This 
7427
7428         (FieldExpr.EmitAssign): Ditto.
7429
7430         This fixes several hidden bugs that I uncovered while doing a code
7431         review of this today.
7432
7433         * codegen.cs (EmitThis): reworked so the semantics are more clear
7434         and also support value types "this" instances.
7435
7436         * iterators.cs: Changed so that for iterators in value types, we
7437         do not pass the value type as a parameter.  
7438
7439         Initialization of the enumerator helpers is now done in the caller
7440         instead of passing the parameters to the constructors and having
7441         the constructor set the fields.
7442
7443         The fields have now `assembly' visibility instead of private.
7444
7445 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7446
7447         * expression.cs (Argument.Resolve): Check if fields passed as ref
7448         or out are contained in a MarshalByRefObject.
7449
7450         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7451         another compiler type.
7452
7453 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7454
7455         * class.cs (Indexer.Define): use the new name checking method.
7456         Also, return false on an error.
7457         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7458         (is_identifier_[start/part]_character): make static.
7459
7460 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7461
7462         * expression.cs (Binary.ResolveOperator): Do no append strings
7463         twice: since we can be invoked more than once (array evaluation)
7464         on the same concatenation, take care of this here.  Based on a fix
7465         from Ben (bug #56454)
7466
7467 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7468
7469         * codegen.cs: Fix another case where CS1548 must be reported (when 
7470         delay-sign isn't specified and no private is available #56564). Fix
7471         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7472         error when MCS is used on the MS runtime and we need to delay-sign 
7473         (which seems unsupported by AssemblyBuilder - see #56621).
7474
7475 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7476
7477         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7478         (TypeManager.ComputeNamespaces): Faster implementation for
7479         Microsoft runtime.
7480
7481         * compiler.csproj: Updated AssemblyName to mcs.
7482
7483 2004-05-11  Jackson Harper  <jackson@ximian.com>
7484
7485         * Makefile: Preserve MONO_PATH
7486         
7487 2004-05-11  Jackson Harper  <jackson@ximian.com>
7488
7489         * Makefile: Use mono and mcs to build gmcs
7490         
7491 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7492
7493         * codegen.cs: Add patch from Robert Shade
7494         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7495         sync with mcs.
7496
7497 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7498
7499         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7500         incomplete key pairs (#57941).
7501
7502 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7503
7504         * codegen.cs: Fix another case where CS1548 must be reported (when 
7505         delay-sign isn't specified and no private is available #56564). Fix
7506         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7507         error when MCS is used on the MS runtime and we need to delay-sign 
7508         (which seems unsupported by AssemblyBuilder - see #56621).
7509
7510 2004-04-29  Jackson Harper  <jackson@ximian.com>
7511
7512         * Makefile: Set MONO_PATH to use the bootstrap corlib
7513         * driver.cs: Check the GAC for referenced assemblies.
7514                 
7515 2004-04-29  Martin Baulig  <martin@ximian.com>
7516
7517         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7518
7519 2004-04-07  Martin Baulig  <martin@ximian.com>
7520
7521         * expression.cs (Binary.ResolveOperator): Added special case for
7522         Equality/Inequality between a type parameter and a null literal.
7523
7524 2004-04-07  Martin Baulig  <martin@ximian.com>
7525
7526         * convert.cs: Check null literal -> type parameter conversions.
7527
7528 2004-04-07  Martin Baulig  <martin@ximian.com>
7529
7530         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7531         `class' and `struct' constraints.
7532
7533 2004-04-07  Martin Baulig  <martin@ximian.com>
7534
7535         * generic.cs (SpecialConstraint): New public enum.
7536         (Constraints.Resolve): Added support for the `class' and `struct'
7537         constraints.
7538
7539         * cs-parser.jay (type_parameter_constraint): Added support for the
7540         `class' and `struct' constraints.
7541
7542 2004-04-07  Martin Baulig  <martin@ximian.com>
7543
7544         * support.cs (GenericConstraints): Replaced `Types' by
7545         `ClassConstraint' and `InterfaceConstraints'; added
7546         `HasClassConstraint'.   
7547
7548 2004-04-07  Martin Baulig  <martin@ximian.com>
7549
7550         * generic.cs
7551         (Constraints.InterfaceConstraints): New public property.
7552         (Constraints.Types): Make this property public
7553         (TypeParameter): Implement IMemberContainer.
7554         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7555         instead of a TypeBuilder/MethodBuilder; pass the interface
7556         constraints to TypeManager.AddTypeParameter().
7557         (TypeParameter.DefineType): Just take an EmitContext and no
7558         TypeBuilder/MethodBuilder.  Use the new public API.
7559
7560         * typemanager.cs (TypeManager.AddTypeParameter): Added
7561         `TypeExpr[]' argument; add the interfaces to the
7562         `builder_to_ifaces' hash.
7563         (TypeManager.LookupMemberContainer): For
7564         GenericTypeParameterBuilders, get the TypeParameter from the
7565         `builder_to_type_param'.
7566         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7567         the TypeParameter and call FindMembers on it.
7568
7569 2004-04-07  Martin Baulig  <martin@ximian.com>
7570
7571         * class.cs
7572         (MethodCore.GenericMethod): Moved this field here from Method.
7573         (MethodCore.IsDuplicateImplementation): Take the number of type
7574         parameters into account if we're a generic method.
7575
7576         * expression.cs (Invocation.InferTypeArguments): Don't return true
7577         if `arguments' is null; we still need to check whether we actually
7578         don't need to infer anything in this case.
7579         (MemberAccess): Merged the functionality from GenericMemberAccess
7580         into this class.
7581
7582         * generic.cs (GenericMemberAccess): Removed.
7583
7584 2004-04-05  Martin Baulig  <martin@ximian.com>
7585
7586         * decl.cs (MemberCore): For generic classes, interfaces and
7587         structs, `Name' now includes the number of type parameters
7588         ("Stack!1.Node!1").
7589         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7590         encode the number of type arguments in the type name.
7591
7592         * expression.cs (Expression.MemberLookup): Removed the
7593         `num_type_args' argument; we now encode the number of type
7594         arguments in the type name.
7595
7596         * ecore.cs (SimpleName): Encode the number of type arguments in
7597         the type name itself.
7598
7599         * generic.cs (ConstructedType): Likewise.
7600
7601         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7602         `MemberName'; we now include the number of type parameters in the
7603         type name.
7604
7605         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7606         (TypeManager.MemberLookup): Removed the
7607         `num_type_args' argument; we now encode the number of type
7608         arguments in the type name.     
7609
7610 2004-04-03  Martin Baulig  <martin@ximian.com>
7611
7612         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7613         (MemberCore.MemberName): Moved here from MemberBase.
7614         (DeclSpace.SetParameterInfo): Just take the constraints as an
7615         ArrayList; we already have the type parameters in our
7616         `MemberName'; also do the CS0080 reporting here.
7617
7618         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7619         `IDENTIFIER opt_type_parameter_list'; when constructing our
7620         `MemberName', it'll already include our type parameters.
7621         (class_declaration, interface_declaration): Likewise.
7622         (delegate_declaration): Likewise.
7623         (MakeName): Take a MemberName and return a MemberName.
7624         The following two changes are required to avoid shift/reduce conflicts:
7625         (member_name): Don't include a TypeName anymore; ie. this is now
7626         just 'IDENTIFIER opt_type_parameter_list'.
7627         (property_declaration, event_declaration): Use a
7628         `namespace_or_type_name' instead of a `member_name'.            
7629
7630 2004-04-03  Martin Baulig  <martin@ximian.com>
7631
7632         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7633         `MemberName' class.
7634         (TypeName): Formerly known as MemberName.
7635
7636         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7637         instead of a `MemberName'.
7638
7639         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7640         (member_name): New rule; create a MemberName.
7641
7642 2004-04-02  Martin Baulig  <martin@ximian.com>
7643
7644         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7645         (CS0305 and CS0308).
7646
7647 2004-04-02  Martin Baulig  <martin@ximian.com>
7648
7649         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7650         support for nested types.
7651
7652 2004-04-02  Martin Baulig  <martin@ximian.com>
7653
7654         * ecore.cs (IAlias): New public interface.
7655         (TypeExpr, TypeExpression): Implement IAlias.
7656         (TypeAliasExpression): New public class.
7657
7658         * namespace.cs (Namespace): Implement IAlias.
7659         (Namespace.Lookup): Return an IAlias instead on an object.
7660         (Namespace.DefineName): Take an IAlias instead of an object.
7661         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7662         an object.
7663         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7664         Expression.
7665         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7666         object.
7667         (NamespaceEntry.Lookup): Likewise.
7668
7669         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7670         instead of a Type.      
7671
7672         * decl.cs (DeclSpace): Implement IAlias.
7673         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7674
7675         * generic.cs (ConstructedType): Improved error checking.
7676
7677 2004-04-02  Martin Baulig  <martin@ximian.com>
7678
7679         * convert.cs: Added type parameter conversions.
7680
7681         * ecore.cs
7682         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7683         (ClassCast.Emit): If the source type is a type parameter, box it.
7684         If the target type is a type parameter, emit an `unbox.any'
7685         instead of a `classcast'.1      
7686
7687 2004-04-01  Martin Baulig  <martin@ximian.com>
7688
7689         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7690
7691 2004-04-01  Martin Baulig  <martin@ximian.com>
7692
7693         * generic.cs (ConstructedType.CheckConstraints): Use
7694         Convert.ImplicitStandardConversionExists(); user-defined implicit
7695         conversions are not allowed according to the spec.
7696
7697 2004-03-30  Martin Baulig  <martin@ximian.com>
7698
7699         * expression.cs (New): Added support for type parameters.
7700
7701         * typemanager.cs
7702         (TypeManager.activator_type): New public static field.
7703         (TypeManager.activator_create_instance): Likewise.
7704
7705 2004-03-30  Martin Baulig  <martin@ximian.com>
7706
7707         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7708         public method.
7709
7710 2004-03-30  Martin Baulig  <martin@ximian.com>
7711
7712         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7713         the spec here: the argument type must be convertible to the
7714         constraints.
7715
7716 2004-03-30  Martin Baulig  <martin@ximian.com>
7717
7718         * generic.cs
7719         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7720         TypeManager.AddTypeParameter().
7721         (ConstructedType.CheckConstraints): Re-enable this and actually
7722         check whether we have a constructor constraint.
7723
7724         * typemanager.cs
7725         (TypeManager.builder_to_type_param): New static field.
7726         (TypeManager.AddTypeParameter): New static method.
7727         (TypeManager.LookupTypeParameter): New public method.
7728
7729 2004-03-30  Martin Baulig  <martin@ximian.com>
7730
7731         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7732         the new API to actually define the constructor constraint.
7733
7734         * typemanager.cs
7735         (TypeManager.new_constraint_attr_type): New static field.
7736         (TypeManager.InitCoreTypes): Initialize it.
7737
7738 2004-03-30  Martin Baulig  <martin@ximian.com>
7739
7740         * generic.cs (Constraints): Completed error checking, use correct
7741         error numbers.
7742
7743 2004-03-29  Martin Baulig  <martin@ximian.com>
7744
7745         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7746
7747         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7748         public version which takes a `ParameterData pd' instead of an
7749         `ArrayList args'.
7750
7751 2004-03-29  Martin Baulig  <martin@ximian.com>
7752
7753         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7754         not a MethodInfo.       
7755
7756 2004-03-29  Martin Baulig  <martin@ximian.com>
7757
7758         * expression.cs (Argument.ResolveMethodGroup): If we're a
7759         ConstructedType, call GetMemberAccess() on it.  
7760
7761 2004-03-29  Martin Baulig  <martin@ximian.com>
7762
7763         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7764         (MethodCore.CheckGenericOverride): When overriding a generic
7765         method, check whether the constraints match.
7766
7767         * support.cs (GenericConstraints): New public interface.
7768         (ParameterData.GenericConstraints): New public method.
7769
7770         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7771         method parameter and compute our constraints if appropriate.
7772         (Parameter.GenericConstraints): New public property.
7773
7774         * generic.cs (Constraints): Implement GenericConstraints.
7775
7776 2004-03-29  Martin Baulig  <martin@ximian.com>
7777
7778         * decl.cs (MemberCache.FindMemberToOverride): Use
7779         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7780
7781 2004-03-29  Martin Baulig  <martin@ximian.com>
7782
7783         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7784
7785 2004-03-29  Martin Baulig  <martin@ximian.com>
7786
7787         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7788         not allowed on non-generic declarations").
7789
7790 2004-03-29  Martin Baulig  <martin@ximian.com>
7791
7792         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7793         public version of this method.
7794
7795         * class.cs (MethodCore.IsDuplicateImplementation): Use
7796         Invocation.InferTypeArguments() to check this.
7797
7798 2004-03-29  Martin Baulig  <martin@ximian.com>
7799
7800         * convert.cs: Use TypeManager.IsDelegateType() instead of
7801         comparing types correctly.
7802
7803 2004-03-29  Martin Baulig  <martin@ximian.com>
7804
7805         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7806         types directly to make it work for generic instances.
7807
7808         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7809
7810 2004-03-29  Martin Baulig  <martin@ximian.com>
7811
7812         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7813         support for arrays.     
7814
7815 2004-03-24  Martin Baulig  <martin@ximian.com>
7816
7817         * decl.cs (DeclSpace.FindType): Also use
7818         TypeManager.CheckGeneric() for types from the using clauses.
7819
7820 2004-03-23  Martin Baulig  <martin@ximian.com>
7821
7822         * expression.cs (Invocation.OverloadResolve): Added `bool
7823         may_fail' argument and use it instead of the Location.IsNull() hack.
7824
7825 2004-03-23  Martin Baulig  <martin@ximian.com>
7826
7827         * expression.cs (Invocation.InferType): Use correct type inference
7828         rules here.     
7829
7830 2004-03-23  Martin Baulig  <martin@ximian.com>
7831
7832         * ecore.cs (MethodGroupExpr.Name): Use
7833         TypeManager.CSharpSignature() instead of just the name.
7834
7835         * expression.cs (Invocation.OverloadResolve): Provide better error
7836         reporting.
7837         (Invocation.DoResolve): OverloadResolve() never returns null
7838         without reporting an error, so removed the error -6 reporting here.
7839
7840 2004-03-23  Martin Baulig  <martin@ximian.com>
7841
7842         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7843         generic methods.
7844
7845         * cs-parser.jay (delegate_declaration): Support generic delegates.
7846
7847         * delegate.cs: Support generic delegates.
7848
7849 2004-03-22  Martin Baulig  <martin@ximian.com>
7850
7851         * expression.cs (Invocation.InferParamsTypeArguments): New static
7852         method; does type inference for params arguments.
7853
7854 2004-03-21  Martin Baulig  <martin@ximian.com>
7855
7856         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7857         method; checks whether a method is a generic method.    
7858
7859         * expression.cs (Invocation.InferTypeArguments): New static method;
7860         infer type arguments for generic method invocation.
7861
7862         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7863         property; we set this to true if we're resolving a generic method
7864         invocation and the user specified type arguments, ie. we're not
7865         doing type inference.
7866
7867 2004-03-20  Martin Baulig  <martin@ximian.com>
7868
7869         * class.cs (MethodData.DeclaringType): New public property.
7870         (MethodData.Define): Set DeclaringType here.
7871         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7872         instead of OperatorMethodBuilder.DeclaringType.
7873
7874 2004-03-20  Martin Baulig  <martin@ximian.com>
7875
7876         * cs-tokenizer.cs (xtoken): Return a special
7877         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7878
7879         * cs-parser.jay (default_value_expression): Switch to the new
7880         syntax (14.5.13).
7881
7882 2004-03-19  Martin Baulig  <martin@ximian.com>
7883
7884         * decl.cs (MemberName): New class.  We use this to "construct"
7885         namespace_or_type_name's.
7886
7887         * generics.cs (TypeArguments.GetDeclarations): New public method;
7888         returns the type arguments as a string[] and reports a CS0081 if
7889         one of them is not an identifier.
7890
7891         * class.cs (MemberBase): The .ctor now takes the name as a
7892         MemberName instead of a string.
7893         (MemberBase.ExplicitInterfaceName): Changed type from string to
7894         Expression.
7895         (MemberBase.DoDefine): If we're an explicit implementation, the
7896         InterfaceType may be a generic instance.
7897
7898         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7899         (namespace_name): Call MemberName.GetName () to transform the
7900         MemberName into a string and ensure we don't have any type
7901         arguments.
7902         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7903         MemberName into an expression.
7904         (method_header): Use namespace_or_type_name instead of member_name.     
7905
7906 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7907
7908         * rootcontext.cs: Add new types to the boot resolution.
7909
7910         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7911         MulticastDelegate is not allowed.
7912
7913         * typemanager.cs: Add new types to lookup: System.TypedReference
7914         and ArgIterator.
7915
7916         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7917         check for TypedReference or ArgIterator, they are not allowed. 
7918
7919         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7920         makes us properly catch 1510 in some conditions (see bug 56016 for
7921         details). 
7922
7923 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7924
7925         * CryptoConvert.cs: update from corlib version
7926         with endian fixes.
7927
7928 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7929
7930         * class.cs (Indexer.Define): Check indexername declaration
7931
7932 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7933
7934         * attribute.cs (IsClsCompliant): Fixed problem with handling
7935         all three states (compliant, not-compliant, undetected).
7936
7937 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7938
7939         * attribute.cs (Attribute): Location is now public.
7940         (Resolve): Store resolved arguments (pos_values) in attribute class.
7941         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7942         (GetClsCompliantAttributeValue): New method that gets
7943         CLSCompliantAttribute value.
7944         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7945         if exists else null.
7946         (AttributeTester): New class for CLS-Compliant verification routines.
7947
7948         * class.cs (Emit): Add CLS-Compliant verification.
7949         (Method.GetSignatureForError): Implemented.
7950         (Constructor.GetSignatureForError): Implemented
7951         (Constructor.HasCompliantArgs): Returns if constructor has
7952         CLS-Compliant arguments.
7953         (Constructor.Emit): Override.
7954         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7955         is needed to test only parameters.
7956         (FieldBase.GetSignatureForError): Implemented.
7957         (TypeContainer): New member for storing base interfaces.
7958         (TypeContainer.FindMembers): Search in base interfaces too.
7959
7960         * codegen.cs (GetClsComplianceAttribute): New method that gets
7961         assembly or module CLSCompliantAttribute value.
7962         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7963         for assembly.
7964         (ModuleClass.Emit): Add error 3012 test.
7965
7966         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7967
7968         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7969         state for all decl types.
7970         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7971         if CLS-Compliant tests are required.
7972         (IsClsCompliaceRequired): New method. Analyze whether code
7973         must be CLS-Compliant.
7974         (IsExposedFromAssembly): New method. Returns true when MemberCore
7975         is exposed from assembly.
7976         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7977         value or gets cached value.
7978         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7979         is explicitly marked with CLSCompliantAttribute.
7980         (IsIdentifierClsCompliant): New abstract method. This method is
7981         used to testing error 3005.
7982         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7983         for identifier and parameters CLS-Compliant testing.
7984         (VerifyClsCompliance): New method. The main virtual method for
7985         CLS-Compliant verifications.
7986         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7987         null. I don't know why is null (too many public members !).
7988         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7989         and get value of first CLSCompliantAttribute that found.
7990
7991         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7992         (VerifyClsCompliance): Override and add extra tests.
7993
7994         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7995         clscheck- disable CLS-Compliant verification event if assembly is has
7996         CLSCompliantAttribute(true).
7997
7998         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7999         ApllyAttribute is now called in emit section as in the other cases.
8000         Possible future Emit integration.
8001         (IsIdentifierClsCompliant): New override.
8002         (VerifyClsCompliance): New override.
8003         (GetEnumeratorName): Returns full enum name.
8004
8005         * parameter.cs (GetSignatureForError): Implemented.
8006
8007         * report.cs (WarningData): New struct for Warning message information.
8008         (LocationOfPreviousError): New method.
8009         (Warning): New method. Reports warning based on the warning table.
8010         (Error_T): New method. Reports error based on the error table.
8011
8012         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8013         verifications are done here.
8014
8015         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8016
8017         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8018         CLSCompliantAttribute.
8019         (all_imported_types): New member holds all imported types from other
8020         assemblies.
8021         (LoadAllImportedTypes): New method fills static table with exported types
8022         from all referenced assemblies.
8023         (Modules): New property returns all assembly modules.
8024
8025 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8026
8027         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8028         throwing a parser error.
8029
8030         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8031         which removes the hardcoded get_/set_ prefixes for properties, as
8032         IL allows for the properties to be named something else.  
8033
8034         Bug #56013
8035
8036         * expression.cs: Do not override operand before we know if it is
8037         non-null.  Fix 56207
8038
8039 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8040
8041         * typemanager.cs: support for pinned variables.
8042
8043 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8044
8045         * decl.cs, typemanager.cs: Avoid using an arraylist
8046         as a buffer if there is only one result set.
8047
8048 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8049
8050         * expression.cs: Make sure you cant call a static method
8051         with an instance expression, bug #56174.
8052
8053 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8054
8055         * class.cs (IsDuplicateImplementation): Improve error reporting to
8056         flag 663 (method only differs in parameter modifier).
8057
8058         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8059         in preprocessor directives.
8060
8061         * location.cs (LookupFile): Allow for the empty path.
8062
8063         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8064         better approach for some of that patch, but its failing with the
8065         CharSet enumeration.  For now try/catch will do.
8066
8067         * typemanager.cs: Do not crash if a struct does not have fields.
8068         Fixes 56150.
8069
8070 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8071
8072         * expression.cs: cs0213, cant fix a fixed expression.
8073         fixes 50231.
8074
8075 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8076
8077         * cs-parser.jay: detect invalid embeded statements gracefully.
8078         bug #51113.
8079
8080 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8081
8082         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8083         As a regex:
8084         s/
8085         the invocation type may not be a subclass of the tye of the item/
8086         The type of the item must be a subclass of the invocation item.
8087         /g
8088
8089         Fixes bug #50820.
8090
8091 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8092
8093         * attribute.cs: Added methods to get a string and a bool from an
8094         attribute. Required to information from AssemblyKeyFileAttribute,
8095         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8096         * codegen.cs: Modified AssemblyName creation to include support for
8097         strongnames. Catch additional exceptions to report them as CS1548.
8098         * compiler.csproj: Updated include CryptoConvert.cs.
8099         * compiler.csproj.user: Removed file - user specific configuration.
8100         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8101         Mono.Security assembly. The original class is maintained and tested in
8102         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8103         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8104         like CSC 8.0 (C# v2) supports.
8105         * Makefile: Added CryptoConvert.cs to mcs sources.
8106         * rootcontext.cs: Added new options for strongnames.
8107
8108 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8109
8110         * driver.cs: For --expect-error, report error code `2'
8111         if the program compiled with no errors, error code `1' if
8112         it compiled with an error other than the one expected.
8113
8114 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8115
8116         * compiler.csproj: Updated for Visual Studio .NET 2003.
8117         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8118         * compiler.sln: Updated for Visual Studio .NET 2003.
8119
8120 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8121
8122         * expression.cs: Fix bug #47234. We basically need to apply the
8123         rule that we prefer the conversion of null to a reference type
8124         when faced with a conversion to 'object' (csc behaviour).
8125
8126 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8127
8128         * statement.cs: Shorter form for foreach, eliminates
8129         a local variable. r=Martin.
8130
8131 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8132
8133         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8134         checks if we can use brtrue/brfalse to test for 0.
8135         * expression.cs: use the above in the test for using brtrue/brfalse.
8136         cleanup code a bit.
8137
8138 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8139
8140         * expression.cs: Rewrite string concat stuff. Benefits:
8141
8142         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8143         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8144         rather than a concat chain.
8145
8146         * typemanager.cs: Add lookups for more concat overloads.
8147
8148 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8149
8150         * expression.cs: Emit shorter il code for array init.
8151
8152         newarr
8153         dup
8154         // set 1
8155
8156         // set 2
8157
8158         newarr
8159         stloc.x
8160
8161         ldloc.x
8162         // set 1
8163
8164         ldloc.x
8165         // set 2
8166
8167 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8168
8169         * statement.cs: Before, two switch blocks would be merged if the
8170         total size of the blocks (end_item - begin_item + 1) was less than
8171         two times the combined sizes of the blocks.
8172
8173         Now, it will only merge if after the merge at least half of the
8174         slots are filled.
8175
8176         fixes 55885.
8177
8178 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8179
8180         * class.cs : csc build fix for GetMethods(). See bug #52503.
8181
8182 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8183
8184         * expression.cs: Make sure fp comparisons work with NaN.
8185         This fixes bug #54303. Mig approved this patch a long
8186         time ago, but we were not able to test b/c the runtime
8187         had a related bug.
8188
8189 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8190
8191         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8192
8193 2004-03-19  Martin Baulig  <martin@ximian.com>
8194
8195         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8196         two overloads may unify for some type parameter substitutions and
8197         report a CS0408 if appropriate.
8198
8199 2004-03-19  Martin Baulig  <martin@ximian.com>
8200
8201         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8202         error here and not in our caller.
8203
8204 2004-03-19  Martin Baulig  <martin@ximian.com>
8205
8206         * interface.cs: Completely killed this file.
8207         (Interface): We're now a TypeContainer and live in class.cs.
8208
8209         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8210         argument; we're now also called for interfaces.
8211         (TypeContainer.DefineMembers): Allow this method being called
8212         multiple times.
8213         (TypeContainer.GetMethods): New public method; formerly known as
8214         Interface.GetMethod().  This is used by PendingImplementation.
8215         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8216         it's now private and non-static.
8217         (Interface): Moved this here; it's now implemented similar to
8218         Class and Struct.
8219         (Method, Property, Event, Indexer): Added `bool is_interface'
8220         argument to their .ctor's.
8221         (MemberBase.IsInterface): New public field.
8222
8223         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8224         instances instead of InterfaceMethod, InterfaceProperty, etc.
8225         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8226         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8227
8228 2004-03-19  Martin Baulig  <martin@ximian.com>
8229
8230         * class.cs (MethodCore.IsDuplicateImplementation): New private
8231         method which does the CS0111 checking.
8232         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8233         Use IsDuplicateImplementation().
8234
8235 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8236
8237         * decl.cs (FindMemberToOverride): New method to find the correct
8238         method or property to override in the base class.
8239         * class.cs
8240             - Make Method/Property use the above method to find the
8241               version in the base class.
8242             - Remove the InheritableMemberSignatureCompare as it is now
8243               dead code.
8244
8245         This patch makes large code bases much faster to compile, as it is
8246         O(n) rather than O(n^2) to do this validation.
8247
8248         Also, it fixes bug 52458 which is that nested classes are not
8249         taken into account when finding the base class member.
8250
8251         Reviewed/Approved by Martin.
8252
8253 2004-03-17  Martin Baulig  <martin@ximian.com>
8254
8255         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8256         of type arguments into account; use the `real_num_type_args'
8257         approach like in DoResolveAsTypeStep().
8258
8259         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8260         nested types.
8261
8262 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8263
8264         * interface.cs: In all interface classes removed redundant
8265         member initialization.
8266
8267 2004-03-16  Martin Baulig  <martin@ximian.com>
8268
8269         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8270
8271 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8272
8273         * decl.cs (DefineTypeAndParents): New helper method to define a
8274         type's containers before the type itself is defined;  This is a
8275         bug exposed by the recent changes to Windows.Forms when an
8276         implemented interface was defined inside a class that had not been
8277         built yet.   
8278
8279         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8280
8281         (Check): Loop correctly to report errors modifiers
8282         (UNSAFE was not in the loop, since it was the same as TOP).
8283
8284         * interface.cs: Every interface member now takes a ModFlags,
8285         instead of a "is_new" bool, which we set on the base MemberCore. 
8286
8287         Every place where we called "UnsafeOk" in the interface, now we
8288         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8289         the unsafe settings from the member declaration instead of the
8290         container interface. 
8291
8292         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8293
8294         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8295         `set_indexer_name' to the pending bits (one per type).
8296
8297         We fixed a bug today that was picking the wrong method to
8298         override, since for properties the existing InterfaceMethod code
8299         basically ignored the method name.  Now we make sure that the
8300         method name is one of the valid indexer names.
8301
8302 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8303  
8304         * support.cs (SeekableStreamReader): Keep track of stream byte
8305         positions and don't mix them with character offsets to the buffer.
8306
8307         Patch from Gustavo Giráldez
8308
8309 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8310
8311         * interface.cs (InterfaceSetGetBase): Removed double member
8312         initialization, base class does it as well.
8313
8314 2004-03-13  Martin Baulig  <martin@ximian.com>
8315
8316         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8317         when compiling corlib.
8318
8319 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8320
8321         * convert.cs (ExplicitConversion): We were reporting an error on
8322         certain conversions (object_type source to a value type, when the
8323         expression was `null') before we had a chance to pass it through
8324         the user defined conversions.
8325
8326         * driver.cs: Replace / and \ in resource specifications to dots.
8327         Fixes 50752
8328
8329         * class.cs: Add check for duplicate operators.  Fixes 52477
8330
8331 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8332
8333         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8334         that are in the middle of the statements, not only at the end.
8335         Fixes #54987
8336
8337         * class.cs (TypeContainer.AddField): No longer set the
8338         `HaveStaticConstructor' flag, now we call it
8339         `UserDefineStaticConstructor' to diferentiate the slightly
8340         semantic difference.
8341
8342         The situation is that we were not adding BeforeFieldInit (from
8343         Modifiers.TypeAttr) to classes that could have it.
8344         BeforeFieldInit should be set to classes that have no static
8345         constructor. 
8346
8347         See:
8348
8349         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8350
8351         And most importantly Zoltan's comment:
8352
8353         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8354
8355         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8356          before its static fields are used', i.e. initialization does not need
8357          to be triggered by the first access to the type. Setting this flag
8358          helps the JIT to compile better code, since it can run the static
8359          constructor at JIT time, and does not need to generate code to call it
8360          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8361          this flag for lots of classes like String. 
8362          
8363          csc sets this flag if the type does not have an explicit static 
8364          constructor. The reasoning seems to be that if there are only static
8365          initalizers for a type, and no static constructor, then the programmer
8366          does not care when this initialization happens, so beforefieldinit
8367          can be used.
8368          
8369          This bug prevents the AOT compiler from being usable, since it 
8370          generates so many calls to mono_runtime_class_init that the AOT code
8371          is much slower than the JITted code. The JITted code is faster, 
8372          because it does not generate these calls if the vtable is type is
8373          already initialized, which is true in the majority of cases. But the
8374          AOT compiler can't do this."
8375
8376 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8377
8378         * class.cs (MethodData.Emit): Refactor the code so symbolic
8379         information is generated for destructors;  For some reasons we
8380         were taking a code path that did not generate symbolic information
8381         before. 
8382
8383 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8384
8385         * class.cs: Create a Constructor.CheckBase method that
8386         takes care of all validation type code. The method
8387         contains some code that was moved from Define.
8388
8389         It also includes new code that checks for duplicate ctors.
8390         This fixes bug #55148.
8391
8392 2004-03-09  Joshua Tauberer <tauberer@for.net>
8393
8394         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8395         a { ... }-style array creation invokes EmitStaticInitializers
8396         which is not good for reference-type arrays.  String, decimal
8397         and now null constants (NullCast) are not counted toward
8398         static initializers.
8399
8400 2004-03-05  Martin Baulig  <martin@ximian.com>
8401
8402         * location.cs (SourceFile.HasLineDirective): New public field;
8403         specifies whether the file contains or is referenced by a "#line"
8404         directive.
8405         (Location.DefineSymbolDocuments): Ignore source files which
8406         either contain or are referenced by a "#line" directive.        
8407
8408 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8409
8410         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8411         direct access to our parent, so check the method inline there.
8412
8413 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8414
8415         * expression.cs (Invocation.EmitCall): Miguel's last commit
8416         caused a regression. If you had:
8417
8418             T t = null;
8419             t.Foo ();
8420
8421         In Foo the implict this would be null.
8422
8423 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * expression.cs (Invocation.EmitCall): If the method is not
8426         virtual, do not emit a CallVirt to it, use Call.
8427
8428         * typemanager.cs (GetFullNameSignature): Improve the method to
8429         cope with ".ctor" and replace it with the type name.
8430
8431         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8432         as an argument the ConstructorBuilder where it is being defined,
8433         to catch the recursive constructor invocations.
8434
8435 2004-03-16  Martin Baulig  <martin@ximian.com>
8436
8437         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8438         ConstructedType, call ResolveType() on it to get the type rather
8439         than just using `expr.Type'.
8440
8441 2004-03-16  Martin Baulig  <martin@ximian.com>
8442
8443         * generics.cs (ConstructedType.GetMemberAccess): Take the
8444         EmitContext instead on the TypeExpr and use
8445         ec.TypeContainer.CurrentType/ec.ContainerType.
8446
8447 2004-03-16  Martin Baulig  <martin@ximian.com>
8448
8449         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8450         parameters before aliases.
8451
8452 2004-03-16  Martin Baulig  <martin@ximian.com>
8453
8454         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8455         New oublic function; checks whether two generic instances may become
8456         equal under some instantiations (26.3.1).
8457
8458         * class.cs (TypeContainer.Define): Call
8459         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8460         error.
8461
8462 2004-03-16  Martin Baulig  <martin@ximian.com>
8463
8464         * class.cs (TypeContainer.GetClassBases): Moved
8465         Error_TypeParameterAsBase() here and also check whether the base
8466         class is not an attribute.
8467
8468 2004-03-16  Martin Baulig  <martin@ximian.com>
8469
8470         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8471
8472 2004-03-16  Martin Baulig  <martin@ximian.com>
8473
8474         * class.cs (Error_TypeParameterAsBase): Use correct error number
8475         here (CS0689).  
8476
8477 2004-03-16  Martin Baulig  <martin@ximian.com>
8478
8479         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8480         for generics.
8481
8482         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8483         error reporting.
8484
8485 2004-03-15  Martin Baulig  <martin@ximian.com>
8486
8487         * typemanager.cs (TypeManager.GetFullName): New public method.
8488         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8489         argument; only return members with the correct number of type
8490         arguments.
8491         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8492         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8493         whether the number of type arguments matches.
8494
8495         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8496         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8497
8498         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8499         field; it's set by the protected .ctor when we're actually a
8500         GenericMemberAccess.
8501         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8502         arguments and pass it to MemberLookupFinal ().
8503
8504         * ecore.cs (Expression.MemberLookup): Added `int
8505         num_type_arguments' argument; only return members with the correct
8506         number of type arguments.
8507         (Expression.MemberLookupFailed): Check whether the MemberLookup
8508         failed because we did not have the correct number of type
8509         arguments; report CS0305 in this case.
8510
8511         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8512         `e.ResolveAsTypeTerminal()' already did so.
8513
8514 2004-03-15  Martin Baulig  <martin@ximian.com>
8515
8516         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8517         we're a ConstructedType; in this case, the caller must report an
8518         error (for instance CS0131).
8519
8520         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8521         (TypeArguments.Resolve): Actually report errors here.
8522
8523 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8524
8525         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8526         `set_indexer_name' to the pending bits (one per type).
8527
8528         We fixed a bug today that was picking the wrong method to
8529         override, since for properties the existing InterfaceMethod code
8530         basically ignored the method name.  Now we make sure that the
8531         method name is one of the valid indexer names.
8532
8533 2004-03-15  Martin Baulig  <martin@ximian.com>
8534
8535         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8536         for generic instances.
8537
8538 2004-03-13  Martin Baulig  <martin@ximian.com>
8539
8540         * class.cs (TypeContainer.DefineType): Call
8541         TypeManager.AddUserType() immediately after creating the
8542         TypeBuilder; pass all type parameters when creating the
8543         CurrentType.
8544
8545         * decl.cs (DeclSpace.FindNestedType): New public method.
8546         (DeclSpace.FindType): Added `int num_type_args' argument; only
8547         return types with the correct number of type parameters.
8548         (DeclSpace.CountTypeParams): New public property.
8549
8550         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8551         the number of type parameters; defaults to zero.
8552
8553         * generic.cs (TypeArguments.Count): New public property.
8554         (ConstructedType.DoResolveAsTypeStep): First call
8555         ds.FindNestedType() to find out whether we're nested in the
8556         current generic type; in this case, we inherit all type parameters
8557         from the current class.
8558
8559         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8560         num_type_args' argument.
8561         (RootContext.LookupType): Added overloaded version which takes the
8562         number of type arguments; only return types with the correct
8563         number of type arguments.
8564
8565         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8566         checks whether `Type t' has `int num_type_args'.
8567
8568 2004-03-13  Martin Baulig  <martin@ximian.com>
8569
8570         * generic.cs (GenericMethod.DefineType): New method; calls
8571         DefineType() on all the type parameters.
8572
8573         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8574         (MethodData.Define): If we're a generic method, call
8575         GenericMethod.DefineType() to define the type parameters.       
8576
8577 2004-03-10  Martin Baulig  <martin@ximian.com>
8578
8579         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8580         instead of IsAssignableFrom.    
8581
8582 2004-03-10  Martin Baulig  <martin@ximian.com>
8583
8584         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8585
8586         * support.cs (ParameterData.HasArrayParameter): New property.
8587         (ReflectionParameters.ctor): Take a MethodBase instead of a
8588         ParameterInfo[].  If we have any type parameters, get the generic
8589         method definition and ask it whether we have variable arguments.
8590
8591 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8592
8593         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8594         routines to check if a type is an enumerable/enumerator allow
8595         classes that implement the IEnumerable or IEnumerator interfaces.
8596
8597         * class.cs (Property, Operator): Implement IIteratorContainer, and
8598         implement SetYields.
8599
8600         (Property.Define): Do the block swapping for get_methods in the
8601         context of iterators.   We need to check if Properties also
8602         include indexers or not.
8603
8604         (Operator): Assign the Block before invoking the
8605         OperatorMethod.Define, so we can trigger the Iterator code
8606         replacement. 
8607
8608         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8609         Property and Operator classes are not created when we parse the
8610         declarator but until we have the block completed, so we use a
8611         singleton SimpleIteratorContainer.Simple to flag whether the
8612         SetYields has been invoked.
8613
8614         We propagate this setting then to the Property or the Operator to
8615         allow the `yield' to function.
8616
8617 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8618
8619         * codegen.cs: Implemented attribute support for modules.
8620         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8621         Assembly/Module functionality.
8622
8623         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8624         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8625         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8626
8627 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8628
8629         * interface.cs (FindMembers): The operation is performed on all base
8630         interfaces and not only on the first. It is required for future CLS Compliance patch.
8631
8632 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8633
8634         * statement.cs, codegen.cs:
8635         This patch deals with patterns such as:
8636
8637         public class List : IEnumerable {
8638
8639                 public MyEnumerator GetEnumerator () {
8640                         return new MyEnumerator(this);
8641                 }
8642
8643                 IEnumerator IEnumerable.GetEnumerator () {
8644                         ...
8645                 }
8646                 
8647                 public struct MyEnumerator : IEnumerator {
8648                         ...
8649                 }
8650         }
8651
8652         Before, there were a few things we did wrong:
8653         1) we would emit callvirt on a struct, which is illegal
8654         2) we emited ldarg when we needed to emit ldarga
8655         3) we would mistakenly call the interface methods on an enumerator
8656         type that derived from IEnumerator and was in another assembly. For example:
8657
8658         public class MyEnumerator : IEnumerator
8659
8660         Would have the interface methods called, even if there were public impls of the
8661         method. In a struct, this lead to invalid IL code.
8662
8663 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8664
8665         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8666           renamed to Emit.
8667
8668         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8669
8670 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8671
8672         * cs-parser.jay: Fix small regression: we were not testing V2
8673         compiler features correctly.
8674
8675         * interface.cs: If the emit context is null, then create one
8676
8677 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8678
8679         * decl.cs (GetSignatureForError): New virtual method to get full name
8680           for error messages.
8681
8682         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8683           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8684
8685         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8686           Duplicated members and code in these classes has been removed.
8687           Better encapsulation in these classes.
8688
8689 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8690
8691         * assign.cs (Assign.DoResolve): When dealing with compound
8692         assignments, there is a new rule in ECMA C# 2.4 (might have been
8693         there before, but it is documented here) that states that in:
8694
8695         a op= b;
8696
8697         If b is of type int, and the `op' is a shift-operator, then the
8698         above is evaluated as:
8699
8700         a = (int) a op b 
8701
8702         * expression.cs (Binary.ResolveOperator): Instead of testing for
8703         int/uint/long/ulong, try to implicitly convert to any of those
8704         types and use that in pointer arithmetic.
8705
8706         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8707         method to print information for from the type, not from the
8708         null-method we were given.
8709
8710 2004-02-01  Duncan Mak  <duncan@ximian.com>
8711
8712         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8713         parsing for cmd, fixes bug #53694.
8714
8715 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8716
8717         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8718         in the member name duplication tests. Property and operator name duplication
8719         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8720
8721 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8722
8723         * interface.cs (PopulateMethod): Fixed crash when interface method
8724         returns not existing type (error test cs0246-3.cs).
8725
8726 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8727
8728         * cs-parser.jay (interface_accessors): Re-write actions to also
8729         store attributes attached to get and set methods. Fix spelling
8730         while at it.
8731
8732         (inteface_property_declaration): Modify accordingly.
8733
8734         (InterfaceAccessorInfo): New helper class to store information to pass
8735         around between rules that use interface_accessors.
8736
8737         * interface.cs (Emit): Apply attributes on the get and set
8738         accessors of properties and indexers too.
8739
8740         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8741         right MethodBuilder when applying attributes to the get and set accessors.
8742
8743 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8744
8745         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8746
8747 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8748
8749         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8750
8751 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8754         changes that treat `yield' specially when present before `break'
8755         or `return' tokens.
8756
8757         * cs-tokenizer.cs: yield is no longer a keyword.
8758
8759 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8760
8761         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8762         setting for default constructors.
8763         For default constructors are almost every time set wrong Modifier. The
8764         generated IL code has been alright. But inside mcs this values was
8765         wrong and this was reason why several of my CLS Compliance tests
8766         failed.
8767
8768 2004-02-27  Martin Baulig  <martin@ximian.com>
8769
8770         * generics.cs (ConstructedType.ResolveType): Make the nested type
8771         stuff actually work.
8772
8773 2004-02-25  Martin Baulig  <martin@ximian.com>
8774
8775         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8776         property; returns the type parameters just from the current type,
8777         ie. with the ones from outer classes.
8778         (DeclSpace.LookupGeneric): First search in the current class, then
8779         in outer classes.
8780         (DeclSpace.initialize_type_params): When hiding a type parameter
8781         from an outer class, put it into the `type_param_list' anyways.
8782
8783         * expression.cs (MemberAccess.expr): Made this field protected.
8784
8785         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8786         the type parameters from the current class.
8787
8788         * generic.cs (ConstructedType.ResolveType): Support nested generic
8789         types by taking the type parameters which we inherit from outer
8790         classes into account.
8791         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8792         support for nested generic types.
8793
8794 2004-02-23  Martin Baulig  <martin@ximian.com>
8795
8796         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8797         field and check whether we're nested inside a generic type.
8798         (DeclSpace.ResolveType): If we're resolving to a generic type
8799         definition, create a ConstructedType and return its resolved type.
8800         (DeclSpace.initialize_type_params): New private method;
8801         initializes the `type_param_list' field from the type parameters
8802         from this and all enclosing classes.
8803         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8804         we're already initialized.
8805
8806 2004-02-23  Martin Baulig  <martin@ximian.com>
8807
8808         * class.cs (Method.Define): Create the generic method before
8809         calling DoDefine().
8810         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8811         the TypeContainer one); we use this for generic methods.
8812
8813         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8814         parent's TypeBuilder.
8815
8816 2004-02-18  Martin Baulig  <martin@ximian.com>
8817
8818         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8819         to check for equality.
8820
8821 2004-02-05  Martin Baulig  <martin@ximian.com>
8822
8823         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8824         `ec.TypeContainer.CurrentType', use it instead of
8825         `ec.ContainerType' to check whether we're in the type's ctor.
8826
8827 2004-01-29  Martin Baulig  <martin@ximian.com>
8828
8829         * expression.cs (Invocation.DoResolve): If we're a
8830         `ConstructedType', then we're actually a generic method, so
8831         rewrite the expr as a GenericMemberAccess.
8832
8833         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8834         here; manually parse it into a string.
8835
8836 2004-01-28  Martin Baulig  <martin@ximian.com>
8837
8838         * typemanager.cs (TypeManager.IsEqual): New static method.
8839         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8840         check for equality instead of using `=='.
8841
8842 2004-01-26  Martin Baulig  <martin@ximian.com>
8843
8844         * decl.cs (DeclSpace.CurrentType): New public field.
8845
8846         * expression.cs (This.ResolveBase): If we have an
8847         `ec.TypeContainer.CurrentType', use it instead of
8848         `ec.ContainerType'.
8849
8850         * class.cs (TypeContainer.DefineType): If we're a generic type,
8851         create the `CurrentType' (unresolved).
8852         (TypeContainer.GenericType): New private field.
8853         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8854         it and store it in `GenericType' before creating the MemberCache.
8855         (TypeContainer.GetMembers): If we have a `GenericType', call
8856         TypeManager.FindMembers() on it.
8857
8858         * interface.cs (Interface.GenericType): New private field.
8859         (Interface.DefineType): If we're a generic type, create the
8860         `CurrentType' (unresolved).
8861         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8862         and store it in `GenericType' before creating the MemberCache.
8863         (Interface.GetMembers): If we have a `GenericType', call
8864         TypeManager.FindMembers() on it.
8865
8866 2004-01-22  Martin Baulig  <martin@ximian.com>
8867
8868         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8869         not a QualifiedIdentifier.  This is what `type_name_expression'
8870         was previously doing.
8871         (type_name_expression): Removed; the code is now in
8872         `namespace_or_type_name'.
8873         (qualified_identifier): Removed, use `namespace_or_type_name'
8874         instead.
8875         (QualifiedIdentifier): Removed this class.      
8876
8877 2004-01-22  Martin Baulig  <martin@ximian.com>
8878
8879         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8880         not a string as alias name.
8881
8882 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8883
8884         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8885         #52730 bug, and instead compute correctly the need to use a
8886         temporary variable when requesting an address based on the
8887         static/instace modified of the field and the constructor.
8888  
8889 2004-01-21  Martin Baulig  <martin@ximian.com>
8890
8891         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8892         class and namespace before looking up aliases.  Fixes #52517.
8893
8894 2004-01-21  Martin Baulig  <martin@ximian.com>
8895
8896         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8897         assinged in a 'try'; fixes exception4.cs.
8898
8899 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8900         * class.cs : Implemented parameter-less constructor for TypeContainer
8901
8902         * decl.cs: Attributes are now stored here. New property OptAttributes
8903
8904         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8905
8906         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8907
8908 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8909
8910         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8911           (CSharpSignature): New method for indexer and property signature.
8912
8913 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8914
8915         * pending.cs (IsVirtualFilter): Faster implementation.
8916
8917 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8918
8919         * typemanager.cs: Avoid inclusion of same assembly more than once.
8920
8921 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8922
8923         * cs-parser.jay: Fixed problem where the last assembly attribute
8924           has been applied also to following declaration (class, struct, etc.)
8925           
8926 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8927
8928         * class.cs: Added error CS0538, CS0539 reporting.
8929         Fixed crash on Microsoft runtime when field type is void.
8930
8931         * cs-parser.jay: Added error CS0537 reporting.
8932
8933         * pending.cs: Added error CS0535 reporting.
8934         Improved error report for errors CS0536, CS0534.
8935
8936 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8937
8938         Merge a few bits from the Anonymous Method MCS tree.
8939
8940         * statement.cs (ToplevelBlock): New class for toplevel methods,
8941         will hold anonymous methods, lifted variables.
8942
8943         * cs-parser.jay: Create toplevel blocks for delegates and for
8944         regular blocks of code. 
8945
8946 2004-01-20  Martin Baulig  <martin@ximian.com>
8947
8948         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8949         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8950         and `NeedExplicitReturn'; added `IsLastStatement'.
8951         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8952         have a `ReturnLabel' or we're not unreachable.
8953
8954         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8955         child's reachability; don't just override ours with it.  Fixes
8956         #58058 (lluis's example).
8957         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8958         InFinally(), InLoop(), InSwitch() and
8959         BreakCrossesTryCatchBoundary() methods.
8960
8961         * statement.cs (Return): Do all error checking in Resolve().
8962         Unless we are the last statement in a top-level block, always
8963         create a return label and jump to it.
8964         (Break, Continue): Do all error checking in Resolve(); also make
8965         sure we aren't leaving a `finally'.
8966         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8967         statement in a top-level block.
8968         (Block.Flags): Added `IsDestructor'.
8969         (Block.IsDestructor): New public property.
8970
8971 2004-01-20  Martin Baulig  <martin@ximian.com>
8972
8973         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8974
8975 2004-01-20  Martin Baulig  <martin@ximian.com>
8976
8977         * statement.cs (Statement.ResolveUnreachable): New public method.
8978         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8979         (Block.Resolve): Resolve unreachable statements.
8980
8981 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8982
8983         * expression.cs: We need to fix the case where we do
8984         not have a temp variable here.
8985
8986         * assign.cs: Only expression compound assignments need
8987         temporary variables.
8988
8989 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8990
8991         * flowanalysis.cs: Reduce memory allocation in a few ways:
8992           - A block with no variables should not allocate a bit
8993             vector for itself.
8994           - A method with no out parameters does not need any tracking
8995             for assignment of the parameters, so we need not allocate
8996             any data for it.
8997           - The arrays:
8998                 public readonly Type[] VariableTypes;
8999                 public readonly string[] VariableNames;
9000             Are redundant. The data is already stored in the variable
9001             map, so we need not allocate another array for it.
9002           - We need to add alot of checks for if (params | locals) == null
9003             due to the first two changes.
9004
9005 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9006
9007         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9008         implement IMemoryLocation, we store a copy on a local variable and
9009         take the address of it.  Patch from Benjamin Jemlich
9010
9011         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9012         to use a special "type_name_expression" rule which reduces the
9013         number of "QualifiedIdentifier" classes created, and instead
9014         directly creates MemberAccess expressions.
9015
9016 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9017
9018         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9019         that fixes #52853.  Null literal assignment to ValueType
9020
9021         * class.cs (MethodData.Emit): Instead of checking the name of the
9022         method to determine if its a destructor, create a new derived
9023         class from Method called Destructor, and test for that.  
9024
9025         * cs-parser.jay: Create a Destructor object instead of a Method.  
9026
9027         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9028
9029         Fixes: 52933
9030
9031 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9032
9033         * expression.cs (Binary.ResolveOperator): Perform an implicit
9034         conversion from MethodGroups to their delegate types on the
9035         Addition operation.
9036
9037         * delegate.cs: Introduce a new class DelegateCreation that is the
9038         base class for `NewDelegate' and `ImplicitDelegateCreation',
9039         factor some code in here.
9040
9041         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9042         conversion from MethodGroups to compatible delegate types. 
9043
9044         * ecore.cs (Expression.Resolve): Do not flag error 654
9045         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9046         we allow conversions from MethodGroups to delegate types now.
9047
9048         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9049         assignments in v2 either.
9050
9051 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9052
9053         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9054         static read-only fields in ctors.
9055
9056         Applied patch from Benjamin Jemlich 
9057
9058         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9059
9060 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9061
9062         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9063         here to return true, as they can be used like this:
9064
9065                 (XXX) int.MEMBER ()
9066
9067         Fixed 49836 and all the other dups
9068
9069 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9070
9071         * driver.cs: Implement /win32res and /win32icon.
9072
9073 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9074
9075         * cs-parser.jay: Add a rule to improve error handling for the
9076         common mistake of placing modifiers after the type.
9077
9078 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9079
9080         * cs-parser.jay (interface_event_declaration): Catch
9081         initialization of events on interfaces, and report cs0068
9082
9083         * cs-parser.jay (interface_event_declaration): Catch
9084         initialization of events. 
9085
9086         * ecore.cs: Better report missing constructors.
9087
9088         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9089         the error reporting done in the wrong place.  Fix.
9090
9091         * expression.cs (Binary.ResolveOperator): Catch the 
9092         operator + (E x, E y) error earlier, and later allow for implicit
9093         conversions in operator +/- (E e, U x) from U to the underlying
9094         type of E.
9095
9096         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9097         52596, if the container class is abstract, the default constructor
9098         is protected otherwise its public (before, we were always public).
9099
9100         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9101         fixed statement.
9102
9103         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9104         Jemlich that fixes bug #52597, MCS was generating invalid code for
9105         idisposable structs.   Thanks to Ben for following up with this
9106         bug as well.
9107
9108 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9109
9110         * driver.cs: Allow assemblies without code to be generated, fixes
9111         52230.
9112
9113 2004-01-07  Nick Drochak <ndrochak@gol.com>
9114
9115         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9116
9117 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9118
9119         * cs-parser.jay: Add rules to improve error reporting if fields or
9120         methods are declared at the namespace level (error 116)
9121
9122         * Add rules to catch event add/remove
9123
9124 2004-01-04  David Sheldon <dave-mono@earth.li>
9125
9126   * expression.cs: Added matching ")" to error message for 
9127   CS0077
9128
9129 2004-01-03 Todd Berman <tberman@gentoo.org>
9130
9131         * ecore.cs, attribute.cs:
9132         Applying fix from #52429.
9133
9134 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9135
9136         * ecore.cs, expression.cs, statement.cs:
9137         Total rewrite of how we handle branching. We
9138         now handle complex boolean expressions with fewer
9139         jumps. As well if (x == 0) no longer emits a ceq.
9140
9141         if (x is Foo) is much faster now, because we generate
9142         better code.
9143
9144         Overall, we get a pretty big improvement on our benchmark
9145         tests. The code we generate is smaller and more readable.
9146
9147         I did a full two-stage bootstrap. The patch was reviewed
9148         by Martin and Miguel.
9149
9150 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9151
9152         * cs-parser.jay: Make primary_expression not take a QI.
9153         we dont need this because the member_access rule covers
9154         us here. So we replace the rule with just IDENTIFIER.
9155
9156         This has two good effects. First, we remove a s/r conflict.
9157         Second, we allocate many fewer QualifiedIdentifier objects.
9158
9159 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9160
9161         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9162         set the correct information via SRE. This prevents
9163         hanging on the MS runtime. Fixes #29374.
9164
9165 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9166
9167         * convert.cs: correctly handle conversions to value types
9168         from Enum and ValueType as unboxing conversions.
9169
9170         Fixes bug #52569. Patch by Benjamin Jemlich.
9171
9172 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9173
9174         * expression.cs (BetterConversion): Prefer int -> uint
9175         over int -> ulong (csc's behaviour). This fixed bug #52046.
9176
9177 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9178
9179         * decl.cs (MemberCache.FindMembers): now returns a
9180         MemberInfo [].
9181
9182         * typemanager.cs: In general, go with with ^^.
9183         (CopyNewMethods): take an IList.
9184         (RealMemberLookup): Only allocate an arraylist
9185         if we copy from two sets of methods.
9186
9187         This change basically does two things:
9188         1) Fewer array lists allocated due to CopyNewMethods.
9189         2) the explicit cast in MemberList costed ALOT.
9190
9191 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9192
9193         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9194         a hashtable to avoid needless string allocations when an identifier is
9195         used more than once (the common case).
9196
9197 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9198
9199         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9200         is broken, it will not return anything. So, we
9201         have to use the information we have in mcs to
9202         do the task.
9203
9204         * typemanager.cs: Add a cache for GetInterfaces,
9205         since this will now be used more often (due to ^^)
9206
9207         (GetExplicitInterfaces) New method that gets the
9208         declared, not effective, interfaces on a type
9209         builder (eg, if you have interface IFoo, interface
9210         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9211         { IBar }.
9212
9213         This patch makes MCS able to bootstrap itself on
9214         Windows again.
9215
9216 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9217
9218         * expression.cs: Remove the Nop's that Miguel put
9219         in by mistake.
9220
9221 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9222
9223         * report.cs, codegen.cs: Give the real stack trace to
9224         the error when an exception is thrown.
9225
9226 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9227
9228         * decl.cs: only allocate hashtables for ifaces if 
9229         it is an iface!
9230
9231 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9232
9233         * expression.cs: fix the error from cs0121-2.cs
9234         (a parent interface has two child interfaces that
9235         have a function with the same name and 0 params
9236         and the function is called through the parent).
9237
9238 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9239
9240         * class.cs, rootcontext.cs, typmanager.cs: do not
9241         leak pointers.
9242
9243 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9244
9245         * codegen.cs: remove stack for the ec flow branching.
9246         It is already a linked list, so no need.
9247
9248 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9249
9250         * Makefile: Allow custom profiler here.
9251
9252 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9253
9254         * typemanager.cs (LookupType):
9255           - Use a static char [], because split takes
9256             a param array for args, so it was allocating
9257             every time.
9258           - Do not store true in a hashtable, it boxes.
9259
9260 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9261
9262         * flowanalysis.cs: bytify common enums.
9263
9264 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9265
9266         * modifiers.cs: Add a new set of flags for the
9267         flags allowed on explicit interface impls.
9268         * cs-parser.jay: catch the use of modifiers in
9269         interfaces correctly.
9270         * class.cs: catch private void IFoo.Blah ().
9271
9272         All related to bug #50572.
9273
9274 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9275
9276         * decl.cs: Rewrite the consistant accessability checking.
9277         Accessability is not linear, it must be implemented in
9278         a tableish way. Fixes #49704.
9279
9280 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9281
9282         * expression.cs: Handle negation in a checked context.
9283         We must use subtraction from zero. Fixes #38674.
9284
9285 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9286
9287         * class.cs: Ignore static void main in DLLs.
9288         * rootcontext.cs: Handle the target type here,
9289         since we are have to access it from class.cs
9290         * driver.cs: account for the above.
9291
9292 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9293
9294         * report.cs: Give line numbers and files if available.
9295
9296 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9297
9298         * driver.cs: Implement /addmodule.
9299
9300         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9301         ModuleBuilders.
9302
9303 2003-12-20  Martin Baulig  <martin@ximian.com>
9304
9305         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9306         (FieldBase.IsAssigned): Removed this field.
9307         (FieldBase.SetAssigned): New public method.
9308         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9309
9310 2003-12-20  Martin Baulig  <martin@ximian.com>
9311
9312         * expression.cs (LocalVariableReference.DoResolve): Don't set
9313         `vi.Used' if we're called from DoResolveLValue().
9314
9315         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9316         returns the usage vector it just merged into the current one -
9317         pass this one to UsageWarning().
9318         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9319         of the `EmitContext', don't call this recursively on our children.
9320
9321 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9322
9323         * driver.cs: Implement /target:module.
9324
9325 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9326
9327         * support.cs (CharArrayHashtable): New helper class.
9328
9329         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9330         char arrays, not strings, so we can avoid creating a string in
9331         consume_identifier if the identifier is a keyword.
9332
9333 2003-12-16  Martin Baulig  <martin@ximian.com>
9334
9335         * statement.cs (LocalInfo.Assigned): Removed this property.
9336         (LocalInfo.Flags): Removed `Assigned'.
9337         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9338         and uses flow analysis.
9339         (Block.UsageWarning): Made this method private.
9340         (Block.Resolve): Call UsageWarning() if appropriate.
9341
9342         * expression.cs (LocalVariableReference.DoResolve): Always set
9343         LocalInfo.Used here.
9344
9345 2003-12-13  Martin Baulig  <martin@ximian.com>
9346
9347         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9348         any value here; we're now using flow analysis to figure out
9349         whether a statement/block returns a value.
9350
9351 2003-12-13  Martin Baulig  <martin@ximian.com>
9352
9353         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9354         working again.
9355         (FlowBranching.MergeFinally): Don't call
9356         `branching.CheckOutParameters()' here, this is called in
9357         MergeTopBlock().
9358         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9359         when adding the `finally' vector.       
9360
9361 2003-12-13  Martin Baulig  <martin@ximian.com>
9362
9363         * flowanalysis.cs
9364         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9365         actually work and also fix #48962.
9366
9367 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9368
9369         * decl.cs: Do not check System.Object for nested types,
9370         since we know it does not have any. Big bang for buck:
9371
9372         BEFORE:
9373            Run 1:   8.35 seconds
9374            Run 2:   8.32 seconds
9375            corlib:  17.99 seconds
9376         AFTER:
9377            Run 1:   8.17 seconds
9378            Run 2:   8.17 seconds
9379            corlib:  17.39 seconds
9380
9381 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9382
9383         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9384         time we are returning 0 members, so we save alot here.
9385
9386 2003-12-11  Martin Baulig  <martin@ximian.com>
9387
9388         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9389         `MergeChild()', also just take the `FlowBranching' as argument;
9390         call Merge() on it and return the result.
9391         (FlowBranching.Merge): We don't need to do anything if we just
9392         have one sibling.
9393
9394 2003-12-11  Martin Baulig  <martin@ximian.com>
9395
9396         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9397         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9398         Maurer for this idea.
9399
9400 2003-12-11  Martin Baulig  <martin@ximian.com>
9401
9402         * flowanalysis.cs (MergeResult): This class is now gone; we now
9403         use the `UsageVector' for this.  The reason for this is that if a
9404         branching just has one sibling, we don't need to "merge" them at
9405         all - that's the next step to do.
9406         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9407         `MergeResult'.
9408
9409 2003-12-11  Martin Baulig  <martin@ximian.com>
9410
9411         Reworked flow analyis and made it more precise and bug-free.  The
9412         most important change is that we're now using a special `Reachability'
9413         class instead of having "magic" meanings of `FlowReturns'.  I'll
9414         do some more cleanups and optimizations and also add some more
9415         documentation this week.
9416
9417         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9418         largely reworked this class.
9419         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9420         the new `Reachability' class instead of having "magic" values here.
9421         (FlowBranching): We're now using an instance of `Reachability'
9422         instead of having separate `Returns', `Breaks' etc. fields.
9423
9424         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9425         based on flow analysis; ignore the return value of block.Emit ().
9426
9427 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9428
9429         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9430         if they are private.
9431
9432 2003-12-09  Martin Baulig  <martin@ximian.com>
9433
9434         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9435         call them directly on the UsageVector.
9436
9437 2003-12-09  Martin Baulig  <martin@ximian.com>
9438
9439         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9440         Changed return type from `FlowReturns' to `Reachability'.
9441
9442 2003-12-09  Martin Baulig  <martin@ximian.com>
9443
9444         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9445         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9446         `Reachable' fields with a single `Reachability' one.
9447
9448 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9449
9450         * class.cs (FindMembers): Remove foreach's.
9451
9452         Bootstrap times:
9453
9454         BEFORE
9455                 Run 1:   8.74 seconds
9456                 Run 2:   8.71 seconds
9457
9458         AFTER
9459                 Run 1:   8.64 seconds
9460                 Run 2:   8.58 seconds
9461
9462
9463 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9464
9465         * cs-parser.jay:
9466         * gen-treedump.cs:
9467         * statement.cs:
9468         This patch does a few things:
9469                 1. EmptyStatement is now a singleton, so it is never reallocated.
9470                 2. All blah is EmptyStatement constructs have been changed to
9471                    blah == EmptyStatement.Value, which is much faster and valid
9472                    now that EmptyStatement is a singleton.
9473                 3. When resolving a block, rather than allocating a new array for
9474                    the non-empty statements, empty statements are replaced with
9475                    EmptyStatement.Value
9476                 4. Some recursive functions have been made non-recursive.
9477         Mainly the performance impact is from (3), however (1) and (2) are needed for
9478         this to work. (4) does not make a big difference in normal situations, however
9479         it makes the profile look saner.
9480
9481         Bootstrap times:
9482
9483         BEFORE
9484         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9485         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9486         Total memory allocated: 56397 KB
9487
9488         AFTER
9489         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9490         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9491         Total memory allocated: 55666 KB
9492
9493 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9494
9495         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9496         than the hashtable in a hashtable version
9497
9498         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9499         we always end up concating a string. This results in a huge perf
9500         loss, because many strings have to be tracked by the GC. In this
9501         patch, we first use a hashtable that works with two keys, so that
9502         the strings do not need to be concat'ed.
9503
9504         Bootstrap times:
9505         BEFORE
9506                 Run 1:   8.74 seconds
9507                 Run 2:   8.71 seconds
9508
9509         AFTER
9510                 Run 1:   8.65 seconds
9511                 Run 2:   8.56 seconds
9512
9513 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9514
9515         * Makefile: Add a new target `do-time' that does a quick and simple
9516         profile, leaving easy to parse output.
9517
9518 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9519
9520         * codegen.cs (Init): Create the dynamic assembly with 
9521         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9522
9523 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9524
9525         * support.cs: Make the PtrHashtable use only one
9526         instance of its comparer.
9527
9528 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9529
9530         * typemanager.cs: Fix lookup of GetNamespaces.
9531
9532 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9533
9534         * expression.cs: Removed redundant line.
9535
9536         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9537         ArrayLists, use for loops with bounds.  
9538
9539         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9540         arraylist.
9541
9542         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9543         arraylists, use for loop with bounds.
9544
9545         The above three changes give us a 0.071 second performance
9546         improvement out of 3.294 seconds down to 3.223.  On my machine
9547         the above changes reduced the memory usage by 1,387 KB during
9548         compiler bootstrap.
9549
9550         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9551         QualifiedIdentifiers.  Before we created a new string through
9552         concatenation, and mostly later on, the result would be
9553         manipulated by DecomposeQI through string manipulation.
9554
9555         This reduced the compiler memory usage for bootstrapping from
9556         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9557         compile times in 0.05 seconds.
9558
9559 2003-11-28  Dick Porter  <dick@ximian.com>
9560
9561         * support.cs: Do string compares with the Invariant culture.
9562
9563         * rootcontext.cs: 
9564         * gen-treedump.cs: 
9565         * expression.cs: 
9566         * driver.cs: 
9567         * decl.cs: 
9568         * codegen.cs: 
9569         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9570         the comparison is done with the Invariant culture.
9571
9572 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9573
9574         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9575         GetEnumerator method.
9576
9577         (ProbeCollectionType): Iterate starting at the most specific type
9578         upwards looking for a GetEnumerator
9579
9580         * expression.cs: Shift count can be up to 31 for int/uint and 63
9581         for long/ulong.
9582
9583 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9584
9585         * statement.cs (Block.LookupLabel): Also look for the label on the
9586         children blocks.  Use a hash table to keep track of visited
9587         nodes. 
9588
9589         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9590         we actually did transform the other operand, otherwise fall back
9591         to the common codepath that casts to long.
9592
9593         * cs-tokenizer.cs: Use the same code pattern as the int case.
9594         Maybe I should do the parsing myself, and avoid depending on the
9595         Parse routines to get this done.
9596
9597 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9600         which fixes bug 51347.  This time test it.
9601
9602         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9603         attributes for example can not tell the difference between these.
9604         The difference was only a syntax feature of the language. 
9605
9606         * attribute.cs: Apply attributes to delegates.
9607
9608         * delegate.cs: Call the apply attributes method.
9609
9610 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9611
9612         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9613         comparing 0 vs Byte.MinValue, not the value
9614
9615         (ImplicitConversionRequired): When reporting a conversion error,
9616         use error 31 to print out the constant error instead of the
9617         simpler 29.
9618
9619         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9620         which fixes bug 51347.
9621
9622 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9623
9624         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9625         which fixes the -warnaserror command line option.
9626
9627 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * cfold.cs (DoNumericPromotions): During constant folding of
9630         additions on UIntConstant, special case intconstants with
9631         IntConstants like we do on the expression binary operator. 
9632
9633 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * convert.cs (ImplicitReferenceConversion): We were missing a case
9636         (System.Enum are not value types or class types, so we need to
9637         classify them separatedly).
9638
9639         * driver.cs: We do not support error 2007.
9640
9641 2003-11-12 Jackson Harper <jackson@ximian.com>
9642
9643         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9644         system directory. Also use the full file name so users can
9645         libraries names mscorlib-o-tron.dll in a non system dir.
9646         
9647 2004-01-04  David Sheldon <dave-mono@earth.li>
9648
9649         * expression.cs: Added matching ")" to error message for CS0077.
9650
9651 2003-12-19  Martin Baulig  <martin@ximian.com>
9652
9653         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9654         static method; see documentation in the method.
9655         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9656
9657         * convert.cs (Convert.ImplicitReferenceConversion,
9658         Convert.ImplicitReferenceConversionExists): Add support for
9659         generic type declarations; see gen-36.cs.
9660
9661 2003-12-19  Martin Baulig  <martin@ximian.com>
9662
9663         * pending.cs (Pending.InterfaceMethod): Use
9664         `Type.IsAssignableFrom()' instead of `=='.
9665
9666 2003-12-18  Martin Baulig  <martin@ximian.com>
9667
9668         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9669         byref types first.
9670
9671         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9672         `expr_type.Equals (target_type)' instead of `=='.
9673
9674 2003-12-08  Martin Baulig  <martin@ximian.com>
9675
9676         * generics.cs (Constraints.Types): Removed.
9677         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9678         to Type's.
9679         (Constraints.ResolveTypes): New public method; resolves the
9680         TypeExpr's to Type's.
9681         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9682         longer takes the constraints.
9683         (TypeParameter.DefineMethod): Likewise.
9684         (TypeParameter.DefineType): New public method.  Calls
9685         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9686         the constraints.
9687
9688 2003-12-08  Martin Baulig  <martin@ximian.com>
9689
9690         * convert.cs (Convert.ImplicitConversionStandard): Use
9691         `expr_type.Equals (target_type)' instead of `=='.
9692
9693 2003-12-08  Martin Baulig  <martin@ximian.com>
9694
9695         * typemanager.cs (TypeManager.GetReferenceType): Call
9696         `Type.MakeByRefType ()'.
9697
9698 2003-12-08  Martin Baulig  <martin@ximian.com>
9699
9700         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9701         just has some special meaning in some situations.  For instance,
9702         it is allowed to use `where' as the name of a variable etc.
9703
9704 2003-12-04  Martin Baulig  <martin@ximian.com>
9705
9706         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9707         `Type.MakeArrayType()' for array types.
9708
9709 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9710
9711         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9712         debugging message.
9713
9714         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9715         corlib to compile.
9716
9717 2003-11-16  Martin Baulig  <martin@ximian.com>
9718
9719         * codegen.cs (EmitContext.IsGeneric): Removed.
9720
9721         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9722         ResolveGeneric() on the DeclSpace.
9723
9724 2003-11-16  Martin Baulig  <martin@ximian.com>
9725
9726         * generic.cs (TypeArguments.Resolve):
9727         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9728         `ResolveType()' on it to get the Type.
9729
9730 2003-11-15  Martin Baulig  <martin@ximian.com>
9731
9732         * generic.cs (ConstructedType.GetInterfaces): Override this.
9733
9734 2003-11-14  Martin Baulig  <martin@ximian.com>
9735
9736         * interface.cs (Interface.DefineType): Define all type parameters
9737         before adding the interfaces we inherit.
9738
9739 2003-11-11  Martin Baulig  <martin@ximian.com>
9740
9741         * generic.cs (ConstructedType.ResolveType): Always call
9742         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9743
9744 2003-11-10  Martin Baulig  <martin@ximian.com>
9745
9746         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9747         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9748         calling `ResolveType()' on them, directly assign their `Type'.
9749
9750 2003-11-08  Martin Baulig  <martin@ximian.com>
9751
9752         * generic.cs (ConstructedType): Override `IsClass' etc.
9753
9754 2003-11-08  Martin Baulig  <martin@ximian.com>
9755
9756         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9757         return value and the `out parent' parameter.
9758         (TypeContainer.DefineType): Moved the CS0644 check into
9759         GetClassBases().  Don't pass the interface types to the
9760         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9761         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9762
9763         * ecore.cs (TypeExpr.IsAttribute): New property.
9764         (TypeExpr.GetInterfaces): New method.
9765
9766         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9767         TypeExpr instead of a Type.
9768         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9769         (Interface.DefineType): Don't pass the interface types to the
9770         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9771         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9772
9773         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9774         instead of a `Type[]'.
9775         (TypeManager.RegisterBuilder): Likewise.
9776         (TypeManager.AddUserInterface): Likewise.
9777         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9778         `Type[]' and also return a `TypeExpr[]'.
9779         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9780
9781 2003-11-08  Martin Baulig  <martin@ximian.com>
9782
9783         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9784         Expression.     
9785
9786 2003-11-08  Martin Baulig  <martin@ximian.com>
9787
9788         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9789         TypeManager.ResolveExpressionTypes().
9790
9791         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9792         instead of an Expression.
9793         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9794         (TypeExpression): New public class; formerly known as `TypeExpr'.
9795
9796         * expression.cs (ComposedCast): Derive from TypeExpr.
9797
9798         * typemanager.cs (TypeManager.system_*_expr): These are now
9799         TypExpr's instead of Expression's.
9800         (TypeManager.ResolveExpressionTypes): New public static function;
9801         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9802         of them.        
9803
9804 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9805
9806         * expression.cs (New.DoResolve): Do not dereference value that
9807         might be a null return.
9808
9809         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9810         sure that the constant value has the right type.  Fixes an
9811         unreported bug, similar to 50425.
9812
9813         * const.cs (Const.LookupConstantValue): Call
9814         ImplicitStandardConversionExists before doing a conversion to
9815         avoid havng the TypeManager.ChangeType do conversions.
9816
9817         Reduced the number of casts used
9818
9819         (Const.ChangeType): New routine to enable reuse of the constant
9820         type changing code from statement.
9821
9822         * typemanager.cs (ChangeType): Move common initialization to
9823         static global variables.
9824
9825         Fixes #50425.
9826
9827         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9828         every value type to go through, even if it was void.  Fix that. 
9829
9830         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9831         character of the define, and the is_identifier_part_character for
9832         the rest of the string.
9833
9834 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9835
9836         * expression.cs (UnaryMutator.EmitCode): When I updated
9837         LocalVariableReference.DoResolve, I overdid it, and dropped an
9838         optimization done on local variable references.
9839
9840 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9841
9842         * ecore.cs: Convert the return from Ldlen into an int.
9843
9844 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9847         the accessibility, this is a special case for toplevel non-public
9848         classes (internal for instance).
9849
9850 2003-10-20  Nick Drochak <ndrochak@gol.com>
9851
9852         * ecore.cs: Fix typo and build.  Needed another right paren.
9853
9854 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9855
9856         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9857         `internal' case regular and protected, but not allowing protected
9858         to be evaluated later.  Bug 49840
9859
9860 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9861
9862         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9863         to kb.Nlast, and not the kb.nFirst to isolate the switch
9864         statement.
9865
9866         Extract the underlying type, so enumerations of long/ulong are
9867         treated like long/ulong.
9868
9869 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9870
9871         * expression.cs (New): Overload the meaning of RequestedType to
9872         track the possible creation of the NewDelegate type, since
9873         DoResolve is invoked more than once for new constructors on field
9874         initialization.
9875
9876         See bugs: #48800 and #37014
9877
9878         * cs-parser.jay (declare_local_constants): Take an arraylist
9879         instead of a single constant.
9880
9881         (local_constant_declaration): It should take a
9882         constant_declarators, not a constant_declarator.  Fixes 49487
9883
9884         * convert.cs: Fix error report.
9885
9886 2003-10-13 Jackson Harper <jackson@ximian.com>
9887
9888         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9889         bug #49611
9890         
9891 2003-11-03  Martin Baulig  <martin@ximian.com>
9892
9893         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9894         `out bool has_type_arg'; if set, we need to pass the type to
9895         ig.Emit().
9896         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9897         Stelem_Any/Ldelem_Any for generic parameters.   
9898
9899 2003-11-02  Martin Baulig  <martin@ximian.com>
9900
9901         * expression.cs (Invocation.EmitCall): Use
9902         `TypeManager.IsValueType()' to check whether it's a value type.
9903         Don't set `struct_call' when calling a method on a type parameter.
9904
9905 2003-11-02  Martin Baulig  <martin@ximian.com>
9906
9907         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9908         and removed the TypeBuilder argument.
9909
9910         * typemanager.cs (TypeManager.IsValueType): Return
9911         `t.IsGenericParameter || t.IsValueType'.
9912
9913 2003-10-25  Martin Baulig  <martin@ximian.com>
9914
9915         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9916         call ConstructedType.Resolve() on it.
9917
9918         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9919
9920 2003-10-25  Martin Baulig  <martin@ximian.com>
9921
9922         * class.cs (TypeContainer.GetClassBases): Changed
9923         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9924         CS8214 reporting here.
9925         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9926         instead of a `Type' for our parent.  In case of a recursive
9927         declaration (see tests/gen-23.cs for an example), our parent is a
9928         ConstructedType and it doesn't have its type set.  So, first
9929         create our own TypeBuilder, then call constructed.Resolve() to get
9930         the parent's type and finally TypeBuilder.SetParent() it.
9931
9932         * ecore.cs (TypeExpr.Name): New public virtual property.
9933
9934         * generic.cs
9935         (ConstructedType): We're now a TypeExpr and not just an Expression.
9936         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9937         arguments here; this is done later.
9938         (ConstructedType.Resolve): New public method to resolve the type
9939         arguments and bind them.
9940
9941 2003-10-21  Martin Baulig  <martin@ximian.com>
9942
9943         * convert.cs: Use `TypeManager.IsValueType' instead of
9944         'type.IsValueType' everywhere.
9945
9946         * typemanager.cs (TypeManager.IsValueType): Return true for type
9947         parameters.  The reason for this is that we need to box a type
9948         parameter when converting it to a reference type.
9949
9950         * cs-parser.jay: Added support for default value expressions.
9951
9952         * generics.cs (DefaultValueExpression): New public class.       
9953
9954 2003-10-17  Martin Baulig  <martin@ximian.com>
9955
9956         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9957         TypeContainer so we can also use this for Interfaces.
9958         (TypeParameter.Resolve): Likewise.
9959
9960         * interface.cs (Interface.DefineType): Added support for generic
9961         interfaces.
9962
9963         * cs-parser.jay: Added support for generic structs and interfaces.
9964
9965 2003-10-17  Martin Baulig  <martin@ximian.com>
9966
9967         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9968         call generic methods :-)
9969
9970 2003-10-16  Martin Baulig  <martin@ximian.com>
9971
9972         * cs-parser.jay (namespace_or_type_name): Only create a
9973         GenericMemberAccess if we actually have type arguments.
9974
9975 2003-10-13  Martin Baulig  <martin@ximian.com>
9976
9977         * class.cs (Method.Define): If we're a generic method, call
9978         TypeBuilder.DefineGenericMethod () before resolving
9979         the parameters.
9980         (MethodData): Added .ctor which takes an additional MethodBuilder
9981         argument; this is used for generic methods.
9982         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9983         we already have a MethodBuilder.
9984
9985 2003-10-10  Martin Baulig  <martin@ximian.com>
9986
9987         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9988         instead of a `DeclSpace'.  This is used for generic methods.
9989
9990         * cs-parser.jay (method_header): Added support for generic
9991         methods; create a `GenericMethod' instance and pass it to the
9992         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9993         parameters and locals.
9994
9995         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9996         since we already have the location.  Check whether we're a generic
9997         type declaration or a generic method and create the correct type
9998         parameter.
9999
10000         * generic.cs (TypeParameter.DefineMethod): New public method.
10001         (GenericMethod): New public class; derives from DeclSpace and is
10002         used for generic methods.       
10003
10004 2003-10-09  Martin Baulig  <martin@ximian.com>
10005
10006         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10007         to the .ctor.
10008         (MethodCore.DoDefineParameters): Removed the TypeContainer
10009         argument; use the DeclSpace which was passed to the .ctor instead.
10010         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10011         TypeContainer; we only need a DeclSpace here.
10012
10013 2003-10-09  Martin Baulig  <martin@ximian.com>
10014
10015         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10016         to the .ctor.
10017         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10018         EmitContext's .ctor.    
10019
10020 2003-10-09  Martin Baulig  <martin@ximian.com>
10021
10022         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10023         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10024         AsAccessible(), moved them as well.
10025
10026         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10027
10028 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10029
10030         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10031         generation for >=, as spotted by Paolo, bug 48679.  
10032         Patch from David Waite.
10033
10034         * cs-tokenizer.cs: Add handling for #pragma.
10035
10036         * cs-parser.jay: Allow for both yield and yield return in the
10037         syntax.  The anti-cobolization of C# fight will go on!
10038
10039         * class.cs (TypeBuilder.DefineType): Catch error condition here
10040         (Parent.DefineType erroring out and returning null).
10041
10042         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10043         coping with enumerations variables, we were mistakenly processing
10044         them as a regular value type instead of built-in types.  Fixes the
10045         bug #48063
10046
10047         * typemanager.cs (IsBuiltinOrEnum): New method.
10048
10049 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10050
10051         * cs-parser.jay: Upgrade: yield now needs the return clause.
10052
10053 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10054
10055         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10056
10057 2003-09-29  Martin Baulig  <martin@ximian.com>
10058
10059         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10060         inflated generic methods.
10061
10062         * generics.cs (ConstructedType): Distinguish between open and
10063         closed constructed types; correctly resolve the arguments.
10064
10065 2003-09-22  Martin Baulig  <martin@ximian.com>
10066
10067         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10068         all type arguments meet their constraints.
10069
10070 2003-09-19  Martin Baulig  <martin@ximian.com>
10071
10072         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10073         `MemberCache parent' argument.  Normally, an interface doesn't
10074         have a parent type except System.Object, but we use this in gmcs
10075         for generic type parameters.
10076
10077 2003-09-18  Martin Baulig  <martin@ximian.com>
10078
10079         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10080         on `type.IsInterface'; don't check whether the type has a parent
10081         to determine whether it's an interface.
10082
10083 2003-09-17  Martin Baulig  <martin@ximian.com>
10084
10085         * generic.cs (ConstructedType.ToString): Always use `name' as the
10086         type name.
10087
10088 2003-09-15  Martin Baulig  <martin@ximian.com>
10089
10090         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10091
10092         * generic.cs (Constraints.Resolve): New public method; this is
10093         called to resolve the constraint types and to check whether all
10094         the constraints are correct.
10095         (Constraints.Types): New public property.
10096         (TypeParameter.Resolve): New public method; resolves all the
10097         type's constraints.
10098
10099         * class.cs (TypeContainer.DefineType): Call
10100         TypeParameter.Resolve() before actually defining the type.
10101
10102 2003-09-15  Martin Baulig  <martin@ximian.com>
10103
10104         * class.cs (TypeContainer.DefineType): Added an error flag to
10105         avoid reporting duplicate CS0146's ("class definition is
10106         circular.").
10107
10108         * driver.cs (Driver.MainDriver): Abort if
10109         RootContext.ResolveTree() reported any errors.
10110
10111 2003-09-07  Martin Baulig  <martin@ximian.com>
10112
10113         * report.cs (Error, Warning): Added overloaded versions which take
10114         a `params object[] args' and call String.Format().
10115
10116 2003-09-07  Martin Baulig  <martin@ximian.com>
10117
10118         * decl.cs (DeclSpace..ctor): Don't call
10119         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10120         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10121         (DeclSpace.RecordDecl): New method.
10122
10123         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10124
10125 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10126
10127         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10128         value attributes to be applied to ParameterBuilders.
10129
10130         * class.cs (MethodCore.LabelParameters): Make static and more
10131         generic so that it can be used from other places - like interface
10132         methods, for instance.
10133
10134         * interface.cs (Interface.Emit): Call LabelParameters before
10135         emitting attributes on the InterfaceMethod.
10136
10137 2003-09-07  Martin Baulig  <martin@ximian.com>
10138
10139         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10140         if the number of type parameters doesn't match.
10141
10142 2003-09-04  Martin Baulig  <martin@ximian.com>
10143
10144         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10145         for arrays of generic type params (ie. `!0[]').
10146
10147 2003-09-04  Martin Baulig  <martin@ximian.com>
10148
10149         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10150         for the moment.
10151
10152 2003-09-04  Martin Baulig  <martin@ximian.com>
10153
10154         * decl.cs (DeclSpace.LookupGeneric): New method.
10155         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10156         moment.
10157
10158         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10159         argument, not just a string.
10160         (TypeParameter.Define): New public method; this is called to
10161         actually define the generic parameter; after this, you can use the
10162         new `Type' property to get the type.
10163
10164 2003-09-04  Martin Baulig  <martin@ximian.com>
10165
10166         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10167         is now an ArrayList; initialize the result of the `TypeParameters'
10168         property here.
10169         (DeclSpace.GetGenericData): Removed.
10170         (DeclSpace.LookupGeneric): Temporarily removed; we need to
10171         implement this in a different way.
10172         (DeclSpace.GetTypeParameters): Removed; there's now a
10173         `TypeParameters' property.
10174         (DeclSpace.TypeParameters): New public property.
10175
10176         * generic.cs (Constraints): Make this class public.
10177         (TypeParameter): New public class.
10178
10179 2003-09-04  Martin Baulig  <martin@ximian.com>
10180
10181         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10182         generic parameters.
10183
10184         * class.cs (TypeContainer.DefineType): Call
10185         TypeBuilder.DefineGenericParameter () on all generic parameters if
10186         this is a generic type.
10187
10188 2003-08-28  Martin Baulig  <martin@ximian.com>
10189
10190         * sample-stack.il: Compile this with ilasm: "ilasm /dll
10191         sample-stack.il".
10192
10193         * sample-hello.cs: Compile this with gmcs: "gmcs
10194         /r:sample-stack.dll sample-hello.cs".
10195
10196 2003-08-28  Martin Baulig  <martin@ximian.com>
10197
10198         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10199         the parameters to the generic type.
10200
10201 2003-08-28  Martin Baulig  <martin@ximian.com>
10202
10203         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10204
10205 2003-08-28  Martin Baulig  <martin@ximian.com>
10206
10207         * cs-parser.jay (opt_type_argument_list): Use
10208         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10209         (primary_expression): Replace `qualified_identifier' with `type_name'.
10210         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10211
10212         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10213         parser to check whether it is syntactically a type parameter list;
10214         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10215         this case.
10216
10217 2003-08-26  Martin Baulig  <martin@ximian.com>
10218
10219         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10220         resolving aliases; fixes #47927.
10221
10222 2003-08-26  Martin Baulig  <martin@ximian.com>
10223
10224         * statement.cs (Using.DoResolve): This is internally emitting a
10225         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10226         do not always return.  Fixes #47681.
10227
10228 2003-08-26  Martin Baulig  <martin@ximian.com>
10229
10230         * decl.cs (MemberCore): Moved WarningNotHiding(),
10231         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10232         into MemberBase.
10233         (AdditionResult): Make this nested in DeclSpace.
10234         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10235         argument; call NamespaceEntry.Define() unless we're nested in a
10236         class or struct.
10237
10238         * namespace.cs (Namespace.DefineName): New public function.  This
10239         is called from DeclSpace's .ctor to add 
10240         (Namespace.Lookup): Include DeclSpaces in the lookup.
10241
10242         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10243
10244         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10245
10246 2003-08-25  Martin Baulig  <martin@ximian.com>
10247
10248         * convert.cs (Convert.ExplicitReferenceConversion): When
10249         converting from an interface type to a class, unbox if the target
10250         type is a struct type.  Fixes #47822.
10251
10252 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10253
10254         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10255         #47854.
10256
10257 2003-08-22  Martin Baulig  <martin@ximian.com>
10258
10259         * class.cs (TypeManager.DefineType): When defining a nested type,
10260         call DefineType() on our parent; fixes #47801.
10261
10262 2003-08-22  Martin Baulig  <martin@ximian.com>
10263
10264         * class.cs (MethodData.Define): While checking if a method is an
10265         interface implementation, improve the test a bit more to fix #47654.
10266
10267 2003-08-22  Martin Baulig  <martin@ximian.com>
10268
10269         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10270         correctly; fixes #47722.
10271
10272 2003-08-22  Martin Baulig  <martin@ximian.com>
10273
10274         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10275         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10276
10277         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10278
10279 2003-08-22  Martin Baulig  <martin@ximian.com>
10280
10281         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10282         can only be assigned in static constructors.  Fixes #47161.
10283
10284 2003-08-22  Martin Baulig  <martin@ximian.com>
10285
10286         Rewrote and improved the flow analysis code.
10287
10288         * flowbranching.cs (FlowBranching): Make this class abstract.
10289         (FlowBranching.CreateBranching): New static function to create a
10290         new flow branching.
10291         (FlowBranchingBlock, FlowBranchingException): New classes.
10292         (FlowBranching.UsageVector.Type): New public readonly field.
10293         (FlowBranching.UsageVector.Breaks): Removed the setter.
10294         (FlowBranching.UsageVector.Returns): Removed the setter.
10295         (FlowBranching.UsageVector): Added Break(), Return(),
10296         NeverReachable() and Throw() methods to modify the reachability.
10297         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10298         done by FlowBranching.Merge().
10299         (FlowBranching.UsageVector.MergeChild): New method; merges the
10300         merge result into the current vector.
10301         (FlowBranching.Merge): New abstract method to merge a branching.
10302
10303 2003-08-12  Martin Baulig  <martin@ximian.com>
10304
10305         * expression.cs (Indirection.CacheTemporaries): Create the
10306         LocalTemporary with the pointer type, not its element type.
10307
10308 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10309
10310         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10311         token was a keyword or not.
10312
10313         Add `error' options where an IDENTIFIER was expected;  Provide
10314         CheckToken and CheckIdentifierToken convenience error reporting
10315         functions. 
10316
10317         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10318
10319         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10320         NameSpaceEntry NameSpaceEntry.
10321
10322         (LookupInterfaceOrClass): Avoid creating a full qualified name
10323         from namespace and name: avoid doing lookups when we know the
10324         namespace is non-existant.   Use new Tree.LookupByNamespace which
10325         looks up DeclSpaces based on their namespace, name pair.
10326
10327         * driver.cs: Provide a new `parser verbose' to display the
10328         exception thrown during parsing.  This is turned off by default
10329         now, so the output of a failure from mcs is more graceful.
10330
10331         * namespace.cs: Track all the namespaces defined in a hashtable
10332         for quick lookup.
10333
10334         (IsNamespace): New method
10335
10336 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10337
10338         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10339         we know that we need to concatenate (full typename can never be
10340         null). 
10341
10342         * class.cs: ditto.
10343
10344         * statement.cs: Use a bitfield;  Do not initialize to null things
10345         which are done by the constructor by default.
10346
10347         * cs-parser.jay: bug fix, parameter was 4, not 3.
10348
10349         * expression.cs: Just use the property;
10350
10351         * statement.cs: No need for GetVariableInfo method.
10352
10353 2003-08-08  Martin Baulig  <martin@ximian.com>
10354
10355         * flowanalysis.cs (FlowReturns): This is now nested in the
10356         `FlowBranching' class.
10357         (MyBitVector): Moved this here from statement.cs.
10358         (FlowBranching.SiblingType): New enum type.
10359         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10360
10361 2003-08-07  Martin Baulig  <martin@ximian.com>
10362
10363         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10364         `FlowBranching' class and called `BranchingType'.
10365
10366 2003-08-07  Martin Baulig  <martin@ximian.com>
10367
10368         * flowanalysis.cs: Moved all the control flow analysis code into
10369         its own file.
10370
10371 2003-08-07  Martin Baulig  <martin@ximian.com>
10372
10373         * assign.cs (Assign.DoResolve): `target' must either be an
10374         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10375         #37319.
10376
10377 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * expression.cs (BinaryMethod): This kind of expression is created by the
10380         Binary class if it determines that the operator has to be handled
10381         by a method.
10382
10383         (BinaryDelegate): This kind of expression is created if we are
10384         dealing with a + or - operator on delegates.
10385
10386         (Binary): remove method, argumetns, and DelegateOperator: when
10387         dealing with methods, 
10388
10389         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10390
10391         * statement.cs (Block): use bitfields for the three extra booleans
10392         we had in use.   Remove unused topblock parameter.
10393
10394         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10395
10396         * assign.cs: Drop extra unneeded tests.
10397
10398 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10399
10400         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10401
10402         * statement.cs (Foreach): Use VariableStorage instead of
10403         LocalBuilders.   
10404
10405         * codegen.cs (VariableStorage): New class used by clients that
10406         require a variable stored: locals or fields for variables that
10407         need to live across yield.
10408
10409         Maybe provide a convenience api for EmitThis+EmitLoad?
10410
10411         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10412         these bad boys.
10413
10414 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10415
10416         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10417         RemapParameterLValue): New methods that are used to turn a
10418         precomputed FieldInfo into an expression like this:
10419
10420                 instance.FieldInfo
10421
10422         The idea is to use this instead of making LocalVariableReference
10423         have more than one meaning.
10424
10425         * cs-parser.jay: Add error production to BASE.
10426
10427         * ecore.cs: Deal with TypeManager.GetField returning null, which
10428         is now a valid return value.
10429
10430         (FieldExprNoAddress): New expression for Fields whose address can
10431         not be taken.
10432
10433         * expression.cs (LocalVariableReference): During the resolve
10434         phases, create new expressions if we are in a remapping context.
10435         Remove code that dealt with remapping here.
10436
10437         (ParameterReference): same.
10438
10439         (ProxyInstance): New expression, like the `This' expression, but
10440         it is born fully resolved.  We know what we are doing, so remove
10441         the errors that are targeted to user-provided uses of `this'.
10442
10443         * statement.cs (Foreach): our variable is now stored as an
10444         Expression;  During resolution, follow the protocol, dont just
10445         assume it will return this.
10446
10447 2003-08-06  Martin Baulig  <martin@ximian.com>
10448
10449         * support.cs (SeekableStreamReader.cs): New public class.
10450
10451         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10452         SeekableStreamReader instead of the normal StreamReader.
10453
10454 2003-08-04  Martin Baulig  <martin@ximian.com>
10455
10456         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10457         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10458         deambiguate casts and delegate invocations.
10459         (parenthesized_expression): Use the new tokens to ensure this is
10460         not a cast of method invocation.
10461
10462         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10463         when reading a `)' and Deambiguate_CloseParens () was previously
10464         called.
10465
10466         * expression.cs (ParenthesizedExpression): New class.  This is
10467         just used for the CS0075 test.
10468         (Binary.DoResolve): Check for CS0075.   
10469
10470 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10471
10472         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10473         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10474         reference comparison.
10475
10476         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10477         examine the ReturnType for equality - this is necessary in the
10478         cases of implicit and explicit operators whose signature also
10479         includes the return type.
10480
10481 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * namespace.cs: Cache the result of the namespace computation,
10484         instead of computing it every time.
10485
10486 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10487
10488         * decl.cs: Use a global arraylist that we reuse over invocations
10489         to avoid excesive memory consumption.  Reduces memory usage on an
10490         mcs compile by one meg (45 average).
10491
10492         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10493         private, work around that.
10494
10495 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10496
10497         * literal.cs (IntLiteral): Define Zero and One static literals. 
10498
10499         * cs-parser.jay (integer_literal): use static literals to reduce
10500         memory usage for the most used literals (0, 1 and -1).  211kb
10501         reduced in memory usage.
10502
10503         Replace all calls to `new ArrayList' with `new
10504         ArrayList(4)' which is a good average number for most allocations,
10505         and also requires only 16 bytes of memory for its buffer by
10506         default. 
10507
10508         This reduced MCS memory usage in seven megabytes for the RSS after
10509         bootstrapping.
10510
10511 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10512
10513         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10514         handle params methods the correct way by forming only one
10515         applicable set with params and normal methods in them. Earlier we
10516         were looking at params methods only if we found no normal methods
10517         which was not the correct thing to do.
10518
10519         (Invocation.BetterFunction): Take separate arguments indicating
10520         when candidate and the best method are params methods in their
10521         expanded form.
10522
10523         This fixes bugs #43367 and #46199.
10524
10525         * attribute.cs: Documentation updates.
10526
10527         (CheckAttribute): Rename to CheckAttributeTarget.
10528         (GetValidPlaces): Rename to GetValidTargets.
10529
10530         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10531         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10532
10533         Fixes bug #44468.
10534
10535 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10536
10537         * codegen.cs: Compute IsGeneric correctly.
10538
10539         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10540         resolution. 
10541
10542         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10543         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10544         regressions, and I was chasing more bugs than I required.
10545
10546         * interface.cs: Use expressions for base type names (like classes
10547         and structs have been doing for a while now), and resolve that.
10548         This patch should probably go into head as well.
10549
10550         This makes it one less user of FindType.
10551
10552 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10553
10554         This compiler can not self host currently.  Need to fix that.
10555         
10556         * Makefile: compile to `gmcs.exe'
10557
10558         * driver.cs: Turn on v2 by default on gmcs.
10559
10560         * generic.cs (ConstructedType): Does no longer take a container
10561         type argument;  That will be taken care of later.
10562
10563         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10564         Use SimpleName to resolve for now, so we can continue the work on
10565         the parser, until we get Type.GetType that understands generics.
10566
10567         (ConstructedType.ToString): Implement
10568
10569         (TypeArguments.Resolve): Resolve the child expressions as types. 
10570         
10571         * cs-parser.jay: Rename interface_constraints to
10572         type_parameter_constraints
10573
10574         (namespace_or_type_name): Only use constructed types for the basic
10575         construction, we will deal with identifier<...> later.
10576
10577         (type/type_name): No longer call DecomposeQI, as
10578         namespace_or_type_name is always decoded now.
10579         
10580 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10581
10582         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10583         closely: we eliminate methods in base types when we have an
10584         applicable method in a top-level type.
10585
10586         Please see section 14.5.5.1 for an exact description of what goes
10587         on. 
10588
10589         This fixes bug #45127 and a host of other related to corlib compilation.
10590
10591         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10592         array is the method corresponding to the top-level type (this is
10593         because of the changes made to icall.c) so we change this
10594         accordingly.
10595
10596         (MethodGroupExpr.Name): This too.
10597
10598         * typemanager.cs (GetElementType): New method which does the right
10599         thing when compiling corlib. 
10600
10601         * everywhere: Make use of the above in the relevant places.
10602
10603 2003-07-22  Martin Baulig  <martin@ximian.com>
10604
10605         * cs-parser.jay (invocation_expression): Moved
10606         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10607         `cast_expression', but create a InvocationOrCast which later
10608         resolves to either an Invocation or a Cast.
10609
10610         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10611         method; call this before EmitStatement() to make sure that this
10612         expression can be used as a statement.
10613
10614         * expression.cs (InvocationOrCast): New class; resolves to either
10615         an Invocation or a Cast.
10616
10617         * statement.cs (StatementExpression): Call ResolveStatement() on
10618         the ExpressionStatement before emitting it.
10619
10620 2003-07-21  Martin Baulig  <martin@ximian.com>
10621
10622         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10623         `ref' and `out' attributes match; fixes #46220.
10624         (MemberAccess.ResolveMemberAccess): You can't reference a type
10625         through an expression; fixes #33180.
10626         (Indexers.GetIndexersForType): Don't return the indexers from
10627         interfaces the class implements; fixes #46502.
10628
10629 2003-07-21  Martin Baulig  <martin@ximian.com>
10630
10631         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10632         CS0661 checks; fixes bug #30442.
10633
10634 2003-07-21  Martin Baulig  <martin@ximian.com>
10635
10636         * decl.cs (AdditionResult): Added `Error'.
10637
10638         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10639
10640         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10641         cs0031.cs actually work.
10642
10643  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10644  
10645         * cs-parser.jay (namespace_name): do not use
10646         namespace_or_type_name, use qualified_identifier, because
10647         namespace_or_type_name will soon return a composed expression
10648         instead of a string.
10649  
10650         (namespace_or_type_name): Instead of returning a string, now this
10651         production returns an expression.
10652  
10653         * codegen.cs (EmitContext): Setup IsGeneric property based on
10654         whether our DeclSpace is generic, our the method is generic.
10655  
10656         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10657         the method is generic.
10658  
10659         * cs-parser.jay (type_arguments, opt_type_argument_list,
10660         type_parameters, type_parameter_list, opt_type_parameter_list,
10661         type_parameter,, opt_type_parameter_constraints_clauses,
10662         type_parameter_constraints_clauses,
10663         type_parameter_constraint_clause, type_parameter_constraint,
10664         interface_constraints): Add new production
10665  
10666         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10667         DeclSpace is generic or not.
10668  
10669         (DeclSpace.SetParameterInfo): New routine, used to set the
10670         parameter info for a type.
10671  
10672         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10673         returns a GenericTypeExpr
10674  
10675         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10676         generic, lookup the generic argument.
10677  
10678         * attribute.cs: Do not allow TypeParameterExpressions in
10679         Attributes.
10680  
10681         * class.cs: Do not allow the Main method to be defined in a
10682         Generic container.
10683  
10684         * expression.cs (SizeOf): Do not allow generic types to be used as
10685         arguments to sizeof.
10686  
10687         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10688         it: whether a type is generic or not.  Only works for types we are
10689         currently building for now.
10690         
10691 2003-07-20  Martin Baulig  <martin@ximian.com>
10692
10693         * namespace.cs: Fixed that bug which caused a crash when compiling
10694         the debugger's GUI.
10695
10696 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10697
10698         * typemanager.cs (LookupTypeReflection): Never expose types which
10699         are NotPublic, NestedPrivate, NestedAssembly, or
10700         NestedFamANDAssem.  We used to return these, and later do a check
10701         that would report a meaningful error, but the problem is that we
10702         would not get the real match, if there was a name override.
10703
10704 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10705
10706         * namespace.cs (Namespace, Name): Do not compute the namespace
10707         name dynamically, compute it in the constructor.  This reduced
10708         memory usage by 1697 KB.
10709
10710         * driver.cs: Use --pause to pause at the end.
10711
10712 2003-07-17  Peter Williams  <peter@newton.cx>
10713
10714         * Makefile: Change the name of the test target so that it doesn't
10715         conflict with the recursive test target.
10716
10717 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10718
10719         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10720         AddressOf): Do not use EmitThis, that was wrong, use the actual
10721         this pointer.
10722
10723 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10724
10725         * class.cs (MethodData.Define): While checking if a method is an
10726         interface implementation, improve the test: If we are not public
10727         (use new test here: use the computed MethodAttributes directly,
10728         instead of the parsed modifier flags) check if the `implementing'
10729         method comes from an interface or not.
10730
10731         * pending.cs (VerifyPendingMethods): Slightly better error
10732         message.
10733
10734         * makefile: add test target that does the mcs bootstrap.
10735
10736 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10737
10738         * interface.cs (Define): Do nothing here since there are no
10739         members to populate etc. Move the attribute emission out of here
10740         since this was just totally the wrong place to put it. Attribute
10741         application happens during the 'Emit' phase, not in the 'Define'
10742         phase.
10743
10744         (Emit): Add this method and move the attribute emission here
10745
10746         * rootcontext.cs (EmitCode): Call the Emit method on interface
10747         types too.
10748
10749 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10750
10751         * expression.cs (OverloadResolve): Report error only if Location
10752         is not 'Null' which means that there was a probe going on.
10753
10754 2003-07-14  Martin Baulig  <martin@ximian.com>
10755
10756         * expression.cs (ConditionalLogicalOperator): New public class to
10757         implement user defined conditional logical operators.
10758         This is section 14.11.2 in the spec and bug #40505.
10759
10760 2003-07-14  Martin Baulig  <martin@ximian.com>
10761
10762         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10763
10764 2003-07-14  Martin Baulig  <martin@ximian.com>
10765
10766         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10767
10768         * ecore.cs (IVariable.VerifyFixed): New interface method.
10769
10770         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10771         operator, check whether the variable is actually fixed.  Fixes bug
10772         #36055.  Set a variable definitely assigned when taking its
10773         address as required by the spec.
10774
10775         * statement.cs (LocalInfo.IsFixed): New field.
10776         (LocalInfo.MakePinned): Set `IsFixed' to true.
10777
10778 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10779
10780         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10781         for .ctors, ensure that we only ask for members declared in the
10782         attribute type (BindingFlags.DeclaredOnly).
10783
10784         Fixes bug #43632.
10785
10786         * expression.cs (Error_WrongNumArguments): Report error 1501
10787         correctly the way CSC does.
10788
10789 2003-07-13  Martin Baulig  <martin@ximian.com>
10790
10791         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10792         lookup on the fully qualified name, to make things like "X.X" work
10793         where "X.X" is a fully qualified type name, but we also have a
10794         namespace "X" in the using list.  Fixes #41975.
10795
10796 2003-07-13  Martin Baulig  <martin@ximian.com>
10797
10798         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10799         function. If we're a CompoundAssign, we need to create an embedded
10800         CompoundAssign, not an embedded Assign.
10801         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10802         Fixes #45854.
10803
10804 2003-07-13  Martin Baulig  <martin@ximian.com>
10805
10806         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10807         work to fix bug #46088.
10808
10809 2003-07-13  Ravi Pratap <ravi@ximian.com>
10810
10811         * class.cs (Operator.Emit): Do not emit attributes here - it is
10812         taken care of by the Method class that we delegate too. This takes
10813         care of bug #45876.
10814
10815 2003-07-10  Martin Baulig  <martin@ximian.com>
10816
10817         * expression.cs (TypeOfVoid): New class.
10818         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10819
10820 2003-07-10  Martin Baulig  <martin@ximian.com>
10821
10822         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10823         bug #35957.
10824
10825 2003-07-10  Martin Baulig  <martin@ximian.com>
10826
10827         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10828         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10829
10830         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10831
10832         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10833
10834 2003-07-10  Martin Baulig  <martin@ximian.com>
10835
10836         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10837         of decimal.  Fixes #42850.
10838
10839         NOTE: I also fixed the created byte blob, but this doesn't work on
10840         the MS runtime and csc never produces any byte blobs for decimal
10841         arrays.
10842
10843 2003-07-10  Martin Baulig  <martin@ximian.com>
10844
10845         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10846         structs; fixes #32068.
10847         (Block.AddChildVariableNames): Fixed #44302.
10848
10849 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10850
10851         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10852
10853 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10854
10855         * attribute.cs: And this test is onger needed.
10856
10857 2003-07-08  Martin Baulig  <martin@ximian.com>
10858
10859         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10860         inaccessible types.  Fixes #36313.
10861
10862         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10863
10864         * namespace.cs (NamespaceEntry): Create implicit entries for all
10865         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10866         implicit entries for N1.N2 and N1.
10867
10868 2003-07-08  Martin Baulig  <martin@ximian.com>
10869
10870         Rewrote the handling of namespaces to fix a lot of the issues
10871         wrt. `using' aliases etc.
10872
10873         * namespace.cs (Namespace): Splitted this class into a
10874         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10875
10876         * typemanager.cs (TypeManager.IsNamespace): Removed.
10877         (TypeManager.ComputeNamespaces): Only compute namespaces from
10878         loaded assemblies here, not the namespaces from the assembly we're
10879         currently compiling.
10880
10881 2003-07-08  Martin Baulig  <martin@ximian.com>
10882
10883         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10884
10885 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10886
10887         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10888         already fixed it.  
10889
10890         I thought about the memory savings here, but LookupTypeReflection
10891         is used under already very constrained scenarios.  Compiling
10892         corlib or mcs only exposes one hit, so it would not really reduce
10893         any memory consumption.
10894
10895 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10896
10897         * typemanager.cs: fixes bug #45889 by only adding public types from
10898         other assemblies to the list of known types.
10899
10900 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10901
10902         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10903         on the type we resolved.
10904
10905 2003-07-05  Martin Baulig  <martin@ximian.com>
10906
10907         * pending.cs (PendingImplementation.ParentImplements): Don't
10908         create the proxy if the parent is abstract.
10909
10910         * class.cs (TypeContainer.DefineIndexers): Process explicit
10911         interface implementations first.  Fixes #37714.
10912
10913 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10914
10915         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10916         defined recursively;  but since we modify the input parameters
10917         (left is set to `this' temporarily), we reset this value if the
10918         left_is_explicit is false, which gives the original semantics to
10919         the code.  
10920
10921         * literal.cs (NullPointer): new class used to represent a null
10922         literal in a pointer context.
10923
10924         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10925         type is a pointer, use a NullPointer object instead of a
10926         NullLiteral.   Closes 43687
10927
10928         (ExplicitConversion): Convert pointer values using
10929         the conv opcode to the proper type.
10930
10931         * ecore.cs (New): change ValueTypeVariable property into a method,
10932         that returns whether the valuetype is suitable for being used.
10933
10934         * expression.cs (Binary.DoNumericPromotions): Only return if we
10935         the int constant was a valid uint, and we can return both left and
10936         right as uints.  If not, we continue processing, to trigger the
10937         type conversion.  This fixes 39018.
10938
10939         * statement.cs (Block.EmitMeta): During constant resolution, set
10940         the CurrentBlock property on the emitcontext, so that we resolve
10941         constants propertly.
10942
10943 2003-07-02  Martin Baulig  <martin@ximian.com>
10944
10945         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10946         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10947
10948         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10949         than emitting it here.
10950
10951         * statement.cs: Fixed some more flow analysis bugs.
10952
10953 2003-07-02  Martin Baulig  <martin@ximian.com>
10954
10955         * class.cs (MethodData.Define): When implementing interface
10956         methods, set Final unless we're Virtual.
10957
10958         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10959         check work for interface methods.
10960
10961 2003-07-01  Martin Baulig  <martin@ximian.com>
10962
10963         * ecore.cs (EmitContext.This): Replaced this property with a
10964         GetThis() method which takes a Location argument.  This ensures
10965         that we get the correct error location for a CS0188.
10966
10967 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10968
10969         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10970         ImplicitStandardConversion.
10971
10972         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10973
10974 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10975
10976         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10977         optimization.
10978
10979 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10980
10981         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10982         constructors.
10983
10984         (MethodData.Define): Turn off initlocals for unsafe methods.
10985
10986 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10987
10988         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10989         complete;  Fixes #37521.
10990
10991         * delegate.cs: Use Modifiers.TypeAttr to compute the
10992         TypeAttributes, instead of rolling our own.  This makes the flags
10993         correct for the delegates.
10994
10995 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10996
10997         * class.cs (Constructor.Define): Set the private flag for static
10998         constructors as well.
10999
11000         * cs-parser.jay (statement_expression): Set the return value to
11001         null, to avoid a crash when we catch an error.
11002
11003 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11004
11005         * cs-parser.jay: Applied patch from Jackson that adds support for
11006         extern and unsafe modifiers to destructor declarations.
11007
11008         * expression.cs: Report error 21 if the user is trying to index a
11009         System.Array.
11010
11011         * driver.cs: Add an error message, suggested by the bug report.
11012
11013         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11014         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11015
11016 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11017
11018         * namespace.cs: Add some information to reduce FAQs.
11019
11020 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11021
11022         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11023         underlying enumeration types.  Fixes #43915.
11024
11025         * expression.cs: Treat ushort/short as legal values to be used in
11026         bitwise operations.
11027
11028 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11029
11030         * delegate.cs: transfer custom attributes for paramenters from
11031         the delegate declaration to Invoke and BeginInvoke.
11032
11033 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11034
11035         * attribute.cs: handle custom marshalers and emit marshal info
11036         for fields, too.
11037
11038 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11039
11040         * makefile.gnu: Added anonymous.cs to the compiler sources.
11041
11042 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * iterators.cs: Change the name of the proxy class to include two
11045         underscores.
11046
11047         * cs-parser.jay: Update grammar to include anonymous methods.
11048
11049         * anonymous.cs: new file.
11050
11051 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * class.cs (Field.Define): Add missing test for pointers and
11054         safety. 
11055
11056 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11057
11058         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11059         we use the stobj opcode.
11060
11061         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11062         since it wasn't the correct fix. 
11063
11064         It still is puzzling that we are required to use stobj for IntPtr
11065         which seems to be a ValueType.
11066
11067 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11068
11069         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11070         during regular simple name resolution.   Now, the trick is that
11071         instead of returning for processing the simplename, we do a
11072         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11073         contextual lookup type).   If a match is found, return that, if
11074         not, return for further composition.
11075
11076         This fixes long-standing 30485.
11077
11078         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11079         using the address to initialize an object, do an Stobj instead of
11080         using the regular Stelem.
11081
11082         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11083         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11084         Because if we are a BaseIndexerAccess that value will be true.
11085         Fixes 43643.
11086
11087         * statement.cs (GotoCase.Resolve): Return after reporting an
11088         error, do not attempt to continue. 
11089
11090         * expression.cs (PointerArithmetic.Emit): If our operand is a
11091         long, convert our constants to match the operand before
11092         multiplying.  Convert to I type before adding.   Fixes 43670.
11093
11094 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11095
11096         * enum.cs (ImplicitConversionExists) : Rename to
11097         ImplicitEnumConversionExists to remove ambiguity. 
11098
11099         * ecore.cs (NullCast): New type of cast expression class which
11100         basically is very similar to EmptyCast with the difference being
11101         it still is a constant since it is used only to cast a null to
11102         something else
11103         (eg. (string) null)
11104
11105         * convert.cs (ImplicitReferenceConversion): When casting a null
11106         literal, we return a NullCast.
11107
11108         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11109         should be around anymore.
11110
11111         The renaming (reported was slightly wrong). Corrections:
11112
11113         ConvertImplicitStandard -> ImplicitConversionStandard
11114         ConvertExplicitStandard -> ExplicitConversionStandard
11115
11116         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11117         before passing them in !
11118
11119         * convert.cs (ImplicitConversionStandard): When comparing for
11120         equal expr and target types, ensure that expr is not a
11121         NullLiteral.
11122
11123         In general, we must not be checking (expr_type ==
11124         target_type) in the top level conversion methods
11125         (ImplicitConversion, ExplicitConversion etc). This checking is
11126         done in the methods that they delegate to.
11127
11128 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11129
11130         * convert.cs: Move Error_CannotConvertType,
11131         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11132         ImplicitNumericConversion, ImplicitConversionExists,
11133         ImplicitUserConversionExists, StandardConversionExists,
11134         FindMostEncompassedType, FindMostSpecificSource,
11135         FindMostSpecificTarget, ImplicitUserConversion,
11136         ExplicitUserConversion, GetConversionOperators,
11137         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11138         TryImplicitIntConversion, Error_CannotConvertImplicit,
11139         ConvertImplicitRequired, ConvertNumericExplicit,
11140         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11141         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11142         its own file.
11143
11144         Perform the following renames:
11145
11146         StandardConversionExists -> ImplicitStandardConversionExists
11147         ConvertImplicit -> ImplicitConversion
11148         ConvertImplicitStandard -> ImplicitStandardConversion
11149         TryImplicitIntConversion -> ImplicitIntConversion
11150         ConvertImplicitRequired -> ImplicitConversionRequired
11151         ConvertNumericExplicit -> ExplicitNumericConversion
11152         ConvertReferenceExplicit -> ExplicitReferenceConversion
11153         ConvertExplicit -> ExplicitConversion
11154         ConvertExplicitStandard -> ExplicitStandardConversion
11155
11156 2003-05-19  Martin Baulig  <martin@ximian.com>
11157
11158         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11159         (TypeInfo): Added support for structs having structs as fields.
11160
11161         * ecore.cs (FieldExpr): Implement IVariable.
11162         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11163         VariableInfo for the field.
11164
11165 2003-05-18  Martin Baulig  <martin@ximian.com>
11166
11167         * expression.cs (This.DoResolve): Report a CS0027 if we're
11168         emitting a field initializer.
11169
11170 2003-05-18  Martin Baulig  <martin@ximian.com>
11171
11172         * expression.cs (This.ResolveBase): New public function.
11173         (This.DoResolve): Check for CS0188.
11174
11175         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11176         This.Resolve().
11177
11178         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11179         `instance_expression' to null if we don't have any non-static
11180         methods.
11181
11182 2003-05-18  Martin Baulig  <martin@ximian.com>
11183
11184         Reworked the way how local variables and parameters are handled by
11185         the flow analysis code.
11186
11187         * statement.cs (TypeInfo, VariableMap): New public classes.
11188         (VariableInfo): New public class.  This is now responsible for
11189         checking whether a variable has been assigned.  It is used for
11190         parameters and local variables.
11191         (Block.EmitMeta): Take the InternalParameters as argument; compute
11192         the layout of the flow vectors here.
11193         (Block.LocalMap, Block.ParameterMap): New public properties.
11194         (FlowBranching): The .ctor doesn't get the InternalParameters
11195         anymore since Block.EmitMeta() now computes the layout of the flow
11196         vector.
11197         (MyStructInfo): This class is now known as `StructInfo' and nested
11198         in `TypeInfo'; we don't access this directly anymore.
11199
11200         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11201         property and removed IsAssigned(), IsFieldAssigned(),
11202         SetAssigned() and SetFieldAssigned(); we now call them on the
11203         VariableInfo so we don't need to duplicate this code everywhere.
11204
11205         * expression.cs (ParameterReference): Added `Block block' argument
11206         to the .ctor.
11207         (LocalVariableReference, ParameterReference, This): The new
11208         VariableInfo class is now responsible for all the definite
11209         assignment stuff.
11210
11211         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11212         IsParameterAssigned, SetParameterAssigned): Removed.
11213
11214 2003-05-18  Martin Baulig  <martin@ximian.com>
11215
11216         * typemanager.cs (InitCoreTypes): Try calling
11217         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11218         the 3-args-version.  Corlib now also needs our `void_type'.
11219         (GetMethod): Added overloaded version which takes an optional
11220         `bool report_errors' to allow lookups of optional methods.
11221
11222 2003-05-12  Martin Baulig  <martin@ximian.com>
11223
11224         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11225         only used for locals and not for parameters.
11226
11227 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * support.cs (InternalParameters.ParameterType): Return the
11230         ExternalType of the parameter.
11231
11232         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11233         they were unused.
11234
11235 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11236
11237         * class.cs (MethodData.Define): Do not set the `newslot' on
11238         interface members, if they are also flagged as "override".
11239
11240         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11241         better code for ++i and i++.  This only works for static fields
11242         and local variables.
11243
11244         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11245         want to pull the DeclSpace out of the builder_to_declspace instead
11246         of the TypeBuilder (like in TypeContainer.FindMembers).
11247
11248         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11249         instead of LookupTypeContainer.  Fixes the crash on .NET for
11250         looking up interface members.
11251
11252         * const.cs: Create our own emit context during the Definition
11253         stage, so that constants are evaluated in the proper context, when
11254         a recursive definition happens.
11255
11256 2003-05-11  Martin Baulig  <martin@ximian.com>
11257
11258         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11259         new block for a switch section.
11260         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11261         the adding/lookup in the switch block.  Fixes #39828.
11262
11263 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11264
11265         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11266         functionality: I needed to convert the data after I had performed
11267         the add/sub operation into the operands type size.
11268
11269         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11270         pass the type for the box operation, otherwise the resulting
11271         object would have been of type object.
11272
11273         (BoxedCast): Add constructor to specify the type to box as.
11274
11275 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11276
11277         * iterators.cs: I was reusing the `count' variable inadvertently,
11278         take steps to not allow this to happen.
11279
11280 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11281
11282         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11283         by creating an array at the point where the params starts and
11284         putting all those arguments there, then adjusting the size of the
11285         array.
11286
11287 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11288
11289         * expression.cs (New.AddressOf): Implement interface
11290         IMemoryLocation.  This is used when the `new' operator is used in
11291         the context of an invocation to a method on a value type.
11292
11293         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11294         example. 
11295
11296         * namespace.cs: Also check the using aliases here.
11297
11298         * driver.cs: Move the test for using validity after the types have
11299         been entered, so we do a single pass that also includes the using
11300         aliases. 
11301
11302         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11303         in the regular case.   CreateSiblingForFinally is doing extra
11304         error checking.
11305
11306         * attribute.cs (GetAttributeArgumentExpression): Store the result
11307         on an out value, and use the return value to indicate failure
11308         instead of using null (which is a valid return for Constant.GetValue).
11309
11310         * statement.cs: Perform the analysis flow for the increment
11311         portion after the statement, because this will be the real flow of
11312         execution.  Fixes #42385
11313
11314         * codegen.cs (EmitContext.EmitArgument,
11315         EmitContext.EmitStoreArgument): New helper functions when the
11316         RemapToProxy flag is set.
11317
11318         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11319         function.
11320
11321         Add support for remapping parameters. 
11322
11323         * iterators.cs: Propagate parameter values;  Store parameter
11324         values in the proxy classes.
11325
11326 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11327
11328         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11329         need a proxy reference;  I do not know what I was thinking
11330
11331         * cs-parser.jay (constructor_initializer): catch another error,
11332         and display nice message.
11333
11334         (field_declaration): catch void field declaration
11335         to flag a better error. 
11336
11337         * class.cs (MemberBase.CheckBase): Report an error instead of a
11338         warning if a new protected member is declared in a struct. 
11339         (Field.Define): catch the error of readonly/volatile.
11340
11341         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11342
11343         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11344         volatile variable is taken
11345
11346 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11347
11348         * statement.cs (Fixed.Resolve): Report an error if we are not in
11349         an unsafe context.
11350
11351 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11352
11353         * typemanager.cs: reuse the code that handles type clashes for
11354         delegates and enumerations.
11355
11356         * class.cs (Report28): Always report.
11357
11358         * expression.cs (EncodeAsAttribute): Allow nulls here.
11359
11360 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11361
11362         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11363         the functionality for testing whether an expression is valid for
11364         an attribute here.  Also handle the case of arrays of elements
11365         being stored. 
11366
11367         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11368         encoding a linear array into an array of objects that are suitable
11369         to be passed to an CustomAttributeBuilder.
11370
11371         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11372
11373         * ecore.cs: (FieldExpr): Handle field remapping here.
11374
11375         * iteratators.cs: Pass the instance variable (if the method is an
11376         instance method) to the constructors, so we can access the field
11377         variables on the class.
11378
11379         TODO: Test this with structs.  I think the THIS variable on
11380         structs might have to be a pointer, and not a refenrece
11381
11382 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11383
11384         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11385         local variables to fields in a proxy class.
11386
11387         * iterators.cs (PopulateProxy): Rename our internal fields to
11388         <XXX>.  
11389         Create a <THIS> field if we are an instance method, so we can
11390         reference our parent container variables.
11391         (MapVariable): Called back from the EmitContext code to enter a
11392         new variable to field mapping into the proxy class (we just create
11393         a FieldBuilder).
11394
11395         * expression.cs
11396         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11397         for using the remapped locals to fields.
11398
11399         I placed the code here, because that gives the same semantics to
11400         local variables, and only changes the Emit code.
11401
11402         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11403         statements inside iterators.
11404         (VariableInfo): Add a FieldBuilder for the cases when we are
11405         remapping local variables to fields in a proxy class
11406
11407         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11408         current_block != null.
11409
11410         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11411         not cope with strings, as it has been moved to the
11412         TableSwitchEmit.  Fixed bug in switch generation.
11413
11414         * expression.cs (New.DoResolve): Provide more context for the user
11415         when reporting an error.
11416
11417         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11418         pointers. 
11419
11420         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11421         check the permissions for it.  Note than in a type-resolution
11422         context the check was already present in DeclSpace.ResolveType,
11423         but was missing from the MemberAccess.
11424
11425         (ArrayCreation.CheckIndices): warn if the user has
11426         more nested levels of expressions, but there are no more
11427         dimensions specified.  Avoids crash on bug 41906.
11428
11429 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11430
11431         * statement.cs (Block): replace Implicit bool, for a generic
11432         flags.   
11433         New flag: `Unchecked'.  This is used during the EmitMeta phase
11434         (which is out-of-line with the regular Resolve/Emit process for a
11435         statement, as this is done ahead of time, but still gets a chance
11436         to call constant resolve).
11437
11438         (Block.Flags): new enum for adding a new flag.
11439
11440         (Block.EmitMeta): track the state of unchecked.
11441
11442         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11443         to enable constant resolution to work there as well.
11444
11445 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11446
11447         * typemanager.cs (ienumerable_type): Also look up
11448         System.Collections.IEnumerable. 
11449
11450 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11451
11452         TODO: Test more than one conditional per method.
11453
11454         * class.cs (Indexer.Define): Report the location where the user is
11455         referencing the unsupported feature.
11456
11457         (MethodData): Overload the use of `conditionals' to
11458         minimize the creation of needless ArrayLists.   This saves roughly
11459         212kb on my machine.
11460
11461         (Method): Implement the new IIteratorContainer interface.
11462         (Method.SetYields): Implement the method by setting the ModFlags
11463         to contain METHOD_YIELDS.
11464
11465         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11466         which just got set to null.
11467
11468         * iterators.cs: New file.
11469
11470         (Yield, YieldBreak): New statements.
11471
11472         * statement.cs (Return.Resolve): Flag an error if we are used in
11473         an iterator method.
11474
11475         * codegen.cs (InIterator): New flag set if the code is being
11476         compiled in an iterator method.
11477
11478         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11479         internal modifier, and we just use it to avoid adding extra
11480         fields, as this is seldom used.  
11481
11482         * cs-parser.jay: Add yield_statement (yield and yield break).
11483
11484         * driver.cs: New flag -v2 to turn on version 2 features. 
11485
11486         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11487         hashtable when v2 is enabled.
11488
11489 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11490
11491         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11492         there is already a namespace defined with this name.
11493
11494         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11495         people upgraded their corlibs.
11496
11497         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11498         always use fully qualified types, no need to use the compiler
11499         front end.
11500
11501         (TypeManager.IsNamespace): Use binarysearch.
11502
11503         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11504         AddDelegate): I did not quite use the new IsValid API properly: I
11505         have to pass the short-name and the fullname.  I was passing only
11506         the basename instead of the fullname sometimes. 
11507
11508         (TypeContainer.DefineType): call NamespaceClash.
11509
11510         * interface.cs (Interface.DefineType): use NamespaceClash before
11511         defining the type.
11512
11513         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11514         defining the type.
11515
11516         * enum.cs: (Enum.DefineType): use NamespaceClash before
11517         defining the type.
11518
11519         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11520         speed increase.  First, use the negative_hits cache when we get a
11521         negative.  Second, add the type with its full original name
11522         instead of the new . and + encoded name (reflection uses + to
11523         separate type from a nested type).  Use LookupTypeReflection
11524         directly which bypasses the type->name hashtable (that we already
11525         know does not contain the type.
11526
11527         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11528         location/container type. 
11529
11530         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11531
11532 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11533
11534         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11535
11536         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11537         method is being referenced in the method group from a static
11538         context, and report error 120 if so.
11539
11540         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11541         Error118. 
11542
11543         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11544         is created, we create the A namespace).
11545
11546         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11547         Fixes #41591
11548
11549 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11550
11551         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11552         invocation to ModuleBuilder.GetType with the same values will
11553         return a new type instance, so we need to cache its return
11554         values. 
11555
11556         * expression.cs (Binary.ResolveOperator): Only allow the compare
11557         operators on enums if they are of the same type.
11558
11559         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11560         types of ValueType on their own case.  Before we were giving them
11561         the same treatment as objects.
11562
11563         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11564         fullname.  Short name is used to compare against container name.
11565         Fullname is used to check against defined namespace names.
11566
11567         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11568         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11569
11570         (Method.CheckBase): Call parent.
11571         (MemberBase.CheckBase): Check for protected members on sealed
11572         classes.
11573         (PropertyBase.CheckBase): Call parent.
11574         (Field.Define): Call parent.
11575
11576         * report.cs: Negative error codes are now mapped to 8000 - code,
11577         so that the display is render more nicely.
11578
11579         * typemanager.cs: Do not use try/catch, instead report a regular
11580         error. 
11581
11582         (GetPointerType, GetReferenceType): These methods provide
11583         mechanisms to obtain the T* and T& from a T.  We had the code
11584         previously scattered around the code base, and it also used
11585         TypeManager.LookupType that would go through plenty of caches.
11586         This one goes directly to the type source.
11587
11588         In some places we did the Type.GetType followed by
11589         ModuleBuilder.GetType, but not in others, so this unifies the
11590         processing as well.
11591
11592         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11593         statements now that we have namespace information.
11594
11595         * typemanager.cs (IsNamespace): New method, returns whether the
11596         string presented is a namespace or not.
11597
11598         (ComputeNamespaces): New public entry point, computes the list of
11599         available namespaces, using the GetNamespaces API call in Mono, or
11600         the slower version in MS.NET.   
11601
11602         Now before we start the semantic analysis phase, we have a
11603         complete list of namespaces including everything that the user has
11604         provided.
11605
11606         Deleted old code to cache namespaces in .nsc files.
11607
11608 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11609
11610         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11611         class/struct location definition Location for the implicit
11612         constructor location.
11613
11614         (Operator.Define): Use the location of the operator for the
11615         implicit Method definition.
11616
11617         (Constructor.Emit): use the constructor location for the implicit
11618         base initializer constructor.
11619
11620         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11621         and the Expression class now contains two new methods:
11622
11623         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11624         isolate type lookup from the rest of the resolution process.
11625
11626         Since we use Expressions to hold type definitions due to the way
11627         we parse the input we have historically overloaded Resolve to
11628         perform the Type lookups if a special flag is passed.  Now this is
11629         eliminated and two methods take their place. 
11630
11631         The differences in the two methods between xStep and xTerminal is
11632         that xStep is involved in our current lookup system that uses
11633         SimpleNames to compose a name, while xTerminal is used just to
11634         catch the case where the simplename lookup failed.
11635
11636 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11637
11638         * expression.cs (ResolveMemberAccess): Remove redundant code.
11639         TypeExpr expressions are always born fully resolved.
11640
11641         * interface.cs (PopulateMethod): Do not lookup the types twice.
11642         We were doing it once during SemanticAnalysis and once during
11643         PopulateMethod.
11644
11645         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11646         in local variable type definitions, were being returned as a
11647         SimpleName (we decomposed everything into a string), that is
11648         because primary_expression was being used instead of a type in the
11649         grammar (reduce/reduce conflicts).
11650
11651         The part that was wrong is that we converted the expression into a
11652         string (an oversimplification in one hand, compounded with primary
11653         expressions doing string concatenation).
11654
11655         So things like:
11656
11657         A.B.C [] x;
11658
11659         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11660         using clauses from working on this particular context.  And a type
11661         was being matched directly against "A.B.C[]".
11662
11663         We now use the correct approach, and allow for ComposedCast to be
11664         part of the unary expression.  So the "A.B.C []" become a composed
11665         cast of "A.B.C" (as a nested group of MemberAccess with a
11666         SimpleName at the end) plus the rank composition "[]". 
11667
11668         Also fixes 35567
11669
11670 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11671
11672         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11673         for the access level checking.
11674
11675         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11676         `TypeContainer container', because I kept getting confused when I
11677         was debugging this code.
11678
11679         * expression.cs (Indexers): Instead of tracking getters/setters,
11680         we now track them in parallel.  We create one arraylist less, but
11681         most importantly it is possible now for the LValue code to find a
11682         matching get for a set.
11683
11684         (IndexerAccess.DoResolveLValue): Update the code.
11685         GetIndexersForType has been modified already to extract all the
11686         indexers from a type.  The code assumed it did not.
11687
11688         Also make the code set the correct return type for the indexer.
11689         This was fixed a long time ago for properties, but was missing for
11690         indexers.  It used to be void_type.
11691
11692         (Binary.Emit): Test first for doubles instead of
11693         floats, as they are more common.
11694
11695         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11696         when dealing with floats and the <=, >= operators.  This fixes bug
11697         #39314 
11698
11699         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11700         to load the array value by emitting a load on the foreach variable
11701         type.  This was incorrect.  
11702
11703         We now emit the code to load an element using the the array
11704         variable type, and then we emit the conversion operator.
11705
11706         Fixed #40176
11707
11708 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11709
11710         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11711
11712 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11713
11714         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11715         test for protection before we test for signatures. 
11716
11717         (MethodSignature.ToString): implement.
11718
11719         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11720         to the case where we reduced into a LongConstant.
11721
11722         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11723         depend on whether the information is acurrate, because the
11724         Microsoft runtime will always claim that the array type is public,
11725         regardless of the real state.
11726
11727         If the type is a pointer, another problem happens: the type is
11728         reported as non-public in Microsoft.  
11729
11730         In both cases we have to call CheckAccessLevel recursively with
11731         the underlying type as the argument to be tested.
11732
11733 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11734
11735         * assign.cs (Assign.Emit): If we are dealing with a compound
11736         assignment expression, we should use the code path that stores the
11737         intermediate result in a temporary value.  This fixes #40903.
11738
11739         *expression.cs (Indirection.ToString): Provide ToString method for
11740         debugging. 
11741
11742 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11743
11744         * class.cs: Null out fields holding references to Block objects so
11745         they can be garbage collected.
11746
11747         * expression.cs (OverloadResolve): Remove unused local.
11748
11749 2003-04-07  Martin Baulig  <martin@ximian.com>
11750
11751         * codegen.cs (EmitContext.CurrentFile): New public field.
11752         (EmitContext.Mark): Use the CurrentFile to check whether the
11753         location is in the correct file.
11754         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11755
11756 2003-04-07  Martin Baulig  <martin@ximian.com>
11757
11758         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11759
11760         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11761         location.  [FIXME: The location argument which gets passed to this
11762         method is sometimes wrong!]
11763
11764 2003-04-07  Nick Drochak <ndrochak@gol.com>
11765
11766         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11767
11768 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11769
11770         * expression.cs (Indirection.EmitAssign): We were using the
11771         temporary, but returning immediately instead of continuing the
11772         EmitAssing flow.
11773
11774 2003-04-06  Martin Baulig  <martin@ximian.com>
11775
11776         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11777         if it's a nested child, but also deriving from the outer class.
11778         See test 190.cs.
11779
11780         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11781         nested child, but also deriving from the outer class.  See
11782         test-190.cs.
11783         (FilterWithClosure): We may access private members of the outer
11784         class if we're a nested child and deriving from the outer class.
11785         (RealMemberLookup): Only set `closure_private_ok' if the
11786         `original_bf' contained BindingFlags.NonPublic.
11787
11788 2003-04-05  Martin Baulig  <martin@ximian.com>
11789
11790         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11791         probe if its a type parameter, and if so, flag an error.
11792
11793         * decl.cs: Move here the SetParameterInfo code from class.cs.
11794         Handle IsGeneric here.
11795
11796         Handle a variety of errors in the parameter info definition.
11797
11798         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11799         type parameters here.
11800
11801         * cs-parser.jay (class_declaration): report errors for parameters
11802         here as well.
11803
11804 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11805
11806         * generic.cs: New file, contains support code for generics.
11807
11808         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11809         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11810
11811         Update parser for the above removals.
11812
11813         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11814         now taken care of in the parser.
11815
11816 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * class.cs (Event.Define): Do not allow abstract events to have
11819         initializers. 
11820
11821 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11822
11823         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11824         block in event declarations.
11825
11826         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11827         value type, get its address.
11828
11829         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11830         leaving a class on the stack instead of a boolean value (int
11831         0/1).  Change the code so we compare against null, and then the
11832         result against zero.
11833
11834         * class.cs (TypeContainer.GetClassBases): We were checking for the
11835         parent class being sealed too late.
11836
11837         * expression.cs (Binary.Emit): For <= and >= when dealing with
11838         floating point values, use cgt.un and clt.un instead of cgt and
11839         clt alone.
11840
11841 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11842
11843         * statement.cs: Apply the same optimization as MS: skip the 
11844         GetEnumerator returning an IEnumerator, and use the one returning a 
11845         CharEnumerator instead. This allows us to avoid the try-finally block 
11846         and the boxing.
11847
11848 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11849
11850         * cs-parser.jay: Attributes cannot be applied to
11851                          namespaces. Fixes #40473
11852
11853 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11854
11855         * class.cs:
11856         (Add*): check if the name is valid using the full name for constants,
11857         fields, properties and events.
11858
11859 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11860
11861         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11862         char constants to be part of the enumeration.
11863
11864         * expression.cs (Conditional.DoResolve): Add support for operator
11865         true. Implements the missing functionality from 14.12
11866
11867         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11868         operator true/false as required by the spec.
11869
11870         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11871         implicit conversion to boolean.
11872
11873         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11874         also one where the type implements `operator true'. 
11875
11876         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11877         get an expression that will invoke operator true based on an
11878         expression.  
11879
11880         (GetConversionOperators): Removed the hack that called op_True
11881         here.  
11882
11883         (Expression.ResolveBoolean): Move this from Statement.
11884
11885 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11886
11887         * ecore.cs (FieldExpr): do not allow initialization of initonly
11888         fields on derived classes
11889
11890 2003-03-13  Martin Baulig  <martin@ximian.com>
11891
11892         * statement.cs (Block.Emit): Call ig.BeginScope() and
11893         ig.EndScope() when compiling with debugging info; call
11894         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11895
11896 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11897
11898         * expression.cs (Indexers): Do not construct immediately, allow
11899         for new members to be appended as we go.  Fixes 38143
11900
11901 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11902
11903         * expression.cs: save/restore context when resolving an unchecked
11904         expression.
11905
11906 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11907
11908         * cfold.cs: Catch division by zero in modulus operator during
11909         constant folding.
11910
11911 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11912
11913         * interface.cs (Interface.DefineMembers): Avoid defining members
11914         twice. 
11915
11916 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * driver.cs: handle the +/- options for -noconfig
11919
11920         * statement.cs (Unckeched.Resolve): Also track the state of
11921         unchecked in the Resolve phase.
11922
11923 2003-02-27  Martin Baulig  <martin@ximian.com>
11924
11925         * ecore.cs (Expression.MemberLookup): Don't create a
11926         MethodGroupExpr for something which is not a method.  Fixes #38291.
11927
11928 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * class.cs (MemberBase.CheckParameters): Also check that the type
11931         is unmanaged if it is a pointer.
11932
11933         * expression.cs (SizeOf.Resolve): Add location information.
11934
11935         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11936         a managed type is declared.
11937
11938         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11939         parameter modifiers as well.  Fixes bug 38606
11940
11941         * class.cs: Very sad.  Am backing out the speed up changes
11942         introduced by the ArrayList -> Array in the TypeContainer, as they
11943         were not actually that much faster, and introduced a bug (no error
11944         reports on duplicated methods).
11945
11946         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11947         source first, this will guarantee that we have a valid expression
11948         before calling in lower levels functions that will require a
11949         resolved object.  Then use this original_source in the
11950         target.ResolveLValue instead of the original source that was
11951         passed to us.
11952
11953         Another change.  Use target.Resolve instead of LValueResolve.
11954         Although we are resolving for LValues, we will let the Assign code
11955         take care of that (it will be called again from Resolve).  This
11956         basically allows code like this:
11957
11958         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11959         class Y { void A (X x) { x [0] += o; }
11960
11961         The problem was that the indexer was trying to resolve for
11962         set_Item (idx, object o) and never finding one.  The real set_Item
11963         was set_Item (idx, X).  By delaying the process we get the right
11964         semantics. 
11965
11966         Fixes bug 36505
11967
11968 2003-02-23  Martin Baulig  <martin@ximian.com>
11969
11970         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11971         while calling DoEmit ().
11972
11973         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11974         source files; if you use the #line directive inside a method, the
11975         compiler stops emitting line numbers for the debugger until it
11976         reaches the end of the method or another #line directive which
11977         restores the original file.
11978
11979 2003-02-23  Martin Baulig  <martin@ximian.com>
11980
11981         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11982
11983 2003-02-23  Martin Baulig  <martin@ximian.com>
11984
11985         * statement.cs (Block.AddChildVariableNames): We need to call this
11986         recursively, not just for our immediate children.
11987
11988 2003-02-23  Martin Baulig  <martin@ximian.com>
11989
11990         * class.cs (Event.Define): Always make the field private, like csc does.
11991
11992         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11993         actually work, fixes bug #37521.
11994
11995 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11996
11997         * delegate.cs: When creating the various temporary "Parameters"
11998         classes, make sure that we call the ComputeAndDefineParameterTypes
11999         on those new parameters (just like we do with the formal ones), to
12000         allow them to be resolved in the context of the DeclSpace.
12001
12002         This fixes the bug that Dick observed in Bugzilla #38530.
12003
12004 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12005
12006         * expression.cs (ResolveMemberAccess): When resolving a constant,
12007         do not attempt to pull a constant if the value was not able to
12008         generate a valid constant.
12009
12010         * const.cs (LookupConstantValue): Do not report more errors than required.
12011
12012 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12013
12014         * expression.cs: fixes bug #38328.
12015
12016 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12017
12018         * class.cs: Changed all the various members that can be part of a
12019         class from being an ArrayList to be an Array of the right type.
12020         During the DefineType type_list, interface_list, delegate_list and
12021         enum_list are turned into types, interfaces, delegates and enums
12022         arrays.  
12023
12024         And during the member population, indexer_list, event_list,
12025         constant_list, field_list, instance_constructor_list, method_list,
12026         operator_list and property_list are turned into their real arrays.
12027
12028         Although we could probably perform this operation earlier, for
12029         good error reporting we need to keep the lists and remove the
12030         lists for longer than required.
12031
12032         This optimization was triggered by Paolo profiling the compiler
12033         speed on the output of `gen-sample-program.pl' perl script. 
12034
12035         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12036         not crash in methods like MemberLookupFailed that use this field.  
12037
12038         This problem arises when the compiler fails to resolve a type
12039         during interface type definition for example.
12040
12041 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12044         inherit from System.Object, so we have to stop at null, not only
12045         when reaching System.Object.
12046
12047 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12048
12049         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12050         DeclaredOnly because the parent indexer might have had a different
12051         name, but did not loop until the top of the hierarchy was reached.
12052
12053         The problem this one fixes is 35492: when a class implemented an
12054         indexer from an interface, we were getting the interface method
12055         (which was abstract) and we were flagging an error (can not invoke
12056         abstract method).
12057
12058         This also keeps bug 33089 functioning, and test-148 functioning.
12059
12060         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12061         out if a method is special is to see if it is declared in a
12062         property or event, or whether it is one of the predefined operator
12063         names.   This should fix correctly #36804.
12064
12065 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12066
12067         The goal here is to remove the dependency on EmptyCast.Peel ().
12068         Killing it completely.
12069
12070         The problem is that currently in a number of places where
12071         constants are expected, we have to "probe" for an EmptyCast, and
12072         Peel, which is not the correct thing to do, as this will be
12073         repetitive and will likely lead to errors. 
12074
12075         The idea is to remove any EmptyCasts that are used in casts that
12076         can be reduced to constants, so we only have to cope with
12077         constants. 
12078
12079         This bug hunt was triggered by Bug 37363 and the desire to remove
12080         the duplicate pattern where we were "peeling" emptycasts to check
12081         whether they were constants.  Now constants will always be
12082         constants.
12083
12084         * ecore.cs: Use an enumconstant here instead of wrapping with
12085         EmptyCast.  
12086
12087         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12088         throwing me off.  By handling this we can get rid of a few hacks.
12089
12090         * statement.cs (Switch): Removed Peel() code.
12091
12092 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12093
12094         * class.cs: Location information for error 508
12095
12096         * expression.cs (New.DoResolve): Add a guard against double
12097         resolution of an expression.  
12098
12099         The New DoResolve might be called twice when initializing field
12100         expressions (see EmitFieldInitializers, the call to
12101         GetInitializerExpression will perform a resolve on the expression,
12102         and later the assign will trigger another resolution
12103
12104         This leads to bugs (#37014)
12105
12106         * delegate.cs: The signature for EndInvoke should contain any ref
12107         or out parameters as well.  We were not doing this in the past. 
12108
12109         * class.cs (Field.Define): Do not overwrite the type definition
12110         inside the `volatile' group.  Turns out that volatile enumerations
12111         were changing the type here to perform a validity test, which
12112         broke conversions. 
12113
12114 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12115
12116         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12117         and structs, we do not want to load the instance variable
12118
12119         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12120         enum_type has to be handled like an object reference (implicit
12121         conversions exists from this to object), but the regular IsClass
12122         and IsValueType tests will never return true for this one.
12123
12124         Also we use TypeManager.IsValueType instead of type.IsValueType,
12125         just for consistency with the rest of the code (this is only
12126         needed if we ever use the construct exposed by test-180.cs inside
12127         corlib, which we dont today).
12128
12129 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12130
12131         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12132         just InternalCall.
12133
12134 2003-02-09  Martin Baulig  <martin@ximian.com>
12135
12136         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12137         (Namespace.DefineNamespaces): New static public method; this is
12138         called when we're compiling with debugging to add all namespaces
12139         to the symbol file.
12140
12141         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12142         pass it to the Namespace's .ctor.
12143
12144         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12145         and MethodBase arguments; pass the namespace ID to the symwriter;
12146         pass the MethodBase instead of the token to the symwriter.
12147         (SymbolWriter.DefineNamespace): New method to add a namespace to
12148         the symbol file.
12149
12150 2003-02-09  Martin Baulig  <martin@ximian.com>
12151
12152         * symbolwriter.cs: New file.  This is a wrapper around
12153         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12154         methods here in near future.
12155
12156 2003-02-09  Martin Baulig  <martin@ximian.com>
12157
12158         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12159         ILGenerator.MarkSequencePoint() which are actually used by the
12160         symbol writer.
12161
12162 2003-02-09  Martin Baulig  <martin@ximian.com>
12163
12164         * location.cs (SourceFile): New public sealed class.  This
12165         contains the name and an index which is used in the location's token.
12166         (Location): Reserve an appropriate number of bits in the token for
12167         the source file instead of walking over that list, this gives us a
12168         really huge performance improvement when compiling with debugging.
12169
12170         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12171         `SourceFile' argument instead of a string.
12172         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12173         but don't parse/tokenize here, we need to generate the list of all
12174         source files before we do that.
12175         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12176         the files.
12177
12178         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12179         instead of a string.
12180
12181         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12182         of a string.
12183
12184 2003-02-09  Martin Baulig  <martin@ximian.com>
12185
12186         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12187         filename on `#line default'.
12188
12189 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12190
12191         * statement.cs: don't clear the pinned var when the fixed statement
12192         returns from the method (fixes bug#37752).
12193
12194 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12195
12196         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12197         to IsValueType.
12198
12199 2003-02-07  Martin Baulig  <martin@ximian.com>
12200
12201         * driver.cs: Removed the `--debug-args' command line argument.
12202
12203         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12204         automatically by the AsssemblyBuilder.
12205         (CodeGen.InitializeSymbolWriter): We don't need to call any
12206         initialization function on the symbol writer anymore.  This method
12207         doesn't take any arguments.
12208
12209 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12210
12211         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12212         from referenced assemblies as well.
12213
12214 2003-02-02  Martin Baulig  <martin@ximian.com>
12215
12216         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12217
12218 2003-02-02  Martin Baulig  <martin@ximian.com>
12219
12220         * class.cs (Constructor.Emit): Open the symbol writer before
12221         emitting the constructor initializer.
12222         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12223         single-stepping through constructor initializers.
12224
12225 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * class.cs: Handle error 549: do not allow virtual methods in
12228         sealed classes. 
12229
12230 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12231
12232         * decl.cs: Check access levels when resolving types
12233
12234 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12235
12236         * statement.cs: Add parameters and locals set in catch blocks that might 
12237         return to set vector
12238
12239 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * class.cs (Operator): Set the SpecialName flags for operators.
12242
12243         * expression.cs (Invocation.DoResolve): Only block calls to
12244         accessors and operators on SpecialName methods.
12245
12246         (Cast.TryReduce): Handle conversions from char constants.
12247
12248
12249 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12250
12251         * statement.cs: small memory and time optimization in FlowBranching.
12252
12253 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12254
12255         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12256         problem that the last fix but in the other sid (Set).
12257
12258         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12259         access when there is no indexer in the hierarchy.
12260
12261 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12262
12263         * class.cs: Combine some if statements.
12264
12265 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12266
12267         * driver.cs: fixed bug #37187.
12268
12269 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12270
12271         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12272         any indexer, it's needed to build a list with all the indexers in the
12273         hierarchy (AllGetters), else we have problems. Fixes #35653.
12274
12275 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12276
12277         * class.cs (MethodData.Define): It is wrong for an interface
12278         implementation to be static in both cases: explicit and implicit.
12279         We were only handling this in one case.
12280
12281         Improve the if situation there to not have negations.
12282
12283         * class.cs (Field.Define): Turns out that we do not need to check
12284         the unsafe bit on field definition, only on usage.  Remove the test.
12285
12286 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12287
12288         * driver.cs: use assembly.Location instead of Codebase (the latest
12289         patch made mcs fail when using MS assemblies).
12290
12291 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12292
12293         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12294         get the path to *corlib.dll.
12295
12296 2003-01-21  Nick Drochak <ndrochak@gol.com>
12297
12298         * cs-tokenizer.cs:
12299         * pending.cs:
12300         * typemanager.cs: Remove compiler warnings
12301
12302 2003-01-20  Duncan Mak  <duncan@ximian.com>
12303
12304         * AssemblyInfo.cs: Bump the version number to 0.19.
12305
12306 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12307
12308         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12309
12310 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12311
12312         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12313
12314 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12315
12316         * cs-parser.jay: Small fix: we were not comparing the constructor
12317         name correctly.   Thanks to Zoltan for the initial pointer.
12318
12319 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12320
12321         * cs-tokenizer.cs: Set file name when specified with #line
12322
12323 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12324
12325         * cs-parser.jay: Only perform the constructor checks here if we
12326         are named like the class;  This will help provider a better
12327         error.  The constructor path is taken when a type definition is
12328         not found, but most likely the user forgot to add the type, so
12329         report that rather than the constructor error.
12330
12331 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12332
12333         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12334         allocations.
12335
12336 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12337
12338         * cs-parser.jay: Add cleanup call.
12339
12340 2003-01-13  Duncan Mak  <duncan@ximian.com>
12341
12342         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12343         consistent with other methods.
12344
12345 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12346
12347         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12348
12349 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12350
12351         * attribute.cs: only set GuidAttr to true when we have a
12352         GuidAttribute.
12353
12354 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12355
12356         * ecore.cs:
12357         * expression.cs:
12358         * typemanager.cs: fixes to allow mcs compile corlib with the new
12359         Type.IsSubclassOf fix.
12360
12361 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12362
12363         * expression.cs (LocalVariableReference.DoResolve): Classify a
12364         constant as a value, not as a variable.   Also, set the type for
12365         the variable.
12366
12367         * cs-parser.jay (fixed_statement): take a type instead of a
12368         pointer_type, so we can produce a better error message later.
12369
12370         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12371         as an error.  
12372
12373         (For.DoEmit): Make inifinite loops have a
12374         non-conditional branch back.
12375
12376         (Fixed.DoEmit): First populate the pinned variables, then emit the
12377         statement, then clear the variables.  Before I was emitting the
12378         code once for each fixed piece.
12379
12380
12381 2003-01-08  Martin Baulig  <martin@ximian.com>
12382
12383         * statement.cs (FlowBranching.MergeChild): A break in a
12384         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12385
12386 2003-01-08  Martin Baulig  <martin@ximian.com>
12387
12388         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12389         lives in the same number space than `param_map'.  Fixes #36154.
12390
12391 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12392
12393         * cs-parser.jay (constructor_declaration): Set the
12394         Constructor.ModFlags before probing for it.  This makes the
12395         compiler report 514, 515 and 132 (the code was there, but got
12396         broken). 
12397
12398         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12399         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12400         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12401
12402 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12403
12404         * enum.cs: create the enum static fields using the enum type.
12405
12406 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12407
12408         * class.cs: don't try to create the ParamBuilder for the return
12409         type if it's not needed (and handle it breaking for the ms runtime
12410         anyway).
12411
12412 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12413
12414         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12415
12416 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12417
12418         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12419         the command.   This showed up while compiling the JANET source
12420         code, which used \r as its only newline separator.
12421
12422 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12423
12424         * class.cs (Method.Define): If we are an operator (because it
12425         reuses our code), then set the SpecialName and HideBySig.  #36128
12426
12427 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12428
12429         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12430         exception, report error 120 `object reference required'.
12431
12432         * driver.cs: Add --pause option, used during to measure the size
12433         of the process as it goes with --timestamp.
12434
12435         * expression.cs (Invocation.DoResolve): Do not allow methods with
12436         SpecialName to be invoked.
12437
12438 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12439
12440         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12441         number before adding it.
12442
12443 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12444
12445         * ecore.cs (StandardImplicitConversion): When in an unsafe
12446         context, we allow conversion between void * to any other pointer
12447         type. This fixes bug #35973.
12448
12449 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12450
12451         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12452         is not thrown when extensionless outputs are used 
12453
12454 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12455
12456         * rootcontext.cs: fixed compilation of corlib.
12457
12458 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12459
12460         * attribute.cs (Attributes.Contains): Add new method.
12461
12462         * class.cs (MethodCore.LabelParameters): if the parameter is an
12463         `out' parameter, check that no attribute `[In]' has been passed.
12464
12465         * enum.cs: Handle the `value__' name in an enumeration.
12466
12467 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12468
12469         * decl.cs: Added special case to allow overrides on "protected
12470         internal" methods
12471
12472 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12473
12474         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12475         since it makes much more sense.
12476
12477         (Attributes.ctor): Don't require a Location parameter.
12478
12479         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12480
12481         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12482         since we already have that information per attribute.
12483
12484         * everywhere : make appropriate changes.
12485
12486         * class.cs (LabelParameters): Write the code which actually
12487         applies attributes to the return type. We can't do this on the MS
12488         .NET runtime so we flag a warning in the case an exception is
12489         thrown.
12490
12491 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12492
12493         * const.cs: Handle implicit null conversions here too.
12494
12495 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12496
12497         * class.cs (MethodCore.LabelParameters): Remove the extra
12498         Type [] parameter since it is completely unnecessary. Instead
12499         pass in the method's attributes so that we can extract
12500         the "return" attribute.
12501
12502 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12503
12504         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12505         of ignoring it and letting the compile continue.
12506
12507         * typemanager.cs (ChangeType): use an extra argument to return an
12508         error condition instead of throwing an exception.
12509
12510 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12511
12512         * expression.cs (Unary.TryReduce): mimic the code for the regular
12513         code path.  Perform an implicit cast in the cases where we can
12514         implicitly convert to one of the integral types, and then reduce
12515         based on that constant.   This fixes bug #35483.
12516
12517 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12518
12519         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12520
12521 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12522
12523         * namespace.cs: fixed bug #35489.
12524
12525 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12526
12527         * class.cs: Remove some dead code.
12528
12529         * cs-parser.jay: Estimate the number of methods needed
12530         (RootContext.MethodCount);
12531
12532         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12533         numbers instead of StringBuilders.
12534
12535         * support.cs (PtrHashtable): Add constructor with initial size;
12536         We can now reduce reallocations of the method table.
12537
12538 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12539
12540         * attribute.cs (ApplyAttributes): Keep track of the emitted
12541         attributes on a per-target basis. This fixes bug #35413.
12542
12543 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12544
12545         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12546         default to the Windows 1252 encoding.
12547
12548         (UnixParseOption): Support version, thanks to Alp for the missing
12549         pointer. 
12550
12551         * AssemblyInfo.cs: Add nice assembly information.
12552
12553         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12554         (bug 35169).
12555
12556         * cs-parser.jay: Allow a trailing comma before the close bracked
12557         in the attribute_section production.
12558
12559         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12560         address of the instance was being taken, I will take this out,
12561         because we take the address of the object immediately here.
12562
12563 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12564
12565         * typemanager.cs (AreMultipleAllowed): Take care of the most
12566         obvious case where attribute type is not in the current assembly -
12567         stupid me ;-)
12568
12569 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12572         definitions, instead of doing that afterwards.  
12573
12574         Also we use a nice little hack, depending on the constructor, we
12575         know if we are a "composed" name or a simple name.  Hence, we
12576         avoid the IndexOf test, and we avoid 
12577
12578         * codegen.cs: Add code to assist in a bug reporter to track down
12579         the source of a compiler crash. 
12580
12581 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12582
12583         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12584         types have been emitted for a given element and flag an error
12585         if something which does not have AllowMultiple set is used more
12586         than once.
12587
12588         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12589         attribute types and their corresponding AllowMultiple properties
12590
12591         (AreMultipleAllowed): Check the property for a given type.
12592
12593         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12594         property in the case we have a TypeContainer.
12595
12596         (Attributes.AddAttribute): Detect duplicates and just skip on
12597         adding them. This trivial fix catches a pretty gross error in our
12598         attribute emission - global attributes were being emitted twice!
12599
12600         Bugzilla bug #33187 is now fixed.
12601
12602 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12603
12604         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12605         instead of pp_and).
12606
12607         * expression.cs (Binary.ResolveOperator): I can only use the
12608         Concat (string, string, string) and Concat (string, string,
12609         string, string) if the child is actually a concatenation of
12610         strings. 
12611
12612 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12613
12614         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12615         context where we need a 2-character lookahead.
12616
12617         * pending.cs (PendingImplementation): Rework so we can keep track
12618         of interface types all the time, and flag those which were
12619         implemented by parents as optional.
12620
12621 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * expression.cs (Binary.ResolveOperator): Use
12624         String.Concat(string,string,string) or
12625         String.Concat(string,string,string,string) when possible. 
12626
12627         * typemanager: More helper methods.
12628
12629
12630 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12631
12632         * pending.cs: remove the bogus return from GetMissingInterfaces()
12633         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12634
12635 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12636
12637         * namespace.cs: avoid duplicated 'using xxx' being added to
12638         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12639         when we get more than one 'using' statement for the same namespace.
12640         Report a CS0105 warning for it.
12641
12642 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12643
12644         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12645         of calling getChar/putback, uses internal knowledge of it.    
12646
12647         (xtoken): Reorder tokenizer so most common patterns are checked
12648         first.  This reduces the compilation time in another 5% (from 8.11s
12649         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12650
12651         The parsing time is 22% of the compilation in mcs, and from that
12652         64% is spent on the tokenization process.  
12653
12654         I tried using a binary search for keywords, but this is slower
12655         than the hashtable.  Another option would be to do a couple of
12656         things:
12657
12658                 * Not use a StringBuilder, instead use an array of chars,
12659                   with a set value.  Notice that this way we could catch
12660                   the 645 error without having to do it *afterwards*.
12661
12662                 * We could write a hand-parser to avoid the hashtable
12663                   compares altogether.
12664
12665         The identifier consumption process takes 37% of the tokenization
12666         time.  Another 15% is spent on is_number.  56% of the time spent
12667         on is_number is spent on Int64.Parse:
12668
12669                 * We could probably choose based on the string length to
12670                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12671                   computations. 
12672
12673         Another 3% is spend on wrapping `xtoken' in the `token' function.
12674
12675         Handle 0xa0 as whitespace (#34752)
12676
12677 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * typemanager.cs (IsCLRType): New routine to tell whether a type
12680         is one of the builtin types.  
12681
12682         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12683         typecode in more places instead of doing pointer comparissions.
12684         We could leverage some knowledge about the way the typecodes are
12685         laid out.
12686
12687         New code to cache namespaces in assemblies, it is currently not
12688         invoked, to be used soon.
12689
12690         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12691
12692         * expression.cs (Binary.ResolveOperator): specially handle
12693         strings, and do not perform user-defined operator overloading for
12694         built-in types.
12695
12696 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12697
12698         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12699         internalcall as it is a pretty simple operation;  Avoid whenever
12700         possible to call Char.IsLetter.
12701
12702         (consume_identifier): Cut by half the number of
12703         hashtable calls by merging the is_keyword and GetKeyword behavior.
12704
12705         Do not short-circuit, because if we do, we
12706         report errors (ie, #if false && true would produce an invalid
12707         directive error);
12708
12709
12710 2002-11-24  Martin Baulig  <martin@ximian.com>
12711
12712         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12713         check constant ranges and report a CS0221.  Fixes #33186.
12714
12715 2002-11-24  Martin Baulig  <martin@ximian.com>
12716
12717         * cs-parser.jay: Make this work for uninitialized variable
12718         declarations in the `for' initializer.  Fixes #32416.
12719
12720 2002-11-24  Martin Baulig  <martin@ximian.com>
12721
12722         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12723         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12724
12725 2002-11-24  Martin Baulig  <martin@ximian.com>
12726
12727         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12728         argument; if true, we also check for user-defined conversions.
12729         This is only needed if both arguments are of a user-defined type.
12730         Fixes #30443, added test-175.cs.
12731         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12732
12733         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12734
12735 2002-11-24  Martin Baulig  <martin@ximian.com>
12736
12737         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12738         function to get the store opcode.
12739         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12740         only emit the Ldelema if the store opcode is Stobj.  You must run
12741         both test-34 and test-167 to test this.  Fixes #34529.
12742
12743 2002-11-23  Martin Baulig  <martin@ximian.com>
12744
12745         * ecore.cs (Expression.MemberLookup): Added additional
12746         `qualifier_type' argument which is used when we're being called
12747         from MemberAccess.DoResolve() and null if we're called from a
12748         SimpleName lookup.
12749         (Expression.MemberLookupFailed): New method to report errors; this
12750         does the CS1540 check and reports the correct error message.
12751
12752         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12753         argument for the CS1540 check and redone the way how we're dealing
12754         with private members.  See the comment in the source code for details.
12755         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12756         `closure_start_type' to `closure_qualifier_type' and check whether
12757         it's not null.  It was not this filter being broken, it was just
12758         being called with the wrong arguments.
12759
12760         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12761         and pass it the correct `qualifier_type'; this also does the error
12762         handling for us.
12763
12764 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12765
12766         * expression.cs (Invocation.EmitParams): If the we are dealing
12767         with a non-built-in value type, load its address as well.
12768
12769         (ArrayCreation): Use a a pretty constant instead
12770         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12771         static initializers.  
12772
12773         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12774         because they are not really value types, just glorified integers. 
12775
12776         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12777
12778         * ecore.cs: Remove redundant code for enumerations, make them use
12779         the same code path as everything else, fixes the casting issue
12780         with enumerations in Windows.Forms.
12781
12782         * attribute.cs: Do only cast to string if it is a string, the
12783         validation happens later.
12784
12785         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12786         people upgrade their corlibs.
12787
12788         * ecore.cs: Oops, enumerations were not following the entire code path
12789
12790 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12791
12792         * typemanager.cs (FilterWithClosure): Commented out the test for
12793         1540 in typemanager.cs, as it has problems when accessing
12794         protected methods from a parent class (see test-174.cs). 
12795
12796         * attribute.cs (Attribute.ValidateGuid): new method.
12797         (Attribute.Resolve): Use above.
12798
12799 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12800
12801         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12802
12803         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12804         handling for enumerations, as we only needed the TypeContainer
12805         functionality to begin with (this is required for the fix below to
12806         work for enums that reference constants in a container class for
12807         example). 
12808
12809         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12810
12811         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12812         a valid TypeBuilder to perform lookups on.o
12813
12814         * class.cs (InheritableMemberSignatureCompare): Use true in the
12815         call to GetGetMethod and GetSetMethod, because we are comparing
12816         the signature, and we need to get the methods *even* if they are
12817         private. 
12818
12819         (PropertyBase.CheckBase): ditto.
12820
12821         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12822         GotoCase.Resolve): Use Peel on EmpytCasts.
12823
12824         * ecore.cs (EmptyCast): drop child, add Peel method.
12825
12826 2002-11-17  Martin Baulig  <martin@ximian.com>
12827
12828         * ecore.cs (EmptyCast.Child): New public property.
12829
12830         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12831         label resolved to an EmptyCast.  Fixes #34162.
12832         (GotoCase.Resolve): Likewise.
12833         (Block.EmitMeta): Likewise.
12834
12835 2002-11-17  Martin Baulig  <martin@ximian.com>
12836
12837         * expression.cs (Invocation.BetterConversion): Prefer int over
12838         uint; short over ushort; long over ulong for integer literals.
12839         Use ImplicitConversionExists instead of StandardConversionExists
12840         since we also need to check for user-defined implicit conversions.
12841         Fixes #34165.  Added test-173.cs.
12842
12843 2002-11-16  Martin Baulig  <martin@ximian.com>
12844
12845         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12846         with the `true' and `false' literals.  Fixes #33151.
12847
12848 2002-11-16  Martin Baulig  <martin@ximian.com>
12849
12850         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12851         October 22nd; don't do the cs1540 check for static members.
12852
12853         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12854         now using our own filter here and doing the cs1540 check again.
12855
12856 2002-11-16  Martin Baulig  <martin@ximian.com>
12857
12858         * support.cs (InternalParameters): Don't crash if we don't have
12859         any fixed parameters.  Fixes #33532.
12860
12861 2002-11-16  Martin Baulig  <martin@ximian.com>
12862
12863         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12864         when looking up static methods to make this work on Windows.
12865         Fixes #33773.
12866
12867 2002-11-16  Martin Baulig  <martin@ximian.com>
12868
12869         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12870         a setter rather than using PropertyInfo.CanWrite.
12871
12872 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12873
12874         * class.cs: Allow acces to block member by subclasses. Fixes build
12875         breaker.
12876
12877 2002-11-14  Martin Baulig  <martin@ximian.com>
12878
12879         * class.cs (Constructor.Emit): Added the extern/block check.
12880         Fixes bug #33678.
12881
12882 2002-11-14  Martin Baulig  <martin@ximian.com>
12883
12884         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12885         iteration while looking for indexers, this is needed because the
12886         indexer may have a different name in our base classes.  Fixed the
12887         error reporting (no indexers at all, not get accessor, no
12888         overloaded match).  Fixes bug #33089.
12889         (IndexerAccess.DoResolveLValue): Likewise.
12890
12891 2002-11-14  Martin Baulig  <martin@ximian.com>
12892
12893         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12894         indexers.  Fixes the first part of bug #33089.
12895         (MethodSignature.InheritableMemberSignatureCompare): Added support
12896         for properties.
12897
12898 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12899
12900         * attribute.cs (Attribute.Resolve): Catch the
12901         NullReferenceException and report it since it isn't supposed to
12902         happen. 
12903
12904 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12905
12906         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12907         LogicalOr and LogicalAnd that can benefit from recursively
12908         handling EmitBranchable.  The code now should be nice for Paolo.
12909
12910 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12911
12912         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12913         the Type lookups, as we perform quite a number of lookups on
12914         non-Types.  This can be removed once we can deterministically tell
12915         whether we have a type or a namespace in advance.
12916
12917         But this might require special hacks from our corlib.
12918
12919         * TODO: updated.
12920
12921         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12922         and double which avoids a conversion from an integer to a double.
12923
12924         * expression.cs: tiny optimization, avoid calling IsConstant,
12925         because it effectively performs the lookup twice.
12926
12927 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12928
12929         But a bogus return here to keep the semantics of the old code
12930         until the Mono runtime is fixed.
12931
12932         * pending.cs (GetMissingInterfaces): New method used to remove all
12933         the interfaces that are already implemented by our parent
12934         classes from the list of pending methods. 
12935
12936         * interface.cs: Add checks for calls after ResolveTypeExpr.
12937
12938 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * class.cs (Class.Emit): Report warning 67: event not used if the
12941         warning level is beyond 3.
12942
12943         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12944         being a NullLiteral.
12945
12946         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12947         specifiers. 
12948
12949         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12950         path that might fail if a type can not be resolved.
12951
12952         * expression.cs (Binary.Emit): Emit unsigned versions of the
12953         operators. 
12954
12955         * driver.cs: use error 5.
12956
12957 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12958
12959         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12960
12961 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12962
12963         * cs-parser.jay (switch_section): A beautiful patch from Martin
12964         Baulig that fixed 33094.
12965
12966 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12967
12968         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12969         Check whether the base is abstract and report an error if so.
12970
12971         * expression.cs (IndexerAccess.DoResolveLValue,
12972         IndexerAccess.DoResolve): ditto. 
12973
12974         (Invocation.DoResolve): ditto.
12975
12976         (Invocation.FullMethodDesc): Improve the report string.
12977
12978         * statement.cs (Block): Eliminate IsVariableDefined as it is
12979         basically just a wrapper for GetVariableInfo.
12980
12981         * ecore.cs (SimpleName): Use new 
12982
12983         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12984         type, as we return the actual parameter ref/unref state on a
12985         different call.
12986
12987 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * support.cs: Return proper flags REF/OUT fixing the previous
12990         commit.  
12991
12992         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12993         not used to mean `ref' but `ref or out' in ParameterReference
12994
12995         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12996         full type signature instead of calling TypeManger.CSharpName
12997         ourselves. 
12998
12999         * support.cs (InternalParameters.ParameterDesc): Do not compare
13000         directly to the modflags, because REF/OUT will actually be bitsets
13001         if set. 
13002
13003         * delegate.cs (VerifyMethod): Check also the modifiers.
13004
13005         * cs-tokenizer.cs: Fix bug where floating point values with an
13006         exponent where a sign was missing was ignored.
13007
13008         * driver.cs: Allow multiple assemblies to be specified in a single
13009         /r: argument
13010
13011 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13012
13013         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13014         because identifiers after a parenthesis would end up in this kind
13015         of production, and we needed to desamiguate it for having casts
13016         like:
13017
13018                 (UserDefinedType *) xxx
13019
13020 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13021
13022         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13023         we should set on the Bindingflags.NonPublic, but not turn on
13024         private_ok.  private_ok controls whether a Private member is
13025         returned (this is chekced on the filter routine), while the
13026         BindingFlags.NonPublic just controls whether private/protected
13027         will be allowed.   This fixes the problem part of the problem of
13028         private properties being allowed to be used in derived classes.
13029
13030         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13031         so we can call the children DoResolveLValue method (this will
13032         properly signal errors on lvalue assignments to base properties)
13033
13034         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13035         getter are null, and we have a property info, we know that this
13036         happened because the lookup failed, so we report an error 122 for
13037         protection level violation.
13038
13039         We also silently return if setter and getter are null in the
13040         resolve functions, this condition only happens if we have flagged
13041         the error before.  This is the other half of the problem. 
13042
13043         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13044         not have accessibility information, that is why we were returning
13045         true in the filter function in typemanager.cs.
13046
13047         To properly report 122 (property is inaccessible because of its
13048         protection level) correctly, we report this error in ResolveAccess
13049         by failing if both the setter and the getter are lacking (ie, the
13050         lookup failed). 
13051
13052         DoResolve and DoLResolve have been modified to check for both
13053         setter/getter being null and returning silently, the reason being
13054         that I did not want to put the knowledge about this error in upper
13055         layers, like:
13056
13057         int old = Report.Errors;
13058         x = new PropertyExpr (...);
13059         if (old != Report.Errors)
13060                 return null;
13061         else
13062                 return x;
13063
13064         So the property expr is returned, but it is invalid, so the error
13065         will be flagged during the resolve process. 
13066
13067         * class.cs: Remove InheritablePropertySignatureCompare from the
13068         class, as we no longer depend on the property signature to compute
13069         whether it is possible to implement a method or not.
13070
13071         The reason is that calling PropertyInfo.GetGetMethod will return
13072         null (in .NET, in Mono it works, and we should change this), in
13073         cases where the Get Method does not exist in that particular
13074         class.
13075
13076         So this code:
13077
13078         class X { public virtual int A { get { return 1; } } }
13079         class Y : X { }
13080         class Z : Y { public override int A { get { return 2; } } }
13081
13082         Would fail in Z because the parent (Y) would not have the property
13083         defined.  So we avoid this completely now (because the alternative
13084         fix was ugly and slow), and we now depend exclusively on the
13085         method names.
13086
13087         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13088         reference method, instead of using the property.
13089
13090         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13091         routines are gone now.
13092
13093         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13094         names, they were incorrectly named.
13095
13096         * cs-tokenizer.cs: Return are more gentle token on failure. 
13097
13098         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13099         had an out-of-sync index variable, which caused it to remove from
13100         the list of pending methods the wrong method sometimes.
13101
13102 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13103
13104         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13105         CanWrite, because those refer to this particular instance of the
13106         property, and do not take into account the fact that we can
13107         override single members of a property.
13108
13109         Constructor requires an EmitContext.  The resolution process does
13110         not happen here, but we need to compute the accessors before,
13111         because the resolution does not always happen for properties.
13112
13113         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13114         subclass, before we did not update this flag, but we did update
13115         bindingflags. 
13116
13117         (GetAccessors): Drop this routine, as it did not work in the
13118         presence of partially overwritten set/get methods. 
13119
13120         Notice that this broke the cs1540 detection, but that will require
13121         more thinking. 
13122
13123 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13124
13125         * class.cs:
13126         * codegen.cs:
13127         * driver.cs: issue a warning instead of an error if we don't support
13128         debugging for the platform. Also ignore a couple of errors that may
13129         arise when trying to write the symbols. Undo my previous patch.
13130
13131 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13132
13133         * driver.cs: ignore /debug switch except for Unix platforms.
13134
13135 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13136
13137         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13138
13139 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13140
13141         * driver.cs: Do not make mcs-debug conditional, so we do not break
13142         builds that use it.
13143
13144         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13145         review this patch.  But basically after all the children variables
13146         have been merged, the value of "Breaks" was not being set to
13147         new_breaks for Switch blocks.  I think that it should be set after
13148         it has executed.  Currently I set this to the value of new_breaks,
13149         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13150         conservative, but I do not understand this code very well.
13151
13152         I did not break anything in the build, so that is good ;-)
13153
13154         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13155
13156 2002-10-20  Mark Crichton  <crichton@gimp.org>
13157
13158         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13159
13160 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13161
13162         * cfold.cs: Fixed compile blocker.
13163
13164 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13165
13166         * driver.cs: I was chekcing the key, not the file.
13167
13168 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13169
13170         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13171         message that we were generating - we just need to silently return
13172         a null.
13173
13174 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13175
13176         * class.cs (Event.Define): Change my previous commit, as this
13177         breaks the debugger.  This is a temporary hack, as it seems like
13178         the compiler is generating events incorrectly to begin with.
13179
13180         * expression.cs (Binary.ResolveOperator): Added support for 
13181         "U operator - (E x, E y)"
13182
13183         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13184         y)".
13185
13186         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13187         init-only variables, but this path did not take into account that
13188         there might be also instance readonly variables.  Correct this
13189         problem. 
13190
13191         This fixes bug 32253
13192
13193         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13194         delegates as well.
13195
13196         * driver.cs: Change the extension for modules to `netmodule'
13197
13198         * cs-parser.jay: Improved slightly the location tracking for
13199         the debugger symbols.
13200
13201         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13202         modifiers that were specified instead of the hardcoded value
13203         (FamAndAssem).  This was basically ignoring the static modifier,
13204         and others.  Fixes 32429.
13205
13206         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13207         fixed a bug in the process (32476)
13208
13209         * expression.cs (ArrayAccess.EmitAssign): Patch from
13210         hwang_rob@yahoo.ca that fixes bug 31834.3
13211
13212 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13213
13214         * driver.cs: Make the module extension .netmodule.
13215
13216 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * driver.cs: Report an error if the resource file is not found
13219         instead of crashing.
13220
13221         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13222         false, like Emit does.
13223
13224 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13225
13226         * typemanager.cs: Remove unused private member.  Also reported mcs
13227         bug to report this as a warning like csc.
13228
13229 2002-10-15  Martin Baulig  <martin@gnome.org>
13230
13231         * statement.cs (Statement.Emit): Made this a virtual method; emits
13232         the line number info and calls DoEmit().
13233         (Statement.DoEmit): New protected abstract method, formerly knows
13234         as Statement.Emit().
13235
13236         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13237
13238 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13239
13240         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13241         have fixed a remaining problem: not every AddXXXX was adding a
13242         fully qualified name.  
13243
13244         Now everyone registers a fully qualified name in the DeclSpace as
13245         being defined instead of the partial name.  
13246
13247         Downsides: we are slower than we need to be due to the excess
13248         copies and the names being registered this way.  
13249
13250         The reason for this is that we currently depend (on the corlib
13251         bootstrap for instance) that types are fully qualified, because
13252         we dump all the types in the namespace, and we should really have
13253         types inserted into the proper namespace, so we can only store the
13254         basenames in the defined_names array.
13255
13256 2002-10-10  Martin Baulig  <martin@gnome.org>
13257
13258         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13259         from bug #31834, see the bug report for a testcase which is
13260         miscompiled.
13261
13262 2002-10-10  Martin Baulig  <martin@gnome.org>
13263
13264         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13265         flow analysis code for this.
13266
13267         * statement.cs (Do, While, For): Tell the flow analysis code about
13268         infinite loops.
13269         (FlowBranching.UsageVector): Added support for infinite loops.
13270         (Block.Resolve): Moved the dead code elimination here and use flow
13271         analysis to do it.
13272
13273 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13274
13275         * class.cs (Field.Define): Catch cycles on struct type
13276         definitions. 
13277
13278         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13279         fields if the fields are static.  We only need to check instance
13280         fields. 
13281
13282         * expression.cs (As.DoResolve): Test for reference type.
13283
13284         * statement.cs (Using.ResolveExpression): Use
13285         ConvertImplicitRequired, not ConvertImplicit which reports an
13286         error on failture
13287         (Using.ResolveLocalVariableDecls): ditto.
13288
13289         * expression.cs (Binary.ResolveOperator): Report errors in a few
13290         places where we had to.
13291
13292         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13293
13294 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13295
13296         * expression.cs: Use StoreFromPtr instead of extracting the type
13297         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13298
13299         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13300         an enumeration value to a System.Enum, but System.Enum is not a
13301         value type, but an class type, so we need to box.
13302
13303         (Expression.ConvertExplicit): One codepath could return
13304         errors but not flag them.  Fix this.  Fixes #31853
13305
13306         * parameter.cs (Resolve): Do not allow void as a parameter type.
13307
13308 2002-10-06  Martin Baulig  <martin@gnome.org>
13309
13310         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13311         if it's a class type and not a struct.  Fixes #31815.
13312
13313 2002-10-06  Martin Baulig  <martin@gnome.org>
13314
13315         * statement.cs: Reworked the flow analysis code a bit to make it
13316         usable for dead code elimination.
13317
13318 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13319
13320         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13321
13322 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13323
13324         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13325         to fix the test 165, will investigate deeper.
13326
13327 2002-10-04  Martin Baulig  <martin@gnome.org>
13328
13329         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13330         finally blocks actually work.
13331         (Try.Resolve): We don't need to create a sibling for `finally' if
13332         there is no finally block.
13333
13334 2002-10-04  Martin Baulig  <martin@gnome.org>
13335
13336         * class.cs (Constructor.Define): The default accessibility for a
13337         non-default constructor is private, not public.
13338
13339 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13340
13341         * class.cs (Constructor): Make AllowedModifiers public, add
13342         EXTERN.
13343
13344         * cs-parser.jay: Perform the modifiers test here, as the
13345         constructor for the Constructor class usually receives a zero
13346         because of the way we create it (first we create, later we
13347         customize, and we were never checking the modifiers).
13348
13349         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13350         is a version of LookupTypeReflection that includes the type-name
13351         cache.  This can be used as a fast path for functions that know
13352         the fully qualified name and are only calling into *.GetType() to
13353         obtain a composed type.
13354
13355         This is also used by TypeManager.LookupType during its type
13356         composition.
13357
13358         (LookupType): We now also track the real type name, as sometimes
13359         we can get a quey for the real type name from things like
13360         ComposedCast.  This fixes bug 31422.
13361
13362         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13363         complete type fullname, it does not have to go through the type
13364         resolution system to obtain the composed version of the type (for
13365         obtaining arrays or pointers).
13366
13367         (Conditional.Emit): Use the EmitBoolExpression to
13368         generate nicer code, as requested by Paolo.
13369
13370         (ArrayCreation.CheckIndices): Use the patch from
13371         hwang_rob@yahoo.ca to validate the array initializers. 
13372
13373 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13374
13375         * class.cs (ConstructorInitializer.Emit): simplify code by using
13376         Invocation.EmitCall, and at the same time, fix the bugs in calling
13377         parent constructors that took variable arguments. 
13378
13379         * ecore.cs (Expression.ConvertNumericExplicit,
13380         Expression.ImplicitNumericConversion): Remove the code that
13381         manually wrapped decimal (InternalTypeConstructor call is now gone
13382         as well).
13383
13384         * expression.cs (Cast.TryReduce): Also handle decimal types when
13385         trying to perform a constant fold on the type.
13386
13387         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13388
13389         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13390         that only turned off an error report, and did nothing else. 
13391
13392 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13393
13394         * driver.cs: Handle and ignore /fullpaths
13395
13396 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * expression.cs (Binary.ResolveOperator): Catch the case where
13399         DoNumericPromotions returns true, 
13400
13401         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13402
13403 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13406         report error 70.
13407
13408 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13409
13410         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13411         conversion exists, but it is also required that the conversion be
13412         performed.  This manifested in "(Type64Enum) 2".  
13413
13414         * class.cs (TypeManager.AddMethod): The fix is not to change
13415         AddEnum, because that one was using a fully qualified name (every
13416         DeclSpace derivative does), but to change the AddMethod routine
13417         that was using an un-namespaced name.  This now correctly reports
13418         the duplicated name.
13419
13420         Revert patch until I can properly fix it.  The issue
13421         is that we have a shared Type space across all namespaces
13422         currently, which is wrong.
13423
13424         Options include making the Namespace a DeclSpace, and merge
13425         current_namespace/current_container in the parser.
13426
13427 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13428
13429         * cs-parser.jay: Improve error reporting when we get a different
13430         kind of expression in local_variable_type and
13431         local_variable_pointer_type. 
13432
13433         Propagate this to avoid missleading errors being reported.
13434
13435         * ecore.cs (ImplicitReferenceConversion): treat
13436         TypeManager.value_type as a target just like object_type.   As
13437         code like this:
13438
13439         ValueType v = 1;
13440
13441         Is valid, and needs to result in the int 1 being boxed before it
13442         is assigned to the value type v.
13443
13444         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13445         to validate the enumeration name.
13446
13447         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13448         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13449         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13450
13451         * ecore.cs (TryImplicitIntConversion): When doing an
13452         implicit-enumeration-conversion, check if the type is 64-bits and
13453         perform a conversion before passing to EnumConstant.
13454
13455 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13458         report ambiguous type references.  Unlike the MS version, we
13459         report what the ambiguity is.   Innovation at work ;-)
13460
13461         (DeclSpace.FindType): Require a location argument to
13462         display when we display an ambiguous error.
13463
13464         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13465
13466         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13467
13468         * expression.cs (EmitDynamicInitializers): Apply patch from
13469         hwang_rob@yahoo.ca that fixes the order in which we emit our
13470         initializers. 
13471
13472 2002-09-21  Martin Baulig  <martin@gnome.org>
13473
13474         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13475         delegate takes no arguments.
13476
13477 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13478
13479         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13480         from integers.
13481
13482         * expression.cs: Extract the underlying type.
13483
13484         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13485
13486         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13487
13488 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * class.cs (TypeContainer.DefineType): We can not use the nice
13491         PackingSize with the size set to 1 DefineType method, because it
13492         will not allow us to define the interfaces that the struct
13493         implements.
13494
13495         This completes the fixing of bug 27287
13496
13497         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13498         means also structs.  This fixes part of the problem. 
13499         (Expresion.ImplicitReferenceConversionExists): ditto.
13500
13501         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13502         error if there were no errors reported during the type lookup
13503         process, to avoid duplicates or redundant errors.  Without this
13504         you would get an ambiguous errors plus a type not found.  We have
13505         beaten the user enough with the first error.  
13506
13507         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13508         reference. 
13509
13510         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13511         during the resolution process, stop the lookup, this avoids
13512         repeated error reports (same error twice).
13513
13514         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13515
13516         * typemanager.cs (LookupType): Redo the type lookup code to match
13517         the needs of System.Reflection.  
13518
13519         The issue is that System.Reflection requires references to nested
13520         types to begin with a "+" sign instead of a dot.  So toplevel
13521         types look like: "NameSpace.TopLevelClass", and nested ones look
13522         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13523         levels. 
13524
13525 2002-09-19  Martin Baulig  <martin@gnome.org>
13526
13527         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13528         says that a method always returns or always throws an exception,
13529         don't report the CS0161.
13530
13531         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13532         set `Returns = new_returns'.
13533
13534 2002-09-19  Martin Baulig  <martin@gnome.org>
13535
13536         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13537         to an enum constant, check for a CS0176.
13538
13539 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13540
13541         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13542         for operators that must be in pairs and report errors.
13543
13544         * ecore.cs (SimpleName.DoResolveType): During the initial type
13545         resolution process, when we define types recursively, we must
13546         check first for types in our current scope before we perform
13547         lookups in the enclosing scopes.
13548
13549         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13550
13551         (Invocation.VerifyArgumentsCompat): Call
13552         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13553         I thought we were supposed to always call this, but there are a
13554         few places in the code where we dont do it.
13555
13556 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13557
13558         * driver.cs: Add support in -linkres and -resource to specify the
13559         name of the identifier.
13560
13561 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13562
13563         * ecore.cs (StandardConversionExists): Sync with the conversion
13564         code: allow anything-* to void* conversions.
13565
13566         (FindMostSpecificSource): Use an Expression argument
13567         instead of a Type, because we might be handed over a Literal which
13568         gets a few more implicit conversions that plain types do not.  So
13569         this information was being lost.
13570
13571         Also, we drop the temporary type-holder expression when not
13572         required.
13573
13574 2002-09-17  Martin Baulig  <martin@gnome.org>
13575
13576         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13577         this is an explicit interface implementation.
13578
13579 2002-09-17  Martin Baulig  <martin@gnome.org>
13580
13581         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13582         different `IndexerName' attributes.
13583
13584         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13585         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13586         virtual CommonResolve().
13587
13588 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13589
13590         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13591         and convert that to the UnderlyingType.
13592
13593         * statement.cs (Foreach.Resolve): Indexers are just like variables
13594         or PropertyAccesses.
13595
13596         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13597         inside quoted strings, we were not doing this before.
13598
13599 2002-09-16  Martin Baulig  <martin@gnome.org>
13600
13601         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13602         resolve it.  This is needed for the definite assignment check of the
13603         instance expression, fixes bug #29846.
13604         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13605
13606 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13607
13608         * parameter.cs: Fix compile error.  Cannot reference static member
13609         from an instance object.  Is this an mcs bug?
13610
13611 2002-09-14  Martin Baulig  <martin@gnome.org>
13612
13613         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13614         multiple times.  Fixes bug #30295, added test-166.cs.
13615
13616 2002-09-14  Martin Baulig  <martin@gnome.org>
13617
13618         * statement.cs (Block.Emit): Don't emit unreachable code.
13619         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13620         `break' statements.
13621         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13622
13623 2002-09-14  Martin Baulig  <martin@gnome.org>
13624
13625         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13626         is set.
13627
13628 2002-09-14  Martin Baulig  <martin@gnome.org>
13629
13630         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13631         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13632         be false on the ms runtime.
13633
13634 2002-09-13  Martin Baulig  <martin@gnome.org>
13635
13636         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13637         the CS0038 error message.
13638
13639 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13640
13641         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13642         constant inside, return it.
13643
13644 2002-09-12  Martin Baulig  <martin@gnome.org>
13645
13646         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13647         implicit conversion can be done between enum types.
13648
13649         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13650         check whether an implicit conversion to the current enum's UnderlyingType
13651         exists and report an error if not.
13652
13653         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13654         without debugging support.
13655
13656         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13657         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13658
13659 2002-09-12  Martin Baulig  <martin@gnome.org>
13660
13661         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13662
13663         * ecore.cs (IMemberExpr.DeclaringType): New property.
13664         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13665         nonstatic member of an outer type (CS0038).
13666
13667 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * driver.cs: Activate the using-error detector at warning level
13670         4 (at least for MS-compatible APIs).
13671
13672         * namespace.cs (VerifyUsing): Small buglett fix.
13673
13674         * pending.cs (PendingImplementation): pass the container pointer. 
13675
13676         * interface.cs (GetMethods): Allow for recursive definition.  Long
13677         term, I would like to move every type to support recursive
13678         definitions, not the current ordering mechanism that we have right
13679         now.
13680
13681         The situation is this: Attributes are handled before interfaces,
13682         so we can apply attributes to interfaces.  But some attributes
13683         implement interfaces, we will now handle the simple cases
13684         (recursive definitions will just get an error).  
13685
13686         * parameter.cs: Only invalidate types at the end if we fail to
13687         lookup all types.  
13688
13689 2002-09-09  Martin Baulig  <martin@gnome.org>
13690
13691         * ecore.cs (PropertyExpr.Emit): Also check for
13692         TypeManager.system_int_array_get_length so this'll also work when
13693         compiling corlib.  Fixes #30003.
13694
13695 2002-09-09  Martin Baulig  <martin@gnome.org>
13696
13697         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13698         and throw an exception if we can't get the type's size.  Fixed #30040,
13699         added test-165.cs.
13700
13701 2002-09-09  Martin Baulig  <martin@gnome.org>
13702
13703         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13704
13705         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13706         context.  Fixes bug #30027.
13707
13708         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13709         virtual functions.  Fixes bug #30043, added test-164.cs.
13710
13711 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13712
13713         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13714
13715 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13716
13717         * driver.cs: Use an object to get the windows codepage since it's not a
13718         static property.
13719
13720 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13721
13722         * statement.cs (For.Emit): for infinite loops (test == null)
13723         return whether there is a break inside, not always "true".
13724
13725         * namespace.cs (UsingEntry): New struct to hold the name of the
13726         using definition, the location where it is defined, and whether it
13727         has been used in a successful type lookup.
13728
13729         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13730         strings.
13731
13732         * decl.cs: ditto.
13733
13734 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13735
13736         * attribute.cs : Fix incorrect code which relied on catching
13737         a NullReferenceException to detect a null being passed in
13738         where an object was expected.
13739
13740 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13741
13742         * statement.cs (Try): flag the catch variable as assigned
13743
13744         * expression.cs (Cast): Simplified by using ResolveType instead of
13745         manually resolving.
13746
13747         * statement.cs (Catch): Fix bug by using ResolveType.
13748
13749 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13750
13751         * expression.cs (BetterConversion): Special case for when we have
13752         a NullLiteral as the argument and we have to choose between string
13753         and object types - we choose string the way csc does.
13754
13755         * attribute.cs (Attribute.Resolve): Catch the
13756         NullReferenceException and report error #182 since the Mono
13757         runtime no more has the bug and having this exception raised means
13758         we tried to select a constructor which takes an object and is
13759         passed a null.
13760
13761 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13762
13763         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13764         message (1502, 1503) when we can't locate a method after overload
13765         resolution. This is much more informative and closes the bug
13766         Miguel reported.
13767
13768         * interface.cs (PopulateMethod): Return if there are no argument
13769         types. Fixes a NullReferenceException bug.
13770
13771         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13772         expressions too. Previously we were checking only in one place for
13773         positional arguments leaving out named arguments.
13774
13775         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13776         type to the enum type is not allowed. Remove code corresponding to
13777         that.
13778
13779         (ConvertNumericExplicit): Allow explicit conversions from
13780         the underlying type to enum type. This precisely follows the spec
13781         and closes a bug filed by Gonzalo.
13782
13783 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13784
13785         * compiler.csproj:
13786         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13787
13788 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13789
13790         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13791         it was important that we stored the right value after the
13792         reduction in `converted'.
13793
13794 2002-09-04  Martin Baulig  <martin@gnome.org>
13795
13796         * location.cs (Location.SymbolDocument): Use full pathnames for the
13797         source files.
13798
13799 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13800
13801         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13802         of the expression resolve mechanism, because that will catch the
13803         SimpleName error failures.
13804
13805         (Conditional): If we can not resolve the
13806         expression, return, do not crash.
13807
13808 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13809
13810         * cs-tokenizer.cs:
13811         (location): display token name instead of its number.
13812
13813 2002-08-28  Martin Baulig  <martin@gnome.org>
13814
13815         * expression.cs (Binary.ResolveOperator): Don't silently return
13816         but return an error if an operator cannot be applied between two
13817         enum types.
13818
13819 2002-08-28  Martin Baulig  <martin@gnome.org>
13820
13821         * class.cs (Constructor.Define): Set the permission attributes
13822         correctly instead of making all constructors public.
13823
13824 2002-08-28  Martin Baulig  <martin@gnome.org>
13825
13826         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13827         for private members before reporting a CS0103; if we find anything,
13828         it's a CS0122.
13829
13830 2002-08-28  Martin Baulig  <martin@gnome.org>
13831
13832         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13833         to check whether `closure_start_type == closure_invocation_type',
13834         we also need to check whether `m.DeclaringType == closure_invocation_type'
13835         before bypassing the permission checks.  We might be accessing
13836         protected/private members from the base class.
13837         (TypeManager.RealMemberLookup): Only set private_ok if private
13838         members were requested via BindingFlags.NonPublic.
13839
13840         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13841
13842         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13843         MethodGroupExpr.IsExplicitImpl if appropriate.
13844         (Invocation.DoResolve): Don't report the CS0120 for explicit
13845         interface implementations.
13846
13847 2002-08-27  Martin Baulig  <martin@gnome.org>
13848
13849         * expression.cs (Invocation.DoResolve): If this is a static
13850         method and we don't have an InstanceExpression, we must report
13851         a CS0120.
13852
13853 2002-08-25  Martin Baulig  <martin@gnome.org>
13854
13855         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13856         `==' between a valuetype and an object.
13857
13858 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13859
13860         * ecore.cs (TypeExpr): Provide a ToString method.
13861
13862 2002-08-24  Martin Baulig  <martin@gnome.org>
13863
13864         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13865         now called proggie.dbg and it's a binary file.
13866
13867 2002-08-23  Martin Baulig  <martin@gnome.org>
13868
13869         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13870
13871 2002-08-23  Martin Baulig  <martin@gnome.org>
13872
13873         * struct.cs (MyStructInfo.ctor): Make this work with empty
13874         structs; it's not allowed to use foreach() on null.
13875
13876 2002-08-23  Martin Baulig  <martin@gnome.org>
13877
13878         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13879         writer the full pathname of the generated assembly.
13880
13881 2002-08-23  Martin Baulig  <martin@gnome.org>
13882
13883         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13884         A `finally' block never returns or breaks; improved handling of
13885         unreachable code.
13886
13887 2002-08-23  Martin Baulig  <martin@gnome.org>
13888
13889         * statement.cs (Throw.Resolve): Allow `throw null'.
13890
13891 2002-08-23  Martin Baulig  <martin@gnome.org>
13892
13893         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13894         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13895         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13896         MemberLookup would return a wrong event if this is an explicit
13897         interface implementation and the class has an event with the same
13898         name.
13899
13900 2002-08-23  Martin Baulig  <martin@gnome.org>
13901
13902         * statement.cs (Block.AddChildVariableNames): New public method.
13903         (Block.AddChildVariableName): Likewise.
13904         (Block.IsVariableNameUsedInChildBlock): Likewise.
13905         (Block.AddVariable): Check whether a variable name has already
13906         been used in a child block.
13907
13908         * cs-parser.jay (declare_local_variables): Mark all variable names
13909         from the current block as being used in a child block in the
13910         implicit block.
13911
13912 2002-08-23  Martin Baulig  <martin@gnome.org>
13913
13914         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13915         find the symbol writer.
13916
13917         * driver.cs: csc also allows the arguments to /define being
13918         separated by commas, not only by semicolons.
13919
13920 2002-08-23  Martin Baulig  <martin@gnome.org>
13921
13922         * interface.cs (Interface.GetMembers): Added static check for events.
13923
13924 2002-08-15  Martin Baulig  <martin@gnome.org>
13925
13926         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13927         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13928
13929         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13930         why the MethodData.EmitDestructor() change was necessary.
13931
13932 2002-08-20  Martin Baulig  <martin@gnome.org>
13933
13934         * class.cs (TypeContainer.FindMembers): Added static check for events.
13935
13936         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13937
13938         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13939         use Type.GetEvents(), not Type.FindMembers().
13940
13941 2002-08-20  Martin Baulig  <martin@gnome.org>
13942
13943         * decl.cs (MemberCache): Added a special method cache which will
13944         be used for method-only searched.  This ensures that a method
13945         search will return a MethodInfo with the correct ReflectedType for
13946         inherited methods.      
13947
13948 2002-08-20  Martin Baulig  <martin@gnome.org>
13949
13950         * decl.cs (DeclSpace.FindMembers): Made this public.
13951
13952 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13953
13954         * delegate.cs: fixed build on windows.
13955         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13956
13957 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13958
13959         * ecore.cs (StandardConversionExists): Return a false
13960         if we are trying to convert the void type to anything else
13961         since that is not allowed.
13962
13963         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13964         we flag error 70 in the event an event is trying to be accessed
13965         directly from outside the declaring type.
13966
13967 2002-08-20  Martin Baulig  <martin@gnome.org>
13968
13969         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13970         MemberCache from typemanager.cs to decl.cs.
13971
13972 2002-08-19  Martin Baulig  <martin@gnome.org>
13973
13974         * class.cs (TypeContainer): Implement IMemberContainer.
13975         (TypeContainer.DefineMembers): Create the MemberCache.
13976         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13977         return public members if BindingFlags.Public was given, check
13978         whether members are static.
13979
13980 2002-08-16  Martin Baulig  <martin@gnome.org>
13981
13982         * decl.cs (DeclSpace.Define): Splitted this in Define and
13983         DefineMembers.  DefineMembers is called first and initializes the
13984         MemberCache.
13985
13986         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13987         DefineMembers() on all our DeclSpaces.
13988
13989         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13990         but call DefineMembers() on all nested interfaces.  We call their
13991         Define() in our new Define() function.
13992
13993         * interface.cs (Interface): Implement IMemberContainer.
13994         (Interface.Define): Moved all code except the attribute stuf to
13995         DefineMembers().
13996         (Interface.DefineMembers): Initialize the member cache.
13997
13998         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13999         need this anymore since we can use MemberCache.FindMembers directly.
14000
14001 2002-08-19  Martin Baulig  <martin@gnome.org>
14002
14003         * typemanager.cs (MemberCache): When creating the cache for an
14004         interface type, add all inherited members.
14005         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14006         to `out bool used_cache' and documented it.
14007         (TypeManager.MemberLookup): If we already used the cache in the first
14008         iteration, we don't need to do the interfaces check.
14009
14010 2002-08-19  Martin Baulig  <martin@gnome.org>
14011
14012         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14013         here from IMemberFinder and don't implement this interface anymore.
14014         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14015
14016         * typemanager.cs (IMemberFinder): This interface is now only used by
14017         classes which actually support the member cache.
14018         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14019         since we only put DeclSpaces into this Hashtable.
14020         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14021         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14022
14023 2002-08-16  Martin Baulig  <martin@gnome.org>
14024
14025         * typemanager.cs (ICachingMemberFinder): Removed.
14026         (IMemberFinder.MemberCache): New property.
14027         (TypeManager.FindMembers): Merged this with RealFindMembers().
14028         This function will never be called from TypeManager.MemberLookup()
14029         so we can't use the cache here, just the IMemberFinder.
14030         (TypeManager.MemberLookup_FindMembers): Check whether the
14031         IMemberFinder has a MemberCache and call the cache's FindMembers
14032         function.
14033         (MemberCache): Rewrote larger parts of this yet another time and
14034         cleaned it up a bit.
14035
14036 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14037
14038         * driver.cs (LoadArgs): Support quoting.
14039
14040         (Usage): Show the CSC-like command line arguments.
14041
14042         Improved a few error messages.
14043
14044 2002-08-15  Martin Baulig  <martin@gnome.org>
14045
14046         * typemanager.cs (IMemberContainer.Type): New property.
14047         (IMemberContainer.IsInterface): New property.
14048
14049         The following changes are conditional to BROKEN_RUNTIME, which is
14050         defined at the top of the file.
14051
14052         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14053         class'es members, but add all members from TypeHandle.ObjectType
14054         if we're an interface.
14055         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14056         is the current type.
14057         (MemberCache.CacheEntry.Container): Removed this field.
14058         (TypeHandle.GetMembers): Include inherited members.
14059
14060 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14061
14062         * typemanager.cs: fixed compilation and added a comment on a field that
14063         is never used.
14064
14065 2002-08-15  Martin Baulig  <martin@gnome.org>
14066
14067         * class.cs (ConstructorInitializer.Resolve): In the
14068         Expression.MemberLookup call, use the queried_type as
14069         invocation_type.
14070
14071         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14072         declared' attribute, it's always true.
14073         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14074         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14075         temporary wrapper for FindMembers which tells MemberLookup whether
14076         members from the base classes are included in the return value.
14077         This will go away soon.
14078         (TypeManager.MemberLookup): Use this temporary hack here; once the
14079         new MemberCache is completed, we don't need to do the DeclaredOnly
14080         looping here anymore since the MemberCache will take care of this.
14081         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14082         (MemberCache): When creating the MemberCache for a class, get
14083         members from the current class and all its base classes.
14084         (MemberCache.CacheEntry.Container): New field.  This is a
14085         temporary hack until the Mono runtime is fixed to distinguish
14086         between ReflectedType and DeclaringType.  It allows us to use MCS
14087         with both the MS runtime and the unfixed Mono runtime without
14088         problems and without accecting performance.
14089         (MemberCache.SearchMembers): The DeclaredOnly looping from
14090         TypeManager.MemberLookup is now done here.      
14091
14092 2002-08-14  Martin Baulig  <martin@gnome.org>
14093
14094         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14095         Type.GetFields on dynamic types but get the fields from the
14096         corresponding TypeContainer.
14097         (MyStructInfo.GetStructInfo): Added check for enum types.
14098
14099         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14100         (MemberList.SyncRoot): Implemented.
14101         (TypeManager.FilterWithClosure): No need to check permissions if
14102         closure_start_type == closure_invocation_type, don't crash if
14103         closure_invocation_type is null.
14104
14105 2002-08-13  Martin Baulig  <martin@gnome.org>
14106
14107         Rewrote TypeContainer.FindMembers to use a member cache.  This
14108         gives us a speed increase of about 35% for the self-hosting MCS
14109         build and of about 15-20% for the class libs (both on GNU/Linux).
14110
14111         * report.cs (Timer): New class to get enhanced profiling.  This
14112         whole class is "TIMER" conditional since it remarkably slows down
14113         compilation speed.
14114
14115         * class.cs (MemberList): New class.  This is an IList wrapper
14116         which we're now using instead of passing MemberInfo[]'s around to
14117         avoid copying this array unnecessarily.
14118         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14119         (ICachingMemberFinder, IMemberContainer): New interface.
14120         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14121         has already been checked, otherwise use it for the name comparision.
14122         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14123         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14124         if possible.  Returns a MemberList, not a MemberInfo [].
14125         (TypeHandle): New class, implements IMemberContainer.  We create
14126         one instance of this class per type, it contains a MemberCache
14127         which is used to do the member lookups.
14128         (MemberCache): New class.  Each instance of this class contains
14129         all members of a type and a name-based hash table.
14130         (MemberCache.FindMembers): This is our new member lookup
14131         function.  First, it looks up all members of the requested name in
14132         the hash table.  Then, it walks this list and sorts out all
14133         applicable members and returns them.
14134
14135 2002-08-13  Martin Baulig  <martin@gnome.org>
14136
14137         In addition to a nice code cleanup, this gives us a performance
14138         increase of about 1.4% on GNU/Linux - not much, but it's already
14139         half a second for the self-hosting MCS compilation.
14140
14141         * typemanager.cs (IMemberFinder): New interface.  It is used by
14142         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14143         Enum, Delegate or Interface.
14144         (TypeManager.finder_to_member_finder): New PtrHashtable.
14145         (TypeManager.finder_to_container): Removed.
14146         (TypeManager.finder_to_delegate): Removed.
14147         (TypeManager.finder_to_interface): Removed.
14148         (TypeManager.finder_to_enum): Removed.
14149
14150         * interface.cs (Interface): Implement IMemberFinder.
14151
14152         * delegate.cs (Delegate): Implement IMemberFinder.
14153
14154         * enum.cs (Enum): Implement IMemberFinder.
14155
14156         * class.cs (TypeContainer): Implement IMemberFinder.
14157
14158 2002-08-12  Martin Baulig  <martin@gnome.org>
14159
14160         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14161
14162 2002-08-12  Martin Baulig  <martin@gnome.org>
14163
14164         * ecore.cs (ITypeExpression): New interface for expressions which
14165         resolve to a type.
14166         (TypeExpression): Renamed to TypeLookupExpression.
14167         (Expression.DoResolve): If we're doing a types-only lookup, the
14168         expression must implement the ITypeExpression interface and we
14169         call DoResolveType() on it.
14170         (SimpleName): Implement the new ITypeExpression interface.
14171         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14172         hack, the situation that we're only looking up types can't happen
14173         anymore when this method is called.  Moved the type lookup code to
14174         DoResolveType() and call it.
14175         (SimpleName.DoResolveType): This ITypeExpression interface method
14176         is now doing the types-only lookup.
14177         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14178         (ResolveFlags): Added MaskExprClass.
14179
14180         * expression.cs (MemberAccess): Implement the ITypeExpression
14181         interface.
14182         (MemberAccess.DoResolve): Added support for a types-only lookup
14183         when we're called via ITypeExpression.DoResolveType().
14184         (ComposedCast): Implement the ITypeExpression interface.
14185
14186         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14187         Expression.Resolve() with ResolveFlags.Type instead.
14188
14189 2002-08-12  Martin Baulig  <martin@gnome.org>
14190
14191         * interface.cs (Interface.Define): Apply attributes.
14192
14193         * attribute.cs (Attribute.ApplyAttributes): Added support for
14194         interface attributes.
14195
14196 2002-08-11  Martin Baulig  <martin@gnome.org>
14197
14198         * statement.cs (Block.Emit): Only check the "this" variable if we
14199         do not always throw an exception.
14200
14201         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14202         whether the property has a set accessor.
14203
14204 2002-08-11  Martin Baulig  <martin@gnome.org>
14205
14206         Added control flow analysis support for structs.
14207
14208         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14209         with control flow analysis turned off.
14210         (IVariable): New interface.
14211         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14212         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14213         (FieldExpr.DoResolve): Resolve the instance expression with flow
14214         analysis turned off and do the definite assignment check after the
14215         resolving when we know what the expression will resolve to.
14216
14217         * expression.cs (LocalVariableReference, ParameterReference):
14218         Implement the new IVariable interface, only call the flow analysis
14219         code if ec.DoFlowAnalysis is true.
14220         (This): Added constructor which takes a Block argument.  Implement
14221         the new IVariable interface.
14222         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14223         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14224         This does the definite assignment checks for struct members.
14225
14226         * class.cs (Constructor.Emit): If this is a non-static `struct'
14227         constructor which doesn't have any initializer, call
14228         Block.AddThisVariable() to tell the flow analysis code that all
14229         struct elements must be initialized before control returns from
14230         the constructor.
14231
14232         * statement.cs (MyStructInfo): New public class.
14233         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14234         argument to this indexer.  If non-zero, check an individual struct
14235         member, not the whole struct.
14236         (FlowBranching.CheckOutParameters): Check struct members.
14237         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14238         overloaded versions of these methods which take an additional
14239         `int field_idx' argument to check struct members.
14240         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14241         overloaded versions of these methods which take an additional
14242         `string field_name' argument to check struct member.s
14243         (VariableInfo): Implement the IVariable interface.
14244         (VariableInfo.StructInfo): New public property.  Returns the
14245         MyStructInfo instance of the variable if it's a struct or null.
14246         (Block.AddThisVariable): New public method.  This is called from
14247         Constructor.Emit() for non-static `struct' constructor which do
14248         not have any initializer.  It creates a special variable for the
14249         "this" instance variable which will be checked by the flow
14250         analysis code to ensure that all of the struct's fields are
14251         initialized before control returns from the constructor.
14252         (UsageVector): Added support for struct members.  If a
14253         variable/parameter is a struct with N members, we reserve a slot
14254         in the usage vector for each member.  A struct is considered fully
14255         initialized if either the struct itself (slot 0) or all its
14256         members are initialized.
14257
14258 2002-08-08  Martin Baulig  <martin@gnome.org>
14259
14260         * driver.cs (Driver.MainDriver): Only report an error CS5001
14261         if there were no compilation errors.
14262
14263         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14264         `UnsafeContext' property to determine whether the parent is in
14265         unsafe context rather than checking the parent's ModFlags:
14266         classes nested in an unsafe class are unsafe as well.
14267
14268 2002-08-08  Martin Baulig  <martin@gnome.org>
14269
14270         * statement.cs (UsageVector.MergeChildren): Distinguish between
14271         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14272         we return.  Added test17() and test18() to test-154.cs.
14273
14274 2002-08-08  Martin Baulig  <martin@gnome.org>
14275
14276         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14277         Family access, make sure the invoking type isn't a subclass of the
14278         queried type (that'd be a CS1540).
14279
14280         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14281         this method which takes an additional `Type invocation_type'.
14282
14283         * expression.cs (BaseAccess.DoResolve): Use the base type as
14284         invocation and query type.
14285         (MemberAccess.DoResolve): If the lookup failed and we're about to
14286         report a CS0122, try a lookup with the ec.ContainerType - if this
14287         succeeds, we must report a CS1540.
14288
14289 2002-08-08  Martin Baulig  <martin@gnome.org>
14290
14291         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14292         (MethodGroupExpr): Implement the IMemberExpr interface.
14293
14294         * expression (MemberAccess.ResolveMemberAccess): No need to have
14295         any special code for MethodGroupExprs anymore, they're now
14296         IMemberExprs.   
14297
14298 2002-08-08  Martin Baulig  <martin@gnome.org>
14299
14300         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14301         Family, FamANDAssem and FamORAssem permissions.
14302         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14303
14304 2002-08-08  Martin Baulig  <martin@gnome.org>
14305
14306         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14307         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14308         or loop block.
14309
14310 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14311
14312         * driver.cs: implemented /resource option to embed managed resources.
14313
14314 2002-08-07  Martin Baulig  <martin@gnome.org>
14315
14316         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14317         (FieldBase.HasFieldInitializer): New public property.
14318         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14319         returns the field initializer and makes sure it is only resolved once.
14320         (TypeContainer.EmitFieldInitializers): Call
14321         FieldBase.GetInitializerExpression to get the initializer, this ensures
14322         that it isn't resolved multiple times.
14323
14324         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14325         the resolving process (SimpleName/MemberLookup) that we're currently
14326         emitting a field initializer (which must not access any instance members,
14327         this is an error CS0236).
14328
14329         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14330         argument, if the `IsFieldInitializer' flag is set, we must report and
14331         error CS0236 and not an error CS0120.   
14332
14333 2002-08-07  Martin Baulig  <martin@gnome.org>
14334
14335         * ecore.cs (IMemberExpr): New public interface.
14336         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14337         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14338         if the expression is an IMemberExpr.
14339
14340         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14341         to be null, implicitly default to `this' if we're non-static in
14342         this case.  Simplified the code a lot by using the new IMemberExpr
14343         interface.  Also fixed bug #28176 here.
14344
14345 2002-08-06  Martin Baulig  <martin@gnome.org>
14346
14347         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14348         ParameterReferences during semantic analysis so that we can do a
14349         type-only search when resolving Cast, TypeOf and SizeOf.
14350         (block): Pass the `current_local_parameters' to the Block's
14351         constructor.
14352
14353         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14354         argument to the constructor.
14355         (ConstructorInitializer.Resolve): Create a temporary implicit
14356         block with the parameters.
14357
14358         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14359         references here if we aren't doing a type-only search.
14360
14361         * statement.cs (Block): Added constructor which takes a
14362         `Parameters parameters' argument.
14363         (Block.Parameters): New public property.
14364
14365         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14366         to `Parameters' and made it public readonly.
14367
14368 2002-08-06  Martin Baulig  <martin@gnome.org>
14369
14370         * ecore.cs (Expression.Warning): Made this public as well.
14371
14372         * report.cs (Report.Debug): Print the contents of collections.
14373
14374 2002-08-06  Martin Baulig  <martin@gnome.org>
14375
14376         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14377         used to tell Resolve() which kinds of expressions it may return.
14378         (Expression.Resolve): Added overloaded version of this method which
14379         takes a `ResolveFlags flags' argument.  This can be used to tell
14380         Resolve() which kinds of expressions it may return.  Reports a
14381         CS0118 on error.
14382         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14383         ResolveFlags.SimpleName.
14384         (Expression.Error118): Added overloaded version of this method which
14385         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14386         which kinds of expressions are allowed.
14387
14388         * expression.cs (Argument.ResolveMethodGroup): New public method.
14389         Resolves an argument, but allows a MethodGroup to be returned.
14390         This is used when invoking a delegate.
14391
14392         * TODO: Updated a bit.
14393
14394 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14395
14396         Fixed compilation with csc.
14397
14398         * ecore.cs: Expression.Error made public. Is this correct? Should
14399         Warning be made public too?
14400
14401         * expression.cs: use ea.Location instead of ea.loc.
14402         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14403
14404 2002-08-06  Martin Baulig  <martin@gnome.org>
14405
14406         * ecore.cs (Expression.loc): Moved the location here instead of
14407         duplicating it in all derived classes.
14408         (Expression.Location): New public property.
14409         (Expression.Error, Expression.Warning): Made them non-static and
14410         removed the location argument.
14411         (Expression.Warning): Added overloaded version which takes an
14412         `int level' argument.
14413         (Expression.Error118): Make this non-static and removed the
14414         expression and location arguments.
14415         (TypeExpr): Added location argument to the constructor.
14416
14417         * expression.cs (StaticCallExpr): Added location argument to
14418         the constructor.
14419         (Indirection, PointerArithmetic): Likewise.
14420         (CheckedExpr, UnCheckedExpr): Likewise.
14421         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14422         (StringPtr): Likewise.
14423
14424
14425 2002-08-05  Martin Baulig  <martin@gnome.org>
14426
14427         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14428
14429         * assign.cs (Assign.DoResolve): Check whether the source
14430         expression is a value or variable.
14431
14432         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14433         while resolving the corresponding blocks.
14434
14435         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14436         an error, don't silently return null.
14437
14438         * statement.cs (Block.AddVariable): Do the error reporting here
14439         and distinguish between CS0128 and CS0136.
14440         (Block.DoResolve): Report all unused labels (warning CS0164).
14441         (LabeledStatement): Pass the location to the constructor.
14442         (LabeledStatement.HasBeenReferenced): New property.
14443         (LabeledStatement.Resolve): Set it to true here.
14444
14445         * statement.cs (Return.Emit): Return success even after reporting
14446         a type mismatch error (CS0126 or CS0127), this is what csc does and
14447         it avoids confusing the users with any consecutive errors.
14448
14449 2002-08-05  Martin Baulig  <martin@gnome.org>
14450
14451         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14452
14453         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14454
14455         * expression.cs (MemberAccess.DoResolve): Silently return if an
14456         error has already been reported.
14457
14458         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14459         error has already been reported.
14460
14461 2002-08-05  Martin Baulig  <martin@gnome.org>
14462
14463         * statement.cs (UsageVector): Only initialize the `parameters'
14464         vector if we actually have any "out" parameters.
14465
14466 2002-08-05  Martin Baulig  <martin@gnome.org>
14467
14468         * expression.cs (Binary.ResolveOperator): When combining delegates,
14469         they must have the same type.
14470
14471 2002-08-05  Martin Baulig  <martin@gnome.org>
14472
14473         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14474         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14475         work with the ms runtime and we also don't need it: if we're a
14476         PropertyBuilder and not in the `indexer_arguments' hash, then we
14477         are a property and not an indexer.
14478
14479         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14480         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14481         since the latter one doesn't work with the ms runtime.
14482
14483 2002-08-03  Martin Baulig  <martin@gnome.org>
14484
14485         Fixed bugs #27998 and #22735.
14486
14487         * class.cs (Method.IsOperator): New public field.
14488         (Method.CheckBase): Report CS0111 if there's already a method
14489         with the same parameters in the current class.  Report CS0508 when
14490         attempting to change the return type of an inherited method.
14491         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14492         and it's not marked abstract or extern.
14493         (PropertyBase): New abstract base class for Property and Indexer.
14494         (PropertyBase.CheckBase): Moved here from Property and made it work
14495         for indexers.
14496         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14497         the same so we can reuse it there.
14498         (Property, Indexer): Derive from PropertyBase.
14499         (MethodSignature.inheritable_property_signature_filter): New delegate
14500         to find properties and indexers.
14501
14502         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14503         argument and improved error reporting.
14504
14505         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14506         EmptyReadOnlyParameters and made it a property.
14507
14508         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14509         version of this method which takes a `PropertyInfo indexer'.
14510         (TypeManager.RegisterIndexer): New method.
14511
14512         * class.cs: Added myself as author of this file :-)
14513
14514 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14515
14516         * class.cs: fixed compilation on windoze.
14517
14518 2002-08-03  Martin Baulig  <martin@gnome.org>
14519
14520         * interface.cs (Interface.GetInterfaceBases): Check whether all
14521         base interfaces are at least as accessible than the current one.
14522
14523         * class.cs (TypeContainer.GetClassBases): Check whether base types
14524         are at least as accessible than the current type.
14525         (TypeContainer.AsAccessible): Implemented and made non-static.
14526         (MemberBase.CheckParameters): Report errors if the accessibility
14527         checks fail.
14528
14529         * delegate.cs (Delegate.Delegate): The default visibility is
14530         internal for top-level types and private for nested types.
14531         (Delegate.Define): Report errors if the accessibility checks fail.
14532
14533         * enum.cs (Enum.Enum): The default visibility is internal for
14534         top-level types and private for nested types.
14535         (Enum.DefineType): Compute the correct visibility.
14536
14537         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14538         function which takes a `bool is_toplevel' instead of a TypeContainer.
14539
14540         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14541         builtin type.
14542
14543 2002-08-02  Martin Baulig  <martin@gnome.org>
14544
14545         * expression.cs (LocalVariableReferenc): Added constructor which
14546         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14547         (LocalVariableReference.IsReadOnly): New property.
14548         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14549         variable is readonly, use our own readonly flag to do this; you can
14550         use the new constructor to get a writable reference to a read-only
14551         variable.
14552
14553         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14554         reference to the local variable.
14555
14556 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14557
14558         * rootcontext.cs (ResolveCore): Also include System.Exception
14559
14560         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14561         we reach an EmptyStatement.
14562
14563         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14564         is also fine.
14565
14566         * expression.cs (Binary.ResolveOperator): Check error result in
14567         two places.
14568
14569         use brtrue/brfalse directly and avoid compares to null.
14570
14571 2002-08-02  Martin Baulig  <martin@gnome.org>
14572
14573         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14574         Fixes bug #28407, added test-155.cs.
14575
14576 2002-08-01  Martin Baulig  <martin@gnome.org>
14577
14578         * class.cs (Event.EmitDefaultMethod): Make this work with static
14579         events.  Fixes #28311, added verify-3.cs.
14580
14581 2002-08-01  Martin Baulig  <martin@gnome.org>
14582
14583         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14584         `is_disposable' fields.
14585         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14586         `hm.is_disposable' if we're using the collection pattern.
14587         (Foreach.EmitCollectionForeach): Use the correct type for the
14588         enumerator's local variable, only emit the try/finally block if
14589         necessary (fixes #27713).
14590
14591 2002-08-01  Martin Baulig  <martin@gnome.org>
14592
14593         * ecore.cs (Expression.report118): Renamed to Error118 and made
14594         it public static.
14595
14596         * statement.cs (Throw.Resolve): Check whether the expression is of
14597         the correct type (CS0118) and whether the type derives from
14598         System.Exception (CS0155).
14599         (Catch.Resolve): New method.  Do the type lookup here and check
14600         whether it derives from System.Exception (CS0155).
14601         (Catch.CatchType, Catch.IsGeneral): New public properties.
14602
14603         * typemanager.cs (TypeManager.exception_type): Added.
14604
14605 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14606
14607         * driver.cs: Updated About function.
14608
14609 2002-07-31  Martin Baulig  <martin@gnome.org>
14610
14611         Implemented Control Flow Analysis.
14612
14613         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14614         (EmitContext.CurrentBranching): Added.
14615         (EmitContext.StartFlowBranching): Added.
14616         (EmitContext.EndFlowBranching): Added.
14617         (EmitContext.KillFlowBranching): Added.
14618         (EmitContext.IsVariableAssigned): Added.
14619         (EmitContext.SetVariableAssigned): Added.
14620         (EmitContext.IsParameterAssigned): Added.
14621         (EmitContext.SetParameterAssigned): Added.
14622         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14623         Added control flow analysis stuff here.
14624
14625         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14626         resolve the expression as lvalue.
14627         (LocalVariableReference.DoResolve): Check whether the variable has
14628         already been assigned.
14629         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14630         the parameter as assigned here.
14631         (ParameterReference.DoResolve): Check whether the parameter has already
14632         been assigned.
14633         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14634         expression as lvalue.
14635
14636         * statement.cs (FlowBranching): New class for the flow analysis code.
14637         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14638         (LabeledStatement.IsDefined): New public property.
14639         (LabeledStatement.AddUsageVector): New public method to tell flow
14640         analyis that the label may be reached via a forward jump.
14641         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14642         flow analysis.
14643         (VariableInfo.Number): New public field.  This is used by flow analysis
14644         to number all locals of a block.
14645         (Block.CountVariables): New public property.  This is the number of
14646         local variables in this block (including the locals from all parent
14647         blocks).
14648         (Block.EmitMeta): Number all the variables.
14649
14650         * statement.cs: Added flow analysis support to all classes.
14651
14652 2002-07-31  Martin Baulig  <martin@gnome.org>
14653
14654         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14655         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14656         then use this argument.
14657
14658         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14659
14660         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14661         use this to specify /define options.
14662
14663 2002-07-29  Martin Baulig  <martin@gnome.org>
14664
14665         * statement.cs (Fixed): Moved all code that does variable lookups
14666         and resolvings from Emit to Resolve.
14667
14668         * statement.cs (For): Moved all code that does variable lookups
14669         and resolvings from Emit to Resolve.
14670
14671         * statement.cs (Using): Moved all code that does variable lookups
14672         and resolvings from Emit to Resolve.
14673
14674 2002-07-29  Martin Baulig  <martin@gnome.org>
14675
14676         * attribute.cs (Attribute.Resolve): Explicitly catch a
14677         System.NullReferenceException when creating the
14678         CustromAttributeBuilder and report a different warning message.
14679
14680 2002-07-29  Martin Baulig  <martin@gnome.org>
14681
14682         * support.cs (ParameterData.ParameterName): Added method to
14683         get the name of a parameter.
14684
14685         * typemanager.cs (TypeManager.IsValueType): New public method.
14686
14687 2002-07-29  Martin Baulig  <martin@gnome.org>
14688
14689         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14690         is a flag which specifies that it's either ref or out.
14691         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14692         the out parameter to `out Parameter.Modifier mod', also set the
14693         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14694
14695         * support.cs (InternalParameters.ParameterModifier): Distinguish
14696         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14697         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14698
14699         * expression.cs (Argument.GetParameterModifier): 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 2002-07-29  Martin Baulig  <martin@gnome.org>
14704
14705         * expression.cs (ParameterReference.ParameterReference): Added
14706         `Location loc' argument to the constructor.
14707
14708         * cs-parser.jay: Pass location to ParameterReference.
14709
14710 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14711
14712         * statement.cs (Try): Initialize the location.
14713
14714         * cs-parser.jay: pass location to Try.
14715
14716         * expression.cs (Unary.Reduce): Change the prototype to return
14717         whether a constant fold could be performed or not.  The result is
14718         returned in an out parameters.  In the case of Indirection and
14719         AddressOf, we want to perform the full tests.
14720
14721 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * statement.cs (Statement.Emit): Flag dead code.
14724
14725 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14726
14727         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14728
14729 2002-07-27  Martin Baulig  <martin@gnome.org>
14730
14731         * class.cs (MethodData.Define): Put back call to
14732         TypeManager.AddMethod(), accidentally commented this out.
14733
14734         * report.cs (Debug): New public method to print debugging information,
14735         this is `[Conditional ("DEBUG")]'.
14736
14737 2002-07-26  Martin Baulig  <martin@gnome.org>
14738
14739         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14740         (switch_statement): Push the current_block to the switch_stack and
14741         pop it again when we're done with the switch.
14742         (switch_section): The new block is a child of the current_block.
14743         Fixes bug #24007, added test-152.cs.
14744
14745 2002-07-27  Martin Baulig  <martin@gnome.org>
14746
14747         * expression.cs (Invocation.EmitArguments): When calling a varargs
14748         function with only its fixed arguments, we need to pass an empty
14749         array.
14750
14751 2002-07-27  Martin Baulig  <martin@gnome.org>
14752
14753         Mono 0.13 has been released.
14754
14755 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14756
14757         * driver.cs: Rename --resource to --linkres, because that is what
14758         we do currently, we dont support --resource yet.
14759
14760         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14761
14762 2002-07-25  Martin Baulig  <martin@gnome.org>
14763
14764         * class.cs (MethodData): New public class.  This is a `method builder'
14765         class for a method or one accessor of a Property/Indexer/Event.
14766         (MethodData.GetMethodFlags): Moved here from MemberBase.
14767         (MethodData.ApplyAttributes): Likewise.
14768         (MethodData.ApplyObsoleteAttribute): Likewise.
14769         (MethodData.ApplyConditionalAttribute): Likewise.
14770         (MethodData.ApplyDllImportAttribute): Likewise.
14771         (MethodData.CheckAbstractAndExternal): Likewise.
14772         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14773         (MethodData.Emit): Formerly known as Method.Emit().
14774         (MemberBase): Moved everything which was specific to a single
14775         accessor/method to MethodData.
14776         (Method): Create a new MethodData and call Define() and Emit() on it.
14777         (Property, Indexer, Event): Create a new MethodData objects for each
14778         accessor and call Define() and Emit() on them.
14779
14780 2002-07-25  Martin Baulig  <martin@gnome.org>
14781
14782         Made MethodCore derive from MemberBase to reuse the code from there.
14783         MemberBase now also checks for attributes.
14784
14785         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14786         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14787         as virtual.
14788         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14789         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14790         (MemberBase.ApplyAttributes): New virtual method; applies the
14791         attributes to a method or accessor.
14792         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14793         (MemberBase.ApplyConditionalAttribute): Likewise.
14794         (MemberBase.ApplyDllImportAttribute): Likewise.
14795         (MemberBase.CheckAbstractAndExternal): Likewise.
14796         (MethodCore.ParameterTypes): This is now a property instead of a
14797         method, it's initialized from DoDefineParameters().
14798         (MethodCore.ParameterInfo): Removed the set accessor.
14799         (MethodCore.DoDefineParameters): New protected virtual method to
14800         initialize ParameterTypes and ParameterInfo.
14801         (Method.GetReturnType): We can now simply return the MemberType.
14802         (Method.GetMethodFlags): Override the MemberBase version and add
14803         the conditional flags.
14804         (Method.CheckBase): Moved some code from Define() here, call
14805         DoDefineParameters() here.
14806         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14807         here to avoid some larger code duplication.
14808         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14809         ensure that abstract and external accessors don't declare a body.
14810
14811         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14812         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14813         lookup in the attribute's parent classes, so we need to abort as soon
14814         as we found the first match.
14815         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14816         the attribute has no arguments.
14817
14818         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14819         of a Method.
14820
14821 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14822
14823         * cs-parser.jay: reverted previous patch.
14824
14825 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14826
14827         * cs-parser.jay: fixed bug #22119.
14828
14829 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14830
14831         * attribute.cs: fixed compilation. The error was:
14832         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14833         be assigned to before control leaves the current method."
14834         [FIXME:  Filed as bug #28186: MCS must report this error.]
14835
14836 2002-07-25  Martin Baulig  <martin@gnome.org>
14837
14838         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14839         method to pull the condition name ouf of a Conditional attribute.
14840         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14841         the obsolete message and error flag out of an Obsolete attribute.
14842
14843         * class.cs (Method.GetMethodFlags): New public method to get the
14844         TypeManager.MethodFlags for this method.
14845         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14846         private methods.
14847         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14848         if we're overriding a virtual function, set the new private variable
14849         `parent_method'; call the new TypeManager.AddMethod().
14850
14851         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14852         the MethodBuilder and the Method in a PtrHashtable.
14853         (TypeManager.builder_to_method): Added for this purpose.
14854         (TypeManager.MethodFlags): Added IsObsoleteError.
14855         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14856         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14857         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14858         the message from the attribute.
14859
14860 2002-07-24  Martin Baulig  <martin@gnome.org>
14861
14862         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14863         preprocessor directives, ensure that the argument to #define/#undef is
14864         exactly one identifier and that it's actually an identifier.
14865
14866         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14867         did not work ....
14868
14869 2002-07-24  Martin Baulig  <martin@gnome.org>
14870
14871         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14872         initialize it to TypeManager.object_type in the constructor.
14873         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14874         of the `hm.get_current' method if we're using the collection pattern.
14875         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14876         for the explicit conversion to make it work when we're using the collection
14877         pattern and the `Current' property has a different return type than `object'.
14878         Fixes #27713.
14879
14880 2002-07-24  Martin Baulig  <martin@gnome.org>
14881
14882         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14883         does not match, but don't report any errors.  This method is called in
14884         order for all methods in a MethodGroupExpr until a matching method is
14885         found, so we don't want to bail out if the first method doesn't match.
14886         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14887         matches, report the 123.  Fixes #28070.
14888
14889 2002-07-24  Martin Baulig  <martin@gnome.org>
14890
14891         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14892         TypeManager.TypeToCoreType() to the top of the method so the
14893         following equality checks will work.  Fixes #28107.
14894
14895 2002-07-24  Martin Baulig  <martin@gnome.org>
14896
14897         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14898         operand is of type uint, and the other operand is of type sbyte,
14899         short or int, the operands are converted to type long." -
14900         Actually do what this comment already told us.  Fixes bug #28106,
14901         added test-150.cs.
14902
14903 2002-07-24  Martin Baulig  <martin@gnome.org>
14904
14905         * class.cs (MethodBase): New abstract class.  This is now a base
14906         class for Property, Indexer and Event to avoid some code duplication
14907         in their Define() and DefineMethods() methods.
14908         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14909         generic methods for Define() and DefineMethods().
14910         (FieldBase): Derive from MemberBase, not MemberCore.
14911         (Property): Derive from MemberBase, not MemberCore.
14912         (Property.DefineMethod): Moved all the code from this method to the
14913         new MethodBase.DefineAccessor(), just call it with appropriate
14914         argumetnts.
14915         (Property.Define): Call the new Property.DoDefine(), this does some
14916         sanity checks and we don't need to duplicate the code everywhere.
14917         (Event): Derive from MemberBase, not MemberCore.
14918         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14919         accessors, this will also make them work with interface events.
14920         (Indexer): Derive from MemberBase, not MemberCore.
14921         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14922         (Indexer.Define): Use the new MethodBase functions.
14923
14924         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14925         argument to the constructor.
14926         (Interface.FindMembers): Added support for interface events.
14927         (Interface.PopluateEvent): Implemented.
14928
14929         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14930
14931 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14934         but this is required to check for a method name being the same as
14935         the containing class.  
14936
14937         Handle this now.
14938
14939 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14940
14941         * interface.cs: initialize variable.
14942
14943 2002-07-23  Martin Baulig  <martin@gnome.org>
14944
14945         Implemented the IndexerName attribute in interfaces.
14946
14947         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14948         name if this is an explicit interface implementation.
14949         (Indexer.InterfaceIndexerName): New public variable.  If we're
14950         implementing an interface indexer, this is the IndexerName in that
14951         interface.  Otherwise, it's the IndexerName.
14952         (Indexer.DefineMethod): If we're implementing interface indexer,
14953         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14954         and Pending.ImplementIndexer methods.
14955         (Indexer.Define): Also define the PropertyBuilder if we're
14956         implementing an interface indexer and this is neither an explicit
14957         interface implementation nor do the IndexerName match the one in
14958         the interface.
14959
14960         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14961         If a method is defined here, then we always need to create a proxy
14962         for it.  This is used when implementing interface indexers.
14963         (Pending.IsInterfaceIndexer): New public method.
14964         (Pending.ImplementIndexer): New public method.
14965         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14966         This is used when implementing interface indexers to define a proxy
14967         if necessary.
14968         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14969         define a proxy if necessary.
14970
14971         * interface.cs (Interface.IndexerName): New public variable.
14972         (Interface.PopulateIndexer): Set the IndexerName.
14973         (Interface.DefineIndexers): New private method.  Populate all the
14974         indexers and make sure their IndexerNames match.
14975
14976         * typemanager.cs (IndexerPropertyName): Added support for interface
14977         indexers.
14978
14979 2002-07-22  Martin Baulig  <martin@gnome.org>
14980
14981         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14982         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14983         ret if HasReturnLabel.
14984         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14985         variables.
14986
14987         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14988         and set the ec.LoopBeginTryCatchLevel.
14989         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14990         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14991         the current ec.TryCatchLevel, the branch goes out of an exception
14992         block.  In this case, we need to use Leave and not Br.
14993
14994 2002-07-22  Martin Baulig  <martin@gnome.org>
14995
14996         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14997         block unless the block does not always return or it is contained in
14998         another try { ... } catch { ... } block.  Fixes bug #26506.
14999         Added verify-1.cs to the test suite.
15000
15001 2002-07-22  Martin Baulig  <martin@gnome.org>
15002
15003         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15004         then we do not always return.  Fixes bug #24985.
15005
15006 2002-07-22  Martin Baulig  <martin@gnome.org>
15007
15008         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15009         lookup on a per-class level; ie. walk up the class hierarchy until we
15010         found at least one applicable method, then choose the best among them.
15011         Fixes bug #24463 and test-29.cs.
15012
15013 2002-07-22  Martin Baulig  <martin@gnome.org>
15014
15015         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15016         return types of the methods.  The return type is not part of the
15017         signature and we must not check it to make the `new' modifier work.
15018         Fixes bug #27999, also added test-147.cs.
15019         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15020
15021         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15022         on the method's return type.
15023
15024 2002-07-21  Martin Baulig  <martin@gnome.org>
15025
15026         * assign.cs: Make this work if the rightmost source is a constant and
15027         we need to do an implicit type conversion.  Also adding a few more tests
15028         to test-38.cs which should have caught this.
15029
15030         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15031         target in the makefile for this.  The makefile.gnu is primarily intended
15032         for end-users who don't want to debug the compiler.
15033
15034 2002-07-21  Martin Baulig  <martin@gnome.org>
15035
15036         * assign.cs: Improved the Assign class so it can now handle embedded
15037         assignments (X = Y = Z = something).  As a side-effect this'll now also
15038         consume less local variables.  test-38.cs now passes with MCS, added
15039         a few new test cases to that test.
15040
15041 2002-07-20  Martin Baulig  <martin@gnome.org>
15042
15043         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15044         instructions.  Fixes bug #27977, also added test-146.cs.
15045
15046 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15047
15048         * cs-tokenizer.cs: fixed getHex ().
15049
15050 2002-07-19  Martin Baulig  <martin@gnome.org>
15051
15052         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15053         not Type.GetType() to lookup the array type.  This is needed when
15054         we're constructing an array of a user-defined type.
15055         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15056         single-dimensional arrays, but also for single-dimensial arrays of
15057         type decimal.
15058
15059 2002-07-19  Martin Baulig  <martin@gnome.org>
15060
15061         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15062         this function is called, it's not allowed to share LocalBuilders
15063         among ILGenerators.
15064
15065 2002-07-19  Martin Baulig  <martin@gnome.org>
15066
15067         * expression.cs (Argument.Resolve): Report an error 118 when trying
15068         to pass a type as argument.
15069
15070 2002-07-18  Martin Baulig  <martin@gnome.org>
15071
15072         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15073         Conv_R_Un for the signed `long' type.
15074
15075 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15076
15077         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15078         `expr' for the temporary result, as that will fail if we do
15079         multiple resolves on the same expression.
15080
15081 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15082
15083         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15084         ec.TypeContainer for looking up aliases. 
15085
15086         * class.cs (TypeContainer): Remove LookupAlias from here.
15087
15088         * decl.cs (DeclSpace); Move here.
15089
15090 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * class.cs (FindMembers): Only call filter if the constructor
15093         bulider is not null.
15094
15095         Also handle delegates in `NestedTypes' now.  Now we will perform
15096         type lookups using the standard resolution process.  This also
15097         fixes a bug.
15098
15099         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15100         This uses Expressions (the limited kind that can be parsed by the
15101         tree) instead of strings.
15102
15103         * expression.cs (ComposedCast.ToString): Implement, used to flag
15104         errors since now we have to render expressions.
15105
15106         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15107         FormArrayType. 
15108
15109         * ecore.cs (SimpleName.ToString): ditto.
15110
15111         * cs-parser.jay: Instead of using strings to assemble types, use
15112         Expressions to assemble the type (using SimpleName, ComposedCast,
15113         MemberAccess).  This should fix the type lookups in declarations,
15114         because we were using a different code path for this.
15115
15116         * statement.cs (Block.Resolve): Continue processing statements
15117         even when there is an error.
15118
15119 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15120
15121         * class.cs (Event.Define): Also remove the `remove' method from
15122         the list of pending items.
15123
15124         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15125         generate more compact code. 
15126
15127 2002-07-17  Martin Baulig  <martin@gnome.org>
15128
15129         * const.cs (Const.LookupConstantValue): Add support for constant
15130         `unchecked' and `checked' expressions.
15131         Also adding test case test-140.cs for this.
15132
15133 2002-07-17  Martin Baulig  <martin@gnome.org>
15134
15135         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15136         check whether mi.ReturnType implements the IEnumerator interface; the
15137         `==' and the IsAssignableFrom() will fail in this situation.
15138
15139 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15140
15141         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15142         here too.
15143
15144 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15145
15146         * expression.cs: fixed bug #27811.
15147
15148 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15149
15150         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15151         Molaro: when we are a ref, the value already contains a pointer
15152         value, do not take the address of it.
15153
15154 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15155         * removed mb-parser.jay and mb-tokenizer.cs
15156
15157 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15158
15159         * expression.cs: check against the building corlib void type.
15160
15161 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15162
15163         * ecore.cs: fix for valuetype static readonly fields: when 
15164         initializing them, we need their address, not the address of a copy.
15165
15166 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15167
15168         * typemanager.cs: register also enum_type in corlib.
15169
15170 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15171
15172         * class.cs: allow calling this (but not base) initializers in structs.
15173
15174 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15175
15176         * ecore.cs: make sure we compare against the building base types
15177         in GetTypeSize ().
15178
15179 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15180
15181         * typemanager.cs: fix TypeToCoreType() to handle void and object
15182         (corlib gets no more typerefs after this change).
15183
15184 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15185
15186         * expression.cs (ArrayCreation.EmitArrayArguments): use
15187         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15188
15189         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15190         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15191         array indexes, the runtime actually forbids them.
15192
15193         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15194         for array arguments here.
15195
15196         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15197         instead of the default for ValueTypes.
15198
15199         (New.DoEmit): Use IsValueType instead of
15200         IsSubclassOf (value_type)
15201         (New.DoResolve): ditto.
15202         (Invocation.EmitCall): ditto.
15203
15204         * assign.cs (Assign): ditto.
15205
15206         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15207         Statements *are* currently doing part of their resolution during
15208         Emit.  
15209
15210         Expressions do always resolve during resolve, but statements are
15211         only required to propagate resolution to their children.
15212
15213 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15216
15217         (LoadAssembly): Do not add the dll if it is already specified
15218
15219         (MainDriver): Add the System directory to the link path at the end,
15220         after all the other -L arguments. 
15221
15222         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15223         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15224         ldelem.u1) and using the opposite for sbytes.
15225
15226         This fixes Digger, and we can finally run it.
15227
15228         * driver.cs (UnixParseOption): Move the option parsing here.  
15229         (CSCParseOption): Implement CSC-like parsing of options.
15230
15231         We now support both modes of operation, the old Unix way, and the
15232         new CSC-like way.  This should help those who wanted to make cross
15233         platform makefiles.
15234
15235         The only thing broken is that /r:, /reference: and /lib: are not
15236         implemented, because I want to make those have the same semantics
15237         as the CSC compiler has, and kill once and for all the confussion
15238         around this.   Will be doing this tomorrow.
15239
15240         * statement.cs (Unsafe.Resolve): The state is checked during
15241         resolve, not emit, so we have to set the flags for IsUnsfe here.
15242
15243 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15244
15245         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15246         not catch the Error_ObjectRefRequired in SimpleName (as it is
15247         possible to have a class/instance variable name that later gets
15248         deambiguated), we have to check this here.      
15249
15250 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15251
15252         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15253         make static and put into Expression.
15254
15255         (Event.Define): Register the private field of the event with the 
15256         TypeManager so that GetFieldFromEvent can get at it.
15257
15258         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15259         keep track of the private field associated with an event which
15260         has no accessors.
15261
15262         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15263         private field.
15264
15265         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15266
15267 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15268
15269         * expression.cs (Binary.EmitBranchable): this routine emits the
15270         Binary expression in a branchable context.  This basically means:
15271         we need to branch somewhere, not just get the value on the stack.
15272
15273         This works together with Statement.EmitBoolExpression.
15274
15275         * statement.cs (Statement.EmitBoolExpression): Use
15276         EmitBranchable. 
15277
15278 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * statement.cs (For): Reduce the number of jumps in loops.
15281
15282         (For): Implement loop inversion for the For statement.
15283
15284         (Break): We can be breaking out of a Try/Catch controlled section
15285         (foreach might have an implicit try/catch clause), so we need to
15286         use Leave instead of Br.
15287
15288         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15289         now).  If the instace expression supports IMemoryLocation, we use
15290         the AddressOf method from the IMemoryLocation to extract the
15291         address instead of emitting the instance.
15292
15293         This showed up with `This', as we were emitting the instance
15294         always (Emit) instead of the Address of This.  Particularly
15295         interesting when This is a value type, as we dont want the Emit
15296         effect (which was to load the object).
15297
15298 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15301
15302         * statement.cs (Checked): Set the CheckedState during the resolve
15303         process too, as the ConvCast operations track the checked state on
15304         the resolve process, and not emit.
15305
15306         * cs-parser.jay (namespace_member_declaration): Flag that we have
15307         found a declaration when we do.  This is used to flag error 1529
15308
15309         * driver.cs: Report ok when we display the help only.
15310
15311 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15312
15313         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15314
15315 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * cs-tokenizer.cs (define): We also have to track locally the
15318         defines.  AllDefines is just used for the Conditional Attribute,
15319         but we also need the local defines for the current source code. 
15320
15321 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15322
15323         * statement.cs (While, For, Do): These loops can exit through a
15324         Break statement, use this information to tell whether the
15325         statement is the last piece of code.
15326
15327         (Break): Flag that we break.
15328
15329         * codegen.cs (EmitContexts): New `Breaks' state variable.
15330
15331 2002-07-03  Martin Baulig  <martin@gnome.org>
15332
15333         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15334         modifiers in method declarations in structs.  Otherwise, you won't
15335         be able to override things like Object.Equals().
15336
15337 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * class.cs (Method, Property, Indexer): Do not allow the public
15340         modifier to be used in explicit interface implementations.
15341
15342         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15343         override modifiers in method declarations in structs
15344
15345 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15346
15347         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15348         integer or real overflow, report an error
15349
15350 2002-07-02  Martin Baulig  <martin@gnome.org>
15351
15352         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15353         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15354         to tell the runtime about our newly created System.Object and
15355         System.ValueType types.
15356
15357 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15358
15359         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15360         struct instead of Ldarg/Starg.
15361
15362 2002-07-02  Martin Baulig  <martin@gnome.org>
15363
15364         * expression.cs (Indirection.Indirection): Call
15365         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15366
15367 2002-07-02  Martin Baulig  <martin@gnome.org>
15368
15369         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15370         ValueType, call TypeManager.TypeToCoreType() on it.
15371         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15372         the OpCodes.Newarr argument.
15373
15374 2002-07-02  Martin Baulig  <martin@gnome.org>
15375
15376         * expression.cs (Invocation.EmitCall): When compiling corlib,
15377         replace all calls to the system's System.Array type to calls to
15378         the newly created one.
15379
15380         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15381         System.Array methods.
15382         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15383         from the system's System.Array type which must be replaced.
15384
15385 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15386
15387         * typemanager.cs: load unverifiable_code_ctor so we can build
15388         corlib using the correct type. Avoid using GetTypeCode() with
15389         TypeBuilders.
15390         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15391         TypeManager.object_type to allow building corlib.
15392
15393 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15394
15395         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15396
15397 2002-07-01  Martin Baulig  <martin@gnome.org>
15398
15399         * class.cs: Make the last change actually work, we need to check
15400         whether `ifaces != null' to avoid a crash.
15401
15402 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15403
15404         * class.cs: when we build structs without fields that implement
15405         interfaces, we need to add the interfaces separately, since there is
15406         no API to both set the size and add the interfaces at type creation
15407         time.
15408
15409 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15410
15411         * expression.cs: the dimension arguments to the array constructors
15412         need to be converted if they are a long.
15413
15414 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15415
15416         * class.cs: don't emit ldarg.0 if there is no parent constructor
15417         (fixes showstopper for corlib).
15418
15419 2002-06-29  Martin Baulig  <martin@gnome.org>
15420
15421         MCS now compiles corlib on GNU/Linux :-)
15422
15423         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15424         ie. check for MethodImplOptions.InternalCall.
15425
15426         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15427         and TypeManager.attribute_type are null, so we must explicitly check
15428         whether parent is not null to find out whether it's an attribute type.
15429         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15430         and SetBuilder, not only if the property is neither abstract nor external.
15431         This is necessary to set the MethodImplOptions on the accessor methods.
15432         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15433         SetBuilder, see Property.Emit().
15434
15435         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15436         populate "System.Object", "System.ValueType" and "System.Attribute" since
15437         they've already been populated from BootCorlib_PopulateCoreTypes().
15438
15439 2002-06-29  Martin Baulig  <martin@gnome.org>
15440
15441         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15442         is the NullLiteral, we also need to make sure that target_type is not
15443         an enum type.   
15444
15445 2002-06-29  Martin Baulig  <martin@gnome.org>
15446
15447         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15448         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15449         before calling BootstrapCorlib_ResolveDelegate ().
15450
15451 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15452
15453         * statement.cs: fixed build-breaker. All tests passed ok.
15454
15455 2002-06-27  Martin Baulig  <martin@gnome.org>
15456
15457         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15458         for System.Decimal when compiling corlib.
15459
15460 2002-06-27  Martin Baulig  <martin@gnome.org>
15461
15462         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15463         switch blocks which contain nothing but a default clause.
15464
15465 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15466
15467        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15468
15469 2002-06-27  Martin Baulig  <martin@gnome.org>
15470
15471         * ecore.cs (PropertyExpr.PropertyExpr): Call
15472         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15473
15474         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15475         is already a TypeBuilder.
15476
15477 2002-06-27  Martin Baulig  <martin@gnome.org>
15478
15479         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15480         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15481         the "from an array-type to System.Array" case.  This makes it work
15482         when compiling corlib.
15483
15484 2002-06-27  Martin Baulig  <martin@gnome.org>
15485
15486         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15487         non-static PropertyExpr, set its InstanceExpression.  This makes
15488         the `ICollection.Count' property work in System/Array.cs.
15489
15490 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15491
15492         * driver.cs: Made error handling more consistent.  Errors now
15493         tracked by Report class, so many methods which used to return int
15494         now return void.  Main() now prints success/failure and 
15495         errors/warnings message.
15496
15497         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15498         the magic number return values (123 and 124).  Now, if the
15499         expected error occurs, the compiler exits with success (exit value
15500         0).  If the compilation completes without seeing that particular
15501         error, the compiler exits with failure (exit value 1).  The
15502         makefile in mcs/errors has been changed to handle the new behaviour.
15503
15504         * report.cs: Made 'expected error' number a property and renamed
15505         it from 'Probe' to 'ExpectedError'.
15506
15507         * genericparser.cs: Removed error handling support, since it is
15508         now all done by Report class.
15509
15510         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15511         class, so parse() no longer returns an int.
15512
15513         * namespace.cs: Use Report.Error instead of GenericParser.error
15514
15515 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15518         TypeContainer.AddOperator): At the front of the list put the
15519         explicit implementations, so they get resolved/defined first. 
15520
15521 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15524         interface type is implemented by this TypeContainer.  Used during
15525         explicit interface implementation.
15526
15527         (Property.Define, Indexer.Define, Method.Define): Validate that
15528         the given interface in the explicit implementation is one of the
15529         base classes for the containing type.
15530
15531         Also if we are explicitly implementing an interface, but there is
15532         no match in the pending implementation table, report an error.
15533
15534         (Property.Define): Only define the property if we are
15535         not explicitly implementing a property from an interface.  Use the
15536         correct name also for those properties (the same CSC uses,
15537         although that is really not needed).
15538
15539         (Property.Emit): Do not emit attributes for explicitly implemented
15540         properties, as there is no TypeBuilder.
15541
15542         (Indexer.Emit): ditto.
15543
15544         Hiding then means that we do not really *implement* a pending
15545         implementation, which makes code fail.
15546
15547 2002-06-22  Martin Baulig  <martin@gnome.org>
15548
15549         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15550         the return value of Object.GetType().  [FIXME: we need to do this whenever
15551         we get a type back from the reflection library].
15552
15553 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15554
15555         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15556
15557 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15558
15559         * attribute.cs: Return null if we can not look up the type.
15560
15561         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15562         the interface types found.
15563
15564         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15565         interface types found.
15566
15567         * typemanager.cs (GetInterfaces): Make this routine returns alll
15568         the interfaces and work around the lame differences between
15569         System.Type and System.Reflection.Emit.TypeBuilder in the results
15570         result for GetInterfaces.
15571
15572         (ExpandInterfaces): Given an array of interface types, expand and
15573         eliminate repeated ocurrences of an interface.  This expands in
15574         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15575         be IA, IB, IC.
15576
15577 2002-06-21  Martin Baulig  <martin@gnome.org>
15578
15579         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15580         on System.Enum.
15581
15582 2002-06-21  Martin Baulig  <martin@gnome.org>
15583
15584         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15585         and called with one of the core types, return the corresponding typebuilder for
15586         that type.
15587
15588         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15589         element type.
15590
15591 2002-06-21  Martin Baulig  <martin@gnome.org>
15592
15593         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15594         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15595         (Expression.ConvertReferenceExplicit): Likewise.
15596
15597         * expression.cs (ElementAccess.DoResolve): Likewise.
15598         (ElementAccess.DoResolveLValue): Likewise.
15599
15600 2002-06-10  Martin Baulig  <martin@gnome.org>
15601
15602         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15603         add the "value" parameter to the parameter list.
15604
15605         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15606         to our caller.
15607
15608 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15611         the argument to an int, uint, long or ulong, per the spec.  Also
15612         catch negative constants in array creation.
15613
15614 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15615
15616         * class.cs: do not allow the same interface to appear twice in
15617         the definition list.
15618
15619 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15620
15621         * ecore.cs: don't use ldlen with System.Array.
15622
15623 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15624
15625         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15626
15627 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15628
15629         * modifiers.cs: produce correct field attributes for protected
15630         internal. Easy fix so miguel can work on ther harder stuff:-)
15631
15632 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * pending.cs: New file.  Move the code from class.cs here.
15635         Support clearning the pending flag for all methods (when not doing
15636         explicit interface implementation).
15637
15638 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15639
15640         * rootcontext.cs: added a couple more types needed to bootstrap.
15641
15642 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15643
15644         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15645         constructor in the type, instead of any constructor in the type
15646         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15647         a bug in the Mono runtime when applying the params attribute). 
15648
15649 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15650         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15651
15652 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15653
15654         * expression.cs (Unary.ResolveOperator): Use TypeManager
15655         to resolve the type.
15656
15657 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15658
15659         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15660         attached.
15661
15662         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15663         with each member too.
15664
15665         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15666         field builders too - this takes care of the enum member case.
15667
15668 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15669
15670         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15671         address-of operator on both value types and pointers.
15672
15673 2002-06-10  Martin Baulig  <martin@gnome.org>
15674
15675         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15676         PropertyBuilder to the `property_builders' list.
15677
15678         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15679         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15680         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15681         find any indexers which are inherited from an interface.
15682
15683 2002-06-09  Martin Baulig  <martin@gnome.org>
15684
15685         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15686         the same type as the constant if necessary.  There's also a test-130.cs
15687         for this.
15688
15689         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15690
15691         * typemanager.cs (TypeManager.ChangeType): Previously known as
15692         Enum.ChangeEnumType().
15693
15694 2002-06-09  Martin Baulig  <martin@gnome.org>
15695
15696         * expression.cs (Cast.TryReduce): Added support for consts.
15697
15698 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15699
15700         * class.cs (Accessor): Hold attributes information so we can pass
15701         it along.
15702
15703         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15704         Modify to pass in attributes attached to the methods.
15705
15706         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15707
15708         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15709         to handle the Accessor kind :-)
15710
15711         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15712
15713 2002-06-08  Martin Baulig  <martin@gnome.org>
15714
15715         * expression.cs (Unary.TryReduceNegative): Added support for
15716         ULongConstants.
15717
15718 2002-06-08  Martin Baulig  <martin@gnome.org>
15719
15720         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15721         name can't be found in the `defined_names' - the caller will do a
15722         MemberLookup in this case and thus find methods in System.Enum
15723         such as Enum.IsDefined().
15724
15725 2002-06-08  Martin Baulig  <martin@gnome.org>
15726
15727         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15728         Convert.ChangeType() which works with TypeBuilder created types.
15729         (Enum.LookupEnumValue, Enum.Define): Use it here.
15730
15731         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15732         `TypeBuilder.BaseType != null' check.
15733         (TypeContainer.FindMembers): Only lookup parent members if we
15734         actually have a parent.
15735         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15736         (ConstructorInitializer.Resolve): Likewise.
15737
15738         * interface.cs (Interface.FindMembers): Added
15739         `TypeBuilder.BaseType != null' check.
15740
15741         * rootcontext.cs (RootContext.ResolveCore): Added
15742         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15743         classes_second_stage.
15744
15745         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15746         debug_type and trace_type when compiling with --nostdlib.       
15747
15748 2002-06-07  Martin Baulig  <martin@gnome.org>
15749
15750         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15751         (AddField): Set it to true when adding a non-static field.
15752         (DefineType): Use `have_nonstatic_fields' to find out whether we
15753         have non-static fields, not `Fields != null'.
15754
15755 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15758         dereferencing a null on the static-field code path)
15759
15760 2002-05-30  Martin Baulig  <martin@gnome.org>
15761
15762         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15763         to take command line arguments.  Use reflection to call the new
15764         custom `Initialize' function on the symbol writer and pass it the
15765         command line arguments.
15766
15767         * driver.cs (--debug-args): New command line argument to pass command
15768         line arguments to the symbol writer.
15769
15770 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15771
15772         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15773         the target type for indexers and properties.  Thanks to Joe for
15774         catching this.
15775
15776 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15777
15778         * typemanager.cs (MethodFlags): returns the method flags
15779         (Obsolete/ShouldIgnore) that control warning emission and whether
15780         the invocation should be made, or ignored. 
15781
15782         * expression.cs (Invocation.Emit): Remove previous hack, we should
15783         not do this on matching a base type, we should do this based on an attribute
15784
15785         Only emit calls to System.Diagnostics.Debug and
15786         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15787         on the command line.
15788
15789         * rootcontext.cs: Global settings for tracing and debugging.
15790
15791         * cs-tokenizer.cs (define): New utility function to track
15792         defines.   Set the global settings for TRACE and DEBUG if found.
15793
15794 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15795
15796         * interface.cs (Populate*): Pass in the TypeContainer as well as
15797         the DeclSpace as parameters so that we can create EmitContexts and
15798         then use that to apply attributes etc.
15799
15800         (PopulateMethod, PopulateEvent, PopulateProperty)
15801         (PopulateIndexer): Apply attributes everywhere.
15802
15803         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15804         etc.
15805
15806         (ApplyAttributes): Update accordingly.
15807
15808         We now apply interface attributes for all members too.
15809
15810 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15811
15812         * class.cs (Indexer.Define); Correctly check if we are explicit
15813         implementation (instead of checking the Name for a ".", we
15814         directly look up if the InterfaceType was specified).
15815
15816         Delay the creation of the PropertyBuilder.
15817
15818         Only create the PropertyBuilder if we are not an explicit
15819         interface implementation.   This means that explicit interface
15820         implementation members do not participate in regular function
15821         lookups, and hence fixes another major ambiguity problem in
15822         overload resolution (that was the visible effect).
15823
15824         (DefineMethod): Return whether we are doing an interface
15825         implementation. 
15826
15827         * typemanager.cs: Temporary hack until we get attributes in
15828         interfaces (Ravi is working on that) and we get IndexerName
15829         support in interfaces.
15830
15831         * interface.cs: Register the indexers as properties.
15832
15833         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15834         warning, I have verified that this is a bug in the .NET runtime
15835         (JavaScript suffers of the same problem).
15836
15837         * typemanager.cs (MemberLookup): When looking up members for
15838         interfaces, the parent of an interface is the implicit
15839         System.Object (so we succeed in searches of Object methods in an
15840         interface method invocation.  Example:  IEnumerable x;  x.ToString
15841         ()) 
15842
15843 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15844
15845         * class.cs (Event): Events should also register if they do
15846         implement the methods that an interface requires.
15847
15848         * typemanager.cs (MemberLookup); use the new GetInterfaces
15849         method. 
15850
15851         (GetInterfaces): The code used to lookup interfaces for a type is
15852         used in more than one place, factor it here. 
15853
15854         * driver.cs: Track the errors at the bottom of the file, we kept
15855         on going.
15856
15857         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15858         instance if the method we are calling is static!
15859
15860 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * attribute.cs (ApplyAttributes): Make this function filter out
15863         the IndexerName attribute (as that attribute in reality is never
15864         applied) and return the string constant for the IndexerName
15865         attribute. 
15866
15867         * class.cs (TypeContainer.Emit): Validate that all the indexers
15868         have the same IndexerName attribute, and if so, set the
15869         DefaultName attribute on the class. 
15870
15871         * typemanager.cs: The return value might contain other stuff (not
15872         only methods).  For instance, consider a method with an "Item"
15873         property and an Item method.
15874
15875         * class.cs: If there is a problem with the parameter types,
15876         return. 
15877
15878 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15879
15880         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15881         looks at user defined conversion after making a call to 
15882         StandardConversionExists - we need this for overload resolution.
15883
15884         * expression.cs : Update accordingly the various method calls.
15885
15886         This fixes 2 bugs filed against implicit user defined conversions 
15887
15888 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * statement.cs: Track the result of the assignment.
15891
15892 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15893
15894         * expression.cs (MemberAccess): Improved error reporting for
15895         inaccessible members.
15896
15897 2002-05-22  Martin Baulig  <martin@gnome.org>
15898
15899         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15900         itself with debugging support.
15901
15902 2002-05-22  Martin Baulig  <martin@gnome.org>
15903
15904         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15905         Removed, this isn't needed anymore.
15906
15907 2002-05-20  Martin Baulig  <martin@gnome.org>
15908
15909         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15910         be underlying type for an enum.
15911
15912 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15913
15914         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15915         that splits out the loading of just the core types.
15916
15917         * rootcontext.cs (ResolveCore): Split the struct resolution in
15918         two, so we can load the enumeration underlying types before any
15919         enums are used.
15920
15921         * expression.cs (Is): Bandaid until we fix properly Switch (see
15922         bug #24985 for details).
15923
15924         * typemanager.cs (ImplementsInterface): The hashtable will contain
15925         a null if there are no interfaces implemented.
15926
15927 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * cs-parser.jay (indexer_declarator): It is fine to have array
15930         parameters
15931
15932 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * typemanager.cs: (RegisterBuilder): New function used to register
15935         TypeBuilders that implement interfaces.  Since
15936         TypeBuilder.GetInterfaces (as usual) does not work with lame
15937         Reflection.Emit. 
15938         (AddUserType): register interfaces.
15939
15940         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15941         dealing with TypeBuilder.  Also, arrays are showing up as
15942         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15943         methods can not be invoked on them!
15944
15945         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15946         (ImplicitReferenceConversionExists): Split out from
15947         StandardConversionExists. 
15948
15949         * expression.cs (As): We were only implementing one of the three
15950         cases for the as operator.  We now implement them all.
15951         (Is): Implement the various other cases for Is as well.
15952
15953         * typemanager.cs (CACHE): New define used to control if we want or
15954         not the FindMembers cache.  Seems to have a negative impact on
15955         performance currently
15956
15957         (MemberLookup): Nested types have full acess to
15958         enclosing type members
15959
15960         Remove code that coped with instance/static returns for events, we
15961         now catch this in RealFindMembers.
15962
15963         (RealFindMembers): only perform static lookup if the instance
15964         lookup did not return a type or an event.  
15965
15966 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * assign.cs (CompoundAssign): We pass more semantic information
15969         now to Compound Assignments than we did before: now we have all
15970         the information at hand, and now we resolve the target *before* we
15971         do the expression expansion, which allows the "CacheValue" method
15972         to have the effect we intended (before, a [x] += 1 would generate
15973         two differen ArrayAccess expressions from the ElementAccess,
15974         during the resolution process).
15975
15976         (CompoundAssign.DoResolve): Resolve target and original_source here.
15977
15978 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15979
15980         * expression.cs (ArrayAccess): dropped debugging information. 
15981
15982         * typemanager.cs: Small bug fix: I was always returning i_members,
15983         instead of one of i_members or s_members (depending on which had
15984         the content).
15985
15986         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15987         method is invoked before any code generation takes place, and it
15988         is a mechanism to inform that the expression will be invoked more
15989         than once, and that the method should use temporary values to
15990         avoid having side effects
15991
15992         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15993
15994         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15995         implementation.
15996
15997         * expression.cs (Indirection, ArrayAccess): Add support for
15998         CacheTemporaries in these two bad boys. 
15999
16000         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16001         ldobj or ldind_ref.  
16002         (StoreFromPtr): Handle stobj as well.
16003
16004         * expression.cs (UnaryMutator): Share more code.
16005
16006         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16007         down: I was not tracking the Filter function as well, which
16008         was affecting the results of the cache.
16009
16010 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16011
16012         * attribute.cs: Remove the hack to handle the CharSet property on
16013         StructLayouts. 
16014
16015 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16016
16017         * attribute.cs (DoResolve): More uglyness, we now only try to
16018         resolve the attribute partially, to extract the CharSet
16019         information (only if we are a StructLayout attribute).  Otherwise 
16020
16021         (GetExtraTypeInfo): Add some code to conditionally kill in the
16022         future this.   I am more and more convinced that the .NET
16023         framework has special code to handle the attribute setting on
16024         certain elements.
16025
16026         * expression.cs (IsParamsMethodApplicable): Revert my previous
16027         foreach change here, it was wrong.
16028
16029 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16030
16031         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16032         (pp_expr): do not abort on unknown input, just return.
16033         (eval): abort if there are pending chars.
16034
16035         * attribute.cs (Attribute.Resolve): Positional parameters are
16036         optional.  Deal with that case.
16037
16038         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16039         the Ansi/Unicode/Auto information for the type.
16040
16041         (TypeContainer.DefineType): instantiate the EmitContext here, as
16042         we will be using it during the type definition (to resolve
16043         attributes) and during the emit phase.
16044
16045         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16046         to pull type information out of the attributes
16047
16048         (Attribute.Resolve): track the constructor builder, and allow for
16049         multiple invocations (structs and classes will use this).
16050
16051         * ecore.cs (MemberLookupFinal): new version with all the
16052         parameters customizable.
16053
16054         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16055         constructors.  Return if the result value is null (as the error
16056         would have been flagged already by MemberLookupFinal)
16057
16058         Do not allow instances of abstract classes or interfaces to be
16059         created.
16060
16061         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16062         We have to compare the assembly property here when dealing with
16063         FamANDAssem and Assembly access modifiers, because we might be
16064         creating an assembly from *modules* (that means that we are not
16065         getting TypeBuilders for types defined in other modules that are
16066         part of this assembly).
16067
16068         (Method.Emit): If the method is marked abstract and has a body,
16069         emit an error. 
16070
16071         (TypeContainer.DefineMembers): If both the defined member and the
16072         parent name match are methods, then do not emit any warnings: let
16073         the Method.Define routine take care of flagging warnings.  But if
16074         there is a mismatch (method overrides something else, or method is
16075         overriwritten by something, then emit warning).
16076
16077         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16078         set to null, this means `do not check for the return type on the
16079         signature'. 
16080
16081         (Method.Define): set the return type for the method signature to
16082         null, so that we get methods with the same name and parameters and
16083         different return types.  This is used to flag warning 114 (you are
16084         hiding a method, and you probably want to use the new/override
16085         keywords instead).
16086
16087         * typemanager.cs (MemberLookup): Implemented proper access
16088         control, closing a long standing set of bug reports.  The problem
16089         was that the Framework only has two bits: Public and NonPublic,
16090         and NonPublic includes private and protected methods, but we need
16091         to enforce the FamANDAssem, FamOrAssem and Family. 
16092
16093 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * statement.cs (GotoCase): Return true: Ammounts to giving up
16096         knowledge on whether we return or not, and letting the other case
16097         be responsible for it.
16098
16099 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16100
16101         * driver.cs: Do not load directories for each file processed, only
16102         do it if there is a pattern.
16103
16104         * ecore.cs: Report readonly assigns here as well, as we might have
16105         been resolved only by MemberAccess.
16106
16107         (SimpleName.SimpleNameResolve): Also be useful for LValue
16108         resolution.   We need this to propagate assign to local readonly variables
16109
16110         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16111         do not want to reuse potential criteria memory.
16112
16113         * class.cs (MyEventBuilder): Set reflected_type;
16114
16115         * ecore.cs (Constantify): Added support for constifying bools.
16116
16117         (RootContext.LookupType): Added a cache for values looked up in
16118         the declaration space.
16119
16120         * typemanager.cs (FindMembers): Now is a front-end to
16121         RealFindMembers, and provides a two-level hashtable-based cache to
16122         the request.  
16123
16124         15% performance improvement: from 22.5 to 19.2 seconds.
16125
16126         * expression.cs (IsParamsMethodApplicable): use foreach.
16127         (Invocation.DoResolve): ditto.
16128         (New.DoResolve): ditto.
16129         (ArrayCreation.DoResolve): ditto.
16130
16131         * ecore.cs (FindMostEncompassingType): use foreach.
16132
16133         * delegate.cs (NewDelegate.DoResolve): Use foreach
16134
16135         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16136         (RemoveMethods): use foreach.
16137
16138         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16139         nested foreach statements instead of for, and also break out of
16140         the inner loop once a match is found.
16141
16142         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16143
16144 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16147         we actually unwrap the expression to allow for extra information
16148         to be extracted. 
16149
16150         * expression.cs: Use Shr_Un on unsigned operations. 
16151
16152 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16153
16154         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16155         applicable operators was not being considered correctly. This closes
16156         the bug Miguel reported.
16157
16158 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16159
16160         * attribute.cs: check that the type derives from System.Attribute
16161         and report the correct error in that case (moved the duplicate code to
16162         its own method, too).
16163
16164 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16165
16166         * attribute.cs: lookup attribute type name as the spec says: first the
16167         bare attribute name and then name + "Attribute" (nant compiles with
16168         mcs after this fix).
16169
16170 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16171
16172         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16173         Because of the way we parse things, we should try to see if a
16174         UIntConstant can fit in an integer.
16175
16176 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16177
16178         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16179         when we are in an explicit context.
16180
16181         (ConvertReferenceExplicit): When converting from Iface type S to Class
16182         T make sure the rules are implemented as an OR.
16183
16184         * parameter.cs (ParameterType): Make it a property for now although the
16185         purpose really isn't anything immediate.
16186
16187         * expression.cs (Is*Applicable): Do better checking on the parameter type
16188         of a ref/out parameter. The ones from the system assemblies are already 
16189         marked with the correct type so we don't need to do any correction.
16190
16191         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16192         the object type is standard too so include that.
16193
16194 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16195
16196         * ecore.cs (StandardConversionExists): Augment with missing code:
16197         deal with IntConstant, LongConstants and Enumerations.
16198
16199         * assign.cs: Report the error, instead of failing silently
16200
16201         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16202         typecontainer that they are declared, because the
16203         typecontainer/namespace will have the list of using clauses that
16204         need to be applied.
16205
16206         Assembly Attributes were escaping the normal registration
16207         mechanism. 
16208
16209         (EmitCode): Apply attributes within an EmitContext that represents
16210         the container they were declared on.
16211
16212         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16213
16214 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16215
16216         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16217         Revamp completely - make much cleaner as we now operate only
16218         on a set of Types.
16219
16220         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16221         to implement the logic detailed in the spec more correctly.
16222
16223         (UserDefinedConversion): Update accordingly.
16224
16225 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16226
16227         * statement.cs: Return flow analysis information up.
16228
16229         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16230         and the default.
16231
16232         (token): Do not consume an extra character before calling
16233         decimal_digits.
16234
16235 2002-05-06  Piers Haken <piersh@friskit.com>
16236
16237         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16238
16239 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16240
16241         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16242         EmitContext during the instance constructor initializer
16243         resolution, to stop access to instance variables.
16244
16245         This is mandated by the spec, last paragraph of the `constructor
16246         initializers' section. 
16247
16248 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16249
16250         * cs-parser.jay, class.cs (Accessor): new class used to represent
16251         an accessor (get or set).  In the past we used `null' to represent
16252         a missing accessor.  But this is ambiguous because there was no
16253         way to tell in abstract indexers/properties if one of them was
16254         specified.
16255
16256         Now there is a way of addressing that.
16257
16258         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16259         instead of FindMembers.
16260
16261         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16262         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16263
16264         * attribute.cs: Treat indexers and properties as the same in terms
16265         of applying attributes
16266
16267         * ecore.cs (FindMostEncompassedType): Use statically initialized
16268         EmptyExpressions()s like we do elsewhere to avoid creating useless
16269         objects (and we take this out of the tight loop).
16270
16271         (GetConversionOperators): Move the code to extract the actual
16272         operators to a separate routine to clean things up.
16273
16274 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16275
16276         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16277         events are always registered FieldBuilders.
16278
16279         * class.cs (FieldBase): New class shared by Fields 
16280
16281         * delegate.cs: If we are a toplevel delegate, use our full name.
16282         If we are a nested delegate, then only use our tail name.
16283
16284 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16285
16286         * expression.cs (IsApplicable): Ensure that we add the "&" to
16287         ref/out types before comparing it with the type of the argument.
16288
16289         (IsParamsMethodApplicable): Ditto.
16290
16291         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16292         silly me ;-)
16293
16294         * delegate.cs : Handle the case when we have more than one applicable
16295         method. Flag an error only when we finish checking all.
16296
16297 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16298
16299         * expression.cs: Add support for boolean static initializers.
16300
16301 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16304
16305         * parameter.cs (ComputeParameterTypes,
16306         ComputeAndDefineParameterTypes): Better error handling: now we
16307         clear the `types' cache if we fail during any of the type lookups.
16308         We also return the status code correctly to our caller
16309
16310         * delegate.cs: If we fail to define a delegate, abort the extra
16311         steps. 
16312
16313         * expression.cs (Binary.ResolveOperator): for
16314         operator==(object,object) and operator !=(object, object) we also
16315         have to verify that there is an implicit conversion from one to
16316         the other.
16317
16318         (ArrayAccess.DoResolve): Array Access can operate on
16319         non-variables. 
16320
16321 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16322
16323         * assign.cs (CompoundAssign): A new class used as a "flag" that
16324         the assignment actually is happening as part of a compound
16325         assignment operator.
16326
16327         During compound assignment, a few new rules exist to enable things
16328         like:
16329
16330         byte b |= 1 + 2
16331
16332         From the spec:
16333
16334         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16335         to the type of x) if y is implicitly convertible to the type of x,
16336         and the operator is a builtin operator and the return type of the
16337         operator is explicitly convertible to the type of x. 
16338
16339         * rootcontext.cs: Reset warning level to 2.  4 catches various
16340         "interesting" features in mcs, we must clean this up at some
16341         point, but currently am trying to kill other bugs ;-)
16342
16343         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16344         in container classes as well.  
16345
16346         * expression.cs (Binary.ResolveOperator): Handle string case
16347         before anything else (as operator overloading does emit an error
16348         before doing anything else).
16349
16350         This code could go away when we move to a table driven model, but
16351         i could not come up with a good plan last night.
16352
16353 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16354
16355         * typemanager.cs (CSharpName): reimplementation using regex.
16356         * class.cs: added null check for fields in Emit
16357         * rootcontext.cs: set warninglevel to 4
16358
16359 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16360
16361         * typemanager.cs (CSharpName): reimplemented with Lupus
16362         suggestion.
16363
16364 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16365
16366         * statement.cs (If): correclty implement Resolve, because we were
16367         not catching sem errors in there.  The same process is needed
16368         everywhere else. 
16369         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16370
16371
16372         (Statement.Warning_DeadCodeFound): Factorize code.
16373         (While): Report dead code here too.
16374
16375         (Statement): Added Resolve virtual method to allow
16376         for resolution split from the emit code.
16377
16378 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16379
16380         * statement.cs (EmitBoolExpression): No longer try to resolve the
16381         expression here.    
16382         (MakeBoolean): New utility function that resolve, implicitly
16383         converts to boolean and tags the expression. 
16384
16385
16386         (If, Do): Implement dead code elimination.
16387         (While): Implement loop inversion
16388
16389         (Do, While, For, If): Resolve the expression prior to calling our
16390         code generation.
16391
16392 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16393
16394         * class.cs:
16395           - added method Report28 (warning: program has more than one entry point)
16396           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16397           - modified method Method.Define, the part at the end of the method
16398
16399         * rootcontext.cs: added static public Location EntryPointLocation;
16400           
16401         * ../errors/cs0028.cs : Add test case for the above warning.              
16402
16403         * typemanager.cs:
16404           - modified method CSharpName to allow arrays of primitive type to
16405             be printed nicely (e.g. instead of System.Int32[][] it now prints
16406             int[][])
16407           - added method CSharpSignature: returns the signature of a method
16408             in string format to be used in reporting errors, warnings, etc.
16409
16410         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16411         with String.Empty.
16412
16413 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16414
16415         * delegate.cs (Define): Fix extremely silly bug where I was
16416         setting the type of the 'object' parameter of the BeginInvoke
16417         method to System.IAsyncResult instead of System.Object ;-)
16418
16419 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16420
16421         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16422         here. 
16423
16424         (Constructor.Emit): return if we fail to initialize the
16425         constructor.  Another door closed!  
16426
16427         * expression.cs (New.DoResolve): Improve error message (from -6 to
16428         1501).  Use DeclaredOnly lookup to find the exact constructor.
16429
16430         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16431         loop.  This is useful.
16432
16433         * cs-parser.jay: Adjust the default parameters so that destructors
16434         have the proper signature.
16435
16436 2002-04-26  Martin Baulig  <martin@gnome.org>
16437
16438         * driver.cs (LoadAssembly): If `assembly' contains any characters
16439         which are only valid in path names and not in assembly names
16440         (currently slash, backslash and point), use Assembly.LoadFrom ()
16441         instead of Assembly.Load () on the `assembly' (before iteration
16442         over the link_paths).
16443
16444 2002-04-26  Martin Baulig  <martin@gnome.org>
16445
16446         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16447
16448 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * class.cs (Property): use the new typemanager.MemberLookup
16451
16452         (TypeContainer.MemberLookup): Implement using the
16453         TypeManager.MemberLookup now. 
16454
16455         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16456         and return MemberInfos, so that these can be used without an
16457         EmitContext (what we had before).
16458
16459 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16460
16461         * expression.cs: Fix the case where the argument to params if the
16462         type of the params.  I omitted handling this before.   Fixed
16463
16464 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * driver.cs: Call BootCorlib_PopulateCoreType
16467
16468         * class.cs (Property.CheckBase): Check for properties only, not
16469         for all members. 
16470
16471         * interface.cs: Temporary hack: try/catch around the
16472         CustomAttributeBuilder, because I am getting an exception that I
16473         do not understand.
16474
16475         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16476         types whose definitions are required to be there (attributes are
16477         defined before standard types).
16478
16479         Compute definitions as we boot the various types, as they are used
16480         immediately (value_type class will need object_type, but if we do
16481         not initialize object_type, we will pass a null, which will let
16482         the runtime pick the System.Object from the existing corlib, which
16483         is not what we want).
16484
16485 2002-04-22  Patrik Torstensson <totte@labs2.com>
16486
16487         * cs-tokenizer.cs: fixed a number of trim() issues.
16488
16489 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16490
16491         * expression.cs (Argument.Type): Ensure that we return the correct
16492         type when we have out or ref parameters [in which case we 
16493         append a "&"].
16494
16495 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16496
16497         * class.cs (Property, Indexer): Allow extern modifier in there. 
16498
16499         * typemanager.cs (InitBaseTypes): Initializes object_type and
16500         value_type, since those will be used early on during the bootstrap
16501         process to compile corlib.
16502
16503         (InitCoreTypes): Move code from here to InitBaseTypes.
16504
16505 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16506
16507         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16508         single-dimension arrays as using the ldlen opcode.  
16509
16510         Daniel Lewis discovered this optimization.  
16511
16512         * typemanager.cs: Add signature for System.Array::get_Length
16513
16514 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16515
16516         * statement.cs: report the error when the foreach does not apply to an
16517         array nor a collection.
16518
16519 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16520
16521         * expression.cs: Add implicit conversions to the operator ~.
16522
16523         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16524
16525         * typemanager.cs: Locate the decimal constructor.
16526
16527 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16528
16529         * attribute.cs: use the new property of TypeOf.
16530         * expression.cs: added 'get' property around typearg.
16531
16532         These changes fix a build breaker reported by NickD. Is this the
16533         correct way to fix?  If not, please, revert my changes and make it
16534         work :-).
16535
16536 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16537
16538         * attribute.cs: Add support for typeof in attribute invocations.
16539         I am not sure that this is right though.
16540
16541 2002-04-14  Duncan Mak  <duncan@ximian.com>
16542
16543         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16544         Binary.Operator.Division case.
16545
16546 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16547
16548         * class.cs (DefineType): Ensure that we do a proper check on
16549         attribute types and also register it with the TypeManager.
16550
16551         (TypeContainer.Targets): The default for attribute types is
16552         AttributeTargets.All.
16553
16554         * attribute.cs (ApplyAttributes): Registering the attribute type
16555         is done elsewhere, not when we discover we have a Usage attribute.
16556
16557 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16558
16559         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16560         and get rid of is_delegate parameter.
16561
16562         * everywhere : update.
16563
16564 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16565
16566         * cs-parser.jay (compilation_unit): Revamp completely to use
16567         some new ideas that I got from Rhys' grammar to solve the problems
16568         with assembly level attributes.
16569
16570         (outer_declaration): New grammar production.
16571
16572         (attribute_sections): Add.
16573
16574         (opt_attributes): Base on attribute_sections
16575
16576         (namespace_declaration): Allow opt_attributes to tackle the case
16577         when we have assembly level attributes - we are clever in this
16578         regard now ;-)
16579
16580         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16581         attributes in the non-global context.
16582
16583         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16584         instead of SetGlobalAttributes.
16585
16586         * class.cs, rootcontext.cs : Ensure we define and generate 
16587         attribute types before anything else.
16588
16589         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16590         and flag the new error -20 for the case when the attribute type
16591         does not have valid targets specified. csc does not catch this.
16592
16593         * ../errors/errors.txt : update for error # -20
16594
16595 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16596
16597         * support.cs (InternalParameters.ParameterModifier): Do some null
16598         checking and return sane values.
16599
16600         * class.cs (Method.Define): If we are a PInvoke method, ensure
16601         that we are static and extern. Report error # 601
16602
16603         * ../errors/cs0601.cs : Add test case for the above error.
16604
16605 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16606
16607         * rootcontext.cs (attribute_types): We need to keep type of
16608         all attribute types separately and emit code for them first.
16609
16610         (RegisterAttribute) : Implement.
16611
16612         * class.cs (DefineType): Check if the current Type is a custom
16613         attribute type and register it accordingly.
16614
16615         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16616         adding the first attribute twice and rename to
16617
16618         (SetGlobalAttributes): this.
16619
16620         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16621         lookups.
16622
16623         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16624         if we are processing global arguments. Hmm, I am unsure of this.
16625
16626 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16627
16628         * expression.cs: added static array of strings to avoid calling
16629         Enum.ToString () for Operator in Binary. Significant recover of
16630         performance.
16631
16632 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16633
16634         * class.cs (FindMembers): Allow the Builders of the various
16635         members to be null.  If they are skip them.  This only happens
16636         during the PInvoke declaration.
16637
16638 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16639
16640         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16641         failure, so we do not keep going afterwards.
16642
16643         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16644         wanted to pass `false' as the `is_delegate' argument.  If this is
16645         the case, why not use delegate_type == null to mean `is_delegate =
16646         false' and anything else as is_delegate = true.
16647
16648 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16649
16650         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16651         code for the section, not the beginning of the tests.
16652
16653 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16654
16655         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16656
16657         * expression.cs (Binary): same.  Warn about errors where we have
16658         Enum/Enum in operator + as well.
16659
16660 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16661
16662         * statement.cs:
16663                 - added support for switch(bool)
16664                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16665                 - add TableSwitchEmit() to handle table-based switch statements
16666
16667 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16668
16669         * expression.cs (Invocation.OverloadResolve): Factor out code which
16670         does parameter compatibility checking with arguments so that we can 
16671         re-use the code even from Delegate.VerifyApplicability
16672
16673         (VerifyArgumentsCompat): Move above code here.
16674
16675         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16676         and instead make a call to the above method.
16677
16678 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16679
16680         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16681         We use it to keep track of classes which are attribute types.
16682
16683 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16684
16685         * delegate.cs (Delegate.Define): Correctly define the types in the
16686         presence of fixed and array parameters.
16687
16688         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16689         doing FindMembers.
16690
16691         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16692         include NonPublic after the first iteration.
16693
16694         * class.cs (Indexer.CheckBase): Only check if both parents are
16695         non-null. 
16696
16697         * cs-parser.jay (accessor_body): If empty, set to null.
16698
16699         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16700         same code path here to resolve constants names that we did have in
16701         MemberAccess.DoResolve.  There is too much code duplicated here.
16702
16703 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16704
16705         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16706
16707         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16708         to MakeUnionSet.
16709
16710         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16711         tokens, numbers and strings.
16712
16713         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16714         parenthesis.
16715
16716         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16717         asyncronous parameters and the regular parameters.  
16718
16719         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16720         specify the target directory.
16721
16722         * expression.cs: (This.DoResolve): Simplify
16723         (As.Emit): Optimize, do not generate IsInst if the expression is
16724         always of the given type.
16725
16726         (Is.DoResolve): Bug fix, we were reporting both always/never for
16727         the is expression.
16728
16729         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16730         creating too many unnecessary arrays.
16731
16732 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16733
16734         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16735         fields instead of rolling our own initializer.   Takes care of all
16736         implicit conversions, and drops unnecessary static checks/argument.
16737
16738 2002-03-31  Dick Porter  <dick@ximian.com>
16739
16740         * driver.cs: use the GetDirectories() return values properly, and
16741         use "/" as path separator.
16742
16743 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16744
16745         * expression.cs (Unary): Optimize - - expr into expr.
16746         (Binary): Optimize a + (-b) into a -b.
16747
16748         * codegen.cs (CodeGen): Made all methods static.
16749
16750 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * rootcontext.cs: 
16753
16754         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16755         TypeBuilder property.
16756
16757         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16758         instead. 
16759
16760         * tree.cs: Removed the various RecordXXXX, and replaced with a
16761         single RecordDecl.  Removed all the accessor methods, and just
16762         left a single access point Type 
16763
16764         * enum.cs: Rename DefineEnum to DefineType.
16765
16766         * decl.cs: New abstract method `DefineType' used to unify the
16767         Defines for Enumerations, Interfaces, TypeContainers and
16768         Delegates.
16769
16770         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16771         LookupBaseClasses method that used to live in class.cs and
16772         interface.cs here, and renamed to FindType.
16773
16774         * delegate.cs: Implement DefineType.  Take advantage of the
16775         refactored pattern for locating the parent builder without taking
16776         the parent_builder argument (which we know does not work if we are
16777         nested, and triggering a toplevel definition).
16778
16779 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16780
16781         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16782         accessibility of a member has changed during override and report
16783         an error if so.
16784
16785         * class.cs (Method.Define, Property.Define): Only complain on
16786         overrides if the method is private, any other accessibility is
16787         fine (and since we just checked the permission is the same, we are
16788         good to go).
16789
16790         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16791         and elif are processed always.  The other pre-processing
16792         directives are only processed if we are "taking" the path
16793
16794 2002-03-29  Martin Baulig  <martin@gnome.org>
16795
16796         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16797         current location is not Null.
16798
16799         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16800         a separate method so we can profile it.
16801
16802         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16803         `span.Seconds' are just seconds, but no minutes or hours.
16804         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16805
16806 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16807
16808         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16809         Remove the gratuitous set of Final:
16810
16811                                 // If an interface implementation, then we can set Final.
16812                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16813                                     implementing.DeclaringType.IsInterface)
16814                                         flags |= MethodAttributes.Final;
16815
16816         I do not know what I was smoking when I used that.
16817
16818
16819         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16820         step into fixing the name resolution issues for delegates and
16821         unifying the toplevel name resolution.
16822
16823 2002-03-28  Martin Baulig  <martin@gnome.org>
16824
16825         * class.cs (Method.Emit): If we have a symbol writer, call its
16826         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16827         tell it about the current method.
16828
16829         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16830         writer that we're going to emit the first byte of IL code for a new
16831         statement (a new source line).
16832         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16833         EmitContext.Mark() before emitting any code.
16834
16835         * location.cs (SymbolDocument): Return null when we're Null.
16836
16837         * statement.cs (Statement): Moved the `Location loc' variable here.
16838         (Statement.EmitBoolExpression): If we have a symbol writer, call
16839         ec.Mark() before emitting any code to tell it that we're at the
16840         beginning of a new statement.
16841         (StatementExpression): Added `Location' argument to the constructor.
16842         (Block): Added public readonly variable `StartLocation' and public
16843         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16844         (Block): Added constructor which takes a start and end location.
16845         (Block.SetEndLocation): New method. This sets the end location.
16846         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16847         local variables we create.
16848         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16849         each statement and do also mark the begin and end of the block.
16850
16851         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16852         tell it the current lexer.Location, use Location.Null for the end of the
16853         block.
16854         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16855         current block, set its end location using SetEndLocation().
16856         (statement_expression): StatementExpression constructor now takes the
16857         lexer.Location as additional argument.
16858         (for_statement, declare_local_variables): Likewise.
16859         (declare_local_variables): When creating a new implicit block, use the
16860         new Block constructor and pass it the lexer.Location.
16861
16862 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16863
16864         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16865         members also on the parent interfaces recursively.
16866
16867 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16868
16869         * report.cs: Use new formats, since Gonzalo finished the missing
16870         bits. 
16871
16872         * expression.cs (Binary.ResolveOperator): added missing operator|
16873         operator& and operator^ for bool/bool.
16874
16875         * cs-parser.jay: CheckDef now takes a Location argument that is
16876         used to report errors more precisly (instead of reporting the end
16877         of a definition, we try to track something which is a lot closer
16878         to the source of the problem).
16879
16880         * cs-tokenizer.cs: Track global token use, so we can properly flag
16881         the use of #define/#undef after the first token has been seen.
16882
16883         Also, rename the reportXXXX to Error_DescriptiveName
16884
16885         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16886         TypeContainer, so that Enum and Interface can use this too.
16887
16888         * class.cs (TypeContainer.LookupInterfaceOrClass,
16889         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16890         `builder' argument.  Typically this was used to pass the parent
16891         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16892         the definition).  
16893
16894         The problem is that a nested class could trigger the definition of
16895         a toplevel class, and the builder would be obviously wrong in that
16896         case. 
16897
16898         So we drop this argument, and we compute dynamically the
16899         TypeBuilder/ModuleBuilder (the correct information was available
16900         to us anyways from DeclSpace.Parent)
16901
16902         * interface.cs (Interface.DefineInterface): Drop builder
16903         parameter cleanup like class.cs
16904
16905         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16906         like class.cs
16907
16908         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16909         values. 
16910
16911         (Try.Emit): Propagate the returns value from the statement.
16912
16913         (Return.Emit): Even if we are leavning 
16914
16915         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16916
16917         * modifiers.cs: Fix the computation of MethodAttributes flags.
16918
16919 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16920
16921         * driver.cs: allow compilation of files that start with '/'.
16922         Add a default case when checking the argument of --target.
16923
16924 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16925
16926         * interface.cs: Implement the same search algorithm for types in
16927         the interface code.
16928
16929         * delegate.cs: Do not allow multiple definition.
16930
16931         * Recovered ChangeLog that got accidentally amputated
16932
16933         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16934
16935         * rootcontext.cs: Load manually enum to allow core classes to
16936         contain enumerations.
16937
16938         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16939         Update to new static methods in TypeManager.
16940
16941         * typemanager.cs (GetMethod, GetConstructor): Use our
16942         implementation of FindMembers to find the members, since during
16943         corlib compilation, the types are TypeBuilders and GetMethod and
16944         GetConstructor do not work.
16945
16946         Make all methods in TypeManager static.
16947
16948         (InitCodeHelpers): Split the functionality from
16949         the InitCodeTypes function.
16950
16951         * driver.cs: Call InitCodeHelpers after we have populated the
16952         types. 
16953
16954         * cs-parser.jay (delegate_declaration): we did not used to compute
16955         the delegate name correctly for void delegates.
16956
16957 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * rootcontext.cs (RootContext): Init the interface_resolve_order
16960         and type_container_resolve_order always.
16961
16962         (ResolveCore, BootstrapCorlib_ResolveClass,
16963         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16964         compiler when compiling with --nostdlib
16965
16966         * class.cs (TypeContainer.DefineType): Check that our parent is
16967         not null.  This test is most important when we are bootstraping
16968         the core types.
16969
16970         * codegen.cs: Split out the symbol writing code.
16971
16972 2002-03-25  Martin Baulig  <martin@gnome.org>
16973
16974         * driver.cs (-g): Made -g an alias for --debug.
16975
16976 2002-03-24  Martin Baulig  <martin@gnome.org>
16977
16978         * codegen.cs (SymbolWriter): New public variable. Returns the
16979         current symbol writer.
16980         (CodeGen): Added `bool want_debugging_support' argument to the
16981          constructor. If true, tell the ModuleBuild that we want debugging
16982         support and ask it for the ISymbolWriter.
16983         (Save): If we have a symbol writer, call it's Close() method after
16984         saving the assembly.
16985
16986         * driver.c (--debug): New command line argument to create a
16987         debugger information file.
16988
16989         * location.cs (SymbolDocument): New public property. Returns an
16990         ISymbolDocumentWriter object for the current source file or null
16991         if we don't have a symbol writer.
16992
16993 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16994
16995         * driver.cs (LoadAssembly): Correctly return when all the paths
16996         have been tried and not before.
16997
16998         * statement.cs (Switch.Emit): return the actual coverage for this
16999         statement (returns/not-returns)
17000
17001         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17002         switch of the statement if we are the last switch section.  That
17003         kills two problems: try/catch problems (we used to emit an empty
17004         nop at the end) and switch statements where all branches would
17005         return. 
17006
17007 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17008
17009         * driver.cs: Add default assemblies (the equivalent to the
17010         Microsoft CSC.RSP file)
17011
17012         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17013         also update tokens_seen and set it to false.
17014
17015         * driver.cs: Implement --recurse for Mike.
17016
17017         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17018         correctly splitting out the paths.
17019
17020 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * interface.cs (Interface.PopulateProperty): Instead of using
17023         `parent' as the declaration space for the set parameters, use
17024         `this' 
17025
17026         * support.cs (InternalParameters): InternalParameters constructor
17027         takes a DeclSpace instead of a TypeContainer.
17028
17029         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17030         types are being initialized, load the address of it before calling
17031         the function.  
17032
17033         (New): Provide a mechanism to disable the generation of local
17034         value type temporaries when the caller will be providing us with
17035         an address to store it.
17036
17037         (ArrayCreation.EmitDynamicInitializers): Use it.
17038
17039 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17040
17041         * expression.cs (Invocation.EmitArguments): Only probe for array
17042         property if there is more than one argument.  Sorry about that.
17043
17044         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17045         empty param arrays.
17046
17047         * class.cs (Method.LabelParameters): Fix incorrect code path that
17048         prevented the `ParamArrayAttribute' from being applied to the
17049         params attribute.
17050
17051 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17052
17053         * support.cs (ReflectionParameters): Correctly compute whether the
17054         last argument is a params array.  Fixes the problem with
17055         string.Split ('a')
17056
17057         * typemanager.cs: Make the assemblies array always be non-null
17058         (empty, but non-null)
17059
17060         * tree.cs (RecordDecl): New function that abstracts the recording
17061         of names.  This reports error 101, and provides a pointer to the
17062         previous declaration.  Fixes a crash in the compiler.
17063
17064         * cs-parser.jay (constructor_declaration): Update to new grammar,
17065         and provide a constructor_body that can be empty.
17066
17067 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17068
17069         * driver.cs: Add support for --resources.
17070
17071         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17072         Make all types for the various array helper methods be integer.
17073
17074         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17075         CheckState to ConvCast.
17076
17077         (ConvCast): Now it takes a `checked' state argument, to avoid
17078         depending on the emit context for the conversion, and just using
17079         the resolve time setting.
17080
17081         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17082         instead of Invocation.EmitArguments.  We do not emit the original
17083         arguments, instead we emit those which have been converted to
17084         unsigned int expressions.
17085
17086         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17087
17088         * codegen.cs: ditto.
17089
17090         * expression.cs (LocalVariableReference): Drop the use of the
17091         Store function that depended on the variable index.
17092
17093         * statement.cs (VariableInfo): Drop the `Idx' property from this
17094         class, as this is not taking into account the indexes for
17095         temporaries tat we generate during the execution, getting the
17096         indexes wrong.
17097
17098         * class.cs: First emit class initializers, then call the parent
17099         constructor. 
17100
17101         * expression.cs (Binary): Fix opcode emision.
17102         (UnaryMutator.EmitCode): Support checked code generation
17103
17104         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17105         matches for events for both the Static and Instance scans,
17106         pointing to the same element.   Fix that.
17107
17108 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17109
17110         * rootcontext.cs (ResolveTree): Always set the
17111         interface_resolve_order, because nested interfaces will be calling
17112         into us.
17113
17114         * class.cs (GetInterfaceOrClass): Track the same resolution
17115         process used by TypeManager.LookupType.  This fixes the nested
17116         type lookups in class declarations (separate path from
17117         LookupType). 
17118
17119         (TypeContainer.DefineType): Also define nested interfaces.
17120         (TypeContainer.RegisterOrder): New public function used to
17121         register the order in which child interfaces need to be closed.
17122
17123         Nested interfaces need to be closed after their parents have been
17124         created. 
17125
17126         * interface.cs (InterfaceAttr): Put all the logic for computing
17127         the interface attribute here. 
17128
17129         (DefineInterface): Register our interface order with the
17130         RootContext or with the TypeContainer depending on the case.
17131
17132 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * cs-parser.jay: rework foreach statement to work with the new
17135         changes to the policy on SimpleNames.
17136
17137         * report.cs: support Stacktrace on warnings as well.
17138
17139         * makefile: drop --unsafe and /unsafe from the compile.
17140
17141 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17142
17143         * ecore.cs (StandardConversionExists): Modify to take an Expression
17144         as the first parameter. Ensure we do null -> reference type conversion
17145         checking.
17146
17147         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17148         temporary Expression objects.
17149
17150 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17151
17152         * interface.cs: workaround bug in method overloading resolution
17153         (there is already a bugzilla bug for it).
17154
17155 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17156
17157         We could also solve this problem by having a separate path for
17158         performing type lookups, instead of DoResolve, we could have a
17159         ResolveType entry point, and only participating pieces of the
17160         production (simplename, deref, array) would implement this. 
17161
17162         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17163         signal SimpleName to only resolve type names and not attempt to
17164         resolve anything else.
17165
17166         * expression.cs (Cast): Set the flag.
17167
17168         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17169
17170         * class.cs: Only report 108 if there is no `new' modifier.
17171
17172         * cs-parser.jay: rework foreach statement to work with the new
17173         changes to the policy on SimpleNames.
17174         
17175         * report.cs: support Stacktrace on warnings as well.
17176
17177         * makefile: drop --unsafe and /unsafe from the compile.
17178
17179 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17180
17181         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17182         lookups here, instead of doing that at parse time.  This means
17183         that our grammar will not introduce `LocalVariableReferences' as
17184         expressions at this point.  That solves the problem of code like
17185         this:
17186
17187         class X {
17188            static void Main ()
17189            { int X = 1;
17190             { X x = null }}}
17191
17192         This is only half the fix.  The full fix requires parameters to
17193         also be handled in this way.
17194
17195         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17196         makes the use more obvious of the DeclSpace.  The
17197         ec.TypeContainer.TypeBuilder is now only used to pull the
17198         TypeBuilder for it.
17199
17200         My theory is that I can get rid of the TypeBuilder completely from
17201         the EmitContext, and have typecasts where it is used (from
17202         DeclSpace to where it matters).  
17203
17204         The only pending problem is that the code that implements Aliases
17205         is on TypeContainer, and probably should go in DeclSpace.
17206
17207         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17208         lookups here, instead of doing that at parse time.  This means
17209         that our grammar will not introduce `LocalVariableReferences' as
17210         expressions at this point.  That solves the problem of code like
17211         this:
17212
17213         class X {
17214            static void Main ()
17215            { int X = 1;
17216             { X x = null }}}
17217
17218         This is only half the fix.  The full fix requires parameters to
17219         also be handled in this way.
17220
17221         * class.cs (Property.DefineMethod): When implementing an interface
17222         method, set newslot, when implementing an abstract method, do not
17223         set the flag (before we tried never setting it, or always setting
17224         it, which is the difference).
17225         (Indexer.DefineMethod): same.
17226         (Method.DefineMethod): same.
17227
17228         * ecore.cs: Only set the status used flag if we get back a Field.
17229
17230         * attribute.cs: Temporary hack, so Paolo can keep working.
17231
17232 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17233
17234         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17235         the unmanaged type in the case we have a MarshalAs attribute.
17236
17237         (Resolve): Handle the case when we are parsing the special MarshalAs
17238         attribute [we need to store the unmanaged type to use later]
17239
17240         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17241         MarshalAs Attribute.
17242
17243         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17244         on parameters and accordingly set the marshalling info.
17245
17246 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17247
17248         * class.cs: Optimizing slightly by removing redundant code after
17249         we switched to the `NoTypes' return value.
17250         (Property.DefineMethod): use NoTypes here too.
17251
17252         This fixes the bug I introduced in my last batch of changes.
17253
17254 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17255
17256         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17257
17258         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17259         Enums since those are types too. 
17260
17261         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17262
17263         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17264         thanks to a call during the lookup process.
17265
17266 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17267
17268         * statement.cs (Foreach): Lots of work to accomodate a particular
17269         kind of foreach statement that I had not kept in mind.  It is
17270         possible to have foreachs on classes that provide a GetEnumerator
17271         method that return objects that implement the "pattern" for using
17272         a foreach, there is no need to support GetEnumerator
17273         specifically. 
17274
17275         This is needed to compile nant.
17276
17277         * decl.cs: Only report 114 if the member is not `Finalize' and if
17278         the warning level is at least 2.
17279
17280         * class.cs: Moved the compare function from Method to
17281         MethodSignature. 
17282
17283         (MethodSignature.InheritableMemberSignatureCompare): Add new
17284         filter function that is used to extract inheritable methods from a
17285         class. 
17286
17287         (Method.Define): Use the new `inheritable_method_signature_filter'
17288         delegate
17289
17290         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17291         command. 
17292
17293 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17294
17295         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17296
17297         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17298
17299         * expression.cs: Pass location information to
17300         ConvertImplicitStandard. 
17301
17302         * class.cs: Added debugging code to track return values from
17303         interfaces. 
17304
17305 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17306
17307         * expression.cs (Is.DoResolve): If either side of the `is' is an
17308         interface, do not flag the warning.
17309
17310         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17311         for interfaces
17312
17313         * report.cs: Allow for --fatal to be used with --probe.
17314
17315         * typemanager.cs (NoTypes): Move the definition for the empty Type
17316         array here. 
17317
17318         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17319         properties. 
17320         (TypeContainer.DefineProxy): New function used to proxy to parent
17321         implementations when implementing interfaces.
17322         (TypeContainer.ParentImplements): used to lookup if our parent
17323         implements a public function that is required by an interface.
17324         (TypeContainer.VerifyPendingMethods): Hook this up.
17325
17326         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17327         `modules' and `assemblies' arraylists into arrays.  We only grow
17328         these are the very early start up of the program, so this improves
17329         the speedof LookupType (nicely measured).
17330
17331         * expression.cs (MakeByteBlob): Replaced unsafe code with
17332         BitConverter, as suggested by Paolo.
17333
17334         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17335         folding of string concatenation, but if either side is a string,
17336         and the other is not, then return null, and let the runtime use
17337         the concatenation on the string plus the object (using
17338         `Object.ToString'). 
17339
17340 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17341
17342         Constant Folding has been implemented now.
17343
17344         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17345         the error instead on types that are not supported in one's
17346         complement. 
17347
17348         * constant.cs (Constant and all children): New set of functions to
17349         perform implict and explicit conversions.
17350
17351         * ecore.cs (EnumConstant): Implement the new functions to perform
17352         conversion by proxying to the child expression.
17353
17354         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17355         own separate setting that can not be turned off from the command
17356         line using --unchecked or --checked and is only controlled using
17357         the checked/unchecked statements and expressions.  This setting is
17358         used by the constant folder to flag errors.
17359
17360         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17361         ConstantCheckState as well.   
17362
17363         During Resolve, they also have to flag the state, because the
17364         constant folder runs completely in the Resolve phase.
17365
17366         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17367         well.
17368
17369 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17370
17371         * cfold.cs: New file, this file contains the constant folder.
17372
17373         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17374         argument to track whether we are using the resulting address to
17375         load or store a value and provide better error messages. 
17376
17377         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17378         new AddressOf arguments.
17379
17380         * statement.cs (Foreach.EmitCollectionForeach): Update
17381
17382         * expression.cs (Argument.Emit): Call AddressOf with proper
17383         arguments to track usage.
17384
17385         (New.DoEmit): Call AddressOf with new arguments.
17386
17387         (Unary.Emit): Adjust AddressOf call.
17388
17389 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17390
17391         * cs-parser.jay (member_access): Change the case for pre-defined types
17392         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17393         this suggestion.
17394
17395         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17396         a method body.
17397
17398         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17399         essentially like methods and apply attributes like MethodImplOptions to them too.
17400
17401         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17402         not being null.
17403
17404         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17405         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17406         is the DeclSpace.
17407
17408         * Update code everywhere accordingly.
17409
17410         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17411
17412         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17413
17414 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17415
17416         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17417         try performing lookups against those instead of jumping straight into using
17418         the 'using' clauses.
17419
17420         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17421
17422         (LookupType): Perform lookups in implicit parents too.
17423
17424         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17425         sequence as RootContext.LookupType. 
17426
17427         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17428         the various cases of namespace lookups into this method.
17429
17430 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17431
17432         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17433         in positional arguments)
17434
17435         * class.cs (Operator): Update the AllowedModifiers to contain
17436         extern. 
17437
17438         * cs-parser.jay: Update operator declaration to allow for the
17439         operator body to be empty.
17440
17441         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17442         values. 
17443
17444 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * class.cs (Method.Emit): Label parameters.
17447
17448         * driver.cs: Return 1 or 0 as the program exit code.
17449
17450 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17451
17452         * expression.cs: Special case the `null' object when trying to
17453         auto-compute the type, as anything can be explicitly converted to
17454         that. 
17455
17456         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17457         spotting this Paolo.
17458
17459         (Expression.ImplicitNumericConversion): Perform comparissions of
17460         the type using the underlying type in the case of an enumeration
17461         rather than using the enumeration type for the compare.
17462
17463         Cope with the underlying == type case, which is not possible to
17464         catch before. 
17465
17466         (Expression.ConvertNumericExplicit): Perform comparissions of
17467         the type using the underlying type in the case of an enumeration
17468         rather than using the enumeration type for the compare.
17469
17470         * driver.cs: If the user does not supply an extension, assume .exe
17471
17472         * cs-parser.jay (if_statement): Rewrote so that we can track the
17473         location for the if statement.
17474
17475         * expression.cs (Binary.ConstantFold): Only concat strings when
17476         the operation is "+", not everything ;-)
17477
17478         * statement.cs (Statement.EmitBoolExpression): Take a location
17479         argument. 
17480         (If, While, Do): Track location.
17481
17482         * expression.cs (Binary.ResolveOperator): In the object + string
17483         case, I was missing a call to ConvertImplicit
17484
17485 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17486
17487         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17488         Location arguments. Ensure we use RootContext.LookupType to do our work
17489         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17490
17491         * interface.cs (PopulateMethod): Handle the type of the parameter being
17492         null gracefully.
17493
17494         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17495         have a params method with no fixed arguments and a call is made with no
17496         arguments.
17497
17498 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17499
17500         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17501         the verbatim-string-literal
17502
17503         * support.cs (InternalParameters.ParameterModifier): handle null
17504         fixed parameters.
17505         (InternalParameters.ParameterType): ditto.
17506
17507         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17508         duplicating the name of the variable parameter.
17509         (GetParameterByName): Fix bug where we were not looking up array
17510         paramters if they were the only present (thanks Paolo!).
17511         (GetParameterInfo): We only have an empty set of types if both
17512         fixed and array are set to null.
17513         (GetParameterInfo-idx): Handle FixedParameter == null
17514
17515         * cs-parser.jay: Handle the case where there is no catch
17516         statements (missing null test).
17517
17518 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * driver.cs (MainDriver): Be conservative on our command line
17521         handling.
17522
17523         Catch DirectoryNotFoundException when calling GetFiles.
17524
17525         (SplitPathAndPattern): Used to split the input specification into
17526         a path and a pattern that we can feed to Directory.GetFiles.
17527
17528 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17529
17530         * statement.cs (Fixed): Implement the last case of the Fixed
17531         statement (string handling).
17532
17533         * expression.cs (StringPtr): New class used to return a char * to
17534         a string;  Used by the Fixed statement.
17535
17536         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17537
17538         * expression.cs (Binary.ResolveOperator): Remove redundant
17539         MemberLookup pn parent type.
17540         Optimize union call, we do not need a union if the types are the same.
17541         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17542         type.
17543
17544         Specialize the use of MemberLookup everywhere, instead of using
17545         the default settings. 
17546
17547         (StackAlloc): Implement stackalloc keyword.
17548
17549         * cs-parser.jay: Add rule to parse stackalloc.
17550
17551         * driver.cs: Handle /h, /help, /?
17552
17553         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17554         before we supported unsafe code.
17555
17556         * makefile: add --unsafe to the self compilation of mcs.
17557
17558 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * expression.cs (PointerArithmetic): New class that is used to
17561         perform pointer arithmetic.
17562         (Binary.Resolve): Handle pointer arithmetic
17563         Handle pointer comparission.
17564         (ArrayPtr): Utility expression class that is used to take the
17565         address of an array.
17566
17567         (ElementAccess): Implement array access for pointers
17568
17569         * statement.cs (Fixed): Implement fixed statement for arrays, we
17570         are missing one more case before we are done.
17571
17572         * expression.cs (Indirection): Implement EmitAssign and set the
17573         ExprClass to Variable.  This allows pointer dereferences to be
17574         treated as variables, and to have values assigned to them.
17575
17576         * ecore.cs (Expression.StoreFromPtr): New utility function to
17577         store values dereferencing.
17578
17579 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17580
17581         * expression.cs (Binary.ResolveOperator): Ensure that we are
17582         not trying to operate on a void type - this fixes the reported
17583         bug.
17584
17585         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17586         the parent implementation is sealed.
17587
17588         * ../errors/cs0239.cs : Add.
17589
17590         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17591
17592         * typemanager.cs (unverifiable_code_type): Corresponds to 
17593         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17594         which have unsafe code in them.
17595
17596         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17597         unsafe context.
17598
17599 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17600
17601         * cs-tokenizer.cs: Add support for @"litreal strings"
17602
17603         Make tokenizer accept pre-processor directives
17604         on any column (remove the old C-like limitation). 
17605
17606         * rootcontext.cs (EmitCode): Emit any global attributes.
17607         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17608
17609         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17610
17611         * cs-parser.jay: Add support for global attributes.  
17612
17613 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17614
17615         * expression.cs (Indirection): New helper class.  Unary will
17616         create Indirection classes to be able to implement the
17617         IMemoryLocation interface on it.
17618
17619 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17620
17621         * cs-parser.jay (fixed_statement): reference the right statement.
17622
17623         * statement.cs (Fixed.Emit): Finish implementing the fixed
17624         statement for the &x case.
17625
17626 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * class.cs (Property.Define, Method.Define): Remove newslot when
17629         `implementing'.  
17630
17631         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17632         wrong.  NewSlot should only be used if the `new' keyword is present.
17633
17634         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17635         locating our system dir.  Sorry about this.
17636
17637 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17638
17639         * driver.cs (GetSystemDir): Compute correctly the location of our
17640         system assemblies.  I was using the compiler directory instead of
17641         the library directory.
17642
17643 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17644
17645         * expression.cs (BetterFunction): Put back in what Miguel commented out
17646         since it is the correct fix. The problem is elsewhere ;-)
17647
17648         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17649         parameters of the parms method are themselves compatible or not !
17650
17651         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17652         to check that a class implements an interface before saying that an implicit
17653         conversion was allowed. Use ImplementsInterface to do the checking.
17654
17655 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * class.cs (Method.Define): Track whether we are an explicit
17658         implementation or not.  And only call DefineMethodOverride if we
17659         are an explicit implementation.
17660
17661         (Property.DefineMethod): Ditto.
17662
17663 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17664
17665         * expression.cs (BetterFunction): Catch hideous bug which was
17666          preventing us from detecting ambiguous calls due to implicit casts i.e
17667         cs0121.
17668
17669 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17670
17671         * support.cs (Pair): Remove un-needed method.  I figured why I was
17672         getting the error in cs-parser.jay, the variable in a foreach loop
17673         is readonly, and the compiler does not really treat this as a variable.
17674
17675         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17676         instead of EQUALS in grammar.  
17677
17678         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17679
17680         * expression.cs (Unary.DoResolve): Check whether the argument is
17681         managed or not.
17682
17683 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17684
17685         * support.cs: Api for Pair to set a value.  Despite the fact that
17686         the variables are public the MS C# compiler refuses to compile
17687         code that accesses the field if the variable is part of a foreach
17688         statement. 
17689
17690         * statement.cs (Fixed): Begin implementation of the fixed
17691         statement.
17692
17693         (Block.AddVariable): Return the VariableInfo on success and null
17694         on failure instead of true/false. 
17695
17696         * cs-parser.jay (foreach): Catch errors on variables already
17697         defined (we were ignoring this value before) and properly unwind
17698         the block hierarchy
17699
17700         (fixed_statement): grammar for the fixed statement.
17701
17702 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17703
17704         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17705         pointer types to be incretemented.
17706
17707         (SizeOf): Implement.
17708
17709         * cs-parser.jay (pointer_member_access): Implement
17710         expr->IDENTIFIER production.
17711
17712         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17713         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17714         on safe contexts.
17715
17716         (Unary): Implement indirection.
17717
17718         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17719         use in non-unsafe context).
17720
17721         (SimpleName.DoResolve): Check for pointers in field access on safe
17722         contexts. 
17723
17724         (Expression.LoadFromPtr): Factor the load-indirect code in this
17725         function.  This was duplicated in UnboxCast and ParameterReference
17726
17727 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17728
17729         * expression.cs (ComposedCast): report an error if a pointer cast
17730         is used in a safe region.
17731
17732         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17733         pointer type casts in unsafe context.
17734
17735         * codegen.cs (EmitContext): Set up IsUnsafe.
17736
17737         * cs-parser.jay (non_expression_type): Add productions for pointer
17738         casts. 
17739
17740         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17741         code.  We should not use force into static mode if the method is
17742         not virtual.  Fixes bug in MIS
17743
17744         * statement.cs (Do.Emit, While.Emit, For.Emit,
17745         Statement.EmitBoolExpression): Add support to Do and While to
17746         propagate infinite loop as `I do return' semantics.
17747
17748         Improve the For case to also test for boolean constants.
17749
17750         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17751         to the list of attributes we can add.
17752
17753         Remove `EmitContext' argument.
17754
17755         * class.cs (Method.Define): Apply parameter attributes.
17756         (Constructor.Define): Apply parameter attributes.
17757         (MethodCore.LabelParameters): Move here the core of labeling
17758         parameters. 
17759
17760         * support.cs (ReflectionParameters.ParameterModifier,
17761         InternalParameters.ParameterModifier): Use IsByRef on the type and
17762         only return the OUT bit for these parameters instead of in/out/ref
17763         flags.
17764
17765         This is because I miss-understood things.  The ParameterInfo.IsIn
17766         and IsOut represent whether the parameter has the [In] and [Out]
17767         attributes set.  
17768
17769 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * ecore.cs (FieldExpr.Emit): Release temporaries.
17772
17773         * assign.cs (LocalTemporary.Release): new function.
17774
17775         * codegen.cs (EmitContext.GetTemporaryStorage,
17776         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17777         temporary storage.  Now we can "put back" localbuilders when we
17778         are done with them
17779
17780 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17781
17782         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17783         need to make a copy of the variable to generate verifiable code.
17784
17785 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17786
17787         * driver.cs: Compute dynamically the system directory.
17788
17789         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17790         Slower, but more generally useful.  Used by the abstract
17791         registering implementation. 
17792
17793         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17794         the rules for the special rule on Type/instances.  First check if
17795         we have the same name, and if so, try that special static path
17796         rather than the instance path.
17797
17798 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17799
17800         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17801         for, while and if.
17802
17803         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17804         Enum, ValueType, Delegate or Array for non-corlib compiles.
17805
17806         * cs-tokenizer.cs: Catch long identifiers (645)
17807
17808         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17809         piece of code.
17810
17811         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17812         fix, we were returning too early, so we were not registering
17813         pending methods from abstract classes.
17814
17815         Do not register pending methods if the class is abstract.
17816
17817         * expression.cs (Conditional.DoResolve): Report circular implicit
17818         conversions when we neecd to compute it for conditional
17819         expressions. 
17820
17821         (Is.DoResolve): If the expression is always of the provided type,
17822         flag warning 183.  If the expression can not ever be of the
17823         provided type flag warning 184.
17824
17825         * class.cs: Catch 169 as well.
17826
17827         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17828         read. 
17829
17830 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17831
17832         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17833
17834 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17835
17836         * interface.cs: (PopulateMethod): Check for pointers being defined
17837         only if the unsafe context is active.
17838         (PopulateProperty): ditto.
17839         (PopulateIndexer): ditto.
17840
17841         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17842         specified.  If pointers are present, make sure that they are
17843         present in an unsafe context.
17844         (Constructor, Constructor.Define): ditto.
17845         (Field, Field.Define): ditto.
17846         (Property, Property.Define): ditto.
17847         (Event, Event.Define): ditto.
17848
17849         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17850         hashtable if there are classes or structs defined.
17851
17852         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17853         code, as the constant resolution moved.
17854
17855         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17856         the metadata, so we can flag error 133. 
17857
17858         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17859         pointer is being declared in an unsafe context.
17860
17861 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17862
17863         * modifiers.cs (Modifiers.Check): Require a Location argument.
17864         Report error 227 for Unsafe use.
17865
17866         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17867
17868         * statement.cs (For.Emit): If the test is null, then report that
17869         we do `return', as we wont reach anything afterwards.
17870
17871         (Switch.SwitchGoverningType): Track the expression that matched
17872         the conversion.
17873
17874         * driver.cs: Allow negative numbers as an error code to flag.
17875
17876         * cs-parser.jay: Handle 1551.
17877
17878         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17879
17880 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17881
17882         * cs-parser.jay: Report 1518 (type declaration can only contain
17883         class, struct, interface, enum or delegate)
17884
17885         (switch_label): Report 1523 (keywords `case' or `default' must
17886         preced code)
17887
17888         (opt_switch_sections): Report 1522 (empty switch)
17889
17890         * driver.cs: Report 1515 (response file specified multiple times)
17891         Report 1516 (Source file specified multiple times).
17892
17893         * expression.cs (Argument.Resolve): Signal 1510
17894
17895         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17896         access not allowed in static code)
17897
17898 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17899
17900         * typemanager.cs (IsPointerType): Utility method which we are going
17901         to need a lot.
17902
17903         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17904         the object type, so we take care of that.
17905
17906         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17907
17908         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17909         added to non-params parameters :-)
17910
17911         * typemanager.cs (CSharpName): Include 'void' type too. 
17912
17913         (void_ptr_type): Include in the set of core types.
17914
17915         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17916         duplicating code.
17917
17918         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17919         an unsafe context.
17920
17921         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17922         completely forgotten about it.
17923
17924 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17925
17926         * cs-parser.jay (pointer_type): Add. This begins our implementation
17927         of parsing rules for unsafe code.
17928
17929         (unsafe_statement): Implement.
17930
17931         (embedded_statement): Modify to include the above.
17932
17933         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17934
17935         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17936         if the current context is an unsafe one.
17937
17938         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17939         are handled differently, we need separate rules for them.
17940
17941         (local_variable_declaration): Update to use local_variable_pointer_type
17942         to allow variable declarations of unmanaged pointer types.
17943
17944         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17945         in unsafe contexts.
17946
17947         * ../errors/cs0214.cs : Add.
17948
17949 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17950
17951         * makefile: remove 'response' file when cleaning.
17952
17953 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17954
17955         * cs-parser.jay: Report 1524.
17956
17957 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17958
17959         * typemanager.cs (RegisterMethod): drop checking if we have
17960         registered this from here
17961
17962 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17963
17964         * class.cs (Method.EmitDestructor): Implement calling our base
17965         destructor. 
17966
17967         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17968         value of InFinally.
17969
17970         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17971         this routine and will wrap the call in a try/catch block.  Deal
17972         with the case.
17973
17974 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17975
17976         * ecore.cs (Expression.MemberLookup): instead of taking a
17977         parameter `same_type' that was used to tell whether we could
17978         access private members we compute our containing type from the
17979         EmitContext.
17980
17981         (FieldExpr): Added partial support for volatile fields.  This does
17982         not work for volatile fields exposed from assemblies, as I can not
17983         figure out how to extract the modreq from it.
17984
17985         Updated all the source files to use this.
17986
17987         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17988         because it is referenced by MemberLookup very often. 
17989
17990 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17991
17992         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17993         TypeBuilder.GetCustomAttributes to retrieve what we need.
17994
17995         Get rid of redundant default_member_attr_type as this is the same as
17996         default_member_type which already exists.
17997
17998         * interface.cs, attribute.cs : Update accordingly.
17999
18000 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18001
18002         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18003         work for TYpeBuilders though.  Ravi, can you please fix this?
18004
18005         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18006
18007         * expression.cs (Argument.Emit): Handle the case of ref objects
18008         being passed to ref functions;  
18009
18010         (ParameterReference.EmitLoad): Loads the content of the pointer
18011         without dereferencing.
18012
18013 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18016
18017 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18018
18019         * class.cs (Indexer.DefineMethod): Incorporate the interface
18020         type in the name of the method if we are doing explicit interface
18021         implementation.
18022
18023         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18024
18025         (BetterConversion): Fix extremely trivial bug where we were referring to
18026         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18027         again !
18028
18029         * ../errors/bug16.cs : Add although we have fixed it.
18030
18031 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18032
18033         * expression.cs (BaseIndexer): Begin implementation.
18034
18035         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18036
18037         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18038         production directly to remove a shift/reduce, and implement
18039         explicit interface implementation.
18040
18041         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18042         after a floating point suffix.
18043
18044         * expression.cs (DoNumericPromotions): Improved the conversion for
18045         uint/uint.  If we have a constant, we avoid doing a typecast to a
18046         larger type.
18047
18048         * class.cs (Indexer): Implement explicit interface implementation
18049         for indexers.
18050
18051 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18052
18053         * class.cs: make the default instance constructor public and hidebysig.
18054
18055 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18056
18057         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18058         so we can call it from elsewhere.
18059
18060         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18061         we emit it internally if the class has a defined indexer; otherwise the user
18062         emits it by decorating the class definition with the DefaultMemberAttribute.
18063
18064         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18065         attribute is not used on a type which defines an indexer.
18066
18067         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18068         character when we skip whitespace.
18069
18070         * ../errors/cs0646.cs : Add.
18071
18072 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18073
18074         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18075         again. 
18076
18077         * makefile: Add practical target `mcs3.exe' which builds the third
18078         generation compiler. 
18079
18080         * expression.cs (New): Fix structures constructor calling.
18081
18082         * class.cs (Property, Method, Indexer): Emit Final flag on the
18083         method if we are an interface implementation and we are not
18084         abstract. 
18085
18086         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18087         whether this property is referencing a `base' method.
18088
18089         * expression.cs (Invocation.EmitCall): take an extra argument:
18090         is_base, this is used to determine whether the `call' or
18091         `callvirt' opcode should be used.
18092
18093
18094         * delegate.cs: update EmitCall.
18095
18096         * class.cs (Method.Define): Set NewSlot for the cases where we are
18097         not implementing an interface method.
18098
18099         (Property.Define): ditto.
18100
18101 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18104         'r'.  Allows mcs to parse itself fully.
18105
18106 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18107
18108         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18109         of the number of initializers that require the InitializeArray method.
18110
18111         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18112         update the above field where necessary.
18113
18114         (MakeByteBlob): Update accordingly.
18115
18116         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18117         greater than 2.
18118
18119         (EmitDynamicInitializers): Update in accordance with the new optimization.
18120
18121         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18122         same OpCode applies.
18123
18124         * cs-parser.jay : Fix some glaring errors I introduced.
18125
18126 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18127
18128         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18129         so that we can check for name clashes there too.
18130
18131         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18132         for interface indexers.
18133
18134         * interfaces.cs (Define): Emit the default member attribute.
18135
18136         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18137         variable was being referred to while setting the value ;-)
18138
18139 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18142         byte-by-byte information when we know the data is zero.
18143
18144         Make the block always a multiple of 4, because
18145         DefineInitializedData has a bug.
18146
18147         * assign.cs: Fix, we should assign from the temporary, not from
18148         the source. 
18149
18150         * expression.cs (MakeByteBlob): Fix my incorrect code.
18151
18152 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18153
18154         * typemanager.cs (EnumToUnderlying): This function is used to get
18155         the underlying type from an enumeration, because it does not
18156         always work. 
18157
18158         * constant.cs: Use the I4_S form for values between -128 and 127.
18159
18160         * statement.cs (Block.LookupLabel): Looks up a label.
18161         (Block): Drop support for labeled blocks.
18162
18163         (LabeledStatement): New kind of statement that represents a label
18164         only.
18165
18166         (Goto): Finally implement this bad boy.
18167
18168         * cs-parser.jay: Update to reflect new mechanism to implement
18169         labels.
18170
18171 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * codegen.cs (EmitContext.This): a codegen property that keeps the
18174         a single instance of this instead of creating many different this
18175         instances. 
18176
18177         * delegate.cs (Delegate.DoResolve): Update to use the property;
18178
18179         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18180
18181         * expression.cs (BaseAccess.DoResolve): Ditto.
18182
18183 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18184
18185         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18186         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18187
18188         (InitCoreTypes): Update accordingly.
18189
18190         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18191         so we can quickly store the state.
18192
18193         (ApplyAttributes): Set the correct implementation flags
18194         for InternalCall methods.
18195
18196 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18197
18198         * expression.cs (EmitCall): if a method is not virtual, then do
18199         not use callvirt on it.
18200
18201         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18202         user defined stuff) requires the use of stobj, which takes an
18203         address on the stack instead of an array and an index.  So emit
18204         the Ldelema operation for it.
18205
18206         (EmitStoreOpcode): Use stobj for valuetypes.
18207
18208         (UnaryMutator.EmitCode): Use the right 1 value depending on
18209         whether we are dealing with int64/uint64, float or doubles.
18210
18211         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18212         constructors that I implemented last night.
18213
18214         (Constructor.IsDefault): Fix to work properly for static
18215         constructors.
18216
18217         * cs-parser.jay (CheckDef): report method signature errors.
18218         Update error number 103 to be 132.
18219
18220         * decl.cs: New AdditionResult enumeration value: MethodExists.
18221         Although we do this check for methods later on in the semantic
18222         analysis, catching repeated default constructors is so easy that
18223         we catch these here. 
18224
18225         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18226         promotions code.
18227
18228         (ParameterReference.EmitAssign, Emit): handle
18229         bools as bytes.
18230
18231         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18232         (ArrayAccess.EmitStoreOpcode): ditto.
18233
18234         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18235
18236         * expression.cs (MakeByteBlob): Complete all the missing types
18237         (uint, short, ushort, byte, sbyte)
18238
18239         * class.cs: Only init instance field initializers on instance
18240         constructors. 
18241
18242         Rename `constructors' to instance_constructors. 
18243
18244         (TypeContainer.AddConstructor): Only add constructors to the list
18245         if it is not static.
18246
18247         Make sure that we handle default_static_constructor independently
18248         everywhere where we handle instance_constructors
18249
18250 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * class.cs: Do not lookup or create a base initializer for a
18253         static constructor.
18254
18255         (ConstructorInitializer.Resolve): use the proper type to lookup
18256         for constructors.
18257
18258         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18259
18260         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18261         in DeclSpace. 
18262
18263         * decl.cs: CloseType is now an virtual method, the default
18264         implementation just closes this type.
18265
18266 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18267
18268         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18269         to PreserveSig by default. Also emit HideBySig on such methods.
18270
18271         Basically, set the defaults to standard values.
18272
18273         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18274         argument, if candidate is better, it can't be worse than the best !
18275
18276         (Invocation): Re-write bits to differentiate between methods being
18277         applicable in their expanded form and their normal form - for params
18278         methods of course.
18279
18280         Get rid of use_standard everywhere as only standard conversions are allowed
18281         in overload resolution. 
18282
18283         More spec conformance.
18284
18285 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18286
18287         * driver.cs: Add --timestamp, to see where the compiler spends
18288         most of its time.
18289
18290         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18291         `this' in static code.
18292
18293         (SimpleName.DoResolve): Implement in terms of a helper function
18294         that allows static-references to be passed upstream to
18295         MemberAccess.
18296
18297         (Expression.ResolveWithSimpleName): Resolve specially simple
18298         names when called by MemberAccess to implement the special
18299         semantics. 
18300
18301         (Expression.ImplicitReferenceConversion): Handle conversions from
18302         Null to reference types before others, as Null's type is
18303         System.Object. 
18304
18305         * expression.cs (Invocation.EmitCall): Handle the special case of
18306         calling methods declared on a reference type from a ValueType
18307         (Base classes System.Object and System.Enum)
18308
18309         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18310         the left hand side is a TypeExpr, not on every enumeration. 
18311
18312         (Binary.Resolve): If types are reference types, then do a cast to
18313         object on operators != and == of both arguments.
18314
18315         * typemanager.cs (FindMembers): Extract instance and static
18316         members if requested.
18317
18318         * interface.cs (PopulateProperty): Use void_type instead of null
18319         as the return type for the setter method.
18320
18321         (PopulateIndexer): ditto.
18322
18323 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18324
18325         * support.cs (ReflectionParameters): Fix minor bug where we
18326         were examining the wrong parameter for the ParamArray attribute.
18327
18328         Cope with requests for the type of the parameter at position
18329         greater than the params parameter's. We now return the element
18330         type of the params array as that makes more sense.
18331
18332         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18333         accordingly as we no longer have to extract the element type
18334         ourselves.
18335
18336         (Invocation.OverloadResolve): Update.
18337
18338 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18341         against IEnumerator, test whether the return value is a descendant
18342         of the IEnumerator interface.
18343
18344         * class.cs (Indexer.Define): Use an auxiliary method to implement
18345         the other bits of the method definition.  Begin support for
18346         explicit interface implementation.
18347
18348         (Property.DefineMethod): Use TypeManager.void_type instead of null
18349         for an empty return value.
18350
18351 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18352
18353         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18354         dealing with a FieldExpr which is composed of a FieldBuilder, in
18355         the code path we did extract the constant, but we should have
18356         obtained the underlying value to be able to cast it (otherwise we
18357         end up in an infinite loop, this is what Ravi was running into).
18358
18359         (ArrayCreation.UpdateIndices): Arrays might be empty.
18360
18361         (MemberAccess.ResolveMemberAccess): Add support for section
18362         14.5.4.1 that deals with the special case of E.I when E is a type
18363         and something else, that I can be a reference to a static member.
18364
18365         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18366         handle a particular array type to create byte blobs, it is just
18367         something we dont generate byteblobs for.
18368
18369         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18370         arguments. 
18371
18372         * location.cs (Push): remove the key from the hashtable that we
18373         are about to add.   This happens for empty files.
18374
18375         * driver.cs: Dispose files after we have parsed them.
18376
18377         (tokenize): new function that only runs the tokenizer on its
18378         input, for speed testing.
18379
18380 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18381
18382         * class.cs (Event.Define): Define the private field only if there
18383         are no accessors defined.
18384
18385         * expression.cs (ResolveMemberAccess): If there is no associated
18386         field with the event, that means we have an event defined with its
18387         own accessors and we should flag error cs0070 since transforming
18388         ourselves into a field is not valid in that case.
18389
18390         * ecore.cs (SimpleName.DoResolve): Same as above.
18391
18392         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18393         and charset to sane values.
18394
18395 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18396
18397         * assign.cs (DoResolve): Perform check on events only if they 
18398         are being accessed outside the declaring type.
18399
18400         * cs-parser.jay (event_declarations): Update rules to correctly
18401         set the type of the implicit parameter etc.
18402
18403         (add_accessor, remove_accessor): Set current local parameters.
18404
18405         * expression.cs (Binary): For delegate addition and subtraction,
18406         cast the return value from the method into the appropriate delegate
18407         type.
18408
18409 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18410
18411         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18412         of these as the workaround is unnecessary.
18413
18414         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18415         delegate data - none of that is needed at all.
18416
18417         Re-write bits to extract the instance expression and the delegate method
18418         correctly.
18419
18420         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18421         on delegates too.
18422
18423         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18424         of attaching attributes instead of duplicating code everywhere.
18425
18426         * everywhere : Update code to do attribute emission using the above method.
18427
18428 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18429
18430         * expression.cs (IsParamsMethodApplicable): if there are not
18431         parameters, return immediately.
18432
18433         * ecore.cs: The 0 literal can be implicity converted to an enum
18434         type. 
18435
18436         (SimpleName.DoResolve): First lookup the type, then lookup the
18437         members. 
18438
18439         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18440         want to get its address.  If the InstanceExpression is not
18441         addressable, store the result in a temporary variable, then get
18442         the address of it.
18443
18444         * codegen.cs: Only display 219 errors on warning level or above. 
18445
18446         * expression.cs (ArrayAccess): Make it implement the
18447         IMemoryLocation interface.
18448
18449         (Binary.DoResolve): handle the operator == (object a, object b)
18450         and operator != (object a, object b) without incurring into a
18451         BoxedCast (because 5 != o should never be performed).
18452
18453         Handle binary enumerator operators.
18454
18455         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18456         value type, otherwise use Ldelem_ref.
18457
18458         Use precomputed names;
18459
18460         (AddressOf): Implement address of
18461
18462         * cs-parser.jay (labeled_statement): Fix recursive block
18463         addition by reworking the production.
18464
18465         * expression.cs (New.DoEmit): New has a special case:
18466                 
18467                  If we are dealing with a ValueType, we have a few
18468                  situations to deal with:
18469                 
18470                     * The target of New is a ValueType variable, that is
18471                       easy, we just pass this as the variable reference
18472                 
18473                     * The target of New is being passed as an argument,
18474                       to a boxing operation or a function that takes a
18475                       ValueType.
18476                 
18477                       In this case, we need to create a temporary variable
18478                       that is the argument of New.
18479
18480
18481 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18482
18483         * rootcontext.cs (LookupType): Check that current_type is not null before
18484         going about looking at nested types.
18485
18486         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18487         not implement the IAssignMethod interface any more.
18488
18489         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18490         where we tranform them into FieldExprs if they are being resolved from within
18491         the declaring type.
18492
18493         * ecore.cs (SimpleName.DoResolve): Do the same here.
18494
18495         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18496
18497         * ../errors/bug10.cs : Add.
18498
18499         * ../errors/cs0070.cs : Add.
18500
18501         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18502
18503         * assign.cs : Get rid of EventIsLocal everywhere.
18504
18505 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * ecore.cs (ConvertIntLiteral): finished the implementation.
18508
18509         * statement.cs (SwitchLabel): Convert the value we are using as a
18510         key before looking up the table.
18511
18512 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18513
18514         * codegen.cs (EmitTopBlock): Require a Location argument now.
18515
18516         * cs-parser.jay (constructor_declarator): We need to setup
18517         current_local_parameters before we parse the
18518         opt_constructor_initializer, to allow the variables to be bound
18519         to the constructor arguments.
18520
18521         * rootcontext.cs (LookupType): First lookup nested classes in our
18522         class and our parents before we go looking outside our class.
18523
18524         * expression.cs (ConstantFold): Extract/debox the values at the
18525         beginnning. 
18526
18527         * rootcontext.cs (EmitCode): Resolve the constants first before we
18528         resolve the types.  This is not really needed, but it helps debugging.
18529
18530         * statement.cs: report location.
18531
18532         * cs-parser.jay: pass location to throw statement.
18533
18534         * driver.cs: Small bug fix.
18535
18536         * report.cs: Updated format to be 4-zero filled digits.
18537
18538 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18539
18540         * expression.cs (CheckIndices): Fix minor bug where the wrong
18541         variable was being referred to ;-)
18542
18543         (DoEmit): Do not call EmitStaticInitializers when the 
18544         underlying type is System.Object.
18545
18546 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18547
18548         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18549         and do the usual workaround for SRE.
18550
18551         * class.cs (MyEventBuilder.EventType): New member to get at the type
18552         of the event, quickly.
18553
18554         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18555
18556         * assign.cs (Assign.DoResolve): Handle the case when the target
18557         is an EventExpr and perform the necessary checks.
18558
18559         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18560         interface.
18561
18562         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18563
18564         (EventExpr): Set the type in the constructor itself since we 
18565         are meant to be born fully resolved.
18566
18567         (EventExpr.Define): Revert code I wrote earlier.
18568                 
18569         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18570         instance expression is null. The instance expression is a This in that case
18571         or a null, depending on whether it is a static method or not.
18572
18573         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18574         refers to more than one method.
18575
18576         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18577         and accordingly flag errors.
18578
18579 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18580
18581         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18582
18583 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * location.cs (ToString): Provide useful rutine.
18586
18587 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18590         objects, return the actual integral boxed.
18591
18592         * statement.cs (SwitchLabel): define an ILLabel for each
18593         SwitchLabel. 
18594
18595         (Switch.CheckSwitch): If the value is a Literal, extract
18596         the underlying literal.
18597
18598         Also in the unused hashtable we had, add the SwitchLabel so we can
18599         quickly look this value up.
18600
18601         * constant.cs: Implement a bunch of new constants.  Rewrite
18602         Literal based on this.  Made changes everywhere to adapt to this.
18603
18604         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18605         dereferencing array only once, and also copes with enumrations.
18606
18607         bytes are two bytes wide, not one.
18608
18609         (Cast): Perform constant conversions.
18610
18611         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18612         wrappers to the literals here.
18613
18614         * expression.cs (DoNumericPromotions): long literals can converted
18615         to ulong implicity (this is taken care of elsewhere, but I was
18616         missing this spot).
18617
18618         * ecore.cs (Expression.Literalize): Make the return type Literal,
18619         to improve type checking.
18620
18621         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18622
18623 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * literal.cs: Revert code from ravi that checked the bounds.  The
18626         bounds are sane by the definition of the type itself. 
18627
18628         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18629         need to actually look up in our parent hierarchy for interfaces
18630         implemented. 
18631
18632         * const.cs: Use the underlying type for enumerations
18633
18634         * delegate.cs: Compute the basename for the delegate creation,
18635         that should fix the delegate test case, and restore the correct
18636         Type Lookup semantics in rootcontext
18637
18638         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18639         referencing a nested type with the Reflection API is using the "+"
18640         sign. 
18641
18642         * cs-parser.jay: Do not require EOF token at the end.
18643
18644 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18645
18646         * rootcontext.cs (LookupType): Concatenate type names with
18647         a '.' instead of a '+' The test suite passes again.
18648
18649         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18650         field of the enumeration.
18651
18652         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18653         the case when the member is an EventExpr.
18654
18655         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18656         static has an associated instance expression.
18657
18658         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18659
18660         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18661
18662         * class.cs (Event.Define): Register event and perform appropriate checks
18663         for error #111.
18664
18665         We define the Add and Remove methods even if the use provides none because
18666         in that case, we provide default implementations ourselves.
18667
18668         Define a private field of the type of the event. This is done by the CSC compiler
18669         and we should be doing it too ;-)
18670
18671         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18672         More methods we use in code we generate.
18673
18674         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18675         is important.
18676
18677         (InitCoreTypes): Update accordingly for the above.
18678
18679         * class.cs (Event.Emit): Generate code for default accessors that we provide
18680
18681         (EmitDefaultMethod): Do the job in the above.
18682
18683         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18684         appropriate place.
18685
18686 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18689         builders even if we were missing one.
18690
18691         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18692         pass the Basename as our class name instead of the Name.  The
18693         basename will be correctly composed for us.
18694
18695         * parameter.cs (Paramters): Now takes a Location argument.
18696
18697         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18698         make all the code call directly LookupType in RootContext and take
18699         this chance to pass the Location information everywhere.
18700
18701         * Everywhere: pass Location information.
18702
18703 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18704
18705         * class.cs (Constructor.Define): Updated way of detecting the
18706         length of the parameters.
18707
18708         (TypeContainer.DefineType): Use basename as the type name for
18709         nested types.
18710
18711         (TypeContainer.Define): Do not recursively define types here, as
18712         definition is taken care in order by the RootContext.
18713
18714         * tree.cs: Keep track of namespaces in a per-file basis.
18715
18716         * parameter.cs (Parameter.ComputeSignature): Update to use
18717         DeclSpace. 
18718
18719         (Parameters.GetSignature): ditto.
18720
18721         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18722         instead of a TypeContainer.
18723
18724         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18725         resolve names.  Because we need to be resolve in our context, not
18726         our parents.
18727
18728         * driver.cs: Implement response files.
18729
18730         * class.cs (TypeContainer.DefineType): If we are defined, do not
18731         redefine ourselves.
18732
18733         (Event.Emit): Emit the code for add/remove handlers.
18734         (Event.Define): Save the MethodBuilders for add/remove.
18735
18736         * typemanager.cs: Use pair here too.
18737
18738         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18739         DictionaryEntry requires the first argument to be non-null.  
18740
18741         (enum_declaration): Compute full name for registering the
18742         enumeration.
18743
18744         (delegate_declaration): Instead of using
18745         formal_parameter_list, use opt_formal_parameter_list as the list
18746         can be empty.
18747
18748         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18749         (EventParsing): New property that controls whether `add' and
18750         `remove' are returned as tokens or identifiers (for events);
18751
18752 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18753
18754         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18755         use MyEventBuilder only and let it wrap the real builder for us.
18756
18757         (MyEventBuilder): Revamp constructor etc.
18758
18759         Implement all operations that we perform on EventBuilder in precisely the same
18760         way here too.
18761
18762         (FindMembers): Update to use the EventBuilder member.
18763
18764         (Event.Emit): Update accordingly.
18765
18766 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18767
18768         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18769         by calling the appropriate methods.
18770
18771         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18772         useful.
18773
18774         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18775
18776 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18777
18778         * delegate.cs (Delegate.Populate): Check that the return type
18779         and various parameters types are indeed accessible.
18780
18781         * class.cs (Constructor.Define): Same here.
18782
18783         (Field.Define): Ditto.
18784
18785         (Event.Define): Ditto.
18786
18787         (Operator.Define): Check that the underlying Method defined itself
18788         correctly - so it's MethodBuilder should not be null.
18789
18790         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18791         expression happens to be null.
18792
18793         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18794         members but as of now we don't seem to be able to do anything really useful with it.
18795
18796         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18797         not the EventBuilder.
18798
18799 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * cs-tokenizer.cs: Add support for defines.
18802         Add support for #if, #elif, #else, #endif
18803
18804         (eval_var): evaluates a variable.
18805         (eval): stubbed for evaluating functions.
18806
18807         * cs-parser.jay: Pass the defines information
18808
18809         * driver.cs: Add --define command line option.
18810
18811         * decl.cs: Move MemberCore here.
18812
18813         Make it the base class for DeclSpace.  This allows us to catch and
18814         report 108 and 109 for everything now.
18815
18816         * class.cs (TypeContainer.Define): Extract all the members
18817         before populating and emit the warning 108 (new keyword required
18818         to override) instead of having each member implement this.
18819
18820         (MemberCore.Define): New abstract method, we will be using this in
18821         the warning reporting engine in Populate.
18822
18823         (Operator.Define): Adjust to new MemberCore protocol. 
18824
18825         * const.cs (Const): This does not derive from Expression, it is a
18826         temporary object we use to create fields, it is a MemberCore. 
18827
18828         * class.cs (Method.Define): Allow the entry point to be in a
18829         specific class.
18830
18831         * driver.cs: Rewrite the argument handler to clean it up a bit.
18832
18833         * rootcontext.cs: Made it just an auxiliary namespace feature by
18834         making everything static.
18835
18836         * driver.cs: Adapt code to use RootContext type name instead of
18837         instance variable.
18838
18839         * delegate.cs: Remove RootContext argument.
18840
18841         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18842         argument. 
18843
18844         * class.cs (Event.Define): The lookup can fail.
18845
18846         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18847
18848         * expression.cs: Resolve the this instance before invoking the code.
18849
18850 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18851
18852         * cs-parser.jay: Add a production in element_access that allows
18853         the thing to become a "type" reference.  This way we can parse
18854         things like "(string [])" as a type.
18855
18856         Note that this still does not handle the more complex rules of
18857         casts. 
18858
18859
18860         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18861
18862         * ecore.cs: (CopyNewMethods): new utility function used to
18863         assemble the list of methods from running FindMembers.
18864
18865         (MemberLookup): Rework FindMembers so that 
18866
18867 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18868
18869         * class.cs (TypeContainer): Remove Delegates who fail to be
18870         defined.
18871
18872         * delegate.cs (Populate): Verify that we dont get null return
18873         values.   TODO: Check for AsAccessible.
18874
18875         * cs-parser.jay: Use basename to emit error 574 (destructor should
18876         have the same name as container class), not the full name.
18877
18878         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18879         possible representation.  
18880
18881         Also implements integer type suffixes U and L.
18882
18883 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18884
18885         * expression.cs (ArrayCreation.DoResolve): We need to do the
18886         argument resolution *always*.
18887
18888         * decl.cs: Make this hold the namespace.  Hold the root context as
18889         well.
18890         (LookupType): Move here.
18891
18892         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18893
18894         * location.cs (Row, Name): Fixed the code, it was always returning
18895         references to the first file.
18896
18897         * interface.cs: Register properties defined through interfaces.
18898
18899         * driver.cs: Add support for globbing on the command line
18900
18901         * class.cs (Field): Make it derive from MemberCore as well.
18902         (Event): ditto.
18903
18904 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18905
18906         * class.cs (Event::Define): Check that the type of the event is a delegate
18907         type else flag error #66.
18908
18909         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18910         same.
18911
18912         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18913         values of EntryPoint, CharSet etc etc.
18914
18915         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18916
18917         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18918         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18919         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18920         which needs this to do its work.
18921
18922         * ../errors/cs0066.cs : Add.
18923
18924 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18925
18926         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18927         helper functions.
18928
18929         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18930         clears out the parameters field.
18931         (MemberSignatureCompare): Cleanup
18932
18933         (MemberCore): New base class used to share code between MethodCore
18934         and Property.
18935
18936         (RegisterRequiredImplementations) BindingFlags.Public requires
18937         either BindingFlags.Instace or Static.  Use instance here.
18938
18939         (Property): Refactored code to cope better with the full spec.
18940
18941         * parameter.cs (GetParameterInfo): Return an empty array instead
18942         of null on error.
18943
18944         * class.cs (Property): Abstract or extern properties have no bodies.
18945
18946         * parameter.cs (GetParameterInfo): return a zero-sized array.
18947
18948         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18949         method modifier validation to the typecontainer so we can reuse
18950         this on properties.
18951
18952         (MethodCore.ParameterTypes): return an empty sized array of types.
18953
18954         (Property.Define): Test property modifier validity.
18955
18956         Add tests for sealed/override too.
18957
18958         (Method.Emit): abstract or extern methods have no bodies.
18959
18960 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18961
18962         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18963         thing.
18964
18965         (Method::Define, ::Emit): Modify accordingly.
18966
18967         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18968
18969         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18970
18971         * makefile: Pass in /unsafe.
18972
18973 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18974
18975         * class.cs (MakeKey): Kill routine.
18976
18977         * class.cs (TypeContainer.Define): Correctly define explicit
18978         method implementations (they require the full interface name plus
18979         the method name).
18980
18981         * typemanager.cs: Deply the PtrHashtable here and stop using the
18982         lame keys.  Things work so much better.
18983
18984         This of course broke everyone who depended on `RegisterMethod' to
18985         do the `test for existance' test.  This has to be done elsewhere.
18986
18987         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18988         the object stupid Equals method (because, that like fails all over
18989         the place).  We still do not use it.
18990
18991         * class.cs (TypeContainer.SetRequiredInterface,
18992         TypeContainer.RequireMethods): Killed these two routines and moved
18993         all the functionality to RegisterRequiredImplementations.
18994
18995         (TypeContainer.RegisterRequiredImplementations): This routine now
18996         registers all the implementations required in an array for the
18997         interfaces and abstract methods.  We use an array of structures
18998         which can be computed ahead of time to reduce memory usage and we
18999         also assume that lookups are cheap as most classes will not
19000         implement too many interfaces.
19001
19002         We also avoid creating too many MethodSignatures.
19003
19004         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19005         clear the "pending" bit if we find that there are problems with
19006         the declaration.
19007
19008         (TypeContainer.VerifyPendingMethods): Update to report errors of
19009         methods that look like implementations but are not.
19010
19011         (TypeContainer.Define): Add support for explicit interface method
19012         implementation. 
19013
19014 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19015
19016         * typemanager.cs: Keep track of the parameters here instead of
19017         being a feature of the TypeContainer.
19018
19019         * class.cs: Drop the registration of parameters here, as
19020         InterfaceMethods are also interface declarations.
19021
19022         * delegate.cs: Register methods with the TypeManager not only with
19023         the TypeContainer.  This code was buggy.
19024
19025         * interface.cs: Full registation here.
19026
19027 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19028
19029         * expression.cs: Remove reducer for binary expressions, it can not
19030         be done this way.
19031
19032         * const.cs: Put here the code that used to go into constant.cs
19033
19034         * constant.cs: Put here the code for constants, this is a new base
19035         class for Literals.
19036
19037         * literal.cs: Make Literal derive from Constant.
19038
19039 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * statement.cs (Return.Emit): Report error 157 if the user
19042         attempts to return from a finally block.
19043
19044         (Return.Emit): Instead of emitting a return, jump to the end of
19045         the function.
19046
19047         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19048         LocalBuilder to store the result of the function.  ReturnLabel is
19049         the target where we jump.
19050
19051
19052 2001-12-09  Radek Doulik  <rodo@ximian.com>
19053
19054         * cs-parser.jay: remember alias in current namespace
19055
19056         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19057         namespaces
19058
19059         * class.cs (LookupAlias): lookup alias in my_namespace
19060
19061         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19062         aliases hashtable
19063         (LookupAlias): lookup alias in this and if needed in parent
19064         namespaces
19065
19066 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19067
19068         * support.cs: 
19069
19070         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19071         making things static.  I need this to avoid passing the
19072         TypeContainer when calling ParameterType.
19073
19074         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19075         that did string manipulation to compute the type and then call
19076         GetType.  Use Parameter.ParameterType instead.
19077
19078         * cs-tokenizer.cs: Consume the suffix for floating values.
19079
19080         * expression.cs (ParameterReference): figure out whether this is a
19081         reference parameter or not.  Kill an extra variable by computing
19082         the arg_idx during emission.
19083
19084         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19085         function that returns whether a parameter is an out/ref value or not.
19086
19087         (Parameter.ParameterType): The type of the parameter (base,
19088         without ref/out applied).
19089
19090         (Parameter.Resolve): Perform resolution here.
19091         (Parameter.ExternalType): The full type (with ref/out applied).
19092
19093         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19094         support for expressions on the using statement.
19095
19096 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19097
19098         * statement.cs (Using.EmitLocalVariableDecls): Split the
19099         localvariable handling of the using statement.
19100
19101         (Block.EmitMeta): Keep track of variable count across blocks.  We
19102         were reusing slots on separate branches of blocks.
19103
19104         (Try.Emit): Emit the general code block, we were not emitting it. 
19105
19106         Check the type of the declaration to be an IDisposable or
19107         something that can be implicity converted to it. 
19108
19109         Emit conversions if required.
19110
19111         * ecore.cs (EmptyExpression): New utility class.
19112         (Expression.ImplicitConversionExists): New utility function.
19113
19114 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * statement.cs (Using): Implement.
19117
19118         * expression.cs (LocalVariableReference): Support read only variables.
19119
19120         * statement.cs: Remove the explicit emit for the Leave opcode.
19121         (VariableInfo): Add a readonly field.
19122
19123 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * ecore.cs (ConvCast): new class used to encapsulate the various
19126         explicit integer conversions that works in both checked and
19127         unchecked contexts.
19128
19129         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19130         properly generate the overflow opcodes.
19131
19132 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19133
19134         * statement.cs: The correct type for the EmptyExpression is the
19135         element_type, not the variable type.  Ravi pointed this out.
19136
19137 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19138
19139         * class.cs (Method::Define): Handle PInvoke methods specially
19140         by using DefinePInvokeMethod instead of the usual one.
19141
19142         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19143         above to do the task of extracting information and defining the method.
19144
19145 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19146
19147         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19148         of the condition for string type.
19149
19150         (Emit): Move that here. 
19151
19152         (ArrayCreation::CheckIndices): Keep string literals in their expression
19153         form.
19154
19155         (EmitDynamicInitializers): Handle strings appropriately.
19156
19157 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19158
19159         * codegen.cs (EmitContext): Replace multiple variables with a
19160         single pointer to the current Switch statement.
19161
19162         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19163         EmitContext.
19164
19165 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19166
19167         * statement.cs 
19168
19169         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19170         default'.
19171
19172         (Foreach.Emit): Foreach on arrays was not setting
19173         up the loop variables (for break/continue).
19174
19175         (GotoCase): Semi-implented.
19176
19177 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19178
19179         * attribute.cs (CheckAttribute): Handle system attributes by using
19180         Attribute.GetAttributes to examine information we need.
19181
19182         (GetValidPlaces): Same here.
19183
19184         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19185
19186         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19187
19188         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19189
19190         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19191
19192         (Method::Emit): Handle the case when we are a PInvoke method.
19193
19194 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19195
19196         * expression.cs: Use ResolveWithSimpleName on compound names.
19197
19198 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19199
19200         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19201         before trying to reduce it.
19202
19203         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19204
19205         * constant.cs (LookupConstantValue): Implement.
19206
19207         (EmitConstant): Use the above in emitting the constant.
19208
19209         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19210         that are user-defined by doing a LookupConstantValue on them.
19211
19212         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19213         too, like above.
19214
19215 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19216
19217         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19218
19219         (BaseAccess.DoResolve): Implement.
19220
19221         (MemberAccess.DoResolve): Split this routine into a
19222         ResolveMemberAccess routine that can be used independently
19223
19224 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19225
19226         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19227         As that share bits of the implementation.  Is returns a boolean,
19228         while As returns the Type that is being probed.
19229
19230 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19231
19232         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19233         instead of a Literal - much easier.
19234
19235         (EnumInTransit): Remove - utterly useless :-)
19236
19237         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19238
19239         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19240
19241         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19242         chain when we have no associated expression.
19243
19244 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19245
19246         * constant.cs (Define): Use Location while reporting the errror.
19247
19248         Also emit a warning when 'new' is used and there is no inherited
19249         member to hide.
19250
19251         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19252         populated.
19253
19254         (LookupEnumValue): Implement to lookup an enum member's value and define it
19255         if necessary.
19256
19257         (Populate): Re-write accordingly to use the above routine.
19258
19259 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19260
19261         * expression.cs (This): Fix prototype for DoResolveLValue to
19262         override the base class DoResolveLValue.
19263
19264         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19265         declarations) 
19266
19267         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19268         (we need to load the address of the field here).  This fixes
19269         test-22. 
19270
19271         (FieldExpr.DoResolveLValue): Call the DoResolve
19272         function to initialize the Instance expression.
19273
19274         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19275         correctly the GetEnumerator operation on a value type.
19276
19277         * cs-parser.jay: Add more simple parsing error catches.
19278
19279         * statement.cs (Switch): Add support for string switches.
19280         Handle null specially.
19281
19282         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19283
19284 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19285
19286         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19287
19288         (declare_local_constant): New helper function.
19289
19290         * statement.cs (AddConstant): Keep a separate record of constants
19291
19292         (IsConstant): Implement to determine if a variable is a constant.
19293
19294         (GetConstantExpression): Implement.
19295
19296         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19297
19298         * statement.cs (IsVariableDefined): Re-write.
19299
19300 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19301
19302         * class.cs (TypeContainer::FindMembers): Look for constants
19303         in the case when we are looking for MemberTypes.Field
19304
19305         * expression.cs (MemberAccess::DoResolve): Check that in the
19306         case we are a FieldExpr and a Literal, we are not being accessed
19307         by an instance reference.
19308
19309         * cs-parser.jay (local_constant_declaration): Implement.
19310
19311         (declaration_statement): Implement for constant declarations.
19312
19313 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19314
19315         * statement.cs (Switch): Catch double defaults.
19316
19317         (Switch): More work on the switch() statement
19318         implementation.  It works for integral values now, need to finish
19319         string support.
19320
19321
19322 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19323
19324         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19325         integer literals into other integer literals.  To be used by
19326         switch. 
19327
19328 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19329
19330         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19331         some memory.
19332
19333         (EmitDynamicInitializers): Cope with the above since we extract data
19334         directly from ArrayData now.
19335
19336         (ExpectInitializers): Keep track of whether initializers are mandatory
19337         or not.
19338
19339         (Bounds): Make it a hashtable to prevent the same dimension being 
19340         recorded for every element in that dimension.
19341
19342         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19343         from being found.
19344
19345         Also fix bug which was causing the indices to be emitted in the reverse
19346         order.
19347
19348 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19349
19350         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19351         unfinished.  They do not work, because the underlying code is
19352         sloppy.
19353
19354 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19355
19356         * cs-parser.jay: Remove bogus fixme.
19357
19358         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19359         on Switch statement.
19360
19361 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19362
19363         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19364         the same. 
19365
19366         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19367         parameter. Apparently, any expression is allowed. 
19368
19369         (ValidateInitializers): Update accordingly.
19370
19371         (CheckIndices): Fix some tricky bugs thanks to recursion.
19372
19373         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19374         I was being completely brain-dead.
19375
19376         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19377         and re-write acordingly.
19378
19379         (DelegateInvocation): Re-write accordingly.
19380
19381         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19382
19383         (MakeByteBlob): Handle types more correctly.
19384
19385         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19386         initialization from expressions but it is incomplete because I am a complete
19387         Dodo :-|
19388
19389 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19390
19391         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19392         on If.  Basically, we have to return `true' (ie, we do return to
19393         our caller) only if both branches of the if return.
19394
19395         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19396         short-circuit operators, handle them as short circuit operators. 
19397
19398         (Cast.DoResolve): Resolve type.
19399         (Cast.Cast): Take an expression as the target type.
19400
19401         * cs-parser.jay (cast_expression): Remove old hack that only
19402         allowed a limited set of types to be handled.  Now we take a
19403         unary_expression and we resolve to a type during semantic
19404         analysis.
19405
19406         Use the grammar productions from Rhys to handle casts (this is
19407         not complete like Rhys syntax yet, we fail to handle that corner
19408         case that C# has regarding (-x), but we will get there.
19409
19410 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19411
19412         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19413         field which is an array type.
19414
19415         * cs-parser.jay (declare_local_variables): Support array initialization too.
19416
19417         * typemanager.cs (MakeKey): Implement.
19418
19419         (everywhere): Use the above appropriately.
19420
19421         * cs-parser.jay (for_statement): Update for array initialization while
19422         declaring variables.
19423
19424         * ecore.cs : The error message was correct, it's the variable's names that
19425         were misleading ;-) Make the code more readable.
19426
19427         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19428         the correct type etc.
19429
19430         (ConvertExplicit): Handle Enum types by examining the underlying type.
19431
19432 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19433
19434         * parameter.cs (GetCallingConvention): Always return
19435         CallingConventions.Standard for now.
19436
19437 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19438
19439         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19440         and `r' after calling DoNumericPromotions.
19441
19442         * ecore.cs: Fix error message (the types were in the wrong order).
19443
19444         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19445         BindingFlags.Instance as well 
19446
19447         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19448         implicit int literal conversion in an empty cast so that we
19449         propagate the right type upstream.
19450
19451         (UnboxCast): new class used to unbox value types.
19452         (Expression.ConvertExplicit): Add explicit type conversions done
19453         by unboxing.
19454
19455         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19456         the target type before applying the implicit LongLiterals to ULong
19457         literal cast.
19458
19459 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19460
19461         * cs-parser.jay (for_statement): Reworked the way For works: now
19462         we declare manually any variables that are introduced in
19463         for_initializer to solve the problem of having out-of-band code
19464         emition (that is what got for broken).
19465
19466         (declaration_statement): Perform the actual variable declaration
19467         that used to be done in local_variable_declaration here.
19468
19469         (local_variable_declaration): Do not declare anything, just pass
19470         the information on a DictionaryEntry
19471
19472 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19473
19474         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19475         re-write of the logic to now make it recursive.
19476
19477         (UpdateIndices): Re-write accordingly.
19478
19479         Store element data in a separate ArrayData list in the above methods.
19480
19481         (MakeByteBlob): Implement to dump the array data into a byte array.
19482
19483 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19484
19485         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19486         into CheckIndices.
19487
19488         * constant.cs (Define): Implement.
19489
19490         (EmitConstant): Re-write fully.
19491
19492         Pass in location info.
19493
19494         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19495         respectively.
19496
19497         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19498         DictionaryEntry since we need location info too.
19499
19500         (constant_declaration): Update accordingly.
19501
19502         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19503         code into another method : UpdateIndices.
19504
19505 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19506
19507         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19508         some type checking etc.
19509
19510 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19511
19512         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19513         bits to provide dimension info if the user skips doing that.
19514
19515         Update second constructor to store the rank correctly.
19516
19517 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19518
19519         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19520         and try to implement.
19521
19522         * ../errors/cs0150.cs : Add.
19523
19524         * ../errors/cs0178.cs : Add.
19525
19526 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19527
19528         * statement.cs: Implement foreach on multi-dimensional arrays. 
19529
19530         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19531         name of the params argument.
19532
19533         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19534         initializing the array.
19535
19536         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19537         we can use this elsewhere.
19538
19539         * statement.cs: Finish implementation of foreach for single
19540         dimension arrays.
19541
19542         * cs-parser.jay: Use an out-of-band stack to pass information
19543         around, I wonder why I need this.
19544
19545         foreach_block: Make the new foreach_block the current_block.
19546
19547         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19548         function used to return a static Parameters structure.  Used for
19549         empty parameters, as those are created very frequently.
19550
19551         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19552
19553 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19554
19555         * interface.cs : Default modifier is private, not public. The
19556         make verify test passes again.
19557
19558 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19559
19560         * support.cs (ReflectionParameters): Fix logic to determine
19561         whether the last parameter is a params one. Test 9 passes again.
19562
19563         * delegate.cs (Populate): Register the builders we define with
19564         RegisterParameterForBuilder. Test 19 passes again.
19565
19566         * cs-parser.jay (property_declaration): Reference $6 instead
19567         of $$ to get at the location.
19568
19569         (indexer_declaration): Similar stuff.
19570
19571         (attribute): Ditto.
19572
19573         * class.cs (Property): Register parameters for the Get and Set methods
19574         if they exist. Test 23 passes again.
19575
19576         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19577         call to EmitArguments as we are sure there aren't any params arguments. 
19578         Test 32 passes again.
19579
19580         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19581         IndexOutOfRangeException. 
19582
19583         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19584         Test 33 now passes again.
19585
19586 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19587
19588         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19589         broke a bunch of things.  Will have to come up with a better way
19590         of tracking locations.
19591
19592         * statement.cs: Implemented foreach for single dimension arrays.
19593
19594 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19595
19596         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19597         an error.  This removes the lookup from the critical path.
19598
19599         * cs-parser.jay: Removed use of temporary_loc, which is completely
19600         broken. 
19601
19602 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * support.cs (ReflectionParameters.ParameterModifier): Report
19605         whether the argument is a PARAMS argument or not.
19606
19607         * class.cs: Set the attribute `ParamArrayAttribute' on the
19608         parameter argument.
19609
19610         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19611         and cons_param_array_attribute (ConstructorInfo for
19612         ParamArrayAttribute)., 
19613
19614         * codegen.cs: Emit the return using the `Return' statement, that
19615         way we can report the error correctly for missing return values. 
19616
19617         * class.cs (Method.Emit): Clean up.
19618
19619         * expression.cs (Argument.Resolve): Take another argument: the
19620         location where this argument is used.  Notice that this is not
19621         part of the "Argument" class as to reduce the size of the
19622         structure (we know the approximate location anyways).
19623
19624         Test if the argument is a variable-reference, if not, then
19625         complain with a 206.
19626
19627         (Argument.Emit): Emit addresses of variables.
19628
19629         (Argument.FullDesc): Simplify.
19630
19631         (Invocation.DoResolve): Update for Argument.Resolve.
19632
19633         (ElementAccess.DoResolve): ditto.
19634
19635         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19636         method should be virtual, as this method is always virtual.
19637
19638         (NewDelegate.DoResolve): Update for Argument.Resolve.
19639
19640         * class.cs (ConstructorInitializer.DoResolve): ditto.
19641
19642         * attribute.cs (Attribute.Resolve): ditto.
19643
19644 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19645
19646         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19647
19648         * expression.cs (ParameterReference): Drop IStackStorage and implement
19649         IAssignMethod instead. 
19650
19651         (LocalVariableReference): ditto.
19652
19653         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19654         IAssignMethod instead. 
19655
19656 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19657
19658         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19659         enumerations that are used in heavily used structures derive from
19660         byte in a laughable and pathetic attempt to reduce memory usage.
19661         This is the kind of pre-optimzations that you should not do at
19662         home without adult supervision.
19663
19664         * expression.cs (UnaryMutator): New class, used to handle ++ and
19665         -- separatedly from the other unary operators.  Cleans up the
19666         code, and kills the ExpressionStatement dependency in Unary.
19667
19668         (Unary): Removed `method' and `Arguments' from this class, making
19669         it smaller, and moving it all to SimpleCall, so I can reuse this
19670         code in other locations and avoid creating a lot of transient data
19671         strucutres when not required.
19672
19673         * cs-parser.jay: Adjust for new changes.
19674
19675 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19676
19677         * enum.cs (Enum.Populate): If there is a failure during
19678         definition, return
19679
19680         * cs-parser.jay (opt_enum_base): we used to catch type errors
19681         here, but this is really incorrect.  The type error should be
19682         catched during semantic analysis.
19683
19684 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19685
19686         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19687         current_local_parameters as expected since I, in my stupidity, had forgotten
19688         to do this :-)
19689
19690         * attribute.cs (GetValidPlaces): Fix stupid bug.
19691
19692         * class.cs (Method::Emit): Perform check on applicability of attributes.
19693
19694         (Constructor::Emit): Ditto.
19695
19696         (Field::Emit): Ditto.
19697
19698         (Field.Location): Store location information.
19699
19700         (Property, Event, Indexer, Operator): Ditto.
19701
19702         * cs-parser.jay (field_declaration): Pass in location for each field.
19703
19704         * ../errors/cs0592.cs : Add.
19705
19706 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19707
19708         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19709
19710         (InitCoreTypes): Update accordingly.
19711
19712         (RegisterAttrType, LookupAttr): Implement.
19713
19714         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19715         info about the same.
19716
19717         (Resolve): Update to populate the above as necessary.
19718
19719         (Error592): Helper.
19720
19721         (GetValidPlaces): Helper to the above.
19722
19723         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19724
19725         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19726
19727 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19728
19729         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19730
19731         * ../errors/cs0617.cs : Add.
19732
19733 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19734
19735         * enum.cs (Emit): Rename to Populate to be more consistent with what
19736         we expect it to do and when exactly it is called.
19737
19738         * class.cs, rootcontext.cs : Update accordingly.
19739
19740         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19741         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19742
19743         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19744
19745         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19746         of a fieldinfo using the above, when dealing with a FieldBuilder.
19747
19748 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19749
19750         * ../errors/cs0031.cs : Add.
19751
19752         * ../errors/cs1008.cs : Add.
19753
19754         * ../errrors/cs0543.cs : Add.
19755
19756         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19757         enum type.
19758
19759         (FindMembers): Implement.
19760
19761         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19762         enums and delegates too.
19763
19764         (enum_types): Rename to builder_to_enum.
19765
19766         (delegate_types): Rename to builder_to_delegate.
19767
19768         * delegate.cs (FindMembers): Implement.
19769
19770 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19771
19772         * typemanager.cs (IsEnumType): Implement.
19773
19774         * enum.cs (Emit): Re-write parts to account for the underlying type
19775         better and perform checking etc.
19776
19777         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19778         of the underlying type.
19779
19780         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19781         value
19782
19783         * enum.cs (error31): Helper to report error #31.
19784
19785         * cs-parser.jay (enum_declaration): Store location of each member too.
19786
19787         * enum.cs (member_to_location): New hashtable. 
19788
19789         (AddEnumMember): Update location hashtable.
19790
19791         (Emit): Use the location of each member while reporting errors.
19792
19793 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * cs-parser.jay: A for_initializer if is a
19796         local_variable_declaration really ammount to have an implicit
19797         block with the variable declaration and no initializer for for.
19798
19799         * statement.cs (For.Emit): Cope with null initializers.
19800
19801         This fixes the infinite loop on for initializers.
19802
19803 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19804
19805         * enum.cs: More cleanup.
19806
19807         * ecore.cs: Remove dead code.
19808
19809         * class.cs (Property.Emit): More simplification.
19810         (Event.Emit): ditto.
19811
19812         Reworked to have less levels of indentation.
19813
19814 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19815
19816         * class.cs (Property): Emit attributes.
19817
19818         (Field): Ditto.
19819
19820         (Event): Ditto.
19821
19822         (Indexer): Ditto.
19823
19824         (Operator): Ditto.
19825
19826         * enum.cs (Emit): Ditto.
19827
19828         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19829         Enums too.
19830
19831         * class.cs (Field, Event, etc.): Move attribute generation into the
19832         Emit method everywhere.
19833
19834         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19835         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19836         as we had no way of defining nested enums !
19837
19838         * rootcontext.cs : Adjust code accordingly.
19839
19840         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19841
19842 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19843
19844         * expression.cs (EvalConstantExpression): Move into ecore.cs
19845
19846         * enum.cs (Enum): Rename some members and make them public and readonly
19847         according to our convention.
19848
19849         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19850         nothing else.
19851
19852         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19853
19854         (Enum::Emit): Write a simple version for now which doesn't try to compute
19855         expressions. I shall modify this to be more robust in just a while.
19856
19857         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19858
19859         (TypeContainer::CloseType): Create the Enum types too.
19860
19861         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19862
19863         * expression.cs (EvalConstantExpression): Get rid of completely.
19864
19865         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19866         user-defined values and other cases.
19867
19868         (IsValidEnumLiteral): Helper function.
19869
19870         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19871         out there in the case we had a literal FieldExpr.
19872
19873         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19874
19875         (Literalize): Revamp a bit to take two arguments.
19876
19877         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19878
19879 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19880
19881         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19882
19883         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19884
19885         (Resolve): Use the above to ensure we have proper initializers.
19886
19887 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19888
19889         * expression.cs (Expression::EvalConstantExpression): New method to 
19890         evaluate constant expressions.
19891
19892         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19893
19894 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19897         in an array.
19898
19899         (Binary.ResolveOperator): Handle operator != (object a, object b)
19900         and operator == (object a, object b);
19901
19902         (Binary.DoNumericPromotions): Indicate whether the numeric
19903         promotion was possible.
19904
19905         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19906         Implement.  
19907
19908         Made the ArrayAccess implement interface IAssignMethod instead of
19909         IStackStore as the order in which arguments are passed reflects
19910         this.
19911
19912         * assign.cs: Instead of using expr.ExprClass to select the way of
19913         assinging, probe for the IStackStore/IAssignMethod interfaces.
19914
19915         * typemanager.cs: Load InitializeArray definition.
19916
19917         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19918         static data that can be used to initialize arrays. 
19919
19920 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * expression.cs: Handle operator== and operator!= for booleans.
19923
19924         (Conditioal.Reduce): Implement reducer for the ?: operator.
19925
19926         (Conditional.Resolve): Implement dead code elimination.
19927
19928         (Binary.Resolve): Catch string literals and return a new
19929         concatenated string.
19930
19931         (Unary.Reduce): Implement reduction of unary expressions.
19932
19933         * ecore.cs: Split out the expression core handling here.
19934
19935         (Expression.Reduce): New method used to perform constant folding
19936         and CSE.  This is needed to support constant-expressions. 
19937
19938         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19939         targets, and optimize for !x.
19940
19941 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19942
19943         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19944         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19945         set custom atttributes.
19946
19947         * literal.cs (Literal::GetValue): New abstract method to return the actual
19948         value of the literal, cast as an object.
19949
19950         (*Literal): Implement GetValue method.
19951
19952         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19953         expressions to the arraylist but objects of type Argument.
19954
19955         * class.cs (TypeContainer::Emit): Emit our attributes too.
19956
19957         (Method::Emit, Constructor::Emit): Ditto.
19958
19959         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19960         to be ignoring earlier.
19961
19962 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19963
19964         * attribute.cs (AttributeSection::Define): Implement to do the business
19965         of constructing a CustomAttributeBuilder.
19966
19967         (Attribute): New trivial class. Increases readability of code.  
19968
19969         * cs-parser.jay : Update accordingly.
19970
19971         (positional_argument_list, named_argument_list, named_argument): New rules
19972
19973         (attribute_arguments): Use the above so that we are more correct.
19974
19975 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19976
19977         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19978         to perform all checks for a method with a params parameter.
19979
19980         (Invocation::OverloadResolve): Update to use the above method and therefore
19981         cope correctly with params method invocations.
19982
19983         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19984         params too.
19985
19986         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19987         constructors in our parent too because we can't afford to miss out on 
19988         protected ones ;-)
19989
19990         * attribute.cs (AttributeSection): New name for the class Attribute
19991
19992         Other trivial changes to improve readability.
19993
19994         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19995         use the new class names.
19996
19997 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19998
19999         * class.cs (Method::Define): Complete definition for params types too
20000
20001         (Indexer::Define): Ditto.
20002
20003         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20004         Cope everywhere with a request for info about the array parameter.
20005
20006 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20007
20008         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20009
20010         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20011         local_variable_type to extract the string corresponding to the type.
20012
20013         (local_variable_type): Fixup the action to use the new helper method.
20014
20015         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20016         go.
20017
20018         * expression.cs : Clean out code which uses the above.
20019
20020 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20021
20022         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20023         and bale out if necessary by returning a false.
20024
20025         (RegisterProperty): Ditto.
20026
20027         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20028         and print out appropriate error messages.
20029
20030         * interface.cs (everywhere): Ditto.
20031
20032         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20033         location to constructor.
20034
20035         * class.cs (Property, Event, Indexer): Update accordingly.
20036
20037         * ../errors/cs111.cs : Added.
20038
20039         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20040         of a method, as laid down by the spec.
20041
20042         (Invocation::OverloadResolve): Use the above method.
20043
20044 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20045
20046         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20047         now take a TypeContainer and a Parameters object.
20048
20049         (ParameterData): Modify return type of ParameterModifier method to be 
20050         Parameter.Modifier and not a string.
20051
20052         (ReflectionParameters, InternalParameters): Update accordingly.
20053
20054         * expression.cs (Argument::GetParameterModifier): Same here.
20055
20056         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20057         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20058         symbol in it at all so maybe this is only for now.
20059
20060 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20061
20062         * support.cs (InternalParameters): Constructor now takes an extra argument 
20063         which is the actual Parameters class.
20064
20065         (ParameterDesc): Update to provide info on ref/out modifiers.
20066
20067         * class.cs (everywhere): Update call to InternalParameters to pass in
20068         the second argument too.
20069
20070         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20071         to return the modifier info [ref/out etc]
20072
20073         (InternalParameters, ReflectionParameters): Implement the above.
20074
20075         * expression.cs (Argument::ParameterModifier): Similar function to return
20076         info about the argument's modifiers.
20077
20078         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20079         too.
20080
20081         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20082         a new SetFormalParameters object which we pass to InternalParameters.
20083
20084 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20085
20086         * expression.cs (NewArray): Merge into the ArrayCreation class.
20087
20088 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20089
20090         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20091         NewUserdefinedArray into one as there wasn't much of a use in having
20092         two separate ones.
20093
20094         * expression.cs (Argument): Change field's name to ArgType from Type.
20095
20096         (Type): New readonly property which returns the proper type, taking into 
20097         account ref/out modifiers.
20098
20099         (everywhere): Adjust code accordingly for the above.
20100
20101         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20102         whether we are emitting for a ref or out parameter.
20103
20104         * expression.cs (Argument::Emit): Use the above field to set the state.
20105
20106         (LocalVariableReference::Emit): Update to honour the flag and emit the
20107         right stuff.
20108
20109         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20110
20111         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20112
20113         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20114
20115         (ReflectionParameters, InternalParameters): Implement the above method.
20116
20117         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20118         reporting errors.
20119
20120         (Invocation::FullMethodDesc): Ditto. 
20121
20122 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * cs-parser.jay: Add extra production for the second form of array
20125         creation. 
20126
20127         * expression.cs (ArrayCreation): Update to reflect the above
20128         change. 
20129
20130         * Small changes to prepare for Array initialization.
20131
20132 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20133
20134         * typemanager.cs (ImplementsInterface): interface might be null;
20135         Deal with this problem;
20136
20137         Also, we do store negative hits on the cache (null values), so use
20138         this instead of calling t.GetInterfaces on the type everytime.
20139
20140 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20141
20142         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20143
20144         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20145         split functionality out into different classes.
20146
20147         (New::FormArrayType): Move into NewBuiltinArray.
20148
20149         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20150         quite useless.
20151
20152         (NewBuiltinArray): New class to handle creation of built-in arrays.
20153
20154         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20155         account creation of one-dimensional arrays.
20156
20157         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20158
20159         (NewUserdefinedArray::DoResolve): Implement.
20160
20161         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20162
20163         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20164         we maintain inside the TypeManager. This is necessary to perform lookups on the
20165         module builder.
20166
20167         (LookupType): Update to perform GetType on the module builders too.     
20168
20169         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20170
20171         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20172
20173 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20174
20175         * expression.cs (New::DoResolve): Implement guts of array creation.
20176
20177         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20178
20179 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20180
20181         * expression.cs: Fix bug I introduced lsat night that broke
20182         Delegates. 
20183
20184         (Expression.Resolve): Report a 246 error (can not resolve name)
20185         if we find a SimpleName in the stream.
20186
20187         (Expression.ResolveLValue): Ditto.
20188
20189         (Expression.ResolveWithSimpleName): This function is a variant of
20190         ResolveName, this one allows SimpleNames to be returned without a
20191         warning.  The only consumer of SimpleNames is MemberAccess
20192
20193 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20194
20195         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20196         might arrive here.  I have my doubts that this is correct.
20197
20198         * statement.cs (Lock): Implement lock statement.
20199
20200         * cs-parser.jay: Small fixes to support `lock' and `using'
20201
20202         * cs-tokenizer.cs: Remove extra space
20203
20204         * driver.cs: New flag --checked, allows to turn on integer math
20205         checking. 
20206
20207         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20208         Threading.Monitor.Exit 
20209
20210 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20213         Expression Class to be IndexerAccess.
20214
20215         Notice that Indexer::DoResolve sets the eclass to Value.
20216
20217 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20218
20219         * class.cs (TypeContainer::Emit): Emit code for indexers.
20220
20221         * assign.cs (IAssignMethod): New interface implemented by Indexers
20222         and Properties for handling assignment.
20223
20224         (Assign::Emit): Simplify and reuse code. 
20225
20226         * expression.cs (IndexerAccess, PropertyExpr): Implement
20227         IAssignMethod, clean up old code. 
20228
20229 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20230
20231         * typemanager.cs (ImplementsInterface): New method to determine if a type
20232         implements a given interface. Provides a nice cache too.
20233
20234         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20235         method.
20236
20237         (ConvertReferenceExplicit): Ditto.
20238
20239         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20240         various methods, with correct names etc.
20241
20242         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20243         Operator.UnaryNegation.
20244
20245         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20246         we have a unary plus or minus operator.
20247
20248         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20249         UnaryMinus.
20250
20251         * everywhere : update accordingly.
20252
20253         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20254         respectively.
20255
20256         * class.cs (Method::Define): For the case where we are implementing a method
20257         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20258         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20259
20260 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20261
20262         * interface.cs (FindMembers): Implement to work around S.R.E
20263         lameness.
20264
20265         * typemanager.cs (IsInterfaceType): Implement.
20266
20267         (FindMembers): Update to handle interface types too.
20268
20269         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20270         use IsAssignableFrom as that is not correct - it doesn't work.
20271
20272         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20273         and accordingly override EmitStatement.
20274
20275         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20276         using the correct logic :-)
20277
20278 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20279
20280         * ../errors/cs-11.cs : Add to demonstrate error -11 
20281
20282 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20283
20284         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20285         then pass this as a hint to ResolveLValue.
20286
20287         * expression.cs (FieldExpr): Add Location information
20288
20289         (FieldExpr::LValueResolve): Report assignment to readonly
20290         variable. 
20291
20292         (Expression::ExprClassFromMemberInfo): Pass location information.
20293
20294         (Expression::ResolveLValue): Add new method that resolves an
20295         LValue. 
20296
20297         (Expression::DoResolveLValue): Default invocation calls
20298         DoResolve. 
20299
20300         (Indexers): New class used to keep track of indexers in a given
20301         Type. 
20302
20303         (IStackStore): Renamed from LValue, as it did not really describe
20304         what this did.  Also ResolveLValue is gone from this interface and
20305         now is part of Expression.
20306
20307         (ElementAccess): Depending on the element access type
20308
20309         * typemanager.cs: Add `indexer_name_type' as a Core type
20310         (System.Runtime.CompilerServices.IndexerNameAttribute)
20311
20312         * statement.cs (Goto): Take a location.
20313
20314 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20315
20316         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20317         if two delegates are compatible.
20318
20319         (NewDelegate::DoResolve): Update to take care of the case when
20320         we instantiate a delegate from another delegate.
20321
20322         * typemanager.cs (FindMembers): Don't even try to look up members
20323         of Delegate types for now.
20324
20325 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20326
20327         * delegate.cs (NewDelegate): New class to take care of delegate
20328         instantiation.
20329
20330         * expression.cs (New): Split the delegate related code out into 
20331         the NewDelegate class.
20332
20333         * delegate.cs (DelegateInvocation): New class to handle delegate 
20334         invocation.
20335
20336         * expression.cs (Invocation): Split out delegate related code into
20337         the DelegateInvocation class.
20338
20339 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20340
20341         * expression.cs (New::DoResolve): Implement delegate creation fully
20342         and according to the spec.
20343
20344         (New::DoEmit): Update to handle delegates differently.
20345
20346         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20347         because of which we were printing out arguments in reverse order !
20348
20349         * delegate.cs (VerifyMethod): Implement to check if the given method
20350         matches the delegate.
20351
20352         (FullDelegateDesc): Implement.
20353
20354         (VerifyApplicability): Implement.
20355
20356         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20357         delegate invocations too.
20358
20359         (Invocation::Emit): Ditto.
20360
20361         * ../errors/cs1593.cs : Added.
20362
20363         * ../errors/cs1594.cs : Added.
20364
20365         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20366
20367 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20368
20369         * typemanager.cs (intptr_type): Core type for System.IntPtr
20370
20371         (InitCoreTypes): Update for the same.
20372
20373         (iasyncresult_type, asynccallback_type): Ditto.
20374
20375         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20376         correct.
20377
20378         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20379         too.
20380
20381         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20382         the builders for the 4 members of a delegate type :-)
20383
20384         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20385         type.
20386
20387         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20388
20389         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20390
20391 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20392
20393         * statement.cs (Break::Emit): Implement.   
20394         (Continue::Emit): Implement.
20395
20396         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20397         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20398         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20399         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20400         end loop
20401
20402         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20403         properties that track the label for the current loop (begin of the
20404         loop and end of the loop).
20405
20406 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20407
20408         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20409         use of emitting anything at all.
20410
20411         * class.cs, rootcontext.cs : Get rid of calls to the same.
20412
20413         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20414
20415         (Populate): Define the constructor correctly and set the implementation
20416         attributes.
20417
20418         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20419         have been defined.
20420
20421         (AddDelegateType): Implement.
20422
20423         (IsDelegateType): Implement helper method.
20424
20425         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20426
20427         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20428         and accordingly handle it.
20429
20430         * delegate.cs (Populate): Take TypeContainer argument.
20431         Implement bits to define the Invoke method. However, I still haven't figured out
20432         how to take care of the native int bit :-(
20433
20434         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20435         Qualify the name of the delegate, not its return type !
20436
20437         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20438         conversion.
20439
20440         (StandardConversionExists): Checking for array types turns out to be recursive.
20441
20442         (ConvertReferenceExplicit): Implement array conversion.
20443
20444         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20445
20446 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20447
20448         * cs-parser.jay (delegate_declaration): Store the fully qualified
20449         name as it is a type declaration.
20450
20451         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20452         readonly.
20453
20454         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20455         as TypeContainer::DefineType.
20456
20457         (Populate): Method in which all the definition of the various methods (Invoke)
20458         etc is done.
20459
20460         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20461         see.
20462
20463         (CloseDelegate): Finally creates the delegate.
20464
20465         * class.cs (TypeContainer::DefineType): Update to define delegates.
20466         (Populate, Emit and CloseType): Do the same thing here too.
20467
20468         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20469         delegates in all these operations.
20470
20471 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20472
20473         * expression.cs: LocalTemporary: a new expression used to
20474         reference a temporary that has been created.
20475
20476         * assign.cs: Handle PropertyAccess back here, so that we can
20477         provide the proper semantic access to properties.
20478
20479         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20480         a few more explicit conversions. 
20481
20482         * modifiers.cs: `NEW' modifier maps to HideBySig.
20483
20484         * expression.cs (PropertyExpr): Make this into an
20485         ExpressionStatement, and support the EmitStatement code path. 
20486
20487         Perform get/set error checking, clean up the interface.
20488
20489         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20490         them into toplevel access objects.
20491
20492 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20493
20494         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20495         SRE.
20496
20497         * typemanager.cs: Keep track here of our PropertyBuilders again to
20498         work around lameness in SRE.
20499
20500 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20501
20502         * expression.cs (LValue::LValueResolve): New method in the
20503         interface, used to perform a second resolution pass for LValues. 
20504
20505         (This::DoResolve): Catch the use of this in static methods.
20506
20507         (This::LValueResolve): Implement.
20508
20509         (This::Store): Remove warning, assigning to `this' in structures
20510         is 
20511
20512         (Invocation::Emit): Deal with invocation of
20513         methods on value types.  We need to pass the address to structure
20514         methods rather than the object itself.  (The equivalent code to
20515         emit "this" for structures leaves the entire structure on the
20516         stack instead of a pointer to it). 
20517
20518         (ParameterReference::DoResolve): Compute the real index for the
20519         argument based on whether the method takes or not a `this' pointer
20520         (ie, the method is static).
20521
20522         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20523         value types returned from functions when we need to invoke a
20524         method on the sturcture.
20525
20526
20527 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20528
20529         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20530         defining the type in the Modulebuilder or Typebuilder. This is to take
20531         care of nested types which need to be defined on the TypeBuilder using
20532         DefineNestedMethod.
20533
20534         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20535         methods in RootContext, only ported to be part of TypeContainer.
20536
20537         (TypeContainer::GetInterfaceOrClass): Ditto.
20538
20539         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20540
20541         * interface.cs (Interface::DefineInterface): New method. Does exactly
20542         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20543         too.
20544
20545         (Interface::GetInterfaces): Move from RootContext here and port.
20546
20547         (Interface::GetInterfaceByName): Same here.
20548
20549         * rootcontext.cs (ResolveTree): Re-write.
20550
20551         (PopulateTypes): Re-write.
20552
20553         * class.cs (TypeContainer::Populate): Populate nested types too.
20554         (TypeContainer::Emit): Emit nested members too.
20555
20556         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20557         instead just use the name argument passed in as it is already fully
20558         qualified.
20559
20560         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20561         to TypeContainer mapping to see if a type is user-defined.
20562
20563         * class.cs (TypeContainer::CloseType): Implement. 
20564
20565         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20566         the default constructor.
20567
20568         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20569         twice.
20570
20571         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20572
20573         * interface.cs (CloseType): Create the type here.
20574
20575         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20576         the hierarchy.
20577
20578         Remove all the methods which are now in TypeContainer.
20579
20580 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20581
20582         * delegate.cs (Define): Re-write bits to define the delegate
20583         correctly.
20584
20585 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20586
20587         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20588
20589         * expression.cs (ImplicitReferenceConversion): handle null as well
20590         as a source to convert to any reference type.
20591
20592         * statement.cs (Return): Perform any implicit conversions to
20593         expected return type.  
20594
20595         Validate use of return statement.  
20596
20597         * codegen.cs (EmitContext): Pass the expected return type here.
20598
20599         * class.cs (Method, Constructor, Property): Pass expected return
20600         type to EmitContext.
20601
20602 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20603
20604         * expression.cs: Make DoResolve take an EmitContext instead of a
20605         TypeContainer.
20606
20607         Replaced `l' and `location' for `loc', for consistency.
20608
20609         (Error, Warning): Remove unneeded Tc argument.
20610
20611         * assign.cs, literal.cs, constant.cs: Update to new calling
20612         convention. 
20613
20614         * codegen.cs: EmitContext now contains a flag indicating whether
20615         code is being generated in a static method or not.
20616
20617         * cs-parser.jay: DecomposeQI, new function that replaces the old
20618         QualifiedIdentifier.  Now we always decompose the assembled
20619         strings from qualified_identifier productions into a group of
20620         memberaccesses.
20621
20622 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20623
20624         * rootcontext.cs: Deal with field-less struct types correctly now
20625         by passing the size option to Define Type.
20626
20627         * class.cs: Removed hack that created one static field. 
20628
20629 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20630
20631         * statement.cs: Moved most of the code generation here. 
20632
20633 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20634
20635         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20636         seem very right.
20637
20638         (ElementAccess): Remove useless bits for now - keep checks as the spec
20639         says.
20640
20641 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20642
20643         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20644         and start performing checks according to the spec.
20645
20646 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20647
20648         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20649         rank_specifiers instead.
20650
20651         (rank_specifiers): Change the order in which the rank specifiers are stored
20652
20653         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20654
20655         * expression.cs (ElementAccess): Implement the LValue interface too.
20656
20657 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20658
20659         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20660         except that user defined conversions are not included.
20661
20662         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20663         perform the conversion of the return type, if necessary.
20664
20665         (New::DoResolve): Check whether we are creating an array or an object
20666         and accordingly do the needful.
20667
20668         (New::Emit): Same here.
20669
20670         (New::DoResolve): Implement guts of array creation.
20671
20672         (New::FormLookupType): Helper function.
20673
20674 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20675
20676         * codegen.cs: Removed most of the code generation here, and move the
20677         corresponding code generation bits to the statement classes. 
20678
20679         Added support for try/catch/finalize and throw.
20680
20681         * cs-parser.jay: Added support for try/catch/finalize.
20682
20683         * class.cs: Catch static methods having the flags override,
20684         virtual or abstract.
20685
20686         * expression.cs (UserCast): This user cast was not really doing
20687         what it was supposed to do.  Which is to be born in fully resolved
20688         state.  Parts of the resolution were being performed at Emit time! 
20689
20690         Fixed this code.
20691
20692 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20693
20694         * expression.cs: Implicity convert the result from UserCast.
20695
20696 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20697
20698         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20699         prevented it from working correctly. 
20700
20701         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20702         merely ConvertImplicit.
20703
20704 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20705
20706         * typemanager.cs: Make the LookupTypeContainer function static,
20707         and not per-instance.  
20708
20709         * class.cs: Make static FindMembers (the one that takes a Type
20710         argument). 
20711
20712         * codegen.cs: Add EmitForeach here.
20713
20714         * cs-parser.jay: Make foreach a toplevel object instead of the
20715         inline expansion, as we need to perform semantic analysis on it. 
20716
20717 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20718
20719         * expression.cs (Expression::ImplicitUserConversion): Rename to
20720         UserDefinedConversion.
20721
20722         (Expression::UserDefinedConversion): Take an extra argument specifying 
20723         whether we look for explicit user conversions too.
20724
20725         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20726
20727         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20728
20729         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20730         with the appropriate arguments.
20731
20732         * cs-parser.jay (cast_expression): Record location too.
20733
20734         * expression.cs (Cast): Record location info.
20735
20736         (Expression::ConvertExplicit): Take location argument.
20737
20738         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20739         to determine if we are doing explicit conversions.
20740
20741         (UserCast::Emit): Update accordingly.
20742
20743         (Expression::ConvertExplicit): Report an error if everything fails.
20744
20745         * ../errors/cs0030.cs : Add.
20746
20747 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20748
20749         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20750         virtual and newslot bits. 
20751
20752         * class.cs (TypeContainer::RegisterRequiredImplementations):
20753         Record methods we need.
20754
20755         (TypeContainer::MakeKey): Helper function to make keys for
20756         MethodBases, since the Methodbase key is useless.
20757
20758         (TypeContainer::Populate): Call RegisterRequiredImplementations
20759         before defining the methods.   
20760
20761         Create a mapping for method_builders_to_methods ahead of time
20762         instead of inside a tight loop.
20763
20764         (::RequireMethods):  Accept an object as the data to set into the
20765         hashtable so we can report interface vs abstract method mismatch.
20766
20767 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20768
20769         * report.cs: Make all of it static.
20770
20771         * rootcontext.cs: Drop object_type and value_type computations, as
20772         we have those in the TypeManager anyways.
20773
20774         Drop report instance variable too, now it is a global.
20775
20776         * driver.cs: Use try/catch on command line handling.
20777
20778         Add --probe option to debug the error reporting system with a test
20779         suite. 
20780
20781         * report.cs: Add support for exiting program when a probe
20782         condition is reached.
20783
20784 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20785
20786         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20787         we do a forcible conversion regardless of type, to check if 
20788         ForceConversion returns a null.
20789
20790         (Binary::error19): Use location to report error.
20791
20792         (Unary::error23): Use location here too.
20793
20794         * ../errors/cs0019.cs : Check in.
20795
20796         * ../errors/cs0023.cs : Check in.
20797
20798         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20799         case of a non-null MethodInfo object with a length of 0 !
20800
20801         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20802         an applicable member - according to the spec :-)
20803         Also fix logic to find members in base types.
20804
20805         (Unary::ResolveOperator): Same here.
20806
20807         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20808         as I was getting thoroughly confused between this and error19 :-)
20809
20810         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20811         (::FindMostEncompassedType): Implement.
20812         (::FindMostEncompassingType): Implement.
20813         (::StandardConversionExists): Implement.
20814
20815         (UserImplicitCast): Re-vamp. We now need info about most specific
20816         source and target types so that we can do the necessary conversions.
20817
20818         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20819         mathematical union with no duplicates.
20820
20821 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20822
20823         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20824         in order from base classes to child classes, so that we can in
20825         child classes look up in our parent for method names and
20826         attributes (required for handling abstract, virtual, new, override
20827         constructs: we need to instrospect our base class, and if we dont
20828         populate the classes in order, the introspection might be
20829         incorrect.  For example, a method could query its parent before
20830         the parent has any methods and would determine that the parent has
20831         no abstract methods (while it could have had them)).
20832
20833         (RootContext::CreateType): Record the order in which we define the
20834         classes.
20835
20836 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20837
20838         * class.cs (TypeContainer::Populate): Also method definitions can
20839         fail now, keep track of this.
20840
20841         (TypeContainer::FindMembers): Implement support for
20842         DeclaredOnly/noDeclaredOnly flag.
20843
20844         (Constructor::Emit) Return the ConstructorBuilder.
20845
20846         (Method::Emit) Return the MethodBuilder. 
20847         Check for abstract or virtual methods to be public.
20848
20849         * rootcontext.cs (RootContext::CreateType): Register all the
20850         abstract methods required for the class to be complete and the
20851         interface methods that must be implemented. 
20852
20853         * cs-parser.jay: Report error 501 (method requires body if it is
20854         not marked abstract or extern).
20855
20856         * expression.cs (TypeOf::Emit): Implement.
20857
20858         * typemanager.cs: runtime_handle_type, new global type.
20859
20860         * class.cs (Property::Emit): Generate code for properties.
20861
20862 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20863
20864         * expression.cs (Unary::ResolveOperator): Find operators on base type
20865         too - we now conform exactly to the spec.
20866
20867         (Binary::ResolveOperator): Same here.
20868
20869         * class.cs (Operator::Define): Fix minor quirk in the tests.
20870
20871         * ../errors/cs0215.cs : Added.
20872
20873         * ../errors/cs0556.cs : Added.
20874
20875         * ../errors/cs0555.cs : Added.
20876
20877 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20878
20879         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20880         single integer which is really efficient
20881
20882 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20883
20884         *  expression.cs (Expression::ImplicitUserConversion): Use location
20885         even in the case when we are examining True operators.
20886  
20887         * class.cs (Operator::Define): Perform extensive checks to conform
20888         with the rules for operator overloading in the spec.
20889
20890         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20891         some of the other conversions mentioned in the spec.
20892
20893         * typemanager.cs (array_type): New static member for the System.Array built-in
20894         type.
20895
20896         (cloneable_interface): For System.ICloneable interface.
20897
20898         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20899         we start resolving the tree and populating types.
20900
20901         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20902  
20903 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20904
20905         * expression.cs (Expression::ExprClassFromMemberInfo,
20906         Expression::Literalize): Create literal expressions from
20907         FieldInfos which are literals.
20908
20909         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20910         type casts, because they were wrong.  The test suite in tests
20911         caught these ones.
20912
20913         (ImplicitNumericConversion): ushort to ulong requires a widening
20914         cast. 
20915
20916         Int32 constant to long requires widening cast as well.
20917
20918         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20919         for integers because the type on the stack is not i4.
20920
20921 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20922
20923         * expression.cs (report118): require location argument. 
20924
20925         * parameter.cs: Do not dereference potential null value.
20926
20927         * class.cs: Catch methods that lack the `new' keyword when
20928         overriding a name.  Report warnings when `new' is used without
20929         anything being there to override.
20930
20931         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20932
20933         * class.cs: Only add constructor to hashtable if it is non-null
20934         (as now constructors can fail on define).
20935
20936         (TypeManager, Class, Struct): Take location arguments.
20937
20938         Catch field instance initialization in structs as errors.
20939
20940         accepting_filter: a new filter for FindMembers that is static so
20941         that we dont create an instance per invocation.
20942
20943         (Constructor::Define): Catch errors where a struct constructor is
20944         parameterless 
20945
20946         * cs-parser.jay: Pass location information for various new
20947         constructs. 
20948
20949         * delegate.cs (Delegate): take a location argument.
20950
20951         * driver.cs: Do not call EmitCode if there were problesm in the
20952         Definition of the types, as many Builders wont be there. 
20953
20954         * decl.cs (Decl::Decl): Require a location argument.
20955
20956         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20957         into integers, and find the most appropiate integer for it.
20958
20959         * literal.cs: Implement ULongLiteral.
20960
20961         * rootcontext.cs: Provide better information about the location of
20962         failure when CreateType fails.
20963
20964 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20965
20966         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20967         as well.
20968
20969         * expression.cs (Binary::CheckShiftArguments): Add missing type
20970         computation.
20971         (Binary::ResolveOperator): Add type to the logical and and logical
20972         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20973         before.
20974
20975         (Binary::DoNumericPromotions): In the case where either argument
20976         is ulong (and most signed types combined with ulong cause an
20977         error) perform implicit integer constant conversions as well.
20978
20979 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20980
20981         * expression.cs (UserImplicitCast): Method should always be
20982         non-null. 
20983         (Invocation::BetterConversion): Simplified test for IntLiteral.
20984
20985         (Expression::ImplicitNumericConversion): Split this routine out.
20986         Put the code that performs implicit constant integer conversions
20987         here. 
20988
20989         (Expression::Resolve): Become a wrapper around DoResolve so we can
20990         check eclass and type being set after resolve.
20991
20992         (Invocation::Badness): Remove this dead function
20993
20994         (Binary::ResolveOperator): Do not compute the expensive argumnets
20995         unless we have a union for it.
20996
20997         (Probe::Emit): Is needs to do an isinst and then
20998         compare against null.
20999
21000         (::CanConvert): Added Location argument.  If the Location argument
21001         is null (Location.Null), then we do not report errors.  This is
21002         used by the `probe' mechanism of the Explicit conversion.  We do
21003         not want to generate an error for something that the user
21004         explicitly requested to be casted.  But the pipeline for an
21005         explicit cast first tests for potential implicit casts.
21006
21007         So for now, if the Location is null, it means `Probe only' to
21008         avoid adding another argument.   Might have to revise this
21009         strategy later.
21010
21011         (ClassCast): New class used to type cast objects into arbitrary
21012         classes (used in Explicit Reference Conversions).
21013
21014         Implement `as' as well.
21015
21016         Reverted all the patches from Ravi below: they were broken:
21017
21018                 * The use of `level' as a mechanism to stop recursive
21019                   invocations is wrong.  That was there just to catch the
21020                   bug with a strack trace but not as a way of addressing
21021                   the problem.
21022
21023                   To fix the problem we have to *understand* what is going
21024                   on and the interactions and come up with a plan, not
21025                   just get things going.
21026
21027                 * The use of the type conversion cache that I proposed
21028                   last night had an open topic: How does this work across
21029                   protection domains.  A user defined conversion might not
21030                   be public in the location where we are applying the
21031                   conversion, a different conversion might be selected
21032                   (ie, private A->B (better) but public B->A (worse),
21033                   inside A, A->B applies, but outside it, B->A will
21034                   apply).
21035
21036                 * On top of that (ie, even if the above is solved),
21037                   conversions in a cache need to be abstract.  Ie, `To
21038                   convert from an Int to a Short use an OpcodeCast', not
21039                   `To convert from an Int to a Short use the OpcodeCast on
21040                   the variable 5' (which is what this patch was doing).
21041
21042 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21043
21044         * expression.cs (Invocation::ConversionExists): Re-write to use
21045         the conversion cache
21046
21047         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21048         cache all conversions done, not just user-defined ones.
21049
21050         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21051         to determine if a conversion exists instead of acutually trying to 
21052         perform the conversion. It's faster too.
21053
21054         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21055         and only then attempt the implicit conversion.
21056
21057 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21058
21059         * expression.cs (ConvertImplicit): Use a cache for conversions
21060         already found. Check level of recursion and bail out if necessary.
21061
21062 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21063
21064         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21065         Export standard methods that we expect for string operations.
21066
21067         * statement.cs (Block::UsageWarning): Track usage of variables and
21068         report the errors for not used variables.
21069
21070         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21071         operator. 
21072
21073 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21074
21075         * codegen.cs: remove unnneded code 
21076
21077         * expression.cs: Removed BuiltinTypeAccess class
21078
21079         Fix the order in which implicit conversions are
21080         done.  
21081
21082         The previous fixed dropped support for boxed conversions (adding a
21083         test to the test suite now)
21084
21085         (UserImplicitCast::CanConvert): Remove test for source being null,
21086         that code is broken.  We should not feed a null to begin with, if
21087         we do, then we should track the bug where the problem originates
21088         and not try to cover it up here.
21089
21090         Return a resolved expression of type UserImplicitCast on success
21091         rather than true/false.  Ravi: this is what I was talking about,
21092         the pattern is to use a static method as a "constructor" for
21093         objects. 
21094
21095         Also, do not create arguments until the very last minute,
21096         otherwise we always create the arguments even for lookups that
21097         will never be performed. 
21098
21099         (UserImplicitCast::Resolve): Eliminate, objects of type
21100         UserImplicitCast are born in a fully resolved state. 
21101
21102         * typemanager.cs (InitCoreTypes): Init also value_type
21103         (System.ValueType). 
21104
21105         * expression.cs (Cast::Resolve): First resolve the child expression.
21106
21107         (LValue): Add new method AddressOf to be used by
21108         the `&' operator.  
21109
21110         Change the argument of Store to take an EmitContext instead of an
21111         ILGenerator, because things like FieldExpr need to be able to call
21112         their children expression to generate the instance code. 
21113
21114         (Expression::Error, Expression::Warning): Sugar functions for
21115         reporting errors.
21116
21117         (Expression::MemberLookup): Accept a TypeContainer instead of a
21118         Report as the first argument.
21119
21120         (Expression::ResolvePrimary): Killed.  I still want to improve
21121         this as currently the code is just not right.
21122
21123         (Expression::ResolveMemberAccess): Simplify, but it is still
21124         wrong. 
21125
21126         (Unary::Resolve): Catch errors in AddressOf operators.
21127
21128         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21129         index to a byte for the short-version, or the compiler will choose
21130         the wrong Emit call, which generates the wrong data.
21131
21132         (ParameterReference::Emit, ::Store): same.
21133
21134         (FieldExpr::AddressOf): Implement.
21135
21136         * typemanager.cs: TypeManager: made public variable instead of
21137         property.
21138
21139         * driver.cs: document --fatal.
21140
21141         * report.cs (ErrorMessage, WarningMessage): new names for the old
21142         Error and Warning classes.
21143
21144         * cs-parser.jay (member_access): Turn built-in access to types
21145         into a normal simplename
21146
21147 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21148
21149         * expression.cs (Invocation::BetterConversion): Fix to cope
21150         with q being null, since this was introducing a bug.
21151
21152         * expression.cs (ConvertImplicit): Do built-in conversions first.
21153
21154 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21155
21156         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21157
21158 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21159
21160         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21161         I had introduced long ago (what's new ?).
21162
21163         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21164         the work of all the checking. 
21165         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21166         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21167
21168         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21169         that is the right way. 
21170
21171         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21172         overloading resolution. Use everywhere instead of cutting and pasting code.
21173
21174         (Binary::ResolveOperator): Use MakeUnionSet.
21175
21176         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21177         we have to convert to bool types. Not complete yet.
21178
21179 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21180
21181         * typemanager.cs (TypeManager::CSharpName): support ushort.
21182
21183         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21184         to provide an expression that performsn an implicit constant int
21185         conversion (section 6.1.6).
21186         (Expression::ConvertImplicitRequired): Reworked to include
21187         implicit constant expression conversions.
21188
21189         (Expression::ConvertNumericExplicit): Finished.
21190
21191         (Invocation::Emit): If InstanceExpression is null, then it means
21192         that we perform a call on this.
21193
21194 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21195
21196         * expression.cs (Unary::Emit): Remove some dead code.
21197         (Probe): Implement Resolve and Emit for `is'.
21198         (Expression::ConvertImplicitRequired): Attempt to do constant
21199         expression conversions here.  Maybe should be moved to
21200         ConvertImplicit, but I am not sure.
21201         (Expression::ImplicitLongConstantConversionPossible,
21202         Expression::ImplicitIntConstantConversionPossible): New functions
21203         that tell whether is it possible to apply an implicit constant
21204         expression conversion.
21205
21206         (ConvertNumericExplicit): Started work on explicit numeric
21207         conversions.
21208
21209         * cs-parser.jay: Update operator constants.
21210
21211         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21212         (Parameters::GetSignature): Hook up VerifyArgs here.
21213         (Parameters::VerifyArgs): Verifies that no two arguments have the
21214         same name. 
21215
21216         * class.cs (Operator): Update the operator names to reflect the
21217         ones that the spec expects (as we are just stringizing the
21218         operator names).
21219
21220         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21221         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21222         previous usage did only work for our methods.
21223         (Expression::ConvertImplicit): Handle decimal implicit numeric
21224         conversions as well.
21225         (Expression::InternalTypeConstructor): Used to invoke constructors
21226         on internal types for default promotions.
21227
21228         (Unary::Emit): Implement special handling for the pre/post
21229         increment/decrement for overloaded operators, as they need to have
21230         the same semantics as the other operators.
21231
21232         (Binary::ResolveOperator): ditto.
21233         (Invocation::ConversionExists): ditto.
21234         (UserImplicitCast::Resolve): ditto.
21235
21236 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21237
21238         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21239         operator, return after emitting body. Regression tests pass again !
21240
21241         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21242         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21243         (Invocation::OverloadResolve): Ditto.
21244         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21245
21246         * everywhere : update calls to the above methods accordingly.
21247
21248 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21249
21250         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21251
21252         * expression.cs (ExpressionStatement): New base class used for
21253         expressions that can appear in statements, so that we can provide
21254         an alternate path to generate expression that do not leave a value
21255         on the stack.
21256
21257         (Expression::Emit, and all the derivatives): We no longer return
21258         whether a value is left on the stack or not.  Every expression
21259         after being emitted leaves a single value on the stack.
21260
21261         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21262         facilties of ExpressionStatement if possible.
21263
21264         * cs-parser.jay: Update statement_expression.
21265
21266 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21267
21268         * driver.cs: Change the wording of message
21269
21270 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21271
21272         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21273         the type of the expression to the return type of the method if
21274         we have an overloaded operator match ! The regression tests pass again !
21275         (Unary::ResolveOperator): Ditto.
21276
21277         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21278         to find "op_Implicit", not "implicit" ;-)
21279         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21280         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21281
21282         * everywhere : Correct calls to the above accordingly.
21283
21284         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21285         (ConvertImplicit): Do user-defined conversion if it exists.
21286
21287 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21288
21289         * assign.cs: track location.
21290         (Resolve): Use implicit conversions on assignment.
21291
21292         * literal.cs: Oops.  Not good, Emit of short access values should
21293         pass (Bytes) or the wrong argument will be selected.
21294
21295         * expression.cs (Unary::Emit): Emit code for -expr.
21296
21297         (Unary::ResolveOperator): Handle `Substract' for non-constants
21298         (substract from zero from the non-constants).
21299         Deal with Doubles as well. 
21300
21301         (Expression::ConvertImplicitRequired): New routine that reports an
21302         error if no implicit conversion exists. 
21303
21304         (Invocation::OverloadResolve): Store the converted implicit
21305         expressions if we make them
21306
21307 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21308
21309         * class.cs (ConstructorInitializer): Take a Location argument.
21310         (ConstructorBaseInitializer): Same here.
21311         (ConstructorThisInitializer): Same here.
21312
21313         * cs-parser.jay : Update all calls accordingly.
21314
21315         * expression.cs (Unary, Binary, New): Take location argument.
21316         Update accordingly everywhere.
21317
21318         * cs-parser.jay : Update all calls to the above to take a location
21319         argument.
21320
21321         * class.cs : Ditto.
21322
21323 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21324
21325         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21326         (Invocation::BetterConversion): Same here
21327         (Invocation::ConversionExists): Ditto.
21328
21329         (Invocation::ConversionExists): Implement.
21330
21331 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21332
21333         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21334         Also take an additional TypeContainer argument.
21335
21336         * All over : Pass in TypeContainer as argument to OverloadResolve.
21337
21338         * typemanager.cs (CSharpName): Update to check for the string type and return
21339         that too.
21340
21341         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21342         a given method.
21343
21344 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21345
21346         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21347         (Invocation::BetterFunction): Implement.
21348         (Invocation::BetterConversion): Implement.
21349         (Invocation::ConversionExists): Skeleton, no implementation yet.
21350
21351         Okay, things work fine !
21352
21353 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21354
21355         * typemanager.cs: declare and load enum_type, delegate_type and
21356         void_type. 
21357
21358         * expression.cs (Expression::Emit): Now emit returns a value that
21359         tells whether a value is left on the stack or not.  This strategy
21360         might be reveted tomorrow with a mechanism that would address
21361         multiple assignments.
21362         (Expression::report118): Utility routine to report mismatches on
21363         the ExprClass.
21364
21365         (Unary::Report23): Report impossible type/operator combination
21366         utility function.
21367
21368         (Unary::IsIncrementableNumber): Whether the type can be
21369         incremented or decremented with add.
21370         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21371         complemented. 
21372         (Unary::ResolveOperator): Implement ++, !, ~,
21373
21374         (Invocation::Emit): Deal with new Emit convetion.
21375
21376         * All Expression derivatives: Updated their Emit method to return
21377         whether they leave values on the stack or not.
21378
21379         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21380         stack for expressions that are statements. 
21381
21382 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21383
21384         * expression.cs (LValue): New interface.  Must be implemented by
21385         LValue objects.
21386         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21387         LValue interface.
21388
21389         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21390         interface for generating code, simplifies the code.
21391
21392 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21393
21394         * expression.cs (everywhere): Comment out return statements in ::Resolve
21395         methods to avoid the warnings.
21396
21397 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21398
21399         * driver.cs (parse): Report error 2001 if we can not open the
21400         source file.
21401
21402         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21403         not resolve it.
21404
21405         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21406         object. 
21407
21408         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21409         otherwise nested blocks end up with the same index.
21410
21411         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21412
21413         * expression.cs:  Instead of having FIXMEs in the Resolve
21414         functions, throw exceptions so it is obvious that we are facing a
21415         bug. 
21416
21417         * cs-parser.jay (invocation_expression): Pass Location information.
21418
21419         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21420         Use a basename for those routines because .NET does not like paths
21421         on them. 
21422
21423         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21424         already defined.
21425
21426 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21429         are loading the correct data types (throws an exception if not).
21430         (TypeManager::InitCoreTypes): Use CoreLookupType
21431
21432         * expression.cs (Unary::ResolveOperator): return the child
21433         expression for expressions which are just +expr.
21434         (Unary::ResolveOperator): Return negative literals for -LITERAL
21435         expressions (otherwise they are Unary {Literal}).
21436         (Invocation::Badness): Take into account `Implicit constant
21437         expression conversions'.
21438
21439         * literal.cs (LongLiteral): Implement long literal class.
21440         (IntLiteral): export the `Value' of the intliteral. 
21441
21442 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21443
21444         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21445
21446         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21447         instead of 'Operator'
21448
21449         * expression.cs (Binary::ResolveOperator): Update accordingly.
21450         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21451         and 'Minus'
21452
21453         * cs-parser.jay (unary_expression): Update to use the new names.
21454
21455         * gen-treedump.cs (GetUnary): Same here.
21456
21457         * expression.cs (Unary::Resolve): Implement.
21458         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21459         operators are found instead of making noise ;-)
21460         (Unary::ResolveOperator): New method to do precisely the same thing which
21461         Binary::ResolveOperator does for Binary expressions.
21462         (Unary.method, .Arguments): Add.
21463         (Unary::OperName): Implement.   
21464         (Unary::ForceConversion): Copy and Paste !
21465
21466         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21467         a unary operator.
21468
21469         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21470         for the inbuilt operators. Only overloading works for now ;-)
21471
21472 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21475         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21476
21477         * expression.cs (This::Emit): Implement. 
21478         (This::Resolve): Implement.
21479         (TypeOf:Resolve): Implement.
21480         (Expression::ResolveSimpleName): Add an implicit this to instance
21481         field references. 
21482         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21483         Bind instance variable to Field expressions.
21484         (FieldExpr::Instance): New field used to track the expression that
21485         represents the object instance.
21486         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21487         binding 
21488         (FieldExpr::Emit): Implement.
21489
21490         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21491         the last instruction contains a return opcode to avoid generating
21492         the last `ret' instruction (this generates correct code, and it is
21493         nice to pass the peverify output).
21494
21495         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21496         initializer for static and instance variables.
21497         (Constructor::Emit): Allow initializer to be null in the case of
21498         static constructors.  Only emit initializer for instance
21499         constructors. 
21500
21501         (TypeContainer::FindMembers): Return a null array if there are no
21502         matches.
21503
21504         Also fix the code for the MemberTypes.Method branch, as it was not
21505         scanning that for operators (or tried to access null variables before).
21506
21507         * assign.cs (Assign::Emit): Handle instance and static fields. 
21508
21509         * TODO: Updated.
21510
21511         * driver.cs: Stop compilation if there are parse errors.
21512
21513         * cs-parser.jay (constructor_declaration): Provide default base
21514         initializer for non-static constructors.
21515         (constructor_declarator): Do not provide a default base
21516         initializers if none was specified.
21517         Catch the fact that constructors should not have parameters.
21518
21519         * class.cs: Do not emit parent class initializers for static
21520         constructors, that should be flagged as an error.
21521
21522 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21523
21524         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21525         Move back code into TypeContainer::Populate.
21526
21527 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21528
21529         * class.cs (TypeContainer::AddConstructor): Fix the check to
21530         compare against Name, not Basename. 
21531         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21532
21533         * cs-parser.jay : Update accordingly.
21534
21535         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21536         for methods, don't forget to look into the operators too.
21537         (RegisterMethodBuilder): Helper method to take care of this for
21538         methods, constructors and operators.
21539         (Operator::Define): Completely revamp.
21540         (Operator.OperatorMethod, MethodName): New fields.
21541         (TypeContainer::Populate): Move the registering of builders into
21542         RegisterMethodBuilder.
21543         (Operator::Emit): Re-write.
21544
21545         * expression.cs (Binary::Emit): Comment out code path to emit method
21546         invocation stuff for the case when we have a user defined operator. I am
21547         just not able to get it right !
21548
21549 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21552         argument. 
21553
21554         (Expression::MemberLookup): Provide a version that allows to
21555         specify the MemberTypes and BindingFlags. 
21556
21557         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21558         so it was not fetching variable information from outer blocks.
21559
21560         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21561         Beforefieldinit as it was buggy.
21562
21563         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21564         that Ravi put here.  
21565
21566         * class.cs (Constructor::Emit): Only emit if block is not null.
21567         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21568         deal with this by semantically definining it as if the user had
21569         done it.
21570
21571         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21572         constructors as we now "emit" them at a higher level.
21573
21574         (TypeContainer::DefineDefaultConstructor): Used to define the
21575         default constructors if none was provided.
21576
21577         (ConstructorInitializer): Add methods Resolve and Emit. 
21578
21579         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21580
21581 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21582
21583         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21584         the default constructor builder with our hashtable for methodbuilders
21585         to methodcores.
21586
21587         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21588         and argument_count is 0 in which case we have a match.
21589         (Binary::ResolveOperator): More null checking and miscellaneous coding
21590         style cleanup.
21591
21592 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21593
21594         * rootcontext.cs (IsNameSpace): Compare against null.
21595
21596         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21597
21598         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21599         and Unary::Operator.
21600
21601         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21602         accordingly.
21603
21604         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21605         we have overloaded operators.
21606         (Binary::ResolveOperator): Implement the part which does the operator overload
21607         resolution.
21608
21609         * class.cs (Operator::Emit): Implement.
21610         (TypeContainer::Emit): Emit the operators we have too.
21611
21612         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21613         the case when we have a user-defined operator.
21614
21615 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21616
21617         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21618
21619 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21620
21621         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21622         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21623         (Constructor::Emit): Implement.
21624         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21625         if we have no work to do. 
21626         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21627         Emit method.
21628
21629         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21630         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21631
21632         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21633         of parent.parent.
21634
21635 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21636
21637         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21638         in the source.
21639         (Tree::RecordNamespace): Method to do what the name says ;-)
21640         (Tree::Namespaces): Property to get at the namespaces hashtable.
21641
21642         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21643         keep track.
21644
21645         * rootcontext.cs (IsNamespace): Fixed it :-)
21646
21647 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * class.cs (TypeContainer::FindMembers): Add support for
21650         constructors. 
21651         (MethodCore): New class that encapsulates both the shared aspects
21652         of a Constructor and a Method.  
21653         (Method, Constructor): Factored pieces into MethodCore.
21654
21655         * driver.cs: Added --fatal which makes errors throw exceptions.
21656         Load System assembly as well as part of the standard library.
21657
21658         * report.cs: Allow throwing exceptions on errors for debugging.
21659
21660         * modifiers.cs: Do not use `parent', instead use the real type
21661         container to evaluate permission settings.
21662
21663         * class.cs: Put Ravi's patch back in.  He is right, and we will
21664         have to cope with the
21665
21666 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21667
21668         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21669         FamORAssem, not FamANDAssem.
21670
21671 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * driver.cs: Added --parse option that only parses its input files
21674         and terminates.
21675
21676         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21677         incorrect.  IsTopLevel is not used to tell whether an object is
21678         root_types or not (that can be achieved by testing this ==
21679         root_types).  But to see if this is a top-level *class* (not
21680         necessarly our "toplevel" container). 
21681
21682 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21683
21684         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21685         parent instead of a direct call to GetType.
21686
21687 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21688
21689         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21690         Modifiers.TypeAttr. This should just be a call to that method.
21691
21692         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21693         object so that we can determine if we are top-level or not.
21694
21695         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21696         TypeContainer too.
21697
21698         * enum.cs (Enum::Define): Ditto.
21699
21700         * modifiers.cs (FieldAttr): Re-write.
21701
21702         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21703         (TypeContainer::HaveStaticConstructor): New property to provide access
21704         to precisely that info.
21705
21706         * modifiers.cs (MethodAttr): Re-write.
21707         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21708
21709         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21710         of top-level types as claimed.
21711
21712 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21713
21714         * expression.cs (MemberLookup): Fruitless attempt to lookup
21715         constructors.  Maybe I need to emit default constructors?  That
21716         might be it (currently .NET emits this for me automatically).
21717         (Invocation::OverloadResolve): Cope with Arguments == null.
21718         (Invocation::EmitArguments): new function, shared by the new
21719         constructor and us.
21720         (Invocation::Emit): Handle static and instance methods.  Emit
21721         proper call instruction for virtual or non-virtual invocations.
21722         (New::Emit): Implement.
21723         (New::Resolve): Implement.
21724         (MemberAccess:Resolve): Implement.
21725         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21726         to track instances.
21727         (FieldExpr::Resolve): Set type.
21728
21729         * support.cs: Handle empty arguments.
21730                 
21731         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21732         SimpleLookup): Auxiliary routines to help parse a qualifier
21733         identifier.  
21734
21735         Update qualifier_identifier rule.
21736
21737         * codegen.cs: Removed debugging messages.
21738
21739         * class.cs: Make this a global thing, this acts just as a "key" to
21740         objects that we might have around.
21741
21742         (Populate): Only initialize method_builders_to_methods once.
21743
21744         * expression.cs (PropertyExpr): Initialize type from the
21745         PropertyType. 
21746
21747         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21748         Resolve pattern.  Attempt to implicitly convert value to boolean.
21749         Emit code.
21750
21751         * expression.cs: Set the type for the int32/int32 argument case.
21752         (Binary::ResolveOperator): Set the return type to boolean for
21753         comparission operators
21754
21755         * typemanager.cs: Remove debugging print code.
21756
21757         (Invocation::Resolve): resolve type.
21758
21759         * class.cs: Allocate a MemberInfo of the correct size, as the code
21760         elsewhere depends on the test to reflect the correct contents.
21761
21762         (Method::) Keep track of parameters, due to System.Reflection holes
21763
21764         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21765         mapping here.
21766
21767         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21768         of the exact size and return that.
21769
21770         (Class::LookupMethodByBuilder): New function that maps
21771         MethodBuilders to its methods.  Required to locate the information
21772         on methods because System.Reflection bit us again.
21773
21774         * support.cs: New file, contains an interface ParameterData and
21775         two implementations: ReflectionParameters and InternalParameters
21776         used to access Parameter information.  We will need to grow this
21777         as required.
21778
21779         * expression.cs (Invocation::GetParameterData): implement a cache
21780         and a wrapper around the ParameterData creation for methods. 
21781         (Invocation::OverloadResolve): Use new code.
21782
21783 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21784
21785         * class.cs (TypeContainer::EmitField): Remove and move into 
21786         (Field::Define): here and modify accordingly.
21787         (Field.FieldBuilder): New member.
21788         (TypeContainer::Populate): Update accordingly.
21789         (TypeContainer::FindMembers): Implement.
21790
21791 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21792
21793         * statement.cs: (VariableInfo::VariableType): New field to be
21794         initialized with the full type once it is resolved. 
21795
21796 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21797
21798         * parameter.cs (GetParameterInfo): Use a type cache to compute
21799         things only once, and to reuse this information
21800
21801         * expression.cs (LocalVariableReference::Emit): Implement.
21802         (OpcodeCast::Emit): fix.
21803
21804         (ParameterReference::Resolve): Implement.
21805         (ParameterReference::Emit): Implement.
21806
21807         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21808         that are expressions need to stay as Expressions.
21809
21810         * typemanager.cs (CSharpName): Returns the C# name of a type if
21811         possible. 
21812
21813         * expression.cs (Expression::ConvertImplicit): New function that
21814         implements implicit type conversions.
21815
21816         (Expression::ImplicitReferenceConversion): Implements implicit
21817         reference conversions.
21818
21819         (EmptyCast): New type for transparent casts.
21820
21821         (OpcodeCast): New type for casts of types that are performed with
21822         a sequence of bytecodes.
21823
21824         (BoxedCast): New type used for casting value types into reference
21825         types.  Emits a box opcode.
21826
21827         (Binary::DoNumericPromotions): Implements numeric promotions of
21828         and computation of the Binary::Type.
21829
21830         (Binary::EmitBranchable): Optimization.
21831
21832         (Binary::Emit): Implement code emission for expressions.
21833
21834         * typemanager.cs (TypeManager): Added two new core types: sbyte
21835         and byte.
21836
21837 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21838
21839         * class.cs (TypeContainer::FindMembers): Method which does exactly
21840         what Type.FindMembers does, only we don't have to use reflection. No
21841         implementation yet.
21842
21843         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21844         typecontainer objects as we need to get at them.
21845         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21846
21847         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21848         typecontainer object.
21849
21850         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21851         of just a Report object.
21852
21853 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21854
21855         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21856         "remove_"
21857         (TypeContainer::Populate): Now define the delegates of the type too.
21858         (TypeContainer.Delegates): Property to access the list of delegates defined
21859         in the type.
21860
21861         * delegates.cs (Delegate::Define): Implement partially.
21862
21863         * modifiers.cs (TypeAttr): Handle more flags.
21864
21865 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21866
21867         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21868         and not <=
21869         (Operator::Define): Re-write logic to get types by using the LookupType method
21870         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21871         (Indexer::Define): Ditto.
21872         (Event::Define): Ditto.
21873         (Property::Define): Ditto.
21874
21875 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21876
21877         * class.cs (TypeContainer::Populate): Now define operators too. 
21878         (TypeContainer.Operators): New property to access the list of operators
21879         in a type.
21880         (Operator.OperatorMethodBuilder): New member to hold the method builder
21881         for the operator we are defining.
21882         (Operator::Define): Implement.
21883
21884 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21885
21886         * class.cs (Event::Define): Make the prefixes of the accessor methods
21887         addOn_ and removeOn_ 
21888
21889         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21890         of the location being passed in too. Ideally, this should go later since all
21891         error reporting should be done through the Report object.
21892
21893         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21894         (Populate): Iterate thru the indexers we have and define them too.
21895         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21896         for the get and set accessors.
21897         (Indexer::Define): Implement.
21898
21899 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21900
21901         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21902         my previous implementation, did not work.
21903
21904         * typemanager.cs: Add a couple of missing types (the longs).
21905
21906         * literal.cs: Use TypeManager.bool_type instead of getting it.
21907
21908         * expression.cs (EventExpr): New kind of expressions.
21909         (Expressio::ExprClassFromMemberInfo): finish
21910
21911 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21912
21913         * assign.cs: Emit stores to static fields differently.
21914
21915 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21916
21917         * Merge in changes and adjust code to tackle conflicts. Backed out my
21918         code in Assign::Resolve ;-) 
21919
21920 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21921
21922         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21923         instead Report.Error and also pass in the location.
21924         (CSharpParser::Lexer): New readonly property to return the reference
21925         to the Tokenizer object.
21926         (declare_local_variables): Use Report.Error with location instead of plain 
21927         old error.
21928         (CheckDef): Ditto.
21929
21930         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21931         (Operator.CheckBinaryOperator): Ditto.
21932
21933         * cs-parser.jay (operator_declarator): Update accordingly.
21934
21935         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21936         (CheckBinaryOperator): Same here.
21937
21938         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21939         on the name without any prefixes of namespace names etc. This is because we
21940         already might have something already fully qualified like 
21941         'System.Console.WriteLine'
21942
21943         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21944
21945 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21946
21947         * cs-tokenizer.cs (location): Return a string which also contains
21948         the file name.
21949
21950         * expression.cs (ElementAccess): New class for expressions of the
21951         type 'element access.'
21952         (BaseAccess): New class for expressions of the type 'base access.'
21953         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21954         respectively.
21955
21956         * cs-parser.jay (element_access): Implement action.
21957         (base_access): Implement actions.
21958         (checked_expression, unchecked_expression): Implement.
21959
21960         * cs-parser.jay (local_variable_type): Correct and implement.
21961         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21962
21963         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21964
21965         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21966         name and the specifiers.
21967
21968         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21969
21970         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21971         making them all public ;-)
21972
21973         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21974         class anyways.
21975
21976 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21977
21978         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21979         PropertyExprs.
21980         (FieldExpr, PropertyExprs): New resolved expressions.
21981         (SimpleName::MemberStaticCheck): Perform static checks for access
21982         to non-static fields on static methods. Maybe this should be
21983         generalized for MemberAccesses. 
21984         (SimpleName::ResolveSimpleName): More work on simple name
21985         resolution. 
21986
21987         * cs-parser.jay (primary_expression/qualified_identifier): track
21988         the parameter index.
21989
21990         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21991         (EmitContext::EmitBoolExpression): Chain to expression generation
21992         instead of temporary hack.
21993         (::EmitStatementExpression): Put generic expression code generation.
21994
21995         * assign.cs (Assign::Emit): Implement variable assignments to
21996         local variables, parameters and fields.
21997
21998 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21999
22000         * statement.cs (Block::GetVariableInfo): New method, returns the
22001         VariableInfo for a variable name in a block.
22002         (Block::GetVariableType): Implement in terms of GetVariableInfo
22003
22004         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22005         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22006
22007 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22008
22009         * cs-parser.jay (operator_declaration): Continue on my quest : update
22010         to take attributes argument.
22011         (event_declaration): Ditto.
22012         (enum_declaration): Ditto.
22013         (indexer_declaration): Ditto.
22014
22015         * class.cs (Operator::Operator): Update constructor accordingly.
22016         (Event::Event): Ditto.
22017
22018         * delegate.cs (Delegate::Delegate): Same here.
22019
22020         * enum.cs (Enum::Enum): Same here.
22021
22022 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22023
22024         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22025
22026         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22027
22028         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22029         being passed around as an arraylist.
22030         (Attributes::AddAttribute): Method to add attribute sections.
22031
22032         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22033         (struct_declaration): Update accordingly.
22034         (constant_declaration): Update.
22035         (field_declaration): Update.
22036         (method_header): Update.
22037         (fixed_parameter): Update.
22038         (parameter_array): Ditto.
22039         (property_declaration): Ditto.
22040         (destructor_declaration): Ditto.
22041
22042         * class.cs (Struct::Struct): Update constructors accordingly.
22043         (Class::Class): Ditto.
22044         (Field::Field): Ditto.
22045         (Method::Method): Ditto.
22046         (Property::Property): Ditto.
22047         (TypeContainer::OptAttribute): update property's return type.
22048
22049         * interface.cs (Interface.opt_attributes): New member.
22050         (Interface::Interface): Update to take the extra Attributes argument.
22051
22052         * parameter.cs (Parameter::Parameter): Ditto.
22053
22054         * constant.cs (Constant::Constant): Ditto.
22055
22056         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22057         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22058         the attributes as a parameter.
22059         (InterfaceProperty): Update constructor call.
22060         (InterfaceEvent): Ditto.
22061         (InterfaceMethod): Ditto.
22062         (InterfaceIndexer): Ditto.
22063
22064         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22065         pass the attributes too.
22066         (interface_event_declaration): Ditto.
22067         (interface_property_declaration): Ditto.
22068         (interface_method_declaration): Ditto.
22069         (interface_declaration): Ditto.
22070
22071 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22072
22073         * class.cs (Method::Define): Track the "static Main" definition to
22074         create an entry point. 
22075
22076         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22077         EntryPoint if we find it. 
22078
22079         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22080         (EmitContext::ig): Make this variable public.
22081
22082         * driver.cs: Make the default output file be the first file name
22083         with the .exe extension.  
22084
22085         Detect empty compilations
22086
22087         Handle various kinds of output targets.  Handle --target and
22088         rename -t to --dumper.
22089
22090         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22091         methods inherited from Expression return now an Expression.  This
22092         will is used during the tree rewriting as we resolve them during
22093         semantic analysis.
22094
22095         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22096         the spec.  Missing entirely is the information about
22097         accessability of elements of it.
22098
22099         (Expression::ExprClassFromMemberInfo): New constructor for
22100         Expressions that creates a fully initialized Expression based on
22101         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22102         a Type.
22103
22104         (Invocation::Resolve): Begin implementing resolution of invocations.
22105
22106         * literal.cs (StringLiteral):  Implement Emit.
22107
22108 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22109
22110         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22111         member.
22112
22113 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22114
22115         * cs-parser.jay (attribute_arguments): Implement actions.
22116         (attribute): Fix bug in production. Implement action.
22117         (attribute_list): Implement.
22118         (attribute_target): Implement.
22119         (attribute_target_specifier, opt_target_specifier): Implement
22120         (CheckAttributeTarget): New method to check if the attribute target
22121         is valid.
22122         (attribute_section): Implement.
22123         (opt_attributes): Implement.
22124
22125         * attribute.cs : New file to handle attributes.
22126         (Attribute): Class to hold attribute info.
22127
22128         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22129         (attribute_section): Modify production to use 2 different rules to 
22130         achieve the same thing. 1 s/r conflict down !
22131         Clean out commented, useless, non-reducing dimension_separator rules.
22132
22133         * class.cs (TypeContainer.attributes): New member to hold list
22134         of attributes for a type.
22135         (Struct::Struct): Modify to take one more argument, the attribute list.
22136         (Class::Class): Ditto.
22137         (Field::Field): Ditto.
22138         (Method::Method): Ditto.
22139         (Property::Property): Ditto.
22140
22141         * cs-parser.jay (struct_declaration): Update constructor call to
22142         pass in the attributes too.
22143         (class_declaration): Ditto.
22144         (constant_declaration): Ditto.
22145         (field_declaration): Ditto.
22146         (method_header): Ditto.
22147         (fixed_parameter): Ditto.
22148         (parameter_array): Ditto.
22149         (property_declaration): Ditto.
22150
22151         * constant.cs (Constant::Constant): Update constructor similarly.
22152         Use System.Collections.
22153
22154         * parameter.cs (Parameter::Parameter): Update as above.
22155
22156 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22157
22158         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22159         (TypeContainer.delegates): New member to hold list of delegates.
22160
22161         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22162         this time as I seem to be on crack ;-)
22163
22164 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22165
22166         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22167         tell whether an identifier represents a namespace.
22168
22169         * expression.cs (NamespaceExpr): A namespace expression, used only
22170         temporarly during expression resolution.
22171         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22172         utility functions to resolve names on expressions.
22173
22174 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * codegen.cs: Add hook for StatementExpressions. 
22177
22178         * class.cs: Fix inverted test for static flag in methods.
22179
22180 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22181
22182         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22183         to make it coincide with MS' number.
22184         (Operator::CheckBinaryOperator): Ditto.
22185
22186         * ../errors/errors.txt : Remove error numbers added earlier.
22187
22188         * ../errors/cs1019.cs : Test case for error # 1019
22189
22190         * ../errros/cs1020.cs : Test case for error # 1020
22191
22192         * cs-parser.jay : Clean out commented cruft.
22193         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22194         used anywhere - non-reducing rule.
22195         (namespace_declarations): Non-reducing rule - comment out.
22196
22197         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22198         with TypeContainer::AddEnum.
22199
22200         * delegate.cs : New file for delegate handling classes.
22201         (Delegate): Class for declaring delegates.
22202
22203         * makefile : Update.
22204
22205         * cs-parser.jay (delegate_declaration): Implement.
22206
22207 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22208
22209         * class.cs (Event::Define): Implement.
22210         (Event.EventBuilder): New member.
22211
22212         * class.cs (TypeContainer::Populate): Update to define all enums and events
22213         we have.
22214         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22215         readonly fields for all these cases ?
22216
22217 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22218
22219         * class.cs (Property): Revamp to use the convention of making fields readonly.
22220         Accordingly modify code elsewhere.
22221
22222         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22223         the Define method of the Property class.
22224
22225         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22226         trivial bug.
22227         (TypeContainer::Populate): Update to define all the properties we have. Also
22228         define all enumerations.
22229
22230         * enum.cs (Define): Implement.
22231
22232 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22233
22234         * cs-parser.jay (overloadable_operator): The semantic value is an
22235         enum of the Operator class.
22236         (operator_declarator): Implement actions.
22237         (operator_declaration): Implement.
22238
22239         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22240         validity of definitions.
22241         (Operator::CheckBinaryOperator): Static method to check for binary operators
22242         (TypeContainer::AddOperator): New method to add an operator to a type.
22243
22244         * cs-parser.jay (indexer_declaration): Added line to actually call the
22245         AddIndexer method so it gets added ;-)
22246
22247         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22248         already taken care of by the MS compiler ?  
22249
22250 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22251
22252         * class.cs (Operator): New class for operator declarations.
22253         (Operator::OpType): Enum for the various operators.
22254
22255 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22256
22257         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22258         ostensibly handle this in semantic analysis.
22259
22260         * cs-parser.jay (general_catch_clause): Comment out
22261         (specific_catch_clauses, specific_catch_clause): Ditto.
22262         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22263         (catch_args, opt_catch_args): New productions.
22264         (catch_clause): Rewrite to use the new productions above
22265         (catch_clauses): Modify accordingly.
22266         (opt_catch_clauses): New production to use in try_statement
22267         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22268         and re-write the code in the actions to extract the specific and
22269         general catch clauses by being a little smart ;-)
22270
22271         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22272         Hooray, try and catch statements parse fine !
22273
22274 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22275
22276         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22277         string from the hashtable of variables.
22278
22279         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22280         I end up making that mistake ;-)
22281         (catch_clauses): Fixed gross error which made Key and Value of the 
22282         DictionaryEntry the same : $1 !!
22283
22284 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22285
22286         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22287
22288         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22289         when the add and remove accessors are specified. 
22290
22291 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22292
22293         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22294         information about indexer_declarator.
22295         (indexer_declarator): Implement actions.
22296         (parsing_indexer): New local boolean used to keep track of whether
22297         we are parsing indexers or properties. This is necessary because 
22298         implicit_parameters come into picture even for the get accessor in the 
22299         case of an indexer.
22300         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22301
22302         * class.cs (Indexer): New class for indexer declarations.
22303         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22304         (TypeContainer::indexers): New member to hold list of indexers for the
22305         type.
22306
22307 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22308
22309         * cs-parser.jay (add_accessor_declaration): Implement action.
22310         (remove_accessor_declaration): Implement action.
22311         (event_accessors_declaration): Implement
22312         (variable_declarators): swap statements for first rule - trivial.
22313
22314         * class.cs (Event): New class to hold information about event
22315         declarations.
22316         (TypeContainer::AddEvent): New method to add an event to a type
22317         (TypeContainer::events): New member to hold list of events.
22318
22319         * cs-parser.jay (event_declaration): Implement actions.
22320
22321 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22322
22323         * cs-parser.jay (dim_separators): Implement. Make it a string
22324         concatenating all the commas together, just as they appear.
22325         (opt_dim_separators): Modify accordingly
22326         (rank_specifiers): Update accordingly. Basically do the same
22327         thing - instead, collect the brackets here.
22328         (opt_rank_sepcifiers): Modify accordingly.
22329         (array_type): Modify to actually return the complete type string
22330         instead of ignoring the rank_specifiers.
22331         (expression_list): Implement to collect the expressions
22332         (variable_initializer): Implement. We make it a list of expressions
22333         essentially so that we can handle the array_initializer case neatly too.
22334         (variable_initializer_list): Implement.
22335         (array_initializer): Make it a list of variable_initializers
22336         (opt_array_initializer): Modify accordingly.
22337
22338         * expression.cs (New::NType): Add enumeration to help us
22339         keep track of whether we have an object/delegate creation
22340         or an array creation.
22341         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22342         members to hold data about array creation.
22343         (New:New): Modify to update NewType
22344         (New:New): New Overloaded contructor for the array creation
22345         case.
22346
22347         * cs-parser.jay (array_creation_expression): Implement to call
22348         the overloaded New constructor.
22349
22350 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22351
22352         * class.cs (TypeContainer::Constructors): Return member
22353         constructors instead of returning null.
22354
22355 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22356
22357         * typemanager.cs (InitCoreTypes): Initialize the various core
22358         types after we have populated the type manager with the user
22359         defined types (this distinction will be important later while
22360         compiling corlib.dll)
22361
22362         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22363         on Expression Classification.  Now all expressions have a method
22364         `Resolve' and a method `Emit'.
22365
22366         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22367         generation from working.     Also add some temporary debugging
22368         code. 
22369
22370 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22371
22372         * codegen.cs: Lots of code generation pieces.  This is only the
22373         beginning, will continue tomorrow with more touches of polish.  We
22374         handle the fundamentals of if, while, do, for, return.  Others are
22375         trickier and I need to start working on invocations soon.
22376
22377         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22378         s.InitStatement. 
22379
22380         * codegen.cs (EmitContext): New struct, used during code
22381         emission to keep a context.   Most of the code generation will be
22382         here. 
22383
22384         * cs-parser.jay: Add embedded blocks to the list of statements of
22385         this block.  So code generation proceeds in a top down fashion.
22386
22387 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22388
22389         * statement.cs: Add support for multiple child blocks.
22390
22391 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22392
22393         * codegen.cs (EmitCode): New function, will emit the code for a
22394         Block of code given a TypeContainer and its ILGenerator. 
22395
22396         * statement.cs (Block): Standard public readonly optimization.
22397         (Block::Block constructors): Link children. 
22398         (Block::Child): Child Linker.
22399         (Block::EmitVariables): Emits IL variable declarations.
22400
22401         * class.cs: Drop support for MethodGroups here, delay until
22402         Semantic Analysis.
22403         (Method::): Applied the same simplification that I did before, and
22404         move from Properties to public readonly fields.
22405         (Method::ParameterTypes): Returns the parameter types for the
22406         function, and implements a cache that will be useful later when I
22407         do error checking and the semantic analysis on the methods is
22408         performed.
22409         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22410         and made a method, optional argument tells whether this is a class
22411         or a structure to apply the `has-this' bit.
22412         (Method::GetCallingConvention): Implement, returns the calling
22413         convention. 
22414         (Method::Define): Defines the type, a second pass is performed
22415         later to populate the methods.
22416
22417         (Constructor::ParameterTypes): implement a cache similar to the
22418         one on Method::ParameterTypes, useful later when we do semantic
22419         analysis. 
22420
22421         (TypeContainer::EmitMethod):  New method.  Emits methods.
22422
22423         * expression.cs: Removed MethodGroup class from here.
22424
22425         * parameter.cs (Parameters::GetCallingConvention): new method.
22426
22427 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22428
22429         * class.cs (TypeContainer::Populate): Drop RootContext from the
22430         argument. 
22431
22432         (Constructor::CallingConvention): Returns the calling convention.
22433         (Constructor::ParameterTypes): Returns the constructor parameter
22434         types. 
22435
22436         (TypeContainer::AddConstructor): Keep track of default constructor
22437         and the default static constructor.
22438
22439         (Constructor::) Another class that starts using `public readonly'
22440         instead of properties. 
22441
22442         (Constructor::IsDefault): Whether this is a default constructor. 
22443
22444         (Field::) use readonly public fields instead of properties also.
22445
22446         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22447         track of static constructors;  If none is used, turn on
22448         BeforeFieldInit in the TypeAttributes. 
22449
22450         * cs-parser.jay (opt_argument_list): now the return can be null
22451         for the cases where there are no arguments. 
22452
22453         (constructor_declarator): If there is no implicit `base' or
22454         `this', then invoke the default parent constructor. 
22455
22456         * modifiers.cs (MethodAttr): New static function maps a set of
22457         modifiers flags into a MethodAttributes enum
22458         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22459         MethodAttr, TypeAttr to represent the various mappings where the
22460         modifiers are used.
22461         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22462
22463 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22464
22465         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22466         method arguments.
22467
22468         * interface.cs (PopulateIndexer): Implemented the code generator
22469         for interface indexers.
22470
22471 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22472
22473         * interface.cs (InterfaceMemberBase): Now we track the new status
22474         here.  
22475
22476         (PopulateProperty): Implement property population.  Woohoo!  Got
22477         Methods and Properties going today. 
22478
22479         Removed all the properties for interfaces, and replaced them with
22480         `public readonly' fields. 
22481
22482 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22483
22484         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22485         initialize their hashtables/arraylists only when they are needed
22486         instead of doing this always.
22487
22488         * parameter.cs: Handle refs and out parameters.
22489
22490         * cs-parser.jay: Use an ArrayList to construct the arguments
22491         instead of the ParameterCollection, and then cast that to a
22492         Parameter[] array.
22493
22494         * parameter.cs: Drop the use of ParameterCollection and use
22495         instead arrays of Parameters.
22496
22497         (GetParameterInfo): Use the Type, not the Name when resolving
22498         types. 
22499
22500 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22501
22502         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22503         and instead use public readonly fields.
22504
22505         * class.cs: Put back walking code for type containers.
22506
22507 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22508
22509         * class.cs (MakeConstant): Code to define constants.
22510
22511         * rootcontext.cs (LookupType): New function.  Used to locate types 
22512
22513
22514 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22515
22516         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22517         this System.Reflection code is.  Kudos to Microsoft
22518
22519         * typemanager.cs: Implement a type cache and avoid loading all
22520         types at boot time.  Wrap in LookupType the internals.  This made
22521         the compiler so much faster.  Wow.  I rule!
22522
22523         * driver.cs: Make sure we always load mscorlib first (for
22524         debugging purposes, nothing really important).
22525
22526         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22527         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22528
22529         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22530         on namespaces that have been imported using the `using' keyword.
22531
22532         * class.cs (TypeContainer::TypeAttr): Virtualize.
22533         (Class::TypeAttr): Return attributes suitable for this bad boy.
22534         (Struct::TypeAttr): ditto.
22535         Handle nested classes.
22536         (TypeContainer::) Remove all the type visiting code, it is now
22537         replaced with the rootcontext.cs code
22538
22539         * rootcontext.cs (GetClassBases): Added support for structs. 
22540
22541 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22542
22543         * interface.cs, statement.cs, class.cs, parameter.cs,
22544         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22545         Drop use of TypeRefs, and use strings instead.
22546
22547 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22548
22549         * rootcontext.cs: 
22550
22551         * class.cs (Struct::Struct): set the SEALED flags after
22552         checking the modifiers.
22553         (TypeContainer::TypeAttr): new property, returns the
22554         TypeAttributes for a class.  
22555
22556         * cs-parser.jay (type_list): Oops, list production was creating a
22557         new list of base types.
22558
22559         * rootcontext.cs (StdLib): New property.
22560         (GetInterfaceTypeByName): returns an interface by type name, and
22561         encapsulates error handling here.
22562         (GetInterfaces): simplified.
22563         (ResolveTree): Encapsulated all the tree resolution here.
22564         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22565         types. 
22566
22567         * driver.cs: Add support for --nostdlib, to avoid loading the
22568         default assemblies.
22569         (Main): Do not put tree resolution here. 
22570
22571         * rootcontext.cs: Beginning of the class resolution.
22572
22573 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22574
22575         * rootcontext.cs: Provide better error reporting. 
22576
22577         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22578
22579         * rootcontext.cs (CreateInterface): Handle the case where there
22580         are no parent interfaces.
22581
22582         (CloseTypes): Routine to flush types at the end.
22583         (CreateInterface): Track types.
22584         (GetInterfaces): Returns an array of Types from the list of
22585         defined interfaces.
22586
22587         * typemanager.c (AddUserType): Mechanism to track user types (puts
22588         the type on the global type hash, and allows us to close it at the
22589         end). 
22590
22591 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22592
22593         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22594         RecordInterface instead.
22595
22596         * cs-parser.jay: Updated to reflect changes above.
22597
22598         * decl.cs (Definition): Keep track of the TypeBuilder type that
22599         represents this type here.  Not sure we will use it in the long
22600         run, but wont hurt for now.
22601
22602         * driver.cs: Smaller changes to accomodate the new code.
22603
22604         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22605         when done. 
22606
22607         * rootcontext.cs (CreateInterface):  New method, used to create
22608         the System.TypeBuilder type for interfaces.
22609         (ResolveInterfaces): new entry point to resolve the interface
22610         hierarchy. 
22611         (CodeGen): Property, used to keep track of the code generator.
22612
22613 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22614
22615         * cs-parser.jay: Add a second production for delegate_declaration
22616         with `VOID'.
22617
22618         (enum_body): Put an opt_comma here instead of putting it on
22619         enum_body or enum_member_declarations so we can handle trailing
22620         commas on enumeration members.  Gets rid of a shift/reduce.
22621
22622         (type_list): Need a COMMA in the middle.
22623
22624         (indexer_declaration): Tell tokenizer to recognize get/set
22625
22626         * Remove old targets.
22627
22628         * Re-add the parser target.
22629
22630 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22631
22632         * cs-parser.jay: Add precendence rules for a number of operators
22633         ot reduce the number of shift/reduce conflicts in the grammar.
22634
22635 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22636
22637         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22638         and put it here.
22639
22640         Get rid of old crufty code.
22641
22642         * rootcontext.cs: Use this to keep track of the parsed
22643         representation and the defined types available to the program. 
22644
22645         * gen-treedump.cs: adjust for new convention.
22646
22647         * type.cs: Split out the type manager, and the assembly builder
22648         from here. 
22649
22650         * typemanager.cs: the type manager will live here now.
22651
22652         * cil-codegen.cs: And the code generator here. 
22653
22654 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22655
22656         * makefile: Fixed up for easy making.
22657
22658 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22659
22660         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22661         the 
22662
22663         (unary_expression): Expand pre_increment_expression and
22664         post_decrement_expression to reduce a shift/reduce.
22665
22666 2001-07-11  Simon Cozens
22667
22668         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22669
22670         Improve allow_keyword_as_indent name.
22671
22672 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22673
22674         * Adjustments for Beta2. 
22675
22676 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22677
22678         * decl.cs: Added `Define' abstract method.
22679         (InTransit): new property, used to catch recursive definitions. 
22680
22681         * interface.cs: Implement `Define'. 
22682
22683         * modifiers.cs: Map Modifiers.constants to
22684         System.Reflection.TypeAttribute flags.
22685
22686         * class.cs: Keep track of types and user-defined types.
22687         (BuilderInit): New method for creating an assembly
22688         (ResolveType): New function to launch the resolution process, only
22689         used by interfaces for now.
22690
22691         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22692         that are inserted into the name space. 
22693
22694 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22695
22696         * ARGH.  I have screwed up my tree so many times due to the use of
22697         rsync rather than using CVS.  Going to fix this at once. 
22698
22699         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22700         load types.
22701
22702 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22703
22704         * Experiment successful: Use System.Type rather that our own
22705         version of Type.  
22706
22707 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22708
22709         * cs-parser.jay: Removed nsAliases from here.
22710
22711         Use new namespaces, handle `using XXX;' 
22712
22713         * namespace.cs: Reimplemented namespace handling, use a recursive
22714         definition of the class.  Now we can keep track of using clauses
22715         and catch invalid using clauses.
22716
22717 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22718
22719         * gen-treedump.cs: Adapted for all the renaming.
22720
22721         * expression.cs (Expression): this class now has a Type property
22722         which returns an expression Type.
22723
22724         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22725         `Type', as this has a different meaning now in the base
22726
22727 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22728
22729         * interface.cs, class.cs: Removed from all the sources the
22730         references to signature computation, as we can not do method
22731         signature computation during the parsing time, as we are not
22732         trying to solve at that point distinguishing:
22733
22734         class X {
22735                 void a (Blah x) {}
22736                 void a (NS.Blah x) {}
22737         }
22738
22739         Which depending on the context might be valid or not, as we do not
22740         know if Blah is the same thing as NS.Blah at that point.
22741
22742         * Redid everything so the code uses TypeRefs now instead of
22743         Types.  TypeRefs are just temporary type placeholders, that need
22744         to be resolved.  They initially have a pointer to a string and the
22745         current scope in which they are used.  This is used later by the
22746         compiler to resolve the reference to an actual Type. 
22747
22748         * DeclSpace is no longer a CIR.Type, and neither are
22749         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22750         are all DeclSpaces, but no Types. 
22751
22752         * type.cs (TypeRefManager): This implements the TypeRef manager,
22753         which keeps track of all the types that need to be resolved after
22754         the parsing has finished. 
22755
22756 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22757
22758         * ARGH.  We are going to have to store `foreach' as a class rather
22759         than resolving it, as we need to verify error 1579 after name
22760         resolution.   *OR* we could keep a flag that says `This request to
22761         IEnumerator comes from a foreach statement' which we can then use
22762         to generate the error.
22763
22764 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22765
22766         * class.cs (TypeContainer.AddMethod): we now add methods to the
22767         MethodGroup instead of the method hashtable.  
22768
22769         * expression.cs: Add MethodGroup abstraction, which gets us one
22770         step closer to the specification in the way we handle method
22771         declarations.  
22772
22773         * cs-parser.jay (primary_expression): qualified_identifier now
22774         tried to match up an identifier to a local variable reference or
22775         to a parameter reference.
22776
22777         current_local_parameters is now a parser global variable that
22778         points to the current parameters for the block, used during name
22779         lookup.
22780
22781         (property_declaration): Now creates an implicit `value' argument to
22782         the set accessor.
22783
22784 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22785
22786         * parameter.cs: Do not use `param' arguments as part of the
22787         signature, per the spec.
22788
22789 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22790
22791         * decl.cs: Base class for classes, structs and interfaces.  This
22792         is the "Declaration Space" 
22793
22794         * cs-parser.jay: Use CheckDef for checking declaration errors
22795         instead of having one on each function.
22796
22797         * class.cs: Factor out some code for handling error handling in
22798         accordance to the "Declarations" section in the "Basic Concepts"
22799         chapter in the ECMA C# spec.
22800
22801         * interface.cs: Make all interface member classes derive from
22802         InterfaceMemberBase.
22803
22804 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22805
22806         * Many things: all interfaces are parsed and generated in
22807         gen-treedump.  Support for member variables, constructors,
22808         destructors, properties, constants is there.
22809
22810         Beginning of the IL backend, but very little done, just there for
22811         testing purposes. 
22812
22813 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22814
22815         * cs-parser.jay: Fix labeled statement.
22816
22817         * cs-tokenizer.cs (escape): Escape " and ' always.
22818         ref_line, ref_name: keep track of the line/filename as instructed
22819         by #line by the compiler.
22820         Parse #line.
22821
22822 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22823
22824         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22825         to match the values in System.CodeDOM.
22826
22827         Divid renamed to Divide.
22828
22829         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22830         statements. 
22831         (Statements.set): remove.
22832
22833         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22834         statements. 
22835
22836         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22837         falseStatements always have valid values. 
22838
22839         * cs-parser.jay: Use System.CodeDOM now.
22840