b351cd0853308405c9356f1770b734d58fbc87fd
[mono.git] / mcs / gmcs / ChangeLog
1 2005-08-20  Martin Baulig  <martin@ximian.com>
2
3         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4         scope if we don't already have it.
5
6         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8         fixes #75867.
9
10 2005-07-31  Miguel de Icaza  <miguel@novell.com>
11
12         * statement.cs: Copy the local exception into the exception
13         captured local.  Fixes 75674
14
15 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
16
17         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
18         type as namespace.
19
20 2005-08-12  Martin Baulig  <martin@ximian.com>
21
22         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
23         for nested types here to avoid hitting the cache too early.
24
25 2005-08-09  Miguel de Icaza  <miguel@novell.com>
26
27         * enum.cs: On the new compiler CLS error 3005 is now a warning not
28         an error. 
29
30 2005-08-03  Martin Baulig  <martin@ximian.com>
31
32         Make iterators in generic methods work; see gtest-191.cs.
33
34         * generic.cs
35         (Constraints.Resolve): Protect against being called twice.
36
37         * class.cs
38         (TypeContainer.GetClassBases): Make this `protected virtual'.
39
40         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
41         (Iterator.GetClassBases): Override this and compute the base
42         classes here.
43         (Iterator.DefineNestedTypes): If we're a generic method, all our
44         method type parameters become class type parameters on the proxy
45         class.
46
47         * statement.cs
48         (ToplevelBlock.Parameters): Make this a property, not a field.
49         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
50
51 2005-08-03  Martin Baulig  <martin@ximian.com>
52
53         * typemanager.cs (TypeManager.IsSubclassOf): Use
54         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
55         (TypeManager.GetFullName_recursed): Improved.
56
57 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
58
59         Fix #75417
60         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
61         Private accessor case, using TypeManager.IsPrivateAccessible instead of
62         invocation_type == mi.DeclaringType, since the first one also checks
63         other condition used by generic instances.
64         
65 2005-07-27  Martin Baulig  <martin@ximian.com>
66
67         * anonymous.cs (CaptureContext.AddField): Added
68         `AnonymousContainer am' argument; compute its toplevel scope if
69         it's not already computed.  Fixes #75649.
70
71 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
72
73         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
74         CheckAttributeType and refactored.
75         (Attribute.ResolvePossibleAttributeType): Changed to reuse
76         ResolveAsTypeTerminal error handling.
77         (ResolveAsTypeTerminal): Introduced because of global attributes extra
78         handling.
79         (GetSignatureForError): Print errors in same way.
80
81         * class.cs,
82         * codegen.cs: Reflect attribute GetSignatureForError change.
83
84         * ecore.cs,
85         * expression.cs: Add silent parameter to ResolveAsTypeStep.
86
87         * namespace.cs (UsingEntry): Refactored to make fields private.
88
89         * assign.cs,
90         statement.cs: Error_UnexpectedKind has extra parameter.
91
92 2005-07-14  Raja R Harinath  <rharinath@novell.com>
93
94         * ecore.cs (IAlias): Remove.
95         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
96         that implement the interface.
97         * namespace.cs (Namespace): Likewise.
98         (Namespace.declspaces): Renamed from 'defined_names'.
99         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
100         DeclSpace instead of an IAlias.
101         * tree.cs (Tree.AddDecl): Update.
102
103 2005-07-12  Raja R Harinath  <rharinath@novell.com>
104
105         * statement.cs (Block.Flags); Remove HasVarargs.
106         (Block.HasVarargs): Move to ToplevelBlock.
107         (Block.ThisVariable, Block.AddThisVariable): Likewise.
108         (Block.Variables): Make protected.  Initialize variable hashtable
109         if necessary.
110         (Block.AddVariable): Update.
111         (Block.Resolve): Update to changes.
112         (ToplevelBlock.HasVarargs): New boolean.
113         (ToplevelBlock.ThisVariable): Move here from Block.
114         (ToplevelBlock.AddThisVariable): Likewise.
115         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
116         * expression.cs (This.ResolveBase): Update to changes.
117         (ArglistAccess.DoResolve): Likewise.
118
119 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
120
121         Fix #75321
122         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
123
124         * class.cs (TypeContainer.VerifyMembers): Distinguish between
125         not used and not used & assigned.
126         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
127
128 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
129
130         Fix #75053
131         * expression.cs (Is.DoResolve): null is never provided type.
132
133 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
134
135         Fix #52496
136         * cs-parser.jay: Less strict event error rule to catch more errors.
137
138 2005-07-11  Martin Baulig  <martin@ximian.com>
139
140         * generic.cs (ConstructedType.CheckConstraints): Improve the check
141         for the constructor constraint: we do not only have to check
142         whether the class has a public constructor, but also ensure that
143         it's parameterless.  Fixes #75492.
144
145 2005-07-11  Martin Baulig  <martin@ximian.com>
146
147         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
148         between type parameters if they either have the reference type
149         constraint or the class constraint.
150
151 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
152
153         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
154
155 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
156
157         Fix #74975
158         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
159         (ExtractSecurityPermissionSet): Cope with self referencing security
160         attributes properly.
161
162         * driver.cs (SetOutputFile): Made public property OutputFile.
163
164 2005-07-07  Raja R Harinath  <rharinath@novell.com>
165
166         Fix #75486.
167         * class.cs (TypeContainer.first_nonstatic_field): Rename from
168         has_nonstatic_fields.  Make into a FieldBase pointer.
169         (TypeContainer.AddField): Add CS0282 check.
170         (TypeContainer.EmitType): Update.
171
172 2005-07-06  Miguel de Icaza  <miguel@novell.com>
173
174         * cs-tokenizer.cs (consume_identifier): Do not create strings to
175         compare if they start with __.
176
177 2005-07-06  Raja R Harinath  <rharinath@novell.com>
178
179         * statement.cs (Switch.SwitchGoverningType): Only look at
180         UserCasts that don't need implicit standard conversions to one of
181         the allowed switch types (Fixes test-322.cs).
182         (LocalInfo.Resolve): Re-enable sanity-test.
183
184 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
185
186         * cs-tokenizer.cs (consume_identifier): Detect double undescores
187         
188         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
189         
190         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
191
192 2005-07-06  Raja R Harinath  <rharinath@novell.com>
193
194         Fix #75472.
195         * ecore.cs (SimpleName.GetSignatureForError): Add.
196         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
197         (MemberAccess.GetSignatureForError): Add.
198
199 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
200  
201         The big error and warning messages review.
202         
203         * anonymous.cs,
204         * assign.cs,
205         * attribute.cs,
206         * class.cs,
207         * codegen.cs,
208         * convert.cs,
209         * cs-parser.jay,
210         * cs-tokenizer.cs,
211         * decl.cs,
212         * delegate.cs,
213         * doc.cs,
214         * driver.cs,
215         * ecore.cs,
216         * enum.cs,
217         * expression.cs,
218         * flowanalysis.cs,
219         * iterators.cs,
220         * literal.cs,
221         * location.cs,
222         * modifiers.cs,
223         * namespace.cs,
224         * parameter.cs,
225         * pending.cs,
226         * report.cs,
227         * rootcontext.cs,
228         * statement.cs,
229         * support.cs,
230         * tree.cs,
231         * typemanager.cs: Updated.
232         
233         * class.cs: (MethodCore.SetYields): Moved here to share.
234         (PropertyMethod.Define): Moved iterator setup here.
235         
236         * iterators.cs: Add orig_method to have full access to parent
237         container.
238
239 2005-07-05  Raja R Harinath  <rharinath@novell.com>
240
241         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
242         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
243         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
244         variable of struct type.
245         * expression.cs (Unary.ResolveOperator): Update to change.
246         (Indirection.VerifyFixed): Likewise.
247         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
248         (ParameterReference.VerifyFixed): Value parameters are fixed.
249         (This.VerifyFixed): Treat 'this' as a value parameter.
250         * statement.cs (LocalInfo.IsFixed): Remove.
251
252 2005-07-01  Martin Baulig  <martin@ximian.com>
253
254         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
255         `ec.EmitThis ()' to get the correct scope.
256
257 2005-07-01  Martin Baulig  <martin@ximian.com>
258
259         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
260         instance is a ParameterReference; fixes #75299.
261
262 2005-06-30  Raja R Harinath  <rharinath@novell.com>
263
264         Fix #75412.
265         * expression.cs (Indexers.map): Remove.
266         (Indexers.Append): Filter out inaccessible setters and getters.
267         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
268
269         Fix #75283.
270         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
271         Refactored from ...
272         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
273         (FieldExpr.Emit, PropertyExpr.Emit): Update.
274         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
275         * expression.cs (Invocation.EmitCall): Add CS0120 check.
276
277 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
278
279         Fix #75322
280         * class.cs (FieldBase.GetInitializerExpression): One more field
281         for backup.
282
283 2005-06-28  Miguel de Icaza  <miguel@novell.com>
284
285         * pending.cs: Do not define a proxy if the base method is virtual,
286         it will be picked up by the runtime (bug 75270).
287
288 2005-07-08  Martin Baulig  <martin@ximian.com>
289
290         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
291         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
292
293 2005-07-07  Martin Baulig  <martin@ximian.com>
294
295         * generic.cs (ConstructedType.CheckConstraint): Use
296         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
297         called recursively; fixes #75329.
298
299 2005-07-06  Martin Baulig  <martin@ximian.com>
300
301         * generic.cs (TypeManager.InferTypeArguments): Added support for
302         anonymous methods; fixes #75461.
303
304 2005-07-01  Martin Baulig  <martin@ximian.com>
305
306         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
307         `ec.EmitThis ()' to get the correct scope.
308
309 2005-07-01  Martin Baulig  <martin@ximian.com>
310
311         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
312         instance is `This'; fixes #75299.
313
314 2005-06-30  Martin Baulig  <martin@ximian.com>
315
316         * class.cs (Indexer): Implement IIteratorContainer; added support
317         for iterators in indexers.
318
319         * codegen.cs
320         (EmitContext.CurrentIterator): Make this a property, not a field.
321
322         * anonymous.cs (AnonymousContainer.Iterator): New public property.
323
324 2005-06-28  Miguel de Icaza  <miguel@novell.com>
325
326         * pending.cs: Do not define a proxy if the base method is virtual,
327         it will be picked up by the runtime (bug 75270).
328
329 2005-06-28  Martin Baulig  <martin@ximian.com>
330
331         * cs-parser.jay (interface_method_declaration): Avoid a
332         reduce/reduce conflict by moving some of the code into a separate
333         `interface_method_declaration_body' rule; fixes #75368.
334
335 2005-06-28  Martin Baulig  <martin@ximian.com>
336
337         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
338         array check after the check for TypeBuilder's.
339
340 2005-06-21  Raja R Harinath  <rharinath@novell.com>
341
342         * convert.cs (FindMostEncompassedType): Add two trivial special
343         cases (number_of_types == 0 || number_of_types == 1).
344         (FindMostEncompasingType): Likewise.
345
346 2005-06-17  Raja R Harinath  <rharinath@novell.com>
347
348         Some cleanups preparing for the fix of #75283.
349         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
350         error testing.
351         (EventExpr.InstanceResolve): Likewise.
352         (EventExpr.DoResolve): Remove redundant checks.
353
354 2005-06-08  Miguel de Icaza  <miguel@novell.com>
355
356         * class.cs: Small fix.
357
358 2005-06-08  Raja R Harinath  <rharinath@novell.com>
359
360         Fix #75160.
361         * class.cs (GetPartialBases): Fix return value check of
362         part.GetClassBases.
363
364 2005-06-07  Raja R Harinath  <rharinath@novell.com>
365
366         Ensure that partial classes are registered in their enclosing
367         namespace.  Initial part of fix of #75160.
368         * tree.cs (Tree.RecordDecl): Add new namespace argument.
369         Register declspace with namespace here, not in
370         DeclSpace.RecordDecl.
371         * cs-parser.jay: Pass namespace to RecordDecl.
372         * class.cs (PartialContainer.Create): Likewise.
373         (ClassPart.DefineType): New sanity-check.  Throws an exception if
374         called.
375         * decl.cs (Declspace.RecordDecl): Remove.
376         * namespace.cs (NamespaceEntry.DefineName): Remove.
377
378 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
379
380         * rootcontext.cs: Reset TargetExt as well.
381
382 2005-06-03  Raja R Harinath  <rharinath@novell.com>
383
384         * ecore.cs (Expression.Resolve): Emit CS0654 error when
385         -langversion:ISO-1.
386
387 2005-06-02  Raja R Harinath  <rharinath@novell.com>
388
389         Fix #75080, cs0119.cs.
390         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
391         of ...
392         (Expression.Resolve): ... this.  Use it.  Remove bogus code
393         allowing ExprClass.Type and ExprClass.Namespace for
394         ResolveFlags.VariableOrValue.
395         (Expression.Resolve) [1-argument variant]: Change default resolve
396         flags based on language version.
397         (Expression.Error_UnexpectedKind): Use a simple string array
398         rather than an ArrayList.
399         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
400         not ExprClass.Type.
401         (TypeOfVoid.DoResolve): Likewise.
402         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
403         flags argument -- it always has the same value.
404
405 2005-05-31  Raja R Harinath  <rharinath@novell.com>
406
407         Fix #75081.
408         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
409         Use it in the error message.
410         * assign.cs, expression.cs, statement.cs: Update.
411
412 2005-05-30  Raja R Harinath  <rharinath@novell.com>
413
414         Fix #75088.
415         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
416         the "almostMatchedMember" case too.
417         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
418         that failed the accessibility checks to 'almost_match'.
419
420 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
421
422         * attribute.cs: Use internal MethodBuilder methods to set
423         ExactSpelling and SetLastError on PInvoke methods, instead
424         of passing them via charset.  Fixes #75060.
425
426 2005-05-27  Raja R Harinath  <rharinath@novell.com>
427
428         * parameter.cs (Parameter): Remove TODO comment.
429         (Parameter.DefineParameter): Remove Location parameter.
430         (Parameters.LabelParameters): Likewise.
431         * class.cs (Constructor.Emit): Update to change.
432         (MethodData.Emit): Likewise.
433         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
434         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
435
436 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
437
438         * parameter.cs,
439           Removed Parameters.Location and added Parameter.Location instead.
440           Removed Location parameter from Emit() and GetSignature().
441         * anonymous.cs,
442           class.cs,
443           cs-parser.jay,
444           delegate.cs,
445           iterators.cs,
446           statement.cs :
447           Modified all related calls.
448
449 2005-06-21  Martin Baulig  <martin@ximian.com>
450
451         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
452         left-hand side is not a nullable type; fixes #75328.
453
454 2005-06-21  Martin Baulig  <martin@ximian.com>
455
456         * typemanager.cs
457         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
458         (TypeManager.GetFullNameSignature): Likewise.
459
460         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
461         `source.FullName' and `target.FullName' to check whether there are
462         two conflicting definitions.
463
464 2005-06-21  Martin Baulig  <martin@ximian.com>
465
466         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
467         a BoxedCast - also for reference types - to be compatible with csc.
468
469 2005-06-21  Martin Baulig  <martin@ximian.com>
470
471         * expression.cs (MemberAccess.DoResolve): Add support for nested
472         types in a generic instance; fixes #75320.
473
474 2005-06-20  Martin Baulig  <martin@ximian.com>
475
476         * generic.cs (TypeManager.InferType): Also walk the class
477         hierarchy for generic instances; fixes #75261.
478
479 2005-06-17  Martin Baulig  <martin@ximian.com>
480
481         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
482         to make things work for corlib.
483
484 2005-06-15  Martin Baulig  <martin@ximian.com>
485
486         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
487         obsolete `SecurityAction' values.
488
489 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
490
491         * rootcontext.cs: Reset TargetExt as well.
492         
493 2005-06-09  Martin Baulig  <martin@ximian.com>
494
495         * delegate.cs (Delegate.VerifyMethod): Added
496         `MethodGroupExpr old_mg' argument; inherit its
497         `HasTypeParameters'; fix #75085.
498
499 2005-06-09  Martin Baulig  <martin@ximian.com>
500
501         * expression.cs (Invocation.OverloadResolve): Correctly handle
502         generic methods for the SetMemberIsUsed(); fix #75064.
503
504 2005-06-09  Martin Baulig  <martin@ximian.com>
505
506         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
507         fixes #75062.
508
509 2005-06-08  Martin Baulig  <martin@ximian.com>
510
511         * cs-parser.jay (nullable_type_or_conditional): If we put the
512         nullable back and our `type' is a `ComposedCast', remove the
513         nullable from it.  Fixes #75156.
514
515         * expression.cs (ComposedCast.RemoveNullable): New public method.
516
517 2005-06-08  Martin Baulig  <martin@ximian.com>
518
519         The big Iterators rewrite :-)
520
521         * iterators.cs: Rewrite this to use the anonymous methods framework.
522
523         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
524         before the TypeContainers; see 2test-21.cs.
525
526         * class.cs
527         (TypeContainer.DefineType): Don't create a new EmitContext if we
528         already have one (this only happens if we're an Iterator).
529         (TypeContainer.Define): Also call Define() on all our iterators.
530         (Method.CreateEmitContext): Added support for iterators.
531
532         * anonymous.cs
533         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
534         (AnonymousContainer.CreateMethodHost): Moved here from
535         AnonymousMethod and made abstract.
536         (AnonymousContainer.CreateScopeType): New abstract method.
537         (AnonymousContainer.IsIterator): New public property.
538         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
539         get the ScopeTypeBuilder rather than manually defining it here. 
540         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
541         iterators here.
542
543         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
544         before RootContext.DefineTypes().
545
546         * codegen.cs (EmitContext.RemapToProxy): Removed.
547         (EmitContext.CurrentAnonymousMethod): Changed type from
548         AnonymousMethod -> AnonymousContainer.
549         (EmitContext.ResolveTopBlock): Protect from being called twice.
550         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
551         (EmitContext.EmitThis): Removed the iterators hacks; use the
552         anonymous methods framework for that.
553
554         * statement.cs
555         (ToplevelBlock.Container): Make this a property, not a field.
556         (ToplevelBlock.ReParent): New public method; move the
557         ToplevelBlock into a new container.
558         (Foreach.TemporaryVariable): Simplify.
559
560 2005-06-05  Martin Baulig  <martin@ximian.com>
561
562         * statement.cs (LocalInfo.CompilerGenerated): New flag.
563         (Block.AddTemporaryVariable): New public method; creates a new
564         `LocalInfo' for a temporary variable.
565         (Block.EmitMeta): Create the LocalBuilders for all the temporary
566         variables here.
567         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
568         non-iterator variables.
569
570 2005-06-05  Martin Baulig  <martin@ximian.com>
571
572         * statement.cs (Foreach.TemporaryVariable): Create the
573         LocalBuilder in the Emit phase and not in Resolve since in some
574         situations, we don't have an ILGenerator during Resolve; see
575         2test-19.cs for an example.
576
577 2005-06-04  Martin Baulig  <martin@ximian.com>
578
579         The big Foreach rewrite - Part II.
580
581         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
582         with `PropertyInfo ienumerator_getcurrent'.
583
584         * codegen.cs (VariableStorage): Removed.
585
586         * statement.cs
587         (Foreach): Derive from Statement, not ExceptionStatement.
588         (Foreach.CollectionForeach): New nested class.  Moved all the code
589         dealing with collection foreach here.
590         (Foreach.ForeachHelperMethods): Removed.
591         (Foreach.TemporaryVariable): Implement IMemoryLocation.
592
593 2005-05-23  Martin Baulig  <martin@ximian.com>
594
595         * statement.cs (Try.DoResolve): Don't create a `finally' if we
596         don't need to.  Fix #75014.
597
598 2005-05-26  Raja R Harinath  <rharinath@novell.com>
599
600         Improve user-defined conversion handling.
601         * convert.cs (GetConversionOperators): Rewrite.  Return only the
602         applicable operators.
603         (AddConversionOperators): New.  Helper for GetConversionOperators.
604         (FindMostEncompassedType, FindMostEncompassingType): Verify that
605         there is only one most encompassed/encompassing type.
606         (FindMostSpecificSource, FindMostSpecificTarget): Remove
607         "applicable operator" handling.
608         (UserConversion): Move cache here from GetConversionOperators.
609         Directly cache the chosen operator, rather than the whole
610         MethodGroup.
611         (ExplicitNumericConversion): Fix buggy implementation of Decimal
612         case.  Allow conversion of decimal to sbyte and byte too.
613         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
614         New static methods.  Used to avoid allocating EmptyExpressions in
615         convert.cs.
616
617 2005-05-24  Duncan Mak  <duncan@novell.com>
618
619         * ecore.cs (CastFromDecimal): New class for casting a decimal to
620         another class, used in Convert.ExplicitNumericConversion.
621         (CastToDecimal): New class, similar to above, but casts to
622         System.Decimal, used in Convert.ImplicitNumericConversion and also
623         in explicit convesion from double/float to decimal.
624
625         * convert.cs (ImplicitNumericConversion): Handle implicit
626         conversions to System.Decimal.
627         (ExplicitNumericConversion): handle explicit conversions to
628         System.Decimal.
629
630         This fixes #68711.
631         
632 2005-05-20  Miguel de Icaza  <miguel@novell.com>
633
634         * typemanager.cs: Do not throw an exception in the TypeBuilder
635         case, we take care of it on the TypeCode.
636
637 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
638         
639         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
640         is back.
641         
642         * cs-parser.jay: Catch more lexical errors.
643         
644         * report.cs: Add one more Error method.
645         
646         * rootcontext.cs,
647         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
648
649 2005-05-20  Martin Baulig  <martin@ximian.com>
650
651         * class.cs (TypeContainer.CircularDepException): Removed.
652         (TypeContainer.DefineType): Removed the `InTransit' stuff.
653         (TypeContainer.CheckRecursiveDefinition): Check for circular class
654         (CS0146) and interface (CS0529) dependencies here.
655
656 2005-05-20  Martin Baulig  <martin@ximian.com>
657
658         * expression.cs (New.DoResolve): Move the CS0712 check above the
659         CS0144 check; otherwise it can never be reached.
660
661 2005-05-20  Martin Baulig  <martin@ximian.com>
662
663         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
664
665 2005-05-20  Martin Baulig  <martin@ximian.com>
666
667         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
668
669         * typemanager.cs (TypeManager.IsAttributeType): New public method.
670
671 2005-05-19  Martin Baulig  <martin@ximian.com>
672
673         * delegate.cs
674         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
675         to disable error reporting.
676
677         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
678         here since we don't want to report an error; see the new test-336.cs.
679
680 2005-05-19  Raja R Harinath  <rharinath@novell.com>
681
682         * statement.cs (ToplevelBlock.GetParameterReference)
683         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
684         Move here from class Block.
685         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
686         * expression.cs (ParameterReference.DoResolveBase): Likewise.
687
688 2005-05-18  Martin Baulig  <martin@ximian.com>
689
690         Fix #74978.
691
692         * flowanalysis.cs
693         (FlowBranching.Reachability): Add non-static public And() and Or()
694         methods.
695         (FlowBranchingSwitch): New class; do the `break_origins' thing
696         like in FlowBranchingLoop.
697         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
698         reachability, not just locals and parameters.
699         (FlowBranching.MergeChild): Remove some of the hacks for loop and
700         switch; MergeBreakOrigins() now takes care of that.
701
702 2005-05-18  Martin Baulig  <martin@ximian.com>
703
704         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
705         a loop and may leave it, reset the barrier; fixes #74974.
706
707 2005-05-16  Raja R Harinath  <rharinath@novell.com>
708
709         Fix test-382.cs.  Emit values of decimal constants.
710         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
711         Carved out of ...
712         (TypeContainer.AddField): ... this.
713         (TypeContainer.EmitFieldInitializers): Allow the list of fields
714         with initializers to include 'Const's.
715         (ClassPart.RegisterFieldForInitialization): Forward to
716         PartialContainer.
717         * const.cs (Const.Const): Pass initializer to base class.
718         (Const.Define): In case of decimal constants, register them for
719         initialization in a static constructor.
720
721 2005-05-14  Martin Baulig  <martin@ximian.com>
722
723         * statement.cs (Block.Resolve): Correctly handle unreachable code;
724         do not call ResolveUnreachable() on unreachable statements in
725         here, see the comment in the source code.
726
727 2005-05-13  Raja R Harinath  <rharinath@novell.com>
728
729         Fix #74934.
730         * expression.cs (BinaryResolveOperator): If one of the operands of
731         an equality comparison is 'null' and the other is a pointer type,
732         convert the null to a NullPointer.
733         * convert.cs (ImplicitReferenceConversion): If the expression is a
734         NullLiteral and the target type is a pointer type, return a
735         NullPointer instead.
736         (ImplicitConversionStandard): Likewise.
737
738 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
739         
740         * cs-parser.jay: Set readonly context based on special constructs.
741         
742         * expression.cs (LocalVariableReference.DoResolveBase): Improved
743         readonly variable error handling.
744         
745         * rootcontext.cs (EmitCode): Don't verify members when error
746         occurred.
747         
748         * statement.cs (LocalInfo): Add reaodnly context information.
749         (SetReadOnlyContext, GetReadOnlyContext): New methods.
750
751 2005-05-17  Martin Baulig  <martin@ximian.com>
752
753         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
754         #70970. 
755
756 2005-05-13  Martin Baulig  <martin@ximian.com>
757
758         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
759         handle unreachable blocks.
760
761 2005-05-13  Martin Baulig  <martin@ximian.com>
762
763         * class.cs
764         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
765         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
766         #74905. 
767
768 2005-05-13  Martin Baulig  <martin@ximian.com>
769
770         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
771         instance variable, not a local.  Fix #74873.
772         (Block.ResolveUnreachable): Set it to true here.
773
774 2005-05-12  Martin Baulig  <martin@ximian.com>
775
776         * cs-parser.jay (property_declaration): Pass the `current_class',
777         not the `current_container' to Property's .ctor.  Fixes #74912.
778
779 2005-05-11  Martin Baulig  <martin@ximian.com>
780
781         * typemanager.cs (Closure): Copy this from MCS and merge all the
782         GMCS-specific changes into it.
783
784 2005-05-12  Raja R Harinath  <harinath@gmail.com>
785
786         Fix #74920.
787         * typemanager.cs (unmanaged_enclosing_types): New.
788         (IsUnmanagedType): Avoid infloops by using
789         'unmanaged_enclosing_types' to talk with recursive invocations.
790
791 2005-05-11  Duncan Mak  <duncan@novell.com>
792
793         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
794         continuing to process for 'arg'.
795         (handle_preprocessing_directive): Check the argument of the #endif
796         directive and report error CS1025 if there are any trailing
797         characters.
798
799         According to the C# spec, having even whitespace after the #endif
800         directive is illegal; however, because we call arg.TrimEnd ()
801         beforehand, we have the same behavior as csc, allowing whitespace
802         after the directive.
803
804         Fixes #74892.
805
806 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
807
808         Fix #74863.
809         
810         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
811         (Constructor.GetObsoleteAttribute): Implemented correctly.
812
813 2005-05-10  Martin Baulig  <martin@ximian.com>
814
815         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
816         resolve the type; fixes #74864.
817         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
818         in DoResolve(); fixes #74862.
819
820 2005-05-10  Martin Baulig  <martin@ximian.com>
821
822         * support.cs (ReflectionParameters.ParameterModifier): Use
823         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
824         and `ParameterAttributes.In'.  Fixes #74884.
825
826 2005-05-10  Martin Baulig  <martin@ximian.com>
827
828         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
829         the cache if we're just looking for `MemberTypes.NestedType' in a
830         generic instance.
831
832         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
833         constraints if we're still resolving the type tree.
834         (Expression.MemberLookup): If we're resolving the type tree, only
835         look for `MemberTypes.NestedType' since we're only interested in
836         getting types.
837
838         * class.cs (TypeContainer.DefineType): Don't resolve the type
839         parameters here; do this later in ResolveType() after the type
840         tree has been resolved.
841         (TypeContainer.ResolveType): New public method; this is called
842         after the type tree is resolved and before the types are being
843         populated.  We resolve the generic constraints here.
844         (TypeContainer.DoDefineMember): Check the constraints on our base
845         class and interfaces.
846
847         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
848         set the `ResolvingTypeTree' flag on the EmitContext.
849
850         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
851
852 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
853
854         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
855         
856         * expression.cs (Argument.GetParameterModifier): Turned to property.
857         (Invocation.Error_InvalidArguments): Add more descriptive errors.
858         
859         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
860         its C# equivalent.
861         
862 2005-05-09  Raja R Harinath  <rharinath@novell.com>
863
864         Fix #74852.
865         * decl.cs (MemberCache.AddMethods): Register override methods,
866         rather than non-override methods.
867         * typemanager.cs (RegisterOverride): New.
868         (IsOverride): Update.
869
870 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
871
872         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
873
874 2005-05-06  Martin Baulig  <martin@ximian.com>
875
876         * attribute.cs
877         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
878         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
879
880 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
881
882         Fix #73105.
883         
884         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
885         recursive declaration.
886         
887         * statement.cs (Block.ResolveMeta): Report any error in resolving.
888         
889 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
890
891         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
892         
893         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
894
895 2005-05-05  Raja R Harinath  <rharinath@novell.com>
896
897         Fix #74797.
898         * decl.cs (DeclSpace.FamilyAccessible): 
899         Use TypeManager.IsNestedFamilyAccessible.
900
901         Fix reopened #64812.
902         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
903         internal'.
904
905 2005-05-04  Raja R Harinath  <rharinath@novell.com>
906             Abin Thomas  <projectmonokochi@rediffmail.com>
907             Anoob V E  <projectmonokochi@rediffmail.com>
908             Harilal P R  <projectmonokochi@rediffmail.com>
909
910         Fix #64812.
911         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
912         allow access to all static members.
913
914 2005-05-04  Martin Baulig  <martin@ximian.com>
915
916         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
917
918 2005-05-04  Martin Baulig  <martin@ximian.com>
919
920         Fix #74655.
921
922         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
923         section at the end; make things work if `default' is not the last
924         section.        
925
926 2005-05-04  Martin Baulig  <martin@ximian.com>
927
928         Fix #70400.
929
930         * statement.cs (Switch): Replaced the `got_default' field with a
931         `default_section' one.
932         (Switch.CheckSwitch): Set `default_section' here.
933         (Switch.Resolve): If we're a constant switch and the constant is
934         not found, use the default section.
935
936 2005-05-03  Martin Baulig  <martin@ximian.com>
937
938         * expression.cs (ArrayAccess.EmitGetLength): New public method.
939
940         * statement.cs (Foreach.ArrayForeach): New nested class.
941         (Foreach.TemporaryVariable): New nested class.
942         (Foreach.EmitArrayForeach): Removed; this is now in the new
943         ArrayForeach class.
944
945 2005-05-03  Raja R Harinath  <rharinath@novell.com>
946
947         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
948         more conservative.
949         (VerifyPendingMethods): Revert change below.
950
951         * typemanager.cs (IsOverride, RegisterNonOverride): New.
952         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
953         that used to trigger warning -28.  Remove warning -28.
954         * expression.cs (Invocation.OverloadResolve): Use
955         TypeManager.IsOverride to distinguish override methods.
956
957         Fix #74773.
958         * pending.cs (VerifyPendingMethods): If a base type implements the
959         requested interface, don't bother checking individual methods of
960         the base type.  As a side-effect, this prevents the creation of
961         unnecessary proxies.
962
963 2005-05-02  Martin Baulig  <martin@ximian.com>
964
965         Fix #70182.
966
967         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
968         Also `And' the locals if the old vector is null.
969         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
970         null; in this case we basically reset all the variables.        
971
972 2005-05-02  Martin Baulig  <martin@ximian.com>
973
974         Fix #74529.
975
976         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
977         Added `FlowBranching branching' argument; always `and' the
978         variables instead of `or'ing them unless we're an infinite loop.
979
980         * statement.cs (While.Resolve): Create a new sibling unless we're
981         infinite.       
982
983 2005-05-02  Martin Baulig  <martin@ximian.com>
984
985         Fix #70140.
986
987         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
988         arguments; use it instead of creating a new TopLevelBlock.
989         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
990         our ConstructorInitializer.
991
992         * statement.cs
993         (TopLevelBlock.TopLevelBranching): New public property.
994         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
995         and create our `TopLevelBranching'.
996
997         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
998         anonymous method host, use `block.TopLevelBranching' rather than
999         creating a new branching.
1000
1001 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1002
1003         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1004         a ScopeInfo, if any of the current children is a child of the new
1005         entry, move those children there.
1006
1007 2005-04-30  Martin Baulig  <martin@ximian.com>
1008
1009         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1010         at the beginning of a SwitchSection.  Fix #73335.
1011
1012 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1013
1014         Fix #74378
1015         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1016         
1017         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1018         (FieldExpr.DoResolve): Obsolete members are ignored for field
1019         initializers.
1020         
1021 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1022
1023         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1024         of arrays detection.
1025
1026         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1027         verification.
1028         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1029
1030         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1031         arrays report.
1032
1033 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1034
1035         * cs-parser.jay: Use the prefered version of -unsafe in error
1036         message.
1037
1038 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1039
1040         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1041         circumstances.
1042
1043 2005-04-20  John Luke  <john.luke@gmail.com>
1044
1045         * driver.cs: fix typo in error message, --outout to --output
1046
1047 2005-04-30  Martin Baulig  <martin@ximian.com>
1048
1049         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1050         handle the .NET 2.x security attributes.
1051
1052 2005-04-30  Martin Baulig  <martin@ximian.com>
1053
1054         * typemanager.cs
1055         (TypeManager.ExpandInterfaces): Don't add things twice.
1056
1057         * class.cs
1058         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1059
1060 2005-04-29  Martin Baulig  <martin@ximian.com>
1061
1062         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1063
1064         * anonymous.cs: Added support for anonymous generic methods.
1065
1066 2005-04-29  Martin Baulig  <martin@ximian.com>
1067
1068         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1069         generic instances.
1070
1071 2005-04-29  Martin Baulig  <martin@ximian.com>
1072
1073         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1074
1075         * expression.cs (New.DoResolve): Fix the CS0304 check.
1076
1077 2005-04-29  Martin Baulig  <martin@ximian.com>
1078
1079         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1080         naming schema.
1081
1082         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1083         explicit interface implementation, compare the interface types.
1084         (MethodData.Define): Use the new naming scheme from the latest
1085         .NET 2.x beta2.
1086         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1087
1088         * decl.cs (MemberName.GetMemberName): Removed.
1089         (MemberName.MethodName, FullName): New properties.
1090
1091 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1092
1093         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1094
1095 2005-04-22  Martin Baulig  <martin@ximian.com>
1096
1097         * generic.cs (GenericMethod): Create the EmitContext in the
1098         `Define()'; in `Define(MethodBuilder)', create the type parameters
1099         before calling `Define()'.  Fixes #73933.
1100
1101 2005-04-22  Martin Baulig  <martin@ximian.com>
1102
1103         * generic.cs
1104         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1105         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1106
1107         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1108         ConstructedType, check its constraints.
1109
1110 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1111
1112         * codegen.cs (InRefOutArgumentResolving): New field.
1113         
1114         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1115         fields outside contructor.
1116         
1117         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1118         
1119 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1120
1121         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1122         parameter code was not completed ever, so it was not as up-to-date
1123         as local variables.  Must finish it.
1124
1125         The bug fix was to compare the Toplevel of the block, not the
1126         current block.  Thanks for Ben for pointing this out. 
1127
1128 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1129
1130         * decl.cs (AddMethods): Use the declaring type of the problem
1131         method to determine if we want to squash a warning.
1132
1133 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1134
1135         * attribute.cs: Removed debug output.
1136
1137         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1138         
1139         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1140         Report.Stderr.
1141         
1142 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1143
1144         Fix #74481.
1145         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1146         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1147         all null comparisons against reference types.
1148
1149 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1150
1151         Fix# 74565
1152         * class.cs (TypeContainer.CircularDepException) New nested
1153         exception class.
1154         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1155         (TypeContainer.DefineType): Removed error, reset InTransit before
1156         exit.
1157         (Class.DefineType): Throw exception when is in Transit.
1158         Catch exception and report error.
1159         (Struct.DefineType): Throw exception when is in Transit.
1160         Catch exception and report error.
1161         (Interface.DefineType): Throw exception when is in Transit.
1162         Catch exception and report error.
1163
1164         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1165         handle nested exception handlers.
1166
1167         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1168         a catch.
1169
1170         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1171         InFinally and InCatch storage.
1172
1173         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1174         (Catch.Resolve): Set and Restore ec.InCatch.
1175         (Try.Resolve): Set and Restore ec.InFinally.
1176         (Try.HasCatch): True when try has catch.
1177
1178 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1179
1180         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1181           for the same event member, so exclude such cases from warning 419.
1182           Fixed bug #74633.
1183
1184 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1185
1186         * expression.cs (Binary.ResolveOperator): Apply patch from John
1187         Luke to fix bug 59864: operators &, | and ^ on enumerations
1188         require that the same enum type on both sides.
1189
1190         * driver.cs: Add warnings to old flag usage, this is to assist
1191         people who produce Makefiles and hope that the Makefiles will be
1192         used on Windows.
1193
1194         * class.cs (TypeContainer.EmitType): Moved the definition of the
1195         special $PRIVATE$ field from the resolve phase to the Emit phase.
1196         During resolve we do not know if we are a struct with
1197         HasExplicitLayout, we know this only after the attributes for the
1198         type are emitted.
1199
1200         Set the FieldOffset to zero on the dummy field that we create for
1201         the class.   Fixes 74590.
1202
1203 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1204
1205         Fix #73834.
1206         * ecore.cs (PropertyExpr.resolved): New.
1207         (DoResolve): Use it to handle a case of double resolution here.
1208         Handle a case of identical-name-and-type-name.
1209         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1210         resolution by storing the results of expression resolution back
1211         into the "probes" array.
1212
1213 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1214
1215         Fix cs0208-7.cs and cs0208-8.cs.
1216         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1217         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1218         error reporting to point out the reason a struct is not unmanaged.
1219
1220 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1221
1222         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1223           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1224
1225 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1226
1227         Fix #74528.
1228         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1229         IdenticalNameAndTypeName here.
1230         (EventExpr.InstanceResolve): Likewise.
1231
1232 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1233
1234         C# 2.0 DefaultCharSetAttribute implementation
1235         
1236         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1237         which allows us to set GlobalNamespace for every resolve.
1238         (Attribute.ResolveArguments): Cut from Resolve.
1239         (Attribute.GetCharSetValue): Returns CharSet named argument.
1240         (Attribute.DefinePInvokeMethod): Gets default charset from
1241         module settings.
1242         (GlobalAttribute.ResolveAsTypeStep): Override.
1243         (GlobalAttribute.ResolveArguments): Override.
1244         
1245         * class.cs (TypeAttr): Is protected.
1246         
1247         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1248         (ModuleClass.DefaultCharSetType): New memeber.
1249         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1250         
1251         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1252         charset from module.
1253         
1254         * delegate.cs (TypeAttr): Override.
1255         (Delegate.DefineType): Use this TypeAttr.
1256         
1257         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1258         at very early stage (before types are defined) to resolve model
1259         module attributes. It will probably not work with corlib but it
1260         should be ok.
1261         
1262         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1263         charset from module.
1264         
1265         * typemanager.cs (default_charset_type): New type.
1266
1267 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1268
1269         * decl.cs (MemberCache.AddMethods): Don't warn if
1270         System.Object.Finalize has buggy MethodAttributes.
1271
1272         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1273         removed below.
1274
1275 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1276
1277         * doc.cs : detect ambiguous reference to overloaded members.
1278           Fixed bug #71603. MS 1.1 csc does not detect it.
1279
1280 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1281
1282         * doc.cs : delegates must not be referenced with parameters.
1283           Fixed bug #71605.
1284
1285 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1286
1287         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1288
1289 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1290
1291         * driver.cs (MainDriver): Stop processing if the CLS stage found
1292         errors. 
1293
1294         (CompilerCallableEntryPoint.InvokeCompiler): Always
1295         reset after execution;   Take a TextWriter argument for the
1296         output.
1297
1298         * report.cs: Use the error stream instead of hardcoding stderr. 
1299
1300 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1301
1302         * class.cs: Reduce code paths to test, too small of an
1303         optimization to make it worth the extra testing.  Always perform
1304         it. 
1305
1306 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1307
1308         Fix #74510.
1309         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1310         operators that had errors reported on them.
1311
1312 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1313
1314         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1315         argument types.
1316         (Attribute.Resolve): Add named argument type checking.
1317         
1318         * class.cs (FixedField.Define): Use IsPrimitiveType
1319         
1320         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1321         
1322         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1323         unsafe parameter types.
1324         
1325         * statement.cs (Using.ResolveExpression): Add better error description.
1326         
1327         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1328         
1329 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1330
1331         Fix #74484.
1332         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1333         AttributeUsageAttribute in the emitcontext of the attribute class,
1334         not in the emitcontext of the attributable entity it was attached to.
1335         * cs-parser.jay: Use 'current_class', not 'current_container',
1336         when creating a GlobalAttribute.
1337
1338 2005-04-08  Alp Toker  <alp@atoker.com>
1339
1340         * pending.cs: The fix to #58413 failed to compile methods implementing
1341         interfaces with/without params modifiers and vice versa, even though
1342         params modifiers aren't part of the signature. Make the modifier check
1343         less strict as in csc.
1344
1345 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1346             Anoob V E  <projectmonokochi@rediffmail.com>
1347             Harilal P R  <projectmonokochi@rediffmail.com>
1348
1349         Fix #58413.
1350         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1351         modifiers of pending methods.
1352         (PendingImplementation.PendingImplementation): Initialize it.
1353         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1354         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1355         with ParameterData.  Add check for modifiers.
1356         * class.cs (MethodData.Define): Update to changes.
1357
1358 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1359
1360         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1361
1362 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1363
1364         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1365         property.
1366         
1367         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1368         
1369         * rootcontext.cs,
1370         * typemanager.cs: Registered RequiredAttributeAttribute.
1371         
1372 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1373
1374         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1375         Warning CS0169 is back at level 3.
1376         (IMethodData.SetMemberIsUsed): New method.
1377         
1378         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1379         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1380         
1381         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1382
1383         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1384         contants.
1385         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1386         is used.
1387         
1388         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1389         is used.
1390         
1391         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1392         to avoid the problems with nested types.
1393
1394 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1395             Anoob V.E  <projectmonokochi@rediffmail.com>
1396             Harilal P.R  <projectmonokochi@rediffmail.com>
1397             Raja R Harinath  <rharinath@novell.com>
1398
1399         Fix #73820.
1400         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1401         attribute.
1402         * typemanager (GetConstructor): Make public.
1403
1404 2005-04-05  John Luke  <john.luke@gmail.com>
1405             Raja R Harinath  <rharinath@novell.com>
1406
1407         Fix #62232.
1408         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1409         struct too.  Return false quicker in a few cases.
1410         (VerifyUnManaged): Use it.
1411
1412 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1413
1414         Fix #74041.
1415         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1416         not 'unreachable_seen'.
1417
1418 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1419
1420         * attribute.cs (Attribute.GetValue): Removed unused.
1421         
1422         * codegen.cs (CodeGen.TrimExt): Removed unused.
1423         
1424         * cs-parser.jay (output): Removed unused.
1425         
1426         * cs-tokenizer.cs (hex_digits): Removed unused.
1427         
1428         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1429         
1430         * expression.cs (Indirection.LoadExprValue): Removed unused.
1431         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1432         
1433         * iterators.cs (Iterator.param_types): Removed unused.
1434         
1435         * statement.cs (Goto.block): Removed unused.
1436         (ToplevelBlock.did): Removed unused.
1437         (Switch.ResolveConstantSwitch): Removed unused.
1438
1439 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1440
1441         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1442         resetting thingy.
1443
1444 2005-04-19  Martin Baulig  <martin@ximian.com>
1445
1446         Merged r42462 from MCS and made it work for GMCS.
1447
1448         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1449
1450         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1451
1452 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1453
1454         Fix #74232 and cs0208-3.cs.
1455         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1456         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1457         unmanaged type.  Don't use FieldBuilders when 't' is a
1458         TypeBuilder.  Use ModFlags and MemberType fields.
1459         * class.cs (MemberBase.member_type): Rename from MemberType.
1460         (MemberBase.MemberType): New property.  Determines member_type on
1461         demand.
1462         (MemberBase.DoDefine): Don't initialize MemberType here.
1463         (FieldMember.Define): Likewise.
1464
1465 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1466
1467         Fix #74241
1468         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1469         Attributes are emitted there.
1470         
1471 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1472
1473         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1474         keyword in 'partial enum' too.
1475         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1476         is not allowed).
1477         Report from Kamil Skalski <nazgul@omega.pl>.
1478
1479         Fix #74309.
1480         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1481         have partial containers too.
1482
1483         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1484         in block' checks to Block.CheckInvariantMeaningInBlock.
1485         * statement.cs (Block.GetKnownVariableInfo): Make private.
1486         (Block.IsVariableUsedInChildBlock): Remove.
1487         (Block.IsVariableUsedInBlock): Likewise.
1488         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1489         conflicting declaration.
1490         (Block.AddVariable): Make error messages less long-winded and more
1491         specific.  Show location of conflicting declaration.
1492         * parameter.cs (Parameters.Location): New readonly property.
1493
1494 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1495
1496         Clean up semantics of invoking ResolveMemberAccess.
1497         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1498         can have an instance, ensure that we pass in a non-TypeExpression
1499         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1500         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1501         argument.  Update to changes and simplify.
1502         (FieldExpr.Emitinstance): Remove CS0120 check.
1503         (PropertyExpr.EmitInstance): Likewise.
1504         * expression.cs (Argument.Resolve): Likewise.
1505         (Invocation.DoResolve): Update to changes in semantics of
1506         InstanceExpression.
1507
1508 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1509
1510         Fix #74241
1511         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1512         customization.
1513         
1514         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1515
1516 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1517
1518         Fix difference in behaviour with commandline invocation.
1519         * driver.cs (Driver.Reset): New.
1520         (CompilerCallableEntryPoint): Call it.
1521
1522         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1523         variable" warnings if the boolean expression failed to resolve.
1524
1525 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1526
1527         * attribute.cs: Fix the union of several permissions when some of them
1528         are unrestricted (so the result isn't an unrestricted permission set).
1529         Fix #74036.
1530
1531 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1532
1533         * ecore.cs (MemberExpr): New class.  Convert from interface
1534         IMemberExpr.
1535         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1536         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1537         error checks.
1538         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1539         (MethodGroupExpr.IsExplicitImpl): Remove.
1540         (Expression.GetFieldFromEvent): Remove.
1541         (SimpleName.MemberStaticCheck): Remove.
1542         (SimpleName.DoSimpleNameResolve): Update to changes.
1543         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1544         (MemberAccess.IdenticalNameAndTypeName): Remove.
1545         (MemberAccess.error176): Move to MemberExpr.
1546         (MemberAccess.DoResolve): Update to changes.
1547         (BaseAccess.DoResolve): Likewise.
1548
1549 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1550
1551         C# 2.0 Conditional attribute class implementation
1552         
1553         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1554         Analyzes class whether it has attribute which has ConditionalAttribute
1555         and its condition is not defined.
1556         
1557         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1558         (Class.IsExcluded): New method. Search for at least one defined
1559         condition in ConditionalAttribute of attribute class.
1560
1561 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1562
1563         * ecore.cs (PropertyExpr): Derive from Expression, not
1564         ExpressionStatement.
1565         (PropertyExpr.EmitStatement): Remove.
1566
1567 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1568
1569         Fix #74060.
1570         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1571         internal field "value__" of an enum be private.  The examples for
1572         "value__" that I found on MSDN all used FieldAttributes.Private.
1573
1574         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1575         Don't mention IL method attribute names.
1576
1577         Fix #47991.  Remove a TODO.
1578         * statement.cs (Block.Toplevel): Make into a field.
1579         (Block.Parameters): Move into ToplevelBlock.
1580         (Block.known_variables): Rename from child_variable_names.
1581         (Block.Block): Remove variants that take Parameters.  Initialize
1582         'Toplevel' with the immediately surrounding toplevel block.
1583         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1584         LocalInfo parameter.
1585         (Block.GetKnownVariableInfo): New.
1586         (Block.IsVariableNameUsedInChildBlock): Update.
1587         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1588         the block, even though it may not be in scope.
1589         (Block.AddVariable): Remove Parameters parameter.  Use
1590         Toplevel.Parameters instead.
1591         (Block.AddConstant): Remove Parameters parameter.
1592         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1593         (Block.IsParamaterReference): Likewise.
1594         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1595         (ToplevelBlock.Parameters): New.  Moved from Block.
1596         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1597         initialize Parameters to a non-null value.
1598         * cs-parser.jay: Update to changes.
1599         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1600         simple names that mean different things in the same block.  Use
1601         Block.IsVariableNameUsedInBlock.
1602
1603 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1604
1605         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1606
1607 2005-03-26  Raja R Harinath  <harinath@acm.org>
1608
1609         Fix #73038.
1610         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1611         fails to resolve, ensure that the LHS is still resolved as an
1612         lvalue.
1613
1614 2005-03-25  Raja R Harinath  <harinath@acm.org>
1615
1616         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1617         ec.ContainerType.
1618         (Enum.current_ec): Remove.
1619         (Enum.LookupEnumValue): Remove EmitContext argument.
1620         Just uses the one created during DefineType.
1621         (Enum.FindMembers): Update.
1622         * expression.cs (MemberAccess.DoResolve): Update.
1623
1624 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1625
1626         * assign.cs (Assign.DoResolve): Check for CS1717 when
1627         source and target are same (uses Equals).
1628
1629         * expression.cs (LocalVariableReference, ParameterReference,
1630         This): Implemented Equals, GetHashCode.
1631
1632         * statement.cs (Block.GetParameterReference): Removed useless
1633         local variable.
1634
1635 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1636
1637         Fix cs0128.cs
1638         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1639         blocks before deciding whether the error is cs0136 or cs0128.
1640
1641         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1642         (using_alias_directive, using_namespace_directive): Pass
1643         MemberName, not an expression to Namespace.UsingAlias and
1644         Namespace.Using.
1645         (MakeName): Use the MemberName of the namespace.
1646         * namespace.cs (Namespace.MemberName): New.
1647         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1648         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1649         Likewise.
1650         * decl.cs (MemberName.Name): Make readonly.
1651         (MemberName.FromDotted): New "constructor".
1652         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1653         (MemberCore.Name): Compute from MemberName on demand.
1654         (MemberCore.SetMemberName): Provide a way to change the
1655         MemberName.
1656         (MemberCore.AddToContainer): Don't take a fullname parameter.
1657         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1658         fully qualified name of the container to the member name.
1659         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1660         only if the type is a member of the root container.
1661         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1662         MemberName.Left rather than searching for an embedded ".".
1663         (PartialContainer.CreatePart): Update to changes in RootContext.
1664         (MemberBase.ShortName): Turn into a property.  Use
1665         MemberCore.SetMemberName.
1666         (MemberBase.ExplicitInterfaceName): Remove.
1667         (MemberBase.UpdateMemberName): Remove.
1668         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1669         (PropertyBase.SetMemberName): New override.
1670         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1671         (Tree.GetDecl): New.
1672         (Tree.AllDecls): Rename from Decls.
1673         * attribute.cs, enum.cs, report.cs: Update to changes.
1674         * driver.cs (MainDriver): Use MemberName.FromDotted on
1675         RootContext.MainClass.
1676
1677 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1678
1679         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1680         checks.
1681
1682         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1683
1684 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1685
1686         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1687         property accessor modifiers.
1688
1689         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1690         fixed buffer attribute (CS1716).
1691         (PropertyMethod.HasCustomAccessModifier): When property accessor
1692         has custom modifier.
1693
1694         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1695         modifiers.
1696         (PropertyExpr.DoResolveLValue): Add CS0272.
1697
1698 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1699
1700         * convert.cs: When converting to a pointer, use the proper Conv.U
1701         or Conv.I depending on the source data type.
1702
1703         * cs-tokenizer.cs: Make the size for large decimal constants,
1704         fixes #72957.
1705
1706 2005-03-17  Martin Baulig  <martin@ximian.com>
1707
1708         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1709         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1710
1711 2005-03-17  Martin Baulig  <martin@ximian.com>
1712
1713         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1714         to bool so we can return an error condition.
1715         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1716         returned an error.
1717
1718 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1719
1720         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1721         attributes.
1722
1723 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1724
1725         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1726         Refactor to avoid traversing the list of assemblies, and to avoid
1727         string concatenation.
1728         * typemanager.cs (guid_attr_type): Remove.
1729         (negative_hits, pointers, references): Remove hashes.
1730         (type_hash): New.
1731         (GetConstructedType): New.  Uses type_hash to handle constructed
1732         types (arrays, references, pointers).
1733         (GetReferenceType, GetPointerType): Use it.
1734         (GetNestedType): New.  Uses type_hash to handle nested types of
1735         reflected types.
1736         (LookupType, LookupTypeDirect): Remove.
1737         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1738         'types' hash and LookupTypeReflection directly.
1739         (params_string, params_object): Use GetConstructedType.
1740         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1741         top-level types.
1742         (Namespace.Lookup): Use cached_types.
1743         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1744         provided by old TypeManager.LookupType.
1745         * rootcontext.cs (MakeFQN): Remove.
1746         * decl.cs (DeclSpace.MakeFQN): Likewise.
1747         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1748         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1749         TypeManager.GetConstructedType.
1750         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1751
1752 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1753
1754         * cs-parser.jay: Fix build.
1755
1756 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1757
1758         * class.cs (TypeContainer.CircularDepException) New nested
1759         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1760
1761         * cs-parser.jay: Reports CS1527 for any namespace element.
1762
1763         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1764         Added CS0407.
1765
1766         * expression.cs (ParameterReference.IsAssigned): Changed error to
1767         CS0269.
1768         (Error_WrongNumArguments): Moved CS0245 detection here.
1769
1770         * statement.cs (Return.Resolve): Add CS1622 report.
1771
1772 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1773
1774         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1775
1776 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1777
1778         * attribute.cs expression.cs: Get rid of some allocations.
1779
1780 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1781
1782         * doc.cs : just eliminate the latest change.
1783
1784 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1785
1786         * doc.cs : commented out the latest change. It breaks xml-030.cs
1787
1788 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1789
1790         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1791           fail. So invoke CreateType() in FindDocumentedType().
1792
1793 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1794
1795         * cs-tokenizer.cs : added IsKeyword().
1796         * doc.cs : Detect keyword incorrectly used as identifier.
1797           Allow identifiers prefixed by @.
1798
1799 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1800
1801         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1802         It caused exception in namespace resolving (again!).
1803         
1804         * class.cs (Class.ctor): Removed exit.
1805         (PropertyMethod.ctor): ditto.
1806         
1807         * codegen.cs (Codegen.Reset): Reset static data.
1808         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1809         
1810         * cs-tokenizer.cs (Cleanup): Removed.
1811         
1812         * driver.cs (GetSystemDir): Rewrote to one line command.
1813         It caused problem with unloaded dynamic modules.
1814         (UnixParseOption): Removed Exit.
1815         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1816         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1817         Now can be mcs used as library.
1818         
1819         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1820         empty location.
1821         
1822         * location.cs (Reset): Reset static data.
1823         
1824         * namespace.cs (Reset): Reset static data.
1825         
1826         * report.cs (Report.Reset): Reset static data.
1827         
1828         * rootcontext.cs (RootContext.Reset): Reset static data.
1829         
1830         * tree.cs (RootTypes.ctor): Use Location.Null
1831         
1832         * typemanager.cs (TypeManager.Reset): Reset static data.
1833         (CoreLookupType): Removed Exit.
1834         (TypeHandle.Reset): Reset static data.
1835         
1836 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1837
1838         Fix #73516.
1839         * typemanager.cs (ComputeNamespaces): Import namespaces from
1840         referenced modules too.
1841
1842 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1843
1844         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1845         than '.'.
1846
1847 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1848
1849         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1850         enclosing DeclSpace.  This ensures that a name-lookup populates
1851         more caches and there are fewer 'TypeExpression's.  Carve out
1852         nested type lookup into ...
1853         (LookupNestedTypeInHierarchy): ... this.
1854
1855 2005-04-15  Martin Baulig  <martin@ximian.com>
1856
1857         Merged r41590 from MCS and make it work in the generics land.
1858
1859         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1860         `check' argument.
1861
1862         * class.cs (PartialContainer.UpdateConstraints): Removed.
1863         (PartialContainer.CheckConstraints): Removed.
1864         (PartialContainer.SetParameterInfo): Store the constraints here.
1865         (PartialContainer.DefineTypeParameters): New public method;
1866         resolve the type parameter's constraints here.  Note that the
1867         PartialContainer doesn't have an EmitContext anymore, so we must
1868         do this in the ClassPart.
1869
1870 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1871
1872         Clean up a few partial-class semantics.  
1873         Fixes test-357.cs and cs1618-2.cs.
1874         * cs-parser.jay (struct_declaration): Use 'current_class' as
1875         parent of newly-created struct.  Remove call to Register ().
1876         Use 'pop_current_class' to complete handing the current struct.
1877         (interface_declaration): Likewise.
1878         (class_declaration): Likewise.
1879         (enum_declaration): Use 'current_class' as parent of newly created
1880         enum.
1881         (delegate_declaration): Likewise.
1882         (pop_current_class): New function.  This is used to handle closing
1883         up the 'current_class' and 'current_container', and pointing them
1884         to the enclosing class/container.
1885         (CSharpParser): Initialize 'current_class' too.
1886         * decl.cs (MemberCore): Add check for invariant: a partial
1887         container is not a parsed entity, and thus does not enclose any
1888         parsed members.
1889         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1890         (DeclSpace.BaseTypeExpr): Use it.
1891         (DeclSpace.LookupType): Add check for invariant.
1892         * class.cs (TypeContainer): Add check for invariant: a nested
1893         class should have the same NamespaceEntry as its enclosing class.
1894         (TypeContainer.EmitFieldInitializers): Make virtual.
1895         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1896         MemberCore.
1897         (TypeContainer.Register): Remove.
1898         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1899         null.  Use TypeResolveEmitContext for resolving base types and
1900         interfaces.  Move initialization of Parts.TypeBuilder here from
1901         ...
1902         (TypeContainer.DefineNestedTypes): ... here.
1903         (PartialContainer): Take a Namespace not a NamespaceEntry.
1904         (PartialContainer.Create): Don't use Register.  Call the
1905         appropriate Add... function directly.
1906         (ClassPart): Take both the PartialContainer and the enclosing
1907         class as constructor arguments.
1908         (ClassPart.EmitFieldInitializers): Override.
1909         (ClassPart.PartFindNestedTypes): Remove.
1910         (FieldBase.GetInitializerExpression): Resolve the initializer
1911         expression in the emit context of the enclosing class.
1912         * tree.cs (RootTypes): Remove Register ().
1913         
1914 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1915
1916         * cs-parser.jay: Removed CS0134.
1917         
1918         * driver.cs: Removed CS1901.
1919         
1920         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1921         for predefined types.
1922
1923 2005-03-07  Duncan Mak  <duncan@novell.com>
1924
1925         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1926         well. Fixes bug #73454.
1927
1928 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1929
1930         * cs-tokenizer.cs (xtoken): Add CS1035.
1931         
1932         * class.cs (MethodData.Define): Add CS0683.
1933         (FieldMember.ctor): Add CS0681.
1934
1935 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1936
1937         * ecore.cs (SimpleName.DoResolve): Rename from
1938         SimpleName.DoResolveAllowStatic.
1939         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1940         Pass 'intermediate' flag to MemberStaticCheck.
1941         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1942         of "intermediate" lookups via MemberAccess.
1943         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1944         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1945
1946 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1947
1948         Fix #73394.
1949         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1950         slipped in because of variable names that are identical to a
1951         builtin type's BCL equivalent ('string String;', 'int Int32;').
1952         (PropertyExpr.EmitInstance): Likewise.
1953
1954 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1955
1956         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1957         
1958         * report.cs (warning_ignore_table): Made public.
1959
1960 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1961
1962         Fix #73282.
1963         * class.cs (MethodData.Emit): Pass 'container' to
1964         container.GetObsoleteAttribute instead of 'container.Parent'.
1965
1966 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1967
1968         * cs-parser.jay: Add 1534 error test.
1969
1970         * iterators.cs (Yield.CheckContext): Add error 1629.
1971         (Iterator.ctor): Save unsafe modifier.
1972         (MoveNextMethod.DoEmit): Restore unsafe context.
1973
1974         * namespace.cs (UsingAlias): Better error message.
1975
1976 2005-03-03  Dan Winship  <danw@novell.com>
1977
1978         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1979         the warning message [#73219]
1980
1981 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1982
1983         Fix compile with MCS 1.0.0.0.
1984         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1985         w_restore to not depend on string constant folding.
1986
1987 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1988
1989         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1990         CS0246 check to users who passed 'silent = false'.
1991         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1992         check.
1993         (SimpleName.SimpleNameResolve): Update.
1994         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1995         (MemberAccess.IdenticalNameAndTypeName): Update.
1996         * doc.cs (FindDocumentedTypeNonArray): Update.
1997
1998 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1999
2000         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2001         * parameters.cs (ComputeAndDefineParameters): Remove.
2002         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2003         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2004         Use GetParameterInfo.
2005
2006 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2007
2008         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2009
2010 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2011
2012         Unify DeclSpace.LookupType and DeclSpace.FindType.
2013         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2014         is in charge of defining nested types on demand.
2015         (DeclSpace.LookupType): Use it when the current_type is a
2016         TypeBuilder.  Use LookupTypeDirect for reflected types.
2017         (DeclSpace.FindType): Remove.
2018         (DeclSpace.LookupInterfaceOrClass): Likewise.
2019         (DeclSpace.DefineTypeAndParents): Likewise.
2020         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2021         DeclSpace.LookupType.
2022         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2023         * typemanager.cs (LookupType): Simplify.
2024         (AddUserType): Remove type from negative_hits.
2025         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2026         * class.cs (TypeContainer.FindMembers): Move handling of nested
2027         types ...
2028         (TypeContainer.FindMembers_NestedTypes): ... here.
2029         (TypeContainer.FindNestedType): Implement override.
2030         (ClassPart.FindNestedType): Delegate to PartialContainer.
2031         (ClassPart.PartFindNestedType): Looks up the nested types of the
2032         part alone.
2033
2034 2005-04-14  Martin Baulig  <martin@ximian.com>
2035
2036         * generic.cs (ConstructedType): Moved all the type lookup and
2037         nested class logic into SimpleName.
2038         (ConstructedType.ResolveConstructedType): Our underlying type is
2039         already fully resolved; all the type lookup stuff is in
2040         SimpleName.
2041
2042         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2043         constructed types here instead of in ConstructedType.
2044
2045         * decl.cs (MemberName.GetTypeExpression): Always create a
2046         SimpleName, not a ConstructedType.
2047         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2048
2049 2005-03-02  Martin Baulig  <martin@ximian.com>
2050
2051         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2052         static constructor in static classes.
2053
2054 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2055
2056         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2057         sizeParamIndex is not specified.
2058
2059 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2060
2061         Fix #73117
2062         * report.cs (WarningMessage.IsEnabled): Missing null check.
2063
2064 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2065
2066         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2067         in the fields and not in the properties.
2068
2069 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2070
2071         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2072         fields as well.
2073
2074 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2075
2076         * attribute.cs: Small refactoring (improved robustness).
2077         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2078         (ValidateGuid): Removed.
2079         (Resolve): Removed referenced to above mentioned.
2080         (GetAttributeUsage): Made private and changed to work without
2081         class assistance.
2082         (GetIndexerAttributeValue): Don't crash.
2083         (GetConditionalAttributeValue): Ditto.
2084         (GetClsCompliantAttributeValue): Ditto.
2085         (ExtractSecurityPermissionSet): All attributes exceptions are
2086         error 648.
2087         (GetPropertyValue): New helper.
2088         (GetMethodImplOptions): New method.
2089         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2090         some missing properties.
2091         
2092         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2093         (Method.ApplyAttributeBuilder): Updated.
2094         
2095         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2096         exception.
2097
2098 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2099
2100         Fix #73052.
2101         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2102         non-simple types (array, pointer, reference).
2103
2104 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2105
2106         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2107
2108         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2109         for operators.
2110         (Method.CheckBase): Catch wrong destructor here.
2111         (MethodData.Define): Add errors 550, 668.
2112
2113         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2114
2115         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2116
2117         * pending.cs (VerifyPendingMethods): Add error 551.
2118
2119         * typemanager.cs (CSharpName): Next error report helper.
2120
2121 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2122
2123         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2124         attributes. Removed useless attribute double check.
2125         It saves almost 2MBs for corlib.
2126
2127 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2128
2129         Fix #72924.
2130         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2131         called twice in case of error.
2132
2133 2005-02-23  Chris Toshok  <toshok@ximian.com>
2134
2135         Fix compiler portions of #72827.
2136         * statement.cs (Block.Emit): call Begin/EndScope on the
2137         EmitContext instead of the ILGenerator.
2138
2139         * codegen.cs (EmitContext.BeginScope): new method, call
2140         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2141         we have one.)
2142         (EmitContext.BeginScope): same, but EndScope and CloseScope
2143
2144         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2145         offset and call the superclass's OpenScope(int) with it.
2146         (SymbolWriter.CloseScope): get the current il
2147         offset and call superclass's CloseScope(int) with it.
2148
2149 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2150
2151         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2152         CS1677 for out and ref as well.
2153
2154         * class.cs (Method.Define): Add error CS1599 detection.
2155         
2156         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2157         
2158         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2159         
2160         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2161         
2162         * support.cs.cs (ModifierDesc): New helper method.
2163
2164 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2165             Abin Thomas  <projectmonokochi@rediffmail.com>
2166             Anoob V E  <projectmonokochi@rediffmail.com>
2167             Harilal P R  <projectmonokochi@rediffmail.com>
2168
2169         Fix #57851, #72718.
2170         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2171         MemberLookup (used for error reporting) actually returns a result.
2172         Fix error report number (122, not 112).
2173
2174 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2175             Anoob V E  <projectmonokochi@rediffmail.com>
2176             Harilal P R  <projectmonokochi@rediffmail.com>
2177
2178         Fix #71134.
2179         * pending.cs (PendingImplementation.GetAbstractMethods):
2180         Find NonPublic members too.
2181
2182 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2183
2184         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2185         Fixed error 217.
2186         
2187         * class.cs (MethodCore.CheckMethodAgainstBase):
2188         Add error 239 report.
2189
2190 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2191
2192         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2193         
2194         * class.cs (Operator.Define): Add error 217 report.
2195         
2196 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2197
2198         Fix #68955.
2199         * expression.cs (Invocation.IsApplicable): Make public.
2200         (Invocation.IsParamsMethodApplicable): Likewise.
2201         * delegate.cs (Delegate.VerifyApplicability): Don't use
2202         Invocation.VerifyArgumentCompat for parameter applicability
2203         testing.  Use Invocation.IsApplicable and
2204         Invocation.IsParamsMethodApplicable.
2205
2206 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2207
2208         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2209         
2210         * class.cs (Operator.Define): Add error 217 report.
2211         
2212 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2213
2214         * namespace.cs (UsingEntry.Resolve): Undo change below.
2215
2216 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2217
2218         Fix #72756.
2219         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2220         disable the error message when the extended MemberLookup also
2221         fails.
2222         (Expression.MemberLookupFinal): Update.
2223         (SimpleName.DoSimpleNameResolve): Update.
2224         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2225         Don't use MemberLookupFinal.
2226         (New.DoResolve): Update.
2227         (BaseAccess.CommonResolve): Update.
2228
2229 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2230
2231         Fix #72732.
2232         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2233         occured previously, don't resolve again.
2234
2235 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2236
2237         Fix #69949
2238         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2239         argument. Call ResolveAttributeUsage for unresolved.
2240         when types doesn't match ctor arguments.
2241         
2242         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2243         for nested attribute classes.
2244         (Class.attribute_usage): Removed.
2245         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2246         for attribute class.
2247         
2248         * ecore.cs (IsAttribute): Removed.
2249         
2250         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2251         
2252         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2253         now normal types.
2254         (attribute_types): Removed.
2255         (EmitCode): Global attributes are emited as the latest.
2256
2257 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2258
2259         * class.cs (EmitFieldInitializers): Don't emit field initializer
2260         for default values when optimilization is on.
2261         
2262         * constant.cs (Constant.IsDefaultValue): New property.
2263         
2264         * driver.cs: Add /optimize handling.
2265         
2266         * constant.cs,
2267         * ecore.cs,
2268         * literal.cs: Implement new IsDefaultValue property.
2269         
2270         * rootcontext.cs (Optimize): New field, holds /optimize option.
2271
2272 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2273
2274         Fix crasher in re-opened #72347.
2275         * namespace.cs (Namespace.Lookup): Return null if
2276         DeclSpace.DefineType returns null.
2277
2278         Fix #72678.
2279         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2280
2281 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2282
2283         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2284         now returns null if it cannot resolve to an lvalue.
2285         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2286         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2287         returned null.  Remove check for SimpleName.
2288         (EventExpr.DoResolveLValue): New.
2289         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2290         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2291         error from ...
2292         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2293         avoid CS0131 error.
2294         (Unary.ResolveOperator): Move CS0211 check ...
2295         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2296         CS0131 error.
2297         (Unary.DoResolveLValue): Simplify.
2298         (AddressOf.DoResolveLValue): New.
2299         (ArrayAccess.DoResolveLValue): New.
2300
2301 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2302
2303         * attribute.cs (Attribute.Resolve): Add arguments casting for
2304         when types doesn't match ctor arguments.
2305
2306 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2307
2308         Fix parts of #63202.
2309         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2310         lookup of operator in base type.  Ensure that all checks happen
2311         when the operator resolves to an "op_..." method.
2312
2313 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2314
2315         Fix #71992.
2316         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2317         'ignore_cs0104' parameter.  Pass it to ...
2318         (NamespaceEntry.Lookup): ... this.
2319         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2320         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2321         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2322         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2323         Update.  Request that cs0104 errors be ignored.
2324         (ComposedCast.ResolveAsTypeStep): Update.
2325
2326 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2327
2328         Fix #59209.
2329         * expression.cs (Invocation.BetterFunction): Remove support for
2330         comparing virtual functions and their overrides.
2331         (Invocation.IsOverride): New.
2332         (Invocation.OverloadResolve): Don't consider 'override' functions
2333         during candidate selection.  Store them in a lookaside list.
2334         If the selected method is a 'virtual' function, use the list to
2335         find any overrides that are closer to the LHS type.
2336
2337 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2338
2339         * expression.cs (New.DoResolve): Add complex core type reduction.
2340         (New.Constantify): Converts complex core type syntax like 'new int ()'
2341         to simple constant.
2342         
2343 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2344
2345         * decl.cs (EntryType.EntryType): New constructor to create an
2346         updated copy of a cache entry.
2347         (MemberCache.AddMethods): Use it.
2348         (MemberCache.ClearDeclaredOnly): Remove.
2349         (MemberCache.MemberCache): Update.
2350
2351 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2352
2353         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2354         variable.  This one is represents the actual low-level declaration
2355         of the method, as opposed to the semantic level `IsStatic'.   
2356
2357         An anonymous method which is hosted into a static method might be
2358         actually an instance method.  IsStatic would reflect the
2359         container, while MethodIsStatic represents the actual code
2360         generated.
2361
2362         * expression.cs (ParameterReference): Use the new MethodIsStatic
2363         instead of IsStatic.
2364
2365         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2366         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2367         set on the current EmitContext. 
2368
2369         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2370         resolve our casted expression as an LValue.  This triggers the
2371         proper LValue processing that is later required by Assign.
2372
2373         This fixes 72347.
2374
2375         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2376
2377 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2378
2379         C# 2.0 Fixed buffer implementation
2380
2381         * anonymous.cs: Update after RegisterHelperClass renaming.
2382
2383         * attribute.cs (AttributeTester.fixed_buffer_cache):
2384         Cache of external fixed buffers.
2385         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2386         implementation if field is fixed buffer else null.
2387
2388         * class.cs
2389         (TypeContainer.AddField): Accept FieldMember instead of Field.
2390         (FieldBase.IsFieldClsCompliant): Extracted code from
2391         VerifyClsCompliance descendant customization.
2392         (FixedField): New class handles fixed buffer fields.
2393         (FixedFieldExternal): Keeps information about imported fixed
2394         buffer.
2395         (IFixedField): Make access to internal or external fixed buffer
2396         same.
2397
2398         * cs-parser.jay: Add fixed buffer parsing.
2399
2400         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2401         buffer.
2402
2403         * expression.cs (Indirection): Extended implementation to accept
2404         fixed buffer field.
2405         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2406         (ElementAccess.MakePointerAccess): Get type as parameter.
2407         (DoResolve): Add fixed buffer field expression conversion.
2408         (DoResolveLValue): Ditto.
2409         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2410         (ArrayPtr): Derives from FixedBufferPtr.
2411         (ArrayPtr.Emit): Add extra emit for array elements.
2412
2413         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2414
2415         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2416         for compiler generated types.
2417         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2418
2419         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2420         and consume less memory.
2421         (Fixed.Resolve): Add fixed buffer case.
2422
2423         * typemanager.cs (compiler_generated_attr_ctor,
2424         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2425         (HasElementType): Add our own implementation to work on every
2426         runtime.
2427
2428 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2429
2430         * anonymous.cs (CaptureContext): Track whether `this' has been
2431         referenced.   
2432
2433         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2434         only captured `this' if it was implicitly done (instance
2435         methods/variables were used). 
2436
2437         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2438         `this' must be captured.
2439
2440 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2441  
2442         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2443         is null it means that there has been no need to capture anything,
2444         so we just create a sibling.
2445
2446         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2447
2448         Just a partial fix.  The other half is fairly elusive.
2449         
2450 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2451
2452         Fix #52586, cs0121-4.cs.
2453         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2454         and return a hashtable.
2455         (MemberCache.ClearDeclaredOnly): New.
2456         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2457         the method_hash of a base type too.
2458         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2459         type methods.  Overwrite entries with the same MethodHandle so
2460         that the ReflectedType is correct.  The process leaves in base
2461         virtual functions and their overrides as distinct entries.
2462         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2463         matters since it was boxed in a ArrayList before.
2464         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2465         modifier.
2466         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2467         case of a virtual function and its override (choose the overload
2468         as better).
2469         (Invocation.OverloadResolve): Avoid 'override' members during
2470         'applicable_type' calculation.
2471
2472 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2473
2474         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2475         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2476         GetTypeHandle.  It is possible for a reflected type to derive from
2477         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2478         System.Array during mscorlib compilation).
2479         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2480         contain a method_hash, don't create one either.  Don't create a
2481         deep copy of the base cache's method_hash.
2482         (MemberCache.SetupCache): Rename back from DeepCopy.
2483         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2484         already initialized.  If we see an override function, add its
2485         underlying base virtual function to the member_hash too.
2486
2487 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2488
2489         Combine two near-redundant caches.
2490         * typemanager.cs (method_params): Rename from method_internal_params.
2491         (TypeManager.GetParameterData): New.  Replace
2492         Invocation.GetParameterData.
2493         (TypeManager.LookupParametersByBuilder): Remove.
2494         * expression.cs (Invocation.method_parameter_cache): Remove.
2495         (Invocation.GetParameterData): Remove.
2496         Update to changes.
2497         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2498         Update to changes.
2499
2500 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2501
2502         Fix #72015.
2503         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2504         TypeManager.multicast_delegate_type is null, resolve it by looking
2505         up "System.MulticastDelegate".
2506         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2507
2508 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2509             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2510             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2511
2512         Fix cs0164.cs.
2513         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2514         (LabeledStatement.AddReference): New.  Set 'referenced'.
2515         (Goto.Resolve): Use it.
2516
2517 2005-02-05  John Luke  <john.luke@gmail.com>
2518
2519         * driver.cs: remove duplicate -doc line in Usage ()
2520
2521 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2522
2523         * location.cs (Location.AddFile): Fix CS2002 error report.
2524
2525 2005-02-02  Martin Baulig  <martin@ximian.com>
2526
2527         * delegate.cs (Delegate.DefineType): Report an internal error if
2528         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2529         details.        
2530
2531 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2532
2533         Fix a crasher in a variant of #31984.
2534         * const.cs (Constant.CheckBase): New override that defers the
2535         new-or-override check in case the base type hasn't been populated
2536         yet.
2537         (Constant.Define): Ensure the new-or-override check is performed.
2538
2539 2005-02-01  Duncan Mak  <duncan@ximian.com>
2540
2541         * const.cs (LookupConstantValue): Check that `ce' is not null
2542         before calling GetValue ().
2543
2544 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2545
2546         Fix test-334.cs (#69519).
2547         * cs-parser.jay (using_alias_directive): Pass in an expression to
2548         NamespaceEntry.UsingAlias.
2549         (using_namespace_directive): Pass in an expression to
2550         NamespaceEntry.Using.
2551         (namespace_name): Don't flatten to a string.
2552         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2553         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2554         ResolveAsTypeStep.
2555         (NamespaceEntry.UsingEntry): Likewise.
2556         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2557         changes.
2558         (NamespaceEntry.LookupForUsing): Remove.
2559         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2560         names.
2561         (NamespaceEntry.Lookup): Remove support for dotted names.
2562
2563 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2564
2565         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2566         split into two.
2567         (NamespaceEntry.ImplicitParent): Compute on demand.
2568         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2569         parallels the current.
2570         (NamespaceEntry.LookupForUsing): Use it.
2571         (NamespaceEntry.Lookup): If the current namespace-entry is
2572         implicit, don't search aliases and using tables.
2573
2574 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2575
2576         Fix #31984.
2577         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2578         BaseCache here.
2579         (TypeContainer.BaseCache): Compute on demand.
2580         (TypeContainer.FindMembers): Define constants and types if they're
2581         not already created.
2582         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2583         check.
2584         * const.cs (Constant.Define): Make idempotent.
2585
2586 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2587
2588         * pending.cs: Produce better code (no nops produced by using Ldarg
2589         + value).
2590         
2591         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2592         i - 1' it should be arg + 1.
2593
2594         Fixes bug #71819.
2595
2596 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2597
2598         * attribute.cs (Attribute.CheckAttributeType): Make private
2599         non-virtual.
2600         (Attribute.ResolveType): Make virtual.
2601         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2602         handling of RootContext.Tree.Types.
2603
2604 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2605
2606         Update attribute-handling to use the SimpleName/MemberAccess
2607         mechanisms.
2608         * cs-parser.jay (attribute): Pass in an expression to the
2609         constructors of Attribute and GlobalAttribute.
2610         * attribute.cs (Attribute): Take an expression for the name.
2611         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2612         passed in attribute name expression.
2613         (Attribute.CheckAttributeType): Use it.
2614         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2615         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2616         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2617         argument to prevent error messages if the lookup fails.
2618
2619 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2620
2621         * expression.cs (Indirection): Implemented IVariable interface
2622         to support indirection in AddressOf operator.
2623         (PointerArithmetic.Emit): Add optimalization for case where
2624         result can be precomputed.
2625
2626 2005-01-26  Martin Baulig  <martin@ximian.com>
2627
2628         * class.cs (TypeContainer.AttributeTargets): Return the correct
2629         AttributeTargets depending on our `Kind' instead of throwing an
2630         exception; fixes #71632.
2631
2632 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2633
2634         Fix #71257
2635         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2636         constant members.
2637
2638 2005-03-17  Martin Baulig  <martin@ximian.com>
2639
2640         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2641         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2642
2643 2005-03-17  Martin Baulig  <martin@ximian.com>
2644
2645         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2646         to bool so we can return an error condition.
2647         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2648         returned an error.
2649
2650 2005-03-17  Martin Baulig  <martin@ximian.com>
2651
2652         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2653
2654         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2655         converting from an array-type of T to `IEnumerable<T>'.
2656
2657 2005-03-16  Martin Baulig  <martin@ximian.com>
2658
2659         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2660         (Nullable.LiftedUnaryMutator): New public class.
2661
2662         * expression.cs (UnaryMutator.DoResolve): Added support for
2663         Nullable Types.
2664
2665 2005-03-14  Martin Baulig  <martin@ximian.com>
2666
2667         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2668
2669 2005-03-14  Martin Baulig  <martin@ximian.com>
2670
2671         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2672         the comparision operators `<', `>', `<=' and `>='.
2673
2674 2005-03-13  Martin Baulig  <martin@ximian.com>
2675
2676         * generic.cs
2677         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2678         avoid confusion with the `NullLiteral'.
2679         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2680
2681 2005-03-13  Martin Baulig  <martin@ximian.com>
2682
2683         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2684         comparing arbitrary types with the null literal.
2685
2686 2005-03-13  Martin Baulig  <martin@ximian.com>
2687
2688         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2689         boolean operators '&&', '||', '&' and '|'.
2690         (Nullable.OperatorTrueOrFalse): New public class.
2691
2692         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2693         instead of a `StaticCallExpr'; added support for nullables.
2694
2695 2005-03-10  Martin Baulig  <martin@ximian.com>
2696
2697         * expression.cs
2698         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2699         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2700
2701 2005-03-07  Martin Baulig  <martin@ximian.com>
2702
2703         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2704         it work if `expr' is not an IMemoryLocation.
2705         (Nullable.Lifted): Implement IMemoryLocation.
2706         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2707         target type.
2708
2709 2005-03-05  Martin Baulig  <martin@ximian.com>
2710
2711         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2712         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2713         (Nullable): Added support for lifted unary and binary operators.
2714
2715         * expression.cs (Unary.DoResolve): Added support for nullable types.
2716         (Binary.DoResolve): Likewise.
2717         (Conditional.DoResolve): Likewise.
2718
2719 2005-03-02  Martin Baulig  <martin@ximian.com>
2720
2721         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2722
2723         * class.cs (ClassPart.SetParameterInfo): Override this.
2724         (PartialContainer.SetParameterInfo): Override this.
2725         (TypeContainer.CheckConstraints): New protected method.
2726         (PartialContainer.CheckConstraints): Override this and check
2727         whether the same contraints were specified in all parts of a
2728         partial generic type definition.
2729         (PartialContainer.UpdateConstraints): New public method.
2730
2731         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2732
2733 2005-03-02  Martin Baulig  <martin@ximian.com>
2734
2735         Committing a patch from Carlos Alberto Cortez to fix #72887.
2736
2737         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2738         casts from `T []' to `int []'.
2739
2740 2005-03-02  Martin Baulig  <martin@ximian.com>
2741
2742         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2743
2744         * expression.cs (Binary.ResolveOperator): When resolving a
2745         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2746         `=='.  Fixes #71866.  See gen-127.cs.
2747
2748 2005-03-02  Martin Baulig  <martin@ximian.com>
2749
2750         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2751         static constructor in static classes.
2752
2753 2005-03-02  Martin Baulig  <martin@ximian.com>
2754
2755         * generic.cs
2756         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2757         (Nullable.LiftedConversion): Added support for user-defined
2758         conversions.
2759
2760         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2761
2762         * cs-parser.jay: Use ComposedCast everywhere instead of
2763         NullableType, so we don't need to check for NullableType
2764         everywhere.
2765         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2766         case where we'll be resolved into a `parenthesized_expression_0'
2767         afterwards.
2768
2769         * convert.cs
2770         (Convert.UserDefinedConversion): Added nullable conversions.
2771
2772 2005-02-28  Martin Baulig  <martin@ximian.com>
2773
2774         * generic.cs (TypeManager.IsNullableType): New static method.
2775         (Nullable): New abstract class.
2776         (Nullable.NullLiteral): New public class.
2777         (Nullable.LiftedConversion): New public class.
2778
2779         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2780         `builtin_types opt_nullable'.
2781
2782         * convert.cs
2783         (Convert.ImplicitConversionStandard): Added nullable conversions.
2784         (Convert.ExplicitConversionStandard): Likewise.
2785         (Convert.ExplicitConversion): Likewise.
2786
2787 2005-02-26  Martin Baulig  <martin@ximian.com>
2788
2789         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2790         begin with a "?", for instance "?[]".  Don't do a type lookup if
2791         `dim' is empty.
2792
2793 2005-02-25  Martin Baulig  <martin@ximian.com>
2794
2795         The first part of Nullable Types :-)
2796
2797         * generic.cs (NullableType): New public class.
2798         (NullCoalescingOperator): New public class.
2799         (TypeArguments.Resolve): Add a CS0306 check.
2800
2801         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2802         (opt_nullable): New rule.
2803         (type): Added `opt_nullable' to `namespace_or_type_name',
2804         `builtin_types' and `pointer_type'.
2805         (array_type): Added `opt_nullable'.
2806         (opt_rank_specifier_or_nullable): New rule; this is the
2807         combination of `opt_rank_specifier' and `opt_nullable'.
2808         (opt_error): New rule; catch errors here.
2809         (nullable_type_or_conditional): New rule; we use this to check for
2810         nullable and still detect the conditional operator.
2811         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2812         instead `opt_rank_specifier'.
2813
2814         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2815         for nullables.
2816
2817 2005-02-24  Martin Baulig  <martin@ximian.com>
2818
2819         * README, README.Changes: Removed; they're old and obsolete.
2820
2821 2005-02-22  Martin Baulig  <martin@ximian.com>
2822
2823         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2824         returned an error, set `constraints' to null to avoid a crash
2825         later on.
2826         (TypeParameter.ResolveType): Likewise.
2827
2828 2005-02-22  Martin Baulig  <martin@ximian.com>
2829
2830         * generic.cs
2831         (Constraints.ResolveTypes): Protect against being called twice.
2832         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2833         (TypeParameter.ResolveType): New public method; calls
2834         constraints.ResolveTypes().
2835         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2836         into the new ResolveType().
2837         (GenericMethod.Define): Call ResolveType() on all our
2838         TypeParameter's.        
2839
2840 2005-02-21  Martin Baulig  <martin@ximian.com>
2841
2842         * generic.cs
2843         (TypeManager.generic_nullable_type): New static public field.
2844         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2845
2846         * rootcontext.cs
2847         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2848
2849 2005-02-15  Martin Baulig  <martin@ximian.com>
2850
2851         * generic.cs (ConstructedType.Constraints): Correctly check
2852         constraints if the argument type is a type parameter; fixes
2853         #72326. 
2854
2855 2005-02-02  Martin Baulig  <martin@ximian.com>
2856
2857         * delegate.cs (Delegate.DefineType): Report an internal error if
2858         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2859         details.        
2860
2861 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2862
2863         * pending.cs: Produce better code (no nops produced by using Ldarg
2864         + value).
2865         
2866         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2867         i - 1' it should be arg + 1.
2868
2869         Fixes bug #71819.
2870         
2871 2005-01-26  Martin Baulig  <martin@ximian.com>
2872
2873         * cs-parser.jay (indexer_declarator): Don't report an error if we
2874         have type parameters since we can be an explicit interface
2875         implementation; fixes #71449.
2876
2877 2005-01-26  Martin Baulig  <martin@ximian.com>
2878
2879         * class.cs (TypeContainer.AttributeTargets): Return the correct
2880         AttributeTargets depending on our `Kind' instead of throwing an
2881         exception; fixes #71632.
2882
2883 2005-01-26  Martin Baulig  <martin@ximian.com>
2884
2885         * delegate.cs (Delegate.DefineType): Correctly define our type
2886         parameters.  Fixes #71483.
2887
2888 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2889
2890         Fix #71602.
2891         * expression.cs (MemberAccess.DoResolve): Don't complain with
2892         cs0572 when the LHS of a member access has identical name and type
2893         name.
2894
2895 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2896
2897         Fix #71651, #71675
2898         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2899         CreatePermission.
2900         Create custom PermissionSet only for PermissionSetAttribute.
2901
2902 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2903
2904         Fix #71649
2905         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2906         delegates in static class.
2907
2908 2005-01-24  Martin Baulig  <martin@ximian.com>
2909
2910         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2911         merging an implicit block, just use its reachability.
2912
2913         * statement.cs (Block.Resolve): Make the unreachable code check
2914         work wrt. implicit blocks; see test-337 from #63842.
2915
2916 2005-01-21  Alp Toker  <alp@atoker.com>
2917  
2918         * cs-parser.jay: destructor_declaration's container is PartialContainer
2919         not Class when partial types are used, so use Kind prop instead of
2920         'is'.
2921         
2922 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2923
2924         * cs-parser.jay: Improve error reporting when an interface
2925         declares new types.
2926
2927 2005-01-20  Dick Porter  <dick@ximian.com>
2928
2929         * support.cs: SeekableStreamReader fix from Sandor Dobos
2930         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2931         chars are read.  Fixes bug 70369.
2932
2933 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2934
2935         * cs-parser.jay (catch_clause): Simplify current_block handling
2936         somewhat.
2937
2938 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2939
2940         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2941         code with ImplicitStandardConversion to handle the implicit
2942         conversion of method groups into valid delegate invocations. 
2943
2944         The problem is that in parameter handling we were using this code
2945         path.  Fixes bug #64698
2946
2947 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2948
2949         * cs-parser.jay: Fix several infelicities.
2950         - Avoid assigning to the parser value stack.  Code like 
2951           '$3 = null' is unclean.  Synthesize a value for the code block
2952           instead. 
2953         - Avoid using oob_stack for storing location information.  Use ...
2954         (_mark_): ... this.  New (empty) rule.  Saves the current location
2955         in $$.
2956         (foreach_statement): Avoid using oob_stack for current_block
2957         handling.  Use technique used in for_statement and
2958         using_statement.  Synthesize a value for the code block to store
2959         additional intermediate information.
2960
2961 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2962
2963         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2964         of a different type is only allowed to private fields of a
2965         containing type, not on fields of a base class.
2966
2967         See test-174.cs and error cs0122-9.cs
2968
2969 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2970
2971         Fix test-335.cs (bug #58126).
2972         * cs-parser.jay (argument): Split out non-expression parts of the
2973         rule into 'non_simple_argument'.
2974         (invocation_expression): Support parenthesized invocations with
2975         multiple arguments, and with single non-simple arguments.
2976
2977 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2978
2979         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2980         places.
2981
2982 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2983
2984         Fix cs0038-1.cs, cs1640-6.cs.
2985         * ecore.cs (Expression.Resolve): Remove special-case for
2986         SimpleName in error-handling.
2987         (Expression.almostMatchedMembers): Relax access permission to
2988         protected.
2989         (Expression.MemberLookupFailed): Handle duplicates in
2990         almostMatchedMembers list.
2991         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2992         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2993         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2994         overload if the passed in MemberInfo is a MethodBase.
2995
2996 2005-01-25  Martin Baulig  <martin@ximian.com>
2997
2998         * doc.cs
2999         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3000
3001 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3002
3003         Fix #70749
3004         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3005         for non-CAS & merge permission sets properly.
3006
3007 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3008
3009         Improve standard-compliance of simple name and member access 
3010         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3011         * ecore.cs (FullNamedExpression): New abstract base class 
3012         for Namespaces and TypeExpressions.
3013         (ResolveFlags.SimpleName): Remove.
3014         (SimpleName): Remove support for dotted names.
3015         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3016         DeclSpace.FindType and DeclSpace.LookupType.
3017         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3018         (Expression.ExprClassName): Make member function.
3019         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3020         a namespace.  Remove creation of dotted "SimpleName"s.
3021         (MemberAccess.DoResolve): Likewise.
3022         * decl.cs (DeclSpace.Cache): Make private.
3023         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3024         (DeclSpace.FindType): Update.
3025         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3026         FullNamedExpression.
3027         * namespace.cs (Namespace): Derive from FullNamedExpression
3028         so that it can be part of expression resolution.
3029         (Namespace.Lookup): Return an FullNamedExpression.
3030         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3031         namespace.
3032         * rootcontext.cs (NamespaceLookup): Remove.
3033         (LookupType): Move to DeclSpace.
3034         * attribute.cs (CheckAttributeType): Update.
3035         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3036         (FindDocumentedTypeNonArray): Likewise.
3037
3038 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3039
3040         Fix cs0509.cs, cs1632.cs.
3041         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3042         is the same as IsInterface.
3043         (TypeContainer.GetClassBases): Likewise.
3044         * statement.cs (LabeledStatement.ig): New field.
3045         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3046         label.
3047         (LabeledStatement.DoEmit): Check that the label was created with
3048         the same ILGenerator.
3049
3050 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3051
3052         Fix #71058
3053         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3054         accessors to its properties.
3055
3056         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3057         from accessors to property.
3058         
3059 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3060
3061         Fix #70722
3062         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3063         only for overrides.
3064         
3065 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3066
3067         * attribute.cs: Check for null and empty strings.  
3068
3069         I have lost another battle to Paolo.
3070
3071 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3072
3073         Fix #70942
3074         * class.cs (PropertyMethod): Set Parent field in ctors.
3075         (SetMethod.InternalParameters): Add unsafe switch hack.
3076         Override MarkForDuplicationCheck where it is appropriate.
3077
3078         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3079         It says whether container allows members with the same name.
3080         Base default is no.
3081         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3082         Removed is_method parameter.
3083
3084 2005-01-06  Duncan Mak  <duncan@ximian.com>
3085
3086         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3087         because the previous change led to incorrect reporting of CS1032
3088         ("Cannot define/undefine preprocessor symbols after first token in
3089         file"). Instead of using `tokens_seen' as the only flag that
3090         triggers CS1040, introduce `comments_seen'. This new flag is used
3091         to signify having seen comments on the current line, so it is
3092         unset after a newline.
3093
3094 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3095
3096         * doc.cs : When searching for a type, find nested type too.
3097           This fixes bug #71040.
3098
3099 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3100
3101         * doc.cs :
3102           - Warn missing member comment on those classes which also does not
3103             have doc comments. Fixed bug #71041.
3104           - Don't warn missing doc comment on default constructor.
3105             Fixed bug #71042.
3106
3107 2005-01-06  Duncan Mak  <duncan@ximian.com>
3108
3109         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3110         comments, set `tokens_seen' to true. This allows us to detect
3111         misplaced preprocessor directives (i.e. not at the beginning of
3112         the a line, nor after whitespaces). In that case, report error
3113         CS1040. This fixes bug #56460.
3114
3115         * cs-parser.jay (interface_member_declaration): Add checks for
3116         IsExplicitImpl, and report CS0541 error if an interface member is
3117         defined as an explicit interface declaration.
3118
3119 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3120
3121         Fix #70817
3122         * class.cs (PropertyMethod): Set Parent field in ctors.
3123         (SetMethod.InternalParameters): Add unsafe switch hack.
3124         
3125         * decl.cs (MemberCore.Parent): Cannot be readonly.
3126
3127 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3128
3129         * decl.cs (DeclSpace.ResolveType): Remove.
3130         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3131         Merge in code from ...
3132         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3133         * class.cs, enum.cs: Update to changes.
3134
3135 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3136
3137         * anonymous.cs: Ensure that we init the scope of our parent if it
3138         has not been initialized yet.
3139
3140 2004-12-30  Duncan Mak  <duncan@ximian.com>
3141
3142         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3143         if field.FieldBuilder is null. Fixes #70758.
3144
3145         * convert.cs: Fixed some typos and updated some of the comments.
3146         (ImplicitStandardConversionExists):
3147         (TryImplicitIntConversion): If `target_type' is an interface and
3148         the type of `ic' implements this interface, return true or a new
3149         BoxedCast instead of null. This fixes #70468.
3150
3151 2004-12-29  Duncan Mak  <duncan@ximian.com>
3152
3153         * expression.cs (Argument.Emit): Check that Expr is
3154         IMemoryLocation before casting to it, and report CS1510 otherwise.
3155
3156         This fixes #70402.
3157
3158 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3159
3160         * statement.cs (Block.ThisVariable): remove the recursion here, to
3161         make the --profile more sane.
3162
3163 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3164
3165         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3166         assembly, by JB Evain.
3167
3168 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3169
3170         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3171           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3172         "parent" refers to enclosing type/class.  "base" refers to superclass.
3173
3174 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3175
3176         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3177         Ensure that we only have GlobalAttributes.
3178         * attribute.cs (Attribute.Emit): Make non-virtual.
3179         (GlobalAttribute.Emit): Remove.
3180         (Attribute.Resolve): Make virtual.
3181         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3182         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3183         the argument. Don't create one.
3184         (Attribute.GetObsoleteAttribute): Likewise.
3185         (Attribute.GetClsCompliantAttributeValue): Likewise.
3186         * class.cs, decl.cs: Update to changes.
3187
3188 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3189
3190         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3191         
3192         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3193         
3194         * statement.cs (Foreach.Resolve): Add error 186 report.
3195
3196 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3197
3198         * expression.cs (Conditional.DoResolve): Add warning 429.
3199         
3200         * statement.cs (If.Resolve): Add warning 665.
3201
3202 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3203
3204         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3205         except when in the parser, and in GlobalAttribute.
3206         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3207         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3208         RootContext.Tree.Types.NamespaceEntry once work is done.
3209         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3210         and resets RootContext.Tree.Types.NamespaceEntry.
3211
3212 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * cs-parser.jay: Don't create a block for every variable.
3215
3216 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3217
3218         * location.cs: Provide extra information.
3219
3220         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3221         variables from the captured environment, it is the ldarg_0.
3222
3223 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3224
3225         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3226         find a conclusion.
3227         
3228         * class.cs: Changed warning level for 169 to avoid developer
3229         displeasure from warning flooding. It will be changed back when they
3230         fix most of current BCL warnings.
3231         
3232         * RootContext.cs: Pushed default WarningLevel to 3.
3233         
3234         * statement.cs: Removed unused variable.
3235
3236 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3237
3238         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3239         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3240         Add error 502 report.
3241         (StaticClass.DefineType): Add error 441 report.
3242         (Class.AllowedModifiersProp): New virtual property as temporary
3243         extension to AllowedModifiers.
3244         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3245         to share implementation with StaticClass and don't call virtual
3246         methods from ctor.
3247         
3248         * driver.cs (MainDriver): Add error 1558 test.
3249
3250         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3251         report. Moved error 36 test here.
3252
3253         * statement.cs (Throw.Resolve): Add error 724 report.
3254
3255         * typemanager.cs: Add out_attribute_type core type.
3256         
3257 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3258
3259         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3260         3018 report.
3261         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3262
3263         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3264         3017 report.
3265         
3266         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3267
3268         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3269         Add error 3023 report.
3270         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3271
3272         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3273         implementation.
3274
3275 2004-12-12  John Luke  <john.luke@gmail.com>
3276
3277         * driver.cs (AddArgs): take -- into account when
3278         adding arguments, fixes bug 65710 
3279
3280 2004-12-12  Martin Baulig  <martin@ximian.com>
3281
3282         * expression.cs (Unary.TryReduceNegative): Added support for
3283         SByteConstant and ByteConstant.
3284         (Unary.Reduce): Check error values from TryReduceNegative().
3285
3286 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3287
3288         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3289         and report exception as error 182.
3290
3291 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3292
3293         * driver.cs (Main): Fix message when there are warnings.
3294
3295 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3296
3297         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3298
3299 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3300
3301         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3302         Reduced number of warnings.
3303         
3304         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3305
3306 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3307
3308         * driver.cs: Removed message.
3309
3310         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3311
3312 2004-12-08    <vargaz@freemail.hu>
3313
3314         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3315
3316 2004-12-08  Martin Baulig  <martin@ximian.com>
3317
3318         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3319         instead of a CS3002 for properties and indexer.
3320
3321 2004-12-08  Martin Baulig  <martin@ximian.com>
3322
3323         * decl.cs (MemberName.ToString): Make this work again.
3324
3325 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3326
3327         * attribute.cs (Resolve): Add error 591 detection.
3328
3329         * class.cs (FieldMember.Define): Add error 1547 detection.
3330         (Indexer.Define): Add error 620 detection.
3331         (Operator.Define): Add error 590 detection.
3332
3333         * ecore.cs: Missing argument for error 79.
3334
3335         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3336         detection.
3337
3338 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3339
3340         Fix #70106
3341         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3342         only.
3343
3344 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3345
3346         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3347           Some operator comments were suppressed.
3348         * doc.cs : Implicit/explicit operator name in doc comments are like
3349           "op_Explicit(type)~returnType", so added suffix handling.
3350
3351 2005-01-21  Alp Toker  <alp@atoker.com>
3352
3353         * cs-parser.jay: destructor_declaration's container is PartialContainer
3354         not Class when partial types are used, so use Kind prop instead of 'is'.
3355
3356 2004-12-12  Martin Baulig  <martin@ximian.com>
3357
3358         * expression.cs (Unary.TryReduceNegative): Added support for
3359         SByteConstant and ByteConstant.
3360         (Unary.Reduce): Check error values from TryReduceNegative().
3361
3362 2004-12-11  Martin Baulig  <martin@ximian.com>
3363
3364         * support.cs (ReflectionParameters.ParameterName): If we have a
3365         `gpd', call `ParameterName' on it.
3366
3367         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3368
3369         * pending.cs (PendingImplementation.DefineProxy): Call
3370         DefineParameter() for all of the MethodBuilder's arguments.
3371
3372 2004-12-09  Martin Baulig  <martin@ximian.com>
3373
3374         * doc.cs (DocUtil): Make this a static class.
3375
3376 2004-12-09  Martin Baulig  <martin@ximian.com>
3377
3378         * expression.cs (Invocation.InferType): Moved the type inference
3379         implementation into TypeManager.
3380
3381         * generics.cs (TypeManager): Moved the type inference
3382         implementation here.
3383
3384 2004-12-09  Martin Baulig  <martin@ximian.com>
3385
3386         * typemanager.cs (TypeManager): Make this a partial class.
3387
3388         * generics.cs
3389         (TypeManager): Move the generics part of `TypeManager' here.
3390
3391 2004-12-08  Martin Baulig  <martin@ximian.com>
3392
3393         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3394         instead of a CS3002 for properties and indexer.  Added CS3024
3395         check for generic interfaces.
3396
3397         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3398         instances are not CLS-compliant.
3399
3400 2004-12-08  Martin Baulig  <martin@ximian.com>
3401
3402         * cs-parser.jay
3403         (void_pointer_expression): New rule for `void*', `void**' etc.
3404         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3405
3406 2004-12-08  Martin Baulig  <martin@ximian.com>
3407
3408         * expression.cs (Invocation.InferType): Removed the hack for
3409         MethodCore.MayUnify().  
3410
3411         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3412         this actually work.
3413
3414         * class.cs (MethodCore.MayUnify): Use
3415         TypeManager.MayBecomeEqualGenericTypes().       
3416
3417 2004-12-08  Martin Baulig  <martin@ximian.com>
3418
3419         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3420         parameter, box it.  Fixes #69233.
3421
3422 2004-12-08  Martin Baulig  <martin@ximian.com>
3423
3424         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3425         have the ctor constraint.  Fixes #68326.
3426
3427 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3428
3429         * cs-parser.jay : interface comment was not consumed because of
3430           extra opt_semicolon before doc handling.
3431
3432 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3433
3434         Fix test-327.cs, test-328.cs, and put in early infrastructure
3435         for eventually fixing #52697.
3436         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3437         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3438         from other methods.
3439         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3440         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3441         (VerifyUsing, error246): Update.
3442         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3443         'NamespaceEntry.LookupNamespaceOrType'.
3444
3445 2004-12-07  Martin Baulig  <martin@ximian.com>
3446
3447         * driver.cs: Call it "BETA SOFTWARE" :-)
3448
3449 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3450
3451         Fix crash on cs0657-17.cs.
3452         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3453         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3454         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3455         the case where the NamespaceEntry gets overwritten.
3456
3457 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3458
3459         Fixed #69195, #56821
3460         * ecore.cs (ResolveBoolean): Tiny refactoring.
3461
3462         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3463         of right expression resolving when left is false constant and
3464         operator is LogicalAnd OR true constant and operator is LogicalOr.
3465
3466         * statement.cs (ResolveUnreachable): Always reports warning.
3467
3468 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3469
3470         * class.cs: Distinguish between 1721 and 1722 (just a little help
3471         for the programmer).
3472
3473 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3474
3475         * delegate.cs: Only allow this on new versions of the language. 
3476
3477 2004-12-02  Duncan Mak  <duncan@ximian.com>
3478
3479         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3480         Expression class.
3481         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3482         here as a static method. Take an additional bool out parameter
3483         `must_do_cs1540_check' for signaling to InstanceResolve.
3484         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3485         member field from PropertyExpr class and made it an argument of
3486         the method instead.
3487         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3488         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3489         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3490         and `remove_accessor' as well as InstanceResolve: report CS0122
3491         where applicable.
3492
3493         Fixes #70129.
3494
3495 2004-12-07  Martin Baulig  <martin@ximian.com>
3496
3497         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3498         and CS0692 where appropriate.
3499
3500 2004-12-06  Martin Baulig  <martin@ximian.com>
3501
3502         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3503         IsDuplicateImplementation() and improved it.
3504
3505         * expression.cs (Invocation.InferTypeArguments): Added
3506         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3507         and removed the "ref" modifier from `infered_types'.
3508
3509         * decl.cs (MemberName.ToString): Removed the exception.
3510
3511 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3512
3513         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3514           comments are allowed.
3515
3516 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3517
3518         * delegate.cs: Add checks for subtypes in paramaters and return values
3519         in VerifyMethod () to add support for Covariance/Contravariance
3520         in delegates.
3521         
3522 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3523
3524         * report.cs: Remove extra closing parenthesis.
3525
3526         * convert.cs (Error_CannotImplicitConversion): If the name of the
3527         types are the same, provide some extra information.
3528
3529 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3530
3531         Fix bug #70102
3532         * attribute.cs (Resolve): Improved implementation of params
3533         attribute arguments.
3534
3535         * support.cs (ParameterData): Add HasParams to be faster.
3536
3537 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3538
3539         all things are for /doc support:
3540
3541         * doc.cs: new file that supports XML documentation generation.
3542         * mcs.exe.sources: added doc.cs.
3543         * driver.cs:
3544           Handle /doc command line option.
3545           Report error 2006 instead of 5 for missing file name for /doc.
3546           Generate XML documentation when required, after type resolution.
3547         * cs-tokenizer.cs:
3548           Added support for picking up documentation (/// and /** ... */),
3549           including a new XmlCommentState enumeration.
3550         * cs-parser.jay:
3551           Added lines to fill Documentation element for field, constant,
3552           property, indexer, method, constructor, destructor, operator, event
3553           and class, struct, interface, delegate, enum.
3554           Added lines to warn incorrect comment.
3555         * rootcontext.cs :
3556           Added Documentation field (passed only when /doc was specified).
3557         * decl.cs:
3558           Added DocComment, DocCommentHeader, GenerateDocComment() and
3559           OnGenerateDocComment() and some supporting private members for
3560           /doc feature to MemberCore.
3561         * class.cs:
3562           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3563         * delegate.cs:
3564           Added overriden DocCommentHeader.
3565         * enum.cs:
3566           Added overriden DocCommentHeader and GenerateDocComment().
3567
3568 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3569
3570         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3571         unwrapping the enumeration values, chain to
3572         DoConstantNumericPromotions again, so we can promote things to the
3573         fundamental types (takes care of enums that are bytes, sbytes).
3574
3575         Fixes bug #62054.
3576
3577 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3578
3579         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3580         Fix long-standing bug in type-lookup.  Use FindType instead of
3581         LookupType when ec.ResolvingTypeTree.
3582         (Attribute.ResolveType, Attribute.Resolve)
3583         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3584         Update to changes.
3585         (Attributes.Search): Remove internal version.  Update.
3586         (Attributes.SearchMulti): Update.
3587         (Attributes.GetClsCompliantAttribute): Remove.
3588         (Attributes.GetIndexerNameAttribute): Remove.
3589         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3590         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3591         * class.cs (Indexer.Define): Likewise.
3592
3593 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3594
3595         Fix bug #68790
3596         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3597         MarshallByReference members access.
3598
3599         * expression.cs: Use CheckMarshallByRefAccess;
3600         Better error CS0197 message.
3601
3602         * report.cs: Print whole related error message.
3603
3604 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3605
3606         * class (GetClassBases): Better error 60 report.
3607         (EventProperty): Disabled warning 67 detection.
3608
3609 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3610
3611         Fix bug #60324
3612         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3613
3614         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3615         precise values.
3616
3617 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3618
3619         Fix bug #49488
3620         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3621
3622         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3623
3624 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3625
3626         * attribute.cs (Attribute.Resolve): Refine error reporting and
3627         report a cs0117 if the identifier does not exist, to distinguish
3628         from 0617 which is a miss-use of the actual identifier.
3629
3630         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3631         between cs0070 and cs0079.
3632
3633         * class.cs (MemberBase.DoDefine): When reporting a wrong
3634         accessibility level, we use MethodCore to compare instead of
3635         Method (this was a regression in some refactoring effort).
3636
3637         So now we correctly report cs0056 again.
3638
3639         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3640         testing the target_type (which was known to be object_type) and
3641         not the source type (which is anonymous_method).
3642
3643         Fixed reporting of error cs1660.
3644
3645         * expression.cs (UserCast.Source): Expose the underlying cast.
3646
3647         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3648         allowed types to find a match to int32 first (most common).
3649
3650         In addition, it ignores any ImplicitUserConversions that did an
3651         internal implicit conversion (as the switch statement allows only
3652         one integral conversion to exist).
3653
3654         * class.cs (PartialContainer.Create): rename `name' to
3655         `member_name' for clarity.  Then replace the string calls with a
3656         call to MemberName.GetPartialName, as now using
3657         MemberName.ToString is an error (this is due to the side effects
3658         it had, that were fixed in the past).
3659
3660         This will restore the error reporting on a number of partial class
3661         errors that were missusing this (and getting an exception as a
3662         results, which is now just a plain textual warning, because
3663         yyparse debug output would crash otherwise).
3664
3665 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3666
3667         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3668
3669 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3670
3671         * rootcontext.cs (LookupType): Make sure to cache lookups that
3672         don't give us a negative result. This saves about 5% of corlib
3673         compilation time.
3674
3675 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3676
3677         * report.cs (AbstractMessage.Print): messages are sent to stderr
3678
3679         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3680         non-interface in the list of interfaces (at this point, either
3681         parent was properly set, or a base class is being listed in the
3682         interfaces section).
3683
3684         This flags error 1722, and resolves the crash from bug 69259.
3685
3686 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3687
3688         * statement.cs (Using.EmitExpressionFinally): make this work right
3689         for valuetypes. Fixes 69926.
3690
3691 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3692
3693         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3694         converted to an enum" here, before we try to change the underlying
3695         type.  This code exists, but it is a different code path than the
3696         one used while encoding constants.
3697
3698         (ImplicitReferenceConversionExists): In addition, resynchronized
3699         the code here, so it matches the same code in
3700         ImplicitReferenceConversionExists for the `from any class-type S
3701         to any interface-type T'.       
3702
3703 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3704
3705         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3706
3707 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3708
3709         * cs-parser.jay: Use verbosity accordingly. 
3710
3711 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3712
3713         * expression.cs (Unary.ResolveOperator): Do not report warning;
3714         AddressOf reads from variable.
3715         
3716         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3717
3718 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3719
3720         Fix bug #69462
3721
3722         * attribute.cs (Attributable): Removed CheckTargets.
3723         (Attributes.Emit): Explicit attribute targets are tested here.
3724
3725         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3726         not enabled for interfaces.
3727
3728         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3729         (GetAssemblyName): Ouch next bug there.
3730
3731 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3732
3733         * expression.cs: Error 275 added.
3734         
3735 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3736
3737         Fix bug #69177 (Implemented decimal constant support)
3738
3739         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3740         (BinaryFold): Add DecimalConstant.
3741
3742         * const.cs (Define): Decimal constant 
3743         (is not constant.
3744         (ChangeType): Add decimal type handling.
3745         (LookupConstantValue): Don't set value for decimal type but
3746         emit DecimalConstantAttribute. Needed for constant optimization.
3747
3748         * constant.cs (ToDecimal): New method.
3749         (ConvertToDecimal): New method.
3750         (IntConstant): Implemented ConvertToDecimal.
3751         (DecimalConstant.Emit): Emit optimized version for decimals in
3752         int range.
3753
3754         * expression.cs (ResolveOperator): Changed order of constant
3755         reduction to work correctly with native types which have
3756         overloaded operators.
3757         (ResolveMemberAccess): Extract constant value from attribute
3758         for decimal type.
3759
3760         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3761
3762         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3763         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3764         (ChangeType): Decimal is special.
3765         (TypeToCoreType): Add decimal type.
3766
3767 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3768
3769         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3770         decimal types.
3771
3772 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3773
3774         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3775         test cs1667-5.cs.
3776
3777 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3778
3779         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3780
3781         * pending.cs (PendingImplementation): Grab only interfaces.
3782
3783 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3784
3785         * statement.cs (ForeachHelperMethods): Add location member and
3786         error 202 detection.
3787
3788 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * expression.cs (DoResolveBase): Fixed wrong warning for out
3791         variables.
3792
3793 2004-12-04  Martin Baulig  <martin@ximian.com>
3794
3795         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3796         to check whether the conversion is ok.
3797
3798         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3799         `Type.EmptyTypes' if we're not a generic TypeContainer.
3800
3801 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3802
3803         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3804         old bug: when converting from the null literal to a pointer,
3805         return an EmptyCast, not the NullLiteral.
3806
3807         This fixes #69921, the recent null_type changes probably made this
3808         bug more prominent.
3809
3810 2004-12-03  Martin Baulig  <martin@ximian.com>
3811
3812         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3813         method as our child, call AnonymousMethod.Compatible() on it.
3814
3815 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3816
3817         * class.cs (FieldBase): Use an unused bit field from the field to
3818         encode the `has_offset' property from the FieldMember.  This saves
3819         a couple of Ks on bootstrap compilation.
3820
3821         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3822         method as our child, return the AnonymousMethod resolved
3823         expression.
3824
3825         * expression.cs (New.DoResolve): Allow return values from
3826         NewDelegate to also include AnonymousMethods.
3827
3828         Fixes #70150.
3829
3830 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3831
3832         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3833         cs1648 report.
3834         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3835         System.Runtime.InteropServices._Exception, since it's a base
3836         interface of the core type System.Exception in the net_2_0 profile.
3837
3838 2004-11-27  Martin Baulig  <martin@ximian.com>
3839
3840         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3841
3842 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3843
3844         * Makefile: Convert to use executable.make.
3845         * gmcs.exe.sources: New.
3846
3847 2004-11-25  Martin Baulig  <martin@ximian.com>
3848
3849         * expression.cs (Invocation.InferType): Added support for byref types.
3850
3851 2004-11-25  Martin Baulig  <martin@ximian.com>
3852
3853         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3854         in TypeManager.TypeToCoreType().
3855
3856 2004-11-25  Martin Baulig  <martin@ximian.com>
3857
3858         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3859         "Dispose" method from the `current_type'.
3860         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3861         DoDefineMembers() instead of using the MethodBuilder; this is
3862         required for generic iterators.
3863
3864         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3865
3866 2004-11-24  Martin Baulig  <martin@ximian.com>
3867
3868         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3869
3870 2004-11-20  Martin Baulig  <martin@ximian.com>
3871
3872         * expression.cs (Invocation.InferType): Correctly infer generic
3873         instances; see gen-103.cs.
3874         (Invocation.InferTypeArguments): If a generic method doesn't have
3875         any unbound type parameters, we don't need to infer anything.
3876
3877 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3878
3879         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3880
3881 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3882
3883         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3884         (TypeHandle.GetMemberCache): New.
3885         (TypeHandle.TypeHandle): Update.
3886         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3887         (TypeManager.LookupParentInterfacesCache):
3888         Rename from LookupInterfaceCache.  Optimize slightly.
3889         (TypeManager.MemberLookup_FindMembers): Update.
3890         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3891         multi-type variant.
3892         (AddCacheContents): Rename from AddHashtable.
3893         * class.cs (TypeContainer.parent_container): Remove.
3894         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3895         (TypeContainer.DoDefineMembers): Don't initialize it.
3896         Update to name changes.
3897         
3898 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3899
3900         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3901         that factors the code to check access modifiers on override.  
3902
3903         (PropertyBase): Use the code here.
3904
3905         Patch from Lluis S'anchez, fixes bug #69361.
3906
3907 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3908
3909         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3910         routine that is used to report the use of a captured variable
3911         whose address has been taken.
3912
3913         There are two checks: one when variables are being captured and
3914         the other check is when the address of a variable is taken. 
3915         
3916         (because an anonymous methods might be resolved before *or* after
3917         the address has been taken) and 
3918
3919         * expression.cs (Conditional.DoResolve): Remove the special
3920         casing that Martin added to trueExpr and falseExpr being both
3921         NullLiteral.  We get the right behavior now just by introducing
3922         the null_type into the compiler. 
3923
3924         * convert.cs (ExplicitConversion): Change the code to use
3925         null_type instead of testing `expr is NullLiteral'.
3926         (ImplicitConversionStandard): use null_type too.
3927         (ImplicitReferenceConversionExists): use null_type too.
3928         (ImplicitReferenceConversion): use null_type too.
3929
3930         * literal.cs: The type of `NullLiteral' is now null_type instead
3931         of object_type. 
3932         (Resolve): Set the type here.
3933
3934         * typemanager.cs: Introduce null_type.
3935
3936 2004-11-18  Martin Baulig  <martin@ximian.com>
3937
3938         * rootcontext.cs
3939         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3940
3941 2004-11-18  Martin Baulig  <martin@ximian.com>
3942
3943         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3944
3945 2004-11-18  Martin Baulig  <martin@ximian.com>
3946
3947         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3948         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3949         call ResolveConstructedType() on it to resolve it without checking
3950         constraints.
3951         (Constraints.ResolveTypes): Check them here.
3952         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3953         but don't check constraints.
3954         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3955         check constraints here.
3956         (ConstructedType.ResolveConstructedType): New public method.  This
3957         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3958         resolve ourselves without checking constraints.
3959
3960         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3961
3962 2004-11-18  Martin Baulig  <martin@ximian.com>
3963
3964         * decl.cs
3965         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3966
3967         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3968
3969 2004-11-18  Martin Baulig  <martin@ximian.com>
3970
3971         * ecore.cs (TypeExpr.ResolveType): Removed.
3972         (Expression.ResolveAsTypeTerminal): We always return a fully
3973         resolved `TypeExpr', so we can just access its `Type'.
3974
3975         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3976
3977 2004-11-17  Martin Baulig  <martin@ximian.com>
3978
3979         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3980         sure we don't return any unresolved TypeExpr's.
3981         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3982         a `TypeExpr'.
3983         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3984
3985         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3986         unresolved `ConstructedType's.
3987
3988 2004-11-17  Martin Baulig  <martin@ximian.com>
3989
3990         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3991
3992 2004-11-17  Martin Baulig  <martin@ximian.com>
3993
3994         * ecore.cs
3995         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3996
3997         * decl.cs (DeclSpace.ResolveType): Removed.
3998         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3999
4000 2004-11-17  Martin Baulig  <martin@ximian.com>
4001
4002         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4003         direction, like FindMembers() does.  Fixes #69546, testcase is in
4004         test-315.cs.    
4005
4006 2004-11-16  Martin Baulig  <martin@ximian.com>
4007
4008         This is based on a patch from Marek Safar, see bug #69082.
4009         Fixes bugs #63705 and #67130.
4010
4011         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4012         method; create a MemberCache for an interface type and cache the
4013         result.
4014
4015         * decl.cs (IMemberContainer.ParentContainer): Removed.
4016         (IMemberContainer.ParentCache): New property.
4017         (MemberCache.SetupCacheForInterface): Removed.
4018         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4019         to create a cache for an interface's "parent".
4020
4021         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4022         interfaces too.
4023
4024 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4025
4026         * statement.cs: Avoid adding bools to a hashtable.
4027
4028 2004-11-15  Martin Baulig  <martin@ximian.com>
4029
4030         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4031
4032 2004-11-11  Martin Baulig  <martin@ximian.com>
4033
4034         * typemanager.cs (TypeManager.GetMethodName): New method.
4035
4036         * class.cs (MethodData.Define): Include the generic arity in the
4037         name of an explicit interface; also add it to the method name.
4038
4039         * pending.cs (PendingImplementation.InterfaceMethod): The method
4040         name now includes the generic arity.
4041
4042 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4043
4044         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4045         calling an unsafe method from a safe location.
4046
4047 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4048
4049         Fix #69167
4050         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4051
4052 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4053
4054         * namespace.cs (VerifyUsing): use GetPartialName instead of
4055         ToString. 
4056
4057 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4058
4059         * statement.cs (Return.Resolve): Fix regression in typo: if
4060         `in_exc', we have to request a NeedReturnLabel, this was a typo
4061         introduced in the anonymous method check-in.  Fixes #69131.
4062
4063         * Indexers were using the ShortName when defining themselves,
4064         causing a regression in the compiler bootstrap when applying the
4065         patch from 2004-11-02 (first part), now they use their full name
4066         and the bug is gone.
4067
4068 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4069
4070         * driver.cs: Strip the path from the names of embedded resources. Fixes
4071         #68519.
4072
4073 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4074
4075         Fix error message regression: cs0104-2.cs.
4076         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4077         (AliasEntry.Resolve): Update.
4078         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4079         'silent' flag.
4080         (RootContext.LookupType): Update.
4081
4082 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4083
4084         * cs-parser.jay: Add support for handling accessor modifiers
4085         * class: Add support port accessor modifiers and error checking,
4086         define PropertyMethod.Define as virtual (not abstract anymore)
4087         * ecore.cs: Add checking for proeprties access with access modifiers
4088         * iterators.cs: Modify Accessor constructor call based in the modified
4089         constructor
4090 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4091
4092         * expression.cs (StringConcat): Handle being called twice,
4093         as when we have a concat in a field init with more than two
4094         ctors in the class
4095
4096 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4097
4098         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4099         special case explicit implementations, we should always produce
4100         the .property or .event declaration.
4101         
4102         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4103         since it will not return correct data if people use this
4104         unresolved in the presence of using statements (see test-313).
4105
4106         * class.cs (MethodData.Define): If we are an explicit interface
4107         implementation, set the method name to the full name of the
4108         interface plus the name of the method.  
4109
4110         Notice that using the method.MethodName.GetFullName() does not
4111         work, as it will only contain the name as declared on the source
4112         file (it can be a shorthand in the presence of using statements)
4113         and not the fully qualifed type name, for example:
4114
4115         using System;
4116
4117         class D : ICloneable {
4118                 object ICloneable.Clone ()  {
4119                 }
4120         }
4121
4122         Would produce a method called `ICloneable.Clone' instead of
4123         `System.ICloneable.Clone'.
4124
4125         * namespace.cs (Alias.Resolve): Use GetPartialName.
4126         
4127 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4128
4129         * cs-parser.jay: Add error 1055 report.
4130
4131 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4132
4133         * assign.cs (Assign.DoResolve): Only do the transform of
4134         assignment into a New if the types are compatible, if not, fall
4135         through and let the implicit code deal with the errors and with
4136         the necessary conversions. 
4137
4138 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4139
4140         * cs-parser.jay: Add error 1031 report.
4141
4142         * cs-tokenizer.cs: Add location for error 1038.
4143
4144 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4145
4146         * cs-parser.jay: Add error 1016 report.
4147
4148 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4149
4150         * cs-parser.jay: Add errors 1575,1611 report.
4151
4152 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4153
4154         * cs-parser.jay: Add error 1001 report.
4155
4156 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4157
4158         Fix #68850
4159         * attribute.cs (GetMarshal): Add method argument for
4160         caller identification.
4161
4162         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4163         agument for GetMarshal and RuntimeMissingSupport.
4164
4165 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4166
4167         * attribute.cs (ExtractSecurityPermissionSet): Removed
4168         TypeManager.code_access_permission_type.
4169
4170         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4171
4172 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4173
4174         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4175         for obsolete use of a variable here.   Fixes regression on errors
4176         cs0619-25 and cs0619-26.
4177
4178 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4179
4180         Fix #62358, implemented security attribute encoding.
4181
4182         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4183         Tests permitted SecurityAction for assembly or other types.
4184         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4185         data from SecurityPermissionAttribute to PermisionSet class.
4186
4187         * class.cs (ApplyAttributeBuilder): Added special handling
4188         for System.Security.Permissions.SecurityAttribute based types.
4189
4190         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4191         special handling for System.Security.Permissions.SecurityAttribute
4192         based types.
4193
4194         * enum.cs (ApplyAttributeBuilder): Added special handling
4195         for System.Security.Permissions.SecurityAttribute based types.
4196
4197         * parameter.cs (ApplyAttributeBuilder): Added special handling
4198         for System.Security.Permissions.SecurityAttribute based types.
4199
4200         * rootcontext.cs: Next 2 core types.
4201
4202         * typemanager.cs (TypeManager.security_permission_attr_type):
4203         Built in type for the SecurityPermission Attribute.
4204         (code_access_permission_type): Build in type.
4205
4206 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4207
4208         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4209         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4210         all of this information into
4211         EmitContext.EmitCapturedVariableInstance.
4212         
4213         * codegen.cs (EmitCapturedVariableInstance): move here the
4214         funcionality of emitting an ldarg.0 in the presence of a
4215         remapping.   This centralizes the instance emit code.
4216
4217         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4218         then emit a load of this: it means that we have reached the
4219         topmost ScopeInfo: the one that contains the pointer to the
4220         instance of the class hosting the anonymous method.
4221
4222         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4223         captures to the topmost CaptureContext.
4224
4225 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4226
4227         * expression.cs (LocalVariableReference): Move the knowledge about
4228         the iterators into codegen's EmitCapturedVariableInstance.
4229
4230 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4231
4232         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4233         all code paths return a value from an anonymous method (it is the
4234         same as the 161 error, but for anonymous methods).
4235
4236 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4237
4238         The introduction of anonymous methods in the compiler changed
4239         various ways of doing things in the compiler.  The most
4240         significant one is the hard split between the resolution phase
4241         and the emission phases of the compiler.
4242
4243         For instance, routines that referenced local variables no
4244         longer can safely create temporary variables during the
4245         resolution phase: they must do so from the emission phase,
4246         since the variable might have been "captured", hence access to
4247         it can not be done with the local-variable operations from the runtime.
4248         
4249         * statement.cs 
4250
4251         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4252         is a toplevel block.
4253
4254         (ToplevelBlock): A new kind of Block, these are the blocks that
4255         are created by the parser for all toplevel method bodies.  These
4256         include methods, accessors and anonymous methods.
4257
4258         These contain some extra information not found in regular blocks:
4259         A pointer to an optional CaptureContext (for tracking captured
4260         local variables and parameters).  A pointer to the parent
4261         ToplevelBlock.
4262         
4263         (Return.Resolve): Catch missmatches when returning a value from an
4264         anonymous method (error 1662).
4265         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4266         phase.
4267
4268         (Break.Resolve): ditto.
4269
4270         (SwitchLabel): instead of defining the labels during the
4271         resolution phase, we now turned the public ILLabel and ILLabelCode
4272         labels into methods called GetILLabelCode() and GetILLabel() that
4273         only define the label during the Emit phase.
4274
4275         (GotoCase): Track the SwitchLabel instead of the computed label
4276         (its contained therein).  Emit the code by using
4277         SwitchLabel.GetILLabelCode ().
4278
4279         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4280         whether the Local has been captured or not.
4281
4282         (LocalInfo.IsCaptured): New property, used to tell whether the
4283         local has been captured.
4284         
4285         * anonymous.cs: Vastly updated to contain the anonymous method
4286         support.
4287
4288         The main classes here are: CaptureContext which tracks any
4289         captured information for a toplevel block and ScopeInfo used to
4290         track the activation frames for various local variables.   
4291
4292         Each toplevel block has an optional capture context associated
4293         with it.  When a method contains an anonymous method both the
4294         toplevel method and the anonymous method will create a capture
4295         context.   When variables or parameters are captured, they are
4296         recorded on the CaptureContext that owns them, for example:
4297
4298         void Demo () {
4299              int a;
4300              MyDelegate d = delegate {
4301                  a = 1;
4302              }
4303         }
4304
4305         Here `a' will be recorded as captured on the toplevel
4306         CapturedContext, the inner captured context will not have anything
4307         (it will only have data if local variables or parameters from it
4308         are captured in a nested anonymous method.
4309
4310         The ScopeInfo is used to track the activation frames for local
4311         variables, for example:
4312
4313         for (int i = 0; i < 10; i++)
4314                 for (int j = 0; j < 10; j++){
4315                    MyDelegate d = delegate {
4316                         call (i, j);
4317                    }
4318                 }
4319
4320         At runtime this captures a single captured variable `i', but it
4321         captures 10 different versions of the variable `j'.  The variable
4322         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4323         recorded on a child.  
4324
4325         The toplevel ScopeInfo will also track information like the `this'
4326         pointer if instance variables were referenced (this is necessary
4327         as the anonymous method lives inside a nested class in the host
4328         type of the method). 
4329
4330         (AnonymousMethod): Expanded to track the Toplevel, implement
4331         `AnonymousMethod.Compatible' to tell whether an anonymous method
4332         can be converted to a target delegate type. 
4333
4334         The routine now also produces the anonymous method content
4335
4336         (AnonymousDelegate): A helper class that derives from
4337         DelegateCreation, this is used to generate the code necessary to
4338         produce the delegate for the anonymous method that was created. 
4339
4340         * assign.cs: API adjustments for new changes in
4341         Convert.ImplicitStandardConversionExists.
4342
4343         * class.cs: Adjustments to cope with the fact that now toplevel
4344         blocks are of type `ToplevelBlock'. 
4345
4346         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4347         insteda of standard blocks.
4348
4349         Flag errors if params arguments are passed to anonymous methods.
4350
4351         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4352         `CurrentAnonymousMethod' which points to the current Anonymous
4353         Method.  The variable points to the AnonymousMethod class that
4354         holds the code being compiled.  It is set in the new EmitContext
4355         created for the anonymous method.
4356
4357         (EmitContext.Phase): Introduce a variable and an enumeration to
4358         assist in enforcing some rules about when and where we are allowed
4359         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4360         only one that enfonces this right now).
4361
4362         (EmitContext.HaveCaptureInfo): new helper method that returns
4363         whether we have a CapturedContext initialized.
4364
4365         (EmitContext.CaptureVariable): New method used to register that a
4366         LocalInfo must be flagged for capturing. 
4367
4368         (EmitContext.CapturedParameter): New method used to register that a
4369         parameters must be flagged for capturing. 
4370         
4371         (EmitContext.CapturedField): New method used to register that a
4372         field must be flagged for capturing. 
4373
4374         (EmitContext.HaveCapturedVariables,
4375         EmitContext.HaveCapturedFields): Return whether there are captured
4376         variables or fields. 
4377
4378         (EmitContext.EmitMethodHostInstance): This is used to emit the
4379         instance for the anonymous method.  The instance might be null
4380         (static methods), this (for anonymous methods that capture nothing
4381         and happen to live side-by-side with the current method body) or a
4382         more complicated expression if the method has a CaptureContext.
4383
4384         (EmitContext.EmitTopBlock): Routine that drives the emission of
4385         code: it will first resolve the top block, then emit any metadata
4386         and then emit the code.  The split is done so that we can extract
4387         any anonymous methods and flag any captured variables/parameters.
4388         
4389         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4390         during this phase, the ILGenerator should not be used as labels
4391         and local variables declared here might not be accessible to any
4392         code that is part of an anonymous method.  
4393
4394         Exceptions to this include the temporary variables that are
4395         created by some statements internally for holding temporary
4396         variables. 
4397         
4398         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4399         metadata for a cb
4400
4401         (EmitContext.TemporaryReturn): This method is typically called
4402         from the Emit phase, and its the only place where we allow the
4403         ReturnLabel to be defined other than the EmitMeta.  The reason is
4404         that otherwise we would have to duplicate a lot of logic in the
4405         Resolve phases of various methods that today is on the Emit
4406         phase. 
4407
4408         (EmitContext.NeedReturnLabel): This no longer creates the label,
4409         as the ILGenerator is not valid during the resolve phase.
4410
4411         (EmitContext.EmitThis): Extended the knowledge in this class to
4412         work in anonymous methods in addition to iterators. 
4413
4414         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4415         code is necessary on the stack to access the instance to a local
4416         variable (the variable will be accessed as a field).
4417
4418         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4419         EmitContext.EmitAddressOfParameter): Routines to support
4420         parameters (not completed at this point). 
4421         
4422         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4423         will also remove the parameters.
4424
4425         * convert.cs (Convert): Define a `ConstantEC' which points to a
4426         null.  This is just to prefity some code that uses
4427         ImplicitStandardConversion code and do not have an EmitContext
4428         handy.
4429
4430         The idea is to flag explicitly that at that point in time, it is
4431         known that the conversion will not trigger the delegate checking
4432         code in implicit conversions (which requires a valid
4433         EmitContext). 
4434
4435         Everywhere: pass new EmitContext parameter since
4436         ImplicitStandardConversionExists now requires it to check for
4437         anonymous method conversions. 
4438
4439         (Convert.ImplicitStandardConversionExists): If the type of an
4440         expression is the anonymous_method_type, and the type is a
4441         delegate, we invoke the AnonymousMethod.Compatible method to check
4442         whether an implicit conversion is possible. 
4443
4444         (Convert.ImplicitConversionStandard): Only do implicit method
4445         group conversions if the language level is not ISO_1.
4446
4447         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4448         MethodInfo for the Invoke method.  used by Delegate and
4449         AnonymousDelegate.
4450
4451         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4452         method conversions if the target type is a delegate.
4453
4454         Removed extra debugging nops.
4455
4456         (LocalVariableReference): Turn the `local_info' into a public
4457         field. 
4458
4459         Add `prepared' field, the same hack used for FieldExprs to cope
4460         with composed assignments, as Local variables do not necessarily
4461         operate purely on the stack as they used to: they can be captured
4462         fields. 
4463
4464         Add `temp' for a temporary result, like fields.
4465
4466         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4467
4468         It now copes with Local variables that are captured and emits the
4469         proper instance variable to load it from a field in the captured
4470         case. 
4471
4472         (ParameterReference.DoResolveBase): During the resolve phase,
4473         capture parameters if we are in an anonymous method.
4474
4475         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4476         anonymous method, use the EmitContext helper routines to emit the
4477         parameter reference.
4478
4479         * iterators.cs: Set RemapToProxy to true/false during the
4480         EmitDispose class.
4481
4482         * parameters.cs (GetParameterByName): New helper method. 
4483
4484         * typemanager.cs (anonymous_method_type) a new type that
4485         represents an anonyous method.  This is always an internal type,
4486         used as a fencepost to test against the anonymous-methodness of an
4487         expression. 
4488         
4489 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4490
4491         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4492         561 report.
4493         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4494
4495 2004-11-10  Martin Baulig  <martin@ximian.com>
4496
4497         * expression.cs (Invocation.BetterFunction): If two methods have
4498         equal parameter types, but only one of them is generic, the
4499         non-generic one wins.
4500         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4501         instance; just use `Type.IsValueType' to determine whether
4502         something is a struct or not.
4503         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4504         so we can be called multiple times.
4505
4506 2004-11-10  Martin Baulig  <martin@ximian.com>
4507
4508         * generic.cs (TypeParameter.DefineConstraints): New public method.
4509         (TypeParameter.CheckAccessLevel): Override this and return true.
4510         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4511         override ResolveType() anymore.
4512         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4513
4514 2004-11-10  Martin Baulig  <martin@ximian.com>
4515
4516         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4517         call DeclSpace.ResolveNestedType() on it.
4518
4519 2004-11-10  Martin Baulig  <martin@ximian.com>
4520
4521         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4522         non-null, call ParameterModifier() on it.
4523
4524 2004-11-10  Martin Baulig  <martin@ximian.com>
4525
4526         * iterators.cs
4527         (Iterators): Added `current_type' and `this_type' fields.
4528         (Iterators.DefineIterator): Create a new EmitContext and store it
4529         in `ec'; compute `this_type'.
4530
4531 2004-11-10  Martin Baulig  <martin@ximian.com>
4532
4533         * typemanager.cs
4534         (TypeManager.IsPrivateAccessible): New public method.
4535         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4536
4537 2004-11-10  Martin Baulig  <martin@ximian.com>
4538
4539         * class.cs (TypeContainer.DefineType): Call
4540         TypeBuilder.DefineGenericParameters() before resolving the type
4541         parameters.
4542         (MethodData.parent_method): New protected field.
4543         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4544         (MethodData.Define): Compute `parent_method'.
4545
4546         * decl.cs
4547         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4548         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4549         (DeclSpace.ec): New protected field; store the EmitContext here.
4550         (DeclSpace.EmitContext): New public property.
4551         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4552         (DeclSpace.ResolveNestedType): New public method.
4553         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4554         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4555         (DeclSpace.FamilyAccessible): Likewise.
4556         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4557         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4558         EmitContext.
4559
4560         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4561         field.
4562
4563         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4564         (Enum.Emit): Don't create a new EmitContext.
4565
4566 2004-10-18  Martin Baulig  <martin@ximian.com>
4567
4568         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4569         `Type' directly, but call ResolveType() on it.
4570         (Catch.Resolve): Likewise.
4571         (Foreach.Resolve): Likewise.
4572
4573 2004-10-18  Martin Baulig  <martin@ximian.com>
4574
4575         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4576         `Type' directly, but call ResolveType() on it.
4577         (Probe.DoResolve): Likewise.
4578         (ArrayCreation.LookupType): Likewise.
4579         (TypeOf.DoResolve): Likewise.
4580         (SizeOf.DoResolve): Likewise.
4581
4582 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4583
4584         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4585         the ResolveType.
4586
4587 2004-10-17  John Luke  <john.luke@gmail.com>
4588
4589         * class.cs (Operator.GetSignatureForError): use CSharpName
4590
4591         * parameter.cs (Parameter.GetSignatureForError): Returns
4592         correct name even if was not defined.
4593
4594 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4595
4596         Fix #65816.
4597         * class.cs (TypeContainer.EmitContext): New property.
4598         (DefineNestedTypes): Create an emitcontext for each part.
4599         (MethodCore.DoDefineParameters): Use container's emitcontext.
4600         Pass type array to InternalParameters.
4601         (MemberBase.DoDefine): Use container's emitcontext.
4602         (FieldMember.Define): Likewise.
4603         (Event.Define): Likewise.
4604         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4605         Pass type array to InternalParameters.
4606         (SetIndexerMethod.GetParameterInfo): Likewise.
4607         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4608         * delegate.cs (Define): Pass emitcontext to
4609         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4610         array to InternalParameters.
4611         * expression.cs (ParameterReference.DoResolveBase): Pass
4612         emitcontext to GetParameterInfo.
4613         (ComposedCast.DoResolveAsTypeStep): Remove check on
4614         ec.ResolvingTypeTree.
4615         * parameter.cs (Parameter.Resolve): Change argument to
4616         EmitContext.  Use ResolveAsTypeTerminal.
4617         (Parameter.GetSignature): Change argument to EmitContext.
4618         (Parameters.ComputeSignature): Likewise.
4619         (Parameters.ComputeParameterTypes): Likewise.
4620         (Parameters.GetParameterInfo): Likewise.
4621         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4622         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4623         * support.cs (InternalParameters..ctor): Remove variant that takes
4624         a DeclSpace.
4625         * typemanager.cs (system_intptr_expr): New.
4626         (InitExpressionTypes): Initialize it.
4627
4628 2004-10-12  Chris Toshok  <toshok@ximian.com>
4629
4630         * cs-parser.jay: fix location for try_statement and catch_clause.
4631
4632 2004-10-18  Martin Baulig  <martin@ximian.com>
4633
4634         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4635         `Type' directly, but call ResolveType() on it.
4636         (MemberBase.DoDefine): Likewise.
4637
4638         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4639         `Type' directly, but call ResolveType() on it.
4640         (ComposedCast.DoResolveAsTypeStep): Likewise.
4641
4642         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4643         `Type' directly, but call ResolveType() on it.
4644
4645 2004-10-17  John Luke  <john.luke@gmail.com>
4646
4647         * class.cs (Operator.GetSignatureForError): use CSharpName
4648
4649         * parameter.cs (Parameter.GetSignatureForError): Returns
4650         correct name even if was not defined.
4651
4652 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4653
4654         Fix #65816.
4655         * class.cs (TypeContainer.EmitContext): New property.
4656         (DefineNestedTypes): Create an emitcontext for each part.
4657         (MethodCore.DoDefineParameters): Use container's emitcontext.
4658         Pass type array to InternalParameters.
4659         (MemberBase.DoDefine): Use container's emitcontext.
4660         (FieldMember.Define): Likewise.
4661         (Event.Define): Likewise.
4662         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4663         Pass type array to InternalParameters.
4664         (SetIndexerMethod.GetParameterInfo): Likewise.
4665         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4666         * delegate.cs (Define): Pass emitcontext to
4667         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4668         array to InternalParameters.
4669         * expression.cs (ParameterReference.DoResolveBase): Pass
4670         emitcontext to GetParameterInfo.
4671         (ComposedCast.DoResolveAsTypeStep): Remove check on
4672         ec.ResolvingTypeTree.
4673         * parameter.cs (Parameter.Resolve): Change argument to
4674         EmitContext.  Use ResolveAsTypeTerminal.
4675         (Parameter.GetSignature): Change argument to EmitContext.
4676         (Parameters.ComputeSignature): Likewise.
4677         (Parameters.ComputeParameterTypes): Likewise.
4678         (Parameters.GetParameterInfo): Likewise.
4679         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4680         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4681         * support.cs (InternalParameters..ctor): Remove variant that takes
4682         a DeclSpace.
4683         * typemanager.cs (system_intptr_expr): New.
4684         (InitExpressionTypes): Initialize it.
4685
4686 2004-10-12  Chris Toshok  <toshok@ximian.com>
4687
4688         * cs-parser.jay: fix location for try_statement and catch_clause.
4689
4690 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4691
4692         More DeclSpace.ResolveType avoidance.
4693         * decl.cs (MemberCore.InUnsafe): New property.
4694         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4695         with newly created EmitContext.
4696         (FieldMember.Define): Likewise.
4697         * delegate.cs (Delegate.Define): Likewise.
4698         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4699         only if normal name-lookup fails.
4700         (TypeExpr.DoResolve): Enable error-checking.
4701         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4702         (SizeOf.DoResolve): Likewise.
4703         (ComposedCast.DoResolveAsTypeStep): Likewise.
4704         (StackAlloc.DoResolve): Likewise.
4705         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4706         (Block.Unsafe): New property.
4707         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4708         (Unsafe): Set 'unsafe' flag of contained block.
4709         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4710         (Fixed.Resolve): Likewise.
4711         (Catch.Resolve): Likewise.
4712         (Using.ResolveLocalVariableDecls): Likewise.
4713         (Foreach.Resolve): Likewise.
4714
4715 2004-10-05  John Luke <john.luke@gmail.com>
4716
4717         * cs-parser.jay: add location to error CS0175
4718
4719 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4720
4721         * ecore.cs (Expression.Constantity): Add support for turning null
4722         into a constant.
4723
4724         * const.cs (Const.Define): Allow constants to be reference types
4725         as long as the value is Null.
4726
4727 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4728
4729         * namespace.cs (NamespaceEntry.Using): No matter which warning
4730         level is set, check if this namespace name has already been added.
4731
4732 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4733
4734         * expression.cs: reftype [!=]= null should always use br[true,false].
4735         # 67410
4736
4737 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4738
4739         Fix #67108
4740         * attribute.cs: Enum conversion moved to 
4741         GetAttributeArgumentExpression to be applied to the all
4742         expressions.
4743
4744 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4745
4746         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4747         * class.c (TypeContainer.DefineType): Flag error if
4748         base types aren't accessible due to access permissions.
4749         * decl.cs (DeclSpace.ResolveType): Move logic to
4750         Expression.ResolveAsTypeTerminal.
4751         (DeclSpace.ResolveTypeExpr): Thin layer over
4752         Expression.ResolveAsTypeTerminal.
4753         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4754         Refactor code into NestedAccess.  Use it.
4755         (DeclSpace.NestedAccess): New.
4756         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4757         argument to silence errors.  Check access permissions.
4758         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4759         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4760         (Cast.DoResolve): Likewise.
4761         (New.DoResolve): Likewise.
4762         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4763         (TypeOf.DoResolve): Likewise.
4764
4765         * expression.cs (Invocation.BetterConversion): Return the Type of
4766         the better conversion.  Implement section 14.4.2.3 more faithfully.
4767         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4768         section 14.4.2.2 explicit.
4769         (Invocation.OverloadResolve): Update.
4770         (Invocation): Remove is_base field.
4771         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4772         (Invocation.Emit): Likewise.
4773
4774 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4775
4776         * cs-parser.jay: Reverted 642 warning fix.
4777
4778 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4779
4780         Fix bug #66615
4781         * decl.cs (FindMemberWithSameName): Indexer can have more than
4782         1 argument.
4783
4784 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4785
4786         * expression.cs (LocalVariableReference.DoResolveLValue):
4787         Do not report warning 219 for out values.
4788         (EmptyExpression.Null): New member to avoid extra allocations.
4789
4790 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4791
4792         * cs-parser.jay: Fix wrong warning 642 report.
4793
4794         * cs-tokenizer.cs (CheckNextToken): New helper;
4795         Inspect next character if is same as expected.
4796
4797 2004-09-23  Martin Baulig  <martin@ximian.com>
4798
4799         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4800         (Convert.ImplicitReferenceConversionExists): Likewise.
4801
4802 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4803
4804         * Makefile (DISTFILES): Comment out a few missing files.
4805
4806 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4807
4808         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4809         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4810         (gmcs.exe): Invoke bootstrap-libs.
4811         (clean-local): Clean the net_2_0_bootstrap profile too.
4812         (PROGRAM_INSTALL_DIR): New.
4813         (install-local): Use it.
4814
4815 2004-10-13  Martin Baulig  <martin@ximian.com>
4816
4817         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4818         (TypeParameter.DefineType): If we're a method type parameter and
4819         that method is overriding something, "inflate" its constraints.
4820
4821 2004-10-12  Martin Baulig  <martin@ximian.com>
4822
4823         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4824         and have type arguments, create and resolve a ConstructedType.
4825
4826 2004-10-12  Martin Baulig  <martin@ximian.com>
4827
4828         * decl.cs (MemberCache.FindMemberToOverride): Use
4829         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4830         to compare the invocationType.
4831
4832         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4833         When comparing two type parameters, only do the signature-only
4834         comparision for method type parameters.
4835
4836 2004-10-11  Martin Baulig  <martin@ximian.com>
4837
4838         * report.cs: Don't make --fatal abort on warnings, we have
4839         -warnaserror for that.
4840
4841 2004-10-11  Martin Baulig  <martin@ximian.com>
4842
4843         * typemanager.cs
4844         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4845         (TypeManager.IsEqual): Call ourself recursively instead of using
4846         Type.IsEqual(). 
4847
4848 2004-10-11  Martin Baulig  <martin@ximian.com>
4849
4850         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4851         on our own type parameters, not on the ones we inherit from a containing
4852         class.
4853
4854         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4855         the comparision.
4856
4857         * generic.cs (TypeParameter.Define): We may only be called once.
4858
4859         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4860         instead of TypeManager.IsEqual().
4861
4862 2004-09-28  Martin Baulig  <martin@ximian.com>
4863
4864         * generic.cs
4865         (GenericConstraints.EffectiveBaseClass): New public property.
4866         (TypeParameter.GenericConstraints): New public property.
4867         (ConstructedType.CheckConstraints): Improved.
4868
4869         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4870         (Convert.TypeParameterConversion): New private method; use this in
4871         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4872         for all conversions related to type parameters.
4873
4874 2004-09-24  Martin Baulig  <martin@ximian.com>
4875
4876         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4877         type parameter conversions for type parameters which are known to
4878         be reference types.
4879
4880 2004-09-24  Martin Baulig  <martin@ximian.com>
4881
4882         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4883         `IsValueType' properties.
4884
4885         * support.cs (ReflectionConstraints): Use
4886         Type.GetGenericParameterConstraints() instead of the old hack.
4887
4888 2004-09-24  Martin Baulig  <martin@ximian.com>
4889
4890         * generic.cs (GenericConstraints): Moved here and made it an
4891         abstract class.
4892
4893         * support.cs (GenericConstraints): Moved to generic.cs.
4894
4895 2004-09-24  Martin Baulig  <martin@ximian.com>
4896
4897         * support.cs
4898         (ReflectionConstraints): Un-nested this class and made it public.
4899
4900         * typemanager.cs
4901         (TypeManager.GetTypeParameterConstraints): New public method.
4902         (TypeManager.HasConstructorConstraint): Use the attributes.
4903
4904 2004-09-24  Martin Baulig  <martin@ximian.com>
4905
4906         * support.cs (GenericConstraints): Replaced `HasConstructor',
4907         `IsReferenceType' and `IsValueType' with `Attributes'.
4908         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4909         method and made the .ctor public.
4910
4911         * generic.cs (Constraints.Attributes): New public property.
4912         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4913         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4914         `IsValueType' -> `HasValueTypeConstraint'.
4915
4916 2004-09-23  Martin Baulig  <martin@ximian.com>
4917
4918         * generic.cs (Constraints): Reflect latest runtime changes.
4919
4920 2004-09-23  Martin Baulig  <martin@ximian.com>
4921
4922         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4923         (Convert.ImplicitReferenceConversionExists): Likewise.
4924
4925 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4926
4927         * class.cs (Operator.Define): Add error 448 and 559 report.
4928         
4929 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4930
4931         * class.cs (MemberBase.IsTypePermitted): New protected
4932         method for checking error CS0610.
4933
4934 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4935
4936         * class.cs (TypeContainer.HasExplicitLayout): New property
4937         Returns whether container has StructLayout attribute set Explicit.
4938         (FieldMember): New abstract class for consts and fields.
4939         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4940         (Field): Reuse FieldMember.
4941
4942         * const.cs (Const): Reuse FieldMember.
4943
4944         * rootcontext.cs: EmitConstants call moved to class.
4945
4946 2004-09-22  Martin Baulig  <martin@ximian.com>
4947
4948         Marek and me just fixed one of our oldest bugs: #28562 :-)
4949
4950         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4951
4952         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4953         we're an EnumConstant, just return that.
4954         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4955         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4956         to get the value which'll actually be written into the attribute.
4957         However, we have to use GetValue() to access the attribute's value
4958         in the compiler.        
4959
4960 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4961
4962         * constant.cs (Constant.IsNegative): New abstract property
4963         IsNegative.
4964
4965         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4966         (StackAlloc.DoResolve): Reused IsNegative.
4967
4968 2004-09-22  Martin Baulig  <martin@ximian.com>
4969
4970         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4971         public method; like LookupTypeContainer, but also works for
4972         generic instances.
4973
4974         * report.cs (Report.SymbolRelatedToPreviousError): Use
4975         TypeManager.LookupGenericTypeContainer().       
4976
4977 2004-09-22  Martin Baulig  <martin@ximian.com>
4978
4979         Thanks to Peter Sestoft for this bug report.
4980
4981         * expression.cs (Conditional): If both the `trueExpr' and the
4982         `falseExpr' is a NullLiteral, return a NullLiteral.
4983
4984 2004-09-22  Martin Baulig  <martin@ximian.com>
4985
4986         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4987         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4988         for the "get_Current" call.
4989
4990 2004-09-21  Martin Baulig  <martin@ximian.com>
4991
4992         * convert.cs (Convert.ImplicitReferenceConversion): When
4993         converting to an interface type, first check whether we're
4994         converting from a reference type.
4995
4996 2004-09-14  Martin Baulig  <martin@ximian.com>
4997
4998         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4999
5000 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5001
5002         Fixed bug #61902
5003         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5004         called and is obsolete then this member suppress message
5005         when call is inside next [Obsolete] method or type.
5006
5007         * expression.cs: Use TestObsoleteMethodUsage member.
5008
5009 2004-09-14  Martin Baulig  <martin@ximian.com>
5010
5011         * genericparser.cs: Removed.
5012
5013 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5014
5015         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5016
5017 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5018
5019         * attribute.cs (Attribute.Resolve): Add error 653 report.
5020
5021         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5022         report.
5023         (Method.ApplyAttributeBuilder): Add error 685 report.
5024         (Operator.Define): Add error 564 report.
5025
5026         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5027
5028         * expression.cs (Invocation.DoResolve): Add error
5029         245 and 250 report.
5030
5031         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5032         error 674 report.
5033
5034 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5035
5036         * class.cs (ConstructorInitializer.Resolve):
5037         Wrong error number (515->516).
5038
5039 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5040
5041         * class.cs (Indexer.Define): Add error 631 report.
5042
5043 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5044
5045         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5046
5047 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5048
5049         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5050
5051 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5052
5053         * cs-parser.jay: Added error CS0241 report.
5054
5055 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5056
5057         * cs-parser.jay (fixed_statement): Introduce a scope for the
5058         declaration in the 'fixed' statement.
5059
5060 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5061
5062         * cs-parser.jay: Added CS0230 error report.
5063
5064 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5065
5066         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5067
5068 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5069
5070         * expression.cs (Argument.Resolve): Added error CS0192 and
5071         CS0199 report.
5072
5073 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5074
5075         C# 2.0 #pragma warning feature
5076
5077         * cs-tokenizer.cs (PreProcessPragma): New method; 
5078         Handles #pragma directive.
5079
5080         * report.cs (WarningRegions): New class; Support
5081         class for #pragma warning directive. It tests whether
5082         warning is enabled for a given line.
5083
5084 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5085
5086         * const.cs: Add more descriptive error report, tahnks to
5087         Sebastien. 
5088
5089 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5090
5091         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5092
5093 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5094
5095         * expression.cs: Apply patch from Ben: Remove dead code from
5096         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5097         as that code just threw an exception anwyays.
5098
5099         * const.cs: Remove the call to the turnintoconstant, for details
5100         see bug: #63144
5101         
5102         * literal.cs: The type of the null-literal is the null type;  So
5103         we use a placeholder type (literal.cs:System.Null, defined here)
5104         for it.
5105
5106         * expression.cs (Conditional.DoResolve): Remove some old code that
5107         is no longer needed, conversions have been fixed.
5108
5109         (ArrayCreationExpression.DoResolve): Return false if we fail to
5110         resolve the inner expression.
5111
5112 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5113
5114         Fix test-290.cs.
5115         * cs-parser.jay (delegate_declaration): Record a delegate
5116         declaration as a type declaration.
5117         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5118
5119 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5120
5121         * parameter.cs: Do not crash if the type can not be resolved. 
5122
5123         * expression.cs: Report errors with unsafe pointers, fixes #64896
5124
5125 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5126
5127         * expression.cs: Pointer arith always needs to do a conv.i
5128         if the operand is a long. fix 65320
5129
5130 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5131
5132         Fixed cs0619-37.cs, cs0619-38.cs
5133
5134         * enum.cs (GetObsoleteAttribute): Removed.
5135
5136         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5137         on Enum member is double staged. The first is tested member
5138         and then enum.
5139
5140 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5141
5142         Fixed #56986, #63631, #65231
5143
5144         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5145         adds member to name container.
5146         (TypeContainer.AddToTypeContainer): New method, adds type to
5147         name container.
5148         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5149         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5150         AddOperator): Simplified by reusing AddToMemberContainer.
5151         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5152         instead of field.
5153         (Method.CheckForDuplications): Fixed implementation to test all
5154         possibilities.
5155         (MemberBase): Detection whether member is explicit interface
5156         implementation is now in constructor.
5157         (MemberBase.UpdateMemberName): Handles IndexerName.
5158         (Accessor): Changed to keep also location information.
5159         (AbstractPropertyEventMethod): Is derived from MemberCore.
5160         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5161         will be emited or not.
5162         (PropertyBase.AreAccessorsDuplicateImplementation):
5163         Tests whether accessors are not in collision with some method.
5164         (Operator): Is derived from MethodCore to simplify common
5165         operations.
5166
5167         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5168         must be performed.
5169         (DeclSpace.AddToContainer): Adds the member to defined_names
5170         table. It tests for duplications and enclosing name conflicts.
5171
5172         * enum.cs (EnumMember): Clean up to reuse the base structures
5173
5174 2004-09-03  Martin Baulig  <martin@ximian.com>
5175
5176         Merged latest changes into gmcs.  Please keep this comment in
5177         here, it makes it easier for me to see what changed in MCS since
5178         the last time I merged.
5179
5180 2004-09-03  Martin Baulig  <martin@ximian.com>
5181
5182         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5183         into TypeContainer, to make partial classes work again.
5184
5185 2004-09-03  Martin Baulig  <martin@ximian.com>
5186
5187         * rootcontext.cs (RootContext.V2): Removed.
5188
5189 2004-03-23  Martin Baulig  <martin@ximian.com>
5190
5191         * expression.cs (Invocation.OverloadResolve): Added `bool
5192         may_fail' argument and use it instead of the Location.IsNull() hack.
5193
5194 2004-09-09  Martin Baulig  <martin@ximian.com>
5195
5196         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5197
5198 2004-09-09  Martin Baulig  <martin@ximian.com>
5199
5200         * generic.cs (TypeParameter.DefineType): Added support for
5201         explicit interface methods.
5202
5203 2004-09-09  Martin Baulig  <martin@ximian.com>
5204
5205         * README.Changes: New document.  Started to list important changes
5206         between MCS and GMCS here.
5207
5208 2004-09-08  Martin Baulig  <martin@ximian.com>
5209
5210         * class.cs
5211         (TypeContainer.CheckRecursiveDefinition): New protected method.
5212         (TypeContainer.DefineType): Move the CS0146 check into
5213         CheckRecursiveDefinition().     
5214
5215 2004-09-06  Martin Baulig  <martin@ximian.com>
5216
5217         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5218         types for the constructor constraint.
5219
5220 2004-09-03  Martin Baulig  <martin@ximian.com>
5221
5222         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5223         into TypeContainer, to make partial classes work again.
5224
5225 2004-09-03  Martin Baulig  <martin@ximian.com>
5226
5227         * rootcontext.cs (RootContext.V2): Removed.
5228
5229 2004-03-23  Martin Baulig  <martin@ximian.com>
5230
5231         * expression.cs (Invocation.OverloadResolve): Added `bool
5232         may_fail' argument and use it instead of the Location.IsNull() hack.
5233
5234 2004-09-03  Martin Baulig  <martin@ximian.com>
5235
5236         Merged latest changes into gmcs.  Please keep this comment in
5237         here, it makes it easier for me to see what changed in MCS since
5238         the last time I merged.
5239
5240 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5241
5242         Fix #61128.
5243         * expression.cs (BetterConversion): Don't allow either conversion 
5244         to be null.  Remove redundant implicit conversion test when 'q ==
5245         null' -- when this function is invoked, we already know that the
5246         implicit conversion exists.
5247         (BetterFunction): Assume that 'best' is non-null.  Remove
5248         redundant reimplementation of IsApplicable when 'best' is null.
5249         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5250         number of arguments.
5251         (IsAncestralType): Extract from OverloadResolve.
5252         (OverloadResolve): Make robust to the MethodGroupExpr being
5253         unsorted.  Implement all the logic of Section 14.5.5.1, and
5254         support overloading of methods from multiple applicable types.
5255         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5256
5257         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5258         (RealError, Warning): Append type of report to related symbol.
5259
5260 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5261
5262         * enum.cs: Fixed CLS-Compliance checks for enum members.
5263         Error tests cs3008-8.cs, cs3014-8.cs
5264
5265 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5266
5267         Fixed bug #62342, #63102
5268         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5269         like ImplementMethod.
5270
5271 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5272
5273         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5274         Fixed bug #65170.
5275
5276 2004-09-02  Martin Baulig  <martin@ximian.com>
5277
5278         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5279         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5280         on the MethodBase.
5281
5282 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5283
5284         C# 2.0 Static classes implemented
5285
5286         * class.cs (TypeContainer): instance_constructors,
5287         initialized_fields, initialized_static_fields,
5288         default_constructor, base_inteface_types are protected to be
5289         accessible from StaticClass.
5290         (TypeContainer.DefineDefaultConstructor): New virtual method
5291         for custom default constructor generating
5292         (StaticClass): New class to handle "Static classes" feature.
5293
5294         * cs-parser.jay: Handle static keyword on class like instance
5295         of StaticClass.
5296
5297         * driver.cs: Added "/langversion" command line switch with two
5298         options (iso-1, default).
5299
5300 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5301
5302         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5303
5304 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5305
5306         * delegate.cs: Style.
5307
5308 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5309
5310         * delegate.cs: Add seperate instance expr field for miguel.
5311
5312 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5313
5314         * PointerArithmetic (Resolve): make sure we are not doing
5315         pointer arith on void*. Also, make sure we are resolved
5316         by not setting eclass until resolve.
5317
5318         All callers: Make sure that PointerArithmetic gets resolved.
5319
5320 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5321
5322         * ArrayCreation (LookupType): If the type does not resolve 
5323         to an array, give an error.
5324
5325 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5326
5327         * statement.cs (Try.Resolve): Fixed bug #64222
5328
5329 2004-08-27  Martin Baulig  <martin@ximian.com>
5330
5331         * class.cs
5332         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5333         crash here.     
5334
5335 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5336
5337         * ecore.cs (Constantify): Get underlying type via
5338         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5339         Windows in special cases.
5340
5341 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5342
5343         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5344         for obtaining also private methods.
5345         (GetRemoveMethod): Used GetRemoveMethod (true)
5346         for obtaining also private methods.
5347
5348 2004-09-02  Martin Baulig  <martin@ximian.com>
5349
5350         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5351         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5352         on the MethodBase.
5353
5354 2004-08-27  Martin Baulig  <martin@ximian.com>
5355
5356         * class.cs
5357         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5358         crash here.     
5359
5360 2004-08-25  Martin Baulig  <martin@ximian.com>
5361
5362         * support.cs (ReflectionParameters..ctor): If this is a generic
5363         method, retrieve and store its type parameters.
5364         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5365         (ReflectionParameters.GenericConstraints): The argument specifies
5366         the type parameter, not the method parameter.
5367         (InternalParameters.GenericConstraints): Likewise.
5368
5369         * generic.cs (TypeParameter.DefineType): Correctly handle
5370         constraints wrt. generic methods in interfaces and their
5371         implementations.        
5372
5373 2004-08-24  Martin Baulig  <martin@ximian.com>
5374
5375         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5376         (Constraints.IsSubclassOf): New internal method.
5377
5378         * typemanager.cs (TypeManager.FindMembers): Added special support
5379         for GenericTypeParameterBuilder's.      
5380         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5381         type parameters.
5382
5383 2004-08-24  Martin Baulig  <martin@ximian.com>
5384
5385         * typemanager.cs
5386         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5387         this for accessibility checks.
5388         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5389         IsNestedFamilyAccessible.
5390         (TypeManager.IsSubclassOf): New method, do what the name actually
5391         says.   
5392
5393 2004-08-24  Martin Baulig  <martin@ximian.com>
5394
5395         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5396         as a SimpleName, include the generic arity.
5397
5398 2004-08-24  Martin Baulig  <martin@ximian.com>
5399
5400         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5401         MethodAttributes.HideBySig for operators.
5402
5403 2004-08-23  Martin Baulig  <martin@ximian.com>
5404
5405         Back to the old error reporting system :-)
5406
5407         * report.cs (Message): Removed.
5408         (Report.MessageData, ErrorData, WarningData): Removed.
5409         (Report.Error, Warning): Back to the old system.
5410
5411 2004-08-23  Martin Baulig  <martin@ximian.com>
5412
5413         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5414
5415         * class.cs (TypeContainer.ParentContainer): New public virtual
5416         method; replaces the explicit interface implementation.
5417         (ClassPart.ParentContainer): Override.
5418
5419 2004-08-23  Martin Baulig  <martin@ximian.com>
5420
5421         * statement.cs (Switch): Added support for constant switches; see
5422         #59428 or test-285.cs.
5423
5424 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5425
5426         Fixed bug #62740.
5427         * statement.cs (GetEnumeratorFilter): Removed useless
5428         logic because C# specs is strict. GetEnumerator must be
5429         public.
5430
5431 2004-08-22  Martin Baulig  <martin@ximian.com>
5432
5433         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5434         a switch and may break, reset the barrier.  Fixes #59867.
5435
5436 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5437
5438         CLS-Compliance speed up (~5% for corlib)
5439
5440         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5441         New method. Tests container for CLS-Compliant names
5442
5443         * class.cs (TypeContainer.VerifyClsName): New method.
5444         Checks whether container name is CLS Compliant.
5445         (Constructor): Implements IMethodData.
5446
5447         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5448         low-case table for CLS Compliance test.
5449         (MemberCache.VerifyClsParameterConflict): New method.
5450         Checks method parameters for CS3006 error.
5451
5452         * enum.cs (EnumMember): Is derived from MemberCore.
5453         (Enum.VerifyClsName): Optimized for better performance.
5454
5455 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5456
5457         * report.cs: Renamed Error_T to Error and changed all
5458         references.
5459
5460 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5461
5462         * class.cs (TypeContainer.IndexerArrayList): New inner class
5463         container for indexers.
5464         (TypeContainer.DefaultIndexerName): New constant for default
5465         indexer name. Replaced all "Item" with this constant.
5466         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5467
5468         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5469         DefaultMemberAttribute constructor.
5470
5471 2004-08-05  Martin Baulig  <martin@ximian.com>
5472
5473         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5474         Fix bug #59429.
5475
5476 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5477
5478         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5479         multi platforms problem.
5480
5481         * compiler.csproj: Included shared files.
5482
5483 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5484
5485         Fix bug 60333, 55971 in the more general way
5486         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5487         Added arg_type argument for constant conversion.
5488         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5489
5490 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5491
5492         Fix bug #59760
5493         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5494         OperatorArrayList, MethodCoreArrayList for typecontainer
5495         containers. Changed class member types to these new types.
5496         (MethodArrayList.DefineMembers): Added test for CS0659.
5497
5498 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5499
5500         * cfold.cs: Synchronize the folding with the code in expression.cs
5501         Binary.DoNumericPromotions for uint operands.
5502
5503         * attribute.cs: Revert patch from Raja, it introduced a regression
5504         while building Blam-1.2.1 (hard to isolate a test case).
5505
5506 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5507
5508         Fix for #55382
5509         * class.cs:
5510         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5511         name collision.
5512         (MethodCore.parent_method): New member. The method we're overriding
5513         if this is an override method.
5514         (MethodCore.CheckBase): Moved from Method class and made common.
5515         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5516         private.
5517         (MethodCore.CheckForDuplications): New abstract method. For custom
5518         member duplication search in a container
5519         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5520         method and its return type.
5521         (Event.conflict_symbol): New member. Symbol with same name in the
5522         parent class.
5523
5524         * decl.cs:
5525         (MemberCache.FindMemberWithSameName): New method. The method
5526         is looking for conflict with inherited symbols.
5527
5528 2004-08-04  Martin Baulig  <martin@ximian.com>
5529
5530         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5531
5532         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5533
5534 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5535
5536         * report.cs (Message): New enum for better error, warning reference in
5537         the code.
5538         (MessageData): New inner abstract class. It generally handles printing of
5539         error and warning messages.
5540         Removed unused Error, Warning, Message methods.
5541
5542 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5543
5544         Fix for cs0592-8.cs test
5545         * attribute.cs
5546         (Attributable.ValidAttributeTargets): Made public.
5547         (Attribute.ExplicitTarget): New member for explicit target value.
5548         (Attribute.CheckTargets): Now we translate explicit attribute
5549         target to Target here.
5550
5551 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5552
5553         * ecore.cs (MethodGroupExpr): new IsBase property.
5554
5555         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5556
5557         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5558         rather than an instance expr.
5559
5560         (DelegateCreation.Emit): Use the method group rather than
5561         the instance expression. Also, if you have base.Foo as the
5562         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5563
5564         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5565
5566         (NewDelegate.DoResolve): Only check for the existance of Invoke
5567         if the method is going to be needed. Use MethodGroupExpr.
5568
5569         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5570
5571         * expression.cs: For pointer arith., make sure to use
5572         the size of the type, not the size of the pointer to
5573         the type.
5574
5575 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5576
5577         Fix for #60722
5578         * class.cs (Class): Added error CS0502 test.
5579
5580 2004-08-03  John Luke  <jluke@cfl.rr.com>
5581             Raja R Harinath  <rharinath@novell.com>
5582
5583         Fix for #60997.
5584         * attribute.cs (Attribute.complained_before): New flag.
5585         (Attribute.ResolveType, Attribute.Resolve),
5586         (Attribute.DefinePInvokeMethod): Set it.
5587         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5588         
5589 2004-08-03  Martin Baulig  <martin@ximian.com>
5590
5591         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5592         use a user-defined operator; we still need to do numeric
5593         promotions in case one argument is a builtin type and the other
5594         one has an implicit conversion to that type.  Fixes #62322.
5595
5596 2004-08-18  Martin Baulig  <martin@ximian.com>
5597
5598         * class.cs (Method.Define): Use the correct method name when
5599         creating the MethodBuilder for a generic method.
5600
5601 2004-08-17  Martin Baulig  <martin@ximian.com>
5602
5603         * generic.cs (Constraints): Support type parameter constraints.
5604
5605 2004-08-16  Martin Baulig  <martin@ximian.com>
5606
5607         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5608         (Token.GENERIC_DIMENSION): New token; this is returned if we
5609         encounter an unbound generic type in a typeof() expression.
5610
5611         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5612         this token is only generated while parsing a typeof() expression.
5613         (typeof_expression): Removed the old unbound_type hack.
5614
5615         * generic.cs (TypeArguments.IsUnbound): New public property.
5616
5617         * decl.cs (MemberName): Added support for unbound types.
5618
5619 2004-08-14  Martin Baulig  <martin@ximian.com>
5620
5621         * typemanager.cs
5622         (TypeManager.IsEqualGenericInstance): New static method.
5623         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5624         just used to check accessibility, so follow the rules of 26.1.6.        
5625
5626         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5627         ConstructedType instead of a TypeExpression if we have type arguments.
5628
5629         * cs-parser.jay (typeof_expression): Support unbound generic types.
5630
5631         * ecore.cs (UnboundTypeExpression): New public class.
5632
5633 2004-08-12  Martin Baulig  <martin@ximian.com>
5634
5635         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5636         TypeManager.IsEqual() rather than `=='.
5637
5638         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5639         generic instances as well.
5640
5641 2004-08-12  Martin Baulig  <martin@ximian.com>
5642
5643         * expression.cs (Invocation.InferType): We can only infer method
5644         type parameters.  Fixes #62647.
5645
5646 2004-08-11  Martin Baulig  <martin@ximian.com>
5647
5648         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5649         before resolving the base classes.
5650
5651 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5652
5653         * Makefile: install .mdb file too.
5654
5655 2004-08-05  Martin Baulig  <martin@ximian.com>
5656
5657         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5658         initializer, the current type is just the TypeBuilder, not the
5659         instantiated generic type.
5660         (FieldExpr.IsFieldInitializer): New public property.
5661
5662 2004-08-04  Martin Baulig  <martin@ximian.com>
5663
5664         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5665
5666         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5667
5668 2004-08-03  Martin Baulig  <martin@ximian.com>
5669
5670         * class.cs (MethodData.Define): If we're an explicit
5671         implementation, remove the generic arity from the type name.
5672
5673 2004-08-03  Martin Baulig  <martin@ximian.com>
5674
5675         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5676         use a user-defined operator; we still need to do numeric
5677         promotions in case one argument is a builtin type and the other
5678         one has an implicit conversion to that type.  Fixes #62322.
5679
5680 2004-08-02  Martin Baulig  <martin@ximian.com>
5681
5682         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5683         `TypeExpr[]' array.
5684         (TypeContainer.GetClassBases): Return the unexpanded list of
5685         interfaces; we expand them later.
5686         (TypeContainer.DefineType): After creating the TypeBuilder, call
5687         TypeManager.ExpandInterfaces() to get an expanded and resolved
5688         list of interfaces.
5689
5690         * ecore.cs (TypeExpr.GetInterfaces): Removed
5691
5692         * generics.cs (Constraints.InterfaceConstraints): Remove.
5693         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5694         register the interface constraints.
5695
5696         * typemanager.cs
5697         (TypeManager.AddUserType): Removed the `ifaces' argument.
5698         (TypeManager.AddTypeParameter): Likewise.
5699         (TypeManager.AddUserInterface): Removed, was unused.
5700         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5701         `TypeExpr[]' array for the interfaces.
5702         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5703         has been defined, returns a list of the resolved interfaces types.
5704         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5705         (TypeManager.GetExplicitInterfaces): Likewise.  
5706
5707 2004-08-02  Martin Baulig  <martin@ximian.com>
5708
5709         * expression.cs (Invocation.EmitCall): If we're invoking a method
5710         on a type parameter, use the new `Constrained' prefix opcode.
5711
5712 2004-08-02  Martin Baulig  <martin@ximian.com>
5713
5714         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5715         (LocalInfo.IsThis): New public property.
5716         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5717
5718 2004-08-01  Martin Baulig  <martin@ximian.com>
5719
5720         * class.cs (TypeContainer.GetClassBases): Don't set the default
5721         here since we may get called from GetPartialBases().
5722         (TypeContainer.DefineType): If GetClassBases() didn't return a
5723         parent, use the default one.
5724
5725 2004-07-30  Martin Baulig  <martin@ximian.com>
5726
5727         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5728
5729         * class.cs (SourceMethod): New public class, derive from the
5730         symbol writer's ISourceMethod.
5731         (Method): Use the new symbol writer API.
5732
5733         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5734         as argument and use the new symbol writer.
5735
5736         * location.cs
5737         (SourceFile): Implement the symbol writer's ISourceFile.
5738         (Location.SymbolDocument): Removed.
5739         (Location.SourceFile): New public property.
5740
5741         * symbolwriter.cs: Use the new symbol writer API.
5742
5743 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5744
5745         * Makefile (install-local): Remove.  Functionality moved to
5746         executable.make.
5747
5748 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5749
5750         * Makefile: Install mcs.exe.config file together with mcs.exe.
5751         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5752         correct runtime version.
5753         
5754 2004-07-25  Martin Baulig  <martin@ximian.com>
5755
5756         * class.cs
5757         (TypeContainer.RegisterOrder): Removed, this was unused.
5758         (TypeContainer, interface_order): Removed.
5759         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5760         TypeContainer as argument since we can also be called with a
5761         `PartialContainer' for a partial class/struct/interface.
5762         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5763         of checking whether we're an `Interface' - we could be a
5764         `PartialContainer'.
5765         (PartialContainer.Register): Override; call
5766         AddClass()/AddStruct()/AddInterface() on our parent.
5767
5768         * cs-parser.jay (interface_member_declaration): Add things to the
5769         `current_container', not the `current_class'.
5770
5771         * rootcontext.cs (RegisterOrder): The overloaded version which
5772         takes an `Interface' was unused, removed.
5773
5774         * typemanager.cs (TypeManager.LookupInterface): Return a
5775         `TypeContainer', not an `Interface'.
5776         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5777         contain a `PartialContainer' for an interface, so check it's
5778         `Kind' to figure out what it is.
5779
5780 2004-07-25  Martin Baulig  <martin@ximian.com>
5781
5782         * class.cs (Class.DefaultTypeAttributes): New public constant.
5783         (Struct.DefaultTypeAttributes): Likewise.
5784         (Interface.DefaultTypeAttributes): Likewise.
5785         (PartialContainer.TypeAttr): Override this and add the
5786         DefaultTypeAttributes.
5787
5788 2004-07-25  Martin Baulig  <martin@ximian.com>
5789
5790         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5791         we can just use the `Parent' field instead.
5792
5793 2004-07-25  Martin Baulig  <martin@ximian.com>
5794
5795         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5796
5797 2004-07-25  Martin Baulig  <martin@ximian.com>
5798
5799         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5800         our parts before defining any methods.
5801         (TypeContainer.VerifyImplements): Make this virtual.
5802         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5803         on our PartialContainer.
5804
5805 2004-07-25  Martin Baulig  <martin@ximian.com>
5806
5807         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5808
5809         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5810         argument, we can just use the `Parent' field instead.
5811
5812         * class.cs
5813         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5814         (MemberBase.DoDefine): Likewise.
5815
5816 2004-07-24  Martin Baulig  <martin@ximian.com>
5817
5818         * decl.cs (MemberCore.Parent): New public field.
5819         (DeclSpace.Parent): Moved to MemberCore.
5820
5821         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5822         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5823         parent's .ctor.
5824         (FieldBase, Field, Operator): Likewise.
5825         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5826         (EventField, Event): Likewise.
5827
5828 2004-07-23  Martin Baulig  <martin@ximian.com>
5829
5830         * class.cs (PartialContainer): New public class.
5831         (ClassPart): New public class.
5832         (TypeContainer): Added support for partial classes.
5833         (TypeContainer.GetClassBases): Splitted some of the functionality
5834         out into GetNormalBases() and GetPartialBases().
5835
5836         * cs-tokenizer.cs (Token.PARTIAL): New token.
5837         (Tokenizer.consume_identifier): Added some hacks to recognize
5838         `partial', but only if it's immediately followed by `class',
5839         `struct' or `interface'.
5840
5841         * cs-parser.jay: Added support for partial clases.
5842
5843 2004-07-23  Martin Baulig  <martin@ximian.com>
5844
5845         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5846         a `DeclSpace' and also made it readonly.
5847         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5848         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5849         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5850
5851         * cs-parser.jay: Pass the `current_class', not the
5852         `current_container' (at the moment, this is still the same thing)
5853         to a new Method, Property, Event, Indexer or Constructor.
5854
5855 2004-07-23  Martin Baulig  <martin@ximian.com>
5856
5857         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5858         and removed the `current_interface' one.
5859         (struct_declaration, class_declaration, interface_declaration):
5860         Set `current_class' to the newly created class/struct/interface;
5861         set their `Bases' and call Register() before parsing their body.
5862
5863 2004-07-23  Martin Baulig  <martin@ximian.com>
5864
5865         * class.cs (Kind): New public enum.
5866         (TypeContainer): Made this class abstract.
5867         (TypeContainer.Kind): New public readonly field.
5868         (TypeContainer.CheckDef): New public method; moved here from
5869         cs-parser.jay.
5870         (TypeContainer.Register): New public abstract method.
5871         (TypeContainer.GetPendingImplementations): New public abstract
5872         method.
5873         (TypeContainer.GetClassBases): Removed the `is_class' and
5874         `is_iface' parameters.
5875         (TypeContainer.DefineNestedTypes): Formerly known as
5876         DoDefineType().
5877         (ClassOrStruct): Made this class abstract.
5878
5879         * tree.cs (RootTypes): New public type. 
5880
5881 2004-07-20  Martin Baulig  <martin@ximian.com>
5882
5883         * tree.cs (Tree.RecordNamespace): Removed.
5884         (Tree.Namespaces): Removed.
5885
5886         * rootcontext.cs (RootContext.IsNamespace): Removed.
5887
5888         * cs-parser.jay (namespace_declaration): Just create a new
5889         NamespaceEntry here.
5890
5891 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5892
5893         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5894         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5895         entry to make sure it runs in the correct runtime version.
5896         
5897 2004-07-18  Martin Baulig  <martin@ximian.com>
5898
5899         * generic.cs (ConstructedType.CheckConstraints): Improved
5900         constraints checking.
5901
5902 2004-07-18  Martin Baulig  <martin@ximian.com>
5903
5904         * expression.cs (Invocation.BetterMethod): Call
5905         TypeManager.TypeToCoreType() on all types and removed my previous
5906         hack; we're already doig the right thing here.
5907
5908 2004-07-17  Martin Baulig  <martin@ximian.com>
5909
5910         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5911
5912 2004-07-16  Martin Baulig  <martin@ximian.com>
5913
5914         * iterators.cs: Added generics support.
5915
5916 2004-07-16  Martin Baulig  <martin@ximian.com>
5917
5918         * iterators.cs: Rewrote this.  We're now using one single Proxy
5919         class for both the IEnumerable and the IEnumerator interface and
5920         `Iterator' derives from Class so we can use the high-level API.
5921
5922         * class.cs (TypeContainer.AddIterator): New method.
5923         (TypeContainer.DoDefineType): New protected virtual method, which
5924         is called from DefineType().
5925         (TypeContainer.DoDefineMembers): Call DefineType() and
5926         DefineMembers() on all our iterators.
5927         (TypeContainer.Emit): Call Emit() on all our iterators.
5928         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5929
5930         * codegen.cs (EmitContext.CurrentIterator): New public field.
5931
5932 2004-07-15  Martin Baulig  <martin@ximian.com>
5933
5934         * typemanager.cs
5935         (TypeManager.not_supported_exception_type): New type.   
5936
5937 2004-07-14  Martin Baulig  <martin@ximian.com>
5938
5939         * typemanager.cs
5940         (TypeManager.generic_ienumerable_type): New type.
5941         (TypeManager.generic_ienumerator_type): New type.
5942
5943         * rootcontext.cs
5944         (RootContext.interfaces_first_stage): Added
5945         "System.Collections.Generic.IEnumerator`1" and
5946         "System.Collections.Generic.IEnumerable`1".     
5947
5948 2004-07-14  Martin Baulig  <martin@ximian.com>
5949
5950         * iterators.cs: Use real error numbers.
5951
5952 2004-07-14  Martin Baulig  <martin@ximian.com>
5953
5954         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5955         requires this to be a System.Collection.IEnumerable and not a
5956         class implementing that interface.
5957         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5958
5959 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5960
5961         * class.cs: Fixed previous fix, it broke some error tests.
5962
5963 2004-07-12  Martin Baulig  <martin@ximian.com>
5964
5965         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5966         Fixes #61293.
5967
5968 2004-07-14  Martin Baulig  <martin@ximian.com>
5969
5970         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5971         an exclamation mark (!) for the generic arity to reflect the
5972         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5973
5974 2004-07-13  Martin Baulig  <martin@ximian.com>
5975
5976         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5977         specifiers being part of a type argument.
5978
5979 2004-07-13  Martin Baulig  <martin@ximian.com>
5980
5981         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5982         name for generic types.
5983
5984 2004-07-13  Martin Baulig  <martin@ximian.com>
5985
5986         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5987         bit to fix #60119.
5988
5989 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5990
5991         * assign.cs (LocalTemporary): Add new argument: is_address,If
5992         `is_address' is true, then the value that we store is the address
5993         to the real value, and not the value itself.
5994         
5995         * ecore.cs (PropertyExpr): use the new local temporary
5996         stuff to allow us to handle X.Y += z (where X is a struct)
5997
5998 2004-07-08  Martin Baulig  <martin@ximian.com>
5999
6000         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6001         not always return, just like we're doing in Using.Resolve().
6002
6003 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6004
6005         * cs-parser.jay (fixed_statement): flag this as Pinned.
6006
6007 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6008
6009         * typemanager.cs (TypeManager): Removed MakePinned method, this
6010         mechanism is replaced with the .NET 2.x compatible mechanism of
6011         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6012
6013         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6014         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6015         `IsFixed' property which has a different meaning.
6016
6017 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6018
6019         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6020         visible from inside a nested class, not just the names of the
6021         immediately enclosing class.
6022         Fix for bug #60730.
6023
6024 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6025
6026         * expression.cs (BetterConversion): Remove buggy special-case
6027         handling of "implicit constant expression conversions".  At this
6028         point, we already know that the conversion is possible -- we're
6029         only checking to see which is better.
6030
6031 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6032
6033         * cs-parser.jay: Added error CS0210 test.
6034
6035 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6036
6037         * cs-parser.jay: Added error CS0134 test.
6038
6039 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6040
6041         Fix bug #52507
6042         * cs-parser.jay: Added error CS0145 test.
6043
6044 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6045
6046         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6047
6048 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6049         
6050         * expression.cs (StackAlloc.Resolve): The argument may not
6051         be a constant; deal with this case.
6052         
6053 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6054
6055         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6056         GetIndexerAttributeValue.
6057         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6058
6059         * class.cs (Indexer.Define): Added error tests for CS0415,
6060         CS0609.
6061
6062 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6063
6064         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6065         property code.
6066
6067 2004-06-23  Martin Baulig  <martin@ximian.com>
6068
6069         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6070         neither return nor throw, reset the barrier as well.  Fixes #60457.
6071
6072 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6073
6074         * class.cs : EventAttributes is now set to None by default.
6075           This fixes bug #60459.
6076
6077 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6078
6079         Fix bug #60219
6080         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6081         Don't throw exception but return null (it's sufficient now).
6082
6083 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6084
6085         * typemanager.cs (GetArgumentTypes): Faster implementation.
6086
6087 2004-06-18  Martin Baulig  <martin@ximian.com>
6088
6089         * attribute.cs (Attribute.Resolve): Check whether we're an
6090         EmptyCast which a Constant child.  Fixes #60333.
6091
6092 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6093
6094         * statement.cs (EmitCollectionForeach): Account for the fact that
6095         not all valuetypes are in areas which we can take the address of.
6096         For these variables, we store to a temporary variable. Also, make
6097         sure that we dont emit a `callvirt' on a valuetype method.
6098
6099 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6100
6101         * expression.cs (StackAlloc.DoReSolve): Added test for
6102         negative parameter (CS0247).
6103
6104 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6105
6106         Fix bug #59792
6107         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6108
6109 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6110
6111         Fix bug #59781
6112         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6113         ulong.
6114
6115 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6116
6117         Fix bug #58254 & cs1555.cs, cs1556.cs
6118         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6119
6120 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6121
6122         * cs-parser.jay: Added error CS1669 test for indexers.
6123
6124 2004-06-18  Martin Baulig  <martin@ximian.com>
6125
6126         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6127         argument.  Fixes #60441.
6128
6129 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6130         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6131         The name needs to have the actual name of the method in order
6132         for other tests (such as the one in OverloadResolve for Invoke
6133         on a delegate) to work. As well, it does not really help
6134         error reporting because the method group had multiple methods.
6135         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6136         Make profiling work.
6137         
6138 2004-06-13  Martin Baulig  <martin@ximian.com>
6139
6140         * cs-parser.jay: Don't allow generic attributes.
6141
6142 2004-06-13  Martin Baulig  <martin@ximian.com>
6143
6144         * class.cs (MemberBase.DoDefineBase): New protected method.
6145         (MemberBase.DoDefine): Compute the `flags' in the new
6146         DoDefineBase() which must be called first.
6147         (Method.Define): Call DoDefineBase() first so we have the flags
6148         when defining the generic method.
6149
6150         * cs-parser.jay (interface_method_declaration): Support generic methods.
6151
6152 2004-06-13  Martin Baulig  <martin@ximian.com>
6153
6154         * decl.cs (TypeName): Removed.
6155         (MemberName): Removed TypeName and MemberNow; now we just have
6156         MemberName.
6157
6158         * cs-parser.jay: Don't distinguish between type arguments and type
6159         parameters in the grammar and simplified the rules a bit.  The
6160         reduce/reduce conflicts are now gone (except the one we inherited
6161         from mcs).
6162
6163 2004-06-11  Martin Baulig  <martin@ximian.com>
6164
6165         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6166         call this twice: for params and varargs methods.
6167
6168 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6169
6170         * class.cs:
6171         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6172
6173 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6174
6175         * attribute.cs (Attribute.GetValidTargets): Made public.
6176
6177         * class.cs: 
6178         (AbstractPropertyEventMethod): New class for better code sharing.
6179         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6180         CS1667 report.
6181         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6182
6183 2004-06-09  Martin Baulig  <martin@ximian.com>
6184
6185         * cs-parser.jay: Removed a reduce/reduce conflict.
6186
6187 2004-06-03  Martin Baulig  <martin@ximian.com>
6188
6189         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6190         GetSimpleName() and return a SimpleName.
6191
6192         * ecore.cs (SimpleName.Arguments): New public field.
6193         (SimpleName): Added overloaded ctor which takes an additional
6194         TypeArguments argument.
6195         (SimpleName.SimpleNameResolve): Added support for generic methods.
6196         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6197         formerly in MemberAccess.DoResolve(), but we also need it in
6198         SimpleNameResolve().
6199
6200         * expression.cs (MemberAccess.DoResolve): Use the new
6201         MethodGroupExpr.ResolveGeneric().       
6202
6203 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6204
6205         * decl.cs: If possible, use lookuptypedirect here. We can only do
6206         this if there is no `.' after the namespace. Avoids using
6207         LookupType, which does lots of slow processing.
6208         (FindNestedType) New method, does what it says :-).
6209         * namespace.cs: use LookupTypeDirect.
6210         * rootcontext.cs: use membercache, if possible.
6211         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6212
6213 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6214
6215         * expression.cs:
6216         According to the spec, 
6217
6218         In a member access of the form E.I, if E is a single identifier,
6219         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6220         field, property, localvariable, or parameter with the same type as
6221         the meaning of E as a type-name (§3.8), then both possible
6222         meanings of E are permitted.
6223
6224         We did not check that E as a simple-name had the same type as E as
6225         a type name.
6226
6227         This trivial check gives us 5-7% on bootstrap time.
6228
6229 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6230
6231         * expression.cs (Invocation.OverloadResolve): Avoid the
6232         use of hashtables and boxing here by allocating on demand.
6233
6234 2004-05-30  Martin Baulig  <martin@ximian.com>
6235
6236         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6237         we're doing a silent lookup.  Don't try to lookup nested types in
6238         TypeManager.object_type (thanks to Ben Maurer).
6239
6240 2004-05-30  Martin Baulig  <martin@ximian.com>
6241
6242         Committing a patch from Ben Maurer.
6243
6244         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6245
6246 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6247
6248         * convert.cs: add a trivial cache for overload operator resolution.
6249
6250 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6251
6252         * attribute.cs
6253         (AttributeTester.GetObsoleteAttribute): Returns instance of
6254         ObsoleteAttribute when type is obsolete.
6255
6256         * class.cs
6257         (TypeContainer.VerifyObsoleteAttribute): Override.
6258         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6259         (MethodCode.VerifyObsoleteAttribute): Override.
6260         (MemberBase.VerifyObsoleteAttribute): Override.
6261
6262         * decl.cs
6263         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6264         and report proper error.
6265
6266         *delegate.cs
6267         (Delegate.VerifyObsoleteAttribute): Override.
6268
6269         * ecore.cs
6270         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6271         and report proper error.
6272         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6273
6274         * enum.cs
6275         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6276         and enum member.
6277
6278         * expression.cs
6279         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6280         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6281         Added test for ObsoleteAttribute.
6282
6283         * statement.cs
6284         (Catch): Derived from Statement.
6285
6286 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6287
6288         * decl.cs: If possible, use lookuptypedirect here. We can only do
6289         this if there is no `.' after the namespace. Avoids using
6290         LookupType, which does lots of slow processing.
6291         (FindNestedType) New method, does what it says :-).
6292         * namespace.cs: use LookupTypeDirect.
6293         * rootcontext.cs: use membercache, if possible.
6294         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6295
6296 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6297
6298         * expression.cs:
6299         According to the spec, 
6300
6301         In a member access of the form E.I, if E is a single identifier,
6302         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6303         field, property, localvariable, or parameter with the same type as
6304         the meaning of E as a type-name (§3.8), then both possible
6305         meanings of E are permitted.
6306
6307         We did not check that E as a simple-name had the same type as E as
6308         a type name.
6309
6310         This trivial check gives us 5-7% on bootstrap time.
6311
6312 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6313
6314         Fixed bug #59071 & cs0160.cs
6315         * statement.cs (Try.Resolve): Check here whether order of catch
6316         clauses matches their dependencies.
6317
6318 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6319
6320         Fixed bug #58624
6321         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6322         unsafe type.
6323
6324 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6325
6326         * expression.cs (Invocation.OverloadResolve): Avoid the
6327         use of hashtables and boxing here by allocating on demand.
6328
6329 2004-05-30  Martin Baulig  <martin@ximian.com>
6330
6331         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6332         we're doing a silent lookup.  Don't try to lookup nested types in
6333         TypeManager.object_type (thanks to Ben Maurer).
6334
6335 2004-05-30  Martin Baulig  <martin@ximian.com>
6336
6337         Committing a patch from Ben Maurer.
6338
6339         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6340
6341 2004-05-29  Martin Baulig  <martin@ximian.com>
6342
6343         * class.cs (IMethodData.ShouldIgnore): New method.
6344
6345         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6346         `Location' argument, we don't need it anywhere.  Use
6347         `IMethodData.ShouldIgnore ()' instead of
6348         `MethodData.GetMethodFlags ()'.
6349         (TypeManager.AddMethod): Removed.
6350         (TypeManager.AddMethod2): Renamed to AddMethod.
6351
6352 2004-05-29  Martin Baulig  <martin@ximian.com>
6353
6354         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6355
6356         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6357         converting from a class type S to an interface type and we already
6358         have an object on the stack, don't box it again.  Fixes #52578.
6359
6360 2004-05-29  Martin Baulig  <martin@ximian.com>
6361
6362         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6363         Added support for `params' parameters.  Fixes #59267.
6364
6365 2004-05-29  Martin Baulig  <martin@ximian.com>
6366
6367         * literal.cs (NullPointer): Provide a private .ctor which sets
6368         `type' to TypeManager.object_type.  Fixes #59048.
6369
6370 2004-05-29  Martin Baulig  <martin@ximian.com>
6371
6372         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6373         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6374
6375         * ecore.cs (EventExpr.instance_expr): Make the field private.
6376
6377 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6378
6379         Fixed bug #50080 & cs0214-2.cs
6380         * expression.cs (Cast.DoResolve): Check unsafe context here.
6381         
6382         * statement.cs (Resolve.DoResolve): Likewise.
6383
6384 2004-05-26  Martin Baulig  <martin@ximian.com>
6385
6386         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6387
6388         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6389         (RootContext.LookupType): Pass down the `silent' flag.
6390
6391 2004-05-25  Martin Baulig  <martin@ximian.com>
6392
6393         * expression.cs
6394         (MethodGroupExpr.IdenticalTypeName): New public property.
6395         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6396         expression actually refers to a type.
6397
6398 2004-05-25  Martin Baulig  <martin@ximian.com>
6399
6400         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6401         for #56176 and made it actually work.
6402
6403 2004-05-25  Martin Baulig  <martin@ximian.com>
6404
6405         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6406         (FieldExpr, PropertyExpr): Override and implement
6407         CacheTemporaries.  Fixes #52279.
6408
6409 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6410
6411         * location.cs: In the new compiler listing a file twice is a
6412         warning, not an error.
6413
6414 2004-05-24  Martin Baulig  <martin@ximian.com>
6415
6416         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6417         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6418
6419 2004-05-24  Martin Baulig  <martin@ximian.com>
6420
6421         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6422         walking the `using' list.  Fixes #53921.
6423
6424 2004-05-24  Martin Baulig  <martin@ximian.com>
6425
6426         * const.cs (Const.LookupConstantValue): Added support for
6427         EmptyCast's; fixes #55251.
6428
6429 2004-05-24  Martin Baulig  <martin@ximian.com>
6430
6431         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6432         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6433         which does the CS0135 check.  The reason is that we first need to
6434         check whether the variable actually exists.
6435
6436 2004-05-24  Martin Baulig  <martin@ximian.com>
6437
6438         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6439         than RootContext.LookupType() to find the explicit interface
6440         type.  Fixes #58584.
6441
6442 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6443
6444         * Makefile: Simplify.  Use executable.make.
6445         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6446
6447 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6448
6449         * decl.cs:
6450         * enum.cs:
6451         Use the invariant culture when doing String.Compare for CLS case
6452         sensitivity.
6453         
6454 2004-05-23  Martin Baulig  <martin@ximian.com>
6455
6456         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6457         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6458
6459         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6460
6461 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6462
6463         * class.cs (MemberBase.Define): Reuse MemberType member for 
6464         resolved type. Other methods can use it too.
6465
6466 2004-05-23  Martin Baulig  <martin@ximian.com>
6467
6468         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6469         the variable also exists in the current block (otherwise, we need
6470         to report a CS0103).  Fixes #58670.
6471
6472 2004-05-23  Martin Baulig  <martin@ximian.com>
6473
6474         * flowanalysis.cs (Reachability.Reachable): Compute this
6475         on-the-fly rather than storing it as a field.
6476
6477 2004-05-23  Martin Baulig  <martin@ximian.com>
6478
6479         * flowanalysis.cs (Reachability.And): Manually compute the
6480         resulting `barrier' from the reachability.      
6481        
6482 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6483
6484         Fix bug #57835
6485         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6486         instance of ObsoleteAttribute when symbol is obsolete.
6487
6488         * class.cs
6489         (IMethodData): Extended interface for ObsoleteAttribute support.
6490
6491 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6492
6493         * attribute.cs: Fix bug #55970
6494
6495 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6496
6497         Fix bug #52705
6498         * attribute.cs
6499         (GetObsoleteAttribute): New method. Creates the instance of
6500         ObsoleteAttribute.
6501         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6502         ObsoleteAttribute when member is obsolete.
6503         (AttributeTester.Report_ObsoleteMessage): Common method for
6504         Obsolete error/warning reporting.
6505
6506         * class.cs
6507         (TypeContainer.base_classs_type): New member for storing parent type.
6508
6509         * decl.cs
6510         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6511         for this MemberCore.
6512
6513 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6514
6515         * attribute.cs, const.cs: Fix bug #58590
6516
6517 2004-05-21  Martin Baulig  <martin@ximian.com>
6518
6519         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6520         out parameters if the end of the method is unreachable.  Fixes
6521         #58098. 
6522
6523 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6524
6525         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6526         Hari was right, why extra method.
6527
6528 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6529
6530         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6531
6532 2004-05-20  Martin Baulig  <martin@ximian.com>
6533
6534         * delegate.cs: Convert this file to Unix mode - like the original
6535         version in mcs is.
6536
6537 2004-05-20  Martin Baulig  <martin@ximian.com>
6538
6539         * attribute.cs: Convert this file to Unix mode - like the original
6540         version in mcs is.
6541
6542 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6543
6544        Fix bug #58688 (MCS does not report error when the same attribute
6545        is assigned twice)
6546
6547        * attribute.cs (Attribute.Emit): Distinction between null and default.
6548
6549 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6550
6551        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6552        of a top-level attribute without an attribute target.
6553        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6554        Make non-static.
6555        (Attribute.Conditional_GetConditionName), 
6556        (Attribute.Obsolete_GetObsoleteMessage): Update.
6557        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6558        part of ScanForIndexerName.
6559        (Attribute.CanIgnoreInvalidAttribute): New function.
6560        (Attribute.ScanForIndexerName): Move to ...
6561        (Attributes.ScanForIndexerName): ... here.
6562        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6563        (Attributes.Search): New internal variant that can choose not to
6564        complain if types aren't resolved.  The original signature now
6565        complains.
6566        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6567        complaints suppressed.
6568        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6569        only if it not useful.
6570        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6571        top-level for attributes that are shared between the assembly
6572        and a top-level class.
6573        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6574        * class.cs: Update to reflect changes.
6575        (DefineIndexers): Fuse loops.
6576        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6577        a couple more variants of attribute names.
6578
6579 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6580
6581         Fix bug #52585 (Implemented explicit attribute declaration)
6582
6583         * attribute.cs:
6584         (Attributable.ValidAttributeTargets): New abstract method. It gets
6585         list of valid attribute targets for explicit target declaration.
6586         (Attribute.Target): It holds target itself.
6587         (AttributeSection): Removed.
6588         (Attribute.CheckTargets): New method. It checks whether attribute
6589         target is valid for the current element.
6590
6591         * class.cs:
6592         (EventProperty): New class. For events that are declared like
6593         property (with add and remove accessors).
6594         (EventField): New class. For events that are declared like field.
6595         class.cs
6596
6597         * cs-parser.jay: Implemented explicit attribute target declaration.
6598
6599         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6600         Override ValidAttributeTargets.
6601
6602         * parameter.cs:
6603         (ReturnParameter): Class for applying custom attributes on 
6604         the return type.
6605         (ParameterAtribute): New class. Class for applying custom
6606         attributes on the parameter type.
6607
6608 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6609
6610         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6611         definitions. 
6612
6613         (Method): Allow UNSAFE here.
6614
6615         * modifiers.cs: Support unsafe reporting.
6616
6617 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6618
6619         * decl.cs: Fix bug #58478.
6620
6621 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6622
6623         * statement.cs: When checking for unreachable code on an EmptyStatement,
6624         set the location. Fixes bug #58488.
6625
6626 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6627
6628         * driver.cs: Add -pkg handling.
6629
6630         From Gonzalo: UseShelLExecute=false
6631
6632 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6633
6634         * attribute.cs:
6635         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6636         for attribute.
6637         (Attribute.IsClsCompliaceRequired): Moved to base for better
6638         accesibility.
6639         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6640         when attribute is AttributeUsageAttribute.
6641         (Attribute.GetValidTargets): Simplified.
6642         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6643         attribute for this type.
6644         (Attribute.ApplyAttributes): Method renamed to Emit and make
6645         non-static.
6646         (GlobalAttributeSection): New class for special handling of global
6647         attributes (assembly, module).
6648         (AttributeSection.Emit): New method.
6649
6650         * class.cs: Implemented Attributable abstract methods.
6651         (MethodCore.LabelParameters): Moved to Parameter class.
6652         (Accessor): Is back simple class.
6653         (PropertyMethod): Implemented Attributable abstract class.
6654         (DelegateMethod): Implemented Attributable abstract class.
6655         (Event): New constructor for disctintion between normal Event
6656         and Event with accessors.
6657
6658         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6659
6660         * codegen.cs, const.cs, decl.cs, delegate.cs:
6661         (CommonAssemblyModulClass): Implemented Attributable abstract class
6662         and simplified.
6663
6664         * enum.cs: Implement IAttributeSupport interface.
6665         (EnumMember): New class for emum members. Implemented Attributable
6666         abstract class
6667
6668         * parameter.cs:
6669         (ParameterBase): Is abstract.
6670         (ReturnParameter): New class for easier [return:] attribute handling.
6671
6672         * typemanager.cs: Removed builder_to_attr.
6673
6674 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6675
6676         Fix bug #57151.
6677         * attribute.cs (Attribute.GetPositionalValue): New function.
6678         * class.cs (TypeContainer.VerifyMembers): New function.
6679         (TypeContainer.Emit): Use it.
6680         (ClassOrStruct): New base class for Class and Struct.
6681         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6682         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6683         class.
6684         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6685         then each non-static field should have a FieldOffset attribute.
6686         Otherwise, none of the fields should have a FieldOffset attribute.
6687         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6688         and FieldOffset attributes.
6689         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6690         (TypeManager.field_offset_attribute_type): New core types.
6691         (TypeManager.InitCoreTypes): Initialize them.
6692
6693 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6694
6695         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6696         Return correct type.
6697         From bug #58270.
6698
6699 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6700
6701         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6702         be implicitly converted to ulong.
6703         
6704         * expression.cs: The logic for allowing operator &, | and ^ worked
6705         was wrong, it worked before because we did not report an error in
6706         an else branch.  Fixes 57895.
6707
6708         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6709         allow volatile fields to be reference types.
6710
6711 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6712
6713         * driver.cs: Add support for /debug-
6714
6715 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6716
6717         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6718         Add a 'complain' parameter to silence errors.
6719         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6720         silently overlooked type-resolutions.
6721         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6722         to reflect changes.
6723         (Attributes.Search): New function.
6724         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6725         (Attributes.GetAttributeFullName): Remove hack.
6726         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6727         Update to reflect changes.
6728         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6729         Use Attributes.Search instead of nested loops.
6730
6731 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6732
6733         * decl.cs:
6734         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6735         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6736         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6737
6738         * report.cs: (Report.Warning): Renamed to Warning_T because of
6739         parameter collision.
6740
6741 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6742
6743         * expression.cs (MemberAccess.ResolveMemberAccess):
6744         Exit with non-zero status after Report.Error.
6745         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6746         Likewise.
6747         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6748
6749 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6750
6751         * support.cs: Don't hang when the file is empty.
6752
6753 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6754
6755         * support.cs: In SeekableStreamReader, compute the preamble size of the
6756           underlying stream. Position changes should take into account that initial
6757           count of bytes.
6758
6759 2004-05-03  Todd Berman  <tberman@sevenl.net>
6760
6761         * driver.cs: remove unused GetSysVersion function.
6762
6763 2004-05-03  Todd Berman  <tberman@sevenl.net>
6764
6765         * driver.cs: Remove the hack from saturday, as well as the hack
6766         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6767         link_paths to get that bit proper.
6768
6769 2004-05-01  Todd Berman  <tberman@sevenl.net>
6770
6771         * driver.cs: Try a LoadFrom before a Load, this checks the current
6772         path. This is currently a bug in mono that is be fixed, however, this
6773         provides a workaround for now. This will be removed when the bug
6774         is fixed.
6775
6776 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6777
6778         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6779         incomplete key pairs (#57941).
6780
6781 2004-05-01  Todd Berman  <tberman@sevenl.net>
6782
6783         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6784         from the GAC
6785
6786 2004-04-30  Jackson Harper  <jackson@ximian.com>
6787
6788         * codegen.cs: Open keys readonly.
6789         
6790 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6791
6792         * typemanager.cs: don't report cyclic struct layout when a struct
6793         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6794         which has 2 Pango.Rectangle fields.
6795
6796 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6797
6798         * expression.cs: Handle IntPtr comparisons with IL code
6799         rather than a method call.
6800
6801 2004-04-29  Martin Baulig  <martin@ximian.com>
6802
6803         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6804         the list of PropertyInfo's in class hierarchy and find the
6805         accessor.  Fixes #56013.
6806
6807 2004-04-29  Martin Baulig  <martin@ximian.com>
6808
6809         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6810
6811 2004-04-29  Martin Baulig  <martin@ximian.com>
6812
6813         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6814
6815         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6816
6817 2004-04-29  Martin Baulig  <martin@ximian.com>
6818
6819         * class.cs (ConstructorInitializer.Resolve): Check whether the
6820         parent .ctor is accessible.  Fixes #52146.
6821
6822 2004-04-29  Martin Baulig  <martin@ximian.com>
6823
6824         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6825
6826         * statement.cs (Using.EmitLocalVariableDecls): Use
6827         TypeManager.idisposable_type, not typeof (IDisposable).
6828         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6829
6830 2004-04-29  Martin Baulig  <martin@ximian.com>
6831
6832         * class.cs (Event.Define): Don't emit the field and don't set
6833         RTSpecialName and SpecialName for events on interfaces.  Fixes
6834         #57703. 
6835
6836 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6837
6838         Refactor Attribute.ApplyAttributes.
6839         * attribute.cs (Attributable): New base class for objects that can
6840         have Attributes applied on them.
6841         (Attribute): Make AttributeUsage fields public.
6842         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6843         (Attribute.IsInternalCall): New property.
6844         (Attribute.UsageAttr): Convert to a public read-only property.
6845         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6846         (Attribute.ResolveType, Attribute.Resolve)
6847         (Attribute.ScanForIndexerName): Update to reflect changes.
6848         (Attribute.CheckAttributeTarget): Re-format.
6849         (Attribute.ApplyAttributes): Refactor, to various
6850         Attributable.ApplyAttributeBuilder methods.
6851         * decl.cs (MemberCore): Make Attributable.
6852         * class.cs (Accessor): Make Attributable.
6853         (MethodData.ApplyAttributes): Use proper attribute types, not
6854         attribute names.
6855         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6856         (TypeContainer.ApplyAttributeBuilder)
6857         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6858         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6859         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6860         (Operator.ApplyAttributeBuilder): New factored-out methods.
6861         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6862         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6863         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6864         * parameter.cs (ParameterBase): New Attributable base class
6865         that can also represent Return types.
6866         (Parameter): Update to the changes.
6867
6868 2004-04-29  Jackson Harper  <jackson@ximian.com>
6869
6870         * driver.cs: Prefer the corlib system version when looking for
6871         assemblies in the GAC. This is still a hack, but its a better hack
6872         now.
6873         
6874 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6875
6876         * decl.cs, enum.cs: Improved error 3005 reporting.
6877   
6878         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6879         (related_symbols): New private member for list of symbols
6880         related to reported error/warning.
6881         
6882         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6883
6884 2004-04-29  Martin Baulig  <martin@ximian.com>
6885
6886         * ecore.cs (Expression.Constantify): If we're an enum and
6887         TypeManager.TypeToCoreType() doesn't give us another type, use
6888         t.UnderlyingSystemType.  Fixes #56178.  
6889
6890 2004-04-29  Martin Baulig  <martin@ximian.com>
6891
6892         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6893         interfaces and for each interface, only add members directly
6894         declared in that interface.  Fixes #53255.
6895
6896 2004-04-28  Martin Baulig  <martin@ximian.com>
6897
6898         * expression.cs (ConditionalLogicalOperator): Use a temporary
6899         variable for `left' to avoid that we evaluate it more than once;
6900         bug #52588.
6901
6902 2004-04-28  Martin Baulig  <martin@ximian.com>
6903
6904         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6905         `void[]' (CS1547).
6906
6907 2004-04-28  Martin Baulig  <martin@ximian.com>
6908
6909         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6910         void (CS1547).
6911
6912         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6913         whether the type is not void (CS1547).
6914
6915 2004-04-28  Martin Baulig  <martin@ximian.com>
6916
6917         * expression.cs (Unary.DoResolveLValue): Override this and report
6918         CS0131 for anything but Operator.Indirection.
6919
6920 2004-04-28  Martin Baulig  <martin@ximian.com>
6921
6922         Committing a patch from Ben Maurer; see bug #50820.
6923
6924         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6925         check for classes.
6926
6927         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6928         classes.        
6929
6930 2004-04-28  Martin Baulig  <martin@ximian.com>
6931
6932         Committing a patch from Ben Maurer; see bug #50820.
6933
6934         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6935         check for classes.
6936
6937         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6938         classes.        
6939
6940 2004-04-28  Martin Baulig  <martin@ximian.com>
6941
6942         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6943         (Block.AddLabel): Call DoLookupLabel() to only search in the
6944         current block.
6945
6946 2004-04-28  Martin Baulig  <martin@ximian.com>
6947
6948         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6949         comparing StringConstants and NullLiterals in Equality and Inequality.
6950
6951 2004-04-28  Jackson Harper  <jackson@ximian.com>
6952
6953         * driver.cs: Attempt to load referenced assemblies from the
6954         GAC. This is the quick and dirty version of this method that
6955         doesnt take into account versions and just takes the first
6956         canidate found. Will be good enough for now as we will not have more
6957         then one version installed into the GAC until I update this method.
6958
6959 2004-04-28  Martin Baulig  <martin@ximian.com>
6960
6961         * typemanager.cs (TypeManager.CheckStructCycles): New public
6962         static method to check for cycles in the struct layout.
6963
6964         * rootcontext.cs (RootContext.PopulateTypes): Call
6965         TypeManager.CheckStructCycles() for each TypeContainer.
6966         [Note: We only need to visit each type once.]
6967
6968 2004-04-28  Martin Baulig  <martin@ximian.com>
6969
6970         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6971
6972         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6973         success and added `out object value'.  Use a `bool resolved' field
6974         to check whether we've already been called rather than
6975         `ConstantValue != null' since this breaks for NullLiterals.
6976
6977 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6978
6979         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6980         setting of this flag, since the 'set' method may be non-public.
6981
6982 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6983
6984         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6985         check on current_vector.Block.
6986
6987 2004-04-27  Martin Baulig  <martin@ximian.com>
6988
6989         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6990         a field initializer.  Fixes #56459.
6991
6992 2004-04-27  Martin Baulig  <martin@ximian.com>
6993
6994         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6995         we're not attempting to use an indexer.  Fixes #52154.
6996
6997 2004-04-27  Martin Baulig  <martin@ximian.com>
6998
6999         * statement.cs (Return): Don't create a return label if we don't
7000         need it; reverts my change from January 20th.  Thanks to Ben
7001         Maurer for this.
7002
7003 2004-04-27  Martin Baulig  <martin@ximian.com>
7004
7005         According to the spec, `goto' can only leave a nested scope, but
7006         never enter it.
7007
7008         * statement.cs (Block.LookupLabel): Only lookup in the current
7009         block, don't recurse into parent or child blocks.
7010         (Block.AddLabel): Check in parent and child blocks, report
7011         CS0140/CS0158 if we find a duplicate.
7012         (Block): Removed this indexer for label lookups.
7013         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7014         this already does the error reporting for us.
7015
7016         * flowanalysis.cs
7017         (FlowBranching.UsageVector.Block): New public variable; may be null.
7018         (FlowBranching.CreateSibling): Added `Block' argument.
7019         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7020         label for the target of a `goto' and check whether we're not
7021         leaving a `finally'.
7022
7023 2004-04-27  Martin Baulig  <martin@ximian.com>
7024
7025         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7026         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7027         just for returns).
7028
7029 2004-04-27  Martin Baulig  <martin@ximian.com>
7030
7031         * statement.cs (Block.AddLabel): Also check for implicit blocks
7032         and added a CS0158 check.
7033
7034 2004-04-27  Martin Baulig  <martin@ximian.com>
7035
7036         * flowanalysis.cs (FlowBranchingLoop): New class.
7037         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7038         UsageVector's instead of an ArrayList.
7039         (FlowBranching.Label): Likewise.
7040         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7041         (FlowBranching.AddBreakVector): New method.
7042
7043 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7044
7045         * attribute.cs: Small regression fix: only convert the type if we
7046         the type is different, fixes System.Drawing build.
7047
7048 2004-04-27  Martin Baulig  <martin@ximian.com>
7049
7050         * attribute.cs (Attribute.Resolve): If we have a constant value
7051         for a named field or property, implicity convert it to the correct
7052         type.
7053
7054 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7055
7056         * statement.cs (Block.Block): Implicit blocks share
7057         'child_variable_names' fields with parent blocks.
7058         (Block.AddChildVariableNames): Remove.
7059         (Block.AddVariable): Mark variable as "used by a child block" in
7060         every surrounding block.
7061         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7062         been used in a child block, complain about violation of "Invariant
7063         meaning in blocks" rule.
7064         * cs-parser.jay (declare_local_variables): Don't use
7065         AddChildVariableNames.
7066         (foreach_statement): Don't create an implicit block: 'foreach'
7067         introduces a scope.
7068
7069 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7070
7071         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7072         converting from 0L to ulong.  Fixes 57522.
7073
7074 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7075
7076         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7077         derived class hides via 'new' keyword field from base class (test-242.cs).
7078         TODO: Handle this in the more general way.
7079         
7080         * class.cs (CheckBase): Ditto.
7081
7082 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7083
7084         * decl.cs (caching_flags): New member for storing cached values
7085         as bit flags.
7086         (MemberCore.Flags): New enum where bit flags for caching_flags
7087         are defined.
7088         (MemberCore.cls_compliance): Moved to caching_flags.
7089         (DeclSpace.Created): Moved to caching_flags.
7090
7091         * class.cs: Use caching_flags instead of DeclSpace.Created
7092         
7093 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7094
7095         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7096         if we are only a derived class, not a nested class.
7097
7098         * typemanager.cs: Same as above, but do this at the MemberLookup
7099         level (used by field and methods, properties are handled in
7100         PropertyExpr).   Allow for the qualified access if we are a nested
7101         method. 
7102
7103 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7104
7105         * class.cs: Refactoring.
7106         (IMethodData): New inteface; Holds links to parent members
7107         to avoid member duplication (reduced memory allocation).
7108         (Method): Implemented IMethodData interface.
7109         (PropertyBase): New inner classes for get/set methods.
7110         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7111         (Event): New inner classes for add/remove methods.
7112         (Event.DelegateMethod): Implemented IMethodData interface.
7113
7114         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7115         EmitContext (related to class.cs refactoring).
7116
7117 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7118
7119         * delegate.cs (Delegate.VerifyApplicability): If the number of
7120         arguments are the same as the number of parameters, first try to
7121         verify applicability ignoring  any 'params' modifier on the last
7122         parameter.
7123         Fixes #56442.
7124
7125 2004-04-08  Martin Baulig  <martin@ximian.com>
7126
7127         Merged latest changes into gmcs.  Please keep this comment in
7128         here, it makes it easier for me to see what changed in MCS since
7129         the last time I merged.
7130
7131 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7132
7133         * class.cs (TypeContainer.AddIndexer): Use
7134         'ExplicitInterfaceName' to determine if interface name was
7135         explicitly specified.  'InterfaceType' is not initialized at this time.
7136         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7137         Indexers array is already in the required order.  Initialize
7138         'IndexerName' only if there are normal indexers.
7139         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7140         (TypeContainer.Emit): Emit DefaultMember attribute only if
7141         IndexerName is initialized.
7142         Fixes #56300.
7143
7144 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7145
7146         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7147         Fixes #57007
7148
7149 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7150
7151         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7152         attributes.
7153         Fix for #56456.
7154
7155         * attribute.cs (Attribute.Resolve): Check for duplicate named
7156         attributes.
7157         Fix for #56463.
7158
7159 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7160
7161         * iterators.cs (MarkYield): track whether we are in an exception,
7162         and generate code accordingly.  Use a temporary value to store the
7163         result for our state.
7164
7165         I had ignored a bit the interaction of try/catch with iterators
7166         since their behavior was not entirely obvious, but now it is
7167         possible to verify that our behavior is the same as MS .NET 2.0
7168
7169         Fixes 54814
7170
7171 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7172
7173         * iterators.cs: Avoid creating temporaries if there is no work to
7174         do. 
7175
7176         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7177         Enumerations, use TypeManager.EnumToUnderlying and call
7178         recursively. 
7179
7180         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7181         bug #57013
7182
7183         (This.Emit): Use EmitContext.EmitThis to emit our
7184         instance variable.
7185
7186         (This.EmitAssign): Ditto.
7187
7188         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7189         codepaths, we will move all the functionality into
7190         Mono.CSharp.This 
7191
7192         (FieldExpr.EmitAssign): Ditto.
7193
7194         This fixes several hidden bugs that I uncovered while doing a code
7195         review of this today.
7196
7197         * codegen.cs (EmitThis): reworked so the semantics are more clear
7198         and also support value types "this" instances.
7199
7200         * iterators.cs: Changed so that for iterators in value types, we
7201         do not pass the value type as a parameter.  
7202
7203         Initialization of the enumerator helpers is now done in the caller
7204         instead of passing the parameters to the constructors and having
7205         the constructor set the fields.
7206
7207         The fields have now `assembly' visibility instead of private.
7208
7209 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7210
7211         * expression.cs (Argument.Resolve): Check if fields passed as ref
7212         or out are contained in a MarshalByRefObject.
7213
7214         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7215         another compiler type.
7216
7217 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7218
7219         * class.cs (Indexer.Define): use the new name checking method.
7220         Also, return false on an error.
7221         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7222         (is_identifier_[start/part]_character): make static.
7223
7224 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7225
7226         * expression.cs (Binary.ResolveOperator): Do no append strings
7227         twice: since we can be invoked more than once (array evaluation)
7228         on the same concatenation, take care of this here.  Based on a fix
7229         from Ben (bug #56454)
7230
7231 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7232
7233         * codegen.cs: Fix another case where CS1548 must be reported (when 
7234         delay-sign isn't specified and no private is available #56564). Fix
7235         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7236         error when MCS is used on the MS runtime and we need to delay-sign 
7237         (which seems unsupported by AssemblyBuilder - see #56621).
7238
7239 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7240
7241         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7242         (TypeManager.ComputeNamespaces): Faster implementation for
7243         Microsoft runtime.
7244
7245         * compiler.csproj: Updated AssemblyName to mcs.
7246
7247 2004-05-11  Jackson Harper  <jackson@ximian.com>
7248
7249         * Makefile: Preserve MONO_PATH
7250         
7251 2004-05-11  Jackson Harper  <jackson@ximian.com>
7252
7253         * Makefile: Use mono and mcs to build gmcs
7254         
7255 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7256
7257         * codegen.cs: Add patch from Robert Shade
7258         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7259         sync with mcs.
7260
7261 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7262
7263         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7264         incomplete key pairs (#57941).
7265
7266 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7267
7268         * codegen.cs: Fix another case where CS1548 must be reported (when 
7269         delay-sign isn't specified and no private is available #56564). Fix
7270         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7271         error when MCS is used on the MS runtime and we need to delay-sign 
7272         (which seems unsupported by AssemblyBuilder - see #56621).
7273
7274 2004-04-29  Jackson Harper  <jackson@ximian.com>
7275
7276         * Makefile: Set MONO_PATH to use the bootstrap corlib
7277         * driver.cs: Check the GAC for referenced assemblies.
7278                 
7279 2004-04-29  Martin Baulig  <martin@ximian.com>
7280
7281         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7282
7283 2004-04-07  Martin Baulig  <martin@ximian.com>
7284
7285         * expression.cs (Binary.ResolveOperator): Added special case for
7286         Equality/Inequality between a type parameter and a null literal.
7287
7288 2004-04-07  Martin Baulig  <martin@ximian.com>
7289
7290         * convert.cs: Check null literal -> type parameter conversions.
7291
7292 2004-04-07  Martin Baulig  <martin@ximian.com>
7293
7294         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7295         `class' and `struct' constraints.
7296
7297 2004-04-07  Martin Baulig  <martin@ximian.com>
7298
7299         * generic.cs (SpecialConstraint): New public enum.
7300         (Constraints.Resolve): Added support for the `class' and `struct'
7301         constraints.
7302
7303         * cs-parser.jay (type_parameter_constraint): Added support for the
7304         `class' and `struct' constraints.
7305
7306 2004-04-07  Martin Baulig  <martin@ximian.com>
7307
7308         * support.cs (GenericConstraints): Replaced `Types' by
7309         `ClassConstraint' and `InterfaceConstraints'; added
7310         `HasClassConstraint'.   
7311
7312 2004-04-07  Martin Baulig  <martin@ximian.com>
7313
7314         * generic.cs
7315         (Constraints.InterfaceConstraints): New public property.
7316         (Constraints.Types): Make this property public
7317         (TypeParameter): Implement IMemberContainer.
7318         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7319         instead of a TypeBuilder/MethodBuilder; pass the interface
7320         constraints to TypeManager.AddTypeParameter().
7321         (TypeParameter.DefineType): Just take an EmitContext and no
7322         TypeBuilder/MethodBuilder.  Use the new public API.
7323
7324         * typemanager.cs (TypeManager.AddTypeParameter): Added
7325         `TypeExpr[]' argument; add the interfaces to the
7326         `builder_to_ifaces' hash.
7327         (TypeManager.LookupMemberContainer): For
7328         GenericTypeParameterBuilders, get the TypeParameter from the
7329         `builder_to_type_param'.
7330         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7331         the TypeParameter and call FindMembers on it.
7332
7333 2004-04-07  Martin Baulig  <martin@ximian.com>
7334
7335         * class.cs
7336         (MethodCore.GenericMethod): Moved this field here from Method.
7337         (MethodCore.IsDuplicateImplementation): Take the number of type
7338         parameters into account if we're a generic method.
7339
7340         * expression.cs (Invocation.InferTypeArguments): Don't return true
7341         if `arguments' is null; we still need to check whether we actually
7342         don't need to infer anything in this case.
7343         (MemberAccess): Merged the functionality from GenericMemberAccess
7344         into this class.
7345
7346         * generic.cs (GenericMemberAccess): Removed.
7347
7348 2004-04-05  Martin Baulig  <martin@ximian.com>
7349
7350         * decl.cs (MemberCore): For generic classes, interfaces and
7351         structs, `Name' now includes the number of type parameters
7352         ("Stack!1.Node!1").
7353         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7354         encode the number of type arguments in the type name.
7355
7356         * expression.cs (Expression.MemberLookup): Removed the
7357         `num_type_args' argument; we now encode the number of type
7358         arguments in the type name.
7359
7360         * ecore.cs (SimpleName): Encode the number of type arguments in
7361         the type name itself.
7362
7363         * generic.cs (ConstructedType): Likewise.
7364
7365         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7366         `MemberName'; we now include the number of type parameters in the
7367         type name.
7368
7369         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7370         (TypeManager.MemberLookup): Removed the
7371         `num_type_args' argument; we now encode the number of type
7372         arguments in the type name.     
7373
7374 2004-04-03  Martin Baulig  <martin@ximian.com>
7375
7376         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7377         (MemberCore.MemberName): Moved here from MemberBase.
7378         (DeclSpace.SetParameterInfo): Just take the constraints as an
7379         ArrayList; we already have the type parameters in our
7380         `MemberName'; also do the CS0080 reporting here.
7381
7382         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7383         `IDENTIFIER opt_type_parameter_list'; when constructing our
7384         `MemberName', it'll already include our type parameters.
7385         (class_declaration, interface_declaration): Likewise.
7386         (delegate_declaration): Likewise.
7387         (MakeName): Take a MemberName and return a MemberName.
7388         The following two changes are required to avoid shift/reduce conflicts:
7389         (member_name): Don't include a TypeName anymore; ie. this is now
7390         just 'IDENTIFIER opt_type_parameter_list'.
7391         (property_declaration, event_declaration): Use a
7392         `namespace_or_type_name' instead of a `member_name'.            
7393
7394 2004-04-03  Martin Baulig  <martin@ximian.com>
7395
7396         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7397         `MemberName' class.
7398         (TypeName): Formerly known as MemberName.
7399
7400         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7401         instead of a `MemberName'.
7402
7403         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7404         (member_name): New rule; create a MemberName.
7405
7406 2004-04-02  Martin Baulig  <martin@ximian.com>
7407
7408         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7409         (CS0305 and CS0308).
7410
7411 2004-04-02  Martin Baulig  <martin@ximian.com>
7412
7413         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7414         support for nested types.
7415
7416 2004-04-02  Martin Baulig  <martin@ximian.com>
7417
7418         * ecore.cs (IAlias): New public interface.
7419         (TypeExpr, TypeExpression): Implement IAlias.
7420         (TypeAliasExpression): New public class.
7421
7422         * namespace.cs (Namespace): Implement IAlias.
7423         (Namespace.Lookup): Return an IAlias instead on an object.
7424         (Namespace.DefineName): Take an IAlias instead of an object.
7425         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7426         an object.
7427         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7428         Expression.
7429         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7430         object.
7431         (NamespaceEntry.Lookup): Likewise.
7432
7433         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7434         instead of a Type.      
7435
7436         * decl.cs (DeclSpace): Implement IAlias.
7437         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7438
7439         * generic.cs (ConstructedType): Improved error checking.
7440
7441 2004-04-02  Martin Baulig  <martin@ximian.com>
7442
7443         * convert.cs: Added type parameter conversions.
7444
7445         * ecore.cs
7446         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7447         (ClassCast.Emit): If the source type is a type parameter, box it.
7448         If the target type is a type parameter, emit an `unbox.any'
7449         instead of a `classcast'.1      
7450
7451 2004-04-01  Martin Baulig  <martin@ximian.com>
7452
7453         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7454
7455 2004-04-01  Martin Baulig  <martin@ximian.com>
7456
7457         * generic.cs (ConstructedType.CheckConstraints): Use
7458         Convert.ImplicitStandardConversionExists(); user-defined implicit
7459         conversions are not allowed according to the spec.
7460
7461 2004-03-30  Martin Baulig  <martin@ximian.com>
7462
7463         * expression.cs (New): Added support for type parameters.
7464
7465         * typemanager.cs
7466         (TypeManager.activator_type): New public static field.
7467         (TypeManager.activator_create_instance): Likewise.
7468
7469 2004-03-30  Martin Baulig  <martin@ximian.com>
7470
7471         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7472         public method.
7473
7474 2004-03-30  Martin Baulig  <martin@ximian.com>
7475
7476         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7477         the spec here: the argument type must be convertible to the
7478         constraints.
7479
7480 2004-03-30  Martin Baulig  <martin@ximian.com>
7481
7482         * generic.cs
7483         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7484         TypeManager.AddTypeParameter().
7485         (ConstructedType.CheckConstraints): Re-enable this and actually
7486         check whether we have a constructor constraint.
7487
7488         * typemanager.cs
7489         (TypeManager.builder_to_type_param): New static field.
7490         (TypeManager.AddTypeParameter): New static method.
7491         (TypeManager.LookupTypeParameter): New public method.
7492
7493 2004-03-30  Martin Baulig  <martin@ximian.com>
7494
7495         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7496         the new API to actually define the constructor constraint.
7497
7498         * typemanager.cs
7499         (TypeManager.new_constraint_attr_type): New static field.
7500         (TypeManager.InitCoreTypes): Initialize it.
7501
7502 2004-03-30  Martin Baulig  <martin@ximian.com>
7503
7504         * generic.cs (Constraints): Completed error checking, use correct
7505         error numbers.
7506
7507 2004-03-29  Martin Baulig  <martin@ximian.com>
7508
7509         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7510
7511         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7512         public version which takes a `ParameterData pd' instead of an
7513         `ArrayList args'.
7514
7515 2004-03-29  Martin Baulig  <martin@ximian.com>
7516
7517         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7518         not a MethodInfo.       
7519
7520 2004-03-29  Martin Baulig  <martin@ximian.com>
7521
7522         * expression.cs (Argument.ResolveMethodGroup): If we're a
7523         ConstructedType, call GetMemberAccess() on it.  
7524
7525 2004-03-29  Martin Baulig  <martin@ximian.com>
7526
7527         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7528         (MethodCore.CheckGenericOverride): When overriding a generic
7529         method, check whether the constraints match.
7530
7531         * support.cs (GenericConstraints): New public interface.
7532         (ParameterData.GenericConstraints): New public method.
7533
7534         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7535         method parameter and compute our constraints if appropriate.
7536         (Parameter.GenericConstraints): New public property.
7537
7538         * generic.cs (Constraints): Implement GenericConstraints.
7539
7540 2004-03-29  Martin Baulig  <martin@ximian.com>
7541
7542         * decl.cs (MemberCache.FindMemberToOverride): Use
7543         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7544
7545 2004-03-29  Martin Baulig  <martin@ximian.com>
7546
7547         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7548
7549 2004-03-29  Martin Baulig  <martin@ximian.com>
7550
7551         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7552         not allowed on non-generic declarations").
7553
7554 2004-03-29  Martin Baulig  <martin@ximian.com>
7555
7556         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7557         public version of this method.
7558
7559         * class.cs (MethodCore.IsDuplicateImplementation): Use
7560         Invocation.InferTypeArguments() to check this.
7561
7562 2004-03-29  Martin Baulig  <martin@ximian.com>
7563
7564         * convert.cs: Use TypeManager.IsDelegateType() instead of
7565         comparing types correctly.
7566
7567 2004-03-29  Martin Baulig  <martin@ximian.com>
7568
7569         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7570         types directly to make it work for generic instances.
7571
7572         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7573
7574 2004-03-29  Martin Baulig  <martin@ximian.com>
7575
7576         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7577         support for arrays.     
7578
7579 2004-03-24  Martin Baulig  <martin@ximian.com>
7580
7581         * decl.cs (DeclSpace.FindType): Also use
7582         TypeManager.CheckGeneric() for types from the using clauses.
7583
7584 2004-03-23  Martin Baulig  <martin@ximian.com>
7585
7586         * expression.cs (Invocation.OverloadResolve): Added `bool
7587         may_fail' argument and use it instead of the Location.IsNull() hack.
7588
7589 2004-03-23  Martin Baulig  <martin@ximian.com>
7590
7591         * expression.cs (Invocation.InferType): Use correct type inference
7592         rules here.     
7593
7594 2004-03-23  Martin Baulig  <martin@ximian.com>
7595
7596         * ecore.cs (MethodGroupExpr.Name): Use
7597         TypeManager.CSharpSignature() instead of just the name.
7598
7599         * expression.cs (Invocation.OverloadResolve): Provide better error
7600         reporting.
7601         (Invocation.DoResolve): OverloadResolve() never returns null
7602         without reporting an error, so removed the error -6 reporting here.
7603
7604 2004-03-23  Martin Baulig  <martin@ximian.com>
7605
7606         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7607         generic methods.
7608
7609         * cs-parser.jay (delegate_declaration): Support generic delegates.
7610
7611         * delegate.cs: Support generic delegates.
7612
7613 2004-03-22  Martin Baulig  <martin@ximian.com>
7614
7615         * expression.cs (Invocation.InferParamsTypeArguments): New static
7616         method; does type inference for params arguments.
7617
7618 2004-03-21  Martin Baulig  <martin@ximian.com>
7619
7620         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7621         method; checks whether a method is a generic method.    
7622
7623         * expression.cs (Invocation.InferTypeArguments): New static method;
7624         infer type arguments for generic method invocation.
7625
7626         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7627         property; we set this to true if we're resolving a generic method
7628         invocation and the user specified type arguments, ie. we're not
7629         doing type inference.
7630
7631 2004-03-20  Martin Baulig  <martin@ximian.com>
7632
7633         * class.cs (MethodData.DeclaringType): New public property.
7634         (MethodData.Define): Set DeclaringType here.
7635         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7636         instead of OperatorMethodBuilder.DeclaringType.
7637
7638 2004-03-20  Martin Baulig  <martin@ximian.com>
7639
7640         * cs-tokenizer.cs (xtoken): Return a special
7641         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7642
7643         * cs-parser.jay (default_value_expression): Switch to the new
7644         syntax (14.5.13).
7645
7646 2004-03-19  Martin Baulig  <martin@ximian.com>
7647
7648         * decl.cs (MemberName): New class.  We use this to "construct"
7649         namespace_or_type_name's.
7650
7651         * generics.cs (TypeArguments.GetDeclarations): New public method;
7652         returns the type arguments as a string[] and reports a CS0081 if
7653         one of them is not an identifier.
7654
7655         * class.cs (MemberBase): The .ctor now takes the name as a
7656         MemberName instead of a string.
7657         (MemberBase.ExplicitInterfaceName): Changed type from string to
7658         Expression.
7659         (MemberBase.DoDefine): If we're an explicit implementation, the
7660         InterfaceType may be a generic instance.
7661
7662         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7663         (namespace_name): Call MemberName.GetName () to transform the
7664         MemberName into a string and ensure we don't have any type
7665         arguments.
7666         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7667         MemberName into an expression.
7668         (method_header): Use namespace_or_type_name instead of member_name.     
7669
7670 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7671
7672         * rootcontext.cs: Add new types to the boot resolution.
7673
7674         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7675         MulticastDelegate is not allowed.
7676
7677         * typemanager.cs: Add new types to lookup: System.TypedReference
7678         and ArgIterator.
7679
7680         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7681         check for TypedReference or ArgIterator, they are not allowed. 
7682
7683         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7684         makes us properly catch 1510 in some conditions (see bug 56016 for
7685         details). 
7686
7687 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7688
7689         * CryptoConvert.cs: update from corlib version
7690         with endian fixes.
7691
7692 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7693
7694         * class.cs (Indexer.Define): Check indexername declaration
7695
7696 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7697
7698         * attribute.cs (IsClsCompliant): Fixed problem with handling
7699         all three states (compliant, not-compliant, undetected).
7700
7701 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7702
7703         * attribute.cs (Attribute): Location is now public.
7704         (Resolve): Store resolved arguments (pos_values) in attribute class.
7705         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7706         (GetClsCompliantAttributeValue): New method that gets
7707         CLSCompliantAttribute value.
7708         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7709         if exists else null.
7710         (AttributeTester): New class for CLS-Compliant verification routines.
7711
7712         * class.cs (Emit): Add CLS-Compliant verification.
7713         (Method.GetSignatureForError): Implemented.
7714         (Constructor.GetSignatureForError): Implemented
7715         (Constructor.HasCompliantArgs): Returns if constructor has
7716         CLS-Compliant arguments.
7717         (Constructor.Emit): Override.
7718         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7719         is needed to test only parameters.
7720         (FieldBase.GetSignatureForError): Implemented.
7721         (TypeContainer): New member for storing base interfaces.
7722         (TypeContainer.FindMembers): Search in base interfaces too.
7723
7724         * codegen.cs (GetClsComplianceAttribute): New method that gets
7725         assembly or module CLSCompliantAttribute value.
7726         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7727         for assembly.
7728         (ModuleClass.Emit): Add error 3012 test.
7729
7730         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7731
7732         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7733         state for all decl types.
7734         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7735         if CLS-Compliant tests are required.
7736         (IsClsCompliaceRequired): New method. Analyze whether code
7737         must be CLS-Compliant.
7738         (IsExposedFromAssembly): New method. Returns true when MemberCore
7739         is exposed from assembly.
7740         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7741         value or gets cached value.
7742         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7743         is explicitly marked with CLSCompliantAttribute.
7744         (IsIdentifierClsCompliant): New abstract method. This method is
7745         used to testing error 3005.
7746         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7747         for identifier and parameters CLS-Compliant testing.
7748         (VerifyClsCompliance): New method. The main virtual method for
7749         CLS-Compliant verifications.
7750         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7751         null. I don't know why is null (too many public members !).
7752         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7753         and get value of first CLSCompliantAttribute that found.
7754
7755         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7756         (VerifyClsCompliance): Override and add extra tests.
7757
7758         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7759         clscheck- disable CLS-Compliant verification event if assembly is has
7760         CLSCompliantAttribute(true).
7761
7762         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7763         ApllyAttribute is now called in emit section as in the other cases.
7764         Possible future Emit integration.
7765         (IsIdentifierClsCompliant): New override.
7766         (VerifyClsCompliance): New override.
7767         (GetEnumeratorName): Returns full enum name.
7768
7769         * parameter.cs (GetSignatureForError): Implemented.
7770
7771         * report.cs (WarningData): New struct for Warning message information.
7772         (LocationOfPreviousError): New method.
7773         (Warning): New method. Reports warning based on the warning table.
7774         (Error_T): New method. Reports error based on the error table.
7775
7776         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7777         verifications are done here.
7778
7779         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7780
7781         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7782         CLSCompliantAttribute.
7783         (all_imported_types): New member holds all imported types from other
7784         assemblies.
7785         (LoadAllImportedTypes): New method fills static table with exported types
7786         from all referenced assemblies.
7787         (Modules): New property returns all assembly modules.
7788
7789 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7790
7791         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7792         throwing a parser error.
7793
7794         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7795         which removes the hardcoded get_/set_ prefixes for properties, as
7796         IL allows for the properties to be named something else.  
7797
7798         Bug #56013
7799
7800         * expression.cs: Do not override operand before we know if it is
7801         non-null.  Fix 56207
7802
7803 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7804
7805         * typemanager.cs: support for pinned variables.
7806
7807 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7808
7809         * decl.cs, typemanager.cs: Avoid using an arraylist
7810         as a buffer if there is only one result set.
7811
7812 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7813
7814         * expression.cs: Make sure you cant call a static method
7815         with an instance expression, bug #56174.
7816
7817 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7818
7819         * class.cs (IsDuplicateImplementation): Improve error reporting to
7820         flag 663 (method only differs in parameter modifier).
7821
7822         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7823         in preprocessor directives.
7824
7825         * location.cs (LookupFile): Allow for the empty path.
7826
7827         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7828         better approach for some of that patch, but its failing with the
7829         CharSet enumeration.  For now try/catch will do.
7830
7831         * typemanager.cs: Do not crash if a struct does not have fields.
7832         Fixes 56150.
7833
7834 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7835
7836         * expression.cs: cs0213, cant fix a fixed expression.
7837         fixes 50231.
7838
7839 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7840
7841         * cs-parser.jay: detect invalid embeded statements gracefully.
7842         bug #51113.
7843
7844 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7845
7846         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7847         As a regex:
7848         s/
7849         the invocation type may not be a subclass of the tye of the item/
7850         The type of the item must be a subclass of the invocation item.
7851         /g
7852
7853         Fixes bug #50820.
7854
7855 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7856
7857         * attribute.cs: Added methods to get a string and a bool from an
7858         attribute. Required to information from AssemblyKeyFileAttribute,
7859         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7860         * codegen.cs: Modified AssemblyName creation to include support for
7861         strongnames. Catch additional exceptions to report them as CS1548.
7862         * compiler.csproj: Updated include CryptoConvert.cs.
7863         * compiler.csproj.user: Removed file - user specific configuration.
7864         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7865         Mono.Security assembly. The original class is maintained and tested in
7866         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7867         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7868         like CSC 8.0 (C# v2) supports.
7869         * Makefile: Added CryptoConvert.cs to mcs sources.
7870         * rootcontext.cs: Added new options for strongnames.
7871
7872 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7873
7874         * driver.cs: For --expect-error, report error code `2'
7875         if the program compiled with no errors, error code `1' if
7876         it compiled with an error other than the one expected.
7877
7878 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7879
7880         * compiler.csproj: Updated for Visual Studio .NET 2003.
7881         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7882         * compiler.sln: Updated for Visual Studio .NET 2003.
7883
7884 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7885
7886         * expression.cs: Fix bug #47234. We basically need to apply the
7887         rule that we prefer the conversion of null to a reference type
7888         when faced with a conversion to 'object' (csc behaviour).
7889
7890 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7891
7892         * statement.cs: Shorter form for foreach, eliminates
7893         a local variable. r=Martin.
7894
7895 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7896
7897         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7898         checks if we can use brtrue/brfalse to test for 0.
7899         * expression.cs: use the above in the test for using brtrue/brfalse.
7900         cleanup code a bit.
7901
7902 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7903
7904         * expression.cs: Rewrite string concat stuff. Benefits:
7905
7906         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7907         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7908         rather than a concat chain.
7909
7910         * typemanager.cs: Add lookups for more concat overloads.
7911
7912 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7913
7914         * expression.cs: Emit shorter il code for array init.
7915
7916         newarr
7917         dup
7918         // set 1
7919
7920         // set 2
7921
7922         newarr
7923         stloc.x
7924
7925         ldloc.x
7926         // set 1
7927
7928         ldloc.x
7929         // set 2
7930
7931 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7932
7933         * statement.cs: Before, two switch blocks would be merged if the
7934         total size of the blocks (end_item - begin_item + 1) was less than
7935         two times the combined sizes of the blocks.
7936
7937         Now, it will only merge if after the merge at least half of the
7938         slots are filled.
7939
7940         fixes 55885.
7941
7942 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7943
7944         * class.cs : csc build fix for GetMethods(). See bug #52503.
7945
7946 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7947
7948         * expression.cs: Make sure fp comparisons work with NaN.
7949         This fixes bug #54303. Mig approved this patch a long
7950         time ago, but we were not able to test b/c the runtime
7951         had a related bug.
7952
7953 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7956
7957 2004-03-19  Martin Baulig  <martin@ximian.com>
7958
7959         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7960         two overloads may unify for some type parameter substitutions and
7961         report a CS0408 if appropriate.
7962
7963 2004-03-19  Martin Baulig  <martin@ximian.com>
7964
7965         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7966         error here and not in our caller.
7967
7968 2004-03-19  Martin Baulig  <martin@ximian.com>
7969
7970         * interface.cs: Completely killed this file.
7971         (Interface): We're now a TypeContainer and live in class.cs.
7972
7973         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7974         argument; we're now also called for interfaces.
7975         (TypeContainer.DefineMembers): Allow this method being called
7976         multiple times.
7977         (TypeContainer.GetMethods): New public method; formerly known as
7978         Interface.GetMethod().  This is used by PendingImplementation.
7979         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7980         it's now private and non-static.
7981         (Interface): Moved this here; it's now implemented similar to
7982         Class and Struct.
7983         (Method, Property, Event, Indexer): Added `bool is_interface'
7984         argument to their .ctor's.
7985         (MemberBase.IsInterface): New public field.
7986
7987         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7988         instances instead of InterfaceMethod, InterfaceProperty, etc.
7989         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7990         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7991
7992 2004-03-19  Martin Baulig  <martin@ximian.com>
7993
7994         * class.cs (MethodCore.IsDuplicateImplementation): New private
7995         method which does the CS0111 checking.
7996         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7997         Use IsDuplicateImplementation().
7998
7999 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8000
8001         * decl.cs (FindMemberToOverride): New method to find the correct
8002         method or property to override in the base class.
8003         * class.cs
8004             - Make Method/Property use the above method to find the
8005               version in the base class.
8006             - Remove the InheritableMemberSignatureCompare as it is now
8007               dead code.
8008
8009         This patch makes large code bases much faster to compile, as it is
8010         O(n) rather than O(n^2) to do this validation.
8011
8012         Also, it fixes bug 52458 which is that nested classes are not
8013         taken into account when finding the base class member.
8014
8015         Reviewed/Approved by Martin.
8016
8017 2004-03-17  Martin Baulig  <martin@ximian.com>
8018
8019         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8020         of type arguments into account; use the `real_num_type_args'
8021         approach like in DoResolveAsTypeStep().
8022
8023         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8024         nested types.
8025
8026 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8027
8028         * interface.cs: In all interface classes removed redundant
8029         member initialization.
8030
8031 2004-03-16  Martin Baulig  <martin@ximian.com>
8032
8033         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8034
8035 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8036
8037         * decl.cs (DefineTypeAndParents): New helper method to define a
8038         type's containers before the type itself is defined;  This is a
8039         bug exposed by the recent changes to Windows.Forms when an
8040         implemented interface was defined inside a class that had not been
8041         built yet.   
8042
8043         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8044
8045         (Check): Loop correctly to report errors modifiers
8046         (UNSAFE was not in the loop, since it was the same as TOP).
8047
8048         * interface.cs: Every interface member now takes a ModFlags,
8049         instead of a "is_new" bool, which we set on the base MemberCore. 
8050
8051         Every place where we called "UnsafeOk" in the interface, now we
8052         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8053         the unsafe settings from the member declaration instead of the
8054         container interface. 
8055
8056         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8057
8058         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8059         `set_indexer_name' to the pending bits (one per type).
8060
8061         We fixed a bug today that was picking the wrong method to
8062         override, since for properties the existing InterfaceMethod code
8063         basically ignored the method name.  Now we make sure that the
8064         method name is one of the valid indexer names.
8065
8066 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8067  
8068         * support.cs (SeekableStreamReader): Keep track of stream byte
8069         positions and don't mix them with character offsets to the buffer.
8070
8071         Patch from Gustavo Giráldez
8072
8073 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8074
8075         * interface.cs (InterfaceSetGetBase): Removed double member
8076         initialization, base class does it as well.
8077
8078 2004-03-13  Martin Baulig  <martin@ximian.com>
8079
8080         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8081         when compiling corlib.
8082
8083 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8084
8085         * convert.cs (ExplicitConversion): We were reporting an error on
8086         certain conversions (object_type source to a value type, when the
8087         expression was `null') before we had a chance to pass it through
8088         the user defined conversions.
8089
8090         * driver.cs: Replace / and \ in resource specifications to dots.
8091         Fixes 50752
8092
8093         * class.cs: Add check for duplicate operators.  Fixes 52477
8094
8095 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8096
8097         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8098         that are in the middle of the statements, not only at the end.
8099         Fixes #54987
8100
8101         * class.cs (TypeContainer.AddField): No longer set the
8102         `HaveStaticConstructor' flag, now we call it
8103         `UserDefineStaticConstructor' to diferentiate the slightly
8104         semantic difference.
8105
8106         The situation is that we were not adding BeforeFieldInit (from
8107         Modifiers.TypeAttr) to classes that could have it.
8108         BeforeFieldInit should be set to classes that have no static
8109         constructor. 
8110
8111         See:
8112
8113         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8114
8115         And most importantly Zoltan's comment:
8116
8117         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8118
8119         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8120          before its static fields are used', i.e. initialization does not need
8121          to be triggered by the first access to the type. Setting this flag
8122          helps the JIT to compile better code, since it can run the static
8123          constructor at JIT time, and does not need to generate code to call it
8124          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8125          this flag for lots of classes like String. 
8126          
8127          csc sets this flag if the type does not have an explicit static 
8128          constructor. The reasoning seems to be that if there are only static
8129          initalizers for a type, and no static constructor, then the programmer
8130          does not care when this initialization happens, so beforefieldinit
8131          can be used.
8132          
8133          This bug prevents the AOT compiler from being usable, since it 
8134          generates so many calls to mono_runtime_class_init that the AOT code
8135          is much slower than the JITted code. The JITted code is faster, 
8136          because it does not generate these calls if the vtable is type is
8137          already initialized, which is true in the majority of cases. But the
8138          AOT compiler can't do this."
8139
8140 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8141
8142         * class.cs (MethodData.Emit): Refactor the code so symbolic
8143         information is generated for destructors;  For some reasons we
8144         were taking a code path that did not generate symbolic information
8145         before. 
8146
8147 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8148
8149         * class.cs: Create a Constructor.CheckBase method that
8150         takes care of all validation type code. The method
8151         contains some code that was moved from Define.
8152
8153         It also includes new code that checks for duplicate ctors.
8154         This fixes bug #55148.
8155
8156 2004-03-09  Joshua Tauberer <tauberer@for.net>
8157
8158         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8159         a { ... }-style array creation invokes EmitStaticInitializers
8160         which is not good for reference-type arrays.  String, decimal
8161         and now null constants (NullCast) are not counted toward
8162         static initializers.
8163
8164 2004-03-05  Martin Baulig  <martin@ximian.com>
8165
8166         * location.cs (SourceFile.HasLineDirective): New public field;
8167         specifies whether the file contains or is referenced by a "#line"
8168         directive.
8169         (Location.DefineSymbolDocuments): Ignore source files which
8170         either contain or are referenced by a "#line" directive.        
8171
8172 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8173
8174         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8175         direct access to our parent, so check the method inline there.
8176
8177 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8178
8179         * expression.cs (Invocation.EmitCall): Miguel's last commit
8180         caused a regression. If you had:
8181
8182             T t = null;
8183             t.Foo ();
8184
8185         In Foo the implict this would be null.
8186
8187 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8188
8189         * expression.cs (Invocation.EmitCall): If the method is not
8190         virtual, do not emit a CallVirt to it, use Call.
8191
8192         * typemanager.cs (GetFullNameSignature): Improve the method to
8193         cope with ".ctor" and replace it with the type name.
8194
8195         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8196         as an argument the ConstructorBuilder where it is being defined,
8197         to catch the recursive constructor invocations.
8198
8199 2004-03-16  Martin Baulig  <martin@ximian.com>
8200
8201         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8202         ConstructedType, call ResolveType() on it to get the type rather
8203         than just using `expr.Type'.
8204
8205 2004-03-16  Martin Baulig  <martin@ximian.com>
8206
8207         * generics.cs (ConstructedType.GetMemberAccess): Take the
8208         EmitContext instead on the TypeExpr and use
8209         ec.TypeContainer.CurrentType/ec.ContainerType.
8210
8211 2004-03-16  Martin Baulig  <martin@ximian.com>
8212
8213         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8214         parameters before aliases.
8215
8216 2004-03-16  Martin Baulig  <martin@ximian.com>
8217
8218         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8219         New oublic function; checks whether two generic instances may become
8220         equal under some instantiations (26.3.1).
8221
8222         * class.cs (TypeContainer.Define): Call
8223         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8224         error.
8225
8226 2004-03-16  Martin Baulig  <martin@ximian.com>
8227
8228         * class.cs (TypeContainer.GetClassBases): Moved
8229         Error_TypeParameterAsBase() here and also check whether the base
8230         class is not an attribute.
8231
8232 2004-03-16  Martin Baulig  <martin@ximian.com>
8233
8234         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8235
8236 2004-03-16  Martin Baulig  <martin@ximian.com>
8237
8238         * class.cs (Error_TypeParameterAsBase): Use correct error number
8239         here (CS0689).  
8240
8241 2004-03-16  Martin Baulig  <martin@ximian.com>
8242
8243         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8244         for generics.
8245
8246         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8247         error reporting.
8248
8249 2004-03-15  Martin Baulig  <martin@ximian.com>
8250
8251         * typemanager.cs (TypeManager.GetFullName): New public method.
8252         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8253         argument; only return members with the correct number of type
8254         arguments.
8255         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8256         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8257         whether the number of type arguments matches.
8258
8259         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8260         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8261
8262         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8263         field; it's set by the protected .ctor when we're actually a
8264         GenericMemberAccess.
8265         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8266         arguments and pass it to MemberLookupFinal ().
8267
8268         * ecore.cs (Expression.MemberLookup): Added `int
8269         num_type_arguments' argument; only return members with the correct
8270         number of type arguments.
8271         (Expression.MemberLookupFailed): Check whether the MemberLookup
8272         failed because we did not have the correct number of type
8273         arguments; report CS0305 in this case.
8274
8275         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8276         `e.ResolveAsTypeTerminal()' already did so.
8277
8278 2004-03-15  Martin Baulig  <martin@ximian.com>
8279
8280         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8281         we're a ConstructedType; in this case, the caller must report an
8282         error (for instance CS0131).
8283
8284         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8285         (TypeArguments.Resolve): Actually report errors here.
8286
8287 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8288
8289         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8290         `set_indexer_name' to the pending bits (one per type).
8291
8292         We fixed a bug today that was picking the wrong method to
8293         override, since for properties the existing InterfaceMethod code
8294         basically ignored the method name.  Now we make sure that the
8295         method name is one of the valid indexer names.
8296
8297 2004-03-15  Martin Baulig  <martin@ximian.com>
8298
8299         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8300         for generic instances.
8301
8302 2004-03-13  Martin Baulig  <martin@ximian.com>
8303
8304         * class.cs (TypeContainer.DefineType): Call
8305         TypeManager.AddUserType() immediately after creating the
8306         TypeBuilder; pass all type parameters when creating the
8307         CurrentType.
8308
8309         * decl.cs (DeclSpace.FindNestedType): New public method.
8310         (DeclSpace.FindType): Added `int num_type_args' argument; only
8311         return types with the correct number of type parameters.
8312         (DeclSpace.CountTypeParams): New public property.
8313
8314         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8315         the number of type parameters; defaults to zero.
8316
8317         * generic.cs (TypeArguments.Count): New public property.
8318         (ConstructedType.DoResolveAsTypeStep): First call
8319         ds.FindNestedType() to find out whether we're nested in the
8320         current generic type; in this case, we inherit all type parameters
8321         from the current class.
8322
8323         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8324         num_type_args' argument.
8325         (RootContext.LookupType): Added overloaded version which takes the
8326         number of type arguments; only return types with the correct
8327         number of type arguments.
8328
8329         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8330         checks whether `Type t' has `int num_type_args'.
8331
8332 2004-03-13  Martin Baulig  <martin@ximian.com>
8333
8334         * generic.cs (GenericMethod.DefineType): New method; calls
8335         DefineType() on all the type parameters.
8336
8337         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8338         (MethodData.Define): If we're a generic method, call
8339         GenericMethod.DefineType() to define the type parameters.       
8340
8341 2004-03-10  Martin Baulig  <martin@ximian.com>
8342
8343         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8344         instead of IsAssignableFrom.    
8345
8346 2004-03-10  Martin Baulig  <martin@ximian.com>
8347
8348         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8349
8350         * support.cs (ParameterData.HasArrayParameter): New property.
8351         (ReflectionParameters.ctor): Take a MethodBase instead of a
8352         ParameterInfo[].  If we have any type parameters, get the generic
8353         method definition and ask it whether we have variable arguments.
8354
8355 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8358         routines to check if a type is an enumerable/enumerator allow
8359         classes that implement the IEnumerable or IEnumerator interfaces.
8360
8361         * class.cs (Property, Operator): Implement IIteratorContainer, and
8362         implement SetYields.
8363
8364         (Property.Define): Do the block swapping for get_methods in the
8365         context of iterators.   We need to check if Properties also
8366         include indexers or not.
8367
8368         (Operator): Assign the Block before invoking the
8369         OperatorMethod.Define, so we can trigger the Iterator code
8370         replacement. 
8371
8372         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8373         Property and Operator classes are not created when we parse the
8374         declarator but until we have the block completed, so we use a
8375         singleton SimpleIteratorContainer.Simple to flag whether the
8376         SetYields has been invoked.
8377
8378         We propagate this setting then to the Property or the Operator to
8379         allow the `yield' to function.
8380
8381 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8382
8383         * codegen.cs: Implemented attribute support for modules.
8384         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8385         Assembly/Module functionality.
8386
8387         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8388         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8389         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8390
8391 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8392
8393         * interface.cs (FindMembers): The operation is performed on all base
8394         interfaces and not only on the first. It is required for future CLS Compliance patch.
8395
8396 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8397
8398         * statement.cs, codegen.cs:
8399         This patch deals with patterns such as:
8400
8401         public class List : IEnumerable {
8402
8403                 public MyEnumerator GetEnumerator () {
8404                         return new MyEnumerator(this);
8405                 }
8406
8407                 IEnumerator IEnumerable.GetEnumerator () {
8408                         ...
8409                 }
8410                 
8411                 public struct MyEnumerator : IEnumerator {
8412                         ...
8413                 }
8414         }
8415
8416         Before, there were a few things we did wrong:
8417         1) we would emit callvirt on a struct, which is illegal
8418         2) we emited ldarg when we needed to emit ldarga
8419         3) we would mistakenly call the interface methods on an enumerator
8420         type that derived from IEnumerator and was in another assembly. For example:
8421
8422         public class MyEnumerator : IEnumerator
8423
8424         Would have the interface methods called, even if there were public impls of the
8425         method. In a struct, this lead to invalid IL code.
8426
8427 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8428
8429         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8430           renamed to Emit.
8431
8432         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8433
8434 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8435
8436         * cs-parser.jay: Fix small regression: we were not testing V2
8437         compiler features correctly.
8438
8439         * interface.cs: If the emit context is null, then create one
8440
8441 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8442
8443         * decl.cs (GetSignatureForError): New virtual method to get full name
8444           for error messages.
8445
8446         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8447           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8448
8449         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8450           Duplicated members and code in these classes has been removed.
8451           Better encapsulation in these classes.
8452
8453 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8454
8455         * assign.cs (Assign.DoResolve): When dealing with compound
8456         assignments, there is a new rule in ECMA C# 2.4 (might have been
8457         there before, but it is documented here) that states that in:
8458
8459         a op= b;
8460
8461         If b is of type int, and the `op' is a shift-operator, then the
8462         above is evaluated as:
8463
8464         a = (int) a op b 
8465
8466         * expression.cs (Binary.ResolveOperator): Instead of testing for
8467         int/uint/long/ulong, try to implicitly convert to any of those
8468         types and use that in pointer arithmetic.
8469
8470         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8471         method to print information for from the type, not from the
8472         null-method we were given.
8473
8474 2004-02-01  Duncan Mak  <duncan@ximian.com>
8475
8476         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8477         parsing for cmd, fixes bug #53694.
8478
8479 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8480
8481         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8482         in the member name duplication tests. Property and operator name duplication
8483         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8484
8485 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8486
8487         * interface.cs (PopulateMethod): Fixed crash when interface method
8488         returns not existing type (error test cs0246-3.cs).
8489
8490 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8491
8492         * cs-parser.jay (interface_accessors): Re-write actions to also
8493         store attributes attached to get and set methods. Fix spelling
8494         while at it.
8495
8496         (inteface_property_declaration): Modify accordingly.
8497
8498         (InterfaceAccessorInfo): New helper class to store information to pass
8499         around between rules that use interface_accessors.
8500
8501         * interface.cs (Emit): Apply attributes on the get and set
8502         accessors of properties and indexers too.
8503
8504         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8505         right MethodBuilder when applying attributes to the get and set accessors.
8506
8507 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8508
8509         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8510
8511 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8512
8513         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8514
8515 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8516
8517         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8518         changes that treat `yield' specially when present before `break'
8519         or `return' tokens.
8520
8521         * cs-tokenizer.cs: yield is no longer a keyword.
8522
8523 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8524
8525         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8526         setting for default constructors.
8527         For default constructors are almost every time set wrong Modifier. The
8528         generated IL code has been alright. But inside mcs this values was
8529         wrong and this was reason why several of my CLS Compliance tests
8530         failed.
8531
8532 2004-02-27  Martin Baulig  <martin@ximian.com>
8533
8534         * generics.cs (ConstructedType.ResolveType): Make the nested type
8535         stuff actually work.
8536
8537 2004-02-25  Martin Baulig  <martin@ximian.com>
8538
8539         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8540         property; returns the type parameters just from the current type,
8541         ie. with the ones from outer classes.
8542         (DeclSpace.LookupGeneric): First search in the current class, then
8543         in outer classes.
8544         (DeclSpace.initialize_type_params): When hiding a type parameter
8545         from an outer class, put it into the `type_param_list' anyways.
8546
8547         * expression.cs (MemberAccess.expr): Made this field protected.
8548
8549         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8550         the type parameters from the current class.
8551
8552         * generic.cs (ConstructedType.ResolveType): Support nested generic
8553         types by taking the type parameters which we inherit from outer
8554         classes into account.
8555         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8556         support for nested generic types.
8557
8558 2004-02-23  Martin Baulig  <martin@ximian.com>
8559
8560         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8561         field and check whether we're nested inside a generic type.
8562         (DeclSpace.ResolveType): If we're resolving to a generic type
8563         definition, create a ConstructedType and return its resolved type.
8564         (DeclSpace.initialize_type_params): New private method;
8565         initializes the `type_param_list' field from the type parameters
8566         from this and all enclosing classes.
8567         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8568         we're already initialized.
8569
8570 2004-02-23  Martin Baulig  <martin@ximian.com>
8571
8572         * class.cs (Method.Define): Create the generic method before
8573         calling DoDefine().
8574         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8575         the TypeContainer one); we use this for generic methods.
8576
8577         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8578         parent's TypeBuilder.
8579
8580 2004-02-18  Martin Baulig  <martin@ximian.com>
8581
8582         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8583         to check for equality.
8584
8585 2004-02-05  Martin Baulig  <martin@ximian.com>
8586
8587         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8588         `ec.TypeContainer.CurrentType', use it instead of
8589         `ec.ContainerType' to check whether we're in the type's ctor.
8590
8591 2004-01-29  Martin Baulig  <martin@ximian.com>
8592
8593         * expression.cs (Invocation.DoResolve): If we're a
8594         `ConstructedType', then we're actually a generic method, so
8595         rewrite the expr as a GenericMemberAccess.
8596
8597         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8598         here; manually parse it into a string.
8599
8600 2004-01-28  Martin Baulig  <martin@ximian.com>
8601
8602         * typemanager.cs (TypeManager.IsEqual): New static method.
8603         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8604         check for equality instead of using `=='.
8605
8606 2004-01-26  Martin Baulig  <martin@ximian.com>
8607
8608         * decl.cs (DeclSpace.CurrentType): New public field.
8609
8610         * expression.cs (This.ResolveBase): If we have an
8611         `ec.TypeContainer.CurrentType', use it instead of
8612         `ec.ContainerType'.
8613
8614         * class.cs (TypeContainer.DefineType): If we're a generic type,
8615         create the `CurrentType' (unresolved).
8616         (TypeContainer.GenericType): New private field.
8617         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8618         it and store it in `GenericType' before creating the MemberCache.
8619         (TypeContainer.GetMembers): If we have a `GenericType', call
8620         TypeManager.FindMembers() on it.
8621
8622         * interface.cs (Interface.GenericType): New private field.
8623         (Interface.DefineType): If we're a generic type, create the
8624         `CurrentType' (unresolved).
8625         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8626         and store it in `GenericType' before creating the MemberCache.
8627         (Interface.GetMembers): If we have a `GenericType', call
8628         TypeManager.FindMembers() on it.
8629
8630 2004-01-22  Martin Baulig  <martin@ximian.com>
8631
8632         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8633         not a QualifiedIdentifier.  This is what `type_name_expression'
8634         was previously doing.
8635         (type_name_expression): Removed; the code is now in
8636         `namespace_or_type_name'.
8637         (qualified_identifier): Removed, use `namespace_or_type_name'
8638         instead.
8639         (QualifiedIdentifier): Removed this class.      
8640
8641 2004-01-22  Martin Baulig  <martin@ximian.com>
8642
8643         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8644         not a string as alias name.
8645
8646 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8647
8648         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8649         #52730 bug, and instead compute correctly the need to use a
8650         temporary variable when requesting an address based on the
8651         static/instace modified of the field and the constructor.
8652  
8653 2004-01-21  Martin Baulig  <martin@ximian.com>
8654
8655         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8656         class and namespace before looking up aliases.  Fixes #52517.
8657
8658 2004-01-21  Martin Baulig  <martin@ximian.com>
8659
8660         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8661         assinged in a 'try'; fixes exception4.cs.
8662
8663 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8664         * class.cs : Implemented parameter-less constructor for TypeContainer
8665
8666         * decl.cs: Attributes are now stored here. New property OptAttributes
8667
8668         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8669
8670         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8671
8672 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8673
8674         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8675           (CSharpSignature): New method for indexer and property signature.
8676
8677 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8678
8679         * pending.cs (IsVirtualFilter): Faster implementation.
8680
8681 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8682
8683         * typemanager.cs: Avoid inclusion of same assembly more than once.
8684
8685 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8686
8687         * cs-parser.jay: Fixed problem where the last assembly attribute
8688           has been applied also to following declaration (class, struct, etc.)
8689           
8690 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8691
8692         * class.cs: Added error CS0538, CS0539 reporting.
8693         Fixed crash on Microsoft runtime when field type is void.
8694
8695         * cs-parser.jay: Added error CS0537 reporting.
8696
8697         * pending.cs: Added error CS0535 reporting.
8698         Improved error report for errors CS0536, CS0534.
8699
8700 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8701
8702         Merge a few bits from the Anonymous Method MCS tree.
8703
8704         * statement.cs (ToplevelBlock): New class for toplevel methods,
8705         will hold anonymous methods, lifted variables.
8706
8707         * cs-parser.jay: Create toplevel blocks for delegates and for
8708         regular blocks of code. 
8709
8710 2004-01-20  Martin Baulig  <martin@ximian.com>
8711
8712         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8713         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8714         and `NeedExplicitReturn'; added `IsLastStatement'.
8715         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8716         have a `ReturnLabel' or we're not unreachable.
8717
8718         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8719         child's reachability; don't just override ours with it.  Fixes
8720         #58058 (lluis's example).
8721         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8722         InFinally(), InLoop(), InSwitch() and
8723         BreakCrossesTryCatchBoundary() methods.
8724
8725         * statement.cs (Return): Do all error checking in Resolve().
8726         Unless we are the last statement in a top-level block, always
8727         create a return label and jump to it.
8728         (Break, Continue): Do all error checking in Resolve(); also make
8729         sure we aren't leaving a `finally'.
8730         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8731         statement in a top-level block.
8732         (Block.Flags): Added `IsDestructor'.
8733         (Block.IsDestructor): New public property.
8734
8735 2004-01-20  Martin Baulig  <martin@ximian.com>
8736
8737         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8738
8739 2004-01-20  Martin Baulig  <martin@ximian.com>
8740
8741         * statement.cs (Statement.ResolveUnreachable): New public method.
8742         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8743         (Block.Resolve): Resolve unreachable statements.
8744
8745 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8746
8747         * expression.cs: We need to fix the case where we do
8748         not have a temp variable here.
8749
8750         * assign.cs: Only expression compound assignments need
8751         temporary variables.
8752
8753 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8754
8755         * flowanalysis.cs: Reduce memory allocation in a few ways:
8756           - A block with no variables should not allocate a bit
8757             vector for itself.
8758           - A method with no out parameters does not need any tracking
8759             for assignment of the parameters, so we need not allocate
8760             any data for it.
8761           - The arrays:
8762                 public readonly Type[] VariableTypes;
8763                 public readonly string[] VariableNames;
8764             Are redundant. The data is already stored in the variable
8765             map, so we need not allocate another array for it.
8766           - We need to add alot of checks for if (params | locals) == null
8767             due to the first two changes.
8768
8769 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8770
8771         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8772         implement IMemoryLocation, we store a copy on a local variable and
8773         take the address of it.  Patch from Benjamin Jemlich
8774
8775         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8776         to use a special "type_name_expression" rule which reduces the
8777         number of "QualifiedIdentifier" classes created, and instead
8778         directly creates MemberAccess expressions.
8779
8780 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8781
8782         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8783         that fixes #52853.  Null literal assignment to ValueType
8784
8785         * class.cs (MethodData.Emit): Instead of checking the name of the
8786         method to determine if its a destructor, create a new derived
8787         class from Method called Destructor, and test for that.  
8788
8789         * cs-parser.jay: Create a Destructor object instead of a Method.  
8790
8791         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8792
8793         Fixes: 52933
8794
8795 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8796
8797         * expression.cs (Binary.ResolveOperator): Perform an implicit
8798         conversion from MethodGroups to their delegate types on the
8799         Addition operation.
8800
8801         * delegate.cs: Introduce a new class DelegateCreation that is the
8802         base class for `NewDelegate' and `ImplicitDelegateCreation',
8803         factor some code in here.
8804
8805         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8806         conversion from MethodGroups to compatible delegate types. 
8807
8808         * ecore.cs (Expression.Resolve): Do not flag error 654
8809         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8810         we allow conversions from MethodGroups to delegate types now.
8811
8812         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8813         assignments in v2 either.
8814
8815 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8816
8817         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8818         static read-only fields in ctors.
8819
8820         Applied patch from Benjamin Jemlich 
8821
8822         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8823
8824 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8825
8826         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8827         here to return true, as they can be used like this:
8828
8829                 (XXX) int.MEMBER ()
8830
8831         Fixed 49836 and all the other dups
8832
8833 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8834
8835         * driver.cs: Implement /win32res and /win32icon.
8836
8837 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8838
8839         * cs-parser.jay: Add a rule to improve error handling for the
8840         common mistake of placing modifiers after the type.
8841
8842 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8843
8844         * cs-parser.jay (interface_event_declaration): Catch
8845         initialization of events on interfaces, and report cs0068
8846
8847         * cs-parser.jay (interface_event_declaration): Catch
8848         initialization of events. 
8849
8850         * ecore.cs: Better report missing constructors.
8851
8852         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8853         the error reporting done in the wrong place.  Fix.
8854
8855         * expression.cs (Binary.ResolveOperator): Catch the 
8856         operator + (E x, E y) error earlier, and later allow for implicit
8857         conversions in operator +/- (E e, U x) from U to the underlying
8858         type of E.
8859
8860         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8861         52596, if the container class is abstract, the default constructor
8862         is protected otherwise its public (before, we were always public).
8863
8864         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8865         fixed statement.
8866
8867         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8868         Jemlich that fixes bug #52597, MCS was generating invalid code for
8869         idisposable structs.   Thanks to Ben for following up with this
8870         bug as well.
8871
8872 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8873
8874         * driver.cs: Allow assemblies without code to be generated, fixes
8875         52230.
8876
8877 2004-01-07  Nick Drochak <ndrochak@gol.com>
8878
8879         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8880
8881 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8882
8883         * cs-parser.jay: Add rules to improve error reporting if fields or
8884         methods are declared at the namespace level (error 116)
8885
8886         * Add rules to catch event add/remove
8887
8888 2004-01-04  David Sheldon <dave-mono@earth.li>
8889
8890   * expression.cs: Added matching ")" to error message for 
8891   CS0077
8892
8893 2004-01-03 Todd Berman <tberman@gentoo.org>
8894
8895         * ecore.cs, attribute.cs:
8896         Applying fix from #52429.
8897
8898 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8899
8900         * ecore.cs, expression.cs, statement.cs:
8901         Total rewrite of how we handle branching. We
8902         now handle complex boolean expressions with fewer
8903         jumps. As well if (x == 0) no longer emits a ceq.
8904
8905         if (x is Foo) is much faster now, because we generate
8906         better code.
8907
8908         Overall, we get a pretty big improvement on our benchmark
8909         tests. The code we generate is smaller and more readable.
8910
8911         I did a full two-stage bootstrap. The patch was reviewed
8912         by Martin and Miguel.
8913
8914 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8915
8916         * cs-parser.jay: Make primary_expression not take a QI.
8917         we dont need this because the member_access rule covers
8918         us here. So we replace the rule with just IDENTIFIER.
8919
8920         This has two good effects. First, we remove a s/r conflict.
8921         Second, we allocate many fewer QualifiedIdentifier objects.
8922
8923 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8924
8925         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8926         set the correct information via SRE. This prevents
8927         hanging on the MS runtime. Fixes #29374.
8928
8929 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8930
8931         * convert.cs: correctly handle conversions to value types
8932         from Enum and ValueType as unboxing conversions.
8933
8934         Fixes bug #52569. Patch by Benjamin Jemlich.
8935
8936 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8937
8938         * expression.cs (BetterConversion): Prefer int -> uint
8939         over int -> ulong (csc's behaviour). This fixed bug #52046.
8940
8941 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8942
8943         * decl.cs (MemberCache.FindMembers): now returns a
8944         MemberInfo [].
8945
8946         * typemanager.cs: In general, go with with ^^.
8947         (CopyNewMethods): take an IList.
8948         (RealMemberLookup): Only allocate an arraylist
8949         if we copy from two sets of methods.
8950
8951         This change basically does two things:
8952         1) Fewer array lists allocated due to CopyNewMethods.
8953         2) the explicit cast in MemberList costed ALOT.
8954
8955 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8956
8957         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8958         a hashtable to avoid needless string allocations when an identifier is
8959         used more than once (the common case).
8960
8961 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8962
8963         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8964         is broken, it will not return anything. So, we
8965         have to use the information we have in mcs to
8966         do the task.
8967
8968         * typemanager.cs: Add a cache for GetInterfaces,
8969         since this will now be used more often (due to ^^)
8970
8971         (GetExplicitInterfaces) New method that gets the
8972         declared, not effective, interfaces on a type
8973         builder (eg, if you have interface IFoo, interface
8974         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8975         { IBar }.
8976
8977         This patch makes MCS able to bootstrap itself on
8978         Windows again.
8979
8980 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8981
8982         * expression.cs: Remove the Nop's that Miguel put
8983         in by mistake.
8984
8985 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8986
8987         * report.cs, codegen.cs: Give the real stack trace to
8988         the error when an exception is thrown.
8989
8990 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8991
8992         * decl.cs: only allocate hashtables for ifaces if 
8993         it is an iface!
8994
8995 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8996
8997         * expression.cs: fix the error from cs0121-2.cs
8998         (a parent interface has two child interfaces that
8999         have a function with the same name and 0 params
9000         and the function is called through the parent).
9001
9002 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9003
9004         * class.cs, rootcontext.cs, typmanager.cs: do not
9005         leak pointers.
9006
9007 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9008
9009         * codegen.cs: remove stack for the ec flow branching.
9010         It is already a linked list, so no need.
9011
9012 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9013
9014         * Makefile: Allow custom profiler here.
9015
9016 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9017
9018         * typemanager.cs (LookupType):
9019           - Use a static char [], because split takes
9020             a param array for args, so it was allocating
9021             every time.
9022           - Do not store true in a hashtable, it boxes.
9023
9024 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9025
9026         * flowanalysis.cs: bytify common enums.
9027
9028 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9029
9030         * modifiers.cs: Add a new set of flags for the
9031         flags allowed on explicit interface impls.
9032         * cs-parser.jay: catch the use of modifiers in
9033         interfaces correctly.
9034         * class.cs: catch private void IFoo.Blah ().
9035
9036         All related to bug #50572.
9037
9038 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9039
9040         * decl.cs: Rewrite the consistant accessability checking.
9041         Accessability is not linear, it must be implemented in
9042         a tableish way. Fixes #49704.
9043
9044 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9045
9046         * expression.cs: Handle negation in a checked context.
9047         We must use subtraction from zero. Fixes #38674.
9048
9049 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9050
9051         * class.cs: Ignore static void main in DLLs.
9052         * rootcontext.cs: Handle the target type here,
9053         since we are have to access it from class.cs
9054         * driver.cs: account for the above.
9055
9056 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9057
9058         * report.cs: Give line numbers and files if available.
9059
9060 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9061
9062         * driver.cs: Implement /addmodule.
9063
9064         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9065         ModuleBuilders.
9066
9067 2003-12-20  Martin Baulig  <martin@ximian.com>
9068
9069         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9070         (FieldBase.IsAssigned): Removed this field.
9071         (FieldBase.SetAssigned): New public method.
9072         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9073
9074 2003-12-20  Martin Baulig  <martin@ximian.com>
9075
9076         * expression.cs (LocalVariableReference.DoResolve): Don't set
9077         `vi.Used' if we're called from DoResolveLValue().
9078
9079         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9080         returns the usage vector it just merged into the current one -
9081         pass this one to UsageWarning().
9082         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9083         of the `EmitContext', don't call this recursively on our children.
9084
9085 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9086
9087         * driver.cs: Implement /target:module.
9088
9089 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9090
9091         * support.cs (CharArrayHashtable): New helper class.
9092
9093         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9094         char arrays, not strings, so we can avoid creating a string in
9095         consume_identifier if the identifier is a keyword.
9096
9097 2003-12-16  Martin Baulig  <martin@ximian.com>
9098
9099         * statement.cs (LocalInfo.Assigned): Removed this property.
9100         (LocalInfo.Flags): Removed `Assigned'.
9101         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9102         and uses flow analysis.
9103         (Block.UsageWarning): Made this method private.
9104         (Block.Resolve): Call UsageWarning() if appropriate.
9105
9106         * expression.cs (LocalVariableReference.DoResolve): Always set
9107         LocalInfo.Used here.
9108
9109 2003-12-13  Martin Baulig  <martin@ximian.com>
9110
9111         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9112         any value here; we're now using flow analysis to figure out
9113         whether a statement/block returns a value.
9114
9115 2003-12-13  Martin Baulig  <martin@ximian.com>
9116
9117         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9118         working again.
9119         (FlowBranching.MergeFinally): Don't call
9120         `branching.CheckOutParameters()' here, this is called in
9121         MergeTopBlock().
9122         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9123         when adding the `finally' vector.       
9124
9125 2003-12-13  Martin Baulig  <martin@ximian.com>
9126
9127         * flowanalysis.cs
9128         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9129         actually work and also fix #48962.
9130
9131 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9132
9133         * decl.cs: Do not check System.Object for nested types,
9134         since we know it does not have any. Big bang for buck:
9135
9136         BEFORE:
9137            Run 1:   8.35 seconds
9138            Run 2:   8.32 seconds
9139            corlib:  17.99 seconds
9140         AFTER:
9141            Run 1:   8.17 seconds
9142            Run 2:   8.17 seconds
9143            corlib:  17.39 seconds
9144
9145 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9146
9147         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9148         time we are returning 0 members, so we save alot here.
9149
9150 2003-12-11  Martin Baulig  <martin@ximian.com>
9151
9152         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9153         `MergeChild()', also just take the `FlowBranching' as argument;
9154         call Merge() on it and return the result.
9155         (FlowBranching.Merge): We don't need to do anything if we just
9156         have one sibling.
9157
9158 2003-12-11  Martin Baulig  <martin@ximian.com>
9159
9160         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9161         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9162         Maurer for this idea.
9163
9164 2003-12-11  Martin Baulig  <martin@ximian.com>
9165
9166         * flowanalysis.cs (MergeResult): This class is now gone; we now
9167         use the `UsageVector' for this.  The reason for this is that if a
9168         branching just has one sibling, we don't need to "merge" them at
9169         all - that's the next step to do.
9170         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9171         `MergeResult'.
9172
9173 2003-12-11  Martin Baulig  <martin@ximian.com>
9174
9175         Reworked flow analyis and made it more precise and bug-free.  The
9176         most important change is that we're now using a special `Reachability'
9177         class instead of having "magic" meanings of `FlowReturns'.  I'll
9178         do some more cleanups and optimizations and also add some more
9179         documentation this week.
9180
9181         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9182         largely reworked this class.
9183         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9184         the new `Reachability' class instead of having "magic" values here.
9185         (FlowBranching): We're now using an instance of `Reachability'
9186         instead of having separate `Returns', `Breaks' etc. fields.
9187
9188         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9189         based on flow analysis; ignore the return value of block.Emit ().
9190
9191 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9192
9193         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9194         if they are private.
9195
9196 2003-12-09  Martin Baulig  <martin@ximian.com>
9197
9198         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9199         call them directly on the UsageVector.
9200
9201 2003-12-09  Martin Baulig  <martin@ximian.com>
9202
9203         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9204         Changed return type from `FlowReturns' to `Reachability'.
9205
9206 2003-12-09  Martin Baulig  <martin@ximian.com>
9207
9208         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9209         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9210         `Reachable' fields with a single `Reachability' one.
9211
9212 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9213
9214         * class.cs (FindMembers): Remove foreach's.
9215
9216         Bootstrap times:
9217
9218         BEFORE
9219                 Run 1:   8.74 seconds
9220                 Run 2:   8.71 seconds
9221
9222         AFTER
9223                 Run 1:   8.64 seconds
9224                 Run 2:   8.58 seconds
9225
9226
9227 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9228
9229         * cs-parser.jay:
9230         * gen-treedump.cs:
9231         * statement.cs:
9232         This patch does a few things:
9233                 1. EmptyStatement is now a singleton, so it is never reallocated.
9234                 2. All blah is EmptyStatement constructs have been changed to
9235                    blah == EmptyStatement.Value, which is much faster and valid
9236                    now that EmptyStatement is a singleton.
9237                 3. When resolving a block, rather than allocating a new array for
9238                    the non-empty statements, empty statements are replaced with
9239                    EmptyStatement.Value
9240                 4. Some recursive functions have been made non-recursive.
9241         Mainly the performance impact is from (3), however (1) and (2) are needed for
9242         this to work. (4) does not make a big difference in normal situations, however
9243         it makes the profile look saner.
9244
9245         Bootstrap times:
9246
9247         BEFORE
9248         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9249         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9250         Total memory allocated: 56397 KB
9251
9252         AFTER
9253         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9254         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9255         Total memory allocated: 55666 KB
9256
9257 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9258
9259         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9260         than the hashtable in a hashtable version
9261
9262         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9263         we always end up concating a string. This results in a huge perf
9264         loss, because many strings have to be tracked by the GC. In this
9265         patch, we first use a hashtable that works with two keys, so that
9266         the strings do not need to be concat'ed.
9267
9268         Bootstrap times:
9269         BEFORE
9270                 Run 1:   8.74 seconds
9271                 Run 2:   8.71 seconds
9272
9273         AFTER
9274                 Run 1:   8.65 seconds
9275                 Run 2:   8.56 seconds
9276
9277 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9278
9279         * Makefile: Add a new target `do-time' that does a quick and simple
9280         profile, leaving easy to parse output.
9281
9282 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9283
9284         * codegen.cs (Init): Create the dynamic assembly with 
9285         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9286
9287 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9288
9289         * support.cs: Make the PtrHashtable use only one
9290         instance of its comparer.
9291
9292 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9293
9294         * typemanager.cs: Fix lookup of GetNamespaces.
9295
9296 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9297
9298         * expression.cs: Removed redundant line.
9299
9300         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9301         ArrayLists, use for loops with bounds.  
9302
9303         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9304         arraylist.
9305
9306         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9307         arraylists, use for loop with bounds.
9308
9309         The above three changes give us a 0.071 second performance
9310         improvement out of 3.294 seconds down to 3.223.  On my machine
9311         the above changes reduced the memory usage by 1,387 KB during
9312         compiler bootstrap.
9313
9314         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9315         QualifiedIdentifiers.  Before we created a new string through
9316         concatenation, and mostly later on, the result would be
9317         manipulated by DecomposeQI through string manipulation.
9318
9319         This reduced the compiler memory usage for bootstrapping from
9320         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9321         compile times in 0.05 seconds.
9322
9323 2003-11-28  Dick Porter  <dick@ximian.com>
9324
9325         * support.cs: Do string compares with the Invariant culture.
9326
9327         * rootcontext.cs: 
9328         * gen-treedump.cs: 
9329         * expression.cs: 
9330         * driver.cs: 
9331         * decl.cs: 
9332         * codegen.cs: 
9333         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9334         the comparison is done with the Invariant culture.
9335
9336 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9337
9338         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9339         GetEnumerator method.
9340
9341         (ProbeCollectionType): Iterate starting at the most specific type
9342         upwards looking for a GetEnumerator
9343
9344         * expression.cs: Shift count can be up to 31 for int/uint and 63
9345         for long/ulong.
9346
9347 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9348
9349         * statement.cs (Block.LookupLabel): Also look for the label on the
9350         children blocks.  Use a hash table to keep track of visited
9351         nodes. 
9352
9353         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9354         we actually did transform the other operand, otherwise fall back
9355         to the common codepath that casts to long.
9356
9357         * cs-tokenizer.cs: Use the same code pattern as the int case.
9358         Maybe I should do the parsing myself, and avoid depending on the
9359         Parse routines to get this done.
9360
9361 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9362
9363         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9364         which fixes bug 51347.  This time test it.
9365
9366         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9367         attributes for example can not tell the difference between these.
9368         The difference was only a syntax feature of the language. 
9369
9370         * attribute.cs: Apply attributes to delegates.
9371
9372         * delegate.cs: Call the apply attributes method.
9373
9374 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9375
9376         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9377         comparing 0 vs Byte.MinValue, not the value
9378
9379         (ImplicitConversionRequired): When reporting a conversion error,
9380         use error 31 to print out the constant error instead of the
9381         simpler 29.
9382
9383         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9384         which fixes bug 51347.
9385
9386 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9387
9388         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9389         which fixes the -warnaserror command line option.
9390
9391 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9392
9393         * cfold.cs (DoNumericPromotions): During constant folding of
9394         additions on UIntConstant, special case intconstants with
9395         IntConstants like we do on the expression binary operator. 
9396
9397 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9398
9399         * convert.cs (ImplicitReferenceConversion): We were missing a case
9400         (System.Enum are not value types or class types, so we need to
9401         classify them separatedly).
9402
9403         * driver.cs: We do not support error 2007.
9404
9405 2003-11-12 Jackson Harper <jackson@ximian.com>
9406
9407         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9408         system directory. Also use the full file name so users can
9409         libraries names mscorlib-o-tron.dll in a non system dir.
9410         
9411 2004-01-04  David Sheldon <dave-mono@earth.li>
9412
9413         * expression.cs: Added matching ")" to error message for CS0077.
9414
9415 2003-12-19  Martin Baulig  <martin@ximian.com>
9416
9417         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9418         static method; see documentation in the method.
9419         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9420
9421         * convert.cs (Convert.ImplicitReferenceConversion,
9422         Convert.ImplicitReferenceConversionExists): Add support for
9423         generic type declarations; see gen-36.cs.
9424
9425 2003-12-19  Martin Baulig  <martin@ximian.com>
9426
9427         * pending.cs (Pending.InterfaceMethod): Use
9428         `Type.IsAssignableFrom()' instead of `=='.
9429
9430 2003-12-18  Martin Baulig  <martin@ximian.com>
9431
9432         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9433         byref types first.
9434
9435         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9436         `expr_type.Equals (target_type)' instead of `=='.
9437
9438 2003-12-08  Martin Baulig  <martin@ximian.com>
9439
9440         * generics.cs (Constraints.Types): Removed.
9441         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9442         to Type's.
9443         (Constraints.ResolveTypes): New public method; resolves the
9444         TypeExpr's to Type's.
9445         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9446         longer takes the constraints.
9447         (TypeParameter.DefineMethod): Likewise.
9448         (TypeParameter.DefineType): New public method.  Calls
9449         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9450         the constraints.
9451
9452 2003-12-08  Martin Baulig  <martin@ximian.com>
9453
9454         * convert.cs (Convert.ImplicitConversionStandard): Use
9455         `expr_type.Equals (target_type)' instead of `=='.
9456
9457 2003-12-08  Martin Baulig  <martin@ximian.com>
9458
9459         * typemanager.cs (TypeManager.GetReferenceType): Call
9460         `Type.MakeByRefType ()'.
9461
9462 2003-12-08  Martin Baulig  <martin@ximian.com>
9463
9464         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9465         just has some special meaning in some situations.  For instance,
9466         it is allowed to use `where' as the name of a variable etc.
9467
9468 2003-12-04  Martin Baulig  <martin@ximian.com>
9469
9470         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9471         `Type.MakeArrayType()' for array types.
9472
9473 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9474
9475         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9476         debugging message.
9477
9478         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9479         corlib to compile.
9480
9481 2003-11-16  Martin Baulig  <martin@ximian.com>
9482
9483         * codegen.cs (EmitContext.IsGeneric): Removed.
9484
9485         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9486         ResolveGeneric() on the DeclSpace.
9487
9488 2003-11-16  Martin Baulig  <martin@ximian.com>
9489
9490         * generic.cs (TypeArguments.Resolve):
9491         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9492         `ResolveType()' on it to get the Type.
9493
9494 2003-11-15  Martin Baulig  <martin@ximian.com>
9495
9496         * generic.cs (ConstructedType.GetInterfaces): Override this.
9497
9498 2003-11-14  Martin Baulig  <martin@ximian.com>
9499
9500         * interface.cs (Interface.DefineType): Define all type parameters
9501         before adding the interfaces we inherit.
9502
9503 2003-11-11  Martin Baulig  <martin@ximian.com>
9504
9505         * generic.cs (ConstructedType.ResolveType): Always call
9506         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9507
9508 2003-11-10  Martin Baulig  <martin@ximian.com>
9509
9510         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9511         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9512         calling `ResolveType()' on them, directly assign their `Type'.
9513
9514 2003-11-08  Martin Baulig  <martin@ximian.com>
9515
9516         * generic.cs (ConstructedType): Override `IsClass' etc.
9517
9518 2003-11-08  Martin Baulig  <martin@ximian.com>
9519
9520         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9521         return value and the `out parent' parameter.
9522         (TypeContainer.DefineType): Moved the CS0644 check into
9523         GetClassBases().  Don't pass the interface types to the
9524         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9525         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9526
9527         * ecore.cs (TypeExpr.IsAttribute): New property.
9528         (TypeExpr.GetInterfaces): New method.
9529
9530         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9531         TypeExpr instead of a Type.
9532         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9533         (Interface.DefineType): Don't pass the interface types to the
9534         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9535         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9536
9537         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9538         instead of a `Type[]'.
9539         (TypeManager.RegisterBuilder): Likewise.
9540         (TypeManager.AddUserInterface): Likewise.
9541         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9542         `Type[]' and also return a `TypeExpr[]'.
9543         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9544
9545 2003-11-08  Martin Baulig  <martin@ximian.com>
9546
9547         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9548         Expression.     
9549
9550 2003-11-08  Martin Baulig  <martin@ximian.com>
9551
9552         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9553         TypeManager.ResolveExpressionTypes().
9554
9555         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9556         instead of an Expression.
9557         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9558         (TypeExpression): New public class; formerly known as `TypeExpr'.
9559
9560         * expression.cs (ComposedCast): Derive from TypeExpr.
9561
9562         * typemanager.cs (TypeManager.system_*_expr): These are now
9563         TypExpr's instead of Expression's.
9564         (TypeManager.ResolveExpressionTypes): New public static function;
9565         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9566         of them.        
9567
9568 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9569
9570         * expression.cs (New.DoResolve): Do not dereference value that
9571         might be a null return.
9572
9573         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9574         sure that the constant value has the right type.  Fixes an
9575         unreported bug, similar to 50425.
9576
9577         * const.cs (Const.LookupConstantValue): Call
9578         ImplicitStandardConversionExists before doing a conversion to
9579         avoid havng the TypeManager.ChangeType do conversions.
9580
9581         Reduced the number of casts used
9582
9583         (Const.ChangeType): New routine to enable reuse of the constant
9584         type changing code from statement.
9585
9586         * typemanager.cs (ChangeType): Move common initialization to
9587         static global variables.
9588
9589         Fixes #50425.
9590
9591         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9592         every value type to go through, even if it was void.  Fix that. 
9593
9594         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9595         character of the define, and the is_identifier_part_character for
9596         the rest of the string.
9597
9598 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9599
9600         * expression.cs (UnaryMutator.EmitCode): When I updated
9601         LocalVariableReference.DoResolve, I overdid it, and dropped an
9602         optimization done on local variable references.
9603
9604 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9605
9606         * ecore.cs: Convert the return from Ldlen into an int.
9607
9608 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9611         the accessibility, this is a special case for toplevel non-public
9612         classes (internal for instance).
9613
9614 2003-10-20  Nick Drochak <ndrochak@gol.com>
9615
9616         * ecore.cs: Fix typo and build.  Needed another right paren.
9617
9618 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9619
9620         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9621         `internal' case regular and protected, but not allowing protected
9622         to be evaluated later.  Bug 49840
9623
9624 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9625
9626         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9627         to kb.Nlast, and not the kb.nFirst to isolate the switch
9628         statement.
9629
9630         Extract the underlying type, so enumerations of long/ulong are
9631         treated like long/ulong.
9632
9633 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * expression.cs (New): Overload the meaning of RequestedType to
9636         track the possible creation of the NewDelegate type, since
9637         DoResolve is invoked more than once for new constructors on field
9638         initialization.
9639
9640         See bugs: #48800 and #37014
9641
9642         * cs-parser.jay (declare_local_constants): Take an arraylist
9643         instead of a single constant.
9644
9645         (local_constant_declaration): It should take a
9646         constant_declarators, not a constant_declarator.  Fixes 49487
9647
9648         * convert.cs: Fix error report.
9649
9650 2003-10-13 Jackson Harper <jackson@ximian.com>
9651
9652         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9653         bug #49611
9654         
9655 2003-11-03  Martin Baulig  <martin@ximian.com>
9656
9657         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9658         `out bool has_type_arg'; if set, we need to pass the type to
9659         ig.Emit().
9660         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9661         Stelem_Any/Ldelem_Any for generic parameters.   
9662
9663 2003-11-02  Martin Baulig  <martin@ximian.com>
9664
9665         * expression.cs (Invocation.EmitCall): Use
9666         `TypeManager.IsValueType()' to check whether it's a value type.
9667         Don't set `struct_call' when calling a method on a type parameter.
9668
9669 2003-11-02  Martin Baulig  <martin@ximian.com>
9670
9671         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9672         and removed the TypeBuilder argument.
9673
9674         * typemanager.cs (TypeManager.IsValueType): Return
9675         `t.IsGenericParameter || t.IsValueType'.
9676
9677 2003-10-25  Martin Baulig  <martin@ximian.com>
9678
9679         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9680         call ConstructedType.Resolve() on it.
9681
9682         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9683
9684 2003-10-25  Martin Baulig  <martin@ximian.com>
9685
9686         * class.cs (TypeContainer.GetClassBases): Changed
9687         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9688         CS8214 reporting here.
9689         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9690         instead of a `Type' for our parent.  In case of a recursive
9691         declaration (see tests/gen-23.cs for an example), our parent is a
9692         ConstructedType and it doesn't have its type set.  So, first
9693         create our own TypeBuilder, then call constructed.Resolve() to get
9694         the parent's type and finally TypeBuilder.SetParent() it.
9695
9696         * ecore.cs (TypeExpr.Name): New public virtual property.
9697
9698         * generic.cs
9699         (ConstructedType): We're now a TypeExpr and not just an Expression.
9700         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9701         arguments here; this is done later.
9702         (ConstructedType.Resolve): New public method to resolve the type
9703         arguments and bind them.
9704
9705 2003-10-21  Martin Baulig  <martin@ximian.com>
9706
9707         * convert.cs: Use `TypeManager.IsValueType' instead of
9708         'type.IsValueType' everywhere.
9709
9710         * typemanager.cs (TypeManager.IsValueType): Return true for type
9711         parameters.  The reason for this is that we need to box a type
9712         parameter when converting it to a reference type.
9713
9714         * cs-parser.jay: Added support for default value expressions.
9715
9716         * generics.cs (DefaultValueExpression): New public class.       
9717
9718 2003-10-17  Martin Baulig  <martin@ximian.com>
9719
9720         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9721         TypeContainer so we can also use this for Interfaces.
9722         (TypeParameter.Resolve): Likewise.
9723
9724         * interface.cs (Interface.DefineType): Added support for generic
9725         interfaces.
9726
9727         * cs-parser.jay: Added support for generic structs and interfaces.
9728
9729 2003-10-17  Martin Baulig  <martin@ximian.com>
9730
9731         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9732         call generic methods :-)
9733
9734 2003-10-16  Martin Baulig  <martin@ximian.com>
9735
9736         * cs-parser.jay (namespace_or_type_name): Only create a
9737         GenericMemberAccess if we actually have type arguments.
9738
9739 2003-10-13  Martin Baulig  <martin@ximian.com>
9740
9741         * class.cs (Method.Define): If we're a generic method, call
9742         TypeBuilder.DefineGenericMethod () before resolving
9743         the parameters.
9744         (MethodData): Added .ctor which takes an additional MethodBuilder
9745         argument; this is used for generic methods.
9746         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9747         we already have a MethodBuilder.
9748
9749 2003-10-10  Martin Baulig  <martin@ximian.com>
9750
9751         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9752         instead of a `DeclSpace'.  This is used for generic methods.
9753
9754         * cs-parser.jay (method_header): Added support for generic
9755         methods; create a `GenericMethod' instance and pass it to the
9756         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9757         parameters and locals.
9758
9759         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9760         since we already have the location.  Check whether we're a generic
9761         type declaration or a generic method and create the correct type
9762         parameter.
9763
9764         * generic.cs (TypeParameter.DefineMethod): New public method.
9765         (GenericMethod): New public class; derives from DeclSpace and is
9766         used for generic methods.       
9767
9768 2003-10-09  Martin Baulig  <martin@ximian.com>
9769
9770         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9771         to the .ctor.
9772         (MethodCore.DoDefineParameters): Removed the TypeContainer
9773         argument; use the DeclSpace which was passed to the .ctor instead.
9774         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9775         TypeContainer; we only need a DeclSpace here.
9776
9777 2003-10-09  Martin Baulig  <martin@ximian.com>
9778
9779         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9780         to the .ctor.
9781         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9782         EmitContext's .ctor.    
9783
9784 2003-10-09  Martin Baulig  <martin@ximian.com>
9785
9786         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9787         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9788         AsAccessible(), moved them as well.
9789
9790         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9791
9792 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9793
9794         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9795         generation for >=, as spotted by Paolo, bug 48679.  
9796         Patch from David Waite.
9797
9798         * cs-tokenizer.cs: Add handling for #pragma.
9799
9800         * cs-parser.jay: Allow for both yield and yield return in the
9801         syntax.  The anti-cobolization of C# fight will go on!
9802
9803         * class.cs (TypeBuilder.DefineType): Catch error condition here
9804         (Parent.DefineType erroring out and returning null).
9805
9806         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9807         coping with enumerations variables, we were mistakenly processing
9808         them as a regular value type instead of built-in types.  Fixes the
9809         bug #48063
9810
9811         * typemanager.cs (IsBuiltinOrEnum): New method.
9812
9813 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9814
9815         * cs-parser.jay: Upgrade: yield now needs the return clause.
9816
9817 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9818
9819         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9820
9821 2003-09-29  Martin Baulig  <martin@ximian.com>
9822
9823         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9824         inflated generic methods.
9825
9826         * generics.cs (ConstructedType): Distinguish between open and
9827         closed constructed types; correctly resolve the arguments.
9828
9829 2003-09-22  Martin Baulig  <martin@ximian.com>
9830
9831         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9832         all type arguments meet their constraints.
9833
9834 2003-09-19  Martin Baulig  <martin@ximian.com>
9835
9836         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9837         `MemberCache parent' argument.  Normally, an interface doesn't
9838         have a parent type except System.Object, but we use this in gmcs
9839         for generic type parameters.
9840
9841 2003-09-18  Martin Baulig  <martin@ximian.com>
9842
9843         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9844         on `type.IsInterface'; don't check whether the type has a parent
9845         to determine whether it's an interface.
9846
9847 2003-09-17  Martin Baulig  <martin@ximian.com>
9848
9849         * generic.cs (ConstructedType.ToString): Always use `name' as the
9850         type name.
9851
9852 2003-09-15  Martin Baulig  <martin@ximian.com>
9853
9854         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9855
9856         * generic.cs (Constraints.Resolve): New public method; this is
9857         called to resolve the constraint types and to check whether all
9858         the constraints are correct.
9859         (Constraints.Types): New public property.
9860         (TypeParameter.Resolve): New public method; resolves all the
9861         type's constraints.
9862
9863         * class.cs (TypeContainer.DefineType): Call
9864         TypeParameter.Resolve() before actually defining the type.
9865
9866 2003-09-15  Martin Baulig  <martin@ximian.com>
9867
9868         * class.cs (TypeContainer.DefineType): Added an error flag to
9869         avoid reporting duplicate CS0146's ("class definition is
9870         circular.").
9871
9872         * driver.cs (Driver.MainDriver): Abort if
9873         RootContext.ResolveTree() reported any errors.
9874
9875 2003-09-07  Martin Baulig  <martin@ximian.com>
9876
9877         * report.cs (Error, Warning): Added overloaded versions which take
9878         a `params object[] args' and call String.Format().
9879
9880 2003-09-07  Martin Baulig  <martin@ximian.com>
9881
9882         * decl.cs (DeclSpace..ctor): Don't call
9883         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9884         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9885         (DeclSpace.RecordDecl): New method.
9886
9887         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9888
9889 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9890
9891         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9892         value attributes to be applied to ParameterBuilders.
9893
9894         * class.cs (MethodCore.LabelParameters): Make static and more
9895         generic so that it can be used from other places - like interface
9896         methods, for instance.
9897
9898         * interface.cs (Interface.Emit): Call LabelParameters before
9899         emitting attributes on the InterfaceMethod.
9900
9901 2003-09-07  Martin Baulig  <martin@ximian.com>
9902
9903         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9904         if the number of type parameters doesn't match.
9905
9906 2003-09-04  Martin Baulig  <martin@ximian.com>
9907
9908         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9909         for arrays of generic type params (ie. `!0[]').
9910
9911 2003-09-04  Martin Baulig  <martin@ximian.com>
9912
9913         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9914         for the moment.
9915
9916 2003-09-04  Martin Baulig  <martin@ximian.com>
9917
9918         * decl.cs (DeclSpace.LookupGeneric): New method.
9919         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9920         moment.
9921
9922         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9923         argument, not just a string.
9924         (TypeParameter.Define): New public method; this is called to
9925         actually define the generic parameter; after this, you can use the
9926         new `Type' property to get the type.
9927
9928 2003-09-04  Martin Baulig  <martin@ximian.com>
9929
9930         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9931         is now an ArrayList; initialize the result of the `TypeParameters'
9932         property here.
9933         (DeclSpace.GetGenericData): Removed.
9934         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9935         implement this in a different way.
9936         (DeclSpace.GetTypeParameters): Removed; there's now a
9937         `TypeParameters' property.
9938         (DeclSpace.TypeParameters): New public property.
9939
9940         * generic.cs (Constraints): Make this class public.
9941         (TypeParameter): New public class.
9942
9943 2003-09-04  Martin Baulig  <martin@ximian.com>
9944
9945         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9946         generic parameters.
9947
9948         * class.cs (TypeContainer.DefineType): Call
9949         TypeBuilder.DefineGenericParameter () on all generic parameters if
9950         this is a generic type.
9951
9952 2003-08-28  Martin Baulig  <martin@ximian.com>
9953
9954         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9955         sample-stack.il".
9956
9957         * sample-hello.cs: Compile this with gmcs: "gmcs
9958         /r:sample-stack.dll sample-hello.cs".
9959
9960 2003-08-28  Martin Baulig  <martin@ximian.com>
9961
9962         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9963         the parameters to the generic type.
9964
9965 2003-08-28  Martin Baulig  <martin@ximian.com>
9966
9967         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9968
9969 2003-08-28  Martin Baulig  <martin@ximian.com>
9970
9971         * cs-parser.jay (opt_type_argument_list): Use
9972         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9973         (primary_expression): Replace `qualified_identifier' with `type_name'.
9974         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9975
9976         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9977         parser to check whether it is syntactically a type parameter list;
9978         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9979         this case.
9980
9981 2003-08-26  Martin Baulig  <martin@ximian.com>
9982
9983         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9984         resolving aliases; fixes #47927.
9985
9986 2003-08-26  Martin Baulig  <martin@ximian.com>
9987
9988         * statement.cs (Using.DoResolve): This is internally emitting a
9989         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9990         do not always return.  Fixes #47681.
9991
9992 2003-08-26  Martin Baulig  <martin@ximian.com>
9993
9994         * decl.cs (MemberCore): Moved WarningNotHiding(),
9995         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9996         into MemberBase.
9997         (AdditionResult): Make this nested in DeclSpace.
9998         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9999         argument; call NamespaceEntry.Define() unless we're nested in a
10000         class or struct.
10001
10002         * namespace.cs (Namespace.DefineName): New public function.  This
10003         is called from DeclSpace's .ctor to add 
10004         (Namespace.Lookup): Include DeclSpaces in the lookup.
10005
10006         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10007
10008         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10009
10010 2003-08-25  Martin Baulig  <martin@ximian.com>
10011
10012         * convert.cs (Convert.ExplicitReferenceConversion): When
10013         converting from an interface type to a class, unbox if the target
10014         type is a struct type.  Fixes #47822.
10015
10016 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10017
10018         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10019         #47854.
10020
10021 2003-08-22  Martin Baulig  <martin@ximian.com>
10022
10023         * class.cs (TypeManager.DefineType): When defining a nested type,
10024         call DefineType() on our parent; fixes #47801.
10025
10026 2003-08-22  Martin Baulig  <martin@ximian.com>
10027
10028         * class.cs (MethodData.Define): While checking if a method is an
10029         interface implementation, improve the test a bit more to fix #47654.
10030
10031 2003-08-22  Martin Baulig  <martin@ximian.com>
10032
10033         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10034         correctly; fixes #47722.
10035
10036 2003-08-22  Martin Baulig  <martin@ximian.com>
10037
10038         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10039         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10040
10041         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10042
10043 2003-08-22  Martin Baulig  <martin@ximian.com>
10044
10045         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10046         can only be assigned in static constructors.  Fixes #47161.
10047
10048 2003-08-22  Martin Baulig  <martin@ximian.com>
10049
10050         Rewrote and improved the flow analysis code.
10051
10052         * flowbranching.cs (FlowBranching): Make this class abstract.
10053         (FlowBranching.CreateBranching): New static function to create a
10054         new flow branching.
10055         (FlowBranchingBlock, FlowBranchingException): New classes.
10056         (FlowBranching.UsageVector.Type): New public readonly field.
10057         (FlowBranching.UsageVector.Breaks): Removed the setter.
10058         (FlowBranching.UsageVector.Returns): Removed the setter.
10059         (FlowBranching.UsageVector): Added Break(), Return(),
10060         NeverReachable() and Throw() methods to modify the reachability.
10061         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10062         done by FlowBranching.Merge().
10063         (FlowBranching.UsageVector.MergeChild): New method; merges the
10064         merge result into the current vector.
10065         (FlowBranching.Merge): New abstract method to merge a branching.
10066
10067 2003-08-12  Martin Baulig  <martin@ximian.com>
10068
10069         * expression.cs (Indirection.CacheTemporaries): Create the
10070         LocalTemporary with the pointer type, not its element type.
10071
10072 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10073
10074         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10075         token was a keyword or not.
10076
10077         Add `error' options where an IDENTIFIER was expected;  Provide
10078         CheckToken and CheckIdentifierToken convenience error reporting
10079         functions. 
10080
10081         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10082
10083         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10084         NameSpaceEntry NameSpaceEntry.
10085
10086         (LookupInterfaceOrClass): Avoid creating a full qualified name
10087         from namespace and name: avoid doing lookups when we know the
10088         namespace is non-existant.   Use new Tree.LookupByNamespace which
10089         looks up DeclSpaces based on their namespace, name pair.
10090
10091         * driver.cs: Provide a new `parser verbose' to display the
10092         exception thrown during parsing.  This is turned off by default
10093         now, so the output of a failure from mcs is more graceful.
10094
10095         * namespace.cs: Track all the namespaces defined in a hashtable
10096         for quick lookup.
10097
10098         (IsNamespace): New method
10099
10100 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10103         we know that we need to concatenate (full typename can never be
10104         null). 
10105
10106         * class.cs: ditto.
10107
10108         * statement.cs: Use a bitfield;  Do not initialize to null things
10109         which are done by the constructor by default.
10110
10111         * cs-parser.jay: bug fix, parameter was 4, not 3.
10112
10113         * expression.cs: Just use the property;
10114
10115         * statement.cs: No need for GetVariableInfo method.
10116
10117 2003-08-08  Martin Baulig  <martin@ximian.com>
10118
10119         * flowanalysis.cs (FlowReturns): This is now nested in the
10120         `FlowBranching' class.
10121         (MyBitVector): Moved this here from statement.cs.
10122         (FlowBranching.SiblingType): New enum type.
10123         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10124
10125 2003-08-07  Martin Baulig  <martin@ximian.com>
10126
10127         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10128         `FlowBranching' class and called `BranchingType'.
10129
10130 2003-08-07  Martin Baulig  <martin@ximian.com>
10131
10132         * flowanalysis.cs: Moved all the control flow analysis code into
10133         its own file.
10134
10135 2003-08-07  Martin Baulig  <martin@ximian.com>
10136
10137         * assign.cs (Assign.DoResolve): `target' must either be an
10138         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10139         #37319.
10140
10141 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * expression.cs (BinaryMethod): This kind of expression is created by the
10144         Binary class if it determines that the operator has to be handled
10145         by a method.
10146
10147         (BinaryDelegate): This kind of expression is created if we are
10148         dealing with a + or - operator on delegates.
10149
10150         (Binary): remove method, argumetns, and DelegateOperator: when
10151         dealing with methods, 
10152
10153         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10154
10155         * statement.cs (Block): use bitfields for the three extra booleans
10156         we had in use.   Remove unused topblock parameter.
10157
10158         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10159
10160         * assign.cs: Drop extra unneeded tests.
10161
10162 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10163
10164         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10165
10166         * statement.cs (Foreach): Use VariableStorage instead of
10167         LocalBuilders.   
10168
10169         * codegen.cs (VariableStorage): New class used by clients that
10170         require a variable stored: locals or fields for variables that
10171         need to live across yield.
10172
10173         Maybe provide a convenience api for EmitThis+EmitLoad?
10174
10175         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10176         these bad boys.
10177
10178 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10181         RemapParameterLValue): New methods that are used to turn a
10182         precomputed FieldInfo into an expression like this:
10183
10184                 instance.FieldInfo
10185
10186         The idea is to use this instead of making LocalVariableReference
10187         have more than one meaning.
10188
10189         * cs-parser.jay: Add error production to BASE.
10190
10191         * ecore.cs: Deal with TypeManager.GetField returning null, which
10192         is now a valid return value.
10193
10194         (FieldExprNoAddress): New expression for Fields whose address can
10195         not be taken.
10196
10197         * expression.cs (LocalVariableReference): During the resolve
10198         phases, create new expressions if we are in a remapping context.
10199         Remove code that dealt with remapping here.
10200
10201         (ParameterReference): same.
10202
10203         (ProxyInstance): New expression, like the `This' expression, but
10204         it is born fully resolved.  We know what we are doing, so remove
10205         the errors that are targeted to user-provided uses of `this'.
10206
10207         * statement.cs (Foreach): our variable is now stored as an
10208         Expression;  During resolution, follow the protocol, dont just
10209         assume it will return this.
10210
10211 2003-08-06  Martin Baulig  <martin@ximian.com>
10212
10213         * support.cs (SeekableStreamReader.cs): New public class.
10214
10215         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10216         SeekableStreamReader instead of the normal StreamReader.
10217
10218 2003-08-04  Martin Baulig  <martin@ximian.com>
10219
10220         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10221         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10222         deambiguate casts and delegate invocations.
10223         (parenthesized_expression): Use the new tokens to ensure this is
10224         not a cast of method invocation.
10225
10226         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10227         when reading a `)' and Deambiguate_CloseParens () was previously
10228         called.
10229
10230         * expression.cs (ParenthesizedExpression): New class.  This is
10231         just used for the CS0075 test.
10232         (Binary.DoResolve): Check for CS0075.   
10233
10234 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10235
10236         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10237         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10238         reference comparison.
10239
10240         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10241         examine the ReturnType for equality - this is necessary in the
10242         cases of implicit and explicit operators whose signature also
10243         includes the return type.
10244
10245 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10246
10247         * namespace.cs: Cache the result of the namespace computation,
10248         instead of computing it every time.
10249
10250 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10251
10252         * decl.cs: Use a global arraylist that we reuse over invocations
10253         to avoid excesive memory consumption.  Reduces memory usage on an
10254         mcs compile by one meg (45 average).
10255
10256         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10257         private, work around that.
10258
10259 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10260
10261         * literal.cs (IntLiteral): Define Zero and One static literals. 
10262
10263         * cs-parser.jay (integer_literal): use static literals to reduce
10264         memory usage for the most used literals (0, 1 and -1).  211kb
10265         reduced in memory usage.
10266
10267         Replace all calls to `new ArrayList' with `new
10268         ArrayList(4)' which is a good average number for most allocations,
10269         and also requires only 16 bytes of memory for its buffer by
10270         default. 
10271
10272         This reduced MCS memory usage in seven megabytes for the RSS after
10273         bootstrapping.
10274
10275 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10276
10277         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10278         handle params methods the correct way by forming only one
10279         applicable set with params and normal methods in them. Earlier we
10280         were looking at params methods only if we found no normal methods
10281         which was not the correct thing to do.
10282
10283         (Invocation.BetterFunction): Take separate arguments indicating
10284         when candidate and the best method are params methods in their
10285         expanded form.
10286
10287         This fixes bugs #43367 and #46199.
10288
10289         * attribute.cs: Documentation updates.
10290
10291         (CheckAttribute): Rename to CheckAttributeTarget.
10292         (GetValidPlaces): Rename to GetValidTargets.
10293
10294         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10295         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10296
10297         Fixes bug #44468.
10298
10299 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10300
10301         * codegen.cs: Compute IsGeneric correctly.
10302
10303         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10304         resolution. 
10305
10306         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10307         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10308         regressions, and I was chasing more bugs than I required.
10309
10310         * interface.cs: Use expressions for base type names (like classes
10311         and structs have been doing for a while now), and resolve that.
10312         This patch should probably go into head as well.
10313
10314         This makes it one less user of FindType.
10315
10316 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10317
10318         This compiler can not self host currently.  Need to fix that.
10319         
10320         * Makefile: compile to `gmcs.exe'
10321
10322         * driver.cs: Turn on v2 by default on gmcs.
10323
10324         * generic.cs (ConstructedType): Does no longer take a container
10325         type argument;  That will be taken care of later.
10326
10327         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10328         Use SimpleName to resolve for now, so we can continue the work on
10329         the parser, until we get Type.GetType that understands generics.
10330
10331         (ConstructedType.ToString): Implement
10332
10333         (TypeArguments.Resolve): Resolve the child expressions as types. 
10334         
10335         * cs-parser.jay: Rename interface_constraints to
10336         type_parameter_constraints
10337
10338         (namespace_or_type_name): Only use constructed types for the basic
10339         construction, we will deal with identifier<...> later.
10340
10341         (type/type_name): No longer call DecomposeQI, as
10342         namespace_or_type_name is always decoded now.
10343         
10344 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10345
10346         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10347         closely: we eliminate methods in base types when we have an
10348         applicable method in a top-level type.
10349
10350         Please see section 14.5.5.1 for an exact description of what goes
10351         on. 
10352
10353         This fixes bug #45127 and a host of other related to corlib compilation.
10354
10355         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10356         array is the method corresponding to the top-level type (this is
10357         because of the changes made to icall.c) so we change this
10358         accordingly.
10359
10360         (MethodGroupExpr.Name): This too.
10361
10362         * typemanager.cs (GetElementType): New method which does the right
10363         thing when compiling corlib. 
10364
10365         * everywhere: Make use of the above in the relevant places.
10366
10367 2003-07-22  Martin Baulig  <martin@ximian.com>
10368
10369         * cs-parser.jay (invocation_expression): Moved
10370         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10371         `cast_expression', but create a InvocationOrCast which later
10372         resolves to either an Invocation or a Cast.
10373
10374         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10375         method; call this before EmitStatement() to make sure that this
10376         expression can be used as a statement.
10377
10378         * expression.cs (InvocationOrCast): New class; resolves to either
10379         an Invocation or a Cast.
10380
10381         * statement.cs (StatementExpression): Call ResolveStatement() on
10382         the ExpressionStatement before emitting it.
10383
10384 2003-07-21  Martin Baulig  <martin@ximian.com>
10385
10386         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10387         `ref' and `out' attributes match; fixes #46220.
10388         (MemberAccess.ResolveMemberAccess): You can't reference a type
10389         through an expression; fixes #33180.
10390         (Indexers.GetIndexersForType): Don't return the indexers from
10391         interfaces the class implements; fixes #46502.
10392
10393 2003-07-21  Martin Baulig  <martin@ximian.com>
10394
10395         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10396         CS0661 checks; fixes bug #30442.
10397
10398 2003-07-21  Martin Baulig  <martin@ximian.com>
10399
10400         * decl.cs (AdditionResult): Added `Error'.
10401
10402         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10403
10404         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10405         cs0031.cs actually work.
10406
10407  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10408  
10409         * cs-parser.jay (namespace_name): do not use
10410         namespace_or_type_name, use qualified_identifier, because
10411         namespace_or_type_name will soon return a composed expression
10412         instead of a string.
10413  
10414         (namespace_or_type_name): Instead of returning a string, now this
10415         production returns an expression.
10416  
10417         * codegen.cs (EmitContext): Setup IsGeneric property based on
10418         whether our DeclSpace is generic, our the method is generic.
10419  
10420         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10421         the method is generic.
10422  
10423         * cs-parser.jay (type_arguments, opt_type_argument_list,
10424         type_parameters, type_parameter_list, opt_type_parameter_list,
10425         type_parameter,, opt_type_parameter_constraints_clauses,
10426         type_parameter_constraints_clauses,
10427         type_parameter_constraint_clause, type_parameter_constraint,
10428         interface_constraints): Add new production
10429  
10430         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10431         DeclSpace is generic or not.
10432  
10433         (DeclSpace.SetParameterInfo): New routine, used to set the
10434         parameter info for a type.
10435  
10436         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10437         returns a GenericTypeExpr
10438  
10439         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10440         generic, lookup the generic argument.
10441  
10442         * attribute.cs: Do not allow TypeParameterExpressions in
10443         Attributes.
10444  
10445         * class.cs: Do not allow the Main method to be defined in a
10446         Generic container.
10447  
10448         * expression.cs (SizeOf): Do not allow generic types to be used as
10449         arguments to sizeof.
10450  
10451         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10452         it: whether a type is generic or not.  Only works for types we are
10453         currently building for now.
10454         
10455 2003-07-20  Martin Baulig  <martin@ximian.com>
10456
10457         * namespace.cs: Fixed that bug which caused a crash when compiling
10458         the debugger's GUI.
10459
10460 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10461
10462         * typemanager.cs (LookupTypeReflection): Never expose types which
10463         are NotPublic, NestedPrivate, NestedAssembly, or
10464         NestedFamANDAssem.  We used to return these, and later do a check
10465         that would report a meaningful error, but the problem is that we
10466         would not get the real match, if there was a name override.
10467
10468 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10469
10470         * namespace.cs (Namespace, Name): Do not compute the namespace
10471         name dynamically, compute it in the constructor.  This reduced
10472         memory usage by 1697 KB.
10473
10474         * driver.cs: Use --pause to pause at the end.
10475
10476 2003-07-17  Peter Williams  <peter@newton.cx>
10477
10478         * Makefile: Change the name of the test target so that it doesn't
10479         conflict with the recursive test target.
10480
10481 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10484         AddressOf): Do not use EmitThis, that was wrong, use the actual
10485         this pointer.
10486
10487 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * class.cs (MethodData.Define): While checking if a method is an
10490         interface implementation, improve the test: If we are not public
10491         (use new test here: use the computed MethodAttributes directly,
10492         instead of the parsed modifier flags) check if the `implementing'
10493         method comes from an interface or not.
10494
10495         * pending.cs (VerifyPendingMethods): Slightly better error
10496         message.
10497
10498         * makefile: add test target that does the mcs bootstrap.
10499
10500 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10501
10502         * interface.cs (Define): Do nothing here since there are no
10503         members to populate etc. Move the attribute emission out of here
10504         since this was just totally the wrong place to put it. Attribute
10505         application happens during the 'Emit' phase, not in the 'Define'
10506         phase.
10507
10508         (Emit): Add this method and move the attribute emission here
10509
10510         * rootcontext.cs (EmitCode): Call the Emit method on interface
10511         types too.
10512
10513 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10514
10515         * expression.cs (OverloadResolve): Report error only if Location
10516         is not 'Null' which means that there was a probe going on.
10517
10518 2003-07-14  Martin Baulig  <martin@ximian.com>
10519
10520         * expression.cs (ConditionalLogicalOperator): New public class to
10521         implement user defined conditional logical operators.
10522         This is section 14.11.2 in the spec and bug #40505.
10523
10524 2003-07-14  Martin Baulig  <martin@ximian.com>
10525
10526         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10527
10528 2003-07-14  Martin Baulig  <martin@ximian.com>
10529
10530         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10531
10532         * ecore.cs (IVariable.VerifyFixed): New interface method.
10533
10534         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10535         operator, check whether the variable is actually fixed.  Fixes bug
10536         #36055.  Set a variable definitely assigned when taking its
10537         address as required by the spec.
10538
10539         * statement.cs (LocalInfo.IsFixed): New field.
10540         (LocalInfo.MakePinned): Set `IsFixed' to true.
10541
10542 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10543
10544         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10545         for .ctors, ensure that we only ask for members declared in the
10546         attribute type (BindingFlags.DeclaredOnly).
10547
10548         Fixes bug #43632.
10549
10550         * expression.cs (Error_WrongNumArguments): Report error 1501
10551         correctly the way CSC does.
10552
10553 2003-07-13  Martin Baulig  <martin@ximian.com>
10554
10555         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10556         lookup on the fully qualified name, to make things like "X.X" work
10557         where "X.X" is a fully qualified type name, but we also have a
10558         namespace "X" in the using list.  Fixes #41975.
10559
10560 2003-07-13  Martin Baulig  <martin@ximian.com>
10561
10562         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10563         function. If we're a CompoundAssign, we need to create an embedded
10564         CompoundAssign, not an embedded Assign.
10565         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10566         Fixes #45854.
10567
10568 2003-07-13  Martin Baulig  <martin@ximian.com>
10569
10570         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10571         work to fix bug #46088.
10572
10573 2003-07-13  Ravi Pratap <ravi@ximian.com>
10574
10575         * class.cs (Operator.Emit): Do not emit attributes here - it is
10576         taken care of by the Method class that we delegate too. This takes
10577         care of bug #45876.
10578
10579 2003-07-10  Martin Baulig  <martin@ximian.com>
10580
10581         * expression.cs (TypeOfVoid): New class.
10582         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10583
10584 2003-07-10  Martin Baulig  <martin@ximian.com>
10585
10586         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10587         bug #35957.
10588
10589 2003-07-10  Martin Baulig  <martin@ximian.com>
10590
10591         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10592         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10593
10594         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10595
10596         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10597
10598 2003-07-10  Martin Baulig  <martin@ximian.com>
10599
10600         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10601         of decimal.  Fixes #42850.
10602
10603         NOTE: I also fixed the created byte blob, but this doesn't work on
10604         the MS runtime and csc never produces any byte blobs for decimal
10605         arrays.
10606
10607 2003-07-10  Martin Baulig  <martin@ximian.com>
10608
10609         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10610         structs; fixes #32068.
10611         (Block.AddChildVariableNames): Fixed #44302.
10612
10613 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10614
10615         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10616
10617 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10618
10619         * attribute.cs: And this test is onger needed.
10620
10621 2003-07-08  Martin Baulig  <martin@ximian.com>
10622
10623         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10624         inaccessible types.  Fixes #36313.
10625
10626         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10627
10628         * namespace.cs (NamespaceEntry): Create implicit entries for all
10629         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10630         implicit entries for N1.N2 and N1.
10631
10632 2003-07-08  Martin Baulig  <martin@ximian.com>
10633
10634         Rewrote the handling of namespaces to fix a lot of the issues
10635         wrt. `using' aliases etc.
10636
10637         * namespace.cs (Namespace): Splitted this class into a
10638         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10639
10640         * typemanager.cs (TypeManager.IsNamespace): Removed.
10641         (TypeManager.ComputeNamespaces): Only compute namespaces from
10642         loaded assemblies here, not the namespaces from the assembly we're
10643         currently compiling.
10644
10645 2003-07-08  Martin Baulig  <martin@ximian.com>
10646
10647         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10648
10649 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10650
10651         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10652         already fixed it.  
10653
10654         I thought about the memory savings here, but LookupTypeReflection
10655         is used under already very constrained scenarios.  Compiling
10656         corlib or mcs only exposes one hit, so it would not really reduce
10657         any memory consumption.
10658
10659 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10660
10661         * typemanager.cs: fixes bug #45889 by only adding public types from
10662         other assemblies to the list of known types.
10663
10664 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10665
10666         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10667         on the type we resolved.
10668
10669 2003-07-05  Martin Baulig  <martin@ximian.com>
10670
10671         * pending.cs (PendingImplementation.ParentImplements): Don't
10672         create the proxy if the parent is abstract.
10673
10674         * class.cs (TypeContainer.DefineIndexers): Process explicit
10675         interface implementations first.  Fixes #37714.
10676
10677 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10680         defined recursively;  but since we modify the input parameters
10681         (left is set to `this' temporarily), we reset this value if the
10682         left_is_explicit is false, which gives the original semantics to
10683         the code.  
10684
10685         * literal.cs (NullPointer): new class used to represent a null
10686         literal in a pointer context.
10687
10688         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10689         type is a pointer, use a NullPointer object instead of a
10690         NullLiteral.   Closes 43687
10691
10692         (ExplicitConversion): Convert pointer values using
10693         the conv opcode to the proper type.
10694
10695         * ecore.cs (New): change ValueTypeVariable property into a method,
10696         that returns whether the valuetype is suitable for being used.
10697
10698         * expression.cs (Binary.DoNumericPromotions): Only return if we
10699         the int constant was a valid uint, and we can return both left and
10700         right as uints.  If not, we continue processing, to trigger the
10701         type conversion.  This fixes 39018.
10702
10703         * statement.cs (Block.EmitMeta): During constant resolution, set
10704         the CurrentBlock property on the emitcontext, so that we resolve
10705         constants propertly.
10706
10707 2003-07-02  Martin Baulig  <martin@ximian.com>
10708
10709         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10710         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10711
10712         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10713         than emitting it here.
10714
10715         * statement.cs: Fixed some more flow analysis bugs.
10716
10717 2003-07-02  Martin Baulig  <martin@ximian.com>
10718
10719         * class.cs (MethodData.Define): When implementing interface
10720         methods, set Final unless we're Virtual.
10721
10722         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10723         check work for interface methods.
10724
10725 2003-07-01  Martin Baulig  <martin@ximian.com>
10726
10727         * ecore.cs (EmitContext.This): Replaced this property with a
10728         GetThis() method which takes a Location argument.  This ensures
10729         that we get the correct error location for a CS0188.
10730
10731 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10732
10733         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10734         ImplicitStandardConversion.
10735
10736         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10737
10738 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10739
10740         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10741         optimization.
10742
10743 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10746         constructors.
10747
10748         (MethodData.Define): Turn off initlocals for unsafe methods.
10749
10750 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10751
10752         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10753         complete;  Fixes #37521.
10754
10755         * delegate.cs: Use Modifiers.TypeAttr to compute the
10756         TypeAttributes, instead of rolling our own.  This makes the flags
10757         correct for the delegates.
10758
10759 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * class.cs (Constructor.Define): Set the private flag for static
10762         constructors as well.
10763
10764         * cs-parser.jay (statement_expression): Set the return value to
10765         null, to avoid a crash when we catch an error.
10766
10767 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10768
10769         * cs-parser.jay: Applied patch from Jackson that adds support for
10770         extern and unsafe modifiers to destructor declarations.
10771
10772         * expression.cs: Report error 21 if the user is trying to index a
10773         System.Array.
10774
10775         * driver.cs: Add an error message, suggested by the bug report.
10776
10777         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10778         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10779
10780 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10781
10782         * namespace.cs: Add some information to reduce FAQs.
10783
10784 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10785
10786         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10787         underlying enumeration types.  Fixes #43915.
10788
10789         * expression.cs: Treat ushort/short as legal values to be used in
10790         bitwise operations.
10791
10792 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10793
10794         * delegate.cs: transfer custom attributes for paramenters from
10795         the delegate declaration to Invoke and BeginInvoke.
10796
10797 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10798
10799         * attribute.cs: handle custom marshalers and emit marshal info
10800         for fields, too.
10801
10802 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10803
10804         * makefile.gnu: Added anonymous.cs to the compiler sources.
10805
10806 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10807
10808         * iterators.cs: Change the name of the proxy class to include two
10809         underscores.
10810
10811         * cs-parser.jay: Update grammar to include anonymous methods.
10812
10813         * anonymous.cs: new file.
10814
10815 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10816
10817         * class.cs (Field.Define): Add missing test for pointers and
10818         safety. 
10819
10820 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10821
10822         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10823         we use the stobj opcode.
10824
10825         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10826         since it wasn't the correct fix. 
10827
10828         It still is puzzling that we are required to use stobj for IntPtr
10829         which seems to be a ValueType.
10830
10831 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10832
10833         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10834         during regular simple name resolution.   Now, the trick is that
10835         instead of returning for processing the simplename, we do a
10836         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10837         contextual lookup type).   If a match is found, return that, if
10838         not, return for further composition.
10839
10840         This fixes long-standing 30485.
10841
10842         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10843         using the address to initialize an object, do an Stobj instead of
10844         using the regular Stelem.
10845
10846         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10847         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10848         Because if we are a BaseIndexerAccess that value will be true.
10849         Fixes 43643.
10850
10851         * statement.cs (GotoCase.Resolve): Return after reporting an
10852         error, do not attempt to continue. 
10853
10854         * expression.cs (PointerArithmetic.Emit): If our operand is a
10855         long, convert our constants to match the operand before
10856         multiplying.  Convert to I type before adding.   Fixes 43670.
10857
10858 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10859
10860         * enum.cs (ImplicitConversionExists) : Rename to
10861         ImplicitEnumConversionExists to remove ambiguity. 
10862
10863         * ecore.cs (NullCast): New type of cast expression class which
10864         basically is very similar to EmptyCast with the difference being
10865         it still is a constant since it is used only to cast a null to
10866         something else
10867         (eg. (string) null)
10868
10869         * convert.cs (ImplicitReferenceConversion): When casting a null
10870         literal, we return a NullCast.
10871
10872         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10873         should be around anymore.
10874
10875         The renaming (reported was slightly wrong). Corrections:
10876
10877         ConvertImplicitStandard -> ImplicitConversionStandard
10878         ConvertExplicitStandard -> ExplicitConversionStandard
10879
10880         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10881         before passing them in !
10882
10883         * convert.cs (ImplicitConversionStandard): When comparing for
10884         equal expr and target types, ensure that expr is not a
10885         NullLiteral.
10886
10887         In general, we must not be checking (expr_type ==
10888         target_type) in the top level conversion methods
10889         (ImplicitConversion, ExplicitConversion etc). This checking is
10890         done in the methods that they delegate to.
10891
10892 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * convert.cs: Move Error_CannotConvertType,
10895         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10896         ImplicitNumericConversion, ImplicitConversionExists,
10897         ImplicitUserConversionExists, StandardConversionExists,
10898         FindMostEncompassedType, FindMostSpecificSource,
10899         FindMostSpecificTarget, ImplicitUserConversion,
10900         ExplicitUserConversion, GetConversionOperators,
10901         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10902         TryImplicitIntConversion, Error_CannotConvertImplicit,
10903         ConvertImplicitRequired, ConvertNumericExplicit,
10904         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10905         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10906         its own file.
10907
10908         Perform the following renames:
10909
10910         StandardConversionExists -> ImplicitStandardConversionExists
10911         ConvertImplicit -> ImplicitConversion
10912         ConvertImplicitStandard -> ImplicitStandardConversion
10913         TryImplicitIntConversion -> ImplicitIntConversion
10914         ConvertImplicitRequired -> ImplicitConversionRequired
10915         ConvertNumericExplicit -> ExplicitNumericConversion
10916         ConvertReferenceExplicit -> ExplicitReferenceConversion
10917         ConvertExplicit -> ExplicitConversion
10918         ConvertExplicitStandard -> ExplicitStandardConversion
10919
10920 2003-05-19  Martin Baulig  <martin@ximian.com>
10921
10922         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10923         (TypeInfo): Added support for structs having structs as fields.
10924
10925         * ecore.cs (FieldExpr): Implement IVariable.
10926         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10927         VariableInfo for the field.
10928
10929 2003-05-18  Martin Baulig  <martin@ximian.com>
10930
10931         * expression.cs (This.DoResolve): Report a CS0027 if we're
10932         emitting a field initializer.
10933
10934 2003-05-18  Martin Baulig  <martin@ximian.com>
10935
10936         * expression.cs (This.ResolveBase): New public function.
10937         (This.DoResolve): Check for CS0188.
10938
10939         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10940         This.Resolve().
10941
10942         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10943         `instance_expression' to null if we don't have any non-static
10944         methods.
10945
10946 2003-05-18  Martin Baulig  <martin@ximian.com>
10947
10948         Reworked the way how local variables and parameters are handled by
10949         the flow analysis code.
10950
10951         * statement.cs (TypeInfo, VariableMap): New public classes.
10952         (VariableInfo): New public class.  This is now responsible for
10953         checking whether a variable has been assigned.  It is used for
10954         parameters and local variables.
10955         (Block.EmitMeta): Take the InternalParameters as argument; compute
10956         the layout of the flow vectors here.
10957         (Block.LocalMap, Block.ParameterMap): New public properties.
10958         (FlowBranching): The .ctor doesn't get the InternalParameters
10959         anymore since Block.EmitMeta() now computes the layout of the flow
10960         vector.
10961         (MyStructInfo): This class is now known as `StructInfo' and nested
10962         in `TypeInfo'; we don't access this directly anymore.
10963
10964         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10965         property and removed IsAssigned(), IsFieldAssigned(),
10966         SetAssigned() and SetFieldAssigned(); we now call them on the
10967         VariableInfo so we don't need to duplicate this code everywhere.
10968
10969         * expression.cs (ParameterReference): Added `Block block' argument
10970         to the .ctor.
10971         (LocalVariableReference, ParameterReference, This): The new
10972         VariableInfo class is now responsible for all the definite
10973         assignment stuff.
10974
10975         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10976         IsParameterAssigned, SetParameterAssigned): Removed.
10977
10978 2003-05-18  Martin Baulig  <martin@ximian.com>
10979
10980         * typemanager.cs (InitCoreTypes): Try calling
10981         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10982         the 3-args-version.  Corlib now also needs our `void_type'.
10983         (GetMethod): Added overloaded version which takes an optional
10984         `bool report_errors' to allow lookups of optional methods.
10985
10986 2003-05-12  Martin Baulig  <martin@ximian.com>
10987
10988         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10989         only used for locals and not for parameters.
10990
10991 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * support.cs (InternalParameters.ParameterType): Return the
10994         ExternalType of the parameter.
10995
10996         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10997         they were unused.
10998
10999 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11000
11001         * class.cs (MethodData.Define): Do not set the `newslot' on
11002         interface members, if they are also flagged as "override".
11003
11004         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11005         better code for ++i and i++.  This only works for static fields
11006         and local variables.
11007
11008         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11009         want to pull the DeclSpace out of the builder_to_declspace instead
11010         of the TypeBuilder (like in TypeContainer.FindMembers).
11011
11012         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11013         instead of LookupTypeContainer.  Fixes the crash on .NET for
11014         looking up interface members.
11015
11016         * const.cs: Create our own emit context during the Definition
11017         stage, so that constants are evaluated in the proper context, when
11018         a recursive definition happens.
11019
11020 2003-05-11  Martin Baulig  <martin@ximian.com>
11021
11022         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11023         new block for a switch section.
11024         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11025         the adding/lookup in the switch block.  Fixes #39828.
11026
11027 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11028
11029         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11030         functionality: I needed to convert the data after I had performed
11031         the add/sub operation into the operands type size.
11032
11033         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11034         pass the type for the box operation, otherwise the resulting
11035         object would have been of type object.
11036
11037         (BoxedCast): Add constructor to specify the type to box as.
11038
11039 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11040
11041         * iterators.cs: I was reusing the `count' variable inadvertently,
11042         take steps to not allow this to happen.
11043
11044 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11047         by creating an array at the point where the params starts and
11048         putting all those arguments there, then adjusting the size of the
11049         array.
11050
11051 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * expression.cs (New.AddressOf): Implement interface
11054         IMemoryLocation.  This is used when the `new' operator is used in
11055         the context of an invocation to a method on a value type.
11056
11057         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11058         example. 
11059
11060         * namespace.cs: Also check the using aliases here.
11061
11062         * driver.cs: Move the test for using validity after the types have
11063         been entered, so we do a single pass that also includes the using
11064         aliases. 
11065
11066         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11067         in the regular case.   CreateSiblingForFinally is doing extra
11068         error checking.
11069
11070         * attribute.cs (GetAttributeArgumentExpression): Store the result
11071         on an out value, and use the return value to indicate failure
11072         instead of using null (which is a valid return for Constant.GetValue).
11073
11074         * statement.cs: Perform the analysis flow for the increment
11075         portion after the statement, because this will be the real flow of
11076         execution.  Fixes #42385
11077
11078         * codegen.cs (EmitContext.EmitArgument,
11079         EmitContext.EmitStoreArgument): New helper functions when the
11080         RemapToProxy flag is set.
11081
11082         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11083         function.
11084
11085         Add support for remapping parameters. 
11086
11087         * iterators.cs: Propagate parameter values;  Store parameter
11088         values in the proxy classes.
11089
11090 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11091
11092         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11093         need a proxy reference;  I do not know what I was thinking
11094
11095         * cs-parser.jay (constructor_initializer): catch another error,
11096         and display nice message.
11097
11098         (field_declaration): catch void field declaration
11099         to flag a better error. 
11100
11101         * class.cs (MemberBase.CheckBase): Report an error instead of a
11102         warning if a new protected member is declared in a struct. 
11103         (Field.Define): catch the error of readonly/volatile.
11104
11105         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11106
11107         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11108         volatile variable is taken
11109
11110 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11111
11112         * statement.cs (Fixed.Resolve): Report an error if we are not in
11113         an unsafe context.
11114
11115 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11116
11117         * typemanager.cs: reuse the code that handles type clashes for
11118         delegates and enumerations.
11119
11120         * class.cs (Report28): Always report.
11121
11122         * expression.cs (EncodeAsAttribute): Allow nulls here.
11123
11124 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11125
11126         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11127         the functionality for testing whether an expression is valid for
11128         an attribute here.  Also handle the case of arrays of elements
11129         being stored. 
11130
11131         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11132         encoding a linear array into an array of objects that are suitable
11133         to be passed to an CustomAttributeBuilder.
11134
11135         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11136
11137         * ecore.cs: (FieldExpr): Handle field remapping here.
11138
11139         * iteratators.cs: Pass the instance variable (if the method is an
11140         instance method) to the constructors, so we can access the field
11141         variables on the class.
11142
11143         TODO: Test this with structs.  I think the THIS variable on
11144         structs might have to be a pointer, and not a refenrece
11145
11146 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11147
11148         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11149         local variables to fields in a proxy class.
11150
11151         * iterators.cs (PopulateProxy): Rename our internal fields to
11152         <XXX>.  
11153         Create a <THIS> field if we are an instance method, so we can
11154         reference our parent container variables.
11155         (MapVariable): Called back from the EmitContext code to enter a
11156         new variable to field mapping into the proxy class (we just create
11157         a FieldBuilder).
11158
11159         * expression.cs
11160         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11161         for using the remapped locals to fields.
11162
11163         I placed the code here, because that gives the same semantics to
11164         local variables, and only changes the Emit code.
11165
11166         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11167         statements inside iterators.
11168         (VariableInfo): Add a FieldBuilder for the cases when we are
11169         remapping local variables to fields in a proxy class
11170
11171         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11172         current_block != null.
11173
11174         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11175         not cope with strings, as it has been moved to the
11176         TableSwitchEmit.  Fixed bug in switch generation.
11177
11178         * expression.cs (New.DoResolve): Provide more context for the user
11179         when reporting an error.
11180
11181         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11182         pointers. 
11183
11184         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11185         check the permissions for it.  Note than in a type-resolution
11186         context the check was already present in DeclSpace.ResolveType,
11187         but was missing from the MemberAccess.
11188
11189         (ArrayCreation.CheckIndices): warn if the user has
11190         more nested levels of expressions, but there are no more
11191         dimensions specified.  Avoids crash on bug 41906.
11192
11193 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11194
11195         * statement.cs (Block): replace Implicit bool, for a generic
11196         flags.   
11197         New flag: `Unchecked'.  This is used during the EmitMeta phase
11198         (which is out-of-line with the regular Resolve/Emit process for a
11199         statement, as this is done ahead of time, but still gets a chance
11200         to call constant resolve).
11201
11202         (Block.Flags): new enum for adding a new flag.
11203
11204         (Block.EmitMeta): track the state of unchecked.
11205
11206         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11207         to enable constant resolution to work there as well.
11208
11209 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11210
11211         * typemanager.cs (ienumerable_type): Also look up
11212         System.Collections.IEnumerable. 
11213
11214 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11215
11216         TODO: Test more than one conditional per method.
11217
11218         * class.cs (Indexer.Define): Report the location where the user is
11219         referencing the unsupported feature.
11220
11221         (MethodData): Overload the use of `conditionals' to
11222         minimize the creation of needless ArrayLists.   This saves roughly
11223         212kb on my machine.
11224
11225         (Method): Implement the new IIteratorContainer interface.
11226         (Method.SetYields): Implement the method by setting the ModFlags
11227         to contain METHOD_YIELDS.
11228
11229         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11230         which just got set to null.
11231
11232         * iterators.cs: New file.
11233
11234         (Yield, YieldBreak): New statements.
11235
11236         * statement.cs (Return.Resolve): Flag an error if we are used in
11237         an iterator method.
11238
11239         * codegen.cs (InIterator): New flag set if the code is being
11240         compiled in an iterator method.
11241
11242         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11243         internal modifier, and we just use it to avoid adding extra
11244         fields, as this is seldom used.  
11245
11246         * cs-parser.jay: Add yield_statement (yield and yield break).
11247
11248         * driver.cs: New flag -v2 to turn on version 2 features. 
11249
11250         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11251         hashtable when v2 is enabled.
11252
11253 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11254
11255         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11256         there is already a namespace defined with this name.
11257
11258         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11259         people upgraded their corlibs.
11260
11261         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11262         always use fully qualified types, no need to use the compiler
11263         front end.
11264
11265         (TypeManager.IsNamespace): Use binarysearch.
11266
11267         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11268         AddDelegate): I did not quite use the new IsValid API properly: I
11269         have to pass the short-name and the fullname.  I was passing only
11270         the basename instead of the fullname sometimes. 
11271
11272         (TypeContainer.DefineType): call NamespaceClash.
11273
11274         * interface.cs (Interface.DefineType): use NamespaceClash before
11275         defining the type.
11276
11277         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11278         defining the type.
11279
11280         * enum.cs: (Enum.DefineType): use NamespaceClash before
11281         defining the type.
11282
11283         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11284         speed increase.  First, use the negative_hits cache when we get a
11285         negative.  Second, add the type with its full original name
11286         instead of the new . and + encoded name (reflection uses + to
11287         separate type from a nested type).  Use LookupTypeReflection
11288         directly which bypasses the type->name hashtable (that we already
11289         know does not contain the type.
11290
11291         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11292         location/container type. 
11293
11294         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11295
11296 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11297
11298         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11299
11300         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11301         method is being referenced in the method group from a static
11302         context, and report error 120 if so.
11303
11304         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11305         Error118. 
11306
11307         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11308         is created, we create the A namespace).
11309
11310         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11311         Fixes #41591
11312
11313 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11314
11315         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11316         invocation to ModuleBuilder.GetType with the same values will
11317         return a new type instance, so we need to cache its return
11318         values. 
11319
11320         * expression.cs (Binary.ResolveOperator): Only allow the compare
11321         operators on enums if they are of the same type.
11322
11323         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11324         types of ValueType on their own case.  Before we were giving them
11325         the same treatment as objects.
11326
11327         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11328         fullname.  Short name is used to compare against container name.
11329         Fullname is used to check against defined namespace names.
11330
11331         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11332         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11333
11334         (Method.CheckBase): Call parent.
11335         (MemberBase.CheckBase): Check for protected members on sealed
11336         classes.
11337         (PropertyBase.CheckBase): Call parent.
11338         (Field.Define): Call parent.
11339
11340         * report.cs: Negative error codes are now mapped to 8000 - code,
11341         so that the display is render more nicely.
11342
11343         * typemanager.cs: Do not use try/catch, instead report a regular
11344         error. 
11345
11346         (GetPointerType, GetReferenceType): These methods provide
11347         mechanisms to obtain the T* and T& from a T.  We had the code
11348         previously scattered around the code base, and it also used
11349         TypeManager.LookupType that would go through plenty of caches.
11350         This one goes directly to the type source.
11351
11352         In some places we did the Type.GetType followed by
11353         ModuleBuilder.GetType, but not in others, so this unifies the
11354         processing as well.
11355
11356         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11357         statements now that we have namespace information.
11358
11359         * typemanager.cs (IsNamespace): New method, returns whether the
11360         string presented is a namespace or not.
11361
11362         (ComputeNamespaces): New public entry point, computes the list of
11363         available namespaces, using the GetNamespaces API call in Mono, or
11364         the slower version in MS.NET.   
11365
11366         Now before we start the semantic analysis phase, we have a
11367         complete list of namespaces including everything that the user has
11368         provided.
11369
11370         Deleted old code to cache namespaces in .nsc files.
11371
11372 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11373
11374         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11375         class/struct location definition Location for the implicit
11376         constructor location.
11377
11378         (Operator.Define): Use the location of the operator for the
11379         implicit Method definition.
11380
11381         (Constructor.Emit): use the constructor location for the implicit
11382         base initializer constructor.
11383
11384         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11385         and the Expression class now contains two new methods:
11386
11387         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11388         isolate type lookup from the rest of the resolution process.
11389
11390         Since we use Expressions to hold type definitions due to the way
11391         we parse the input we have historically overloaded Resolve to
11392         perform the Type lookups if a special flag is passed.  Now this is
11393         eliminated and two methods take their place. 
11394
11395         The differences in the two methods between xStep and xTerminal is
11396         that xStep is involved in our current lookup system that uses
11397         SimpleNames to compose a name, while xTerminal is used just to
11398         catch the case where the simplename lookup failed.
11399
11400 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11401
11402         * expression.cs (ResolveMemberAccess): Remove redundant code.
11403         TypeExpr expressions are always born fully resolved.
11404
11405         * interface.cs (PopulateMethod): Do not lookup the types twice.
11406         We were doing it once during SemanticAnalysis and once during
11407         PopulateMethod.
11408
11409         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11410         in local variable type definitions, were being returned as a
11411         SimpleName (we decomposed everything into a string), that is
11412         because primary_expression was being used instead of a type in the
11413         grammar (reduce/reduce conflicts).
11414
11415         The part that was wrong is that we converted the expression into a
11416         string (an oversimplification in one hand, compounded with primary
11417         expressions doing string concatenation).
11418
11419         So things like:
11420
11421         A.B.C [] x;
11422
11423         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11424         using clauses from working on this particular context.  And a type
11425         was being matched directly against "A.B.C[]".
11426
11427         We now use the correct approach, and allow for ComposedCast to be
11428         part of the unary expression.  So the "A.B.C []" become a composed
11429         cast of "A.B.C" (as a nested group of MemberAccess with a
11430         SimpleName at the end) plus the rank composition "[]". 
11431
11432         Also fixes 35567
11433
11434 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11435
11436         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11437         for the access level checking.
11438
11439         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11440         `TypeContainer container', because I kept getting confused when I
11441         was debugging this code.
11442
11443         * expression.cs (Indexers): Instead of tracking getters/setters,
11444         we now track them in parallel.  We create one arraylist less, but
11445         most importantly it is possible now for the LValue code to find a
11446         matching get for a set.
11447
11448         (IndexerAccess.DoResolveLValue): Update the code.
11449         GetIndexersForType has been modified already to extract all the
11450         indexers from a type.  The code assumed it did not.
11451
11452         Also make the code set the correct return type for the indexer.
11453         This was fixed a long time ago for properties, but was missing for
11454         indexers.  It used to be void_type.
11455
11456         (Binary.Emit): Test first for doubles instead of
11457         floats, as they are more common.
11458
11459         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11460         when dealing with floats and the <=, >= operators.  This fixes bug
11461         #39314 
11462
11463         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11464         to load the array value by emitting a load on the foreach variable
11465         type.  This was incorrect.  
11466
11467         We now emit the code to load an element using the the array
11468         variable type, and then we emit the conversion operator.
11469
11470         Fixed #40176
11471
11472 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11473
11474         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11475
11476 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11477
11478         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11479         test for protection before we test for signatures. 
11480
11481         (MethodSignature.ToString): implement.
11482
11483         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11484         to the case where we reduced into a LongConstant.
11485
11486         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11487         depend on whether the information is acurrate, because the
11488         Microsoft runtime will always claim that the array type is public,
11489         regardless of the real state.
11490
11491         If the type is a pointer, another problem happens: the type is
11492         reported as non-public in Microsoft.  
11493
11494         In both cases we have to call CheckAccessLevel recursively with
11495         the underlying type as the argument to be tested.
11496
11497 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11498
11499         * assign.cs (Assign.Emit): If we are dealing with a compound
11500         assignment expression, we should use the code path that stores the
11501         intermediate result in a temporary value.  This fixes #40903.
11502
11503         *expression.cs (Indirection.ToString): Provide ToString method for
11504         debugging. 
11505
11506 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11507
11508         * class.cs: Null out fields holding references to Block objects so
11509         they can be garbage collected.
11510
11511         * expression.cs (OverloadResolve): Remove unused local.
11512
11513 2003-04-07  Martin Baulig  <martin@ximian.com>
11514
11515         * codegen.cs (EmitContext.CurrentFile): New public field.
11516         (EmitContext.Mark): Use the CurrentFile to check whether the
11517         location is in the correct file.
11518         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11519
11520 2003-04-07  Martin Baulig  <martin@ximian.com>
11521
11522         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11523
11524         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11525         location.  [FIXME: The location argument which gets passed to this
11526         method is sometimes wrong!]
11527
11528 2003-04-07  Nick Drochak <ndrochak@gol.com>
11529
11530         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11531
11532 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11533
11534         * expression.cs (Indirection.EmitAssign): We were using the
11535         temporary, but returning immediately instead of continuing the
11536         EmitAssing flow.
11537
11538 2003-04-06  Martin Baulig  <martin@ximian.com>
11539
11540         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11541         if it's a nested child, but also deriving from the outer class.
11542         See test 190.cs.
11543
11544         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11545         nested child, but also deriving from the outer class.  See
11546         test-190.cs.
11547         (FilterWithClosure): We may access private members of the outer
11548         class if we're a nested child and deriving from the outer class.
11549         (RealMemberLookup): Only set `closure_private_ok' if the
11550         `original_bf' contained BindingFlags.NonPublic.
11551
11552 2003-04-05  Martin Baulig  <martin@ximian.com>
11553
11554         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11555         probe if its a type parameter, and if so, flag an error.
11556
11557         * decl.cs: Move here the SetParameterInfo code from class.cs.
11558         Handle IsGeneric here.
11559
11560         Handle a variety of errors in the parameter info definition.
11561
11562         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11563         type parameters here.
11564
11565         * cs-parser.jay (class_declaration): report errors for parameters
11566         here as well.
11567
11568 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11569
11570         * generic.cs: New file, contains support code for generics.
11571
11572         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11573         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11574
11575         Update parser for the above removals.
11576
11577         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11578         now taken care of in the parser.
11579
11580 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11581
11582         * class.cs (Event.Define): Do not allow abstract events to have
11583         initializers. 
11584
11585 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11586
11587         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11588         block in event declarations.
11589
11590         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11591         value type, get its address.
11592
11593         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11594         leaving a class on the stack instead of a boolean value (int
11595         0/1).  Change the code so we compare against null, and then the
11596         result against zero.
11597
11598         * class.cs (TypeContainer.GetClassBases): We were checking for the
11599         parent class being sealed too late.
11600
11601         * expression.cs (Binary.Emit): For <= and >= when dealing with
11602         floating point values, use cgt.un and clt.un instead of cgt and
11603         clt alone.
11604
11605 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11606
11607         * statement.cs: Apply the same optimization as MS: skip the 
11608         GetEnumerator returning an IEnumerator, and use the one returning a 
11609         CharEnumerator instead. This allows us to avoid the try-finally block 
11610         and the boxing.
11611
11612 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11613
11614         * cs-parser.jay: Attributes cannot be applied to
11615                          namespaces. Fixes #40473
11616
11617 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11618
11619         * class.cs:
11620         (Add*): check if the name is valid using the full name for constants,
11621         fields, properties and events.
11622
11623 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11624
11625         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11626         char constants to be part of the enumeration.
11627
11628         * expression.cs (Conditional.DoResolve): Add support for operator
11629         true. Implements the missing functionality from 14.12
11630
11631         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11632         operator true/false as required by the spec.
11633
11634         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11635         implicit conversion to boolean.
11636
11637         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11638         also one where the type implements `operator true'. 
11639
11640         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11641         get an expression that will invoke operator true based on an
11642         expression.  
11643
11644         (GetConversionOperators): Removed the hack that called op_True
11645         here.  
11646
11647         (Expression.ResolveBoolean): Move this from Statement.
11648
11649 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11650
11651         * ecore.cs (FieldExpr): do not allow initialization of initonly
11652         fields on derived classes
11653
11654 2003-03-13  Martin Baulig  <martin@ximian.com>
11655
11656         * statement.cs (Block.Emit): Call ig.BeginScope() and
11657         ig.EndScope() when compiling with debugging info; call
11658         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11659
11660 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * expression.cs (Indexers): Do not construct immediately, allow
11663         for new members to be appended as we go.  Fixes 38143
11664
11665 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11666
11667         * expression.cs: save/restore context when resolving an unchecked
11668         expression.
11669
11670 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11671
11672         * cfold.cs: Catch division by zero in modulus operator during
11673         constant folding.
11674
11675 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11676
11677         * interface.cs (Interface.DefineMembers): Avoid defining members
11678         twice. 
11679
11680 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11681
11682         * driver.cs: handle the +/- options for -noconfig
11683
11684         * statement.cs (Unckeched.Resolve): Also track the state of
11685         unchecked in the Resolve phase.
11686
11687 2003-02-27  Martin Baulig  <martin@ximian.com>
11688
11689         * ecore.cs (Expression.MemberLookup): Don't create a
11690         MethodGroupExpr for something which is not a method.  Fixes #38291.
11691
11692 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11693
11694         * class.cs (MemberBase.CheckParameters): Also check that the type
11695         is unmanaged if it is a pointer.
11696
11697         * expression.cs (SizeOf.Resolve): Add location information.
11698
11699         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11700         a managed type is declared.
11701
11702         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11703         parameter modifiers as well.  Fixes bug 38606
11704
11705         * class.cs: Very sad.  Am backing out the speed up changes
11706         introduced by the ArrayList -> Array in the TypeContainer, as they
11707         were not actually that much faster, and introduced a bug (no error
11708         reports on duplicated methods).
11709
11710         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11711         source first, this will guarantee that we have a valid expression
11712         before calling in lower levels functions that will require a
11713         resolved object.  Then use this original_source in the
11714         target.ResolveLValue instead of the original source that was
11715         passed to us.
11716
11717         Another change.  Use target.Resolve instead of LValueResolve.
11718         Although we are resolving for LValues, we will let the Assign code
11719         take care of that (it will be called again from Resolve).  This
11720         basically allows code like this:
11721
11722         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11723         class Y { void A (X x) { x [0] += o; }
11724
11725         The problem was that the indexer was trying to resolve for
11726         set_Item (idx, object o) and never finding one.  The real set_Item
11727         was set_Item (idx, X).  By delaying the process we get the right
11728         semantics. 
11729
11730         Fixes bug 36505
11731
11732 2003-02-23  Martin Baulig  <martin@ximian.com>
11733
11734         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11735         while calling DoEmit ().
11736
11737         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11738         source files; if you use the #line directive inside a method, the
11739         compiler stops emitting line numbers for the debugger until it
11740         reaches the end of the method or another #line directive which
11741         restores the original file.
11742
11743 2003-02-23  Martin Baulig  <martin@ximian.com>
11744
11745         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11746
11747 2003-02-23  Martin Baulig  <martin@ximian.com>
11748
11749         * statement.cs (Block.AddChildVariableNames): We need to call this
11750         recursively, not just for our immediate children.
11751
11752 2003-02-23  Martin Baulig  <martin@ximian.com>
11753
11754         * class.cs (Event.Define): Always make the field private, like csc does.
11755
11756         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11757         actually work, fixes bug #37521.
11758
11759 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11760
11761         * delegate.cs: When creating the various temporary "Parameters"
11762         classes, make sure that we call the ComputeAndDefineParameterTypes
11763         on those new parameters (just like we do with the formal ones), to
11764         allow them to be resolved in the context of the DeclSpace.
11765
11766         This fixes the bug that Dick observed in Bugzilla #38530.
11767
11768 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11769
11770         * expression.cs (ResolveMemberAccess): When resolving a constant,
11771         do not attempt to pull a constant if the value was not able to
11772         generate a valid constant.
11773
11774         * const.cs (LookupConstantValue): Do not report more errors than required.
11775
11776 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11777
11778         * expression.cs: fixes bug #38328.
11779
11780 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11781
11782         * class.cs: Changed all the various members that can be part of a
11783         class from being an ArrayList to be an Array of the right type.
11784         During the DefineType type_list, interface_list, delegate_list and
11785         enum_list are turned into types, interfaces, delegates and enums
11786         arrays.  
11787
11788         And during the member population, indexer_list, event_list,
11789         constant_list, field_list, instance_constructor_list, method_list,
11790         operator_list and property_list are turned into their real arrays.
11791
11792         Although we could probably perform this operation earlier, for
11793         good error reporting we need to keep the lists and remove the
11794         lists for longer than required.
11795
11796         This optimization was triggered by Paolo profiling the compiler
11797         speed on the output of `gen-sample-program.pl' perl script. 
11798
11799         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11800         not crash in methods like MemberLookupFailed that use this field.  
11801
11802         This problem arises when the compiler fails to resolve a type
11803         during interface type definition for example.
11804
11805 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11806
11807         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11808         inherit from System.Object, so we have to stop at null, not only
11809         when reaching System.Object.
11810
11811 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11814         DeclaredOnly because the parent indexer might have had a different
11815         name, but did not loop until the top of the hierarchy was reached.
11816
11817         The problem this one fixes is 35492: when a class implemented an
11818         indexer from an interface, we were getting the interface method
11819         (which was abstract) and we were flagging an error (can not invoke
11820         abstract method).
11821
11822         This also keeps bug 33089 functioning, and test-148 functioning.
11823
11824         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11825         out if a method is special is to see if it is declared in a
11826         property or event, or whether it is one of the predefined operator
11827         names.   This should fix correctly #36804.
11828
11829 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11830
11831         The goal here is to remove the dependency on EmptyCast.Peel ().
11832         Killing it completely.
11833
11834         The problem is that currently in a number of places where
11835         constants are expected, we have to "probe" for an EmptyCast, and
11836         Peel, which is not the correct thing to do, as this will be
11837         repetitive and will likely lead to errors. 
11838
11839         The idea is to remove any EmptyCasts that are used in casts that
11840         can be reduced to constants, so we only have to cope with
11841         constants. 
11842
11843         This bug hunt was triggered by Bug 37363 and the desire to remove
11844         the duplicate pattern where we were "peeling" emptycasts to check
11845         whether they were constants.  Now constants will always be
11846         constants.
11847
11848         * ecore.cs: Use an enumconstant here instead of wrapping with
11849         EmptyCast.  
11850
11851         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11852         throwing me off.  By handling this we can get rid of a few hacks.
11853
11854         * statement.cs (Switch): Removed Peel() code.
11855
11856 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11857
11858         * class.cs: Location information for error 508
11859
11860         * expression.cs (New.DoResolve): Add a guard against double
11861         resolution of an expression.  
11862
11863         The New DoResolve might be called twice when initializing field
11864         expressions (see EmitFieldInitializers, the call to
11865         GetInitializerExpression will perform a resolve on the expression,
11866         and later the assign will trigger another resolution
11867
11868         This leads to bugs (#37014)
11869
11870         * delegate.cs: The signature for EndInvoke should contain any ref
11871         or out parameters as well.  We were not doing this in the past. 
11872
11873         * class.cs (Field.Define): Do not overwrite the type definition
11874         inside the `volatile' group.  Turns out that volatile enumerations
11875         were changing the type here to perform a validity test, which
11876         broke conversions. 
11877
11878 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11879
11880         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11881         and structs, we do not want to load the instance variable
11882
11883         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11884         enum_type has to be handled like an object reference (implicit
11885         conversions exists from this to object), but the regular IsClass
11886         and IsValueType tests will never return true for this one.
11887
11888         Also we use TypeManager.IsValueType instead of type.IsValueType,
11889         just for consistency with the rest of the code (this is only
11890         needed if we ever use the construct exposed by test-180.cs inside
11891         corlib, which we dont today).
11892
11893 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11894
11895         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11896         just InternalCall.
11897
11898 2003-02-09  Martin Baulig  <martin@ximian.com>
11899
11900         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11901         (Namespace.DefineNamespaces): New static public method; this is
11902         called when we're compiling with debugging to add all namespaces
11903         to the symbol file.
11904
11905         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11906         pass it to the Namespace's .ctor.
11907
11908         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11909         and MethodBase arguments; pass the namespace ID to the symwriter;
11910         pass the MethodBase instead of the token to the symwriter.
11911         (SymbolWriter.DefineNamespace): New method to add a namespace to
11912         the symbol file.
11913
11914 2003-02-09  Martin Baulig  <martin@ximian.com>
11915
11916         * symbolwriter.cs: New file.  This is a wrapper around
11917         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11918         methods here in near future.
11919
11920 2003-02-09  Martin Baulig  <martin@ximian.com>
11921
11922         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11923         ILGenerator.MarkSequencePoint() which are actually used by the
11924         symbol writer.
11925
11926 2003-02-09  Martin Baulig  <martin@ximian.com>
11927
11928         * location.cs (SourceFile): New public sealed class.  This
11929         contains the name and an index which is used in the location's token.
11930         (Location): Reserve an appropriate number of bits in the token for
11931         the source file instead of walking over that list, this gives us a
11932         really huge performance improvement when compiling with debugging.
11933
11934         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11935         `SourceFile' argument instead of a string.
11936         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11937         but don't parse/tokenize here, we need to generate the list of all
11938         source files before we do that.
11939         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11940         the files.
11941
11942         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11943         instead of a string.
11944
11945         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11946         of a string.
11947
11948 2003-02-09  Martin Baulig  <martin@ximian.com>
11949
11950         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11951         filename on `#line default'.
11952
11953 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11954
11955         * statement.cs: don't clear the pinned var when the fixed statement
11956         returns from the method (fixes bug#37752).
11957
11958 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11959
11960         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11961         to IsValueType.
11962
11963 2003-02-07  Martin Baulig  <martin@ximian.com>
11964
11965         * driver.cs: Removed the `--debug-args' command line argument.
11966
11967         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11968         automatically by the AsssemblyBuilder.
11969         (CodeGen.InitializeSymbolWriter): We don't need to call any
11970         initialization function on the symbol writer anymore.  This method
11971         doesn't take any arguments.
11972
11973 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11974
11975         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11976         from referenced assemblies as well.
11977
11978 2003-02-02  Martin Baulig  <martin@ximian.com>
11979
11980         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11981
11982 2003-02-02  Martin Baulig  <martin@ximian.com>
11983
11984         * class.cs (Constructor.Emit): Open the symbol writer before
11985         emitting the constructor initializer.
11986         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11987         single-stepping through constructor initializers.
11988
11989 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11990
11991         * class.cs: Handle error 549: do not allow virtual methods in
11992         sealed classes. 
11993
11994 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11995
11996         * decl.cs: Check access levels when resolving types
11997
11998 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11999
12000         * statement.cs: Add parameters and locals set in catch blocks that might 
12001         return to set vector
12002
12003 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12004
12005         * class.cs (Operator): Set the SpecialName flags for operators.
12006
12007         * expression.cs (Invocation.DoResolve): Only block calls to
12008         accessors and operators on SpecialName methods.
12009
12010         (Cast.TryReduce): Handle conversions from char constants.
12011
12012
12013 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12014
12015         * statement.cs: small memory and time optimization in FlowBranching.
12016
12017 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12018
12019         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12020         problem that the last fix but in the other sid (Set).
12021
12022         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12023         access when there is no indexer in the hierarchy.
12024
12025 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12026
12027         * class.cs: Combine some if statements.
12028
12029 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12030
12031         * driver.cs: fixed bug #37187.
12032
12033 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12034
12035         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12036         any indexer, it's needed to build a list with all the indexers in the
12037         hierarchy (AllGetters), else we have problems. Fixes #35653.
12038
12039 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12040
12041         * class.cs (MethodData.Define): It is wrong for an interface
12042         implementation to be static in both cases: explicit and implicit.
12043         We were only handling this in one case.
12044
12045         Improve the if situation there to not have negations.
12046
12047         * class.cs (Field.Define): Turns out that we do not need to check
12048         the unsafe bit on field definition, only on usage.  Remove the test.
12049
12050 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12051
12052         * driver.cs: use assembly.Location instead of Codebase (the latest
12053         patch made mcs fail when using MS assemblies).
12054
12055 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12056
12057         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12058         get the path to *corlib.dll.
12059
12060 2003-01-21  Nick Drochak <ndrochak@gol.com>
12061
12062         * cs-tokenizer.cs:
12063         * pending.cs:
12064         * typemanager.cs: Remove compiler warnings
12065
12066 2003-01-20  Duncan Mak  <duncan@ximian.com>
12067
12068         * AssemblyInfo.cs: Bump the version number to 0.19.
12069
12070 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12071
12072         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12073
12074 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12075
12076         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12077
12078 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12079
12080         * cs-parser.jay: Small fix: we were not comparing the constructor
12081         name correctly.   Thanks to Zoltan for the initial pointer.
12082
12083 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12084
12085         * cs-tokenizer.cs: Set file name when specified with #line
12086
12087 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12088
12089         * cs-parser.jay: Only perform the constructor checks here if we
12090         are named like the class;  This will help provider a better
12091         error.  The constructor path is taken when a type definition is
12092         not found, but most likely the user forgot to add the type, so
12093         report that rather than the constructor error.
12094
12095 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12096
12097         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12098         allocations.
12099
12100 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12101
12102         * cs-parser.jay: Add cleanup call.
12103
12104 2003-01-13  Duncan Mak  <duncan@ximian.com>
12105
12106         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12107         consistent with other methods.
12108
12109 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12110
12111         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12112
12113 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12114
12115         * attribute.cs: only set GuidAttr to true when we have a
12116         GuidAttribute.
12117
12118 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12119
12120         * ecore.cs:
12121         * expression.cs:
12122         * typemanager.cs: fixes to allow mcs compile corlib with the new
12123         Type.IsSubclassOf fix.
12124
12125 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12126
12127         * expression.cs (LocalVariableReference.DoResolve): Classify a
12128         constant as a value, not as a variable.   Also, set the type for
12129         the variable.
12130
12131         * cs-parser.jay (fixed_statement): take a type instead of a
12132         pointer_type, so we can produce a better error message later.
12133
12134         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12135         as an error.  
12136
12137         (For.DoEmit): Make inifinite loops have a
12138         non-conditional branch back.
12139
12140         (Fixed.DoEmit): First populate the pinned variables, then emit the
12141         statement, then clear the variables.  Before I was emitting the
12142         code once for each fixed piece.
12143
12144
12145 2003-01-08  Martin Baulig  <martin@ximian.com>
12146
12147         * statement.cs (FlowBranching.MergeChild): A break in a
12148         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12149
12150 2003-01-08  Martin Baulig  <martin@ximian.com>
12151
12152         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12153         lives in the same number space than `param_map'.  Fixes #36154.
12154
12155 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * cs-parser.jay (constructor_declaration): Set the
12158         Constructor.ModFlags before probing for it.  This makes the
12159         compiler report 514, 515 and 132 (the code was there, but got
12160         broken). 
12161
12162         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12163         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12164         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12165
12166 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12167
12168         * enum.cs: create the enum static fields using the enum type.
12169
12170 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12171
12172         * class.cs: don't try to create the ParamBuilder for the return
12173         type if it's not needed (and handle it breaking for the ms runtime
12174         anyway).
12175
12176 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12177
12178         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12179
12180 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12181
12182         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12183         the command.   This showed up while compiling the JANET source
12184         code, which used \r as its only newline separator.
12185
12186 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12187
12188         * class.cs (Method.Define): If we are an operator (because it
12189         reuses our code), then set the SpecialName and HideBySig.  #36128
12190
12191 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12192
12193         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12194         exception, report error 120 `object reference required'.
12195
12196         * driver.cs: Add --pause option, used during to measure the size
12197         of the process as it goes with --timestamp.
12198
12199         * expression.cs (Invocation.DoResolve): Do not allow methods with
12200         SpecialName to be invoked.
12201
12202 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12205         number before adding it.
12206
12207 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12208
12209         * ecore.cs (StandardImplicitConversion): When in an unsafe
12210         context, we allow conversion between void * to any other pointer
12211         type. This fixes bug #35973.
12212
12213 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12214
12215         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12216         is not thrown when extensionless outputs are used 
12217
12218 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12219
12220         * rootcontext.cs: fixed compilation of corlib.
12221
12222 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12223
12224         * attribute.cs (Attributes.Contains): Add new method.
12225
12226         * class.cs (MethodCore.LabelParameters): if the parameter is an
12227         `out' parameter, check that no attribute `[In]' has been passed.
12228
12229         * enum.cs: Handle the `value__' name in an enumeration.
12230
12231 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12232
12233         * decl.cs: Added special case to allow overrides on "protected
12234         internal" methods
12235
12236 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12237
12238         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12239         since it makes much more sense.
12240
12241         (Attributes.ctor): Don't require a Location parameter.
12242
12243         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12244
12245         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12246         since we already have that information per attribute.
12247
12248         * everywhere : make appropriate changes.
12249
12250         * class.cs (LabelParameters): Write the code which actually
12251         applies attributes to the return type. We can't do this on the MS
12252         .NET runtime so we flag a warning in the case an exception is
12253         thrown.
12254
12255 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12256
12257         * const.cs: Handle implicit null conversions here too.
12258
12259 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12260
12261         * class.cs (MethodCore.LabelParameters): Remove the extra
12262         Type [] parameter since it is completely unnecessary. Instead
12263         pass in the method's attributes so that we can extract
12264         the "return" attribute.
12265
12266 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12267
12268         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12269         of ignoring it and letting the compile continue.
12270
12271         * typemanager.cs (ChangeType): use an extra argument to return an
12272         error condition instead of throwing an exception.
12273
12274 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12275
12276         * expression.cs (Unary.TryReduce): mimic the code for the regular
12277         code path.  Perform an implicit cast in the cases where we can
12278         implicitly convert to one of the integral types, and then reduce
12279         based on that constant.   This fixes bug #35483.
12280
12281 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12282
12283         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12284
12285 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12286
12287         * namespace.cs: fixed bug #35489.
12288
12289 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12290
12291         * class.cs: Remove some dead code.
12292
12293         * cs-parser.jay: Estimate the number of methods needed
12294         (RootContext.MethodCount);
12295
12296         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12297         numbers instead of StringBuilders.
12298
12299         * support.cs (PtrHashtable): Add constructor with initial size;
12300         We can now reduce reallocations of the method table.
12301
12302 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12303
12304         * attribute.cs (ApplyAttributes): Keep track of the emitted
12305         attributes on a per-target basis. This fixes bug #35413.
12306
12307 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12308
12309         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12310         default to the Windows 1252 encoding.
12311
12312         (UnixParseOption): Support version, thanks to Alp for the missing
12313         pointer. 
12314
12315         * AssemblyInfo.cs: Add nice assembly information.
12316
12317         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12318         (bug 35169).
12319
12320         * cs-parser.jay: Allow a trailing comma before the close bracked
12321         in the attribute_section production.
12322
12323         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12324         address of the instance was being taken, I will take this out,
12325         because we take the address of the object immediately here.
12326
12327 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12328
12329         * typemanager.cs (AreMultipleAllowed): Take care of the most
12330         obvious case where attribute type is not in the current assembly -
12331         stupid me ;-)
12332
12333 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12334
12335         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12336         definitions, instead of doing that afterwards.  
12337
12338         Also we use a nice little hack, depending on the constructor, we
12339         know if we are a "composed" name or a simple name.  Hence, we
12340         avoid the IndexOf test, and we avoid 
12341
12342         * codegen.cs: Add code to assist in a bug reporter to track down
12343         the source of a compiler crash. 
12344
12345 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12346
12347         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12348         types have been emitted for a given element and flag an error
12349         if something which does not have AllowMultiple set is used more
12350         than once.
12351
12352         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12353         attribute types and their corresponding AllowMultiple properties
12354
12355         (AreMultipleAllowed): Check the property for a given type.
12356
12357         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12358         property in the case we have a TypeContainer.
12359
12360         (Attributes.AddAttribute): Detect duplicates and just skip on
12361         adding them. This trivial fix catches a pretty gross error in our
12362         attribute emission - global attributes were being emitted twice!
12363
12364         Bugzilla bug #33187 is now fixed.
12365
12366 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12369         instead of pp_and).
12370
12371         * expression.cs (Binary.ResolveOperator): I can only use the
12372         Concat (string, string, string) and Concat (string, string,
12373         string, string) if the child is actually a concatenation of
12374         strings. 
12375
12376 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12377
12378         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12379         context where we need a 2-character lookahead.
12380
12381         * pending.cs (PendingImplementation): Rework so we can keep track
12382         of interface types all the time, and flag those which were
12383         implemented by parents as optional.
12384
12385 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12386
12387         * expression.cs (Binary.ResolveOperator): Use
12388         String.Concat(string,string,string) or
12389         String.Concat(string,string,string,string) when possible. 
12390
12391         * typemanager: More helper methods.
12392
12393
12394 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12395
12396         * pending.cs: remove the bogus return from GetMissingInterfaces()
12397         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12398
12399 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12400
12401         * namespace.cs: avoid duplicated 'using xxx' being added to
12402         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12403         when we get more than one 'using' statement for the same namespace.
12404         Report a CS0105 warning for it.
12405
12406 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12407
12408         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12409         of calling getChar/putback, uses internal knowledge of it.    
12410
12411         (xtoken): Reorder tokenizer so most common patterns are checked
12412         first.  This reduces the compilation time in another 5% (from 8.11s
12413         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12414
12415         The parsing time is 22% of the compilation in mcs, and from that
12416         64% is spent on the tokenization process.  
12417
12418         I tried using a binary search for keywords, but this is slower
12419         than the hashtable.  Another option would be to do a couple of
12420         things:
12421
12422                 * Not use a StringBuilder, instead use an array of chars,
12423                   with a set value.  Notice that this way we could catch
12424                   the 645 error without having to do it *afterwards*.
12425
12426                 * We could write a hand-parser to avoid the hashtable
12427                   compares altogether.
12428
12429         The identifier consumption process takes 37% of the tokenization
12430         time.  Another 15% is spent on is_number.  56% of the time spent
12431         on is_number is spent on Int64.Parse:
12432
12433                 * We could probably choose based on the string length to
12434                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12435                   computations. 
12436
12437         Another 3% is spend on wrapping `xtoken' in the `token' function.
12438
12439         Handle 0xa0 as whitespace (#34752)
12440
12441 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12442
12443         * typemanager.cs (IsCLRType): New routine to tell whether a type
12444         is one of the builtin types.  
12445
12446         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12447         typecode in more places instead of doing pointer comparissions.
12448         We could leverage some knowledge about the way the typecodes are
12449         laid out.
12450
12451         New code to cache namespaces in assemblies, it is currently not
12452         invoked, to be used soon.
12453
12454         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12455
12456         * expression.cs (Binary.ResolveOperator): specially handle
12457         strings, and do not perform user-defined operator overloading for
12458         built-in types.
12459
12460 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12461
12462         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12463         internalcall as it is a pretty simple operation;  Avoid whenever
12464         possible to call Char.IsLetter.
12465
12466         (consume_identifier): Cut by half the number of
12467         hashtable calls by merging the is_keyword and GetKeyword behavior.
12468
12469         Do not short-circuit, because if we do, we
12470         report errors (ie, #if false && true would produce an invalid
12471         directive error);
12472
12473
12474 2002-11-24  Martin Baulig  <martin@ximian.com>
12475
12476         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12477         check constant ranges and report a CS0221.  Fixes #33186.
12478
12479 2002-11-24  Martin Baulig  <martin@ximian.com>
12480
12481         * cs-parser.jay: Make this work for uninitialized variable
12482         declarations in the `for' initializer.  Fixes #32416.
12483
12484 2002-11-24  Martin Baulig  <martin@ximian.com>
12485
12486         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12487         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12488
12489 2002-11-24  Martin Baulig  <martin@ximian.com>
12490
12491         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12492         argument; if true, we also check for user-defined conversions.
12493         This is only needed if both arguments are of a user-defined type.
12494         Fixes #30443, added test-175.cs.
12495         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12496
12497         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12498
12499 2002-11-24  Martin Baulig  <martin@ximian.com>
12500
12501         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12502         function to get the store opcode.
12503         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12504         only emit the Ldelema if the store opcode is Stobj.  You must run
12505         both test-34 and test-167 to test this.  Fixes #34529.
12506
12507 2002-11-23  Martin Baulig  <martin@ximian.com>
12508
12509         * ecore.cs (Expression.MemberLookup): Added additional
12510         `qualifier_type' argument which is used when we're being called
12511         from MemberAccess.DoResolve() and null if we're called from a
12512         SimpleName lookup.
12513         (Expression.MemberLookupFailed): New method to report errors; this
12514         does the CS1540 check and reports the correct error message.
12515
12516         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12517         argument for the CS1540 check and redone the way how we're dealing
12518         with private members.  See the comment in the source code for details.
12519         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12520         `closure_start_type' to `closure_qualifier_type' and check whether
12521         it's not null.  It was not this filter being broken, it was just
12522         being called with the wrong arguments.
12523
12524         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12525         and pass it the correct `qualifier_type'; this also does the error
12526         handling for us.
12527
12528 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * expression.cs (Invocation.EmitParams): If the we are dealing
12531         with a non-built-in value type, load its address as well.
12532
12533         (ArrayCreation): Use a a pretty constant instead
12534         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12535         static initializers.  
12536
12537         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12538         because they are not really value types, just glorified integers. 
12539
12540         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12541
12542         * ecore.cs: Remove redundant code for enumerations, make them use
12543         the same code path as everything else, fixes the casting issue
12544         with enumerations in Windows.Forms.
12545
12546         * attribute.cs: Do only cast to string if it is a string, the
12547         validation happens later.
12548
12549         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12550         people upgrade their corlibs.
12551
12552         * ecore.cs: Oops, enumerations were not following the entire code path
12553
12554 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12555
12556         * typemanager.cs (FilterWithClosure): Commented out the test for
12557         1540 in typemanager.cs, as it has problems when accessing
12558         protected methods from a parent class (see test-174.cs). 
12559
12560         * attribute.cs (Attribute.ValidateGuid): new method.
12561         (Attribute.Resolve): Use above.
12562
12563 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12564
12565         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12566
12567         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12568         handling for enumerations, as we only needed the TypeContainer
12569         functionality to begin with (this is required for the fix below to
12570         work for enums that reference constants in a container class for
12571         example). 
12572
12573         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12574
12575         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12576         a valid TypeBuilder to perform lookups on.o
12577
12578         * class.cs (InheritableMemberSignatureCompare): Use true in the
12579         call to GetGetMethod and GetSetMethod, because we are comparing
12580         the signature, and we need to get the methods *even* if they are
12581         private. 
12582
12583         (PropertyBase.CheckBase): ditto.
12584
12585         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12586         GotoCase.Resolve): Use Peel on EmpytCasts.
12587
12588         * ecore.cs (EmptyCast): drop child, add Peel method.
12589
12590 2002-11-17  Martin Baulig  <martin@ximian.com>
12591
12592         * ecore.cs (EmptyCast.Child): New public property.
12593
12594         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12595         label resolved to an EmptyCast.  Fixes #34162.
12596         (GotoCase.Resolve): Likewise.
12597         (Block.EmitMeta): Likewise.
12598
12599 2002-11-17  Martin Baulig  <martin@ximian.com>
12600
12601         * expression.cs (Invocation.BetterConversion): Prefer int over
12602         uint; short over ushort; long over ulong for integer literals.
12603         Use ImplicitConversionExists instead of StandardConversionExists
12604         since we also need to check for user-defined implicit conversions.
12605         Fixes #34165.  Added test-173.cs.
12606
12607 2002-11-16  Martin Baulig  <martin@ximian.com>
12608
12609         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12610         with the `true' and `false' literals.  Fixes #33151.
12611
12612 2002-11-16  Martin Baulig  <martin@ximian.com>
12613
12614         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12615         October 22nd; don't do the cs1540 check for static members.
12616
12617         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12618         now using our own filter here and doing the cs1540 check again.
12619
12620 2002-11-16  Martin Baulig  <martin@ximian.com>
12621
12622         * support.cs (InternalParameters): Don't crash if we don't have
12623         any fixed parameters.  Fixes #33532.
12624
12625 2002-11-16  Martin Baulig  <martin@ximian.com>
12626
12627         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12628         when looking up static methods to make this work on Windows.
12629         Fixes #33773.
12630
12631 2002-11-16  Martin Baulig  <martin@ximian.com>
12632
12633         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12634         a setter rather than using PropertyInfo.CanWrite.
12635
12636 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12637
12638         * class.cs: Allow acces to block member by subclasses. Fixes build
12639         breaker.
12640
12641 2002-11-14  Martin Baulig  <martin@ximian.com>
12642
12643         * class.cs (Constructor.Emit): Added the extern/block check.
12644         Fixes bug #33678.
12645
12646 2002-11-14  Martin Baulig  <martin@ximian.com>
12647
12648         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12649         iteration while looking for indexers, this is needed because the
12650         indexer may have a different name in our base classes.  Fixed the
12651         error reporting (no indexers at all, not get accessor, no
12652         overloaded match).  Fixes bug #33089.
12653         (IndexerAccess.DoResolveLValue): Likewise.
12654
12655 2002-11-14  Martin Baulig  <martin@ximian.com>
12656
12657         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12658         indexers.  Fixes the first part of bug #33089.
12659         (MethodSignature.InheritableMemberSignatureCompare): Added support
12660         for properties.
12661
12662 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12663
12664         * attribute.cs (Attribute.Resolve): Catch the
12665         NullReferenceException and report it since it isn't supposed to
12666         happen. 
12667
12668 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12671         LogicalOr and LogicalAnd that can benefit from recursively
12672         handling EmitBranchable.  The code now should be nice for Paolo.
12673
12674 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12677         the Type lookups, as we perform quite a number of lookups on
12678         non-Types.  This can be removed once we can deterministically tell
12679         whether we have a type or a namespace in advance.
12680
12681         But this might require special hacks from our corlib.
12682
12683         * TODO: updated.
12684
12685         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12686         and double which avoids a conversion from an integer to a double.
12687
12688         * expression.cs: tiny optimization, avoid calling IsConstant,
12689         because it effectively performs the lookup twice.
12690
12691 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12692
12693         But a bogus return here to keep the semantics of the old code
12694         until the Mono runtime is fixed.
12695
12696         * pending.cs (GetMissingInterfaces): New method used to remove all
12697         the interfaces that are already implemented by our parent
12698         classes from the list of pending methods. 
12699
12700         * interface.cs: Add checks for calls after ResolveTypeExpr.
12701
12702 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12703
12704         * class.cs (Class.Emit): Report warning 67: event not used if the
12705         warning level is beyond 3.
12706
12707         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12708         being a NullLiteral.
12709
12710         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12711         specifiers. 
12712
12713         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12714         path that might fail if a type can not be resolved.
12715
12716         * expression.cs (Binary.Emit): Emit unsigned versions of the
12717         operators. 
12718
12719         * driver.cs: use error 5.
12720
12721 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12722
12723         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12724
12725 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12726
12727         * cs-parser.jay (switch_section): A beautiful patch from Martin
12728         Baulig that fixed 33094.
12729
12730 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12731
12732         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12733         Check whether the base is abstract and report an error if so.
12734
12735         * expression.cs (IndexerAccess.DoResolveLValue,
12736         IndexerAccess.DoResolve): ditto. 
12737
12738         (Invocation.DoResolve): ditto.
12739
12740         (Invocation.FullMethodDesc): Improve the report string.
12741
12742         * statement.cs (Block): Eliminate IsVariableDefined as it is
12743         basically just a wrapper for GetVariableInfo.
12744
12745         * ecore.cs (SimpleName): Use new 
12746
12747         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12748         type, as we return the actual parameter ref/unref state on a
12749         different call.
12750
12751 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12752
12753         * support.cs: Return proper flags REF/OUT fixing the previous
12754         commit.  
12755
12756         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12757         not used to mean `ref' but `ref or out' in ParameterReference
12758
12759         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12760         full type signature instead of calling TypeManger.CSharpName
12761         ourselves. 
12762
12763         * support.cs (InternalParameters.ParameterDesc): Do not compare
12764         directly to the modflags, because REF/OUT will actually be bitsets
12765         if set. 
12766
12767         * delegate.cs (VerifyMethod): Check also the modifiers.
12768
12769         * cs-tokenizer.cs: Fix bug where floating point values with an
12770         exponent where a sign was missing was ignored.
12771
12772         * driver.cs: Allow multiple assemblies to be specified in a single
12773         /r: argument
12774
12775 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12776
12777         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12778         because identifiers after a parenthesis would end up in this kind
12779         of production, and we needed to desamiguate it for having casts
12780         like:
12781
12782                 (UserDefinedType *) xxx
12783
12784 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12785
12786         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12787         we should set on the Bindingflags.NonPublic, but not turn on
12788         private_ok.  private_ok controls whether a Private member is
12789         returned (this is chekced on the filter routine), while the
12790         BindingFlags.NonPublic just controls whether private/protected
12791         will be allowed.   This fixes the problem part of the problem of
12792         private properties being allowed to be used in derived classes.
12793
12794         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12795         so we can call the children DoResolveLValue method (this will
12796         properly signal errors on lvalue assignments to base properties)
12797
12798         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12799         getter are null, and we have a property info, we know that this
12800         happened because the lookup failed, so we report an error 122 for
12801         protection level violation.
12802
12803         We also silently return if setter and getter are null in the
12804         resolve functions, this condition only happens if we have flagged
12805         the error before.  This is the other half of the problem. 
12806
12807         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12808         not have accessibility information, that is why we were returning
12809         true in the filter function in typemanager.cs.
12810
12811         To properly report 122 (property is inaccessible because of its
12812         protection level) correctly, we report this error in ResolveAccess
12813         by failing if both the setter and the getter are lacking (ie, the
12814         lookup failed). 
12815
12816         DoResolve and DoLResolve have been modified to check for both
12817         setter/getter being null and returning silently, the reason being
12818         that I did not want to put the knowledge about this error in upper
12819         layers, like:
12820
12821         int old = Report.Errors;
12822         x = new PropertyExpr (...);
12823         if (old != Report.Errors)
12824                 return null;
12825         else
12826                 return x;
12827
12828         So the property expr is returned, but it is invalid, so the error
12829         will be flagged during the resolve process. 
12830
12831         * class.cs: Remove InheritablePropertySignatureCompare from the
12832         class, as we no longer depend on the property signature to compute
12833         whether it is possible to implement a method or not.
12834
12835         The reason is that calling PropertyInfo.GetGetMethod will return
12836         null (in .NET, in Mono it works, and we should change this), in
12837         cases where the Get Method does not exist in that particular
12838         class.
12839
12840         So this code:
12841
12842         class X { public virtual int A { get { return 1; } } }
12843         class Y : X { }
12844         class Z : Y { public override int A { get { return 2; } } }
12845
12846         Would fail in Z because the parent (Y) would not have the property
12847         defined.  So we avoid this completely now (because the alternative
12848         fix was ugly and slow), and we now depend exclusively on the
12849         method names.
12850
12851         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12852         reference method, instead of using the property.
12853
12854         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12855         routines are gone now.
12856
12857         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12858         names, they were incorrectly named.
12859
12860         * cs-tokenizer.cs: Return are more gentle token on failure. 
12861
12862         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12863         had an out-of-sync index variable, which caused it to remove from
12864         the list of pending methods the wrong method sometimes.
12865
12866 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12867
12868         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12869         CanWrite, because those refer to this particular instance of the
12870         property, and do not take into account the fact that we can
12871         override single members of a property.
12872
12873         Constructor requires an EmitContext.  The resolution process does
12874         not happen here, but we need to compute the accessors before,
12875         because the resolution does not always happen for properties.
12876
12877         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12878         subclass, before we did not update this flag, but we did update
12879         bindingflags. 
12880
12881         (GetAccessors): Drop this routine, as it did not work in the
12882         presence of partially overwritten set/get methods. 
12883
12884         Notice that this broke the cs1540 detection, but that will require
12885         more thinking. 
12886
12887 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12888
12889         * class.cs:
12890         * codegen.cs:
12891         * driver.cs: issue a warning instead of an error if we don't support
12892         debugging for the platform. Also ignore a couple of errors that may
12893         arise when trying to write the symbols. Undo my previous patch.
12894
12895 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12896
12897         * driver.cs: ignore /debug switch except for Unix platforms.
12898
12899 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12900
12901         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12902
12903 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12904
12905         * driver.cs: Do not make mcs-debug conditional, so we do not break
12906         builds that use it.
12907
12908         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12909         review this patch.  But basically after all the children variables
12910         have been merged, the value of "Breaks" was not being set to
12911         new_breaks for Switch blocks.  I think that it should be set after
12912         it has executed.  Currently I set this to the value of new_breaks,
12913         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12914         conservative, but I do not understand this code very well.
12915
12916         I did not break anything in the build, so that is good ;-)
12917
12918         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12919
12920 2002-10-20  Mark Crichton  <crichton@gimp.org>
12921
12922         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12923
12924 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12925
12926         * cfold.cs: Fixed compile blocker.
12927
12928 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12929
12930         * driver.cs: I was chekcing the key, not the file.
12931
12932 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12933
12934         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12935         message that we were generating - we just need to silently return
12936         a null.
12937
12938 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * class.cs (Event.Define): Change my previous commit, as this
12941         breaks the debugger.  This is a temporary hack, as it seems like
12942         the compiler is generating events incorrectly to begin with.
12943
12944         * expression.cs (Binary.ResolveOperator): Added support for 
12945         "U operator - (E x, E y)"
12946
12947         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12948         y)".
12949
12950         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12951         init-only variables, but this path did not take into account that
12952         there might be also instance readonly variables.  Correct this
12953         problem. 
12954
12955         This fixes bug 32253
12956
12957         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12958         delegates as well.
12959
12960         * driver.cs: Change the extension for modules to `netmodule'
12961
12962         * cs-parser.jay: Improved slightly the location tracking for
12963         the debugger symbols.
12964
12965         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12966         modifiers that were specified instead of the hardcoded value
12967         (FamAndAssem).  This was basically ignoring the static modifier,
12968         and others.  Fixes 32429.
12969
12970         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12971         fixed a bug in the process (32476)
12972
12973         * expression.cs (ArrayAccess.EmitAssign): Patch from
12974         hwang_rob@yahoo.ca that fixes bug 31834.3
12975
12976 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12977
12978         * driver.cs: Make the module extension .netmodule.
12979
12980 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12981
12982         * driver.cs: Report an error if the resource file is not found
12983         instead of crashing.
12984
12985         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12986         false, like Emit does.
12987
12988 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12989
12990         * typemanager.cs: Remove unused private member.  Also reported mcs
12991         bug to report this as a warning like csc.
12992
12993 2002-10-15  Martin Baulig  <martin@gnome.org>
12994
12995         * statement.cs (Statement.Emit): Made this a virtual method; emits
12996         the line number info and calls DoEmit().
12997         (Statement.DoEmit): New protected abstract method, formerly knows
12998         as Statement.Emit().
12999
13000         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13001
13002 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13003
13004         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13005         have fixed a remaining problem: not every AddXXXX was adding a
13006         fully qualified name.  
13007
13008         Now everyone registers a fully qualified name in the DeclSpace as
13009         being defined instead of the partial name.  
13010
13011         Downsides: we are slower than we need to be due to the excess
13012         copies and the names being registered this way.  
13013
13014         The reason for this is that we currently depend (on the corlib
13015         bootstrap for instance) that types are fully qualified, because
13016         we dump all the types in the namespace, and we should really have
13017         types inserted into the proper namespace, so we can only store the
13018         basenames in the defined_names array.
13019
13020 2002-10-10  Martin Baulig  <martin@gnome.org>
13021
13022         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13023         from bug #31834, see the bug report for a testcase which is
13024         miscompiled.
13025
13026 2002-10-10  Martin Baulig  <martin@gnome.org>
13027
13028         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13029         flow analysis code for this.
13030
13031         * statement.cs (Do, While, For): Tell the flow analysis code about
13032         infinite loops.
13033         (FlowBranching.UsageVector): Added support for infinite loops.
13034         (Block.Resolve): Moved the dead code elimination here and use flow
13035         analysis to do it.
13036
13037 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13038
13039         * class.cs (Field.Define): Catch cycles on struct type
13040         definitions. 
13041
13042         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13043         fields if the fields are static.  We only need to check instance
13044         fields. 
13045
13046         * expression.cs (As.DoResolve): Test for reference type.
13047
13048         * statement.cs (Using.ResolveExpression): Use
13049         ConvertImplicitRequired, not ConvertImplicit which reports an
13050         error on failture
13051         (Using.ResolveLocalVariableDecls): ditto.
13052
13053         * expression.cs (Binary.ResolveOperator): Report errors in a few
13054         places where we had to.
13055
13056         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13057
13058 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13059
13060         * expression.cs: Use StoreFromPtr instead of extracting the type
13061         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13062
13063         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13064         an enumeration value to a System.Enum, but System.Enum is not a
13065         value type, but an class type, so we need to box.
13066
13067         (Expression.ConvertExplicit): One codepath could return
13068         errors but not flag them.  Fix this.  Fixes #31853
13069
13070         * parameter.cs (Resolve): Do not allow void as a parameter type.
13071
13072 2002-10-06  Martin Baulig  <martin@gnome.org>
13073
13074         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13075         if it's a class type and not a struct.  Fixes #31815.
13076
13077 2002-10-06  Martin Baulig  <martin@gnome.org>
13078
13079         * statement.cs: Reworked the flow analysis code a bit to make it
13080         usable for dead code elimination.
13081
13082 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13083
13084         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13085
13086 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13087
13088         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13089         to fix the test 165, will investigate deeper.
13090
13091 2002-10-04  Martin Baulig  <martin@gnome.org>
13092
13093         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13094         finally blocks actually work.
13095         (Try.Resolve): We don't need to create a sibling for `finally' if
13096         there is no finally block.
13097
13098 2002-10-04  Martin Baulig  <martin@gnome.org>
13099
13100         * class.cs (Constructor.Define): The default accessibility for a
13101         non-default constructor is private, not public.
13102
13103 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * class.cs (Constructor): Make AllowedModifiers public, add
13106         EXTERN.
13107
13108         * cs-parser.jay: Perform the modifiers test here, as the
13109         constructor for the Constructor class usually receives a zero
13110         because of the way we create it (first we create, later we
13111         customize, and we were never checking the modifiers).
13112
13113         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13114         is a version of LookupTypeReflection that includes the type-name
13115         cache.  This can be used as a fast path for functions that know
13116         the fully qualified name and are only calling into *.GetType() to
13117         obtain a composed type.
13118
13119         This is also used by TypeManager.LookupType during its type
13120         composition.
13121
13122         (LookupType): We now also track the real type name, as sometimes
13123         we can get a quey for the real type name from things like
13124         ComposedCast.  This fixes bug 31422.
13125
13126         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13127         complete type fullname, it does not have to go through the type
13128         resolution system to obtain the composed version of the type (for
13129         obtaining arrays or pointers).
13130
13131         (Conditional.Emit): Use the EmitBoolExpression to
13132         generate nicer code, as requested by Paolo.
13133
13134         (ArrayCreation.CheckIndices): Use the patch from
13135         hwang_rob@yahoo.ca to validate the array initializers. 
13136
13137 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13138
13139         * class.cs (ConstructorInitializer.Emit): simplify code by using
13140         Invocation.EmitCall, and at the same time, fix the bugs in calling
13141         parent constructors that took variable arguments. 
13142
13143         * ecore.cs (Expression.ConvertNumericExplicit,
13144         Expression.ImplicitNumericConversion): Remove the code that
13145         manually wrapped decimal (InternalTypeConstructor call is now gone
13146         as well).
13147
13148         * expression.cs (Cast.TryReduce): Also handle decimal types when
13149         trying to perform a constant fold on the type.
13150
13151         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13152
13153         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13154         that only turned off an error report, and did nothing else. 
13155
13156 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13157
13158         * driver.cs: Handle and ignore /fullpaths
13159
13160 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13161
13162         * expression.cs (Binary.ResolveOperator): Catch the case where
13163         DoNumericPromotions returns true, 
13164
13165         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13166
13167 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13170         report error 70.
13171
13172 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13173
13174         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13175         conversion exists, but it is also required that the conversion be
13176         performed.  This manifested in "(Type64Enum) 2".  
13177
13178         * class.cs (TypeManager.AddMethod): The fix is not to change
13179         AddEnum, because that one was using a fully qualified name (every
13180         DeclSpace derivative does), but to change the AddMethod routine
13181         that was using an un-namespaced name.  This now correctly reports
13182         the duplicated name.
13183
13184         Revert patch until I can properly fix it.  The issue
13185         is that we have a shared Type space across all namespaces
13186         currently, which is wrong.
13187
13188         Options include making the Namespace a DeclSpace, and merge
13189         current_namespace/current_container in the parser.
13190
13191 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * cs-parser.jay: Improve error reporting when we get a different
13194         kind of expression in local_variable_type and
13195         local_variable_pointer_type. 
13196
13197         Propagate this to avoid missleading errors being reported.
13198
13199         * ecore.cs (ImplicitReferenceConversion): treat
13200         TypeManager.value_type as a target just like object_type.   As
13201         code like this:
13202
13203         ValueType v = 1;
13204
13205         Is valid, and needs to result in the int 1 being boxed before it
13206         is assigned to the value type v.
13207
13208         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13209         to validate the enumeration name.
13210
13211         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13212         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13213         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13214
13215         * ecore.cs (TryImplicitIntConversion): When doing an
13216         implicit-enumeration-conversion, check if the type is 64-bits and
13217         perform a conversion before passing to EnumConstant.
13218
13219 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13220
13221         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13222         report ambiguous type references.  Unlike the MS version, we
13223         report what the ambiguity is.   Innovation at work ;-)
13224
13225         (DeclSpace.FindType): Require a location argument to
13226         display when we display an ambiguous error.
13227
13228         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13229
13230         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13231
13232         * expression.cs (EmitDynamicInitializers): Apply patch from
13233         hwang_rob@yahoo.ca that fixes the order in which we emit our
13234         initializers. 
13235
13236 2002-09-21  Martin Baulig  <martin@gnome.org>
13237
13238         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13239         delegate takes no arguments.
13240
13241 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13242
13243         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13244         from integers.
13245
13246         * expression.cs: Extract the underlying type.
13247
13248         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13249
13250         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13251
13252 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13253
13254         * class.cs (TypeContainer.DefineType): We can not use the nice
13255         PackingSize with the size set to 1 DefineType method, because it
13256         will not allow us to define the interfaces that the struct
13257         implements.
13258
13259         This completes the fixing of bug 27287
13260
13261         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13262         means also structs.  This fixes part of the problem. 
13263         (Expresion.ImplicitReferenceConversionExists): ditto.
13264
13265         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13266         error if there were no errors reported during the type lookup
13267         process, to avoid duplicates or redundant errors.  Without this
13268         you would get an ambiguous errors plus a type not found.  We have
13269         beaten the user enough with the first error.  
13270
13271         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13272         reference. 
13273
13274         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13275         during the resolution process, stop the lookup, this avoids
13276         repeated error reports (same error twice).
13277
13278         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13279
13280         * typemanager.cs (LookupType): Redo the type lookup code to match
13281         the needs of System.Reflection.  
13282
13283         The issue is that System.Reflection requires references to nested
13284         types to begin with a "+" sign instead of a dot.  So toplevel
13285         types look like: "NameSpace.TopLevelClass", and nested ones look
13286         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13287         levels. 
13288
13289 2002-09-19  Martin Baulig  <martin@gnome.org>
13290
13291         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13292         says that a method always returns or always throws an exception,
13293         don't report the CS0161.
13294
13295         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13296         set `Returns = new_returns'.
13297
13298 2002-09-19  Martin Baulig  <martin@gnome.org>
13299
13300         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13301         to an enum constant, check for a CS0176.
13302
13303 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13304
13305         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13306         for operators that must be in pairs and report errors.
13307
13308         * ecore.cs (SimpleName.DoResolveType): During the initial type
13309         resolution process, when we define types recursively, we must
13310         check first for types in our current scope before we perform
13311         lookups in the enclosing scopes.
13312
13313         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13314
13315         (Invocation.VerifyArgumentsCompat): Call
13316         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13317         I thought we were supposed to always call this, but there are a
13318         few places in the code where we dont do it.
13319
13320 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13321
13322         * driver.cs: Add support in -linkres and -resource to specify the
13323         name of the identifier.
13324
13325 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * ecore.cs (StandardConversionExists): Sync with the conversion
13328         code: allow anything-* to void* conversions.
13329
13330         (FindMostSpecificSource): Use an Expression argument
13331         instead of a Type, because we might be handed over a Literal which
13332         gets a few more implicit conversions that plain types do not.  So
13333         this information was being lost.
13334
13335         Also, we drop the temporary type-holder expression when not
13336         required.
13337
13338 2002-09-17  Martin Baulig  <martin@gnome.org>
13339
13340         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13341         this is an explicit interface implementation.
13342
13343 2002-09-17  Martin Baulig  <martin@gnome.org>
13344
13345         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13346         different `IndexerName' attributes.
13347
13348         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13349         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13350         virtual CommonResolve().
13351
13352 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13355         and convert that to the UnderlyingType.
13356
13357         * statement.cs (Foreach.Resolve): Indexers are just like variables
13358         or PropertyAccesses.
13359
13360         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13361         inside quoted strings, we were not doing this before.
13362
13363 2002-09-16  Martin Baulig  <martin@gnome.org>
13364
13365         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13366         resolve it.  This is needed for the definite assignment check of the
13367         instance expression, fixes bug #29846.
13368         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13369
13370 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13371
13372         * parameter.cs: Fix compile error.  Cannot reference static member
13373         from an instance object.  Is this an mcs bug?
13374
13375 2002-09-14  Martin Baulig  <martin@gnome.org>
13376
13377         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13378         multiple times.  Fixes bug #30295, added test-166.cs.
13379
13380 2002-09-14  Martin Baulig  <martin@gnome.org>
13381
13382         * statement.cs (Block.Emit): Don't emit unreachable code.
13383         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13384         `break' statements.
13385         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13386
13387 2002-09-14  Martin Baulig  <martin@gnome.org>
13388
13389         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13390         is set.
13391
13392 2002-09-14  Martin Baulig  <martin@gnome.org>
13393
13394         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13395         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13396         be false on the ms runtime.
13397
13398 2002-09-13  Martin Baulig  <martin@gnome.org>
13399
13400         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13401         the CS0038 error message.
13402
13403 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13406         constant inside, return it.
13407
13408 2002-09-12  Martin Baulig  <martin@gnome.org>
13409
13410         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13411         implicit conversion can be done between enum types.
13412
13413         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13414         check whether an implicit conversion to the current enum's UnderlyingType
13415         exists and report an error if not.
13416
13417         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13418         without debugging support.
13419
13420         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13421         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13422
13423 2002-09-12  Martin Baulig  <martin@gnome.org>
13424
13425         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13426
13427         * ecore.cs (IMemberExpr.DeclaringType): New property.
13428         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13429         nonstatic member of an outer type (CS0038).
13430
13431 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * driver.cs: Activate the using-error detector at warning level
13434         4 (at least for MS-compatible APIs).
13435
13436         * namespace.cs (VerifyUsing): Small buglett fix.
13437
13438         * pending.cs (PendingImplementation): pass the container pointer. 
13439
13440         * interface.cs (GetMethods): Allow for recursive definition.  Long
13441         term, I would like to move every type to support recursive
13442         definitions, not the current ordering mechanism that we have right
13443         now.
13444
13445         The situation is this: Attributes are handled before interfaces,
13446         so we can apply attributes to interfaces.  But some attributes
13447         implement interfaces, we will now handle the simple cases
13448         (recursive definitions will just get an error).  
13449
13450         * parameter.cs: Only invalidate types at the end if we fail to
13451         lookup all types.  
13452
13453 2002-09-09  Martin Baulig  <martin@gnome.org>
13454
13455         * ecore.cs (PropertyExpr.Emit): Also check for
13456         TypeManager.system_int_array_get_length so this'll also work when
13457         compiling corlib.  Fixes #30003.
13458
13459 2002-09-09  Martin Baulig  <martin@gnome.org>
13460
13461         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13462         and throw an exception if we can't get the type's size.  Fixed #30040,
13463         added test-165.cs.
13464
13465 2002-09-09  Martin Baulig  <martin@gnome.org>
13466
13467         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13468
13469         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13470         context.  Fixes bug #30027.
13471
13472         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13473         virtual functions.  Fixes bug #30043, added test-164.cs.
13474
13475 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13476
13477         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13478
13479 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13480
13481         * driver.cs: Use an object to get the windows codepage since it's not a
13482         static property.
13483
13484 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13485
13486         * statement.cs (For.Emit): for infinite loops (test == null)
13487         return whether there is a break inside, not always "true".
13488
13489         * namespace.cs (UsingEntry): New struct to hold the name of the
13490         using definition, the location where it is defined, and whether it
13491         has been used in a successful type lookup.
13492
13493         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13494         strings.
13495
13496         * decl.cs: ditto.
13497
13498 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13499
13500         * attribute.cs : Fix incorrect code which relied on catching
13501         a NullReferenceException to detect a null being passed in
13502         where an object was expected.
13503
13504 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13505
13506         * statement.cs (Try): flag the catch variable as assigned
13507
13508         * expression.cs (Cast): Simplified by using ResolveType instead of
13509         manually resolving.
13510
13511         * statement.cs (Catch): Fix bug by using ResolveType.
13512
13513 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13514
13515         * expression.cs (BetterConversion): Special case for when we have
13516         a NullLiteral as the argument and we have to choose between string
13517         and object types - we choose string the way csc does.
13518
13519         * attribute.cs (Attribute.Resolve): Catch the
13520         NullReferenceException and report error #182 since the Mono
13521         runtime no more has the bug and having this exception raised means
13522         we tried to select a constructor which takes an object and is
13523         passed a null.
13524
13525 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13526
13527         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13528         message (1502, 1503) when we can't locate a method after overload
13529         resolution. This is much more informative and closes the bug
13530         Miguel reported.
13531
13532         * interface.cs (PopulateMethod): Return if there are no argument
13533         types. Fixes a NullReferenceException bug.
13534
13535         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13536         expressions too. Previously we were checking only in one place for
13537         positional arguments leaving out named arguments.
13538
13539         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13540         type to the enum type is not allowed. Remove code corresponding to
13541         that.
13542
13543         (ConvertNumericExplicit): Allow explicit conversions from
13544         the underlying type to enum type. This precisely follows the spec
13545         and closes a bug filed by Gonzalo.
13546
13547 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13548
13549         * compiler.csproj:
13550         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13551
13552 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13553
13554         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13555         it was important that we stored the right value after the
13556         reduction in `converted'.
13557
13558 2002-09-04  Martin Baulig  <martin@gnome.org>
13559
13560         * location.cs (Location.SymbolDocument): Use full pathnames for the
13561         source files.
13562
13563 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13564
13565         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13566         of the expression resolve mechanism, because that will catch the
13567         SimpleName error failures.
13568
13569         (Conditional): If we can not resolve the
13570         expression, return, do not crash.
13571
13572 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13573
13574         * cs-tokenizer.cs:
13575         (location): display token name instead of its number.
13576
13577 2002-08-28  Martin Baulig  <martin@gnome.org>
13578
13579         * expression.cs (Binary.ResolveOperator): Don't silently return
13580         but return an error if an operator cannot be applied between two
13581         enum types.
13582
13583 2002-08-28  Martin Baulig  <martin@gnome.org>
13584
13585         * class.cs (Constructor.Define): Set the permission attributes
13586         correctly instead of making all constructors public.
13587
13588 2002-08-28  Martin Baulig  <martin@gnome.org>
13589
13590         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13591         for private members before reporting a CS0103; if we find anything,
13592         it's a CS0122.
13593
13594 2002-08-28  Martin Baulig  <martin@gnome.org>
13595
13596         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13597         to check whether `closure_start_type == closure_invocation_type',
13598         we also need to check whether `m.DeclaringType == closure_invocation_type'
13599         before bypassing the permission checks.  We might be accessing
13600         protected/private members from the base class.
13601         (TypeManager.RealMemberLookup): Only set private_ok if private
13602         members were requested via BindingFlags.NonPublic.
13603
13604         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13605
13606         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13607         MethodGroupExpr.IsExplicitImpl if appropriate.
13608         (Invocation.DoResolve): Don't report the CS0120 for explicit
13609         interface implementations.
13610
13611 2002-08-27  Martin Baulig  <martin@gnome.org>
13612
13613         * expression.cs (Invocation.DoResolve): If this is a static
13614         method and we don't have an InstanceExpression, we must report
13615         a CS0120.
13616
13617 2002-08-25  Martin Baulig  <martin@gnome.org>
13618
13619         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13620         `==' between a valuetype and an object.
13621
13622 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * ecore.cs (TypeExpr): Provide a ToString method.
13625
13626 2002-08-24  Martin Baulig  <martin@gnome.org>
13627
13628         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13629         now called proggie.dbg and it's a binary file.
13630
13631 2002-08-23  Martin Baulig  <martin@gnome.org>
13632
13633         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13634
13635 2002-08-23  Martin Baulig  <martin@gnome.org>
13636
13637         * struct.cs (MyStructInfo.ctor): Make this work with empty
13638         structs; it's not allowed to use foreach() on null.
13639
13640 2002-08-23  Martin Baulig  <martin@gnome.org>
13641
13642         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13643         writer the full pathname of the generated assembly.
13644
13645 2002-08-23  Martin Baulig  <martin@gnome.org>
13646
13647         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13648         A `finally' block never returns or breaks; improved handling of
13649         unreachable code.
13650
13651 2002-08-23  Martin Baulig  <martin@gnome.org>
13652
13653         * statement.cs (Throw.Resolve): Allow `throw null'.
13654
13655 2002-08-23  Martin Baulig  <martin@gnome.org>
13656
13657         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13658         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13659         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13660         MemberLookup would return a wrong event if this is an explicit
13661         interface implementation and the class has an event with the same
13662         name.
13663
13664 2002-08-23  Martin Baulig  <martin@gnome.org>
13665
13666         * statement.cs (Block.AddChildVariableNames): New public method.
13667         (Block.AddChildVariableName): Likewise.
13668         (Block.IsVariableNameUsedInChildBlock): Likewise.
13669         (Block.AddVariable): Check whether a variable name has already
13670         been used in a child block.
13671
13672         * cs-parser.jay (declare_local_variables): Mark all variable names
13673         from the current block as being used in a child block in the
13674         implicit block.
13675
13676 2002-08-23  Martin Baulig  <martin@gnome.org>
13677
13678         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13679         find the symbol writer.
13680
13681         * driver.cs: csc also allows the arguments to /define being
13682         separated by commas, not only by semicolons.
13683
13684 2002-08-23  Martin Baulig  <martin@gnome.org>
13685
13686         * interface.cs (Interface.GetMembers): Added static check for events.
13687
13688 2002-08-15  Martin Baulig  <martin@gnome.org>
13689
13690         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13691         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13692
13693         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13694         why the MethodData.EmitDestructor() change was necessary.
13695
13696 2002-08-20  Martin Baulig  <martin@gnome.org>
13697
13698         * class.cs (TypeContainer.FindMembers): Added static check for events.
13699
13700         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13701
13702         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13703         use Type.GetEvents(), not Type.FindMembers().
13704
13705 2002-08-20  Martin Baulig  <martin@gnome.org>
13706
13707         * decl.cs (MemberCache): Added a special method cache which will
13708         be used for method-only searched.  This ensures that a method
13709         search will return a MethodInfo with the correct ReflectedType for
13710         inherited methods.      
13711
13712 2002-08-20  Martin Baulig  <martin@gnome.org>
13713
13714         * decl.cs (DeclSpace.FindMembers): Made this public.
13715
13716 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13717
13718         * delegate.cs: fixed build on windows.
13719         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13720
13721 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13722
13723         * ecore.cs (StandardConversionExists): Return a false
13724         if we are trying to convert the void type to anything else
13725         since that is not allowed.
13726
13727         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13728         we flag error 70 in the event an event is trying to be accessed
13729         directly from outside the declaring type.
13730
13731 2002-08-20  Martin Baulig  <martin@gnome.org>
13732
13733         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13734         MemberCache from typemanager.cs to decl.cs.
13735
13736 2002-08-19  Martin Baulig  <martin@gnome.org>
13737
13738         * class.cs (TypeContainer): Implement IMemberContainer.
13739         (TypeContainer.DefineMembers): Create the MemberCache.
13740         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13741         return public members if BindingFlags.Public was given, check
13742         whether members are static.
13743
13744 2002-08-16  Martin Baulig  <martin@gnome.org>
13745
13746         * decl.cs (DeclSpace.Define): Splitted this in Define and
13747         DefineMembers.  DefineMembers is called first and initializes the
13748         MemberCache.
13749
13750         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13751         DefineMembers() on all our DeclSpaces.
13752
13753         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13754         but call DefineMembers() on all nested interfaces.  We call their
13755         Define() in our new Define() function.
13756
13757         * interface.cs (Interface): Implement IMemberContainer.
13758         (Interface.Define): Moved all code except the attribute stuf to
13759         DefineMembers().
13760         (Interface.DefineMembers): Initialize the member cache.
13761
13762         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13763         need this anymore since we can use MemberCache.FindMembers directly.
13764
13765 2002-08-19  Martin Baulig  <martin@gnome.org>
13766
13767         * typemanager.cs (MemberCache): When creating the cache for an
13768         interface type, add all inherited members.
13769         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13770         to `out bool used_cache' and documented it.
13771         (TypeManager.MemberLookup): If we already used the cache in the first
13772         iteration, we don't need to do the interfaces check.
13773
13774 2002-08-19  Martin Baulig  <martin@gnome.org>
13775
13776         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13777         here from IMemberFinder and don't implement this interface anymore.
13778         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13779
13780         * typemanager.cs (IMemberFinder): This interface is now only used by
13781         classes which actually support the member cache.
13782         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13783         since we only put DeclSpaces into this Hashtable.
13784         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13785         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13786
13787 2002-08-16  Martin Baulig  <martin@gnome.org>
13788
13789         * typemanager.cs (ICachingMemberFinder): Removed.
13790         (IMemberFinder.MemberCache): New property.
13791         (TypeManager.FindMembers): Merged this with RealFindMembers().
13792         This function will never be called from TypeManager.MemberLookup()
13793         so we can't use the cache here, just the IMemberFinder.
13794         (TypeManager.MemberLookup_FindMembers): Check whether the
13795         IMemberFinder has a MemberCache and call the cache's FindMembers
13796         function.
13797         (MemberCache): Rewrote larger parts of this yet another time and
13798         cleaned it up a bit.
13799
13800 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13801
13802         * driver.cs (LoadArgs): Support quoting.
13803
13804         (Usage): Show the CSC-like command line arguments.
13805
13806         Improved a few error messages.
13807
13808 2002-08-15  Martin Baulig  <martin@gnome.org>
13809
13810         * typemanager.cs (IMemberContainer.Type): New property.
13811         (IMemberContainer.IsInterface): New property.
13812
13813         The following changes are conditional to BROKEN_RUNTIME, which is
13814         defined at the top of the file.
13815
13816         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13817         class'es members, but add all members from TypeHandle.ObjectType
13818         if we're an interface.
13819         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13820         is the current type.
13821         (MemberCache.CacheEntry.Container): Removed this field.
13822         (TypeHandle.GetMembers): Include inherited members.
13823
13824 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13825
13826         * typemanager.cs: fixed compilation and added a comment on a field that
13827         is never used.
13828
13829 2002-08-15  Martin Baulig  <martin@gnome.org>
13830
13831         * class.cs (ConstructorInitializer.Resolve): In the
13832         Expression.MemberLookup call, use the queried_type as
13833         invocation_type.
13834
13835         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13836         declared' attribute, it's always true.
13837         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13838         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13839         temporary wrapper for FindMembers which tells MemberLookup whether
13840         members from the base classes are included in the return value.
13841         This will go away soon.
13842         (TypeManager.MemberLookup): Use this temporary hack here; once the
13843         new MemberCache is completed, we don't need to do the DeclaredOnly
13844         looping here anymore since the MemberCache will take care of this.
13845         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13846         (MemberCache): When creating the MemberCache for a class, get
13847         members from the current class and all its base classes.
13848         (MemberCache.CacheEntry.Container): New field.  This is a
13849         temporary hack until the Mono runtime is fixed to distinguish
13850         between ReflectedType and DeclaringType.  It allows us to use MCS
13851         with both the MS runtime and the unfixed Mono runtime without
13852         problems and without accecting performance.
13853         (MemberCache.SearchMembers): The DeclaredOnly looping from
13854         TypeManager.MemberLookup is now done here.      
13855
13856 2002-08-14  Martin Baulig  <martin@gnome.org>
13857
13858         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13859         Type.GetFields on dynamic types but get the fields from the
13860         corresponding TypeContainer.
13861         (MyStructInfo.GetStructInfo): Added check for enum types.
13862
13863         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13864         (MemberList.SyncRoot): Implemented.
13865         (TypeManager.FilterWithClosure): No need to check permissions if
13866         closure_start_type == closure_invocation_type, don't crash if
13867         closure_invocation_type is null.
13868
13869 2002-08-13  Martin Baulig  <martin@gnome.org>
13870
13871         Rewrote TypeContainer.FindMembers to use a member cache.  This
13872         gives us a speed increase of about 35% for the self-hosting MCS
13873         build and of about 15-20% for the class libs (both on GNU/Linux).
13874
13875         * report.cs (Timer): New class to get enhanced profiling.  This
13876         whole class is "TIMER" conditional since it remarkably slows down
13877         compilation speed.
13878
13879         * class.cs (MemberList): New class.  This is an IList wrapper
13880         which we're now using instead of passing MemberInfo[]'s around to
13881         avoid copying this array unnecessarily.
13882         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13883         (ICachingMemberFinder, IMemberContainer): New interface.
13884         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13885         has already been checked, otherwise use it for the name comparision.
13886         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13887         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13888         if possible.  Returns a MemberList, not a MemberInfo [].
13889         (TypeHandle): New class, implements IMemberContainer.  We create
13890         one instance of this class per type, it contains a MemberCache
13891         which is used to do the member lookups.
13892         (MemberCache): New class.  Each instance of this class contains
13893         all members of a type and a name-based hash table.
13894         (MemberCache.FindMembers): This is our new member lookup
13895         function.  First, it looks up all members of the requested name in
13896         the hash table.  Then, it walks this list and sorts out all
13897         applicable members and returns them.
13898
13899 2002-08-13  Martin Baulig  <martin@gnome.org>
13900
13901         In addition to a nice code cleanup, this gives us a performance
13902         increase of about 1.4% on GNU/Linux - not much, but it's already
13903         half a second for the self-hosting MCS compilation.
13904
13905         * typemanager.cs (IMemberFinder): New interface.  It is used by
13906         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13907         Enum, Delegate or Interface.
13908         (TypeManager.finder_to_member_finder): New PtrHashtable.
13909         (TypeManager.finder_to_container): Removed.
13910         (TypeManager.finder_to_delegate): Removed.
13911         (TypeManager.finder_to_interface): Removed.
13912         (TypeManager.finder_to_enum): Removed.
13913
13914         * interface.cs (Interface): Implement IMemberFinder.
13915
13916         * delegate.cs (Delegate): Implement IMemberFinder.
13917
13918         * enum.cs (Enum): Implement IMemberFinder.
13919
13920         * class.cs (TypeContainer): Implement IMemberFinder.
13921
13922 2002-08-12  Martin Baulig  <martin@gnome.org>
13923
13924         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13925
13926 2002-08-12  Martin Baulig  <martin@gnome.org>
13927
13928         * ecore.cs (ITypeExpression): New interface for expressions which
13929         resolve to a type.
13930         (TypeExpression): Renamed to TypeLookupExpression.
13931         (Expression.DoResolve): If we're doing a types-only lookup, the
13932         expression must implement the ITypeExpression interface and we
13933         call DoResolveType() on it.
13934         (SimpleName): Implement the new ITypeExpression interface.
13935         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13936         hack, the situation that we're only looking up types can't happen
13937         anymore when this method is called.  Moved the type lookup code to
13938         DoResolveType() and call it.
13939         (SimpleName.DoResolveType): This ITypeExpression interface method
13940         is now doing the types-only lookup.
13941         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13942         (ResolveFlags): Added MaskExprClass.
13943
13944         * expression.cs (MemberAccess): Implement the ITypeExpression
13945         interface.
13946         (MemberAccess.DoResolve): Added support for a types-only lookup
13947         when we're called via ITypeExpression.DoResolveType().
13948         (ComposedCast): Implement the ITypeExpression interface.
13949
13950         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13951         Expression.Resolve() with ResolveFlags.Type instead.
13952
13953 2002-08-12  Martin Baulig  <martin@gnome.org>
13954
13955         * interface.cs (Interface.Define): Apply attributes.
13956
13957         * attribute.cs (Attribute.ApplyAttributes): Added support for
13958         interface attributes.
13959
13960 2002-08-11  Martin Baulig  <martin@gnome.org>
13961
13962         * statement.cs (Block.Emit): Only check the "this" variable if we
13963         do not always throw an exception.
13964
13965         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13966         whether the property has a set accessor.
13967
13968 2002-08-11  Martin Baulig  <martin@gnome.org>
13969
13970         Added control flow analysis support for structs.
13971
13972         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13973         with control flow analysis turned off.
13974         (IVariable): New interface.
13975         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13976         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13977         (FieldExpr.DoResolve): Resolve the instance expression with flow
13978         analysis turned off and do the definite assignment check after the
13979         resolving when we know what the expression will resolve to.
13980
13981         * expression.cs (LocalVariableReference, ParameterReference):
13982         Implement the new IVariable interface, only call the flow analysis
13983         code if ec.DoFlowAnalysis is true.
13984         (This): Added constructor which takes a Block argument.  Implement
13985         the new IVariable interface.
13986         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13987         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13988         This does the definite assignment checks for struct members.
13989
13990         * class.cs (Constructor.Emit): If this is a non-static `struct'
13991         constructor which doesn't have any initializer, call
13992         Block.AddThisVariable() to tell the flow analysis code that all
13993         struct elements must be initialized before control returns from
13994         the constructor.
13995
13996         * statement.cs (MyStructInfo): New public class.
13997         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13998         argument to this indexer.  If non-zero, check an individual struct
13999         member, not the whole struct.
14000         (FlowBranching.CheckOutParameters): Check struct members.
14001         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14002         overloaded versions of these methods which take an additional
14003         `int field_idx' argument to check struct members.
14004         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14005         overloaded versions of these methods which take an additional
14006         `string field_name' argument to check struct member.s
14007         (VariableInfo): Implement the IVariable interface.
14008         (VariableInfo.StructInfo): New public property.  Returns the
14009         MyStructInfo instance of the variable if it's a struct or null.
14010         (Block.AddThisVariable): New public method.  This is called from
14011         Constructor.Emit() for non-static `struct' constructor which do
14012         not have any initializer.  It creates a special variable for the
14013         "this" instance variable which will be checked by the flow
14014         analysis code to ensure that all of the struct's fields are
14015         initialized before control returns from the constructor.
14016         (UsageVector): Added support for struct members.  If a
14017         variable/parameter is a struct with N members, we reserve a slot
14018         in the usage vector for each member.  A struct is considered fully
14019         initialized if either the struct itself (slot 0) or all its
14020         members are initialized.
14021
14022 2002-08-08  Martin Baulig  <martin@gnome.org>
14023
14024         * driver.cs (Driver.MainDriver): Only report an error CS5001
14025         if there were no compilation errors.
14026
14027         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14028         `UnsafeContext' property to determine whether the parent is in
14029         unsafe context rather than checking the parent's ModFlags:
14030         classes nested in an unsafe class are unsafe as well.
14031
14032 2002-08-08  Martin Baulig  <martin@gnome.org>
14033
14034         * statement.cs (UsageVector.MergeChildren): Distinguish between
14035         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14036         we return.  Added test17() and test18() to test-154.cs.
14037
14038 2002-08-08  Martin Baulig  <martin@gnome.org>
14039
14040         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14041         Family access, make sure the invoking type isn't a subclass of the
14042         queried type (that'd be a CS1540).
14043
14044         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14045         this method which takes an additional `Type invocation_type'.
14046
14047         * expression.cs (BaseAccess.DoResolve): Use the base type as
14048         invocation and query type.
14049         (MemberAccess.DoResolve): If the lookup failed and we're about to
14050         report a CS0122, try a lookup with the ec.ContainerType - if this
14051         succeeds, we must report a CS1540.
14052
14053 2002-08-08  Martin Baulig  <martin@gnome.org>
14054
14055         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14056         (MethodGroupExpr): Implement the IMemberExpr interface.
14057
14058         * expression (MemberAccess.ResolveMemberAccess): No need to have
14059         any special code for MethodGroupExprs anymore, they're now
14060         IMemberExprs.   
14061
14062 2002-08-08  Martin Baulig  <martin@gnome.org>
14063
14064         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14065         Family, FamANDAssem and FamORAssem permissions.
14066         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14067
14068 2002-08-08  Martin Baulig  <martin@gnome.org>
14069
14070         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14071         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14072         or loop block.
14073
14074 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14075
14076         * driver.cs: implemented /resource option to embed managed resources.
14077
14078 2002-08-07  Martin Baulig  <martin@gnome.org>
14079
14080         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14081         (FieldBase.HasFieldInitializer): New public property.
14082         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14083         returns the field initializer and makes sure it is only resolved once.
14084         (TypeContainer.EmitFieldInitializers): Call
14085         FieldBase.GetInitializerExpression to get the initializer, this ensures
14086         that it isn't resolved multiple times.
14087
14088         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14089         the resolving process (SimpleName/MemberLookup) that we're currently
14090         emitting a field initializer (which must not access any instance members,
14091         this is an error CS0236).
14092
14093         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14094         argument, if the `IsFieldInitializer' flag is set, we must report and
14095         error CS0236 and not an error CS0120.   
14096
14097 2002-08-07  Martin Baulig  <martin@gnome.org>
14098
14099         * ecore.cs (IMemberExpr): New public interface.
14100         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14101         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14102         if the expression is an IMemberExpr.
14103
14104         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14105         to be null, implicitly default to `this' if we're non-static in
14106         this case.  Simplified the code a lot by using the new IMemberExpr
14107         interface.  Also fixed bug #28176 here.
14108
14109 2002-08-06  Martin Baulig  <martin@gnome.org>
14110
14111         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14112         ParameterReferences during semantic analysis so that we can do a
14113         type-only search when resolving Cast, TypeOf and SizeOf.
14114         (block): Pass the `current_local_parameters' to the Block's
14115         constructor.
14116
14117         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14118         argument to the constructor.
14119         (ConstructorInitializer.Resolve): Create a temporary implicit
14120         block with the parameters.
14121
14122         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14123         references here if we aren't doing a type-only search.
14124
14125         * statement.cs (Block): Added constructor which takes a
14126         `Parameters parameters' argument.
14127         (Block.Parameters): New public property.
14128
14129         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14130         to `Parameters' and made it public readonly.
14131
14132 2002-08-06  Martin Baulig  <martin@gnome.org>
14133
14134         * ecore.cs (Expression.Warning): Made this public as well.
14135
14136         * report.cs (Report.Debug): Print the contents of collections.
14137
14138 2002-08-06  Martin Baulig  <martin@gnome.org>
14139
14140         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14141         used to tell Resolve() which kinds of expressions it may return.
14142         (Expression.Resolve): Added overloaded version of this method which
14143         takes a `ResolveFlags flags' argument.  This can be used to tell
14144         Resolve() which kinds of expressions it may return.  Reports a
14145         CS0118 on error.
14146         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14147         ResolveFlags.SimpleName.
14148         (Expression.Error118): Added overloaded version of this method which
14149         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14150         which kinds of expressions are allowed.
14151
14152         * expression.cs (Argument.ResolveMethodGroup): New public method.
14153         Resolves an argument, but allows a MethodGroup to be returned.
14154         This is used when invoking a delegate.
14155
14156         * TODO: Updated a bit.
14157
14158 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14159
14160         Fixed compilation with csc.
14161
14162         * ecore.cs: Expression.Error made public. Is this correct? Should
14163         Warning be made public too?
14164
14165         * expression.cs: use ea.Location instead of ea.loc.
14166         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14167
14168 2002-08-06  Martin Baulig  <martin@gnome.org>
14169
14170         * ecore.cs (Expression.loc): Moved the location here instead of
14171         duplicating it in all derived classes.
14172         (Expression.Location): New public property.
14173         (Expression.Error, Expression.Warning): Made them non-static and
14174         removed the location argument.
14175         (Expression.Warning): Added overloaded version which takes an
14176         `int level' argument.
14177         (Expression.Error118): Make this non-static and removed the
14178         expression and location arguments.
14179         (TypeExpr): Added location argument to the constructor.
14180
14181         * expression.cs (StaticCallExpr): Added location argument to
14182         the constructor.
14183         (Indirection, PointerArithmetic): Likewise.
14184         (CheckedExpr, UnCheckedExpr): Likewise.
14185         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14186         (StringPtr): Likewise.
14187
14188
14189 2002-08-05  Martin Baulig  <martin@gnome.org>
14190
14191         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14192
14193         * assign.cs (Assign.DoResolve): Check whether the source
14194         expression is a value or variable.
14195
14196         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14197         while resolving the corresponding blocks.
14198
14199         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14200         an error, don't silently return null.
14201
14202         * statement.cs (Block.AddVariable): Do the error reporting here
14203         and distinguish between CS0128 and CS0136.
14204         (Block.DoResolve): Report all unused labels (warning CS0164).
14205         (LabeledStatement): Pass the location to the constructor.
14206         (LabeledStatement.HasBeenReferenced): New property.
14207         (LabeledStatement.Resolve): Set it to true here.
14208
14209         * statement.cs (Return.Emit): Return success even after reporting
14210         a type mismatch error (CS0126 or CS0127), this is what csc does and
14211         it avoids confusing the users with any consecutive errors.
14212
14213 2002-08-05  Martin Baulig  <martin@gnome.org>
14214
14215         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14216
14217         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14218
14219         * expression.cs (MemberAccess.DoResolve): Silently return if an
14220         error has already been reported.
14221
14222         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14223         error has already been reported.
14224
14225 2002-08-05  Martin Baulig  <martin@gnome.org>
14226
14227         * statement.cs (UsageVector): Only initialize the `parameters'
14228         vector if we actually have any "out" parameters.
14229
14230 2002-08-05  Martin Baulig  <martin@gnome.org>
14231
14232         * expression.cs (Binary.ResolveOperator): When combining delegates,
14233         they must have the same type.
14234
14235 2002-08-05  Martin Baulig  <martin@gnome.org>
14236
14237         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14238         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14239         work with the ms runtime and we also don't need it: if we're a
14240         PropertyBuilder and not in the `indexer_arguments' hash, then we
14241         are a property and not an indexer.
14242
14243         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14244         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14245         since the latter one doesn't work with the ms runtime.
14246
14247 2002-08-03  Martin Baulig  <martin@gnome.org>
14248
14249         Fixed bugs #27998 and #22735.
14250
14251         * class.cs (Method.IsOperator): New public field.
14252         (Method.CheckBase): Report CS0111 if there's already a method
14253         with the same parameters in the current class.  Report CS0508 when
14254         attempting to change the return type of an inherited method.
14255         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14256         and it's not marked abstract or extern.
14257         (PropertyBase): New abstract base class for Property and Indexer.
14258         (PropertyBase.CheckBase): Moved here from Property and made it work
14259         for indexers.
14260         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14261         the same so we can reuse it there.
14262         (Property, Indexer): Derive from PropertyBase.
14263         (MethodSignature.inheritable_property_signature_filter): New delegate
14264         to find properties and indexers.
14265
14266         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14267         argument and improved error reporting.
14268
14269         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14270         EmptyReadOnlyParameters and made it a property.
14271
14272         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14273         version of this method which takes a `PropertyInfo indexer'.
14274         (TypeManager.RegisterIndexer): New method.
14275
14276         * class.cs: Added myself as author of this file :-)
14277
14278 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14279
14280         * class.cs: fixed compilation on windoze.
14281
14282 2002-08-03  Martin Baulig  <martin@gnome.org>
14283
14284         * interface.cs (Interface.GetInterfaceBases): Check whether all
14285         base interfaces are at least as accessible than the current one.
14286
14287         * class.cs (TypeContainer.GetClassBases): Check whether base types
14288         are at least as accessible than the current type.
14289         (TypeContainer.AsAccessible): Implemented and made non-static.
14290         (MemberBase.CheckParameters): Report errors if the accessibility
14291         checks fail.
14292
14293         * delegate.cs (Delegate.Delegate): The default visibility is
14294         internal for top-level types and private for nested types.
14295         (Delegate.Define): Report errors if the accessibility checks fail.
14296
14297         * enum.cs (Enum.Enum): The default visibility is internal for
14298         top-level types and private for nested types.
14299         (Enum.DefineType): Compute the correct visibility.
14300
14301         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14302         function which takes a `bool is_toplevel' instead of a TypeContainer.
14303
14304         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14305         builtin type.
14306
14307 2002-08-02  Martin Baulig  <martin@gnome.org>
14308
14309         * expression.cs (LocalVariableReferenc): Added constructor which
14310         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14311         (LocalVariableReference.IsReadOnly): New property.
14312         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14313         variable is readonly, use our own readonly flag to do this; you can
14314         use the new constructor to get a writable reference to a read-only
14315         variable.
14316
14317         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14318         reference to the local variable.
14319
14320 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14321
14322         * rootcontext.cs (ResolveCore): Also include System.Exception
14323
14324         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14325         we reach an EmptyStatement.
14326
14327         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14328         is also fine.
14329
14330         * expression.cs (Binary.ResolveOperator): Check error result in
14331         two places.
14332
14333         use brtrue/brfalse directly and avoid compares to null.
14334
14335 2002-08-02  Martin Baulig  <martin@gnome.org>
14336
14337         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14338         Fixes bug #28407, added test-155.cs.
14339
14340 2002-08-01  Martin Baulig  <martin@gnome.org>
14341
14342         * class.cs (Event.EmitDefaultMethod): Make this work with static
14343         events.  Fixes #28311, added verify-3.cs.
14344
14345 2002-08-01  Martin Baulig  <martin@gnome.org>
14346
14347         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14348         `is_disposable' fields.
14349         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14350         `hm.is_disposable' if we're using the collection pattern.
14351         (Foreach.EmitCollectionForeach): Use the correct type for the
14352         enumerator's local variable, only emit the try/finally block if
14353         necessary (fixes #27713).
14354
14355 2002-08-01  Martin Baulig  <martin@gnome.org>
14356
14357         * ecore.cs (Expression.report118): Renamed to Error118 and made
14358         it public static.
14359
14360         * statement.cs (Throw.Resolve): Check whether the expression is of
14361         the correct type (CS0118) and whether the type derives from
14362         System.Exception (CS0155).
14363         (Catch.Resolve): New method.  Do the type lookup here and check
14364         whether it derives from System.Exception (CS0155).
14365         (Catch.CatchType, Catch.IsGeneral): New public properties.
14366
14367         * typemanager.cs (TypeManager.exception_type): Added.
14368
14369 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * driver.cs: Updated About function.
14372
14373 2002-07-31  Martin Baulig  <martin@gnome.org>
14374
14375         Implemented Control Flow Analysis.
14376
14377         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14378         (EmitContext.CurrentBranching): Added.
14379         (EmitContext.StartFlowBranching): Added.
14380         (EmitContext.EndFlowBranching): Added.
14381         (EmitContext.KillFlowBranching): Added.
14382         (EmitContext.IsVariableAssigned): Added.
14383         (EmitContext.SetVariableAssigned): Added.
14384         (EmitContext.IsParameterAssigned): Added.
14385         (EmitContext.SetParameterAssigned): Added.
14386         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14387         Added control flow analysis stuff here.
14388
14389         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14390         resolve the expression as lvalue.
14391         (LocalVariableReference.DoResolve): Check whether the variable has
14392         already been assigned.
14393         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14394         the parameter as assigned here.
14395         (ParameterReference.DoResolve): Check whether the parameter has already
14396         been assigned.
14397         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14398         expression as lvalue.
14399
14400         * statement.cs (FlowBranching): New class for the flow analysis code.
14401         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14402         (LabeledStatement.IsDefined): New public property.
14403         (LabeledStatement.AddUsageVector): New public method to tell flow
14404         analyis that the label may be reached via a forward jump.
14405         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14406         flow analysis.
14407         (VariableInfo.Number): New public field.  This is used by flow analysis
14408         to number all locals of a block.
14409         (Block.CountVariables): New public property.  This is the number of
14410         local variables in this block (including the locals from all parent
14411         blocks).
14412         (Block.EmitMeta): Number all the variables.
14413
14414         * statement.cs: Added flow analysis support to all classes.
14415
14416 2002-07-31  Martin Baulig  <martin@gnome.org>
14417
14418         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14419         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14420         then use this argument.
14421
14422         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14423
14424         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14425         use this to specify /define options.
14426
14427 2002-07-29  Martin Baulig  <martin@gnome.org>
14428
14429         * statement.cs (Fixed): Moved all code that does variable lookups
14430         and resolvings from Emit to Resolve.
14431
14432         * statement.cs (For): Moved all code that does variable lookups
14433         and resolvings from Emit to Resolve.
14434
14435         * statement.cs (Using): Moved all code that does variable lookups
14436         and resolvings from Emit to Resolve.
14437
14438 2002-07-29  Martin Baulig  <martin@gnome.org>
14439
14440         * attribute.cs (Attribute.Resolve): Explicitly catch a
14441         System.NullReferenceException when creating the
14442         CustromAttributeBuilder and report a different warning message.
14443
14444 2002-07-29  Martin Baulig  <martin@gnome.org>
14445
14446         * support.cs (ParameterData.ParameterName): Added method to
14447         get the name of a parameter.
14448
14449         * typemanager.cs (TypeManager.IsValueType): New public method.
14450
14451 2002-07-29  Martin Baulig  <martin@gnome.org>
14452
14453         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14454         is a flag which specifies that it's either ref or out.
14455         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14456         the out parameter to `out Parameter.Modifier mod', also set the
14457         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14458
14459         * support.cs (InternalParameters.ParameterModifier): Distinguish
14460         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14461         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14462
14463         * expression.cs (Argument.GetParameterModifier): Distinguish
14464         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14465         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14466
14467 2002-07-29  Martin Baulig  <martin@gnome.org>
14468
14469         * expression.cs (ParameterReference.ParameterReference): Added
14470         `Location loc' argument to the constructor.
14471
14472         * cs-parser.jay: Pass location to ParameterReference.
14473
14474 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * statement.cs (Try): Initialize the location.
14477
14478         * cs-parser.jay: pass location to Try.
14479
14480         * expression.cs (Unary.Reduce): Change the prototype to return
14481         whether a constant fold could be performed or not.  The result is
14482         returned in an out parameters.  In the case of Indirection and
14483         AddressOf, we want to perform the full tests.
14484
14485 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14486
14487         * statement.cs (Statement.Emit): Flag dead code.
14488
14489 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14490
14491         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14492
14493 2002-07-27  Martin Baulig  <martin@gnome.org>
14494
14495         * class.cs (MethodData.Define): Put back call to
14496         TypeManager.AddMethod(), accidentally commented this out.
14497
14498         * report.cs (Debug): New public method to print debugging information,
14499         this is `[Conditional ("DEBUG")]'.
14500
14501 2002-07-26  Martin Baulig  <martin@gnome.org>
14502
14503         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14504         (switch_statement): Push the current_block to the switch_stack and
14505         pop it again when we're done with the switch.
14506         (switch_section): The new block is a child of the current_block.
14507         Fixes bug #24007, added test-152.cs.
14508
14509 2002-07-27  Martin Baulig  <martin@gnome.org>
14510
14511         * expression.cs (Invocation.EmitArguments): When calling a varargs
14512         function with only its fixed arguments, we need to pass an empty
14513         array.
14514
14515 2002-07-27  Martin Baulig  <martin@gnome.org>
14516
14517         Mono 0.13 has been released.
14518
14519 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14520
14521         * driver.cs: Rename --resource to --linkres, because that is what
14522         we do currently, we dont support --resource yet.
14523
14524         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14525
14526 2002-07-25  Martin Baulig  <martin@gnome.org>
14527
14528         * class.cs (MethodData): New public class.  This is a `method builder'
14529         class for a method or one accessor of a Property/Indexer/Event.
14530         (MethodData.GetMethodFlags): Moved here from MemberBase.
14531         (MethodData.ApplyAttributes): Likewise.
14532         (MethodData.ApplyObsoleteAttribute): Likewise.
14533         (MethodData.ApplyConditionalAttribute): Likewise.
14534         (MethodData.ApplyDllImportAttribute): Likewise.
14535         (MethodData.CheckAbstractAndExternal): Likewise.
14536         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14537         (MethodData.Emit): Formerly known as Method.Emit().
14538         (MemberBase): Moved everything which was specific to a single
14539         accessor/method to MethodData.
14540         (Method): Create a new MethodData and call Define() and Emit() on it.
14541         (Property, Indexer, Event): Create a new MethodData objects for each
14542         accessor and call Define() and Emit() on them.
14543
14544 2002-07-25  Martin Baulig  <martin@gnome.org>
14545
14546         Made MethodCore derive from MemberBase to reuse the code from there.
14547         MemberBase now also checks for attributes.
14548
14549         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14550         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14551         as virtual.
14552         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14553         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14554         (MemberBase.ApplyAttributes): New virtual method; applies the
14555         attributes to a method or accessor.
14556         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14557         (MemberBase.ApplyConditionalAttribute): Likewise.
14558         (MemberBase.ApplyDllImportAttribute): Likewise.
14559         (MemberBase.CheckAbstractAndExternal): Likewise.
14560         (MethodCore.ParameterTypes): This is now a property instead of a
14561         method, it's initialized from DoDefineParameters().
14562         (MethodCore.ParameterInfo): Removed the set accessor.
14563         (MethodCore.DoDefineParameters): New protected virtual method to
14564         initialize ParameterTypes and ParameterInfo.
14565         (Method.GetReturnType): We can now simply return the MemberType.
14566         (Method.GetMethodFlags): Override the MemberBase version and add
14567         the conditional flags.
14568         (Method.CheckBase): Moved some code from Define() here, call
14569         DoDefineParameters() here.
14570         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14571         here to avoid some larger code duplication.
14572         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14573         ensure that abstract and external accessors don't declare a body.
14574
14575         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14576         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14577         lookup in the attribute's parent classes, so we need to abort as soon
14578         as we found the first match.
14579         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14580         the attribute has no arguments.
14581
14582         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14583         of a Method.
14584
14585 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14586
14587         * cs-parser.jay: reverted previous patch.
14588
14589 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14590
14591         * cs-parser.jay: fixed bug #22119.
14592
14593 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14594
14595         * attribute.cs: fixed compilation. The error was:
14596         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14597         be assigned to before control leaves the current method."
14598         [FIXME:  Filed as bug #28186: MCS must report this error.]
14599
14600 2002-07-25  Martin Baulig  <martin@gnome.org>
14601
14602         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14603         method to pull the condition name ouf of a Conditional attribute.
14604         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14605         the obsolete message and error flag out of an Obsolete attribute.
14606
14607         * class.cs (Method.GetMethodFlags): New public method to get the
14608         TypeManager.MethodFlags for this method.
14609         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14610         private methods.
14611         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14612         if we're overriding a virtual function, set the new private variable
14613         `parent_method'; call the new TypeManager.AddMethod().
14614
14615         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14616         the MethodBuilder and the Method in a PtrHashtable.
14617         (TypeManager.builder_to_method): Added for this purpose.
14618         (TypeManager.MethodFlags): Added IsObsoleteError.
14619         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14620         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14621         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14622         the message from the attribute.
14623
14624 2002-07-24  Martin Baulig  <martin@gnome.org>
14625
14626         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14627         preprocessor directives, ensure that the argument to #define/#undef is
14628         exactly one identifier and that it's actually an identifier.
14629
14630         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14631         did not work ....
14632
14633 2002-07-24  Martin Baulig  <martin@gnome.org>
14634
14635         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14636         initialize it to TypeManager.object_type in the constructor.
14637         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14638         of the `hm.get_current' method if we're using the collection pattern.
14639         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14640         for the explicit conversion to make it work when we're using the collection
14641         pattern and the `Current' property has a different return type than `object'.
14642         Fixes #27713.
14643
14644 2002-07-24  Martin Baulig  <martin@gnome.org>
14645
14646         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14647         does not match, but don't report any errors.  This method is called in
14648         order for all methods in a MethodGroupExpr until a matching method is
14649         found, so we don't want to bail out if the first method doesn't match.
14650         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14651         matches, report the 123.  Fixes #28070.
14652
14653 2002-07-24  Martin Baulig  <martin@gnome.org>
14654
14655         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14656         TypeManager.TypeToCoreType() to the top of the method so the
14657         following equality checks will work.  Fixes #28107.
14658
14659 2002-07-24  Martin Baulig  <martin@gnome.org>
14660
14661         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14662         operand is of type uint, and the other operand is of type sbyte,
14663         short or int, the operands are converted to type long." -
14664         Actually do what this comment already told us.  Fixes bug #28106,
14665         added test-150.cs.
14666
14667 2002-07-24  Martin Baulig  <martin@gnome.org>
14668
14669         * class.cs (MethodBase): New abstract class.  This is now a base
14670         class for Property, Indexer and Event to avoid some code duplication
14671         in their Define() and DefineMethods() methods.
14672         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14673         generic methods for Define() and DefineMethods().
14674         (FieldBase): Derive from MemberBase, not MemberCore.
14675         (Property): Derive from MemberBase, not MemberCore.
14676         (Property.DefineMethod): Moved all the code from this method to the
14677         new MethodBase.DefineAccessor(), just call it with appropriate
14678         argumetnts.
14679         (Property.Define): Call the new Property.DoDefine(), this does some
14680         sanity checks and we don't need to duplicate the code everywhere.
14681         (Event): Derive from MemberBase, not MemberCore.
14682         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14683         accessors, this will also make them work with interface events.
14684         (Indexer): Derive from MemberBase, not MemberCore.
14685         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14686         (Indexer.Define): Use the new MethodBase functions.
14687
14688         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14689         argument to the constructor.
14690         (Interface.FindMembers): Added support for interface events.
14691         (Interface.PopluateEvent): Implemented.
14692
14693         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14694
14695 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14696
14697         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14698         but this is required to check for a method name being the same as
14699         the containing class.  
14700
14701         Handle this now.
14702
14703 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14704
14705         * interface.cs: initialize variable.
14706
14707 2002-07-23  Martin Baulig  <martin@gnome.org>
14708
14709         Implemented the IndexerName attribute in interfaces.
14710
14711         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14712         name if this is an explicit interface implementation.
14713         (Indexer.InterfaceIndexerName): New public variable.  If we're
14714         implementing an interface indexer, this is the IndexerName in that
14715         interface.  Otherwise, it's the IndexerName.
14716         (Indexer.DefineMethod): If we're implementing interface indexer,
14717         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14718         and Pending.ImplementIndexer methods.
14719         (Indexer.Define): Also define the PropertyBuilder if we're
14720         implementing an interface indexer and this is neither an explicit
14721         interface implementation nor do the IndexerName match the one in
14722         the interface.
14723
14724         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14725         If a method is defined here, then we always need to create a proxy
14726         for it.  This is used when implementing interface indexers.
14727         (Pending.IsInterfaceIndexer): New public method.
14728         (Pending.ImplementIndexer): New public method.
14729         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14730         This is used when implementing interface indexers to define a proxy
14731         if necessary.
14732         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14733         define a proxy if necessary.
14734
14735         * interface.cs (Interface.IndexerName): New public variable.
14736         (Interface.PopulateIndexer): Set the IndexerName.
14737         (Interface.DefineIndexers): New private method.  Populate all the
14738         indexers and make sure their IndexerNames match.
14739
14740         * typemanager.cs (IndexerPropertyName): Added support for interface
14741         indexers.
14742
14743 2002-07-22  Martin Baulig  <martin@gnome.org>
14744
14745         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14746         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14747         ret if HasReturnLabel.
14748         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14749         variables.
14750
14751         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14752         and set the ec.LoopBeginTryCatchLevel.
14753         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14754         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14755         the current ec.TryCatchLevel, the branch goes out of an exception
14756         block.  In this case, we need to use Leave and not Br.
14757
14758 2002-07-22  Martin Baulig  <martin@gnome.org>
14759
14760         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14761         block unless the block does not always return or it is contained in
14762         another try { ... } catch { ... } block.  Fixes bug #26506.
14763         Added verify-1.cs to the test suite.
14764
14765 2002-07-22  Martin Baulig  <martin@gnome.org>
14766
14767         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14768         then we do not always return.  Fixes bug #24985.
14769
14770 2002-07-22  Martin Baulig  <martin@gnome.org>
14771
14772         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14773         lookup on a per-class level; ie. walk up the class hierarchy until we
14774         found at least one applicable method, then choose the best among them.
14775         Fixes bug #24463 and test-29.cs.
14776
14777 2002-07-22  Martin Baulig  <martin@gnome.org>
14778
14779         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14780         return types of the methods.  The return type is not part of the
14781         signature and we must not check it to make the `new' modifier work.
14782         Fixes bug #27999, also added test-147.cs.
14783         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14784
14785         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14786         on the method's return type.
14787
14788 2002-07-21  Martin Baulig  <martin@gnome.org>
14789
14790         * assign.cs: Make this work if the rightmost source is a constant and
14791         we need to do an implicit type conversion.  Also adding a few more tests
14792         to test-38.cs which should have caught this.
14793
14794         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14795         target in the makefile for this.  The makefile.gnu is primarily intended
14796         for end-users who don't want to debug the compiler.
14797
14798 2002-07-21  Martin Baulig  <martin@gnome.org>
14799
14800         * assign.cs: Improved the Assign class so it can now handle embedded
14801         assignments (X = Y = Z = something).  As a side-effect this'll now also
14802         consume less local variables.  test-38.cs now passes with MCS, added
14803         a few new test cases to that test.
14804
14805 2002-07-20  Martin Baulig  <martin@gnome.org>
14806
14807         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14808         instructions.  Fixes bug #27977, also added test-146.cs.
14809
14810 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14811
14812         * cs-tokenizer.cs: fixed getHex ().
14813
14814 2002-07-19  Martin Baulig  <martin@gnome.org>
14815
14816         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14817         not Type.GetType() to lookup the array type.  This is needed when
14818         we're constructing an array of a user-defined type.
14819         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14820         single-dimensional arrays, but also for single-dimensial arrays of
14821         type decimal.
14822
14823 2002-07-19  Martin Baulig  <martin@gnome.org>
14824
14825         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14826         this function is called, it's not allowed to share LocalBuilders
14827         among ILGenerators.
14828
14829 2002-07-19  Martin Baulig  <martin@gnome.org>
14830
14831         * expression.cs (Argument.Resolve): Report an error 118 when trying
14832         to pass a type as argument.
14833
14834 2002-07-18  Martin Baulig  <martin@gnome.org>
14835
14836         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14837         Conv_R_Un for the signed `long' type.
14838
14839 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14842         `expr' for the temporary result, as that will fail if we do
14843         multiple resolves on the same expression.
14844
14845 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14846
14847         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14848         ec.TypeContainer for looking up aliases. 
14849
14850         * class.cs (TypeContainer): Remove LookupAlias from here.
14851
14852         * decl.cs (DeclSpace); Move here.
14853
14854 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * class.cs (FindMembers): Only call filter if the constructor
14857         bulider is not null.
14858
14859         Also handle delegates in `NestedTypes' now.  Now we will perform
14860         type lookups using the standard resolution process.  This also
14861         fixes a bug.
14862
14863         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14864         This uses Expressions (the limited kind that can be parsed by the
14865         tree) instead of strings.
14866
14867         * expression.cs (ComposedCast.ToString): Implement, used to flag
14868         errors since now we have to render expressions.
14869
14870         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14871         FormArrayType. 
14872
14873         * ecore.cs (SimpleName.ToString): ditto.
14874
14875         * cs-parser.jay: Instead of using strings to assemble types, use
14876         Expressions to assemble the type (using SimpleName, ComposedCast,
14877         MemberAccess).  This should fix the type lookups in declarations,
14878         because we were using a different code path for this.
14879
14880         * statement.cs (Block.Resolve): Continue processing statements
14881         even when there is an error.
14882
14883 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14884
14885         * class.cs (Event.Define): Also remove the `remove' method from
14886         the list of pending items.
14887
14888         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14889         generate more compact code. 
14890
14891 2002-07-17  Martin Baulig  <martin@gnome.org>
14892
14893         * const.cs (Const.LookupConstantValue): Add support for constant
14894         `unchecked' and `checked' expressions.
14895         Also adding test case test-140.cs for this.
14896
14897 2002-07-17  Martin Baulig  <martin@gnome.org>
14898
14899         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14900         check whether mi.ReturnType implements the IEnumerator interface; the
14901         `==' and the IsAssignableFrom() will fail in this situation.
14902
14903 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14904
14905         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14906         here too.
14907
14908 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14909
14910         * expression.cs: fixed bug #27811.
14911
14912 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14913
14914         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14915         Molaro: when we are a ref, the value already contains a pointer
14916         value, do not take the address of it.
14917
14918 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14919         * removed mb-parser.jay and mb-tokenizer.cs
14920
14921 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14922
14923         * expression.cs: check against the building corlib void type.
14924
14925 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14926
14927         * ecore.cs: fix for valuetype static readonly fields: when 
14928         initializing them, we need their address, not the address of a copy.
14929
14930 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14931
14932         * typemanager.cs: register also enum_type in corlib.
14933
14934 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14935
14936         * class.cs: allow calling this (but not base) initializers in structs.
14937
14938 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14939
14940         * ecore.cs: make sure we compare against the building base types
14941         in GetTypeSize ().
14942
14943 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14944
14945         * typemanager.cs: fix TypeToCoreType() to handle void and object
14946         (corlib gets no more typerefs after this change).
14947
14948 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * expression.cs (ArrayCreation.EmitArrayArguments): use
14951         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14952
14953         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14954         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14955         array indexes, the runtime actually forbids them.
14956
14957         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14958         for array arguments here.
14959
14960         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14961         instead of the default for ValueTypes.
14962
14963         (New.DoEmit): Use IsValueType instead of
14964         IsSubclassOf (value_type)
14965         (New.DoResolve): ditto.
14966         (Invocation.EmitCall): ditto.
14967
14968         * assign.cs (Assign): ditto.
14969
14970         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14971         Statements *are* currently doing part of their resolution during
14972         Emit.  
14973
14974         Expressions do always resolve during resolve, but statements are
14975         only required to propagate resolution to their children.
14976
14977 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14978
14979         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14980
14981         (LoadAssembly): Do not add the dll if it is already specified
14982
14983         (MainDriver): Add the System directory to the link path at the end,
14984         after all the other -L arguments. 
14985
14986         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14987         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14988         ldelem.u1) and using the opposite for sbytes.
14989
14990         This fixes Digger, and we can finally run it.
14991
14992         * driver.cs (UnixParseOption): Move the option parsing here.  
14993         (CSCParseOption): Implement CSC-like parsing of options.
14994
14995         We now support both modes of operation, the old Unix way, and the
14996         new CSC-like way.  This should help those who wanted to make cross
14997         platform makefiles.
14998
14999         The only thing broken is that /r:, /reference: and /lib: are not
15000         implemented, because I want to make those have the same semantics
15001         as the CSC compiler has, and kill once and for all the confussion
15002         around this.   Will be doing this tomorrow.
15003
15004         * statement.cs (Unsafe.Resolve): The state is checked during
15005         resolve, not emit, so we have to set the flags for IsUnsfe here.
15006
15007 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15008
15009         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15010         not catch the Error_ObjectRefRequired in SimpleName (as it is
15011         possible to have a class/instance variable name that later gets
15012         deambiguated), we have to check this here.      
15013
15014 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15015
15016         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15017         make static and put into Expression.
15018
15019         (Event.Define): Register the private field of the event with the 
15020         TypeManager so that GetFieldFromEvent can get at it.
15021
15022         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15023         keep track of the private field associated with an event which
15024         has no accessors.
15025
15026         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15027         private field.
15028
15029         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15030
15031 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * expression.cs (Binary.EmitBranchable): this routine emits the
15034         Binary expression in a branchable context.  This basically means:
15035         we need to branch somewhere, not just get the value on the stack.
15036
15037         This works together with Statement.EmitBoolExpression.
15038
15039         * statement.cs (Statement.EmitBoolExpression): Use
15040         EmitBranchable. 
15041
15042 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15043
15044         * statement.cs (For): Reduce the number of jumps in loops.
15045
15046         (For): Implement loop inversion for the For statement.
15047
15048         (Break): We can be breaking out of a Try/Catch controlled section
15049         (foreach might have an implicit try/catch clause), so we need to
15050         use Leave instead of Br.
15051
15052         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15053         now).  If the instace expression supports IMemoryLocation, we use
15054         the AddressOf method from the IMemoryLocation to extract the
15055         address instead of emitting the instance.
15056
15057         This showed up with `This', as we were emitting the instance
15058         always (Emit) instead of the Address of This.  Particularly
15059         interesting when This is a value type, as we dont want the Emit
15060         effect (which was to load the object).
15061
15062 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15065
15066         * statement.cs (Checked): Set the CheckedState during the resolve
15067         process too, as the ConvCast operations track the checked state on
15068         the resolve process, and not emit.
15069
15070         * cs-parser.jay (namespace_member_declaration): Flag that we have
15071         found a declaration when we do.  This is used to flag error 1529
15072
15073         * driver.cs: Report ok when we display the help only.
15074
15075 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15076
15077         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15078
15079 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * cs-tokenizer.cs (define): We also have to track locally the
15082         defines.  AllDefines is just used for the Conditional Attribute,
15083         but we also need the local defines for the current source code. 
15084
15085 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * statement.cs (While, For, Do): These loops can exit through a
15088         Break statement, use this information to tell whether the
15089         statement is the last piece of code.
15090
15091         (Break): Flag that we break.
15092
15093         * codegen.cs (EmitContexts): New `Breaks' state variable.
15094
15095 2002-07-03  Martin Baulig  <martin@gnome.org>
15096
15097         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15098         modifiers in method declarations in structs.  Otherwise, you won't
15099         be able to override things like Object.Equals().
15100
15101 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15102
15103         * class.cs (Method, Property, Indexer): Do not allow the public
15104         modifier to be used in explicit interface implementations.
15105
15106         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15107         override modifiers in method declarations in structs
15108
15109 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15110
15111         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15112         integer or real overflow, report an error
15113
15114 2002-07-02  Martin Baulig  <martin@gnome.org>
15115
15116         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15117         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15118         to tell the runtime about our newly created System.Object and
15119         System.ValueType types.
15120
15121 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15124         struct instead of Ldarg/Starg.
15125
15126 2002-07-02  Martin Baulig  <martin@gnome.org>
15127
15128         * expression.cs (Indirection.Indirection): Call
15129         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15130
15131 2002-07-02  Martin Baulig  <martin@gnome.org>
15132
15133         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15134         ValueType, call TypeManager.TypeToCoreType() on it.
15135         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15136         the OpCodes.Newarr argument.
15137
15138 2002-07-02  Martin Baulig  <martin@gnome.org>
15139
15140         * expression.cs (Invocation.EmitCall): When compiling corlib,
15141         replace all calls to the system's System.Array type to calls to
15142         the newly created one.
15143
15144         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15145         System.Array methods.
15146         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15147         from the system's System.Array type which must be replaced.
15148
15149 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15150
15151         * typemanager.cs: load unverifiable_code_ctor so we can build
15152         corlib using the correct type. Avoid using GetTypeCode() with
15153         TypeBuilders.
15154         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15155         TypeManager.object_type to allow building corlib.
15156
15157 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15158
15159         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15160
15161 2002-07-01  Martin Baulig  <martin@gnome.org>
15162
15163         * class.cs: Make the last change actually work, we need to check
15164         whether `ifaces != null' to avoid a crash.
15165
15166 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15167
15168         * class.cs: when we build structs without fields that implement
15169         interfaces, we need to add the interfaces separately, since there is
15170         no API to both set the size and add the interfaces at type creation
15171         time.
15172
15173 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15174
15175         * expression.cs: the dimension arguments to the array constructors
15176         need to be converted if they are a long.
15177
15178 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15179
15180         * class.cs: don't emit ldarg.0 if there is no parent constructor
15181         (fixes showstopper for corlib).
15182
15183 2002-06-29  Martin Baulig  <martin@gnome.org>
15184
15185         MCS now compiles corlib on GNU/Linux :-)
15186
15187         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15188         ie. check for MethodImplOptions.InternalCall.
15189
15190         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15191         and TypeManager.attribute_type are null, so we must explicitly check
15192         whether parent is not null to find out whether it's an attribute type.
15193         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15194         and SetBuilder, not only if the property is neither abstract nor external.
15195         This is necessary to set the MethodImplOptions on the accessor methods.
15196         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15197         SetBuilder, see Property.Emit().
15198
15199         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15200         populate "System.Object", "System.ValueType" and "System.Attribute" since
15201         they've already been populated from BootCorlib_PopulateCoreTypes().
15202
15203 2002-06-29  Martin Baulig  <martin@gnome.org>
15204
15205         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15206         is the NullLiteral, we also need to make sure that target_type is not
15207         an enum type.   
15208
15209 2002-06-29  Martin Baulig  <martin@gnome.org>
15210
15211         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15212         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15213         before calling BootstrapCorlib_ResolveDelegate ().
15214
15215 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15216
15217         * statement.cs: fixed build-breaker. All tests passed ok.
15218
15219 2002-06-27  Martin Baulig  <martin@gnome.org>
15220
15221         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15222         for System.Decimal when compiling corlib.
15223
15224 2002-06-27  Martin Baulig  <martin@gnome.org>
15225
15226         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15227         switch blocks which contain nothing but a default clause.
15228
15229 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15230
15231        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15232
15233 2002-06-27  Martin Baulig  <martin@gnome.org>
15234
15235         * ecore.cs (PropertyExpr.PropertyExpr): Call
15236         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15237
15238         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15239         is already a TypeBuilder.
15240
15241 2002-06-27  Martin Baulig  <martin@gnome.org>
15242
15243         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15244         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15245         the "from an array-type to System.Array" case.  This makes it work
15246         when compiling corlib.
15247
15248 2002-06-27  Martin Baulig  <martin@gnome.org>
15249
15250         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15251         non-static PropertyExpr, set its InstanceExpression.  This makes
15252         the `ICollection.Count' property work in System/Array.cs.
15253
15254 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15255
15256         * driver.cs: Made error handling more consistent.  Errors now
15257         tracked by Report class, so many methods which used to return int
15258         now return void.  Main() now prints success/failure and 
15259         errors/warnings message.
15260
15261         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15262         the magic number return values (123 and 124).  Now, if the
15263         expected error occurs, the compiler exits with success (exit value
15264         0).  If the compilation completes without seeing that particular
15265         error, the compiler exits with failure (exit value 1).  The
15266         makefile in mcs/errors has been changed to handle the new behaviour.
15267
15268         * report.cs: Made 'expected error' number a property and renamed
15269         it from 'Probe' to 'ExpectedError'.
15270
15271         * genericparser.cs: Removed error handling support, since it is
15272         now all done by Report class.
15273
15274         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15275         class, so parse() no longer returns an int.
15276
15277         * namespace.cs: Use Report.Error instead of GenericParser.error
15278
15279 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15282         TypeContainer.AddOperator): At the front of the list put the
15283         explicit implementations, so they get resolved/defined first. 
15284
15285 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15286
15287         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15288         interface type is implemented by this TypeContainer.  Used during
15289         explicit interface implementation.
15290
15291         (Property.Define, Indexer.Define, Method.Define): Validate that
15292         the given interface in the explicit implementation is one of the
15293         base classes for the containing type.
15294
15295         Also if we are explicitly implementing an interface, but there is
15296         no match in the pending implementation table, report an error.
15297
15298         (Property.Define): Only define the property if we are
15299         not explicitly implementing a property from an interface.  Use the
15300         correct name also for those properties (the same CSC uses,
15301         although that is really not needed).
15302
15303         (Property.Emit): Do not emit attributes for explicitly implemented
15304         properties, as there is no TypeBuilder.
15305
15306         (Indexer.Emit): ditto.
15307
15308         Hiding then means that we do not really *implement* a pending
15309         implementation, which makes code fail.
15310
15311 2002-06-22  Martin Baulig  <martin@gnome.org>
15312
15313         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15314         the return value of Object.GetType().  [FIXME: we need to do this whenever
15315         we get a type back from the reflection library].
15316
15317 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15318
15319         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15320
15321 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15322
15323         * attribute.cs: Return null if we can not look up the type.
15324
15325         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15326         the interface types found.
15327
15328         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15329         interface types found.
15330
15331         * typemanager.cs (GetInterfaces): Make this routine returns alll
15332         the interfaces and work around the lame differences between
15333         System.Type and System.Reflection.Emit.TypeBuilder in the results
15334         result for GetInterfaces.
15335
15336         (ExpandInterfaces): Given an array of interface types, expand and
15337         eliminate repeated ocurrences of an interface.  This expands in
15338         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15339         be IA, IB, IC.
15340
15341 2002-06-21  Martin Baulig  <martin@gnome.org>
15342
15343         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15344         on System.Enum.
15345
15346 2002-06-21  Martin Baulig  <martin@gnome.org>
15347
15348         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15349         and called with one of the core types, return the corresponding typebuilder for
15350         that type.
15351
15352         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15353         element type.
15354
15355 2002-06-21  Martin Baulig  <martin@gnome.org>
15356
15357         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15358         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15359         (Expression.ConvertReferenceExplicit): Likewise.
15360
15361         * expression.cs (ElementAccess.DoResolve): Likewise.
15362         (ElementAccess.DoResolveLValue): Likewise.
15363
15364 2002-06-10  Martin Baulig  <martin@gnome.org>
15365
15366         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15367         add the "value" parameter to the parameter list.
15368
15369         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15370         to our caller.
15371
15372 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15375         the argument to an int, uint, long or ulong, per the spec.  Also
15376         catch negative constants in array creation.
15377
15378 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15379
15380         * class.cs: do not allow the same interface to appear twice in
15381         the definition list.
15382
15383 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15384
15385         * ecore.cs: don't use ldlen with System.Array.
15386
15387 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15388
15389         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15390
15391 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15392
15393         * modifiers.cs: produce correct field attributes for protected
15394         internal. Easy fix so miguel can work on ther harder stuff:-)
15395
15396 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * pending.cs: New file.  Move the code from class.cs here.
15399         Support clearning the pending flag for all methods (when not doing
15400         explicit interface implementation).
15401
15402 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15403
15404         * rootcontext.cs: added a couple more types needed to bootstrap.
15405
15406 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15409         constructor in the type, instead of any constructor in the type
15410         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15411         a bug in the Mono runtime when applying the params attribute). 
15412
15413 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15414         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15415
15416 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15417
15418         * expression.cs (Unary.ResolveOperator): Use TypeManager
15419         to resolve the type.
15420
15421 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15422
15423         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15424         attached.
15425
15426         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15427         with each member too.
15428
15429         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15430         field builders too - this takes care of the enum member case.
15431
15432 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15433
15434         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15435         address-of operator on both value types and pointers.
15436
15437 2002-06-10  Martin Baulig  <martin@gnome.org>
15438
15439         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15440         PropertyBuilder to the `property_builders' list.
15441
15442         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15443         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15444         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15445         find any indexers which are inherited from an interface.
15446
15447 2002-06-09  Martin Baulig  <martin@gnome.org>
15448
15449         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15450         the same type as the constant if necessary.  There's also a test-130.cs
15451         for this.
15452
15453         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15454
15455         * typemanager.cs (TypeManager.ChangeType): Previously known as
15456         Enum.ChangeEnumType().
15457
15458 2002-06-09  Martin Baulig  <martin@gnome.org>
15459
15460         * expression.cs (Cast.TryReduce): Added support for consts.
15461
15462 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15463
15464         * class.cs (Accessor): Hold attributes information so we can pass
15465         it along.
15466
15467         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15468         Modify to pass in attributes attached to the methods.
15469
15470         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15471
15472         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15473         to handle the Accessor kind :-)
15474
15475         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15476
15477 2002-06-08  Martin Baulig  <martin@gnome.org>
15478
15479         * expression.cs (Unary.TryReduceNegative): Added support for
15480         ULongConstants.
15481
15482 2002-06-08  Martin Baulig  <martin@gnome.org>
15483
15484         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15485         name can't be found in the `defined_names' - the caller will do a
15486         MemberLookup in this case and thus find methods in System.Enum
15487         such as Enum.IsDefined().
15488
15489 2002-06-08  Martin Baulig  <martin@gnome.org>
15490
15491         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15492         Convert.ChangeType() which works with TypeBuilder created types.
15493         (Enum.LookupEnumValue, Enum.Define): Use it here.
15494
15495         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15496         `TypeBuilder.BaseType != null' check.
15497         (TypeContainer.FindMembers): Only lookup parent members if we
15498         actually have a parent.
15499         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15500         (ConstructorInitializer.Resolve): Likewise.
15501
15502         * interface.cs (Interface.FindMembers): Added
15503         `TypeBuilder.BaseType != null' check.
15504
15505         * rootcontext.cs (RootContext.ResolveCore): Added
15506         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15507         classes_second_stage.
15508
15509         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15510         debug_type and trace_type when compiling with --nostdlib.       
15511
15512 2002-06-07  Martin Baulig  <martin@gnome.org>
15513
15514         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15515         (AddField): Set it to true when adding a non-static field.
15516         (DefineType): Use `have_nonstatic_fields' to find out whether we
15517         have non-static fields, not `Fields != null'.
15518
15519 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15520
15521         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15522         dereferencing a null on the static-field code path)
15523
15524 2002-05-30  Martin Baulig  <martin@gnome.org>
15525
15526         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15527         to take command line arguments.  Use reflection to call the new
15528         custom `Initialize' function on the symbol writer and pass it the
15529         command line arguments.
15530
15531         * driver.cs (--debug-args): New command line argument to pass command
15532         line arguments to the symbol writer.
15533
15534 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15537         the target type for indexers and properties.  Thanks to Joe for
15538         catching this.
15539
15540 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * typemanager.cs (MethodFlags): returns the method flags
15543         (Obsolete/ShouldIgnore) that control warning emission and whether
15544         the invocation should be made, or ignored. 
15545
15546         * expression.cs (Invocation.Emit): Remove previous hack, we should
15547         not do this on matching a base type, we should do this based on an attribute
15548
15549         Only emit calls to System.Diagnostics.Debug and
15550         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15551         on the command line.
15552
15553         * rootcontext.cs: Global settings for tracing and debugging.
15554
15555         * cs-tokenizer.cs (define): New utility function to track
15556         defines.   Set the global settings for TRACE and DEBUG if found.
15557
15558 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15559
15560         * interface.cs (Populate*): Pass in the TypeContainer as well as
15561         the DeclSpace as parameters so that we can create EmitContexts and
15562         then use that to apply attributes etc.
15563
15564         (PopulateMethod, PopulateEvent, PopulateProperty)
15565         (PopulateIndexer): Apply attributes everywhere.
15566
15567         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15568         etc.
15569
15570         (ApplyAttributes): Update accordingly.
15571
15572         We now apply interface attributes for all members too.
15573
15574 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15575
15576         * class.cs (Indexer.Define); Correctly check if we are explicit
15577         implementation (instead of checking the Name for a ".", we
15578         directly look up if the InterfaceType was specified).
15579
15580         Delay the creation of the PropertyBuilder.
15581
15582         Only create the PropertyBuilder if we are not an explicit
15583         interface implementation.   This means that explicit interface
15584         implementation members do not participate in regular function
15585         lookups, and hence fixes another major ambiguity problem in
15586         overload resolution (that was the visible effect).
15587
15588         (DefineMethod): Return whether we are doing an interface
15589         implementation. 
15590
15591         * typemanager.cs: Temporary hack until we get attributes in
15592         interfaces (Ravi is working on that) and we get IndexerName
15593         support in interfaces.
15594
15595         * interface.cs: Register the indexers as properties.
15596
15597         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15598         warning, I have verified that this is a bug in the .NET runtime
15599         (JavaScript suffers of the same problem).
15600
15601         * typemanager.cs (MemberLookup): When looking up members for
15602         interfaces, the parent of an interface is the implicit
15603         System.Object (so we succeed in searches of Object methods in an
15604         interface method invocation.  Example:  IEnumerable x;  x.ToString
15605         ()) 
15606
15607 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15608
15609         * class.cs (Event): Events should also register if they do
15610         implement the methods that an interface requires.
15611
15612         * typemanager.cs (MemberLookup); use the new GetInterfaces
15613         method. 
15614
15615         (GetInterfaces): The code used to lookup interfaces for a type is
15616         used in more than one place, factor it here. 
15617
15618         * driver.cs: Track the errors at the bottom of the file, we kept
15619         on going.
15620
15621         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15622         instance if the method we are calling is static!
15623
15624 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15625
15626         * attribute.cs (ApplyAttributes): Make this function filter out
15627         the IndexerName attribute (as that attribute in reality is never
15628         applied) and return the string constant for the IndexerName
15629         attribute. 
15630
15631         * class.cs (TypeContainer.Emit): Validate that all the indexers
15632         have the same IndexerName attribute, and if so, set the
15633         DefaultName attribute on the class. 
15634
15635         * typemanager.cs: The return value might contain other stuff (not
15636         only methods).  For instance, consider a method with an "Item"
15637         property and an Item method.
15638
15639         * class.cs: If there is a problem with the parameter types,
15640         return. 
15641
15642 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15643
15644         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15645         looks at user defined conversion after making a call to 
15646         StandardConversionExists - we need this for overload resolution.
15647
15648         * expression.cs : Update accordingly the various method calls.
15649
15650         This fixes 2 bugs filed against implicit user defined conversions 
15651
15652 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15653
15654         * statement.cs: Track the result of the assignment.
15655
15656 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15657
15658         * expression.cs (MemberAccess): Improved error reporting for
15659         inaccessible members.
15660
15661 2002-05-22  Martin Baulig  <martin@gnome.org>
15662
15663         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15664         itself with debugging support.
15665
15666 2002-05-22  Martin Baulig  <martin@gnome.org>
15667
15668         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15669         Removed, this isn't needed anymore.
15670
15671 2002-05-20  Martin Baulig  <martin@gnome.org>
15672
15673         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15674         be underlying type for an enum.
15675
15676 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15677
15678         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15679         that splits out the loading of just the core types.
15680
15681         * rootcontext.cs (ResolveCore): Split the struct resolution in
15682         two, so we can load the enumeration underlying types before any
15683         enums are used.
15684
15685         * expression.cs (Is): Bandaid until we fix properly Switch (see
15686         bug #24985 for details).
15687
15688         * typemanager.cs (ImplementsInterface): The hashtable will contain
15689         a null if there are no interfaces implemented.
15690
15691 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * cs-parser.jay (indexer_declarator): It is fine to have array
15694         parameters
15695
15696 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15697
15698         * typemanager.cs: (RegisterBuilder): New function used to register
15699         TypeBuilders that implement interfaces.  Since
15700         TypeBuilder.GetInterfaces (as usual) does not work with lame
15701         Reflection.Emit. 
15702         (AddUserType): register interfaces.
15703
15704         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15705         dealing with TypeBuilder.  Also, arrays are showing up as
15706         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15707         methods can not be invoked on them!
15708
15709         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15710         (ImplicitReferenceConversionExists): Split out from
15711         StandardConversionExists. 
15712
15713         * expression.cs (As): We were only implementing one of the three
15714         cases for the as operator.  We now implement them all.
15715         (Is): Implement the various other cases for Is as well.
15716
15717         * typemanager.cs (CACHE): New define used to control if we want or
15718         not the FindMembers cache.  Seems to have a negative impact on
15719         performance currently
15720
15721         (MemberLookup): Nested types have full acess to
15722         enclosing type members
15723
15724         Remove code that coped with instance/static returns for events, we
15725         now catch this in RealFindMembers.
15726
15727         (RealFindMembers): only perform static lookup if the instance
15728         lookup did not return a type or an event.  
15729
15730 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15731
15732         * assign.cs (CompoundAssign): We pass more semantic information
15733         now to Compound Assignments than we did before: now we have all
15734         the information at hand, and now we resolve the target *before* we
15735         do the expression expansion, which allows the "CacheValue" method
15736         to have the effect we intended (before, a [x] += 1 would generate
15737         two differen ArrayAccess expressions from the ElementAccess,
15738         during the resolution process).
15739
15740         (CompoundAssign.DoResolve): Resolve target and original_source here.
15741
15742 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15743
15744         * expression.cs (ArrayAccess): dropped debugging information. 
15745
15746         * typemanager.cs: Small bug fix: I was always returning i_members,
15747         instead of one of i_members or s_members (depending on which had
15748         the content).
15749
15750         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15751         method is invoked before any code generation takes place, and it
15752         is a mechanism to inform that the expression will be invoked more
15753         than once, and that the method should use temporary values to
15754         avoid having side effects
15755
15756         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15757
15758         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15759         implementation.
15760
15761         * expression.cs (Indirection, ArrayAccess): Add support for
15762         CacheTemporaries in these two bad boys. 
15763
15764         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15765         ldobj or ldind_ref.  
15766         (StoreFromPtr): Handle stobj as well.
15767
15768         * expression.cs (UnaryMutator): Share more code.
15769
15770         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15771         down: I was not tracking the Filter function as well, which
15772         was affecting the results of the cache.
15773
15774 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15775
15776         * attribute.cs: Remove the hack to handle the CharSet property on
15777         StructLayouts. 
15778
15779 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15780
15781         * attribute.cs (DoResolve): More uglyness, we now only try to
15782         resolve the attribute partially, to extract the CharSet
15783         information (only if we are a StructLayout attribute).  Otherwise 
15784
15785         (GetExtraTypeInfo): Add some code to conditionally kill in the
15786         future this.   I am more and more convinced that the .NET
15787         framework has special code to handle the attribute setting on
15788         certain elements.
15789
15790         * expression.cs (IsParamsMethodApplicable): Revert my previous
15791         foreach change here, it was wrong.
15792
15793 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15796         (pp_expr): do not abort on unknown input, just return.
15797         (eval): abort if there are pending chars.
15798
15799         * attribute.cs (Attribute.Resolve): Positional parameters are
15800         optional.  Deal with that case.
15801
15802         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15803         the Ansi/Unicode/Auto information for the type.
15804
15805         (TypeContainer.DefineType): instantiate the EmitContext here, as
15806         we will be using it during the type definition (to resolve
15807         attributes) and during the emit phase.
15808
15809         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15810         to pull type information out of the attributes
15811
15812         (Attribute.Resolve): track the constructor builder, and allow for
15813         multiple invocations (structs and classes will use this).
15814
15815         * ecore.cs (MemberLookupFinal): new version with all the
15816         parameters customizable.
15817
15818         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15819         constructors.  Return if the result value is null (as the error
15820         would have been flagged already by MemberLookupFinal)
15821
15822         Do not allow instances of abstract classes or interfaces to be
15823         created.
15824
15825         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15826         We have to compare the assembly property here when dealing with
15827         FamANDAssem and Assembly access modifiers, because we might be
15828         creating an assembly from *modules* (that means that we are not
15829         getting TypeBuilders for types defined in other modules that are
15830         part of this assembly).
15831
15832         (Method.Emit): If the method is marked abstract and has a body,
15833         emit an error. 
15834
15835         (TypeContainer.DefineMembers): If both the defined member and the
15836         parent name match are methods, then do not emit any warnings: let
15837         the Method.Define routine take care of flagging warnings.  But if
15838         there is a mismatch (method overrides something else, or method is
15839         overriwritten by something, then emit warning).
15840
15841         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15842         set to null, this means `do not check for the return type on the
15843         signature'. 
15844
15845         (Method.Define): set the return type for the method signature to
15846         null, so that we get methods with the same name and parameters and
15847         different return types.  This is used to flag warning 114 (you are
15848         hiding a method, and you probably want to use the new/override
15849         keywords instead).
15850
15851         * typemanager.cs (MemberLookup): Implemented proper access
15852         control, closing a long standing set of bug reports.  The problem
15853         was that the Framework only has two bits: Public and NonPublic,
15854         and NonPublic includes private and protected methods, but we need
15855         to enforce the FamANDAssem, FamOrAssem and Family. 
15856
15857 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15858
15859         * statement.cs (GotoCase): Return true: Ammounts to giving up
15860         knowledge on whether we return or not, and letting the other case
15861         be responsible for it.
15862
15863 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15864
15865         * driver.cs: Do not load directories for each file processed, only
15866         do it if there is a pattern.
15867
15868         * ecore.cs: Report readonly assigns here as well, as we might have
15869         been resolved only by MemberAccess.
15870
15871         (SimpleName.SimpleNameResolve): Also be useful for LValue
15872         resolution.   We need this to propagate assign to local readonly variables
15873
15874         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15875         do not want to reuse potential criteria memory.
15876
15877         * class.cs (MyEventBuilder): Set reflected_type;
15878
15879         * ecore.cs (Constantify): Added support for constifying bools.
15880
15881         (RootContext.LookupType): Added a cache for values looked up in
15882         the declaration space.
15883
15884         * typemanager.cs (FindMembers): Now is a front-end to
15885         RealFindMembers, and provides a two-level hashtable-based cache to
15886         the request.  
15887
15888         15% performance improvement: from 22.5 to 19.2 seconds.
15889
15890         * expression.cs (IsParamsMethodApplicable): use foreach.
15891         (Invocation.DoResolve): ditto.
15892         (New.DoResolve): ditto.
15893         (ArrayCreation.DoResolve): ditto.
15894
15895         * ecore.cs (FindMostEncompassingType): use foreach.
15896
15897         * delegate.cs (NewDelegate.DoResolve): Use foreach
15898
15899         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15900         (RemoveMethods): use foreach.
15901
15902         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15903         nested foreach statements instead of for, and also break out of
15904         the inner loop once a match is found.
15905
15906         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15907
15908 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15909
15910         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15911         we actually unwrap the expression to allow for extra information
15912         to be extracted. 
15913
15914         * expression.cs: Use Shr_Un on unsigned operations. 
15915
15916 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15917
15918         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15919         applicable operators was not being considered correctly. This closes
15920         the bug Miguel reported.
15921
15922 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15923
15924         * attribute.cs: check that the type derives from System.Attribute
15925         and report the correct error in that case (moved the duplicate code to
15926         its own method, too).
15927
15928 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15929
15930         * attribute.cs: lookup attribute type name as the spec says: first the
15931         bare attribute name and then name + "Attribute" (nant compiles with
15932         mcs after this fix).
15933
15934 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15935
15936         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15937         Because of the way we parse things, we should try to see if a
15938         UIntConstant can fit in an integer.
15939
15940 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15941
15942         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15943         when we are in an explicit context.
15944
15945         (ConvertReferenceExplicit): When converting from Iface type S to Class
15946         T make sure the rules are implemented as an OR.
15947
15948         * parameter.cs (ParameterType): Make it a property for now although the
15949         purpose really isn't anything immediate.
15950
15951         * expression.cs (Is*Applicable): Do better checking on the parameter type
15952         of a ref/out parameter. The ones from the system assemblies are already 
15953         marked with the correct type so we don't need to do any correction.
15954
15955         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15956         the object type is standard too so include that.
15957
15958 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * ecore.cs (StandardConversionExists): Augment with missing code:
15961         deal with IntConstant, LongConstants and Enumerations.
15962
15963         * assign.cs: Report the error, instead of failing silently
15964
15965         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15966         typecontainer that they are declared, because the
15967         typecontainer/namespace will have the list of using clauses that
15968         need to be applied.
15969
15970         Assembly Attributes were escaping the normal registration
15971         mechanism. 
15972
15973         (EmitCode): Apply attributes within an EmitContext that represents
15974         the container they were declared on.
15975
15976         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15977
15978 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15979
15980         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15981         Revamp completely - make much cleaner as we now operate only
15982         on a set of Types.
15983
15984         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15985         to implement the logic detailed in the spec more correctly.
15986
15987         (UserDefinedConversion): Update accordingly.
15988
15989 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * statement.cs: Return flow analysis information up.
15992
15993         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15994         and the default.
15995
15996         (token): Do not consume an extra character before calling
15997         decimal_digits.
15998
15999 2002-05-06  Piers Haken <piersh@friskit.com>
16000
16001         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16002
16003 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16004
16005         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16006         EmitContext during the instance constructor initializer
16007         resolution, to stop access to instance variables.
16008
16009         This is mandated by the spec, last paragraph of the `constructor
16010         initializers' section. 
16011
16012 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * cs-parser.jay, class.cs (Accessor): new class used to represent
16015         an accessor (get or set).  In the past we used `null' to represent
16016         a missing accessor.  But this is ambiguous because there was no
16017         way to tell in abstract indexers/properties if one of them was
16018         specified.
16019
16020         Now there is a way of addressing that.
16021
16022         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16023         instead of FindMembers.
16024
16025         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16026         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16027
16028         * attribute.cs: Treat indexers and properties as the same in terms
16029         of applying attributes
16030
16031         * ecore.cs (FindMostEncompassedType): Use statically initialized
16032         EmptyExpressions()s like we do elsewhere to avoid creating useless
16033         objects (and we take this out of the tight loop).
16034
16035         (GetConversionOperators): Move the code to extract the actual
16036         operators to a separate routine to clean things up.
16037
16038 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16039
16040         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16041         events are always registered FieldBuilders.
16042
16043         * class.cs (FieldBase): New class shared by Fields 
16044
16045         * delegate.cs: If we are a toplevel delegate, use our full name.
16046         If we are a nested delegate, then only use our tail name.
16047
16048 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16049
16050         * expression.cs (IsApplicable): Ensure that we add the "&" to
16051         ref/out types before comparing it with the type of the argument.
16052
16053         (IsParamsMethodApplicable): Ditto.
16054
16055         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16056         silly me ;-)
16057
16058         * delegate.cs : Handle the case when we have more than one applicable
16059         method. Flag an error only when we finish checking all.
16060
16061 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16062
16063         * expression.cs: Add support for boolean static initializers.
16064
16065 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16068
16069         * parameter.cs (ComputeParameterTypes,
16070         ComputeAndDefineParameterTypes): Better error handling: now we
16071         clear the `types' cache if we fail during any of the type lookups.
16072         We also return the status code correctly to our caller
16073
16074         * delegate.cs: If we fail to define a delegate, abort the extra
16075         steps. 
16076
16077         * expression.cs (Binary.ResolveOperator): for
16078         operator==(object,object) and operator !=(object, object) we also
16079         have to verify that there is an implicit conversion from one to
16080         the other.
16081
16082         (ArrayAccess.DoResolve): Array Access can operate on
16083         non-variables. 
16084
16085 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * assign.cs (CompoundAssign): A new class used as a "flag" that
16088         the assignment actually is happening as part of a compound
16089         assignment operator.
16090
16091         During compound assignment, a few new rules exist to enable things
16092         like:
16093
16094         byte b |= 1 + 2
16095
16096         From the spec:
16097
16098         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16099         to the type of x) if y is implicitly convertible to the type of x,
16100         and the operator is a builtin operator and the return type of the
16101         operator is explicitly convertible to the type of x. 
16102
16103         * rootcontext.cs: Reset warning level to 2.  4 catches various
16104         "interesting" features in mcs, we must clean this up at some
16105         point, but currently am trying to kill other bugs ;-)
16106
16107         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16108         in container classes as well.  
16109
16110         * expression.cs (Binary.ResolveOperator): Handle string case
16111         before anything else (as operator overloading does emit an error
16112         before doing anything else).
16113
16114         This code could go away when we move to a table driven model, but
16115         i could not come up with a good plan last night.
16116
16117 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16118
16119         * typemanager.cs (CSharpName): reimplementation using regex.
16120         * class.cs: added null check for fields in Emit
16121         * rootcontext.cs: set warninglevel to 4
16122
16123 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * typemanager.cs (CSharpName): reimplemented with Lupus
16126         suggestion.
16127
16128 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16129
16130         * statement.cs (If): correclty implement Resolve, because we were
16131         not catching sem errors in there.  The same process is needed
16132         everywhere else. 
16133         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16134
16135
16136         (Statement.Warning_DeadCodeFound): Factorize code.
16137         (While): Report dead code here too.
16138
16139         (Statement): Added Resolve virtual method to allow
16140         for resolution split from the emit code.
16141
16142 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16143
16144         * statement.cs (EmitBoolExpression): No longer try to resolve the
16145         expression here.    
16146         (MakeBoolean): New utility function that resolve, implicitly
16147         converts to boolean and tags the expression. 
16148
16149
16150         (If, Do): Implement dead code elimination.
16151         (While): Implement loop inversion
16152
16153         (Do, While, For, If): Resolve the expression prior to calling our
16154         code generation.
16155
16156 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16157
16158         * class.cs:
16159           - added method Report28 (warning: program has more than one entry point)
16160           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16161           - modified method Method.Define, the part at the end of the method
16162
16163         * rootcontext.cs: added static public Location EntryPointLocation;
16164           
16165         * ../errors/cs0028.cs : Add test case for the above warning.              
16166
16167         * typemanager.cs:
16168           - modified method CSharpName to allow arrays of primitive type to
16169             be printed nicely (e.g. instead of System.Int32[][] it now prints
16170             int[][])
16171           - added method CSharpSignature: returns the signature of a method
16172             in string format to be used in reporting errors, warnings, etc.
16173
16174         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16175         with String.Empty.
16176
16177 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16178
16179         * delegate.cs (Define): Fix extremely silly bug where I was
16180         setting the type of the 'object' parameter of the BeginInvoke
16181         method to System.IAsyncResult instead of System.Object ;-)
16182
16183 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16184
16185         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16186         here. 
16187
16188         (Constructor.Emit): return if we fail to initialize the
16189         constructor.  Another door closed!  
16190
16191         * expression.cs (New.DoResolve): Improve error message (from -6 to
16192         1501).  Use DeclaredOnly lookup to find the exact constructor.
16193
16194         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16195         loop.  This is useful.
16196
16197         * cs-parser.jay: Adjust the default parameters so that destructors
16198         have the proper signature.
16199
16200 2002-04-26  Martin Baulig  <martin@gnome.org>
16201
16202         * driver.cs (LoadAssembly): If `assembly' contains any characters
16203         which are only valid in path names and not in assembly names
16204         (currently slash, backslash and point), use Assembly.LoadFrom ()
16205         instead of Assembly.Load () on the `assembly' (before iteration
16206         over the link_paths).
16207
16208 2002-04-26  Martin Baulig  <martin@gnome.org>
16209
16210         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16211
16212 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16213
16214         * class.cs (Property): use the new typemanager.MemberLookup
16215
16216         (TypeContainer.MemberLookup): Implement using the
16217         TypeManager.MemberLookup now. 
16218
16219         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16220         and return MemberInfos, so that these can be used without an
16221         EmitContext (what we had before).
16222
16223 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16224
16225         * expression.cs: Fix the case where the argument to params if the
16226         type of the params.  I omitted handling this before.   Fixed
16227
16228 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * driver.cs: Call BootCorlib_PopulateCoreType
16231
16232         * class.cs (Property.CheckBase): Check for properties only, not
16233         for all members. 
16234
16235         * interface.cs: Temporary hack: try/catch around the
16236         CustomAttributeBuilder, because I am getting an exception that I
16237         do not understand.
16238
16239         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16240         types whose definitions are required to be there (attributes are
16241         defined before standard types).
16242
16243         Compute definitions as we boot the various types, as they are used
16244         immediately (value_type class will need object_type, but if we do
16245         not initialize object_type, we will pass a null, which will let
16246         the runtime pick the System.Object from the existing corlib, which
16247         is not what we want).
16248
16249 2002-04-22  Patrik Torstensson <totte@labs2.com>
16250
16251         * cs-tokenizer.cs: fixed a number of trim() issues.
16252
16253 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16254
16255         * expression.cs (Argument.Type): Ensure that we return the correct
16256         type when we have out or ref parameters [in which case we 
16257         append a "&"].
16258
16259 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16260
16261         * class.cs (Property, Indexer): Allow extern modifier in there. 
16262
16263         * typemanager.cs (InitBaseTypes): Initializes object_type and
16264         value_type, since those will be used early on during the bootstrap
16265         process to compile corlib.
16266
16267         (InitCoreTypes): Move code from here to InitBaseTypes.
16268
16269 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16270
16271         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16272         single-dimension arrays as using the ldlen opcode.  
16273
16274         Daniel Lewis discovered this optimization.  
16275
16276         * typemanager.cs: Add signature for System.Array::get_Length
16277
16278 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16279
16280         * statement.cs: report the error when the foreach does not apply to an
16281         array nor a collection.
16282
16283 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * expression.cs: Add implicit conversions to the operator ~.
16286
16287         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16288
16289         * typemanager.cs: Locate the decimal constructor.
16290
16291 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16292
16293         * attribute.cs: use the new property of TypeOf.
16294         * expression.cs: added 'get' property around typearg.
16295
16296         These changes fix a build breaker reported by NickD. Is this the
16297         correct way to fix?  If not, please, revert my changes and make it
16298         work :-).
16299
16300 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16301
16302         * attribute.cs: Add support for typeof in attribute invocations.
16303         I am not sure that this is right though.
16304
16305 2002-04-14  Duncan Mak  <duncan@ximian.com>
16306
16307         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16308         Binary.Operator.Division case.
16309
16310 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16311
16312         * class.cs (DefineType): Ensure that we do a proper check on
16313         attribute types and also register it with the TypeManager.
16314
16315         (TypeContainer.Targets): The default for attribute types is
16316         AttributeTargets.All.
16317
16318         * attribute.cs (ApplyAttributes): Registering the attribute type
16319         is done elsewhere, not when we discover we have a Usage attribute.
16320
16321 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16322
16323         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16324         and get rid of is_delegate parameter.
16325
16326         * everywhere : update.
16327
16328 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16329
16330         * cs-parser.jay (compilation_unit): Revamp completely to use
16331         some new ideas that I got from Rhys' grammar to solve the problems
16332         with assembly level attributes.
16333
16334         (outer_declaration): New grammar production.
16335
16336         (attribute_sections): Add.
16337
16338         (opt_attributes): Base on attribute_sections
16339
16340         (namespace_declaration): Allow opt_attributes to tackle the case
16341         when we have assembly level attributes - we are clever in this
16342         regard now ;-)
16343
16344         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16345         attributes in the non-global context.
16346
16347         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16348         instead of SetGlobalAttributes.
16349
16350         * class.cs, rootcontext.cs : Ensure we define and generate 
16351         attribute types before anything else.
16352
16353         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16354         and flag the new error -20 for the case when the attribute type
16355         does not have valid targets specified. csc does not catch this.
16356
16357         * ../errors/errors.txt : update for error # -20
16358
16359 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16360
16361         * support.cs (InternalParameters.ParameterModifier): Do some null
16362         checking and return sane values.
16363
16364         * class.cs (Method.Define): If we are a PInvoke method, ensure
16365         that we are static and extern. Report error # 601
16366
16367         * ../errors/cs0601.cs : Add test case for the above error.
16368
16369 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16370
16371         * rootcontext.cs (attribute_types): We need to keep type of
16372         all attribute types separately and emit code for them first.
16373
16374         (RegisterAttribute) : Implement.
16375
16376         * class.cs (DefineType): Check if the current Type is a custom
16377         attribute type and register it accordingly.
16378
16379         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16380         adding the first attribute twice and rename to
16381
16382         (SetGlobalAttributes): this.
16383
16384         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16385         lookups.
16386
16387         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16388         if we are processing global arguments. Hmm, I am unsure of this.
16389
16390 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16391
16392         * expression.cs: added static array of strings to avoid calling
16393         Enum.ToString () for Operator in Binary. Significant recover of
16394         performance.
16395
16396 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16397
16398         * class.cs (FindMembers): Allow the Builders of the various
16399         members to be null.  If they are skip them.  This only happens
16400         during the PInvoke declaration.
16401
16402 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16405         failure, so we do not keep going afterwards.
16406
16407         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16408         wanted to pass `false' as the `is_delegate' argument.  If this is
16409         the case, why not use delegate_type == null to mean `is_delegate =
16410         false' and anything else as is_delegate = true.
16411
16412 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16413
16414         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16415         code for the section, not the beginning of the tests.
16416
16417 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16418
16419         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16420
16421         * expression.cs (Binary): same.  Warn about errors where we have
16422         Enum/Enum in operator + as well.
16423
16424 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16425
16426         * statement.cs:
16427                 - added support for switch(bool)
16428                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16429                 - add TableSwitchEmit() to handle table-based switch statements
16430
16431 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16432
16433         * expression.cs (Invocation.OverloadResolve): Factor out code which
16434         does parameter compatibility checking with arguments so that we can 
16435         re-use the code even from Delegate.VerifyApplicability
16436
16437         (VerifyArgumentsCompat): Move above code here.
16438
16439         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16440         and instead make a call to the above method.
16441
16442 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16443
16444         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16445         We use it to keep track of classes which are attribute types.
16446
16447 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * delegate.cs (Delegate.Define): Correctly define the types in the
16450         presence of fixed and array parameters.
16451
16452         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16453         doing FindMembers.
16454
16455         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16456         include NonPublic after the first iteration.
16457
16458         * class.cs (Indexer.CheckBase): Only check if both parents are
16459         non-null. 
16460
16461         * cs-parser.jay (accessor_body): If empty, set to null.
16462
16463         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16464         same code path here to resolve constants names that we did have in
16465         MemberAccess.DoResolve.  There is too much code duplicated here.
16466
16467 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16468
16469         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16470
16471         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16472         to MakeUnionSet.
16473
16474         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16475         tokens, numbers and strings.
16476
16477         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16478         parenthesis.
16479
16480         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16481         asyncronous parameters and the regular parameters.  
16482
16483         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16484         specify the target directory.
16485
16486         * expression.cs: (This.DoResolve): Simplify
16487         (As.Emit): Optimize, do not generate IsInst if the expression is
16488         always of the given type.
16489
16490         (Is.DoResolve): Bug fix, we were reporting both always/never for
16491         the is expression.
16492
16493         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16494         creating too many unnecessary arrays.
16495
16496 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16497
16498         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16499         fields instead of rolling our own initializer.   Takes care of all
16500         implicit conversions, and drops unnecessary static checks/argument.
16501
16502 2002-03-31  Dick Porter  <dick@ximian.com>
16503
16504         * driver.cs: use the GetDirectories() return values properly, and
16505         use "/" as path separator.
16506
16507 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16508
16509         * expression.cs (Unary): Optimize - - expr into expr.
16510         (Binary): Optimize a + (-b) into a -b.
16511
16512         * codegen.cs (CodeGen): Made all methods static.
16513
16514 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * rootcontext.cs: 
16517
16518         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16519         TypeBuilder property.
16520
16521         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16522         instead. 
16523
16524         * tree.cs: Removed the various RecordXXXX, and replaced with a
16525         single RecordDecl.  Removed all the accessor methods, and just
16526         left a single access point Type 
16527
16528         * enum.cs: Rename DefineEnum to DefineType.
16529
16530         * decl.cs: New abstract method `DefineType' used to unify the
16531         Defines for Enumerations, Interfaces, TypeContainers and
16532         Delegates.
16533
16534         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16535         LookupBaseClasses method that used to live in class.cs and
16536         interface.cs here, and renamed to FindType.
16537
16538         * delegate.cs: Implement DefineType.  Take advantage of the
16539         refactored pattern for locating the parent builder without taking
16540         the parent_builder argument (which we know does not work if we are
16541         nested, and triggering a toplevel definition).
16542
16543 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16546         accessibility of a member has changed during override and report
16547         an error if so.
16548
16549         * class.cs (Method.Define, Property.Define): Only complain on
16550         overrides if the method is private, any other accessibility is
16551         fine (and since we just checked the permission is the same, we are
16552         good to go).
16553
16554         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16555         and elif are processed always.  The other pre-processing
16556         directives are only processed if we are "taking" the path
16557
16558 2002-03-29  Martin Baulig  <martin@gnome.org>
16559
16560         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16561         current location is not Null.
16562
16563         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16564         a separate method so we can profile it.
16565
16566         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16567         `span.Seconds' are just seconds, but no minutes or hours.
16568         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16569
16570 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16571
16572         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16573         Remove the gratuitous set of Final:
16574
16575                                 // If an interface implementation, then we can set Final.
16576                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16577                                     implementing.DeclaringType.IsInterface)
16578                                         flags |= MethodAttributes.Final;
16579
16580         I do not know what I was smoking when I used that.
16581
16582
16583         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16584         step into fixing the name resolution issues for delegates and
16585         unifying the toplevel name resolution.
16586
16587 2002-03-28  Martin Baulig  <martin@gnome.org>
16588
16589         * class.cs (Method.Emit): If we have a symbol writer, call its
16590         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16591         tell it about the current method.
16592
16593         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16594         writer that we're going to emit the first byte of IL code for a new
16595         statement (a new source line).
16596         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16597         EmitContext.Mark() before emitting any code.
16598
16599         * location.cs (SymbolDocument): Return null when we're Null.
16600
16601         * statement.cs (Statement): Moved the `Location loc' variable here.
16602         (Statement.EmitBoolExpression): If we have a symbol writer, call
16603         ec.Mark() before emitting any code to tell it that we're at the
16604         beginning of a new statement.
16605         (StatementExpression): Added `Location' argument to the constructor.
16606         (Block): Added public readonly variable `StartLocation' and public
16607         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16608         (Block): Added constructor which takes a start and end location.
16609         (Block.SetEndLocation): New method. This sets the end location.
16610         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16611         local variables we create.
16612         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16613         each statement and do also mark the begin and end of the block.
16614
16615         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16616         tell it the current lexer.Location, use Location.Null for the end of the
16617         block.
16618         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16619         current block, set its end location using SetEndLocation().
16620         (statement_expression): StatementExpression constructor now takes the
16621         lexer.Location as additional argument.
16622         (for_statement, declare_local_variables): Likewise.
16623         (declare_local_variables): When creating a new implicit block, use the
16624         new Block constructor and pass it the lexer.Location.
16625
16626 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16627
16628         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16629         members also on the parent interfaces recursively.
16630
16631 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16632
16633         * report.cs: Use new formats, since Gonzalo finished the missing
16634         bits. 
16635
16636         * expression.cs (Binary.ResolveOperator): added missing operator|
16637         operator& and operator^ for bool/bool.
16638
16639         * cs-parser.jay: CheckDef now takes a Location argument that is
16640         used to report errors more precisly (instead of reporting the end
16641         of a definition, we try to track something which is a lot closer
16642         to the source of the problem).
16643
16644         * cs-tokenizer.cs: Track global token use, so we can properly flag
16645         the use of #define/#undef after the first token has been seen.
16646
16647         Also, rename the reportXXXX to Error_DescriptiveName
16648
16649         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16650         TypeContainer, so that Enum and Interface can use this too.
16651
16652         * class.cs (TypeContainer.LookupInterfaceOrClass,
16653         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16654         `builder' argument.  Typically this was used to pass the parent
16655         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16656         the definition).  
16657
16658         The problem is that a nested class could trigger the definition of
16659         a toplevel class, and the builder would be obviously wrong in that
16660         case. 
16661
16662         So we drop this argument, and we compute dynamically the
16663         TypeBuilder/ModuleBuilder (the correct information was available
16664         to us anyways from DeclSpace.Parent)
16665
16666         * interface.cs (Interface.DefineInterface): Drop builder
16667         parameter cleanup like class.cs
16668
16669         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16670         like class.cs
16671
16672         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16673         values. 
16674
16675         (Try.Emit): Propagate the returns value from the statement.
16676
16677         (Return.Emit): Even if we are leavning 
16678
16679         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16680
16681         * modifiers.cs: Fix the computation of MethodAttributes flags.
16682
16683 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16684
16685         * driver.cs: allow compilation of files that start with '/'.
16686         Add a default case when checking the argument of --target.
16687
16688 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16689
16690         * interface.cs: Implement the same search algorithm for types in
16691         the interface code.
16692
16693         * delegate.cs: Do not allow multiple definition.
16694
16695         * Recovered ChangeLog that got accidentally amputated
16696
16697         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16698
16699         * rootcontext.cs: Load manually enum to allow core classes to
16700         contain enumerations.
16701
16702         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16703         Update to new static methods in TypeManager.
16704
16705         * typemanager.cs (GetMethod, GetConstructor): Use our
16706         implementation of FindMembers to find the members, since during
16707         corlib compilation, the types are TypeBuilders and GetMethod and
16708         GetConstructor do not work.
16709
16710         Make all methods in TypeManager static.
16711
16712         (InitCodeHelpers): Split the functionality from
16713         the InitCodeTypes function.
16714
16715         * driver.cs: Call InitCodeHelpers after we have populated the
16716         types. 
16717
16718         * cs-parser.jay (delegate_declaration): we did not used to compute
16719         the delegate name correctly for void delegates.
16720
16721 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16722
16723         * rootcontext.cs (RootContext): Init the interface_resolve_order
16724         and type_container_resolve_order always.
16725
16726         (ResolveCore, BootstrapCorlib_ResolveClass,
16727         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16728         compiler when compiling with --nostdlib
16729
16730         * class.cs (TypeContainer.DefineType): Check that our parent is
16731         not null.  This test is most important when we are bootstraping
16732         the core types.
16733
16734         * codegen.cs: Split out the symbol writing code.
16735
16736 2002-03-25  Martin Baulig  <martin@gnome.org>
16737
16738         * driver.cs (-g): Made -g an alias for --debug.
16739
16740 2002-03-24  Martin Baulig  <martin@gnome.org>
16741
16742         * codegen.cs (SymbolWriter): New public variable. Returns the
16743         current symbol writer.
16744         (CodeGen): Added `bool want_debugging_support' argument to the
16745          constructor. If true, tell the ModuleBuild that we want debugging
16746         support and ask it for the ISymbolWriter.
16747         (Save): If we have a symbol writer, call it's Close() method after
16748         saving the assembly.
16749
16750         * driver.c (--debug): New command line argument to create a
16751         debugger information file.
16752
16753         * location.cs (SymbolDocument): New public property. Returns an
16754         ISymbolDocumentWriter object for the current source file or null
16755         if we don't have a symbol writer.
16756
16757 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16758
16759         * driver.cs (LoadAssembly): Correctly return when all the paths
16760         have been tried and not before.
16761
16762         * statement.cs (Switch.Emit): return the actual coverage for this
16763         statement (returns/not-returns)
16764
16765         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16766         switch of the statement if we are the last switch section.  That
16767         kills two problems: try/catch problems (we used to emit an empty
16768         nop at the end) and switch statements where all branches would
16769         return. 
16770
16771 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16772
16773         * driver.cs: Add default assemblies (the equivalent to the
16774         Microsoft CSC.RSP file)
16775
16776         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16777         also update tokens_seen and set it to false.
16778
16779         * driver.cs: Implement --recurse for Mike.
16780
16781         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16782         correctly splitting out the paths.
16783
16784 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16785
16786         * interface.cs (Interface.PopulateProperty): Instead of using
16787         `parent' as the declaration space for the set parameters, use
16788         `this' 
16789
16790         * support.cs (InternalParameters): InternalParameters constructor
16791         takes a DeclSpace instead of a TypeContainer.
16792
16793         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16794         types are being initialized, load the address of it before calling
16795         the function.  
16796
16797         (New): Provide a mechanism to disable the generation of local
16798         value type temporaries when the caller will be providing us with
16799         an address to store it.
16800
16801         (ArrayCreation.EmitDynamicInitializers): Use it.
16802
16803 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16804
16805         * expression.cs (Invocation.EmitArguments): Only probe for array
16806         property if there is more than one argument.  Sorry about that.
16807
16808         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16809         empty param arrays.
16810
16811         * class.cs (Method.LabelParameters): Fix incorrect code path that
16812         prevented the `ParamArrayAttribute' from being applied to the
16813         params attribute.
16814
16815 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16816
16817         * support.cs (ReflectionParameters): Correctly compute whether the
16818         last argument is a params array.  Fixes the problem with
16819         string.Split ('a')
16820
16821         * typemanager.cs: Make the assemblies array always be non-null
16822         (empty, but non-null)
16823
16824         * tree.cs (RecordDecl): New function that abstracts the recording
16825         of names.  This reports error 101, and provides a pointer to the
16826         previous declaration.  Fixes a crash in the compiler.
16827
16828         * cs-parser.jay (constructor_declaration): Update to new grammar,
16829         and provide a constructor_body that can be empty.
16830
16831 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16832
16833         * driver.cs: Add support for --resources.
16834
16835         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16836         Make all types for the various array helper methods be integer.
16837
16838         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16839         CheckState to ConvCast.
16840
16841         (ConvCast): Now it takes a `checked' state argument, to avoid
16842         depending on the emit context for the conversion, and just using
16843         the resolve time setting.
16844
16845         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16846         instead of Invocation.EmitArguments.  We do not emit the original
16847         arguments, instead we emit those which have been converted to
16848         unsigned int expressions.
16849
16850         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16851
16852         * codegen.cs: ditto.
16853
16854         * expression.cs (LocalVariableReference): Drop the use of the
16855         Store function that depended on the variable index.
16856
16857         * statement.cs (VariableInfo): Drop the `Idx' property from this
16858         class, as this is not taking into account the indexes for
16859         temporaries tat we generate during the execution, getting the
16860         indexes wrong.
16861
16862         * class.cs: First emit class initializers, then call the parent
16863         constructor. 
16864
16865         * expression.cs (Binary): Fix opcode emision.
16866         (UnaryMutator.EmitCode): Support checked code generation
16867
16868         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16869         matches for events for both the Static and Instance scans,
16870         pointing to the same element.   Fix that.
16871
16872 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * rootcontext.cs (ResolveTree): Always set the
16875         interface_resolve_order, because nested interfaces will be calling
16876         into us.
16877
16878         * class.cs (GetInterfaceOrClass): Track the same resolution
16879         process used by TypeManager.LookupType.  This fixes the nested
16880         type lookups in class declarations (separate path from
16881         LookupType). 
16882
16883         (TypeContainer.DefineType): Also define nested interfaces.
16884         (TypeContainer.RegisterOrder): New public function used to
16885         register the order in which child interfaces need to be closed.
16886
16887         Nested interfaces need to be closed after their parents have been
16888         created. 
16889
16890         * interface.cs (InterfaceAttr): Put all the logic for computing
16891         the interface attribute here. 
16892
16893         (DefineInterface): Register our interface order with the
16894         RootContext or with the TypeContainer depending on the case.
16895
16896 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * cs-parser.jay: rework foreach statement to work with the new
16899         changes to the policy on SimpleNames.
16900
16901         * report.cs: support Stacktrace on warnings as well.
16902
16903         * makefile: drop --unsafe and /unsafe from the compile.
16904
16905 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16906
16907         * ecore.cs (StandardConversionExists): Modify to take an Expression
16908         as the first parameter. Ensure we do null -> reference type conversion
16909         checking.
16910
16911         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16912         temporary Expression objects.
16913
16914 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16915
16916         * interface.cs: workaround bug in method overloading resolution
16917         (there is already a bugzilla bug for it).
16918
16919 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16920
16921         We could also solve this problem by having a separate path for
16922         performing type lookups, instead of DoResolve, we could have a
16923         ResolveType entry point, and only participating pieces of the
16924         production (simplename, deref, array) would implement this. 
16925
16926         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16927         signal SimpleName to only resolve type names and not attempt to
16928         resolve anything else.
16929
16930         * expression.cs (Cast): Set the flag.
16931
16932         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16933
16934         * class.cs: Only report 108 if there is no `new' modifier.
16935
16936         * cs-parser.jay: rework foreach statement to work with the new
16937         changes to the policy on SimpleNames.
16938         
16939         * report.cs: support Stacktrace on warnings as well.
16940
16941         * makefile: drop --unsafe and /unsafe from the compile.
16942
16943 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16944
16945         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16946         lookups here, instead of doing that at parse time.  This means
16947         that our grammar will not introduce `LocalVariableReferences' as
16948         expressions at this point.  That solves the problem of code like
16949         this:
16950
16951         class X {
16952            static void Main ()
16953            { int X = 1;
16954             { X x = null }}}
16955
16956         This is only half the fix.  The full fix requires parameters to
16957         also be handled in this way.
16958
16959         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16960         makes the use more obvious of the DeclSpace.  The
16961         ec.TypeContainer.TypeBuilder is now only used to pull the
16962         TypeBuilder for it.
16963
16964         My theory is that I can get rid of the TypeBuilder completely from
16965         the EmitContext, and have typecasts where it is used (from
16966         DeclSpace to where it matters).  
16967
16968         The only pending problem is that the code that implements Aliases
16969         is on TypeContainer, and probably should go in DeclSpace.
16970
16971         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16972         lookups here, instead of doing that at parse time.  This means
16973         that our grammar will not introduce `LocalVariableReferences' as
16974         expressions at this point.  That solves the problem of code like
16975         this:
16976
16977         class X {
16978            static void Main ()
16979            { int X = 1;
16980             { X x = null }}}
16981
16982         This is only half the fix.  The full fix requires parameters to
16983         also be handled in this way.
16984
16985         * class.cs (Property.DefineMethod): When implementing an interface
16986         method, set newslot, when implementing an abstract method, do not
16987         set the flag (before we tried never setting it, or always setting
16988         it, which is the difference).
16989         (Indexer.DefineMethod): same.
16990         (Method.DefineMethod): same.
16991
16992         * ecore.cs: Only set the status used flag if we get back a Field.
16993
16994         * attribute.cs: Temporary hack, so Paolo can keep working.
16995
16996 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16997
16998         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16999         the unmanaged type in the case we have a MarshalAs attribute.
17000
17001         (Resolve): Handle the case when we are parsing the special MarshalAs
17002         attribute [we need to store the unmanaged type to use later]
17003
17004         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17005         MarshalAs Attribute.
17006
17007         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17008         on parameters and accordingly set the marshalling info.
17009
17010 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17011
17012         * class.cs: Optimizing slightly by removing redundant code after
17013         we switched to the `NoTypes' return value.
17014         (Property.DefineMethod): use NoTypes here too.
17015
17016         This fixes the bug I introduced in my last batch of changes.
17017
17018 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17019
17020         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17021
17022         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17023         Enums since those are types too. 
17024
17025         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17026
17027         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17028         thanks to a call during the lookup process.
17029
17030 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17031
17032         * statement.cs (Foreach): Lots of work to accomodate a particular
17033         kind of foreach statement that I had not kept in mind.  It is
17034         possible to have foreachs on classes that provide a GetEnumerator
17035         method that return objects that implement the "pattern" for using
17036         a foreach, there is no need to support GetEnumerator
17037         specifically. 
17038
17039         This is needed to compile nant.
17040
17041         * decl.cs: Only report 114 if the member is not `Finalize' and if
17042         the warning level is at least 2.
17043
17044         * class.cs: Moved the compare function from Method to
17045         MethodSignature. 
17046
17047         (MethodSignature.InheritableMemberSignatureCompare): Add new
17048         filter function that is used to extract inheritable methods from a
17049         class. 
17050
17051         (Method.Define): Use the new `inheritable_method_signature_filter'
17052         delegate
17053
17054         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17055         command. 
17056
17057 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17058
17059         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17060
17061         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17062
17063         * expression.cs: Pass location information to
17064         ConvertImplicitStandard. 
17065
17066         * class.cs: Added debugging code to track return values from
17067         interfaces. 
17068
17069 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17070
17071         * expression.cs (Is.DoResolve): If either side of the `is' is an
17072         interface, do not flag the warning.
17073
17074         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17075         for interfaces
17076
17077         * report.cs: Allow for --fatal to be used with --probe.
17078
17079         * typemanager.cs (NoTypes): Move the definition for the empty Type
17080         array here. 
17081
17082         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17083         properties. 
17084         (TypeContainer.DefineProxy): New function used to proxy to parent
17085         implementations when implementing interfaces.
17086         (TypeContainer.ParentImplements): used to lookup if our parent
17087         implements a public function that is required by an interface.
17088         (TypeContainer.VerifyPendingMethods): Hook this up.
17089
17090         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17091         `modules' and `assemblies' arraylists into arrays.  We only grow
17092         these are the very early start up of the program, so this improves
17093         the speedof LookupType (nicely measured).
17094
17095         * expression.cs (MakeByteBlob): Replaced unsafe code with
17096         BitConverter, as suggested by Paolo.
17097
17098         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17099         folding of string concatenation, but if either side is a string,
17100         and the other is not, then return null, and let the runtime use
17101         the concatenation on the string plus the object (using
17102         `Object.ToString'). 
17103
17104 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17105
17106         Constant Folding has been implemented now.
17107
17108         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17109         the error instead on types that are not supported in one's
17110         complement. 
17111
17112         * constant.cs (Constant and all children): New set of functions to
17113         perform implict and explicit conversions.
17114
17115         * ecore.cs (EnumConstant): Implement the new functions to perform
17116         conversion by proxying to the child expression.
17117
17118         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17119         own separate setting that can not be turned off from the command
17120         line using --unchecked or --checked and is only controlled using
17121         the checked/unchecked statements and expressions.  This setting is
17122         used by the constant folder to flag errors.
17123
17124         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17125         ConstantCheckState as well.   
17126
17127         During Resolve, they also have to flag the state, because the
17128         constant folder runs completely in the Resolve phase.
17129
17130         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17131         well.
17132
17133 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17134
17135         * cfold.cs: New file, this file contains the constant folder.
17136
17137         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17138         argument to track whether we are using the resulting address to
17139         load or store a value and provide better error messages. 
17140
17141         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17142         new AddressOf arguments.
17143
17144         * statement.cs (Foreach.EmitCollectionForeach): Update
17145
17146         * expression.cs (Argument.Emit): Call AddressOf with proper
17147         arguments to track usage.
17148
17149         (New.DoEmit): Call AddressOf with new arguments.
17150
17151         (Unary.Emit): Adjust AddressOf call.
17152
17153 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17154
17155         * cs-parser.jay (member_access): Change the case for pre-defined types
17156         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17157         this suggestion.
17158
17159         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17160         a method body.
17161
17162         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17163         essentially like methods and apply attributes like MethodImplOptions to them too.
17164
17165         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17166         not being null.
17167
17168         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17169         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17170         is the DeclSpace.
17171
17172         * Update code everywhere accordingly.
17173
17174         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17175
17176         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17177
17178 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17179
17180         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17181         try performing lookups against those instead of jumping straight into using
17182         the 'using' clauses.
17183
17184         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17185
17186         (LookupType): Perform lookups in implicit parents too.
17187
17188         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17189         sequence as RootContext.LookupType. 
17190
17191         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17192         the various cases of namespace lookups into this method.
17193
17194 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17195
17196         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17197         in positional arguments)
17198
17199         * class.cs (Operator): Update the AllowedModifiers to contain
17200         extern. 
17201
17202         * cs-parser.jay: Update operator declaration to allow for the
17203         operator body to be empty.
17204
17205         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17206         values. 
17207
17208 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17209
17210         * class.cs (Method.Emit): Label parameters.
17211
17212         * driver.cs: Return 1 or 0 as the program exit code.
17213
17214 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17215
17216         * expression.cs: Special case the `null' object when trying to
17217         auto-compute the type, as anything can be explicitly converted to
17218         that. 
17219
17220         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17221         spotting this Paolo.
17222
17223         (Expression.ImplicitNumericConversion): Perform comparissions of
17224         the type using the underlying type in the case of an enumeration
17225         rather than using the enumeration type for the compare.
17226
17227         Cope with the underlying == type case, which is not possible to
17228         catch before. 
17229
17230         (Expression.ConvertNumericExplicit): Perform comparissions of
17231         the type using the underlying type in the case of an enumeration
17232         rather than using the enumeration type for the compare.
17233
17234         * driver.cs: If the user does not supply an extension, assume .exe
17235
17236         * cs-parser.jay (if_statement): Rewrote so that we can track the
17237         location for the if statement.
17238
17239         * expression.cs (Binary.ConstantFold): Only concat strings when
17240         the operation is "+", not everything ;-)
17241
17242         * statement.cs (Statement.EmitBoolExpression): Take a location
17243         argument. 
17244         (If, While, Do): Track location.
17245
17246         * expression.cs (Binary.ResolveOperator): In the object + string
17247         case, I was missing a call to ConvertImplicit
17248
17249 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17250
17251         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17252         Location arguments. Ensure we use RootContext.LookupType to do our work
17253         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17254
17255         * interface.cs (PopulateMethod): Handle the type of the parameter being
17256         null gracefully.
17257
17258         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17259         have a params method with no fixed arguments and a call is made with no
17260         arguments.
17261
17262 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17263
17264         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17265         the verbatim-string-literal
17266
17267         * support.cs (InternalParameters.ParameterModifier): handle null
17268         fixed parameters.
17269         (InternalParameters.ParameterType): ditto.
17270
17271         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17272         duplicating the name of the variable parameter.
17273         (GetParameterByName): Fix bug where we were not looking up array
17274         paramters if they were the only present (thanks Paolo!).
17275         (GetParameterInfo): We only have an empty set of types if both
17276         fixed and array are set to null.
17277         (GetParameterInfo-idx): Handle FixedParameter == null
17278
17279         * cs-parser.jay: Handle the case where there is no catch
17280         statements (missing null test).
17281
17282 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * driver.cs (MainDriver): Be conservative on our command line
17285         handling.
17286
17287         Catch DirectoryNotFoundException when calling GetFiles.
17288
17289         (SplitPathAndPattern): Used to split the input specification into
17290         a path and a pattern that we can feed to Directory.GetFiles.
17291
17292 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17293
17294         * statement.cs (Fixed): Implement the last case of the Fixed
17295         statement (string handling).
17296
17297         * expression.cs (StringPtr): New class used to return a char * to
17298         a string;  Used by the Fixed statement.
17299
17300         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17301
17302         * expression.cs (Binary.ResolveOperator): Remove redundant
17303         MemberLookup pn parent type.
17304         Optimize union call, we do not need a union if the types are the same.
17305         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17306         type.
17307
17308         Specialize the use of MemberLookup everywhere, instead of using
17309         the default settings. 
17310
17311         (StackAlloc): Implement stackalloc keyword.
17312
17313         * cs-parser.jay: Add rule to parse stackalloc.
17314
17315         * driver.cs: Handle /h, /help, /?
17316
17317         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17318         before we supported unsafe code.
17319
17320         * makefile: add --unsafe to the self compilation of mcs.
17321
17322 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17323
17324         * expression.cs (PointerArithmetic): New class that is used to
17325         perform pointer arithmetic.
17326         (Binary.Resolve): Handle pointer arithmetic
17327         Handle pointer comparission.
17328         (ArrayPtr): Utility expression class that is used to take the
17329         address of an array.
17330
17331         (ElementAccess): Implement array access for pointers
17332
17333         * statement.cs (Fixed): Implement fixed statement for arrays, we
17334         are missing one more case before we are done.
17335
17336         * expression.cs (Indirection): Implement EmitAssign and set the
17337         ExprClass to Variable.  This allows pointer dereferences to be
17338         treated as variables, and to have values assigned to them.
17339
17340         * ecore.cs (Expression.StoreFromPtr): New utility function to
17341         store values dereferencing.
17342
17343 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17344
17345         * expression.cs (Binary.ResolveOperator): Ensure that we are
17346         not trying to operate on a void type - this fixes the reported
17347         bug.
17348
17349         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17350         the parent implementation is sealed.
17351
17352         * ../errors/cs0239.cs : Add.
17353
17354         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17355
17356         * typemanager.cs (unverifiable_code_type): Corresponds to 
17357         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17358         which have unsafe code in them.
17359
17360         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17361         unsafe context.
17362
17363 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17364
17365         * cs-tokenizer.cs: Add support for @"litreal strings"
17366
17367         Make tokenizer accept pre-processor directives
17368         on any column (remove the old C-like limitation). 
17369
17370         * rootcontext.cs (EmitCode): Emit any global attributes.
17371         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17372
17373         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17374
17375         * cs-parser.jay: Add support for global attributes.  
17376
17377 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * expression.cs (Indirection): New helper class.  Unary will
17380         create Indirection classes to be able to implement the
17381         IMemoryLocation interface on it.
17382
17383 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17384
17385         * cs-parser.jay (fixed_statement): reference the right statement.
17386
17387         * statement.cs (Fixed.Emit): Finish implementing the fixed
17388         statement for the &x case.
17389
17390 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17391
17392         * class.cs (Property.Define, Method.Define): Remove newslot when
17393         `implementing'.  
17394
17395         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17396         wrong.  NewSlot should only be used if the `new' keyword is present.
17397
17398         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17399         locating our system dir.  Sorry about this.
17400
17401 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17402
17403         * driver.cs (GetSystemDir): Compute correctly the location of our
17404         system assemblies.  I was using the compiler directory instead of
17405         the library directory.
17406
17407 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17408
17409         * expression.cs (BetterFunction): Put back in what Miguel commented out
17410         since it is the correct fix. The problem is elsewhere ;-)
17411
17412         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17413         parameters of the parms method are themselves compatible or not !
17414
17415         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17416         to check that a class implements an interface before saying that an implicit
17417         conversion was allowed. Use ImplementsInterface to do the checking.
17418
17419 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * class.cs (Method.Define): Track whether we are an explicit
17422         implementation or not.  And only call DefineMethodOverride if we
17423         are an explicit implementation.
17424
17425         (Property.DefineMethod): Ditto.
17426
17427 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17428
17429         * expression.cs (BetterFunction): Catch hideous bug which was
17430          preventing us from detecting ambiguous calls due to implicit casts i.e
17431         cs0121.
17432
17433 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17434
17435         * support.cs (Pair): Remove un-needed method.  I figured why I was
17436         getting the error in cs-parser.jay, the variable in a foreach loop
17437         is readonly, and the compiler does not really treat this as a variable.
17438
17439         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17440         instead of EQUALS in grammar.  
17441
17442         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17443
17444         * expression.cs (Unary.DoResolve): Check whether the argument is
17445         managed or not.
17446
17447 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17448
17449         * support.cs: Api for Pair to set a value.  Despite the fact that
17450         the variables are public the MS C# compiler refuses to compile
17451         code that accesses the field if the variable is part of a foreach
17452         statement. 
17453
17454         * statement.cs (Fixed): Begin implementation of the fixed
17455         statement.
17456
17457         (Block.AddVariable): Return the VariableInfo on success and null
17458         on failure instead of true/false. 
17459
17460         * cs-parser.jay (foreach): Catch errors on variables already
17461         defined (we were ignoring this value before) and properly unwind
17462         the block hierarchy
17463
17464         (fixed_statement): grammar for the fixed statement.
17465
17466 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17467
17468         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17469         pointer types to be incretemented.
17470
17471         (SizeOf): Implement.
17472
17473         * cs-parser.jay (pointer_member_access): Implement
17474         expr->IDENTIFIER production.
17475
17476         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17477         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17478         on safe contexts.
17479
17480         (Unary): Implement indirection.
17481
17482         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17483         use in non-unsafe context).
17484
17485         (SimpleName.DoResolve): Check for pointers in field access on safe
17486         contexts. 
17487
17488         (Expression.LoadFromPtr): Factor the load-indirect code in this
17489         function.  This was duplicated in UnboxCast and ParameterReference
17490
17491 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17492
17493         * expression.cs (ComposedCast): report an error if a pointer cast
17494         is used in a safe region.
17495
17496         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17497         pointer type casts in unsafe context.
17498
17499         * codegen.cs (EmitContext): Set up IsUnsafe.
17500
17501         * cs-parser.jay (non_expression_type): Add productions for pointer
17502         casts. 
17503
17504         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17505         code.  We should not use force into static mode if the method is
17506         not virtual.  Fixes bug in MIS
17507
17508         * statement.cs (Do.Emit, While.Emit, For.Emit,
17509         Statement.EmitBoolExpression): Add support to Do and While to
17510         propagate infinite loop as `I do return' semantics.
17511
17512         Improve the For case to also test for boolean constants.
17513
17514         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17515         to the list of attributes we can add.
17516
17517         Remove `EmitContext' argument.
17518
17519         * class.cs (Method.Define): Apply parameter attributes.
17520         (Constructor.Define): Apply parameter attributes.
17521         (MethodCore.LabelParameters): Move here the core of labeling
17522         parameters. 
17523
17524         * support.cs (ReflectionParameters.ParameterModifier,
17525         InternalParameters.ParameterModifier): Use IsByRef on the type and
17526         only return the OUT bit for these parameters instead of in/out/ref
17527         flags.
17528
17529         This is because I miss-understood things.  The ParameterInfo.IsIn
17530         and IsOut represent whether the parameter has the [In] and [Out]
17531         attributes set.  
17532
17533 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17534
17535         * ecore.cs (FieldExpr.Emit): Release temporaries.
17536
17537         * assign.cs (LocalTemporary.Release): new function.
17538
17539         * codegen.cs (EmitContext.GetTemporaryStorage,
17540         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17541         temporary storage.  Now we can "put back" localbuilders when we
17542         are done with them
17543
17544 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17545
17546         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17547         need to make a copy of the variable to generate verifiable code.
17548
17549 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17550
17551         * driver.cs: Compute dynamically the system directory.
17552
17553         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17554         Slower, but more generally useful.  Used by the abstract
17555         registering implementation. 
17556
17557         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17558         the rules for the special rule on Type/instances.  First check if
17559         we have the same name, and if so, try that special static path
17560         rather than the instance path.
17561
17562 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17563
17564         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17565         for, while and if.
17566
17567         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17568         Enum, ValueType, Delegate or Array for non-corlib compiles.
17569
17570         * cs-tokenizer.cs: Catch long identifiers (645)
17571
17572         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17573         piece of code.
17574
17575         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17576         fix, we were returning too early, so we were not registering
17577         pending methods from abstract classes.
17578
17579         Do not register pending methods if the class is abstract.
17580
17581         * expression.cs (Conditional.DoResolve): Report circular implicit
17582         conversions when we neecd to compute it for conditional
17583         expressions. 
17584
17585         (Is.DoResolve): If the expression is always of the provided type,
17586         flag warning 183.  If the expression can not ever be of the
17587         provided type flag warning 184.
17588
17589         * class.cs: Catch 169 as well.
17590
17591         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17592         read. 
17593
17594 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17595
17596         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17597
17598 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17599
17600         * interface.cs: (PopulateMethod): Check for pointers being defined
17601         only if the unsafe context is active.
17602         (PopulateProperty): ditto.
17603         (PopulateIndexer): ditto.
17604
17605         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17606         specified.  If pointers are present, make sure that they are
17607         present in an unsafe context.
17608         (Constructor, Constructor.Define): ditto.
17609         (Field, Field.Define): ditto.
17610         (Property, Property.Define): ditto.
17611         (Event, Event.Define): ditto.
17612
17613         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17614         hashtable if there are classes or structs defined.
17615
17616         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17617         code, as the constant resolution moved.
17618
17619         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17620         the metadata, so we can flag error 133. 
17621
17622         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17623         pointer is being declared in an unsafe context.
17624
17625 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17626
17627         * modifiers.cs (Modifiers.Check): Require a Location argument.
17628         Report error 227 for Unsafe use.
17629
17630         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17631
17632         * statement.cs (For.Emit): If the test is null, then report that
17633         we do `return', as we wont reach anything afterwards.
17634
17635         (Switch.SwitchGoverningType): Track the expression that matched
17636         the conversion.
17637
17638         * driver.cs: Allow negative numbers as an error code to flag.
17639
17640         * cs-parser.jay: Handle 1551.
17641
17642         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17643
17644 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17645
17646         * cs-parser.jay: Report 1518 (type declaration can only contain
17647         class, struct, interface, enum or delegate)
17648
17649         (switch_label): Report 1523 (keywords `case' or `default' must
17650         preced code)
17651
17652         (opt_switch_sections): Report 1522 (empty switch)
17653
17654         * driver.cs: Report 1515 (response file specified multiple times)
17655         Report 1516 (Source file specified multiple times).
17656
17657         * expression.cs (Argument.Resolve): Signal 1510
17658
17659         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17660         access not allowed in static code)
17661
17662 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17663
17664         * typemanager.cs (IsPointerType): Utility method which we are going
17665         to need a lot.
17666
17667         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17668         the object type, so we take care of that.
17669
17670         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17671
17672         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17673         added to non-params parameters :-)
17674
17675         * typemanager.cs (CSharpName): Include 'void' type too. 
17676
17677         (void_ptr_type): Include in the set of core types.
17678
17679         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17680         duplicating code.
17681
17682         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17683         an unsafe context.
17684
17685         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17686         completely forgotten about it.
17687
17688 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17689
17690         * cs-parser.jay (pointer_type): Add. This begins our implementation
17691         of parsing rules for unsafe code.
17692
17693         (unsafe_statement): Implement.
17694
17695         (embedded_statement): Modify to include the above.
17696
17697         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17698
17699         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17700         if the current context is an unsafe one.
17701
17702         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17703         are handled differently, we need separate rules for them.
17704
17705         (local_variable_declaration): Update to use local_variable_pointer_type
17706         to allow variable declarations of unmanaged pointer types.
17707
17708         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17709         in unsafe contexts.
17710
17711         * ../errors/cs0214.cs : Add.
17712
17713 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17714
17715         * makefile: remove 'response' file when cleaning.
17716
17717 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17718
17719         * cs-parser.jay: Report 1524.
17720
17721 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17722
17723         * typemanager.cs (RegisterMethod): drop checking if we have
17724         registered this from here
17725
17726 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17727
17728         * class.cs (Method.EmitDestructor): Implement calling our base
17729         destructor. 
17730
17731         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17732         value of InFinally.
17733
17734         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17735         this routine and will wrap the call in a try/catch block.  Deal
17736         with the case.
17737
17738 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * ecore.cs (Expression.MemberLookup): instead of taking a
17741         parameter `same_type' that was used to tell whether we could
17742         access private members we compute our containing type from the
17743         EmitContext.
17744
17745         (FieldExpr): Added partial support for volatile fields.  This does
17746         not work for volatile fields exposed from assemblies, as I can not
17747         figure out how to extract the modreq from it.
17748
17749         Updated all the source files to use this.
17750
17751         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17752         because it is referenced by MemberLookup very often. 
17753
17754 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17755
17756         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17757         TypeBuilder.GetCustomAttributes to retrieve what we need.
17758
17759         Get rid of redundant default_member_attr_type as this is the same as
17760         default_member_type which already exists.
17761
17762         * interface.cs, attribute.cs : Update accordingly.
17763
17764 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17765
17766         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17767         work for TYpeBuilders though.  Ravi, can you please fix this?
17768
17769         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17770
17771         * expression.cs (Argument.Emit): Handle the case of ref objects
17772         being passed to ref functions;  
17773
17774         (ParameterReference.EmitLoad): Loads the content of the pointer
17775         without dereferencing.
17776
17777 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17778
17779         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17780
17781 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17782
17783         * class.cs (Indexer.DefineMethod): Incorporate the interface
17784         type in the name of the method if we are doing explicit interface
17785         implementation.
17786
17787         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17788
17789         (BetterConversion): Fix extremely trivial bug where we were referring to
17790         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17791         again !
17792
17793         * ../errors/bug16.cs : Add although we have fixed it.
17794
17795 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17796
17797         * expression.cs (BaseIndexer): Begin implementation.
17798
17799         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17800
17801         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17802         production directly to remove a shift/reduce, and implement
17803         explicit interface implementation.
17804
17805         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17806         after a floating point suffix.
17807
17808         * expression.cs (DoNumericPromotions): Improved the conversion for
17809         uint/uint.  If we have a constant, we avoid doing a typecast to a
17810         larger type.
17811
17812         * class.cs (Indexer): Implement explicit interface implementation
17813         for indexers.
17814
17815 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17816
17817         * class.cs: make the default instance constructor public and hidebysig.
17818
17819 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17820
17821         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17822         so we can call it from elsewhere.
17823
17824         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17825         we emit it internally if the class has a defined indexer; otherwise the user
17826         emits it by decorating the class definition with the DefaultMemberAttribute.
17827
17828         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17829         attribute is not used on a type which defines an indexer.
17830
17831         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17832         character when we skip whitespace.
17833
17834         * ../errors/cs0646.cs : Add.
17835
17836 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17837
17838         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17839         again. 
17840
17841         * makefile: Add practical target `mcs3.exe' which builds the third
17842         generation compiler. 
17843
17844         * expression.cs (New): Fix structures constructor calling.
17845
17846         * class.cs (Property, Method, Indexer): Emit Final flag on the
17847         method if we are an interface implementation and we are not
17848         abstract. 
17849
17850         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17851         whether this property is referencing a `base' method.
17852
17853         * expression.cs (Invocation.EmitCall): take an extra argument:
17854         is_base, this is used to determine whether the `call' or
17855         `callvirt' opcode should be used.
17856
17857
17858         * delegate.cs: update EmitCall.
17859
17860         * class.cs (Method.Define): Set NewSlot for the cases where we are
17861         not implementing an interface method.
17862
17863         (Property.Define): ditto.
17864
17865 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17866
17867         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17868         'r'.  Allows mcs to parse itself fully.
17869
17870 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17871
17872         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17873         of the number of initializers that require the InitializeArray method.
17874
17875         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17876         update the above field where necessary.
17877
17878         (MakeByteBlob): Update accordingly.
17879
17880         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17881         greater than 2.
17882
17883         (EmitDynamicInitializers): Update in accordance with the new optimization.
17884
17885         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17886         same OpCode applies.
17887
17888         * cs-parser.jay : Fix some glaring errors I introduced.
17889
17890 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17891
17892         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17893         so that we can check for name clashes there too.
17894
17895         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17896         for interface indexers.
17897
17898         * interfaces.cs (Define): Emit the default member attribute.
17899
17900         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17901         variable was being referred to while setting the value ;-)
17902
17903 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17904
17905         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17906         byte-by-byte information when we know the data is zero.
17907
17908         Make the block always a multiple of 4, because
17909         DefineInitializedData has a bug.
17910
17911         * assign.cs: Fix, we should assign from the temporary, not from
17912         the source. 
17913
17914         * expression.cs (MakeByteBlob): Fix my incorrect code.
17915
17916 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17917
17918         * typemanager.cs (EnumToUnderlying): This function is used to get
17919         the underlying type from an enumeration, because it does not
17920         always work. 
17921
17922         * constant.cs: Use the I4_S form for values between -128 and 127.
17923
17924         * statement.cs (Block.LookupLabel): Looks up a label.
17925         (Block): Drop support for labeled blocks.
17926
17927         (LabeledStatement): New kind of statement that represents a label
17928         only.
17929
17930         (Goto): Finally implement this bad boy.
17931
17932         * cs-parser.jay: Update to reflect new mechanism to implement
17933         labels.
17934
17935 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17936
17937         * codegen.cs (EmitContext.This): a codegen property that keeps the
17938         a single instance of this instead of creating many different this
17939         instances. 
17940
17941         * delegate.cs (Delegate.DoResolve): Update to use the property;
17942
17943         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17944
17945         * expression.cs (BaseAccess.DoResolve): Ditto.
17946
17947 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17948
17949         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17950         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17951
17952         (InitCoreTypes): Update accordingly.
17953
17954         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17955         so we can quickly store the state.
17956
17957         (ApplyAttributes): Set the correct implementation flags
17958         for InternalCall methods.
17959
17960 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * expression.cs (EmitCall): if a method is not virtual, then do
17963         not use callvirt on it.
17964
17965         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17966         user defined stuff) requires the use of stobj, which takes an
17967         address on the stack instead of an array and an index.  So emit
17968         the Ldelema operation for it.
17969
17970         (EmitStoreOpcode): Use stobj for valuetypes.
17971
17972         (UnaryMutator.EmitCode): Use the right 1 value depending on
17973         whether we are dealing with int64/uint64, float or doubles.
17974
17975         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17976         constructors that I implemented last night.
17977
17978         (Constructor.IsDefault): Fix to work properly for static
17979         constructors.
17980
17981         * cs-parser.jay (CheckDef): report method signature errors.
17982         Update error number 103 to be 132.
17983
17984         * decl.cs: New AdditionResult enumeration value: MethodExists.
17985         Although we do this check for methods later on in the semantic
17986         analysis, catching repeated default constructors is so easy that
17987         we catch these here. 
17988
17989         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17990         promotions code.
17991
17992         (ParameterReference.EmitAssign, Emit): handle
17993         bools as bytes.
17994
17995         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17996         (ArrayAccess.EmitStoreOpcode): ditto.
17997
17998         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17999
18000         * expression.cs (MakeByteBlob): Complete all the missing types
18001         (uint, short, ushort, byte, sbyte)
18002
18003         * class.cs: Only init instance field initializers on instance
18004         constructors. 
18005
18006         Rename `constructors' to instance_constructors. 
18007
18008         (TypeContainer.AddConstructor): Only add constructors to the list
18009         if it is not static.
18010
18011         Make sure that we handle default_static_constructor independently
18012         everywhere where we handle instance_constructors
18013
18014 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18015
18016         * class.cs: Do not lookup or create a base initializer for a
18017         static constructor.
18018
18019         (ConstructorInitializer.Resolve): use the proper type to lookup
18020         for constructors.
18021
18022         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18023
18024         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18025         in DeclSpace. 
18026
18027         * decl.cs: CloseType is now an virtual method, the default
18028         implementation just closes this type.
18029
18030 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18031
18032         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18033         to PreserveSig by default. Also emit HideBySig on such methods.
18034
18035         Basically, set the defaults to standard values.
18036
18037         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18038         argument, if candidate is better, it can't be worse than the best !
18039
18040         (Invocation): Re-write bits to differentiate between methods being
18041         applicable in their expanded form and their normal form - for params
18042         methods of course.
18043
18044         Get rid of use_standard everywhere as only standard conversions are allowed
18045         in overload resolution. 
18046
18047         More spec conformance.
18048
18049 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18050
18051         * driver.cs: Add --timestamp, to see where the compiler spends
18052         most of its time.
18053
18054         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18055         `this' in static code.
18056
18057         (SimpleName.DoResolve): Implement in terms of a helper function
18058         that allows static-references to be passed upstream to
18059         MemberAccess.
18060
18061         (Expression.ResolveWithSimpleName): Resolve specially simple
18062         names when called by MemberAccess to implement the special
18063         semantics. 
18064
18065         (Expression.ImplicitReferenceConversion): Handle conversions from
18066         Null to reference types before others, as Null's type is
18067         System.Object. 
18068
18069         * expression.cs (Invocation.EmitCall): Handle the special case of
18070         calling methods declared on a reference type from a ValueType
18071         (Base classes System.Object and System.Enum)
18072
18073         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18074         the left hand side is a TypeExpr, not on every enumeration. 
18075
18076         (Binary.Resolve): If types are reference types, then do a cast to
18077         object on operators != and == of both arguments.
18078
18079         * typemanager.cs (FindMembers): Extract instance and static
18080         members if requested.
18081
18082         * interface.cs (PopulateProperty): Use void_type instead of null
18083         as the return type for the setter method.
18084
18085         (PopulateIndexer): ditto.
18086
18087 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18088
18089         * support.cs (ReflectionParameters): Fix minor bug where we
18090         were examining the wrong parameter for the ParamArray attribute.
18091
18092         Cope with requests for the type of the parameter at position
18093         greater than the params parameter's. We now return the element
18094         type of the params array as that makes more sense.
18095
18096         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18097         accordingly as we no longer have to extract the element type
18098         ourselves.
18099
18100         (Invocation.OverloadResolve): Update.
18101
18102 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18103
18104         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18105         against IEnumerator, test whether the return value is a descendant
18106         of the IEnumerator interface.
18107
18108         * class.cs (Indexer.Define): Use an auxiliary method to implement
18109         the other bits of the method definition.  Begin support for
18110         explicit interface implementation.
18111
18112         (Property.DefineMethod): Use TypeManager.void_type instead of null
18113         for an empty return value.
18114
18115 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18118         dealing with a FieldExpr which is composed of a FieldBuilder, in
18119         the code path we did extract the constant, but we should have
18120         obtained the underlying value to be able to cast it (otherwise we
18121         end up in an infinite loop, this is what Ravi was running into).
18122
18123         (ArrayCreation.UpdateIndices): Arrays might be empty.
18124
18125         (MemberAccess.ResolveMemberAccess): Add support for section
18126         14.5.4.1 that deals with the special case of E.I when E is a type
18127         and something else, that I can be a reference to a static member.
18128
18129         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18130         handle a particular array type to create byte blobs, it is just
18131         something we dont generate byteblobs for.
18132
18133         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18134         arguments. 
18135
18136         * location.cs (Push): remove the key from the hashtable that we
18137         are about to add.   This happens for empty files.
18138
18139         * driver.cs: Dispose files after we have parsed them.
18140
18141         (tokenize): new function that only runs the tokenizer on its
18142         input, for speed testing.
18143
18144 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18145
18146         * class.cs (Event.Define): Define the private field only if there
18147         are no accessors defined.
18148
18149         * expression.cs (ResolveMemberAccess): If there is no associated
18150         field with the event, that means we have an event defined with its
18151         own accessors and we should flag error cs0070 since transforming
18152         ourselves into a field is not valid in that case.
18153
18154         * ecore.cs (SimpleName.DoResolve): Same as above.
18155
18156         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18157         and charset to sane values.
18158
18159 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18160
18161         * assign.cs (DoResolve): Perform check on events only if they 
18162         are being accessed outside the declaring type.
18163
18164         * cs-parser.jay (event_declarations): Update rules to correctly
18165         set the type of the implicit parameter etc.
18166
18167         (add_accessor, remove_accessor): Set current local parameters.
18168
18169         * expression.cs (Binary): For delegate addition and subtraction,
18170         cast the return value from the method into the appropriate delegate
18171         type.
18172
18173 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18174
18175         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18176         of these as the workaround is unnecessary.
18177
18178         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18179         delegate data - none of that is needed at all.
18180
18181         Re-write bits to extract the instance expression and the delegate method
18182         correctly.
18183
18184         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18185         on delegates too.
18186
18187         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18188         of attaching attributes instead of duplicating code everywhere.
18189
18190         * everywhere : Update code to do attribute emission using the above method.
18191
18192 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * expression.cs (IsParamsMethodApplicable): if there are not
18195         parameters, return immediately.
18196
18197         * ecore.cs: The 0 literal can be implicity converted to an enum
18198         type. 
18199
18200         (SimpleName.DoResolve): First lookup the type, then lookup the
18201         members. 
18202
18203         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18204         want to get its address.  If the InstanceExpression is not
18205         addressable, store the result in a temporary variable, then get
18206         the address of it.
18207
18208         * codegen.cs: Only display 219 errors on warning level or above. 
18209
18210         * expression.cs (ArrayAccess): Make it implement the
18211         IMemoryLocation interface.
18212
18213         (Binary.DoResolve): handle the operator == (object a, object b)
18214         and operator != (object a, object b) without incurring into a
18215         BoxedCast (because 5 != o should never be performed).
18216
18217         Handle binary enumerator operators.
18218
18219         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18220         value type, otherwise use Ldelem_ref.
18221
18222         Use precomputed names;
18223
18224         (AddressOf): Implement address of
18225
18226         * cs-parser.jay (labeled_statement): Fix recursive block
18227         addition by reworking the production.
18228
18229         * expression.cs (New.DoEmit): New has a special case:
18230                 
18231                  If we are dealing with a ValueType, we have a few
18232                  situations to deal with:
18233                 
18234                     * The target of New is a ValueType variable, that is
18235                       easy, we just pass this as the variable reference
18236                 
18237                     * The target of New is being passed as an argument,
18238                       to a boxing operation or a function that takes a
18239                       ValueType.
18240                 
18241                       In this case, we need to create a temporary variable
18242                       that is the argument of New.
18243
18244
18245 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18246
18247         * rootcontext.cs (LookupType): Check that current_type is not null before
18248         going about looking at nested types.
18249
18250         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18251         not implement the IAssignMethod interface any more.
18252
18253         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18254         where we tranform them into FieldExprs if they are being resolved from within
18255         the declaring type.
18256
18257         * ecore.cs (SimpleName.DoResolve): Do the same here.
18258
18259         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18260
18261         * ../errors/bug10.cs : Add.
18262
18263         * ../errors/cs0070.cs : Add.
18264
18265         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18266
18267         * assign.cs : Get rid of EventIsLocal everywhere.
18268
18269 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * ecore.cs (ConvertIntLiteral): finished the implementation.
18272
18273         * statement.cs (SwitchLabel): Convert the value we are using as a
18274         key before looking up the table.
18275
18276 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18277
18278         * codegen.cs (EmitTopBlock): Require a Location argument now.
18279
18280         * cs-parser.jay (constructor_declarator): We need to setup
18281         current_local_parameters before we parse the
18282         opt_constructor_initializer, to allow the variables to be bound
18283         to the constructor arguments.
18284
18285         * rootcontext.cs (LookupType): First lookup nested classes in our
18286         class and our parents before we go looking outside our class.
18287
18288         * expression.cs (ConstantFold): Extract/debox the values at the
18289         beginnning. 
18290
18291         * rootcontext.cs (EmitCode): Resolve the constants first before we
18292         resolve the types.  This is not really needed, but it helps debugging.
18293
18294         * statement.cs: report location.
18295
18296         * cs-parser.jay: pass location to throw statement.
18297
18298         * driver.cs: Small bug fix.
18299
18300         * report.cs: Updated format to be 4-zero filled digits.
18301
18302 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18303
18304         * expression.cs (CheckIndices): Fix minor bug where the wrong
18305         variable was being referred to ;-)
18306
18307         (DoEmit): Do not call EmitStaticInitializers when the 
18308         underlying type is System.Object.
18309
18310 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18311
18312         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18313         and do the usual workaround for SRE.
18314
18315         * class.cs (MyEventBuilder.EventType): New member to get at the type
18316         of the event, quickly.
18317
18318         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18319
18320         * assign.cs (Assign.DoResolve): Handle the case when the target
18321         is an EventExpr and perform the necessary checks.
18322
18323         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18324         interface.
18325
18326         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18327
18328         (EventExpr): Set the type in the constructor itself since we 
18329         are meant to be born fully resolved.
18330
18331         (EventExpr.Define): Revert code I wrote earlier.
18332                 
18333         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18334         instance expression is null. The instance expression is a This in that case
18335         or a null, depending on whether it is a static method or not.
18336
18337         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18338         refers to more than one method.
18339
18340         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18341         and accordingly flag errors.
18342
18343 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18346
18347 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18348
18349         * location.cs (ToString): Provide useful rutine.
18350
18351 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18352
18353         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18354         objects, return the actual integral boxed.
18355
18356         * statement.cs (SwitchLabel): define an ILLabel for each
18357         SwitchLabel. 
18358
18359         (Switch.CheckSwitch): If the value is a Literal, extract
18360         the underlying literal.
18361
18362         Also in the unused hashtable we had, add the SwitchLabel so we can
18363         quickly look this value up.
18364
18365         * constant.cs: Implement a bunch of new constants.  Rewrite
18366         Literal based on this.  Made changes everywhere to adapt to this.
18367
18368         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18369         dereferencing array only once, and also copes with enumrations.
18370
18371         bytes are two bytes wide, not one.
18372
18373         (Cast): Perform constant conversions.
18374
18375         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18376         wrappers to the literals here.
18377
18378         * expression.cs (DoNumericPromotions): long literals can converted
18379         to ulong implicity (this is taken care of elsewhere, but I was
18380         missing this spot).
18381
18382         * ecore.cs (Expression.Literalize): Make the return type Literal,
18383         to improve type checking.
18384
18385         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18386
18387 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18388
18389         * literal.cs: Revert code from ravi that checked the bounds.  The
18390         bounds are sane by the definition of the type itself. 
18391
18392         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18393         need to actually look up in our parent hierarchy for interfaces
18394         implemented. 
18395
18396         * const.cs: Use the underlying type for enumerations
18397
18398         * delegate.cs: Compute the basename for the delegate creation,
18399         that should fix the delegate test case, and restore the correct
18400         Type Lookup semantics in rootcontext
18401
18402         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18403         referencing a nested type with the Reflection API is using the "+"
18404         sign. 
18405
18406         * cs-parser.jay: Do not require EOF token at the end.
18407
18408 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18409
18410         * rootcontext.cs (LookupType): Concatenate type names with
18411         a '.' instead of a '+' The test suite passes again.
18412
18413         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18414         field of the enumeration.
18415
18416         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18417         the case when the member is an EventExpr.
18418
18419         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18420         static has an associated instance expression.
18421
18422         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18423
18424         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18425
18426         * class.cs (Event.Define): Register event and perform appropriate checks
18427         for error #111.
18428
18429         We define the Add and Remove methods even if the use provides none because
18430         in that case, we provide default implementations ourselves.
18431
18432         Define a private field of the type of the event. This is done by the CSC compiler
18433         and we should be doing it too ;-)
18434
18435         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18436         More methods we use in code we generate.
18437
18438         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18439         is important.
18440
18441         (InitCoreTypes): Update accordingly for the above.
18442
18443         * class.cs (Event.Emit): Generate code for default accessors that we provide
18444
18445         (EmitDefaultMethod): Do the job in the above.
18446
18447         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18448         appropriate place.
18449
18450 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18453         builders even if we were missing one.
18454
18455         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18456         pass the Basename as our class name instead of the Name.  The
18457         basename will be correctly composed for us.
18458
18459         * parameter.cs (Paramters): Now takes a Location argument.
18460
18461         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18462         make all the code call directly LookupType in RootContext and take
18463         this chance to pass the Location information everywhere.
18464
18465         * Everywhere: pass Location information.
18466
18467 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18468
18469         * class.cs (Constructor.Define): Updated way of detecting the
18470         length of the parameters.
18471
18472         (TypeContainer.DefineType): Use basename as the type name for
18473         nested types.
18474
18475         (TypeContainer.Define): Do not recursively define types here, as
18476         definition is taken care in order by the RootContext.
18477
18478         * tree.cs: Keep track of namespaces in a per-file basis.
18479
18480         * parameter.cs (Parameter.ComputeSignature): Update to use
18481         DeclSpace. 
18482
18483         (Parameters.GetSignature): ditto.
18484
18485         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18486         instead of a TypeContainer.
18487
18488         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18489         resolve names.  Because we need to be resolve in our context, not
18490         our parents.
18491
18492         * driver.cs: Implement response files.
18493
18494         * class.cs (TypeContainer.DefineType): If we are defined, do not
18495         redefine ourselves.
18496
18497         (Event.Emit): Emit the code for add/remove handlers.
18498         (Event.Define): Save the MethodBuilders for add/remove.
18499
18500         * typemanager.cs: Use pair here too.
18501
18502         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18503         DictionaryEntry requires the first argument to be non-null.  
18504
18505         (enum_declaration): Compute full name for registering the
18506         enumeration.
18507
18508         (delegate_declaration): Instead of using
18509         formal_parameter_list, use opt_formal_parameter_list as the list
18510         can be empty.
18511
18512         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18513         (EventParsing): New property that controls whether `add' and
18514         `remove' are returned as tokens or identifiers (for events);
18515
18516 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18517
18518         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18519         use MyEventBuilder only and let it wrap the real builder for us.
18520
18521         (MyEventBuilder): Revamp constructor etc.
18522
18523         Implement all operations that we perform on EventBuilder in precisely the same
18524         way here too.
18525
18526         (FindMembers): Update to use the EventBuilder member.
18527
18528         (Event.Emit): Update accordingly.
18529
18530 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18531
18532         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18533         by calling the appropriate methods.
18534
18535         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18536         useful.
18537
18538         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18539
18540 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18541
18542         * delegate.cs (Delegate.Populate): Check that the return type
18543         and various parameters types are indeed accessible.
18544
18545         * class.cs (Constructor.Define): Same here.
18546
18547         (Field.Define): Ditto.
18548
18549         (Event.Define): Ditto.
18550
18551         (Operator.Define): Check that the underlying Method defined itself
18552         correctly - so it's MethodBuilder should not be null.
18553
18554         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18555         expression happens to be null.
18556
18557         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18558         members but as of now we don't seem to be able to do anything really useful with it.
18559
18560         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18561         not the EventBuilder.
18562
18563 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18564
18565         * cs-tokenizer.cs: Add support for defines.
18566         Add support for #if, #elif, #else, #endif
18567
18568         (eval_var): evaluates a variable.
18569         (eval): stubbed for evaluating functions.
18570
18571         * cs-parser.jay: Pass the defines information
18572
18573         * driver.cs: Add --define command line option.
18574
18575         * decl.cs: Move MemberCore here.
18576
18577         Make it the base class for DeclSpace.  This allows us to catch and
18578         report 108 and 109 for everything now.
18579
18580         * class.cs (TypeContainer.Define): Extract all the members
18581         before populating and emit the warning 108 (new keyword required
18582         to override) instead of having each member implement this.
18583
18584         (MemberCore.Define): New abstract method, we will be using this in
18585         the warning reporting engine in Populate.
18586
18587         (Operator.Define): Adjust to new MemberCore protocol. 
18588
18589         * const.cs (Const): This does not derive from Expression, it is a
18590         temporary object we use to create fields, it is a MemberCore. 
18591
18592         * class.cs (Method.Define): Allow the entry point to be in a
18593         specific class.
18594
18595         * driver.cs: Rewrite the argument handler to clean it up a bit.
18596
18597         * rootcontext.cs: Made it just an auxiliary namespace feature by
18598         making everything static.
18599
18600         * driver.cs: Adapt code to use RootContext type name instead of
18601         instance variable.
18602
18603         * delegate.cs: Remove RootContext argument.
18604
18605         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18606         argument. 
18607
18608         * class.cs (Event.Define): The lookup can fail.
18609
18610         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18611
18612         * expression.cs: Resolve the this instance before invoking the code.
18613
18614 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18615
18616         * cs-parser.jay: Add a production in element_access that allows
18617         the thing to become a "type" reference.  This way we can parse
18618         things like "(string [])" as a type.
18619
18620         Note that this still does not handle the more complex rules of
18621         casts. 
18622
18623
18624         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18625
18626         * ecore.cs: (CopyNewMethods): new utility function used to
18627         assemble the list of methods from running FindMembers.
18628
18629         (MemberLookup): Rework FindMembers so that 
18630
18631 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * class.cs (TypeContainer): Remove Delegates who fail to be
18634         defined.
18635
18636         * delegate.cs (Populate): Verify that we dont get null return
18637         values.   TODO: Check for AsAccessible.
18638
18639         * cs-parser.jay: Use basename to emit error 574 (destructor should
18640         have the same name as container class), not the full name.
18641
18642         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18643         possible representation.  
18644
18645         Also implements integer type suffixes U and L.
18646
18647 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18648
18649         * expression.cs (ArrayCreation.DoResolve): We need to do the
18650         argument resolution *always*.
18651
18652         * decl.cs: Make this hold the namespace.  Hold the root context as
18653         well.
18654         (LookupType): Move here.
18655
18656         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18657
18658         * location.cs (Row, Name): Fixed the code, it was always returning
18659         references to the first file.
18660
18661         * interface.cs: Register properties defined through interfaces.
18662
18663         * driver.cs: Add support for globbing on the command line
18664
18665         * class.cs (Field): Make it derive from MemberCore as well.
18666         (Event): ditto.
18667
18668 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18669
18670         * class.cs (Event::Define): Check that the type of the event is a delegate
18671         type else flag error #66.
18672
18673         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18674         same.
18675
18676         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18677         values of EntryPoint, CharSet etc etc.
18678
18679         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18680
18681         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18682         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18683         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18684         which needs this to do its work.
18685
18686         * ../errors/cs0066.cs : Add.
18687
18688 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18689
18690         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18691         helper functions.
18692
18693         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18694         clears out the parameters field.
18695         (MemberSignatureCompare): Cleanup
18696
18697         (MemberCore): New base class used to share code between MethodCore
18698         and Property.
18699
18700         (RegisterRequiredImplementations) BindingFlags.Public requires
18701         either BindingFlags.Instace or Static.  Use instance here.
18702
18703         (Property): Refactored code to cope better with the full spec.
18704
18705         * parameter.cs (GetParameterInfo): Return an empty array instead
18706         of null on error.
18707
18708         * class.cs (Property): Abstract or extern properties have no bodies.
18709
18710         * parameter.cs (GetParameterInfo): return a zero-sized array.
18711
18712         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18713         method modifier validation to the typecontainer so we can reuse
18714         this on properties.
18715
18716         (MethodCore.ParameterTypes): return an empty sized array of types.
18717
18718         (Property.Define): Test property modifier validity.
18719
18720         Add tests for sealed/override too.
18721
18722         (Method.Emit): abstract or extern methods have no bodies.
18723
18724 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18725
18726         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18727         thing.
18728
18729         (Method::Define, ::Emit): Modify accordingly.
18730
18731         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18732
18733         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18734
18735         * makefile: Pass in /unsafe.
18736
18737 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18738
18739         * class.cs (MakeKey): Kill routine.
18740
18741         * class.cs (TypeContainer.Define): Correctly define explicit
18742         method implementations (they require the full interface name plus
18743         the method name).
18744
18745         * typemanager.cs: Deply the PtrHashtable here and stop using the
18746         lame keys.  Things work so much better.
18747
18748         This of course broke everyone who depended on `RegisterMethod' to
18749         do the `test for existance' test.  This has to be done elsewhere.
18750
18751         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18752         the object stupid Equals method (because, that like fails all over
18753         the place).  We still do not use it.
18754
18755         * class.cs (TypeContainer.SetRequiredInterface,
18756         TypeContainer.RequireMethods): Killed these two routines and moved
18757         all the functionality to RegisterRequiredImplementations.
18758
18759         (TypeContainer.RegisterRequiredImplementations): This routine now
18760         registers all the implementations required in an array for the
18761         interfaces and abstract methods.  We use an array of structures
18762         which can be computed ahead of time to reduce memory usage and we
18763         also assume that lookups are cheap as most classes will not
18764         implement too many interfaces.
18765
18766         We also avoid creating too many MethodSignatures.
18767
18768         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18769         clear the "pending" bit if we find that there are problems with
18770         the declaration.
18771
18772         (TypeContainer.VerifyPendingMethods): Update to report errors of
18773         methods that look like implementations but are not.
18774
18775         (TypeContainer.Define): Add support for explicit interface method
18776         implementation. 
18777
18778 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18779
18780         * typemanager.cs: Keep track of the parameters here instead of
18781         being a feature of the TypeContainer.
18782
18783         * class.cs: Drop the registration of parameters here, as
18784         InterfaceMethods are also interface declarations.
18785
18786         * delegate.cs: Register methods with the TypeManager not only with
18787         the TypeContainer.  This code was buggy.
18788
18789         * interface.cs: Full registation here.
18790
18791 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18792
18793         * expression.cs: Remove reducer for binary expressions, it can not
18794         be done this way.
18795
18796         * const.cs: Put here the code that used to go into constant.cs
18797
18798         * constant.cs: Put here the code for constants, this is a new base
18799         class for Literals.
18800
18801         * literal.cs: Make Literal derive from Constant.
18802
18803 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18804
18805         * statement.cs (Return.Emit): Report error 157 if the user
18806         attempts to return from a finally block.
18807
18808         (Return.Emit): Instead of emitting a return, jump to the end of
18809         the function.
18810
18811         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18812         LocalBuilder to store the result of the function.  ReturnLabel is
18813         the target where we jump.
18814
18815
18816 2001-12-09  Radek Doulik  <rodo@ximian.com>
18817
18818         * cs-parser.jay: remember alias in current namespace
18819
18820         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18821         namespaces
18822
18823         * class.cs (LookupAlias): lookup alias in my_namespace
18824
18825         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18826         aliases hashtable
18827         (LookupAlias): lookup alias in this and if needed in parent
18828         namespaces
18829
18830 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * support.cs: 
18833
18834         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18835         making things static.  I need this to avoid passing the
18836         TypeContainer when calling ParameterType.
18837
18838         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18839         that did string manipulation to compute the type and then call
18840         GetType.  Use Parameter.ParameterType instead.
18841
18842         * cs-tokenizer.cs: Consume the suffix for floating values.
18843
18844         * expression.cs (ParameterReference): figure out whether this is a
18845         reference parameter or not.  Kill an extra variable by computing
18846         the arg_idx during emission.
18847
18848         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18849         function that returns whether a parameter is an out/ref value or not.
18850
18851         (Parameter.ParameterType): The type of the parameter (base,
18852         without ref/out applied).
18853
18854         (Parameter.Resolve): Perform resolution here.
18855         (Parameter.ExternalType): The full type (with ref/out applied).
18856
18857         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18858         support for expressions on the using statement.
18859
18860 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * statement.cs (Using.EmitLocalVariableDecls): Split the
18863         localvariable handling of the using statement.
18864
18865         (Block.EmitMeta): Keep track of variable count across blocks.  We
18866         were reusing slots on separate branches of blocks.
18867
18868         (Try.Emit): Emit the general code block, we were not emitting it. 
18869
18870         Check the type of the declaration to be an IDisposable or
18871         something that can be implicity converted to it. 
18872
18873         Emit conversions if required.
18874
18875         * ecore.cs (EmptyExpression): New utility class.
18876         (Expression.ImplicitConversionExists): New utility function.
18877
18878 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18879
18880         * statement.cs (Using): Implement.
18881
18882         * expression.cs (LocalVariableReference): Support read only variables.
18883
18884         * statement.cs: Remove the explicit emit for the Leave opcode.
18885         (VariableInfo): Add a readonly field.
18886
18887 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18888
18889         * ecore.cs (ConvCast): new class used to encapsulate the various
18890         explicit integer conversions that works in both checked and
18891         unchecked contexts.
18892
18893         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18894         properly generate the overflow opcodes.
18895
18896 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18897
18898         * statement.cs: The correct type for the EmptyExpression is the
18899         element_type, not the variable type.  Ravi pointed this out.
18900
18901 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18902
18903         * class.cs (Method::Define): Handle PInvoke methods specially
18904         by using DefinePInvokeMethod instead of the usual one.
18905
18906         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18907         above to do the task of extracting information and defining the method.
18908
18909 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18910
18911         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18912         of the condition for string type.
18913
18914         (Emit): Move that here. 
18915
18916         (ArrayCreation::CheckIndices): Keep string literals in their expression
18917         form.
18918
18919         (EmitDynamicInitializers): Handle strings appropriately.
18920
18921 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18922
18923         * codegen.cs (EmitContext): Replace multiple variables with a
18924         single pointer to the current Switch statement.
18925
18926         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18927         EmitContext.
18928
18929 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18930
18931         * statement.cs 
18932
18933         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18934         default'.
18935
18936         (Foreach.Emit): Foreach on arrays was not setting
18937         up the loop variables (for break/continue).
18938
18939         (GotoCase): Semi-implented.
18940
18941 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18942
18943         * attribute.cs (CheckAttribute): Handle system attributes by using
18944         Attribute.GetAttributes to examine information we need.
18945
18946         (GetValidPlaces): Same here.
18947
18948         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18949
18950         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18951
18952         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18953
18954         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18955
18956         (Method::Emit): Handle the case when we are a PInvoke method.
18957
18958 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18959
18960         * expression.cs: Use ResolveWithSimpleName on compound names.
18961
18962 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18963
18964         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18965         before trying to reduce it.
18966
18967         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18968
18969         * constant.cs (LookupConstantValue): Implement.
18970
18971         (EmitConstant): Use the above in emitting the constant.
18972
18973         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18974         that are user-defined by doing a LookupConstantValue on them.
18975
18976         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18977         too, like above.
18978
18979 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18980
18981         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18982
18983         (BaseAccess.DoResolve): Implement.
18984
18985         (MemberAccess.DoResolve): Split this routine into a
18986         ResolveMemberAccess routine that can be used independently
18987
18988 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18991         As that share bits of the implementation.  Is returns a boolean,
18992         while As returns the Type that is being probed.
18993
18994 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18995
18996         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18997         instead of a Literal - much easier.
18998
18999         (EnumInTransit): Remove - utterly useless :-)
19000
19001         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19002
19003         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19004
19005         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19006         chain when we have no associated expression.
19007
19008 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19009
19010         * constant.cs (Define): Use Location while reporting the errror.
19011
19012         Also emit a warning when 'new' is used and there is no inherited
19013         member to hide.
19014
19015         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19016         populated.
19017
19018         (LookupEnumValue): Implement to lookup an enum member's value and define it
19019         if necessary.
19020
19021         (Populate): Re-write accordingly to use the above routine.
19022
19023 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19024
19025         * expression.cs (This): Fix prototype for DoResolveLValue to
19026         override the base class DoResolveLValue.
19027
19028         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19029         declarations) 
19030
19031         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19032         (we need to load the address of the field here).  This fixes
19033         test-22. 
19034
19035         (FieldExpr.DoResolveLValue): Call the DoResolve
19036         function to initialize the Instance expression.
19037
19038         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19039         correctly the GetEnumerator operation on a value type.
19040
19041         * cs-parser.jay: Add more simple parsing error catches.
19042
19043         * statement.cs (Switch): Add support for string switches.
19044         Handle null specially.
19045
19046         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19047
19048 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19049
19050         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19051
19052         (declare_local_constant): New helper function.
19053
19054         * statement.cs (AddConstant): Keep a separate record of constants
19055
19056         (IsConstant): Implement to determine if a variable is a constant.
19057
19058         (GetConstantExpression): Implement.
19059
19060         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19061
19062         * statement.cs (IsVariableDefined): Re-write.
19063
19064 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19065
19066         * class.cs (TypeContainer::FindMembers): Look for constants
19067         in the case when we are looking for MemberTypes.Field
19068
19069         * expression.cs (MemberAccess::DoResolve): Check that in the
19070         case we are a FieldExpr and a Literal, we are not being accessed
19071         by an instance reference.
19072
19073         * cs-parser.jay (local_constant_declaration): Implement.
19074
19075         (declaration_statement): Implement for constant declarations.
19076
19077 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19078
19079         * statement.cs (Switch): Catch double defaults.
19080
19081         (Switch): More work on the switch() statement
19082         implementation.  It works for integral values now, need to finish
19083         string support.
19084
19085
19086 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19087
19088         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19089         integer literals into other integer literals.  To be used by
19090         switch. 
19091
19092 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19093
19094         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19095         some memory.
19096
19097         (EmitDynamicInitializers): Cope with the above since we extract data
19098         directly from ArrayData now.
19099
19100         (ExpectInitializers): Keep track of whether initializers are mandatory
19101         or not.
19102
19103         (Bounds): Make it a hashtable to prevent the same dimension being 
19104         recorded for every element in that dimension.
19105
19106         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19107         from being found.
19108
19109         Also fix bug which was causing the indices to be emitted in the reverse
19110         order.
19111
19112 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19113
19114         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19115         unfinished.  They do not work, because the underlying code is
19116         sloppy.
19117
19118 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19119
19120         * cs-parser.jay: Remove bogus fixme.
19121
19122         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19123         on Switch statement.
19124
19125 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19126
19127         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19128         the same. 
19129
19130         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19131         parameter. Apparently, any expression is allowed. 
19132
19133         (ValidateInitializers): Update accordingly.
19134
19135         (CheckIndices): Fix some tricky bugs thanks to recursion.
19136
19137         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19138         I was being completely brain-dead.
19139
19140         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19141         and re-write acordingly.
19142
19143         (DelegateInvocation): Re-write accordingly.
19144
19145         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19146
19147         (MakeByteBlob): Handle types more correctly.
19148
19149         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19150         initialization from expressions but it is incomplete because I am a complete
19151         Dodo :-|
19152
19153 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19154
19155         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19156         on If.  Basically, we have to return `true' (ie, we do return to
19157         our caller) only if both branches of the if return.
19158
19159         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19160         short-circuit operators, handle them as short circuit operators. 
19161
19162         (Cast.DoResolve): Resolve type.
19163         (Cast.Cast): Take an expression as the target type.
19164
19165         * cs-parser.jay (cast_expression): Remove old hack that only
19166         allowed a limited set of types to be handled.  Now we take a
19167         unary_expression and we resolve to a type during semantic
19168         analysis.
19169
19170         Use the grammar productions from Rhys to handle casts (this is
19171         not complete like Rhys syntax yet, we fail to handle that corner
19172         case that C# has regarding (-x), but we will get there.
19173
19174 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19175
19176         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19177         field which is an array type.
19178
19179         * cs-parser.jay (declare_local_variables): Support array initialization too.
19180
19181         * typemanager.cs (MakeKey): Implement.
19182
19183         (everywhere): Use the above appropriately.
19184
19185         * cs-parser.jay (for_statement): Update for array initialization while
19186         declaring variables.
19187
19188         * ecore.cs : The error message was correct, it's the variable's names that
19189         were misleading ;-) Make the code more readable.
19190
19191         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19192         the correct type etc.
19193
19194         (ConvertExplicit): Handle Enum types by examining the underlying type.
19195
19196 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19197
19198         * parameter.cs (GetCallingConvention): Always return
19199         CallingConventions.Standard for now.
19200
19201 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19202
19203         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19204         and `r' after calling DoNumericPromotions.
19205
19206         * ecore.cs: Fix error message (the types were in the wrong order).
19207
19208         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19209         BindingFlags.Instance as well 
19210
19211         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19212         implicit int literal conversion in an empty cast so that we
19213         propagate the right type upstream.
19214
19215         (UnboxCast): new class used to unbox value types.
19216         (Expression.ConvertExplicit): Add explicit type conversions done
19217         by unboxing.
19218
19219         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19220         the target type before applying the implicit LongLiterals to ULong
19221         literal cast.
19222
19223 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * cs-parser.jay (for_statement): Reworked the way For works: now
19226         we declare manually any variables that are introduced in
19227         for_initializer to solve the problem of having out-of-band code
19228         emition (that is what got for broken).
19229
19230         (declaration_statement): Perform the actual variable declaration
19231         that used to be done in local_variable_declaration here.
19232
19233         (local_variable_declaration): Do not declare anything, just pass
19234         the information on a DictionaryEntry
19235
19236 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19237
19238         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19239         re-write of the logic to now make it recursive.
19240
19241         (UpdateIndices): Re-write accordingly.
19242
19243         Store element data in a separate ArrayData list in the above methods.
19244
19245         (MakeByteBlob): Implement to dump the array data into a byte array.
19246
19247 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19248
19249         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19250         into CheckIndices.
19251
19252         * constant.cs (Define): Implement.
19253
19254         (EmitConstant): Re-write fully.
19255
19256         Pass in location info.
19257
19258         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19259         respectively.
19260
19261         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19262         DictionaryEntry since we need location info too.
19263
19264         (constant_declaration): Update accordingly.
19265
19266         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19267         code into another method : UpdateIndices.
19268
19269 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19270
19271         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19272         some type checking etc.
19273
19274 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19275
19276         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19277         bits to provide dimension info if the user skips doing that.
19278
19279         Update second constructor to store the rank correctly.
19280
19281 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19282
19283         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19284         and try to implement.
19285
19286         * ../errors/cs0150.cs : Add.
19287
19288         * ../errors/cs0178.cs : Add.
19289
19290 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19291
19292         * statement.cs: Implement foreach on multi-dimensional arrays. 
19293
19294         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19295         name of the params argument.
19296
19297         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19298         initializing the array.
19299
19300         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19301         we can use this elsewhere.
19302
19303         * statement.cs: Finish implementation of foreach for single
19304         dimension arrays.
19305
19306         * cs-parser.jay: Use an out-of-band stack to pass information
19307         around, I wonder why I need this.
19308
19309         foreach_block: Make the new foreach_block the current_block.
19310
19311         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19312         function used to return a static Parameters structure.  Used for
19313         empty parameters, as those are created very frequently.
19314
19315         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19316
19317 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19318
19319         * interface.cs : Default modifier is private, not public. The
19320         make verify test passes again.
19321
19322 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19323
19324         * support.cs (ReflectionParameters): Fix logic to determine
19325         whether the last parameter is a params one. Test 9 passes again.
19326
19327         * delegate.cs (Populate): Register the builders we define with
19328         RegisterParameterForBuilder. Test 19 passes again.
19329
19330         * cs-parser.jay (property_declaration): Reference $6 instead
19331         of $$ to get at the location.
19332
19333         (indexer_declaration): Similar stuff.
19334
19335         (attribute): Ditto.
19336
19337         * class.cs (Property): Register parameters for the Get and Set methods
19338         if they exist. Test 23 passes again.
19339
19340         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19341         call to EmitArguments as we are sure there aren't any params arguments. 
19342         Test 32 passes again.
19343
19344         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19345         IndexOutOfRangeException. 
19346
19347         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19348         Test 33 now passes again.
19349
19350 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19351
19352         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19353         broke a bunch of things.  Will have to come up with a better way
19354         of tracking locations.
19355
19356         * statement.cs: Implemented foreach for single dimension arrays.
19357
19358 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19359
19360         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19361         an error.  This removes the lookup from the critical path.
19362
19363         * cs-parser.jay: Removed use of temporary_loc, which is completely
19364         broken. 
19365
19366 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * support.cs (ReflectionParameters.ParameterModifier): Report
19369         whether the argument is a PARAMS argument or not.
19370
19371         * class.cs: Set the attribute `ParamArrayAttribute' on the
19372         parameter argument.
19373
19374         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19375         and cons_param_array_attribute (ConstructorInfo for
19376         ParamArrayAttribute)., 
19377
19378         * codegen.cs: Emit the return using the `Return' statement, that
19379         way we can report the error correctly for missing return values. 
19380
19381         * class.cs (Method.Emit): Clean up.
19382
19383         * expression.cs (Argument.Resolve): Take another argument: the
19384         location where this argument is used.  Notice that this is not
19385         part of the "Argument" class as to reduce the size of the
19386         structure (we know the approximate location anyways).
19387
19388         Test if the argument is a variable-reference, if not, then
19389         complain with a 206.
19390
19391         (Argument.Emit): Emit addresses of variables.
19392
19393         (Argument.FullDesc): Simplify.
19394
19395         (Invocation.DoResolve): Update for Argument.Resolve.
19396
19397         (ElementAccess.DoResolve): ditto.
19398
19399         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19400         method should be virtual, as this method is always virtual.
19401
19402         (NewDelegate.DoResolve): Update for Argument.Resolve.
19403
19404         * class.cs (ConstructorInitializer.DoResolve): ditto.
19405
19406         * attribute.cs (Attribute.Resolve): ditto.
19407
19408 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19411
19412         * expression.cs (ParameterReference): Drop IStackStorage and implement
19413         IAssignMethod instead. 
19414
19415         (LocalVariableReference): ditto.
19416
19417         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19418         IAssignMethod instead. 
19419
19420 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19421
19422         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19423         enumerations that are used in heavily used structures derive from
19424         byte in a laughable and pathetic attempt to reduce memory usage.
19425         This is the kind of pre-optimzations that you should not do at
19426         home without adult supervision.
19427
19428         * expression.cs (UnaryMutator): New class, used to handle ++ and
19429         -- separatedly from the other unary operators.  Cleans up the
19430         code, and kills the ExpressionStatement dependency in Unary.
19431
19432         (Unary): Removed `method' and `Arguments' from this class, making
19433         it smaller, and moving it all to SimpleCall, so I can reuse this
19434         code in other locations and avoid creating a lot of transient data
19435         strucutres when not required.
19436
19437         * cs-parser.jay: Adjust for new changes.
19438
19439 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * enum.cs (Enum.Populate): If there is a failure during
19442         definition, return
19443
19444         * cs-parser.jay (opt_enum_base): we used to catch type errors
19445         here, but this is really incorrect.  The type error should be
19446         catched during semantic analysis.
19447
19448 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19449
19450         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19451         current_local_parameters as expected since I, in my stupidity, had forgotten
19452         to do this :-)
19453
19454         * attribute.cs (GetValidPlaces): Fix stupid bug.
19455
19456         * class.cs (Method::Emit): Perform check on applicability of attributes.
19457
19458         (Constructor::Emit): Ditto.
19459
19460         (Field::Emit): Ditto.
19461
19462         (Field.Location): Store location information.
19463
19464         (Property, Event, Indexer, Operator): Ditto.
19465
19466         * cs-parser.jay (field_declaration): Pass in location for each field.
19467
19468         * ../errors/cs0592.cs : Add.
19469
19470 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19471
19472         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19473
19474         (InitCoreTypes): Update accordingly.
19475
19476         (RegisterAttrType, LookupAttr): Implement.
19477
19478         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19479         info about the same.
19480
19481         (Resolve): Update to populate the above as necessary.
19482
19483         (Error592): Helper.
19484
19485         (GetValidPlaces): Helper to the above.
19486
19487         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19488
19489         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19490
19491 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19492
19493         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19494
19495         * ../errors/cs0617.cs : Add.
19496
19497 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19498
19499         * enum.cs (Emit): Rename to Populate to be more consistent with what
19500         we expect it to do and when exactly it is called.
19501
19502         * class.cs, rootcontext.cs : Update accordingly.
19503
19504         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19505         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19506
19507         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19508
19509         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19510         of a fieldinfo using the above, when dealing with a FieldBuilder.
19511
19512 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19513
19514         * ../errors/cs0031.cs : Add.
19515
19516         * ../errors/cs1008.cs : Add.
19517
19518         * ../errrors/cs0543.cs : Add.
19519
19520         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19521         enum type.
19522
19523         (FindMembers): Implement.
19524
19525         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19526         enums and delegates too.
19527
19528         (enum_types): Rename to builder_to_enum.
19529
19530         (delegate_types): Rename to builder_to_delegate.
19531
19532         * delegate.cs (FindMembers): Implement.
19533
19534 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19535
19536         * typemanager.cs (IsEnumType): Implement.
19537
19538         * enum.cs (Emit): Re-write parts to account for the underlying type
19539         better and perform checking etc.
19540
19541         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19542         of the underlying type.
19543
19544         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19545         value
19546
19547         * enum.cs (error31): Helper to report error #31.
19548
19549         * cs-parser.jay (enum_declaration): Store location of each member too.
19550
19551         * enum.cs (member_to_location): New hashtable. 
19552
19553         (AddEnumMember): Update location hashtable.
19554
19555         (Emit): Use the location of each member while reporting errors.
19556
19557 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19558
19559         * cs-parser.jay: A for_initializer if is a
19560         local_variable_declaration really ammount to have an implicit
19561         block with the variable declaration and no initializer for for.
19562
19563         * statement.cs (For.Emit): Cope with null initializers.
19564
19565         This fixes the infinite loop on for initializers.
19566
19567 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * enum.cs: More cleanup.
19570
19571         * ecore.cs: Remove dead code.
19572
19573         * class.cs (Property.Emit): More simplification.
19574         (Event.Emit): ditto.
19575
19576         Reworked to have less levels of indentation.
19577
19578 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19579
19580         * class.cs (Property): Emit attributes.
19581
19582         (Field): Ditto.
19583
19584         (Event): Ditto.
19585
19586         (Indexer): Ditto.
19587
19588         (Operator): Ditto.
19589
19590         * enum.cs (Emit): Ditto.
19591
19592         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19593         Enums too.
19594
19595         * class.cs (Field, Event, etc.): Move attribute generation into the
19596         Emit method everywhere.
19597
19598         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19599         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19600         as we had no way of defining nested enums !
19601
19602         * rootcontext.cs : Adjust code accordingly.
19603
19604         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19605
19606 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19607
19608         * expression.cs (EvalConstantExpression): Move into ecore.cs
19609
19610         * enum.cs (Enum): Rename some members and make them public and readonly
19611         according to our convention.
19612
19613         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19614         nothing else.
19615
19616         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19617
19618         (Enum::Emit): Write a simple version for now which doesn't try to compute
19619         expressions. I shall modify this to be more robust in just a while.
19620
19621         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19622
19623         (TypeContainer::CloseType): Create the Enum types too.
19624
19625         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19626
19627         * expression.cs (EvalConstantExpression): Get rid of completely.
19628
19629         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19630         user-defined values and other cases.
19631
19632         (IsValidEnumLiteral): Helper function.
19633
19634         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19635         out there in the case we had a literal FieldExpr.
19636
19637         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19638
19639         (Literalize): Revamp a bit to take two arguments.
19640
19641         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19642
19643 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19644
19645         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19646
19647         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19648
19649         (Resolve): Use the above to ensure we have proper initializers.
19650
19651 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19652
19653         * expression.cs (Expression::EvalConstantExpression): New method to 
19654         evaluate constant expressions.
19655
19656         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19657
19658 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19659
19660         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19661         in an array.
19662
19663         (Binary.ResolveOperator): Handle operator != (object a, object b)
19664         and operator == (object a, object b);
19665
19666         (Binary.DoNumericPromotions): Indicate whether the numeric
19667         promotion was possible.
19668
19669         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19670         Implement.  
19671
19672         Made the ArrayAccess implement interface IAssignMethod instead of
19673         IStackStore as the order in which arguments are passed reflects
19674         this.
19675
19676         * assign.cs: Instead of using expr.ExprClass to select the way of
19677         assinging, probe for the IStackStore/IAssignMethod interfaces.
19678
19679         * typemanager.cs: Load InitializeArray definition.
19680
19681         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19682         static data that can be used to initialize arrays. 
19683
19684 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19685
19686         * expression.cs: Handle operator== and operator!= for booleans.
19687
19688         (Conditioal.Reduce): Implement reducer for the ?: operator.
19689
19690         (Conditional.Resolve): Implement dead code elimination.
19691
19692         (Binary.Resolve): Catch string literals and return a new
19693         concatenated string.
19694
19695         (Unary.Reduce): Implement reduction of unary expressions.
19696
19697         * ecore.cs: Split out the expression core handling here.
19698
19699         (Expression.Reduce): New method used to perform constant folding
19700         and CSE.  This is needed to support constant-expressions. 
19701
19702         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19703         targets, and optimize for !x.
19704
19705 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19706
19707         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19708         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19709         set custom atttributes.
19710
19711         * literal.cs (Literal::GetValue): New abstract method to return the actual
19712         value of the literal, cast as an object.
19713
19714         (*Literal): Implement GetValue method.
19715
19716         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19717         expressions to the arraylist but objects of type Argument.
19718
19719         * class.cs (TypeContainer::Emit): Emit our attributes too.
19720
19721         (Method::Emit, Constructor::Emit): Ditto.
19722
19723         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19724         to be ignoring earlier.
19725
19726 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19727
19728         * attribute.cs (AttributeSection::Define): Implement to do the business
19729         of constructing a CustomAttributeBuilder.
19730
19731         (Attribute): New trivial class. Increases readability of code.  
19732
19733         * cs-parser.jay : Update accordingly.
19734
19735         (positional_argument_list, named_argument_list, named_argument): New rules
19736
19737         (attribute_arguments): Use the above so that we are more correct.
19738
19739 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19740
19741         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19742         to perform all checks for a method with a params parameter.
19743
19744         (Invocation::OverloadResolve): Update to use the above method and therefore
19745         cope correctly with params method invocations.
19746
19747         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19748         params too.
19749
19750         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19751         constructors in our parent too because we can't afford to miss out on 
19752         protected ones ;-)
19753
19754         * attribute.cs (AttributeSection): New name for the class Attribute
19755
19756         Other trivial changes to improve readability.
19757
19758         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19759         use the new class names.
19760
19761 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19762
19763         * class.cs (Method::Define): Complete definition for params types too
19764
19765         (Indexer::Define): Ditto.
19766
19767         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19768         Cope everywhere with a request for info about the array parameter.
19769
19770 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19771
19772         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19773
19774         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19775         local_variable_type to extract the string corresponding to the type.
19776
19777         (local_variable_type): Fixup the action to use the new helper method.
19778
19779         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19780         go.
19781
19782         * expression.cs : Clean out code which uses the above.
19783
19784 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19785
19786         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19787         and bale out if necessary by returning a false.
19788
19789         (RegisterProperty): Ditto.
19790
19791         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19792         and print out appropriate error messages.
19793
19794         * interface.cs (everywhere): Ditto.
19795
19796         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19797         location to constructor.
19798
19799         * class.cs (Property, Event, Indexer): Update accordingly.
19800
19801         * ../errors/cs111.cs : Added.
19802
19803         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19804         of a method, as laid down by the spec.
19805
19806         (Invocation::OverloadResolve): Use the above method.
19807
19808 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19809
19810         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19811         now take a TypeContainer and a Parameters object.
19812
19813         (ParameterData): Modify return type of ParameterModifier method to be 
19814         Parameter.Modifier and not a string.
19815
19816         (ReflectionParameters, InternalParameters): Update accordingly.
19817
19818         * expression.cs (Argument::GetParameterModifier): Same here.
19819
19820         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19821         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19822         symbol in it at all so maybe this is only for now.
19823
19824 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19825
19826         * support.cs (InternalParameters): Constructor now takes an extra argument 
19827         which is the actual Parameters class.
19828
19829         (ParameterDesc): Update to provide info on ref/out modifiers.
19830
19831         * class.cs (everywhere): Update call to InternalParameters to pass in
19832         the second argument too.
19833
19834         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19835         to return the modifier info [ref/out etc]
19836
19837         (InternalParameters, ReflectionParameters): Implement the above.
19838
19839         * expression.cs (Argument::ParameterModifier): Similar function to return
19840         info about the argument's modifiers.
19841
19842         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19843         too.
19844
19845         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19846         a new SetFormalParameters object which we pass to InternalParameters.
19847
19848 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19849
19850         * expression.cs (NewArray): Merge into the ArrayCreation class.
19851
19852 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19853
19854         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19855         NewUserdefinedArray into one as there wasn't much of a use in having
19856         two separate ones.
19857
19858         * expression.cs (Argument): Change field's name to ArgType from Type.
19859
19860         (Type): New readonly property which returns the proper type, taking into 
19861         account ref/out modifiers.
19862
19863         (everywhere): Adjust code accordingly for the above.
19864
19865         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19866         whether we are emitting for a ref or out parameter.
19867
19868         * expression.cs (Argument::Emit): Use the above field to set the state.
19869
19870         (LocalVariableReference::Emit): Update to honour the flag and emit the
19871         right stuff.
19872
19873         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19874
19875         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19876
19877         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19878
19879         (ReflectionParameters, InternalParameters): Implement the above method.
19880
19881         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19882         reporting errors.
19883
19884         (Invocation::FullMethodDesc): Ditto. 
19885
19886 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * cs-parser.jay: Add extra production for the second form of array
19889         creation. 
19890
19891         * expression.cs (ArrayCreation): Update to reflect the above
19892         change. 
19893
19894         * Small changes to prepare for Array initialization.
19895
19896 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19897
19898         * typemanager.cs (ImplementsInterface): interface might be null;
19899         Deal with this problem;
19900
19901         Also, we do store negative hits on the cache (null values), so use
19902         this instead of calling t.GetInterfaces on the type everytime.
19903
19904 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19905
19906         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19907
19908         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19909         split functionality out into different classes.
19910
19911         (New::FormArrayType): Move into NewBuiltinArray.
19912
19913         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19914         quite useless.
19915
19916         (NewBuiltinArray): New class to handle creation of built-in arrays.
19917
19918         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19919         account creation of one-dimensional arrays.
19920
19921         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19922
19923         (NewUserdefinedArray::DoResolve): Implement.
19924
19925         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19926
19927         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19928         we maintain inside the TypeManager. This is necessary to perform lookups on the
19929         module builder.
19930
19931         (LookupType): Update to perform GetType on the module builders too.     
19932
19933         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19934
19935         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19936
19937 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19938
19939         * expression.cs (New::DoResolve): Implement guts of array creation.
19940
19941         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19942
19943 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19944
19945         * expression.cs: Fix bug I introduced lsat night that broke
19946         Delegates. 
19947
19948         (Expression.Resolve): Report a 246 error (can not resolve name)
19949         if we find a SimpleName in the stream.
19950
19951         (Expression.ResolveLValue): Ditto.
19952
19953         (Expression.ResolveWithSimpleName): This function is a variant of
19954         ResolveName, this one allows SimpleNames to be returned without a
19955         warning.  The only consumer of SimpleNames is MemberAccess
19956
19957 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19960         might arrive here.  I have my doubts that this is correct.
19961
19962         * statement.cs (Lock): Implement lock statement.
19963
19964         * cs-parser.jay: Small fixes to support `lock' and `using'
19965
19966         * cs-tokenizer.cs: Remove extra space
19967
19968         * driver.cs: New flag --checked, allows to turn on integer math
19969         checking. 
19970
19971         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19972         Threading.Monitor.Exit 
19973
19974 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19975
19976         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19977         Expression Class to be IndexerAccess.
19978
19979         Notice that Indexer::DoResolve sets the eclass to Value.
19980
19981 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * class.cs (TypeContainer::Emit): Emit code for indexers.
19984
19985         * assign.cs (IAssignMethod): New interface implemented by Indexers
19986         and Properties for handling assignment.
19987
19988         (Assign::Emit): Simplify and reuse code. 
19989
19990         * expression.cs (IndexerAccess, PropertyExpr): Implement
19991         IAssignMethod, clean up old code. 
19992
19993 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19994
19995         * typemanager.cs (ImplementsInterface): New method to determine if a type
19996         implements a given interface. Provides a nice cache too.
19997
19998         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19999         method.
20000
20001         (ConvertReferenceExplicit): Ditto.
20002
20003         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20004         various methods, with correct names etc.
20005
20006         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20007         Operator.UnaryNegation.
20008
20009         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20010         we have a unary plus or minus operator.
20011
20012         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20013         UnaryMinus.
20014
20015         * everywhere : update accordingly.
20016
20017         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20018         respectively.
20019
20020         * class.cs (Method::Define): For the case where we are implementing a method
20021         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20022         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20023
20024 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20025
20026         * interface.cs (FindMembers): Implement to work around S.R.E
20027         lameness.
20028
20029         * typemanager.cs (IsInterfaceType): Implement.
20030
20031         (FindMembers): Update to handle interface types too.
20032
20033         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20034         use IsAssignableFrom as that is not correct - it doesn't work.
20035
20036         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20037         and accordingly override EmitStatement.
20038
20039         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20040         using the correct logic :-)
20041
20042 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20043
20044         * ../errors/cs-11.cs : Add to demonstrate error -11 
20045
20046 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20047
20048         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20049         then pass this as a hint to ResolveLValue.
20050
20051         * expression.cs (FieldExpr): Add Location information
20052
20053         (FieldExpr::LValueResolve): Report assignment to readonly
20054         variable. 
20055
20056         (Expression::ExprClassFromMemberInfo): Pass location information.
20057
20058         (Expression::ResolveLValue): Add new method that resolves an
20059         LValue. 
20060
20061         (Expression::DoResolveLValue): Default invocation calls
20062         DoResolve. 
20063
20064         (Indexers): New class used to keep track of indexers in a given
20065         Type. 
20066
20067         (IStackStore): Renamed from LValue, as it did not really describe
20068         what this did.  Also ResolveLValue is gone from this interface and
20069         now is part of Expression.
20070
20071         (ElementAccess): Depending on the element access type
20072
20073         * typemanager.cs: Add `indexer_name_type' as a Core type
20074         (System.Runtime.CompilerServices.IndexerNameAttribute)
20075
20076         * statement.cs (Goto): Take a location.
20077
20078 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20079
20080         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20081         if two delegates are compatible.
20082
20083         (NewDelegate::DoResolve): Update to take care of the case when
20084         we instantiate a delegate from another delegate.
20085
20086         * typemanager.cs (FindMembers): Don't even try to look up members
20087         of Delegate types for now.
20088
20089 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20090
20091         * delegate.cs (NewDelegate): New class to take care of delegate
20092         instantiation.
20093
20094         * expression.cs (New): Split the delegate related code out into 
20095         the NewDelegate class.
20096
20097         * delegate.cs (DelegateInvocation): New class to handle delegate 
20098         invocation.
20099
20100         * expression.cs (Invocation): Split out delegate related code into
20101         the DelegateInvocation class.
20102
20103 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20104
20105         * expression.cs (New::DoResolve): Implement delegate creation fully
20106         and according to the spec.
20107
20108         (New::DoEmit): Update to handle delegates differently.
20109
20110         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20111         because of which we were printing out arguments in reverse order !
20112
20113         * delegate.cs (VerifyMethod): Implement to check if the given method
20114         matches the delegate.
20115
20116         (FullDelegateDesc): Implement.
20117
20118         (VerifyApplicability): Implement.
20119
20120         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20121         delegate invocations too.
20122
20123         (Invocation::Emit): Ditto.
20124
20125         * ../errors/cs1593.cs : Added.
20126
20127         * ../errors/cs1594.cs : Added.
20128
20129         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20130
20131 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20132
20133         * typemanager.cs (intptr_type): Core type for System.IntPtr
20134
20135         (InitCoreTypes): Update for the same.
20136
20137         (iasyncresult_type, asynccallback_type): Ditto.
20138
20139         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20140         correct.
20141
20142         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20143         too.
20144
20145         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20146         the builders for the 4 members of a delegate type :-)
20147
20148         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20149         type.
20150
20151         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20152
20153         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20154
20155 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20156
20157         * statement.cs (Break::Emit): Implement.   
20158         (Continue::Emit): Implement.
20159
20160         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20161         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20162         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20163         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20164         end loop
20165
20166         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20167         properties that track the label for the current loop (begin of the
20168         loop and end of the loop).
20169
20170 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20171
20172         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20173         use of emitting anything at all.
20174
20175         * class.cs, rootcontext.cs : Get rid of calls to the same.
20176
20177         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20178
20179         (Populate): Define the constructor correctly and set the implementation
20180         attributes.
20181
20182         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20183         have been defined.
20184
20185         (AddDelegateType): Implement.
20186
20187         (IsDelegateType): Implement helper method.
20188
20189         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20190
20191         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20192         and accordingly handle it.
20193
20194         * delegate.cs (Populate): Take TypeContainer argument.
20195         Implement bits to define the Invoke method. However, I still haven't figured out
20196         how to take care of the native int bit :-(
20197
20198         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20199         Qualify the name of the delegate, not its return type !
20200
20201         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20202         conversion.
20203
20204         (StandardConversionExists): Checking for array types turns out to be recursive.
20205
20206         (ConvertReferenceExplicit): Implement array conversion.
20207
20208         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20209
20210 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20211
20212         * cs-parser.jay (delegate_declaration): Store the fully qualified
20213         name as it is a type declaration.
20214
20215         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20216         readonly.
20217
20218         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20219         as TypeContainer::DefineType.
20220
20221         (Populate): Method in which all the definition of the various methods (Invoke)
20222         etc is done.
20223
20224         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20225         see.
20226
20227         (CloseDelegate): Finally creates the delegate.
20228
20229         * class.cs (TypeContainer::DefineType): Update to define delegates.
20230         (Populate, Emit and CloseType): Do the same thing here too.
20231
20232         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20233         delegates in all these operations.
20234
20235 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20236
20237         * expression.cs: LocalTemporary: a new expression used to
20238         reference a temporary that has been created.
20239
20240         * assign.cs: Handle PropertyAccess back here, so that we can
20241         provide the proper semantic access to properties.
20242
20243         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20244         a few more explicit conversions. 
20245
20246         * modifiers.cs: `NEW' modifier maps to HideBySig.
20247
20248         * expression.cs (PropertyExpr): Make this into an
20249         ExpressionStatement, and support the EmitStatement code path. 
20250
20251         Perform get/set error checking, clean up the interface.
20252
20253         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20254         them into toplevel access objects.
20255
20256 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20257
20258         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20259         SRE.
20260
20261         * typemanager.cs: Keep track here of our PropertyBuilders again to
20262         work around lameness in SRE.
20263
20264 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20265
20266         * expression.cs (LValue::LValueResolve): New method in the
20267         interface, used to perform a second resolution pass for LValues. 
20268
20269         (This::DoResolve): Catch the use of this in static methods.
20270
20271         (This::LValueResolve): Implement.
20272
20273         (This::Store): Remove warning, assigning to `this' in structures
20274         is 
20275
20276         (Invocation::Emit): Deal with invocation of
20277         methods on value types.  We need to pass the address to structure
20278         methods rather than the object itself.  (The equivalent code to
20279         emit "this" for structures leaves the entire structure on the
20280         stack instead of a pointer to it). 
20281
20282         (ParameterReference::DoResolve): Compute the real index for the
20283         argument based on whether the method takes or not a `this' pointer
20284         (ie, the method is static).
20285
20286         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20287         value types returned from functions when we need to invoke a
20288         method on the sturcture.
20289
20290
20291 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20292
20293         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20294         defining the type in the Modulebuilder or Typebuilder. This is to take
20295         care of nested types which need to be defined on the TypeBuilder using
20296         DefineNestedMethod.
20297
20298         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20299         methods in RootContext, only ported to be part of TypeContainer.
20300
20301         (TypeContainer::GetInterfaceOrClass): Ditto.
20302
20303         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20304
20305         * interface.cs (Interface::DefineInterface): New method. Does exactly
20306         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20307         too.
20308
20309         (Interface::GetInterfaces): Move from RootContext here and port.
20310
20311         (Interface::GetInterfaceByName): Same here.
20312
20313         * rootcontext.cs (ResolveTree): Re-write.
20314
20315         (PopulateTypes): Re-write.
20316
20317         * class.cs (TypeContainer::Populate): Populate nested types too.
20318         (TypeContainer::Emit): Emit nested members too.
20319
20320         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20321         instead just use the name argument passed in as it is already fully
20322         qualified.
20323
20324         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20325         to TypeContainer mapping to see if a type is user-defined.
20326
20327         * class.cs (TypeContainer::CloseType): Implement. 
20328
20329         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20330         the default constructor.
20331
20332         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20333         twice.
20334
20335         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20336
20337         * interface.cs (CloseType): Create the type here.
20338
20339         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20340         the hierarchy.
20341
20342         Remove all the methods which are now in TypeContainer.
20343
20344 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20345
20346         * delegate.cs (Define): Re-write bits to define the delegate
20347         correctly.
20348
20349 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20350
20351         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20352
20353         * expression.cs (ImplicitReferenceConversion): handle null as well
20354         as a source to convert to any reference type.
20355
20356         * statement.cs (Return): Perform any implicit conversions to
20357         expected return type.  
20358
20359         Validate use of return statement.  
20360
20361         * codegen.cs (EmitContext): Pass the expected return type here.
20362
20363         * class.cs (Method, Constructor, Property): Pass expected return
20364         type to EmitContext.
20365
20366 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20367
20368         * expression.cs: Make DoResolve take an EmitContext instead of a
20369         TypeContainer.
20370
20371         Replaced `l' and `location' for `loc', for consistency.
20372
20373         (Error, Warning): Remove unneeded Tc argument.
20374
20375         * assign.cs, literal.cs, constant.cs: Update to new calling
20376         convention. 
20377
20378         * codegen.cs: EmitContext now contains a flag indicating whether
20379         code is being generated in a static method or not.
20380
20381         * cs-parser.jay: DecomposeQI, new function that replaces the old
20382         QualifiedIdentifier.  Now we always decompose the assembled
20383         strings from qualified_identifier productions into a group of
20384         memberaccesses.
20385
20386 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20387
20388         * rootcontext.cs: Deal with field-less struct types correctly now
20389         by passing the size option to Define Type.
20390
20391         * class.cs: Removed hack that created one static field. 
20392
20393 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20394
20395         * statement.cs: Moved most of the code generation here. 
20396
20397 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20398
20399         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20400         seem very right.
20401
20402         (ElementAccess): Remove useless bits for now - keep checks as the spec
20403         says.
20404
20405 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20406
20407         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20408         and start performing checks according to the spec.
20409
20410 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20411
20412         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20413         rank_specifiers instead.
20414
20415         (rank_specifiers): Change the order in which the rank specifiers are stored
20416
20417         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20418
20419         * expression.cs (ElementAccess): Implement the LValue interface too.
20420
20421 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20422
20423         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20424         except that user defined conversions are not included.
20425
20426         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20427         perform the conversion of the return type, if necessary.
20428
20429         (New::DoResolve): Check whether we are creating an array or an object
20430         and accordingly do the needful.
20431
20432         (New::Emit): Same here.
20433
20434         (New::DoResolve): Implement guts of array creation.
20435
20436         (New::FormLookupType): Helper function.
20437
20438 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * codegen.cs: Removed most of the code generation here, and move the
20441         corresponding code generation bits to the statement classes. 
20442
20443         Added support for try/catch/finalize and throw.
20444
20445         * cs-parser.jay: Added support for try/catch/finalize.
20446
20447         * class.cs: Catch static methods having the flags override,
20448         virtual or abstract.
20449
20450         * expression.cs (UserCast): This user cast was not really doing
20451         what it was supposed to do.  Which is to be born in fully resolved
20452         state.  Parts of the resolution were being performed at Emit time! 
20453
20454         Fixed this code.
20455
20456 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20457
20458         * expression.cs: Implicity convert the result from UserCast.
20459
20460 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20461
20462         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20463         prevented it from working correctly. 
20464
20465         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20466         merely ConvertImplicit.
20467
20468 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20469
20470         * typemanager.cs: Make the LookupTypeContainer function static,
20471         and not per-instance.  
20472
20473         * class.cs: Make static FindMembers (the one that takes a Type
20474         argument). 
20475
20476         * codegen.cs: Add EmitForeach here.
20477
20478         * cs-parser.jay: Make foreach a toplevel object instead of the
20479         inline expansion, as we need to perform semantic analysis on it. 
20480
20481 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20482
20483         * expression.cs (Expression::ImplicitUserConversion): Rename to
20484         UserDefinedConversion.
20485
20486         (Expression::UserDefinedConversion): Take an extra argument specifying 
20487         whether we look for explicit user conversions too.
20488
20489         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20490
20491         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20492
20493         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20494         with the appropriate arguments.
20495
20496         * cs-parser.jay (cast_expression): Record location too.
20497
20498         * expression.cs (Cast): Record location info.
20499
20500         (Expression::ConvertExplicit): Take location argument.
20501
20502         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20503         to determine if we are doing explicit conversions.
20504
20505         (UserCast::Emit): Update accordingly.
20506
20507         (Expression::ConvertExplicit): Report an error if everything fails.
20508
20509         * ../errors/cs0030.cs : Add.
20510
20511 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20512
20513         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20514         virtual and newslot bits. 
20515
20516         * class.cs (TypeContainer::RegisterRequiredImplementations):
20517         Record methods we need.
20518
20519         (TypeContainer::MakeKey): Helper function to make keys for
20520         MethodBases, since the Methodbase key is useless.
20521
20522         (TypeContainer::Populate): Call RegisterRequiredImplementations
20523         before defining the methods.   
20524
20525         Create a mapping for method_builders_to_methods ahead of time
20526         instead of inside a tight loop.
20527
20528         (::RequireMethods):  Accept an object as the data to set into the
20529         hashtable so we can report interface vs abstract method mismatch.
20530
20531 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * report.cs: Make all of it static.
20534
20535         * rootcontext.cs: Drop object_type and value_type computations, as
20536         we have those in the TypeManager anyways.
20537
20538         Drop report instance variable too, now it is a global.
20539
20540         * driver.cs: Use try/catch on command line handling.
20541
20542         Add --probe option to debug the error reporting system with a test
20543         suite. 
20544
20545         * report.cs: Add support for exiting program when a probe
20546         condition is reached.
20547
20548 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20549
20550         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20551         we do a forcible conversion regardless of type, to check if 
20552         ForceConversion returns a null.
20553
20554         (Binary::error19): Use location to report error.
20555
20556         (Unary::error23): Use location here too.
20557
20558         * ../errors/cs0019.cs : Check in.
20559
20560         * ../errors/cs0023.cs : Check in.
20561
20562         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20563         case of a non-null MethodInfo object with a length of 0 !
20564
20565         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20566         an applicable member - according to the spec :-)
20567         Also fix logic to find members in base types.
20568
20569         (Unary::ResolveOperator): Same here.
20570
20571         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20572         as I was getting thoroughly confused between this and error19 :-)
20573
20574         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20575         (::FindMostEncompassedType): Implement.
20576         (::FindMostEncompassingType): Implement.
20577         (::StandardConversionExists): Implement.
20578
20579         (UserImplicitCast): Re-vamp. We now need info about most specific
20580         source and target types so that we can do the necessary conversions.
20581
20582         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20583         mathematical union with no duplicates.
20584
20585 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20586
20587         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20588         in order from base classes to child classes, so that we can in
20589         child classes look up in our parent for method names and
20590         attributes (required for handling abstract, virtual, new, override
20591         constructs: we need to instrospect our base class, and if we dont
20592         populate the classes in order, the introspection might be
20593         incorrect.  For example, a method could query its parent before
20594         the parent has any methods and would determine that the parent has
20595         no abstract methods (while it could have had them)).
20596
20597         (RootContext::CreateType): Record the order in which we define the
20598         classes.
20599
20600 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20601
20602         * class.cs (TypeContainer::Populate): Also method definitions can
20603         fail now, keep track of this.
20604
20605         (TypeContainer::FindMembers): Implement support for
20606         DeclaredOnly/noDeclaredOnly flag.
20607
20608         (Constructor::Emit) Return the ConstructorBuilder.
20609
20610         (Method::Emit) Return the MethodBuilder. 
20611         Check for abstract or virtual methods to be public.
20612
20613         * rootcontext.cs (RootContext::CreateType): Register all the
20614         abstract methods required for the class to be complete and the
20615         interface methods that must be implemented. 
20616
20617         * cs-parser.jay: Report error 501 (method requires body if it is
20618         not marked abstract or extern).
20619
20620         * expression.cs (TypeOf::Emit): Implement.
20621
20622         * typemanager.cs: runtime_handle_type, new global type.
20623
20624         * class.cs (Property::Emit): Generate code for properties.
20625
20626 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20627
20628         * expression.cs (Unary::ResolveOperator): Find operators on base type
20629         too - we now conform exactly to the spec.
20630
20631         (Binary::ResolveOperator): Same here.
20632
20633         * class.cs (Operator::Define): Fix minor quirk in the tests.
20634
20635         * ../errors/cs0215.cs : Added.
20636
20637         * ../errors/cs0556.cs : Added.
20638
20639         * ../errors/cs0555.cs : Added.
20640
20641 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20642
20643         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20644         single integer which is really efficient
20645
20646 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20647
20648         *  expression.cs (Expression::ImplicitUserConversion): Use location
20649         even in the case when we are examining True operators.
20650  
20651         * class.cs (Operator::Define): Perform extensive checks to conform
20652         with the rules for operator overloading in the spec.
20653
20654         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20655         some of the other conversions mentioned in the spec.
20656
20657         * typemanager.cs (array_type): New static member for the System.Array built-in
20658         type.
20659
20660         (cloneable_interface): For System.ICloneable interface.
20661
20662         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20663         we start resolving the tree and populating types.
20664
20665         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20666  
20667 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20668
20669         * expression.cs (Expression::ExprClassFromMemberInfo,
20670         Expression::Literalize): Create literal expressions from
20671         FieldInfos which are literals.
20672
20673         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20674         type casts, because they were wrong.  The test suite in tests
20675         caught these ones.
20676
20677         (ImplicitNumericConversion): ushort to ulong requires a widening
20678         cast. 
20679
20680         Int32 constant to long requires widening cast as well.
20681
20682         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20683         for integers because the type on the stack is not i4.
20684
20685 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20686
20687         * expression.cs (report118): require location argument. 
20688
20689         * parameter.cs: Do not dereference potential null value.
20690
20691         * class.cs: Catch methods that lack the `new' keyword when
20692         overriding a name.  Report warnings when `new' is used without
20693         anything being there to override.
20694
20695         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20696
20697         * class.cs: Only add constructor to hashtable if it is non-null
20698         (as now constructors can fail on define).
20699
20700         (TypeManager, Class, Struct): Take location arguments.
20701
20702         Catch field instance initialization in structs as errors.
20703
20704         accepting_filter: a new filter for FindMembers that is static so
20705         that we dont create an instance per invocation.
20706
20707         (Constructor::Define): Catch errors where a struct constructor is
20708         parameterless 
20709
20710         * cs-parser.jay: Pass location information for various new
20711         constructs. 
20712
20713         * delegate.cs (Delegate): take a location argument.
20714
20715         * driver.cs: Do not call EmitCode if there were problesm in the
20716         Definition of the types, as many Builders wont be there. 
20717
20718         * decl.cs (Decl::Decl): Require a location argument.
20719
20720         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20721         into integers, and find the most appropiate integer for it.
20722
20723         * literal.cs: Implement ULongLiteral.
20724
20725         * rootcontext.cs: Provide better information about the location of
20726         failure when CreateType fails.
20727
20728 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20729
20730         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20731         as well.
20732
20733         * expression.cs (Binary::CheckShiftArguments): Add missing type
20734         computation.
20735         (Binary::ResolveOperator): Add type to the logical and and logical
20736         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20737         before.
20738
20739         (Binary::DoNumericPromotions): In the case where either argument
20740         is ulong (and most signed types combined with ulong cause an
20741         error) perform implicit integer constant conversions as well.
20742
20743 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20744
20745         * expression.cs (UserImplicitCast): Method should always be
20746         non-null. 
20747         (Invocation::BetterConversion): Simplified test for IntLiteral.
20748
20749         (Expression::ImplicitNumericConversion): Split this routine out.
20750         Put the code that performs implicit constant integer conversions
20751         here. 
20752
20753         (Expression::Resolve): Become a wrapper around DoResolve so we can
20754         check eclass and type being set after resolve.
20755
20756         (Invocation::Badness): Remove this dead function
20757
20758         (Binary::ResolveOperator): Do not compute the expensive argumnets
20759         unless we have a union for it.
20760
20761         (Probe::Emit): Is needs to do an isinst and then
20762         compare against null.
20763
20764         (::CanConvert): Added Location argument.  If the Location argument
20765         is null (Location.Null), then we do not report errors.  This is
20766         used by the `probe' mechanism of the Explicit conversion.  We do
20767         not want to generate an error for something that the user
20768         explicitly requested to be casted.  But the pipeline for an
20769         explicit cast first tests for potential implicit casts.
20770
20771         So for now, if the Location is null, it means `Probe only' to
20772         avoid adding another argument.   Might have to revise this
20773         strategy later.
20774
20775         (ClassCast): New class used to type cast objects into arbitrary
20776         classes (used in Explicit Reference Conversions).
20777
20778         Implement `as' as well.
20779
20780         Reverted all the patches from Ravi below: they were broken:
20781
20782                 * The use of `level' as a mechanism to stop recursive
20783                   invocations is wrong.  That was there just to catch the
20784                   bug with a strack trace but not as a way of addressing
20785                   the problem.
20786
20787                   To fix the problem we have to *understand* what is going
20788                   on and the interactions and come up with a plan, not
20789                   just get things going.
20790
20791                 * The use of the type conversion cache that I proposed
20792                   last night had an open topic: How does this work across
20793                   protection domains.  A user defined conversion might not
20794                   be public in the location where we are applying the
20795                   conversion, a different conversion might be selected
20796                   (ie, private A->B (better) but public B->A (worse),
20797                   inside A, A->B applies, but outside it, B->A will
20798                   apply).
20799
20800                 * On top of that (ie, even if the above is solved),
20801                   conversions in a cache need to be abstract.  Ie, `To
20802                   convert from an Int to a Short use an OpcodeCast', not
20803                   `To convert from an Int to a Short use the OpcodeCast on
20804                   the variable 5' (which is what this patch was doing).
20805
20806 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20807
20808         * expression.cs (Invocation::ConversionExists): Re-write to use
20809         the conversion cache
20810
20811         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20812         cache all conversions done, not just user-defined ones.
20813
20814         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20815         to determine if a conversion exists instead of acutually trying to 
20816         perform the conversion. It's faster too.
20817
20818         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20819         and only then attempt the implicit conversion.
20820
20821 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20822
20823         * expression.cs (ConvertImplicit): Use a cache for conversions
20824         already found. Check level of recursion and bail out if necessary.
20825
20826 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20829         Export standard methods that we expect for string operations.
20830
20831         * statement.cs (Block::UsageWarning): Track usage of variables and
20832         report the errors for not used variables.
20833
20834         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20835         operator. 
20836
20837 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20838
20839         * codegen.cs: remove unnneded code 
20840
20841         * expression.cs: Removed BuiltinTypeAccess class
20842
20843         Fix the order in which implicit conversions are
20844         done.  
20845
20846         The previous fixed dropped support for boxed conversions (adding a
20847         test to the test suite now)
20848
20849         (UserImplicitCast::CanConvert): Remove test for source being null,
20850         that code is broken.  We should not feed a null to begin with, if
20851         we do, then we should track the bug where the problem originates
20852         and not try to cover it up here.
20853
20854         Return a resolved expression of type UserImplicitCast on success
20855         rather than true/false.  Ravi: this is what I was talking about,
20856         the pattern is to use a static method as a "constructor" for
20857         objects. 
20858
20859         Also, do not create arguments until the very last minute,
20860         otherwise we always create the arguments even for lookups that
20861         will never be performed. 
20862
20863         (UserImplicitCast::Resolve): Eliminate, objects of type
20864         UserImplicitCast are born in a fully resolved state. 
20865
20866         * typemanager.cs (InitCoreTypes): Init also value_type
20867         (System.ValueType). 
20868
20869         * expression.cs (Cast::Resolve): First resolve the child expression.
20870
20871         (LValue): Add new method AddressOf to be used by
20872         the `&' operator.  
20873
20874         Change the argument of Store to take an EmitContext instead of an
20875         ILGenerator, because things like FieldExpr need to be able to call
20876         their children expression to generate the instance code. 
20877
20878         (Expression::Error, Expression::Warning): Sugar functions for
20879         reporting errors.
20880
20881         (Expression::MemberLookup): Accept a TypeContainer instead of a
20882         Report as the first argument.
20883
20884         (Expression::ResolvePrimary): Killed.  I still want to improve
20885         this as currently the code is just not right.
20886
20887         (Expression::ResolveMemberAccess): Simplify, but it is still
20888         wrong. 
20889
20890         (Unary::Resolve): Catch errors in AddressOf operators.
20891
20892         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20893         index to a byte for the short-version, or the compiler will choose
20894         the wrong Emit call, which generates the wrong data.
20895
20896         (ParameterReference::Emit, ::Store): same.
20897
20898         (FieldExpr::AddressOf): Implement.
20899
20900         * typemanager.cs: TypeManager: made public variable instead of
20901         property.
20902
20903         * driver.cs: document --fatal.
20904
20905         * report.cs (ErrorMessage, WarningMessage): new names for the old
20906         Error and Warning classes.
20907
20908         * cs-parser.jay (member_access): Turn built-in access to types
20909         into a normal simplename
20910
20911 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20912
20913         * expression.cs (Invocation::BetterConversion): Fix to cope
20914         with q being null, since this was introducing a bug.
20915
20916         * expression.cs (ConvertImplicit): Do built-in conversions first.
20917
20918 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20919
20920         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20921
20922 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20923
20924         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20925         I had introduced long ago (what's new ?).
20926
20927         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20928         the work of all the checking. 
20929         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20930         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20931
20932         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20933         that is the right way. 
20934
20935         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20936         overloading resolution. Use everywhere instead of cutting and pasting code.
20937
20938         (Binary::ResolveOperator): Use MakeUnionSet.
20939
20940         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20941         we have to convert to bool types. Not complete yet.
20942
20943 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20944
20945         * typemanager.cs (TypeManager::CSharpName): support ushort.
20946
20947         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20948         to provide an expression that performsn an implicit constant int
20949         conversion (section 6.1.6).
20950         (Expression::ConvertImplicitRequired): Reworked to include
20951         implicit constant expression conversions.
20952
20953         (Expression::ConvertNumericExplicit): Finished.
20954
20955         (Invocation::Emit): If InstanceExpression is null, then it means
20956         that we perform a call on this.
20957
20958 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20959
20960         * expression.cs (Unary::Emit): Remove some dead code.
20961         (Probe): Implement Resolve and Emit for `is'.
20962         (Expression::ConvertImplicitRequired): Attempt to do constant
20963         expression conversions here.  Maybe should be moved to
20964         ConvertImplicit, but I am not sure.
20965         (Expression::ImplicitLongConstantConversionPossible,
20966         Expression::ImplicitIntConstantConversionPossible): New functions
20967         that tell whether is it possible to apply an implicit constant
20968         expression conversion.
20969
20970         (ConvertNumericExplicit): Started work on explicit numeric
20971         conversions.
20972
20973         * cs-parser.jay: Update operator constants.
20974
20975         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20976         (Parameters::GetSignature): Hook up VerifyArgs here.
20977         (Parameters::VerifyArgs): Verifies that no two arguments have the
20978         same name. 
20979
20980         * class.cs (Operator): Update the operator names to reflect the
20981         ones that the spec expects (as we are just stringizing the
20982         operator names).
20983
20984         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20985         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20986         previous usage did only work for our methods.
20987         (Expression::ConvertImplicit): Handle decimal implicit numeric
20988         conversions as well.
20989         (Expression::InternalTypeConstructor): Used to invoke constructors
20990         on internal types for default promotions.
20991
20992         (Unary::Emit): Implement special handling for the pre/post
20993         increment/decrement for overloaded operators, as they need to have
20994         the same semantics as the other operators.
20995
20996         (Binary::ResolveOperator): ditto.
20997         (Invocation::ConversionExists): ditto.
20998         (UserImplicitCast::Resolve): ditto.
20999
21000 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21001
21002         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21003         operator, return after emitting body. Regression tests pass again !
21004
21005         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21006         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21007         (Invocation::OverloadResolve): Ditto.
21008         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21009
21010         * everywhere : update calls to the above methods accordingly.
21011
21012 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21013
21014         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21015
21016         * expression.cs (ExpressionStatement): New base class used for
21017         expressions that can appear in statements, so that we can provide
21018         an alternate path to generate expression that do not leave a value
21019         on the stack.
21020
21021         (Expression::Emit, and all the derivatives): We no longer return
21022         whether a value is left on the stack or not.  Every expression
21023         after being emitted leaves a single value on the stack.
21024
21025         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21026         facilties of ExpressionStatement if possible.
21027
21028         * cs-parser.jay: Update statement_expression.
21029
21030 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21031
21032         * driver.cs: Change the wording of message
21033
21034 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21035
21036         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21037         the type of the expression to the return type of the method if
21038         we have an overloaded operator match ! The regression tests pass again !
21039         (Unary::ResolveOperator): Ditto.
21040
21041         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21042         to find "op_Implicit", not "implicit" ;-)
21043         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21044         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21045
21046         * everywhere : Correct calls to the above accordingly.
21047
21048         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21049         (ConvertImplicit): Do user-defined conversion if it exists.
21050
21051 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21052
21053         * assign.cs: track location.
21054         (Resolve): Use implicit conversions on assignment.
21055
21056         * literal.cs: Oops.  Not good, Emit of short access values should
21057         pass (Bytes) or the wrong argument will be selected.
21058
21059         * expression.cs (Unary::Emit): Emit code for -expr.
21060
21061         (Unary::ResolveOperator): Handle `Substract' for non-constants
21062         (substract from zero from the non-constants).
21063         Deal with Doubles as well. 
21064
21065         (Expression::ConvertImplicitRequired): New routine that reports an
21066         error if no implicit conversion exists. 
21067
21068         (Invocation::OverloadResolve): Store the converted implicit
21069         expressions if we make them
21070
21071 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21072
21073         * class.cs (ConstructorInitializer): Take a Location argument.
21074         (ConstructorBaseInitializer): Same here.
21075         (ConstructorThisInitializer): Same here.
21076
21077         * cs-parser.jay : Update all calls accordingly.
21078
21079         * expression.cs (Unary, Binary, New): Take location argument.
21080         Update accordingly everywhere.
21081
21082         * cs-parser.jay : Update all calls to the above to take a location
21083         argument.
21084
21085         * class.cs : Ditto.
21086
21087 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21088
21089         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21090         (Invocation::BetterConversion): Same here
21091         (Invocation::ConversionExists): Ditto.
21092
21093         (Invocation::ConversionExists): Implement.
21094
21095 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21096
21097         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21098         Also take an additional TypeContainer argument.
21099
21100         * All over : Pass in TypeContainer as argument to OverloadResolve.
21101
21102         * typemanager.cs (CSharpName): Update to check for the string type and return
21103         that too.
21104
21105         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21106         a given method.
21107
21108 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21109
21110         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21111         (Invocation::BetterFunction): Implement.
21112         (Invocation::BetterConversion): Implement.
21113         (Invocation::ConversionExists): Skeleton, no implementation yet.
21114
21115         Okay, things work fine !
21116
21117 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21118
21119         * typemanager.cs: declare and load enum_type, delegate_type and
21120         void_type. 
21121
21122         * expression.cs (Expression::Emit): Now emit returns a value that
21123         tells whether a value is left on the stack or not.  This strategy
21124         might be reveted tomorrow with a mechanism that would address
21125         multiple assignments.
21126         (Expression::report118): Utility routine to report mismatches on
21127         the ExprClass.
21128
21129         (Unary::Report23): Report impossible type/operator combination
21130         utility function.
21131
21132         (Unary::IsIncrementableNumber): Whether the type can be
21133         incremented or decremented with add.
21134         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21135         complemented. 
21136         (Unary::ResolveOperator): Implement ++, !, ~,
21137
21138         (Invocation::Emit): Deal with new Emit convetion.
21139
21140         * All Expression derivatives: Updated their Emit method to return
21141         whether they leave values on the stack or not.
21142
21143         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21144         stack for expressions that are statements. 
21145
21146 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21147
21148         * expression.cs (LValue): New interface.  Must be implemented by
21149         LValue objects.
21150         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21151         LValue interface.
21152
21153         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21154         interface for generating code, simplifies the code.
21155
21156 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21157
21158         * expression.cs (everywhere): Comment out return statements in ::Resolve
21159         methods to avoid the warnings.
21160
21161 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21162
21163         * driver.cs (parse): Report error 2001 if we can not open the
21164         source file.
21165
21166         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21167         not resolve it.
21168
21169         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21170         object. 
21171
21172         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21173         otherwise nested blocks end up with the same index.
21174
21175         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21176
21177         * expression.cs:  Instead of having FIXMEs in the Resolve
21178         functions, throw exceptions so it is obvious that we are facing a
21179         bug. 
21180
21181         * cs-parser.jay (invocation_expression): Pass Location information.
21182
21183         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21184         Use a basename for those routines because .NET does not like paths
21185         on them. 
21186
21187         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21188         already defined.
21189
21190 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21191
21192         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21193         are loading the correct data types (throws an exception if not).
21194         (TypeManager::InitCoreTypes): Use CoreLookupType
21195
21196         * expression.cs (Unary::ResolveOperator): return the child
21197         expression for expressions which are just +expr.
21198         (Unary::ResolveOperator): Return negative literals for -LITERAL
21199         expressions (otherwise they are Unary {Literal}).
21200         (Invocation::Badness): Take into account `Implicit constant
21201         expression conversions'.
21202
21203         * literal.cs (LongLiteral): Implement long literal class.
21204         (IntLiteral): export the `Value' of the intliteral. 
21205
21206 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21207
21208         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21209
21210         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21211         instead of 'Operator'
21212
21213         * expression.cs (Binary::ResolveOperator): Update accordingly.
21214         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21215         and 'Minus'
21216
21217         * cs-parser.jay (unary_expression): Update to use the new names.
21218
21219         * gen-treedump.cs (GetUnary): Same here.
21220
21221         * expression.cs (Unary::Resolve): Implement.
21222         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21223         operators are found instead of making noise ;-)
21224         (Unary::ResolveOperator): New method to do precisely the same thing which
21225         Binary::ResolveOperator does for Binary expressions.
21226         (Unary.method, .Arguments): Add.
21227         (Unary::OperName): Implement.   
21228         (Unary::ForceConversion): Copy and Paste !
21229
21230         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21231         a unary operator.
21232
21233         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21234         for the inbuilt operators. Only overloading works for now ;-)
21235
21236 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21237
21238         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21239         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21240
21241         * expression.cs (This::Emit): Implement. 
21242         (This::Resolve): Implement.
21243         (TypeOf:Resolve): Implement.
21244         (Expression::ResolveSimpleName): Add an implicit this to instance
21245         field references. 
21246         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21247         Bind instance variable to Field expressions.
21248         (FieldExpr::Instance): New field used to track the expression that
21249         represents the object instance.
21250         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21251         binding 
21252         (FieldExpr::Emit): Implement.
21253
21254         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21255         the last instruction contains a return opcode to avoid generating
21256         the last `ret' instruction (this generates correct code, and it is
21257         nice to pass the peverify output).
21258
21259         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21260         initializer for static and instance variables.
21261         (Constructor::Emit): Allow initializer to be null in the case of
21262         static constructors.  Only emit initializer for instance
21263         constructors. 
21264
21265         (TypeContainer::FindMembers): Return a null array if there are no
21266         matches.
21267
21268         Also fix the code for the MemberTypes.Method branch, as it was not
21269         scanning that for operators (or tried to access null variables before).
21270
21271         * assign.cs (Assign::Emit): Handle instance and static fields. 
21272
21273         * TODO: Updated.
21274
21275         * driver.cs: Stop compilation if there are parse errors.
21276
21277         * cs-parser.jay (constructor_declaration): Provide default base
21278         initializer for non-static constructors.
21279         (constructor_declarator): Do not provide a default base
21280         initializers if none was specified.
21281         Catch the fact that constructors should not have parameters.
21282
21283         * class.cs: Do not emit parent class initializers for static
21284         constructors, that should be flagged as an error.
21285
21286 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21287
21288         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21289         Move back code into TypeContainer::Populate.
21290
21291 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21292
21293         * class.cs (TypeContainer::AddConstructor): Fix the check to
21294         compare against Name, not Basename. 
21295         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21296
21297         * cs-parser.jay : Update accordingly.
21298
21299         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21300         for methods, don't forget to look into the operators too.
21301         (RegisterMethodBuilder): Helper method to take care of this for
21302         methods, constructors and operators.
21303         (Operator::Define): Completely revamp.
21304         (Operator.OperatorMethod, MethodName): New fields.
21305         (TypeContainer::Populate): Move the registering of builders into
21306         RegisterMethodBuilder.
21307         (Operator::Emit): Re-write.
21308
21309         * expression.cs (Binary::Emit): Comment out code path to emit method
21310         invocation stuff for the case when we have a user defined operator. I am
21311         just not able to get it right !
21312
21313 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21314
21315         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21316         argument. 
21317
21318         (Expression::MemberLookup): Provide a version that allows to
21319         specify the MemberTypes and BindingFlags. 
21320
21321         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21322         so it was not fetching variable information from outer blocks.
21323
21324         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21325         Beforefieldinit as it was buggy.
21326
21327         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21328         that Ravi put here.  
21329
21330         * class.cs (Constructor::Emit): Only emit if block is not null.
21331         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21332         deal with this by semantically definining it as if the user had
21333         done it.
21334
21335         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21336         constructors as we now "emit" them at a higher level.
21337
21338         (TypeContainer::DefineDefaultConstructor): Used to define the
21339         default constructors if none was provided.
21340
21341         (ConstructorInitializer): Add methods Resolve and Emit. 
21342
21343         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21344
21345 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21346
21347         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21348         the default constructor builder with our hashtable for methodbuilders
21349         to methodcores.
21350
21351         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21352         and argument_count is 0 in which case we have a match.
21353         (Binary::ResolveOperator): More null checking and miscellaneous coding
21354         style cleanup.
21355
21356 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21357
21358         * rootcontext.cs (IsNameSpace): Compare against null.
21359
21360         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21361
21362         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21363         and Unary::Operator.
21364
21365         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21366         accordingly.
21367
21368         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21369         we have overloaded operators.
21370         (Binary::ResolveOperator): Implement the part which does the operator overload
21371         resolution.
21372
21373         * class.cs (Operator::Emit): Implement.
21374         (TypeContainer::Emit): Emit the operators we have too.
21375
21376         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21377         the case when we have a user-defined operator.
21378
21379 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21382
21383 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21384
21385         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21386         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21387         (Constructor::Emit): Implement.
21388         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21389         if we have no work to do. 
21390         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21391         Emit method.
21392
21393         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21394         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21395
21396         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21397         of parent.parent.
21398
21399 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21400
21401         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21402         in the source.
21403         (Tree::RecordNamespace): Method to do what the name says ;-)
21404         (Tree::Namespaces): Property to get at the namespaces hashtable.
21405
21406         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21407         keep track.
21408
21409         * rootcontext.cs (IsNamespace): Fixed it :-)
21410
21411 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21412
21413         * class.cs (TypeContainer::FindMembers): Add support for
21414         constructors. 
21415         (MethodCore): New class that encapsulates both the shared aspects
21416         of a Constructor and a Method.  
21417         (Method, Constructor): Factored pieces into MethodCore.
21418
21419         * driver.cs: Added --fatal which makes errors throw exceptions.
21420         Load System assembly as well as part of the standard library.
21421
21422         * report.cs: Allow throwing exceptions on errors for debugging.
21423
21424         * modifiers.cs: Do not use `parent', instead use the real type
21425         container to evaluate permission settings.
21426
21427         * class.cs: Put Ravi's patch back in.  He is right, and we will
21428         have to cope with the
21429
21430 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21431
21432         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21433         FamORAssem, not FamANDAssem.
21434
21435 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21436
21437         * driver.cs: Added --parse option that only parses its input files
21438         and terminates.
21439
21440         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21441         incorrect.  IsTopLevel is not used to tell whether an object is
21442         root_types or not (that can be achieved by testing this ==
21443         root_types).  But to see if this is a top-level *class* (not
21444         necessarly our "toplevel" container). 
21445
21446 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21447
21448         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21449         parent instead of a direct call to GetType.
21450
21451 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21452
21453         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21454         Modifiers.TypeAttr. This should just be a call to that method.
21455
21456         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21457         object so that we can determine if we are top-level or not.
21458
21459         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21460         TypeContainer too.
21461
21462         * enum.cs (Enum::Define): Ditto.
21463
21464         * modifiers.cs (FieldAttr): Re-write.
21465
21466         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21467         (TypeContainer::HaveStaticConstructor): New property to provide access
21468         to precisely that info.
21469
21470         * modifiers.cs (MethodAttr): Re-write.
21471         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21472
21473         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21474         of top-level types as claimed.
21475
21476 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * expression.cs (MemberLookup): Fruitless attempt to lookup
21479         constructors.  Maybe I need to emit default constructors?  That
21480         might be it (currently .NET emits this for me automatically).
21481         (Invocation::OverloadResolve): Cope with Arguments == null.
21482         (Invocation::EmitArguments): new function, shared by the new
21483         constructor and us.
21484         (Invocation::Emit): Handle static and instance methods.  Emit
21485         proper call instruction for virtual or non-virtual invocations.
21486         (New::Emit): Implement.
21487         (New::Resolve): Implement.
21488         (MemberAccess:Resolve): Implement.
21489         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21490         to track instances.
21491         (FieldExpr::Resolve): Set type.
21492
21493         * support.cs: Handle empty arguments.
21494                 
21495         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21496         SimpleLookup): Auxiliary routines to help parse a qualifier
21497         identifier.  
21498
21499         Update qualifier_identifier rule.
21500
21501         * codegen.cs: Removed debugging messages.
21502
21503         * class.cs: Make this a global thing, this acts just as a "key" to
21504         objects that we might have around.
21505
21506         (Populate): Only initialize method_builders_to_methods once.
21507
21508         * expression.cs (PropertyExpr): Initialize type from the
21509         PropertyType. 
21510
21511         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21512         Resolve pattern.  Attempt to implicitly convert value to boolean.
21513         Emit code.
21514
21515         * expression.cs: Set the type for the int32/int32 argument case.
21516         (Binary::ResolveOperator): Set the return type to boolean for
21517         comparission operators
21518
21519         * typemanager.cs: Remove debugging print code.
21520
21521         (Invocation::Resolve): resolve type.
21522
21523         * class.cs: Allocate a MemberInfo of the correct size, as the code
21524         elsewhere depends on the test to reflect the correct contents.
21525
21526         (Method::) Keep track of parameters, due to System.Reflection holes
21527
21528         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21529         mapping here.
21530
21531         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21532         of the exact size and return that.
21533
21534         (Class::LookupMethodByBuilder): New function that maps
21535         MethodBuilders to its methods.  Required to locate the information
21536         on methods because System.Reflection bit us again.
21537
21538         * support.cs: New file, contains an interface ParameterData and
21539         two implementations: ReflectionParameters and InternalParameters
21540         used to access Parameter information.  We will need to grow this
21541         as required.
21542
21543         * expression.cs (Invocation::GetParameterData): implement a cache
21544         and a wrapper around the ParameterData creation for methods. 
21545         (Invocation::OverloadResolve): Use new code.
21546
21547 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21548
21549         * class.cs (TypeContainer::EmitField): Remove and move into 
21550         (Field::Define): here and modify accordingly.
21551         (Field.FieldBuilder): New member.
21552         (TypeContainer::Populate): Update accordingly.
21553         (TypeContainer::FindMembers): Implement.
21554
21555 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21556
21557         * statement.cs: (VariableInfo::VariableType): New field to be
21558         initialized with the full type once it is resolved. 
21559
21560 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21561
21562         * parameter.cs (GetParameterInfo): Use a type cache to compute
21563         things only once, and to reuse this information
21564
21565         * expression.cs (LocalVariableReference::Emit): Implement.
21566         (OpcodeCast::Emit): fix.
21567
21568         (ParameterReference::Resolve): Implement.
21569         (ParameterReference::Emit): Implement.
21570
21571         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21572         that are expressions need to stay as Expressions.
21573
21574         * typemanager.cs (CSharpName): Returns the C# name of a type if
21575         possible. 
21576
21577         * expression.cs (Expression::ConvertImplicit): New function that
21578         implements implicit type conversions.
21579
21580         (Expression::ImplicitReferenceConversion): Implements implicit
21581         reference conversions.
21582
21583         (EmptyCast): New type for transparent casts.
21584
21585         (OpcodeCast): New type for casts of types that are performed with
21586         a sequence of bytecodes.
21587
21588         (BoxedCast): New type used for casting value types into reference
21589         types.  Emits a box opcode.
21590
21591         (Binary::DoNumericPromotions): Implements numeric promotions of
21592         and computation of the Binary::Type.
21593
21594         (Binary::EmitBranchable): Optimization.
21595
21596         (Binary::Emit): Implement code emission for expressions.
21597
21598         * typemanager.cs (TypeManager): Added two new core types: sbyte
21599         and byte.
21600
21601 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21602
21603         * class.cs (TypeContainer::FindMembers): Method which does exactly
21604         what Type.FindMembers does, only we don't have to use reflection. No
21605         implementation yet.
21606
21607         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21608         typecontainer objects as we need to get at them.
21609         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21610
21611         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21612         typecontainer object.
21613
21614         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21615         of just a Report object.
21616
21617 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21618
21619         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21620         "remove_"
21621         (TypeContainer::Populate): Now define the delegates of the type too.
21622         (TypeContainer.Delegates): Property to access the list of delegates defined
21623         in the type.
21624
21625         * delegates.cs (Delegate::Define): Implement partially.
21626
21627         * modifiers.cs (TypeAttr): Handle more flags.
21628
21629 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21630
21631         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21632         and not <=
21633         (Operator::Define): Re-write logic to get types by using the LookupType method
21634         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21635         (Indexer::Define): Ditto.
21636         (Event::Define): Ditto.
21637         (Property::Define): Ditto.
21638
21639 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21640
21641         * class.cs (TypeContainer::Populate): Now define operators too. 
21642         (TypeContainer.Operators): New property to access the list of operators
21643         in a type.
21644         (Operator.OperatorMethodBuilder): New member to hold the method builder
21645         for the operator we are defining.
21646         (Operator::Define): Implement.
21647
21648 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21649
21650         * class.cs (Event::Define): Make the prefixes of the accessor methods
21651         addOn_ and removeOn_ 
21652
21653         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21654         of the location being passed in too. Ideally, this should go later since all
21655         error reporting should be done through the Report object.
21656
21657         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21658         (Populate): Iterate thru the indexers we have and define them too.
21659         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21660         for the get and set accessors.
21661         (Indexer::Define): Implement.
21662
21663 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21666         my previous implementation, did not work.
21667
21668         * typemanager.cs: Add a couple of missing types (the longs).
21669
21670         * literal.cs: Use TypeManager.bool_type instead of getting it.
21671
21672         * expression.cs (EventExpr): New kind of expressions.
21673         (Expressio::ExprClassFromMemberInfo): finish
21674
21675 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21676
21677         * assign.cs: Emit stores to static fields differently.
21678
21679 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21680
21681         * Merge in changes and adjust code to tackle conflicts. Backed out my
21682         code in Assign::Resolve ;-) 
21683
21684 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21685
21686         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21687         instead Report.Error and also pass in the location.
21688         (CSharpParser::Lexer): New readonly property to return the reference
21689         to the Tokenizer object.
21690         (declare_local_variables): Use Report.Error with location instead of plain 
21691         old error.
21692         (CheckDef): Ditto.
21693
21694         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21695         (Operator.CheckBinaryOperator): Ditto.
21696
21697         * cs-parser.jay (operator_declarator): Update accordingly.
21698
21699         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21700         (CheckBinaryOperator): Same here.
21701
21702         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21703         on the name without any prefixes of namespace names etc. This is because we
21704         already might have something already fully qualified like 
21705         'System.Console.WriteLine'
21706
21707         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21708
21709 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21710
21711         * cs-tokenizer.cs (location): Return a string which also contains
21712         the file name.
21713
21714         * expression.cs (ElementAccess): New class for expressions of the
21715         type 'element access.'
21716         (BaseAccess): New class for expressions of the type 'base access.'
21717         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21718         respectively.
21719
21720         * cs-parser.jay (element_access): Implement action.
21721         (base_access): Implement actions.
21722         (checked_expression, unchecked_expression): Implement.
21723
21724         * cs-parser.jay (local_variable_type): Correct and implement.
21725         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21726
21727         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21728
21729         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21730         name and the specifiers.
21731
21732         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21733
21734         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21735         making them all public ;-)
21736
21737         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21738         class anyways.
21739
21740 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21741
21742         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21743         PropertyExprs.
21744         (FieldExpr, PropertyExprs): New resolved expressions.
21745         (SimpleName::MemberStaticCheck): Perform static checks for access
21746         to non-static fields on static methods. Maybe this should be
21747         generalized for MemberAccesses. 
21748         (SimpleName::ResolveSimpleName): More work on simple name
21749         resolution. 
21750
21751         * cs-parser.jay (primary_expression/qualified_identifier): track
21752         the parameter index.
21753
21754         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21755         (EmitContext::EmitBoolExpression): Chain to expression generation
21756         instead of temporary hack.
21757         (::EmitStatementExpression): Put generic expression code generation.
21758
21759         * assign.cs (Assign::Emit): Implement variable assignments to
21760         local variables, parameters and fields.
21761
21762 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * statement.cs (Block::GetVariableInfo): New method, returns the
21765         VariableInfo for a variable name in a block.
21766         (Block::GetVariableType): Implement in terms of GetVariableInfo
21767
21768         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21769         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21770
21771 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21772
21773         * cs-parser.jay (operator_declaration): Continue on my quest : update
21774         to take attributes argument.
21775         (event_declaration): Ditto.
21776         (enum_declaration): Ditto.
21777         (indexer_declaration): Ditto.
21778
21779         * class.cs (Operator::Operator): Update constructor accordingly.
21780         (Event::Event): Ditto.
21781
21782         * delegate.cs (Delegate::Delegate): Same here.
21783
21784         * enum.cs (Enum::Enum): Same here.
21785
21786 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21787
21788         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21789
21790         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21791
21792         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21793         being passed around as an arraylist.
21794         (Attributes::AddAttribute): Method to add attribute sections.
21795
21796         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21797         (struct_declaration): Update accordingly.
21798         (constant_declaration): Update.
21799         (field_declaration): Update.
21800         (method_header): Update.
21801         (fixed_parameter): Update.
21802         (parameter_array): Ditto.
21803         (property_declaration): Ditto.
21804         (destructor_declaration): Ditto.
21805
21806         * class.cs (Struct::Struct): Update constructors accordingly.
21807         (Class::Class): Ditto.
21808         (Field::Field): Ditto.
21809         (Method::Method): Ditto.
21810         (Property::Property): Ditto.
21811         (TypeContainer::OptAttribute): update property's return type.
21812
21813         * interface.cs (Interface.opt_attributes): New member.
21814         (Interface::Interface): Update to take the extra Attributes argument.
21815
21816         * parameter.cs (Parameter::Parameter): Ditto.
21817
21818         * constant.cs (Constant::Constant): Ditto.
21819
21820         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21821         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21822         the attributes as a parameter.
21823         (InterfaceProperty): Update constructor call.
21824         (InterfaceEvent): Ditto.
21825         (InterfaceMethod): Ditto.
21826         (InterfaceIndexer): Ditto.
21827
21828         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21829         pass the attributes too.
21830         (interface_event_declaration): Ditto.
21831         (interface_property_declaration): Ditto.
21832         (interface_method_declaration): Ditto.
21833         (interface_declaration): Ditto.
21834
21835 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21836
21837         * class.cs (Method::Define): Track the "static Main" definition to
21838         create an entry point. 
21839
21840         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21841         EntryPoint if we find it. 
21842
21843         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21844         (EmitContext::ig): Make this variable public.
21845
21846         * driver.cs: Make the default output file be the first file name
21847         with the .exe extension.  
21848
21849         Detect empty compilations
21850
21851         Handle various kinds of output targets.  Handle --target and
21852         rename -t to --dumper.
21853
21854         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21855         methods inherited from Expression return now an Expression.  This
21856         will is used during the tree rewriting as we resolve them during
21857         semantic analysis.
21858
21859         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21860         the spec.  Missing entirely is the information about
21861         accessability of elements of it.
21862
21863         (Expression::ExprClassFromMemberInfo): New constructor for
21864         Expressions that creates a fully initialized Expression based on
21865         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21866         a Type.
21867
21868         (Invocation::Resolve): Begin implementing resolution of invocations.
21869
21870         * literal.cs (StringLiteral):  Implement Emit.
21871
21872 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21873
21874         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21875         member.
21876
21877 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21878
21879         * cs-parser.jay (attribute_arguments): Implement actions.
21880         (attribute): Fix bug in production. Implement action.
21881         (attribute_list): Implement.
21882         (attribute_target): Implement.
21883         (attribute_target_specifier, opt_target_specifier): Implement
21884         (CheckAttributeTarget): New method to check if the attribute target
21885         is valid.
21886         (attribute_section): Implement.
21887         (opt_attributes): Implement.
21888
21889         * attribute.cs : New file to handle attributes.
21890         (Attribute): Class to hold attribute info.
21891
21892         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21893         (attribute_section): Modify production to use 2 different rules to 
21894         achieve the same thing. 1 s/r conflict down !
21895         Clean out commented, useless, non-reducing dimension_separator rules.
21896
21897         * class.cs (TypeContainer.attributes): New member to hold list
21898         of attributes for a type.
21899         (Struct::Struct): Modify to take one more argument, the attribute list.
21900         (Class::Class): Ditto.
21901         (Field::Field): Ditto.
21902         (Method::Method): Ditto.
21903         (Property::Property): Ditto.
21904
21905         * cs-parser.jay (struct_declaration): Update constructor call to
21906         pass in the attributes too.
21907         (class_declaration): Ditto.
21908         (constant_declaration): Ditto.
21909         (field_declaration): Ditto.
21910         (method_header): Ditto.
21911         (fixed_parameter): Ditto.
21912         (parameter_array): Ditto.
21913         (property_declaration): Ditto.
21914
21915         * constant.cs (Constant::Constant): Update constructor similarly.
21916         Use System.Collections.
21917
21918         * parameter.cs (Parameter::Parameter): Update as above.
21919
21920 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21921
21922         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21923         (TypeContainer.delegates): New member to hold list of delegates.
21924
21925         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21926         this time as I seem to be on crack ;-)
21927
21928 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21929
21930         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21931         tell whether an identifier represents a namespace.
21932
21933         * expression.cs (NamespaceExpr): A namespace expression, used only
21934         temporarly during expression resolution.
21935         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21936         utility functions to resolve names on expressions.
21937
21938 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21939
21940         * codegen.cs: Add hook for StatementExpressions. 
21941
21942         * class.cs: Fix inverted test for static flag in methods.
21943
21944 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21945
21946         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21947         to make it coincide with MS' number.
21948         (Operator::CheckBinaryOperator): Ditto.
21949
21950         * ../errors/errors.txt : Remove error numbers added earlier.
21951
21952         * ../errors/cs1019.cs : Test case for error # 1019
21953
21954         * ../errros/cs1020.cs : Test case for error # 1020
21955
21956         * cs-parser.jay : Clean out commented cruft.
21957         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21958         used anywhere - non-reducing rule.
21959         (namespace_declarations): Non-reducing rule - comment out.
21960
21961         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21962         with TypeContainer::AddEnum.
21963
21964         * delegate.cs : New file for delegate handling classes.
21965         (Delegate): Class for declaring delegates.
21966
21967         * makefile : Update.
21968
21969         * cs-parser.jay (delegate_declaration): Implement.
21970
21971 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21972
21973         * class.cs (Event::Define): Implement.
21974         (Event.EventBuilder): New member.
21975
21976         * class.cs (TypeContainer::Populate): Update to define all enums and events
21977         we have.
21978         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21979         readonly fields for all these cases ?
21980
21981 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21982
21983         * class.cs (Property): Revamp to use the convention of making fields readonly.
21984         Accordingly modify code elsewhere.
21985
21986         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21987         the Define method of the Property class.
21988
21989         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21990         trivial bug.
21991         (TypeContainer::Populate): Update to define all the properties we have. Also
21992         define all enumerations.
21993
21994         * enum.cs (Define): Implement.
21995
21996 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21997
21998         * cs-parser.jay (overloadable_operator): The semantic value is an
21999         enum of the Operator class.
22000         (operator_declarator): Implement actions.
22001         (operator_declaration): Implement.
22002
22003         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22004         validity of definitions.
22005         (Operator::CheckBinaryOperator): Static method to check for binary operators
22006         (TypeContainer::AddOperator): New method to add an operator to a type.
22007
22008         * cs-parser.jay (indexer_declaration): Added line to actually call the
22009         AddIndexer method so it gets added ;-)
22010
22011         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22012         already taken care of by the MS compiler ?  
22013
22014 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22015
22016         * class.cs (Operator): New class for operator declarations.
22017         (Operator::OpType): Enum for the various operators.
22018
22019 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22020
22021         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22022         ostensibly handle this in semantic analysis.
22023
22024         * cs-parser.jay (general_catch_clause): Comment out
22025         (specific_catch_clauses, specific_catch_clause): Ditto.
22026         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22027         (catch_args, opt_catch_args): New productions.
22028         (catch_clause): Rewrite to use the new productions above
22029         (catch_clauses): Modify accordingly.
22030         (opt_catch_clauses): New production to use in try_statement
22031         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22032         and re-write the code in the actions to extract the specific and
22033         general catch clauses by being a little smart ;-)
22034
22035         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22036         Hooray, try and catch statements parse fine !
22037
22038 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22039
22040         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22041         string from the hashtable of variables.
22042
22043         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22044         I end up making that mistake ;-)
22045         (catch_clauses): Fixed gross error which made Key and Value of the 
22046         DictionaryEntry the same : $1 !!
22047
22048 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22049
22050         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22051
22052         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22053         when the add and remove accessors are specified. 
22054
22055 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22056
22057         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22058         information about indexer_declarator.
22059         (indexer_declarator): Implement actions.
22060         (parsing_indexer): New local boolean used to keep track of whether
22061         we are parsing indexers or properties. This is necessary because 
22062         implicit_parameters come into picture even for the get accessor in the 
22063         case of an indexer.
22064         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22065
22066         * class.cs (Indexer): New class for indexer declarations.
22067         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22068         (TypeContainer::indexers): New member to hold list of indexers for the
22069         type.
22070
22071 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22072
22073         * cs-parser.jay (add_accessor_declaration): Implement action.
22074         (remove_accessor_declaration): Implement action.
22075         (event_accessors_declaration): Implement
22076         (variable_declarators): swap statements for first rule - trivial.
22077
22078         * class.cs (Event): New class to hold information about event
22079         declarations.
22080         (TypeContainer::AddEvent): New method to add an event to a type
22081         (TypeContainer::events): New member to hold list of events.
22082
22083         * cs-parser.jay (event_declaration): Implement actions.
22084
22085 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22086
22087         * cs-parser.jay (dim_separators): Implement. Make it a string
22088         concatenating all the commas together, just as they appear.
22089         (opt_dim_separators): Modify accordingly
22090         (rank_specifiers): Update accordingly. Basically do the same
22091         thing - instead, collect the brackets here.
22092         (opt_rank_sepcifiers): Modify accordingly.
22093         (array_type): Modify to actually return the complete type string
22094         instead of ignoring the rank_specifiers.
22095         (expression_list): Implement to collect the expressions
22096         (variable_initializer): Implement. We make it a list of expressions
22097         essentially so that we can handle the array_initializer case neatly too.
22098         (variable_initializer_list): Implement.
22099         (array_initializer): Make it a list of variable_initializers
22100         (opt_array_initializer): Modify accordingly.
22101
22102         * expression.cs (New::NType): Add enumeration to help us
22103         keep track of whether we have an object/delegate creation
22104         or an array creation.
22105         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22106         members to hold data about array creation.
22107         (New:New): Modify to update NewType
22108         (New:New): New Overloaded contructor for the array creation
22109         case.
22110
22111         * cs-parser.jay (array_creation_expression): Implement to call
22112         the overloaded New constructor.
22113
22114 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22115
22116         * class.cs (TypeContainer::Constructors): Return member
22117         constructors instead of returning null.
22118
22119 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22120
22121         * typemanager.cs (InitCoreTypes): Initialize the various core
22122         types after we have populated the type manager with the user
22123         defined types (this distinction will be important later while
22124         compiling corlib.dll)
22125
22126         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22127         on Expression Classification.  Now all expressions have a method
22128         `Resolve' and a method `Emit'.
22129
22130         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22131         generation from working.     Also add some temporary debugging
22132         code. 
22133
22134 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22135
22136         * codegen.cs: Lots of code generation pieces.  This is only the
22137         beginning, will continue tomorrow with more touches of polish.  We
22138         handle the fundamentals of if, while, do, for, return.  Others are
22139         trickier and I need to start working on invocations soon.
22140
22141         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22142         s.InitStatement. 
22143
22144         * codegen.cs (EmitContext): New struct, used during code
22145         emission to keep a context.   Most of the code generation will be
22146         here. 
22147
22148         * cs-parser.jay: Add embedded blocks to the list of statements of
22149         this block.  So code generation proceeds in a top down fashion.
22150
22151 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22152
22153         * statement.cs: Add support for multiple child blocks.
22154
22155 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22156
22157         * codegen.cs (EmitCode): New function, will emit the code for a
22158         Block of code given a TypeContainer and its ILGenerator. 
22159
22160         * statement.cs (Block): Standard public readonly optimization.
22161         (Block::Block constructors): Link children. 
22162         (Block::Child): Child Linker.
22163         (Block::EmitVariables): Emits IL variable declarations.
22164
22165         * class.cs: Drop support for MethodGroups here, delay until
22166         Semantic Analysis.
22167         (Method::): Applied the same simplification that I did before, and
22168         move from Properties to public readonly fields.
22169         (Method::ParameterTypes): Returns the parameter types for the
22170         function, and implements a cache that will be useful later when I
22171         do error checking and the semantic analysis on the methods is
22172         performed.
22173         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22174         and made a method, optional argument tells whether this is a class
22175         or a structure to apply the `has-this' bit.
22176         (Method::GetCallingConvention): Implement, returns the calling
22177         convention. 
22178         (Method::Define): Defines the type, a second pass is performed
22179         later to populate the methods.
22180
22181         (Constructor::ParameterTypes): implement a cache similar to the
22182         one on Method::ParameterTypes, useful later when we do semantic
22183         analysis. 
22184
22185         (TypeContainer::EmitMethod):  New method.  Emits methods.
22186
22187         * expression.cs: Removed MethodGroup class from here.
22188
22189         * parameter.cs (Parameters::GetCallingConvention): new method.
22190
22191 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22192
22193         * class.cs (TypeContainer::Populate): Drop RootContext from the
22194         argument. 
22195
22196         (Constructor::CallingConvention): Returns the calling convention.
22197         (Constructor::ParameterTypes): Returns the constructor parameter
22198         types. 
22199
22200         (TypeContainer::AddConstructor): Keep track of default constructor
22201         and the default static constructor.
22202
22203         (Constructor::) Another class that starts using `public readonly'
22204         instead of properties. 
22205
22206         (Constructor::IsDefault): Whether this is a default constructor. 
22207
22208         (Field::) use readonly public fields instead of properties also.
22209
22210         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22211         track of static constructors;  If none is used, turn on
22212         BeforeFieldInit in the TypeAttributes. 
22213
22214         * cs-parser.jay (opt_argument_list): now the return can be null
22215         for the cases where there are no arguments. 
22216
22217         (constructor_declarator): If there is no implicit `base' or
22218         `this', then invoke the default parent constructor. 
22219
22220         * modifiers.cs (MethodAttr): New static function maps a set of
22221         modifiers flags into a MethodAttributes enum
22222         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22223         MethodAttr, TypeAttr to represent the various mappings where the
22224         modifiers are used.
22225         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22226
22227 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22228
22229         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22230         method arguments.
22231
22232         * interface.cs (PopulateIndexer): Implemented the code generator
22233         for interface indexers.
22234
22235 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22236
22237         * interface.cs (InterfaceMemberBase): Now we track the new status
22238         here.  
22239
22240         (PopulateProperty): Implement property population.  Woohoo!  Got
22241         Methods and Properties going today. 
22242
22243         Removed all the properties for interfaces, and replaced them with
22244         `public readonly' fields. 
22245
22246 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22247
22248         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22249         initialize their hashtables/arraylists only when they are needed
22250         instead of doing this always.
22251
22252         * parameter.cs: Handle refs and out parameters.
22253
22254         * cs-parser.jay: Use an ArrayList to construct the arguments
22255         instead of the ParameterCollection, and then cast that to a
22256         Parameter[] array.
22257
22258         * parameter.cs: Drop the use of ParameterCollection and use
22259         instead arrays of Parameters.
22260
22261         (GetParameterInfo): Use the Type, not the Name when resolving
22262         types. 
22263
22264 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22265
22266         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22267         and instead use public readonly fields.
22268
22269         * class.cs: Put back walking code for type containers.
22270
22271 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * class.cs (MakeConstant): Code to define constants.
22274
22275         * rootcontext.cs (LookupType): New function.  Used to locate types 
22276
22277
22278 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22279
22280         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22281         this System.Reflection code is.  Kudos to Microsoft
22282
22283         * typemanager.cs: Implement a type cache and avoid loading all
22284         types at boot time.  Wrap in LookupType the internals.  This made
22285         the compiler so much faster.  Wow.  I rule!
22286
22287         * driver.cs: Make sure we always load mscorlib first (for
22288         debugging purposes, nothing really important).
22289
22290         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22291         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22292
22293         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22294         on namespaces that have been imported using the `using' keyword.
22295
22296         * class.cs (TypeContainer::TypeAttr): Virtualize.
22297         (Class::TypeAttr): Return attributes suitable for this bad boy.
22298         (Struct::TypeAttr): ditto.
22299         Handle nested classes.
22300         (TypeContainer::) Remove all the type visiting code, it is now
22301         replaced with the rootcontext.cs code
22302
22303         * rootcontext.cs (GetClassBases): Added support for structs. 
22304
22305 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22306
22307         * interface.cs, statement.cs, class.cs, parameter.cs,
22308         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22309         Drop use of TypeRefs, and use strings instead.
22310
22311 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22312
22313         * rootcontext.cs: 
22314
22315         * class.cs (Struct::Struct): set the SEALED flags after
22316         checking the modifiers.
22317         (TypeContainer::TypeAttr): new property, returns the
22318         TypeAttributes for a class.  
22319
22320         * cs-parser.jay (type_list): Oops, list production was creating a
22321         new list of base types.
22322
22323         * rootcontext.cs (StdLib): New property.
22324         (GetInterfaceTypeByName): returns an interface by type name, and
22325         encapsulates error handling here.
22326         (GetInterfaces): simplified.
22327         (ResolveTree): Encapsulated all the tree resolution here.
22328         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22329         types. 
22330
22331         * driver.cs: Add support for --nostdlib, to avoid loading the
22332         default assemblies.
22333         (Main): Do not put tree resolution here. 
22334
22335         * rootcontext.cs: Beginning of the class resolution.
22336
22337 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22338
22339         * rootcontext.cs: Provide better error reporting. 
22340
22341         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22342
22343         * rootcontext.cs (CreateInterface): Handle the case where there
22344         are no parent interfaces.
22345
22346         (CloseTypes): Routine to flush types at the end.
22347         (CreateInterface): Track types.
22348         (GetInterfaces): Returns an array of Types from the list of
22349         defined interfaces.
22350
22351         * typemanager.c (AddUserType): Mechanism to track user types (puts
22352         the type on the global type hash, and allows us to close it at the
22353         end). 
22354
22355 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22356
22357         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22358         RecordInterface instead.
22359
22360         * cs-parser.jay: Updated to reflect changes above.
22361
22362         * decl.cs (Definition): Keep track of the TypeBuilder type that
22363         represents this type here.  Not sure we will use it in the long
22364         run, but wont hurt for now.
22365
22366         * driver.cs: Smaller changes to accomodate the new code.
22367
22368         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22369         when done. 
22370
22371         * rootcontext.cs (CreateInterface):  New method, used to create
22372         the System.TypeBuilder type for interfaces.
22373         (ResolveInterfaces): new entry point to resolve the interface
22374         hierarchy. 
22375         (CodeGen): Property, used to keep track of the code generator.
22376
22377 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * cs-parser.jay: Add a second production for delegate_declaration
22380         with `VOID'.
22381
22382         (enum_body): Put an opt_comma here instead of putting it on
22383         enum_body or enum_member_declarations so we can handle trailing
22384         commas on enumeration members.  Gets rid of a shift/reduce.
22385
22386         (type_list): Need a COMMA in the middle.
22387
22388         (indexer_declaration): Tell tokenizer to recognize get/set
22389
22390         * Remove old targets.
22391
22392         * Re-add the parser target.
22393
22394 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22395
22396         * cs-parser.jay: Add precendence rules for a number of operators
22397         ot reduce the number of shift/reduce conflicts in the grammar.
22398
22399 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22400
22401         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22402         and put it here.
22403
22404         Get rid of old crufty code.
22405
22406         * rootcontext.cs: Use this to keep track of the parsed
22407         representation and the defined types available to the program. 
22408
22409         * gen-treedump.cs: adjust for new convention.
22410
22411         * type.cs: Split out the type manager, and the assembly builder
22412         from here. 
22413
22414         * typemanager.cs: the type manager will live here now.
22415
22416         * cil-codegen.cs: And the code generator here. 
22417
22418 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22419
22420         * makefile: Fixed up for easy making.
22421
22422 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22423
22424         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22425         the 
22426
22427         (unary_expression): Expand pre_increment_expression and
22428         post_decrement_expression to reduce a shift/reduce.
22429
22430 2001-07-11  Simon Cozens
22431
22432         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22433
22434         Improve allow_keyword_as_indent name.
22435
22436 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22437
22438         * Adjustments for Beta2. 
22439
22440 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22441
22442         * decl.cs: Added `Define' abstract method.
22443         (InTransit): new property, used to catch recursive definitions. 
22444
22445         * interface.cs: Implement `Define'. 
22446
22447         * modifiers.cs: Map Modifiers.constants to
22448         System.Reflection.TypeAttribute flags.
22449
22450         * class.cs: Keep track of types and user-defined types.
22451         (BuilderInit): New method for creating an assembly
22452         (ResolveType): New function to launch the resolution process, only
22453         used by interfaces for now.
22454
22455         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22456         that are inserted into the name space. 
22457
22458 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22459
22460         * ARGH.  I have screwed up my tree so many times due to the use of
22461         rsync rather than using CVS.  Going to fix this at once. 
22462
22463         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22464         load types.
22465
22466 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22467
22468         * Experiment successful: Use System.Type rather that our own
22469         version of Type.  
22470
22471 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22472
22473         * cs-parser.jay: Removed nsAliases from here.
22474
22475         Use new namespaces, handle `using XXX;' 
22476
22477         * namespace.cs: Reimplemented namespace handling, use a recursive
22478         definition of the class.  Now we can keep track of using clauses
22479         and catch invalid using clauses.
22480
22481 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22482
22483         * gen-treedump.cs: Adapted for all the renaming.
22484
22485         * expression.cs (Expression): this class now has a Type property
22486         which returns an expression Type.
22487
22488         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22489         `Type', as this has a different meaning now in the base
22490
22491 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22492
22493         * interface.cs, class.cs: Removed from all the sources the
22494         references to signature computation, as we can not do method
22495         signature computation during the parsing time, as we are not
22496         trying to solve at that point distinguishing:
22497
22498         class X {
22499                 void a (Blah x) {}
22500                 void a (NS.Blah x) {}
22501         }
22502
22503         Which depending on the context might be valid or not, as we do not
22504         know if Blah is the same thing as NS.Blah at that point.
22505
22506         * Redid everything so the code uses TypeRefs now instead of
22507         Types.  TypeRefs are just temporary type placeholders, that need
22508         to be resolved.  They initially have a pointer to a string and the
22509         current scope in which they are used.  This is used later by the
22510         compiler to resolve the reference to an actual Type. 
22511
22512         * DeclSpace is no longer a CIR.Type, and neither are
22513         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22514         are all DeclSpaces, but no Types. 
22515
22516         * type.cs (TypeRefManager): This implements the TypeRef manager,
22517         which keeps track of all the types that need to be resolved after
22518         the parsing has finished. 
22519
22520 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22521
22522         * ARGH.  We are going to have to store `foreach' as a class rather
22523         than resolving it, as we need to verify error 1579 after name
22524         resolution.   *OR* we could keep a flag that says `This request to
22525         IEnumerator comes from a foreach statement' which we can then use
22526         to generate the error.
22527
22528 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22529
22530         * class.cs (TypeContainer.AddMethod): we now add methods to the
22531         MethodGroup instead of the method hashtable.  
22532
22533         * expression.cs: Add MethodGroup abstraction, which gets us one
22534         step closer to the specification in the way we handle method
22535         declarations.  
22536
22537         * cs-parser.jay (primary_expression): qualified_identifier now
22538         tried to match up an identifier to a local variable reference or
22539         to a parameter reference.
22540
22541         current_local_parameters is now a parser global variable that
22542         points to the current parameters for the block, used during name
22543         lookup.
22544
22545         (property_declaration): Now creates an implicit `value' argument to
22546         the set accessor.
22547
22548 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22549
22550         * parameter.cs: Do not use `param' arguments as part of the
22551         signature, per the spec.
22552
22553 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22554
22555         * decl.cs: Base class for classes, structs and interfaces.  This
22556         is the "Declaration Space" 
22557
22558         * cs-parser.jay: Use CheckDef for checking declaration errors
22559         instead of having one on each function.
22560
22561         * class.cs: Factor out some code for handling error handling in
22562         accordance to the "Declarations" section in the "Basic Concepts"
22563         chapter in the ECMA C# spec.
22564
22565         * interface.cs: Make all interface member classes derive from
22566         InterfaceMemberBase.
22567
22568 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22569
22570         * Many things: all interfaces are parsed and generated in
22571         gen-treedump.  Support for member variables, constructors,
22572         destructors, properties, constants is there.
22573
22574         Beginning of the IL backend, but very little done, just there for
22575         testing purposes. 
22576
22577 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22578
22579         * cs-parser.jay: Fix labeled statement.
22580
22581         * cs-tokenizer.cs (escape): Escape " and ' always.
22582         ref_line, ref_name: keep track of the line/filename as instructed
22583         by #line by the compiler.
22584         Parse #line.
22585
22586 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22587
22588         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22589         to match the values in System.CodeDOM.
22590
22591         Divid renamed to Divide.
22592
22593         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22594         statements. 
22595         (Statements.set): remove.
22596
22597         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22598         statements. 
22599
22600         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22601         falseStatements always have valid values. 
22602
22603         * cs-parser.jay: Use System.CodeDOM now.
22604